]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/truemotion2.c
lavf/qsvvpp: bypass vpp if not needed.
[ffmpeg] / libavcodec / truemotion2.c
index 99884be4bbe9b83aa07f1630025a577eff42ec61..cc3b0b76e0149fb3e7d7dbda8c06d377cb52467d 100644 (file)
@@ -31,6 +31,7 @@
 #include "bswapdsp.h"
 #include "bytestream.h"
 #include "internal.h"
+#include "vlc.h"
 
 #define TM2_ESCAPE 0x80000000
 #define TM2_DELTAS 64
@@ -306,7 +307,7 @@ static int tm2_read_stream(TM2Context *ctx, const uint8_t *buf, int stream_id, i
             pos = bytestream2_tell(&gb);
             if (skip <= pos)
                 return AVERROR_INVALIDDATA;
-            bitstream_init(&ctx->bc, buf + pos, (skip - pos) * 8);
+            bitstream_init8(&ctx->bc, buf + pos, skip - pos);
             if ((ret = tm2_read_deltas(ctx, stream_id)) < 0)
                 return ret;
             bytestream2_skip(&gb, ((bitstream_tell(&ctx->bc) + 31) >> 5) << 2);
@@ -323,7 +324,7 @@ static int tm2_read_stream(TM2Context *ctx, const uint8_t *buf, int stream_id, i
     pos = bytestream2_tell(&gb);
     if (skip <= pos)
         return AVERROR_INVALIDDATA;
-    bitstream_init(&ctx->bc, buf + pos, (skip - pos) * 8);
+    bitstream_init8(&ctx->bc, buf + pos, skip - pos);
     if ((ret = tm2_build_huff_table(ctx, &codes)) < 0)
         return ret;
     bytestream2_skip(&gb, ((bitstream_tell(&ctx->bc) + 31) >> 5) << 2);
@@ -342,7 +343,7 @@ static int tm2_read_stream(TM2Context *ctx, const uint8_t *buf, int stream_id, i
         pos = bytestream2_tell(&gb);
         if (skip <= pos)
             return AVERROR_INVALIDDATA;
-        bitstream_init(&ctx->bc, buf + pos, (skip - pos) * 8);
+        bitstream_init8(&ctx->bc, buf + pos, skip - pos);
         for (i = 0; i < toks; i++) {
             if (bitstream_bits_left(&ctx->bc) <= 0) {
                 av_log(ctx->avctx, AV_LOG_ERROR, "Incorrect number of tokens: %i\n", toks);