[libav-commits] qsvdec: Pass field order information to libmfx

Mark Thompson git at libav.org
Mon Nov 14 20:59:30 CET 2016


Module: libav
Branch: master
Commit: 030d84fa2e35af0e77516735de35bf1a52371c86

Author:    Mark Thompson <sw at jkqxz.net>
Committer: Mark Thompson <sw at jkqxz.net>
Date:      Wed Oct 26 21:27:49 2016 +0100

qsvdec: Pass field order information to libmfx

The VC-1 decoder fails to initialise if this is not set.

---

 libavcodec/qsvdec.c |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c
index 9b5dc1d..d61ec7d 100644
--- a/libavcodec/qsvdec.c
+++ b/libavcodec/qsvdec.c
@@ -155,6 +155,21 @@ static int qsv_decode_init(AVCodecContext *avctx, QSVContext *q)
     param.mfx.FrameInfo.Height         = frame_height;
     param.mfx.FrameInfo.ChromaFormat   = MFX_CHROMAFORMAT_YUV420;
 
+    switch (avctx->field_order) {
+    case AV_FIELD_PROGRESSIVE:
+        param.mfx.FrameInfo.PicStruct = MFX_PICSTRUCT_PROGRESSIVE;
+        break;
+    case AV_FIELD_TT:
+        param.mfx.FrameInfo.PicStruct = MFX_PICSTRUCT_FIELD_TFF;
+        break;
+    case AV_FIELD_BB:
+        param.mfx.FrameInfo.PicStruct = MFX_PICSTRUCT_FIELD_BFF;
+        break;
+    default:
+        param.mfx.FrameInfo.PicStruct = MFX_PICSTRUCT_UNKNOWN;
+        break;
+    }
+
     param.IOPattern   = q->iopattern;
     param.AsyncDepth  = q->async_depth;
     param.ExtParam    = q->ext_buffers;
@@ -485,6 +500,7 @@ int ff_qsv_process_data(AVCodecContext *avctx, QSVContext *q,
         avctx->height       = q->parser->height;
         avctx->coded_width  = q->parser->coded_width;
         avctx->coded_height = q->parser->coded_height;
+        avctx->field_order  = q->parser->field_order;
         avctx->level        = q->avctx_internal->level;
         avctx->profile      = q->avctx_internal->profile;
 



More information about the libav-commits mailing list