buildroot/package/bento4/0012-Static-ReadGolomb-Sign...

55 lines
2.0 KiB
Diff

From 91e148a9c53811447d35c36d9f11f767d49477a0 Mon Sep 17 00:00:00 2001
From: Glenn Guy <glennguy83@gmail.com>
Date: Thu, 22 Jul 2021 11:04:26 +0200
Subject: [PATCH] Static ReadGolomb/SignedGolomb
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
Source/C++/Codecs/Ap4AvcParser.cpp | 8 ++++----
Source/C++/Codecs/Ap4AvcParser.h | 3 +++
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/Source/C++/Codecs/Ap4AvcParser.cpp b/Source/C++/Codecs/Ap4AvcParser.cpp
index cfa841d..a17b698 100644
--- a/Source/C++/Codecs/Ap4AvcParser.cpp
+++ b/Source/C++/Codecs/Ap4AvcParser.cpp
@@ -191,8 +191,8 @@ AP4_AvcFrameParser::~AP4_AvcFrameParser()
/*----------------------------------------------------------------------
| ReadGolomb
+---------------------------------------------------------------------*/
-static unsigned int
-ReadGolomb(AP4_BitReader& bits)
+unsigned int
+AP4_AvcFrameParser::ReadGolomb(AP4_BitReader& bits)
{
unsigned int leading_zeros = 0;
while (bits.ReadBit() == 0) {
@@ -209,8 +209,8 @@ ReadGolomb(AP4_BitReader& bits)
/*----------------------------------------------------------------------
| SignedGolomb
+---------------------------------------------------------------------*/
-static int
-SignedGolomb(unsigned int code_num)
+int
+AP4_AvcFrameParser::SignedGolomb(unsigned int code_num)
{
if (code_num % 2) {
return (code_num+1)/2;
diff --git a/Source/C++/Codecs/Ap4AvcParser.h b/Source/C++/Codecs/Ap4AvcParser.h
index 99c5320..0c74c0e 100644
--- a/Source/C++/Codecs/Ap4AvcParser.h
+++ b/Source/C++/Codecs/Ap4AvcParser.h
@@ -321,6 +321,9 @@ public:
unsigned int nal_ref_idc,
AP4_AvcSliceHeader& slice_header);
+ static unsigned int ReadGolomb(AP4_BitReader& bits);
+ static int SignedGolomb(unsigned int code_num);
+
private:
// methods
bool SameFrame(unsigned int nal_unit_type_1, unsigned int nal_ref_idc_1, AP4_AvcSliceHeader& sh1,
--
2.30.2