[FFmpeg-cvslog] avcodec/ffv1: Support >8bit rice golomb

Michael Niedermayer git at videolan.org
Sat Nov 16 14:33:30 EET 2024


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Wed Oct 16 18:49:31 2024 +0200| [a5c0ed2122a9efe06613e52f0ff3f1323bb10169] | committer: Michael Niedermayer

avcodec/ffv1: Support >8bit rice golomb

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a5c0ed2122a9efe06613e52f0ff3f1323bb10169
---

 libavcodec/ffv1.h    | 2 +-
 libavcodec/ffv1enc.c | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavcodec/ffv1.h b/libavcodec/ffv1.h
index 2af457be27..ca03fd2b10 100644
--- a/libavcodec/ffv1.h
+++ b/libavcodec/ffv1.h
@@ -54,8 +54,8 @@
 #define AC_RANGE_DEFAULT_TAB_FORCE -2
 
 typedef struct VlcState {
+    uint32_t error_sum;
     int16_t drift;
-    uint16_t error_sum;
     int8_t bias;
     uint8_t count;
 } VlcState;
diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c
index 0eef4cb63d..a97f9a0c3f 100644
--- a/libavcodec/ffv1enc.c
+++ b/libavcodec/ffv1enc.c
@@ -248,7 +248,7 @@ static inline void put_vlc_symbol(PutBitContext *pb, VlcState *const state,
         i += i;
     }
 
-    av_assert2(k <= 13);
+    av_assert2(k <= 16);
 
     code = v ^ ((2 * state->drift + state->count) >> 31);
 
@@ -707,10 +707,10 @@ static av_cold int encode_init(AVCodecContext *avctx)
     }
     av_assert0(s->bits_per_raw_sample >= 8);
 
-    if (s->bits_per_raw_sample > 8) {
+    if (s->bits_per_raw_sample > (s->version > 3 ? 16 : 8)) {
         if (s->ac == AC_GOLOMB_RICE) {
             av_log(avctx, AV_LOG_INFO,
-                    "bits_per_raw_sample > 8, forcing range coder\n");
+                    "high bits_per_raw_sample, forcing range coder\n");
             s->ac = AC_RANGE_CUSTOM_TAB;
         }
     }



More information about the ffmpeg-cvslog mailing list