[FFmpeg-cvslog] vp9_superframe_bsf: convert to the new bitstream reader

Anton Khirnov git at videolan.org
Tue Oct 31 04:25:26 EET 2017


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Wed Apr 26 09:25:05 2017 +0200| [126bc2c33b79c36bc23f43719d20f55b9b6771e9] | committer: Anton Khirnov

vp9_superframe_bsf: convert to the new bitstream reader

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

 libavcodec/vp9_superframe_bsf.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/libavcodec/vp9_superframe_bsf.c b/libavcodec/vp9_superframe_bsf.c
index be83ba3e75..869d7d4360 100644
--- a/libavcodec/vp9_superframe_bsf.c
+++ b/libavcodec/vp9_superframe_bsf.c
@@ -21,8 +21,8 @@
 
 #include "libavutil/avassert.h"
 #include "avcodec.h"
+#include "bitstream.h"
 #include "bsf.h"
-#include "get_bits.h"
 
 #define MAX_CACHE 8
 typedef struct VP9BSFContext {
@@ -101,7 +101,7 @@ static int merge_superframe(const struct CachedBuf *in, int n_in, AVPacket *out)
 
 static int vp9_superframe_filter(AVBSFContext *ctx, AVPacket *out)
 {
-    GetBitContext gb;
+    BitstreamContext bc;
     VP9BSFContext *s = ctx->priv_data;
     AVPacket *in;
     int res, invisible, profile, marker, uses_superframe_syntax = 0, n;
@@ -118,19 +118,21 @@ static int vp9_superframe_filter(AVBSFContext *ctx, AVPacket *out)
         uses_superframe_syntax = in->size >= idx_sz && in->data[in->size - idx_sz] == marker;
     }
 
-    if ((res = init_get_bits8(&gb, in->data, in->size)) < 0)
+    res = bitstream_init8(&bc, in->data, in->size);
+    if (res < 0)
         goto done;
 
-    get_bits(&gb, 2); // frame marker
-    profile  = get_bits1(&gb);
-    profile |= get_bits1(&gb) << 1;
-    if (profile == 3) profile += get_bits1(&gb);
+    bitstream_read(&bc, 2); // frame marker
+    profile  = bitstream_read(&bc, 1);
+    profile |= bitstream_read(&bc, 1) << 1;
+    if (profile == 3)
+        profile += bitstream_read(&bc, 1);
 
-    if (get_bits1(&gb)) {
+    if (bitstream_read(&bc, 1)) {
         invisible = 0;
     } else {
-        get_bits1(&gb); // keyframe
-        invisible = !get_bits1(&gb);
+        bitstream_read(&bc, 1); // keyframe
+        invisible = !bitstream_read(&bc, 1);
     }
 
     if (uses_superframe_syntax && s->n_cache > 0) {



More information about the ffmpeg-cvslog mailing list