[FFmpeg-cvslog] qcelp: Convert to the new bitstream reader

Alexandra Hájková git at videolan.org
Mon Apr 3 21:38:42 EEST 2017


ffmpeg | branch: master | Alexandra Hájková <alexandra at khirnov.net> | Tue Apr 12 18:39:16 2016 +0200| [0dabd329e84a6a7b074fa55da844fc827a47aa01] | committer: Anton Khirnov

qcelp: Convert to the new bitstream reader

Signed-off-by: Anton Khirnov <anton at khirnov.net>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0dabd329e84a6a7b074fa55da844fc827a47aa01
---

 libavcodec/qcelpdec.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/libavcodec/qcelpdec.c b/libavcodec/qcelpdec.c
index e9e7347..9d5e13a 100644
--- a/libavcodec/qcelpdec.c
+++ b/libavcodec/qcelpdec.c
@@ -31,9 +31,10 @@
 
 #include "libavutil/channel_layout.h"
 #include "libavutil/float_dsp.h"
+
 #include "avcodec.h"
+#include "bitstream.h"
 #include "internal.h"
-#include "get_bits.h"
 #include "qcelpdata.h"
 #include "celp_filters.h"
 #include "acelp_filters.h"
@@ -53,7 +54,7 @@ typedef enum {
 } qcelp_packet_rate;
 
 typedef struct QCELPContext {
-    GetBitContext     gb;
+    BitstreamContext  bc;
     qcelp_packet_rate bitrate;
     QCELPFrame        frame;    /**< unpacked data frame */
 
@@ -718,12 +719,12 @@ static int qcelp_decode_frame(AVCodecContext *avctx, void *data,
                                          qcelp_unpacking_bitmaps_lengths[q->bitrate];
         uint8_t *unpacked_data         = (uint8_t *)&q->frame;
 
-        init_get_bits(&q->gb, buf, 8 * buf_size);
+        bitstream_init(&q->bc, buf, 8 * buf_size);
 
         memset(&q->frame, 0, sizeof(QCELPFrame));
 
         for (; bitmaps < bitmaps_end; bitmaps++)
-            unpacked_data[bitmaps->index] |= get_bits(&q->gb, bitmaps->bitlen) << bitmaps->bitpos;
+            unpacked_data[bitmaps->index] |= bitstream_read(&q->bc, bitmaps->bitlen) << bitmaps->bitpos;
 
         // Check for erasures/blanks on rates 1, 1/4 and 1/8.
         if (q->frame.reserved) {



More information about the ffmpeg-cvslog mailing list