[FFmpeg-cvslog] avcodec/vvc/cabac: add 9.3.3.5 k-th order Exp - Golomb binarization process
Wu Jianhua
git at videolan.org
Sat May 17 06:18:43 EEST 2025
ffmpeg | branch: master | Wu Jianhua <toqsxw at outlook.com> | Wed May 14 21:40:08 2025 +0800| [02fe29fa396d6bc6d4595246ca9a7a299c5cf625] | committer: Nuo Mi
avcodec/vvc/cabac: add 9.3.3.5 k-th order Exp - Golomb binarization process
Signed-off-by: Wu Jianhua <toqsxw at outlook.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=02fe29fa396d6bc6d4595246ca9a7a299c5cf625
---
libavcodec/vvc/cabac.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/libavcodec/vvc/cabac.c b/libavcodec/vvc/cabac.c
index 5510144893..54055ed736 100644
--- a/libavcodec/vvc/cabac.c
+++ b/libavcodec/vvc/cabac.c
@@ -928,6 +928,27 @@ static int truncated_binary_decode(VVCLocalContext *lc, const int c_max)
return v;
}
+// 9.3.3.5 k-th order Exp - Golomb binarization process
+static int kth_order_egk_decode(CABACContext *c, int k)
+{
+ int bit = 1;
+ int value = 0;
+ int symbol = 0;
+
+ while (bit) {
+ bit = get_cabac_bypass(c);
+ value += bit << k++;
+ }
+
+ if (--k) {
+ for (int i = 0; i < k; i++)
+ symbol = (symbol << 1) | get_cabac_bypass(c);
+ value += symbol;
+ }
+
+ return value;
+}
+
// 9.3.3.6 Limited k-th order Exp-Golomb binarization process
static int limited_kth_order_egk_decode(CABACContext *c, const int k, const int max_pre_ext_len, const int trunc_suffix_len)
{
More information about the ffmpeg-cvslog
mailing list