vp9: add 16x16 idct avx2 (8-bit).
[ffmpeg.git] / libavcodec / qsvdec_h2645.c
index 569b765..fda827c 100644 (file)
@@ -82,9 +82,11 @@ static av_cold int qsv_decode_init(AVCodecContext *avctx)
         }
     }
 
-    if (avctx->codec_id == AV_CODEC_ID_H264)
+    if (avctx->codec_id == AV_CODEC_ID_H264) {
         s->bsf = av_bitstream_filter_init("h264_mp4toannexb");
-    else
+        //regarding ticks_per_frame description, should be 2 for h.264:
+        avctx->ticks_per_frame = 2;
+    } else
         s->bsf = av_bitstream_filter_init("hevc_mp4toannexb");
     if (!s->bsf) {
         ret = AVERROR(ENOMEM);
@@ -137,8 +139,8 @@ static int qsv_decode_frame(AVCodecContext *avctx, void *data,
 
 static void qsv_decode_flush(AVCodecContext *avctx)
 {
-//    QSVH2645Context *s = avctx->priv_data;
-    /* TODO: flush qsv engine if necessary */
+    QSVH2645Context *s = avctx->priv_data;
+    ff_qsv_decode_reset(avctx, &s->qsv);
 }
 
 #define OFFSET(x) offsetof(QSVH2645Context, x)
@@ -183,6 +185,9 @@ AVCodec ff_hevc_qsv_decoder = {
     .close          = qsv_decode_close,
     .capabilities   = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1,
     .priv_class     = &hevc_class,
+    .pix_fmts       = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12,
+                                                    AV_PIX_FMT_QSV,
+                                                    AV_PIX_FMT_NONE },
 };
 #endif
 
@@ -218,5 +223,8 @@ AVCodec ff_h264_qsv_decoder = {
     .close          = qsv_decode_close,
     .capabilities   = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1,
     .priv_class     = &class,
+    .pix_fmts       = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12,
+                                                    AV_PIX_FMT_QSV,
+                                                    AV_PIX_FMT_NONE },
 };
 #endif