]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/vp5.c
qsvdec: only access hwaccel_context is the pixel format is QSV
[ffmpeg] / libavcodec / vp5.c
index 742262be054e48e19f98836e3ba02622744be8e6..3e14874ba44b2745b7f456b24f257de72870a2be 100644 (file)
@@ -27,7 +27,7 @@
 #include <string.h>
 
 #include "avcodec.h"
-#include "get_bits.h"
+#include "internal.h"
 
 #include "vp56.h"
 #include "vp56data.h"
@@ -67,7 +67,9 @@ static int vp5_parse_header(VP56Context *s, const uint8_t *buf, int buf_size,
         if (!s->macroblocks || /* first frame */
             16*cols != s->avctx->coded_width ||
             16*rows != s->avctx->coded_height) {
-            avcodec_set_dimensions(s->avctx, 16*cols, 16*rows);
+            int ret = ff_set_dimensions(s->avctx, 16 * cols, 16 * rows);
+            if (ret < 0)
+                return ret;
             return VP56_SIZE_CHANGE;
         }
     } else if (!s->macroblocks)
@@ -173,7 +175,7 @@ static void vp5_parse_coeff(VP56Context *s)
 {
     VP56RangeCoder *c = &s->c;
     VP56Model *model = s->modelp;
-    uint8_t *permute = s->scantable.permutated;
+    uint8_t *permute = s->idct_scantable;
     uint8_t *model1, *model2;
     int coeff, sign, coeff_idx;
     int b, i, cg, idx, ctx, ctx_last;
@@ -281,12 +283,12 @@ static av_cold int vp5_decode_init(AVCodecContext *avctx)
 
 AVCodec ff_vp5_decoder = {
     .name           = "vp5",
+    .long_name      = NULL_IF_CONFIG_SMALL("On2 VP5"),
     .type           = AVMEDIA_TYPE_VIDEO,
     .id             = AV_CODEC_ID_VP5,
     .priv_data_size = sizeof(VP56Context),
     .init           = vp5_decode_init,
     .close          = ff_vp56_free,
     .decode         = ff_vp56_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
-    .long_name      = NULL_IF_CONFIG_SMALL("On2 VP5"),
+    .capabilities   = AV_CODEC_CAP_DR1,
 };