]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/get_bits.h
ra288: return error if input buffer is too small
[ffmpeg] / libavcodec / get_bits.h
index 210ccc7ca684ef07767b63a0a5c7f47ea9084566..d2ae3453156218533e330d29d9f2437a41bd54db 100644 (file)
@@ -1,20 +1,20 @@
 /*
  * copyright (c) 2004 Michael Niedermayer <michaelni@gmx.at>
  *
- * This file is part of FFmpeg.
+ * This file is part of Libav.
  *
- * FFmpeg is free software; you can redistribute it and/or
+ * Libav 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.1 of the License, or (at your option) any later version.
  *
- * FFmpeg is distributed in the hope that it will be useful,
+ * Libav 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 FFmpeg; if not, write to the Free Software
+ * License along with Libav; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
@@ -127,7 +127,7 @@ for examples see get_bits, show_bits, skip_bits, get_vlc
 
 #   define OPEN_READER(name, gb)                \
     unsigned int name##_index = (gb)->index;    \
-    int name##_cache          = 0
+    unsigned int av_unused name##_cache = 0
 
 #   define CLOSE_READER(name, gb) (gb)->index = name##_index
 
@@ -201,19 +201,11 @@ static inline void skip_bits_long(GetBitContext *s, int n){
         }                                                               \
     } while (0)
 
-#if ARCH_X86
-#   define SKIP_CACHE(name, gb, num)                            \
-    __asm__("shldl %2, %1, %0          \n\t"                    \
-            "shll  %2, %1              \n\t"                    \
-            : "+r" (name##_cache0), "+r" (name##_cache1)        \
-            : "Ic" ((uint8_t)(num)))
-#else
 #   define SKIP_CACHE(name, gb, num) do {               \
         name##_cache0 <<= (num);                        \
         name##_cache0 |= NEG_USR32(name##_cache1,num);  \
         name##_cache1 <<= (num);                        \
     } while (0)
-#endif
 
 #   define SKIP_COUNTER(name, gb, num) name##_bit_count += (num)
 
@@ -381,7 +373,7 @@ static inline int check_marker(GetBitContext *s, const char *msg)
 
 /**
  * init GetBitContext.
- * @param buffer bitstream buffer, must be FF_INPUT_BUFFER_PADDING_SIZE bytes larger then the actual read bits
+ * @param buffer bitstream buffer, must be FF_INPUT_BUFFER_PADDING_SIZE bytes larger than the actual read bits
  * because some optimized bitstream readers read 32 or 64 bit at once and could read over the end
  * @param bit_size the size of the buffer in bits
  *
@@ -504,7 +496,7 @@ void free_vlc(VLC *vlc);
 
 
 /**
- * parses a vlc code, faster then get_vlc()
+ * parses a vlc code, faster than get_vlc()
  * @param bits is the number of bits which will be read at once, must be
  *             identical to nb_bits in init_vlc()
  * @param max_depth is the number of times bits bits must be read to completely