10l
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 13 Jul 2003 11:14:43 +0000 (11:14 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 13 Jul 2003 11:14:43 +0000 (11:14 +0000)
Originally committed as revision 2041 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/golomb.h

index 7c73f3bae6a29f2ad611bb9a0189e2f5ef3bc955..5ebebe94ceb6227de010b5f2f85580b4789c8d5c 100644 (file)
@@ -220,7 +220,7 @@ static inline int get_ur_golomb_jpegls(GetBitContext *gb, int k, int limit, int
 
     log= av_log2(buf);
     
-    if(log > 31-12){
+    if(log > 31-11){
         buf >>= log - k;
         buf += (30-log)<<k;
         LAST_SKIP_BITS(re, gb, 32 + k - log);
@@ -385,7 +385,8 @@ static inline void set_ur_golomb_jpegls(PutBitContext *pb, int i, int k, int lim
     e= (i>>k) + 1;
     if(e<limit){
         put_bits(pb, e, 1);
-        put_bits(pb, k, i&((1<<k)-1));
+        if(k)
+            put_bits(pb, k, i&((1<<k)-1));
     }else{
         put_bits(pb, limit  , 1);
         put_bits(pb, esc_len, i - 1);