]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/put_bits.h
lavr: call mix_function_init() in ff_audio_mix_set_matrix()
[ffmpeg] / libavcodec / put_bits.h
index c10dd818f0b79ad35c2cf7003925028b1f39c784..f32b7fd060946924362862e060cbc2fefcbbae99 100644 (file)
@@ -78,7 +78,8 @@ static inline int put_bits_count(PutBitContext *s)
 static inline void flush_put_bits(PutBitContext *s)
 {
 #ifndef BITSTREAM_WRITER_LE
-    s->bit_buf<<= s->bit_left;
+    if (s->bit_left < 32)
+        s->bit_buf<<= s->bit_left;
 #endif
     while (s->bit_left < 32) {
         /* XXX: should test end of buffer */
@@ -96,28 +97,28 @@ static inline void flush_put_bits(PutBitContext *s)
 }
 
 #ifdef BITSTREAM_WRITER_LE
-#define align_put_bits align_put_bits_unsupported_here
-#define ff_put_string ff_put_string_unsupported_here
-#define ff_copy_bits ff_copy_bits_unsupported_here
+#define avpriv_align_put_bits align_put_bits_unsupported_here
+#define avpriv_put_string ff_put_string_unsupported_here
+#define avpriv_copy_bits avpriv_copy_bits_unsupported_here
 #else
 /**
  * Pad the bitstream with zeros up to the next byte boundary.
  */
-void align_put_bits(PutBitContext *s);
+void avpriv_align_put_bits(PutBitContext *s);
 
 /**
  * Put the string string in the bitstream.
  *
  * @param terminate_string 0-terminates the written string if value is 1
  */
-void ff_put_string(PutBitContext *pb, const char *string, int terminate_string);
+void avpriv_put_string(PutBitContext *pb, const char *string, int terminate_string);
 
 /**
  * Copy the content of src to the bitstream.
  *
  * @param length the number of bits of src to copy
  */
-void ff_copy_bits(PutBitContext *pb, const uint8_t *src, int length);
+void avpriv_copy_bits(PutBitContext *pb, const uint8_t *src, int length);
 #endif
 
 /**
@@ -129,13 +130,11 @@ static inline void put_bits(PutBitContext *s, int n, unsigned int value)
     unsigned int bit_buf;
     int bit_left;
 
-    //    printf("put_bits=%d %x\n", n, value);
     assert(n <= 31 && value < (1U << n));
 
     bit_buf = s->bit_buf;
     bit_left = s->bit_left;
 
-    //    printf("n=%d value=%x cnt=%d buf=%x\n", n, value, bit_cnt, bit_buf);
     /* XXX: optimize */
 #ifdef BITSTREAM_WRITER_LE
     bit_buf |= value << (32 - bit_left);
@@ -154,7 +153,6 @@ static inline void put_bits(PutBitContext *s, int n, unsigned int value)
         bit_buf<<=bit_left;
         bit_buf |= value >> (n - bit_left);
         AV_WB32(s->buf_ptr, bit_buf);
-        //printf("bitbuf = %08x\n", bit_buf);
         s->buf_ptr+=4;
         bit_left+=32 - n;
         bit_buf = value;