[FFmpeg-cvslog] mlpenc: fix lossless check error in number_sbits

Jai Luthra git at videolan.org
Tue Feb 4 12:37:26 EET 2020


ffmpeg | branch: master | Jai Luthra <me at jailuthra.in> | Fri Jan 24 16:21:30 2020 +0530| [c1c3916cec9ca627b9bff4a34683f66664ff787d] | committer: Paul B Mahol

mlpenc: fix lossless check error in number_sbits

we need two bits instead of one bit to represent -1 in bitstream

Signed-off-by: Jai Luthra <me at jailuthra.in>

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

 libavcodec/mlpenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/mlpenc.c b/libavcodec/mlpenc.c
index deb171645c..f4948451f1 100644
--- a/libavcodec/mlpenc.c
+++ b/libavcodec/mlpenc.c
@@ -466,7 +466,7 @@ static void default_decoding_params(MLPEncodeContext *ctx,
  */
 static int inline number_sbits(int number)
 {
-    if (number < 0)
+    if (number < -1)
         number++;
 
     return av_log2(FFABS(number)) + 1 + !!number;



More information about the ffmpeg-cvslog mailing list