[Ffmpeg-devel] [PATCH] handle limit>32 for set_ur_golomb_jpegls

Kostya kostya.shishkov
Sat Oct 21 14:32:24 CEST 2006


In coming version of 16-bit JPEG LS Golomb code prefixes may be greater
than 32 bits, so additional checks are needed.

Here is patch fixing set_ur_golomb_jpegls(), something is needed for
get_ur_golomb_jpegls() but I've not figured out what yet.
-------------- next part --------------
Index: libavcodec/golomb.h
===================================================================
--- libavcodec/golomb.h	(revision 6734)
+++ libavcodec/golomb.h	(working copy)
@@ -445,6 +445,10 @@
         if(k)
             put_bits(pb, k, i&((1<<k)-1));
     }else{
+        while(limit > 31) {
+            put_bits(pb, 31, 0);
+            limit -= 31;
+        }
         put_bits(pb, limit  , 1);
         put_bits(pb, esc_len, i - 1);
     }



More information about the ffmpeg-devel mailing list