]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/golomb.h
0x00000103 is not an escape marker
[ffmpeg] / libavcodec / golomb.h
index a8221ec29bd334dd9251cee93282c8e961446db9..9bf7aec466bab312330916e20496324e96b07bc9 100644 (file)
@@ -3,18 +3,20 @@
  * Copyright (c) 2003 Michael Niedermayer <michaelni@gmx.at>
  * Copyright (c) 2004 Alex Beregszaszi
  *
- * This library is free software; you can redistribute it and/or
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
+ * version 2.1 of the License, or (at your option) any later version.
  *
- * This library is distributed in the hope that it will be useful,
+ * FFmpeg is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
+ * License along with FFmpeg; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  *
  */
@@ -443,6 +445,10 @@ static inline void set_ur_golomb_jpegls(PutBitContext *pb, int i, int k, int lim
         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);
     }