]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/wnv1.c
qsv: Load the hw hevc plugin by default on Linux
[ffmpeg] / libavcodec / wnv1.c
index d0304c97ad60d09e402ce0bd0846bb4058cb3344..f498c20b47fc57641f032933e2ac95d09d667401 100644 (file)
  */
 
 #include "avcodec.h"
-#include "get_bits.h"
+#include "bitstream.h"
 #include "internal.h"
 #include "mathops.h"
+#include "vlc.h"
 
 
 typedef struct WNV1Context {
     AVCodecContext *avctx;
 
     int shift;
-    GetBitContext gb;
+    BitstreamContext bc;
 } WNV1Context;
 
 static const uint16_t code_tab[16][2] = {
@@ -49,10 +50,10 @@ static VLC code_vlc;
 /* returns modified base_value */
 static inline int wnv1_get_code(WNV1Context *w, int base_value)
 {
-    int v = get_vlc2(&w->gb, code_vlc.table, CODE_VLC_BITS, 1);
+    int v = bitstream_read_vlc(&w->bc, code_vlc.table, CODE_VLC_BITS, 1);
 
     if (v == 15)
-        return ff_reverse[get_bits(&w->gb, 8 - w->shift)];
+        return ff_reverse[bitstream_read(&w->bc, 8 - w->shift)];
     else
         return base_value + ((v - 7) << w->shift);
 }
@@ -90,7 +91,7 @@ static int decode_frame(AVCodecContext *avctx,
 
     for (i = 8; i < buf_size; i++)
         rbuf[i] = ff_reverse[buf[i]];
-    init_get_bits(&l->gb, rbuf + 8, (buf_size - 8) * 8);
+    bitstream_init8(&l->bc, rbuf + 8, buf_size - 8);
 
     if (buf[2] >> 4 == 6)
         l->shift = 2;