[FFmpeg-cvslog] sonicenc: limit quant so that golomb codes are less than 32 bits long

Michael Niedermayer git at videolan.org
Tue Sep 18 17:54:16 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Sep 18 17:33:55 2012 +0200| [512beea52936f5935a0c6cdaef18364520ea5b7c] | committer: Michael Niedermayer

sonicenc: limit quant so that golomb codes are less than 32 bits long

before they could become 33 bits

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/sonic.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/sonic.c b/libavcodec/sonic.c
index acd7412..d412d60 100644
--- a/libavcodec/sonic.c
+++ b/libavcodec/sonic.c
@@ -724,8 +724,8 @@ static int sonic_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
 
         if (quant < 1)
             quant = 1;
-        if (quant > 65535)
-            quant = 65535;
+        if (quant > 65534)
+            quant = 65534;
 
         set_ue_golomb(&pb, quant);
 



More information about the ffmpeg-cvslog mailing list