This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit bd6e6f638ec3eb1cc8208e1a4db8f6d862816b56
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Fri Oct 23 17:39:52 2026 +0200
Commit:     michaelni <[email protected]>
CommitDate: Thu Nov 5 23:09:16 2026 +0000

    avcodec/golomb: read Golomb-Rice codes of up to 32 bits in get_ur_golomb()
    
    Add a FATE test that codes such a residual at every bit offset.
---
 libavcodec/golomb.h                      |  4 ++--
 tests/Makefile                           |  1 +
 tests/fate/ffv1.mak                      |  9 +++++++++
 tests/ref/fate/ffv1-golomb-float32-26bit | 15 +++++++++++++++
 4 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/libavcodec/golomb.h b/libavcodec/golomb.h
index 5169a5a4c0..48b9895ece 100644
--- a/libavcodec/golomb.h
+++ b/libavcodec/golomb.h
@@ -396,7 +396,7 @@ static inline int get_ur_golomb(GetBitContext *gb, int k, 
int limit,
     }
 #else
     OPEN_READER(re, gb);
-    UPDATE_CACHE(re, gb);
+    UPDATE_CACHE_32(re, gb);
     buf = GET_CACHE(re, gb);
 
     log = av_log2(buf);
@@ -411,7 +411,7 @@ static inline int get_ur_golomb(GetBitContext *gb, int k, 
int limit,
         return buf;
     } else {
         LAST_SKIP_BITS(re, gb, limit);
-        UPDATE_CACHE(re, gb);
+        UPDATE_CACHE_32(re, gb);
 
         buf = SHOW_UBITS(re, gb, esc_len);
 
diff --git a/tests/Makefile b/tests/Makefile
index 7d1597bdf7..beb53a54ca 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -201,6 +201,7 @@ include $(SRC_PATH)/tests/fate/astc.mak
 # Must be included after lavf-video.mak
 include $(SRC_PATH)/tests/fate/ffmpeg.mak
 include $(SRC_PATH)/tests/fate/ffprobe.mak
+include $(SRC_PATH)/tests/fate/ffv1.mak
 include $(SRC_PATH)/tests/fate/fifo-muxer.mak
 include $(SRC_PATH)/tests/fate/filter-audio.mak
 # Must be included after vcodec.mak
diff --git a/tests/fate/ffv1.mak b/tests/fate/ffv1.mak
new file mode 100644
index 0000000000..5175c8df96
--- /dev/null
+++ b/tests/fate/ffv1.mak
@@ -0,0 +1,9 @@
+FATE_FFV1_FLOAT32-$(call TRANSCODE, FFV1, NUT, LAVFI_INDEV 
WRAPPED_AVFRAME_DECODER COLOR_FILTER FORMAT_FILTER GEQ_FILTER SCALE_FILTER) += \
+    fate-ffv1-golomb-float32-26bit
+
+fate-ffv1-golomb-float32-26bit: CMD = transcode lavfi 
"color=black:s=352x288:r=1:d=8,format=gbrpf32,geq=r=X+Y*W:g=X+Y*W:b=X+W*if(lt(Y\,2*(25+N+floor(N/2)+2*floor(N/7))-4)\,if(mod(Y\,2)\,290-(25+N+floor(N/2)+2*floor(N/7))+(Y-1)/2\,290-2*(25+N+floor(N/2)+2*floor(N/7))+Y/2)\,if(eq(Y\,2*(25+N+floor(N/2)+2*floor(N/7))-4)\,19\,if(lt(Y\,2*(25+N+floor(N/2)+2*floor(N/7))+16)\,Y-2*(25+N+floor(N/2)+2*floor(N/7))+3\,if(lt(Y\,286)\,Y-2*(25+N+floor(N/2)+2*floor(N/7))+4\,Y-(25+N+floor(N/2)+2*floor(N/7)
 [...]
+    "-c:v ffv1 -strict experimental -coder 0 -remap_mode 1 -slices 1 -g 1" 
"-pix_fmt gbrpf32le -vf scale"
+
+FATE_FFMPEG += $(FATE_FFV1_FLOAT32-yes)
+fate-ffv1: $(FATE_FFV1_FLOAT32-yes)
+
diff --git a/tests/ref/fate/ffv1-golomb-float32-26bit 
b/tests/ref/fate/ffv1-golomb-float32-26bit
new file mode 100644
index 0000000000..3fe457cdcb
--- /dev/null
+++ b/tests/ref/fate/ffv1-golomb-float32-26bit
@@ -0,0 +1,15 @@
+451a0326abe6e7a074184d3410eef4ce *tests/data/fate/ffv1-golomb-float32-26bit.nut
+163524 tests/data/fate/ffv1-golomb-float32-26bit.nut
+#tb 0: 1/1
+#media_type 0: video
+#codec_id 0: rawvideo
+#dimensions 0: 352x288
+#sar 0: 1/1
+0,          0,          0,        1,  1216512, 0x65029b72
+0,          1,          1,        1,  1216512, 0xc7369b72
+0,          2,          2,        1,  1216512, 0x08bc9b72
+0,          3,          3,        1,  1216512, 0x05e29b72
+0,          4,          4,        1,  1216512, 0x027a9b72
+0,          5,          5,        1,  1216512, 0x4f1a9b72
+0,          6,          6,        1,  1216512, 0xe6829b72
+0,          7,          7,        1,  1216512, 0xc9809b72

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to