[FFmpeg-cvslog] lagarith: Correctly compute hash_shift

Luca Barbato git at videolan.org
Tue Nov 10 17:44:15 CET 2015


ffmpeg | branch: master | Luca Barbato <lu_zero at gentoo.org> | Sun Nov  1 14:46:17 2015 +0100| [0b699920f3c0b2e30969b38ce59226653f9d80ec] | committer: Luca Barbato

lagarith: Correctly compute hash_shift

All the values are unsigned.

Bug-Id: 907
CC: libav-stable at libav.org

Signed-off-by: Luca Barbato <lu_zero at gentoo.org>

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

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

diff --git a/libavcodec/lagarithrac.c b/libavcodec/lagarithrac.c
index edfb18f..f9e4e5c 100644
--- a/libavcodec/lagarithrac.c
+++ b/libavcodec/lagarithrac.c
@@ -45,7 +45,7 @@ void ff_lag_rac_init(lag_rac *l, GetBitContext *gb, int length)
 
     l->range        = 0x80;
     l->low          = *l->bytestream >> 1;
-    l->hash_shift   = FFMAX(l->scale - 8, 0);
+    l->hash_shift   = FFMAX(l->scale, 8) - 8;
 
     for (i = j = 0; i < 256; i++) {
         unsigned r = i << l->hash_shift;



More information about the ffmpeg-cvslog mailing list