ffmpeg | branch: master | Hendrik Leppkes <h.lepp...@gmail.com> | Mon Nov 14 15:20:09 2016 +0100| [68b0d7e0be66bfa8141f8bd3eaa004b8104b8c34] | committer: Hendrik Leppkes
Merge commit '924e2ecd2b7d51cca60c79351ef16b04dd4245c3' * commit '924e2ecd2b7d51cca60c79351ef16b04dd4245c3': qsvdec: when a frames ctx is supplied, use its frame dimensions Merged-by: Hendrik Leppkes <h.lepp...@gmail.com> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=68b0d7e0be66bfa8141f8bd3eaa004b8104b8c34 --- libavcodec/qsvdec.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c index e71af59..ea4abfa 100644 --- a/libavcodec/qsvdec.c +++ b/libavcodec/qsvdec.c @@ -91,6 +91,8 @@ static int qsv_decode_init(AVCodecContext *avctx, QSVContext *q) mfxSession session = NULL; int iopattern = 0; mfxVideoParam param = { { 0 } }; + int frame_width = avctx->coded_width; + int frame_height = avctx->coded_height; int ret; desc = av_pix_fmt_desc_get(avctx->sw_pix_fmt); @@ -122,6 +124,9 @@ static int qsv_decode_init(AVCodecContext *avctx, QSVContext *q) else if (frames_hwctx->frame_type & MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET) iopattern = MFX_IOPATTERN_OUT_VIDEO_MEMORY; } + + frame_width = frames_hwctx->surfaces[0].Info.Width; + frame_height = frames_hwctx->surfaces[0].Info.Height; } if (!iopattern) @@ -146,8 +151,8 @@ static int qsv_decode_init(AVCodecContext *avctx, QSVContext *q) param.mfx.FrameInfo.BitDepthChroma = desc->comp[0].depth; param.mfx.FrameInfo.Shift = desc->comp[0].depth > 8; param.mfx.FrameInfo.FourCC = q->fourcc; - param.mfx.FrameInfo.Width = avctx->coded_width; - param.mfx.FrameInfo.Height = avctx->coded_height; + param.mfx.FrameInfo.Width = frame_width; + param.mfx.FrameInfo.Height = frame_height; param.mfx.FrameInfo.ChromaFormat = MFX_CHROMAFORMAT_YUV420; switch (avctx->field_order) { ====================================================================== diff --cc libavcodec/qsvdec.c index e71af59,5b36489..ea4abfa --- a/libavcodec/qsvdec.c +++ b/libavcodec/qsvdec.c @@@ -146,25 -151,10 +151,25 @@@ static int qsv_decode_init(AVCodecConte param.mfx.FrameInfo.BitDepthChroma = desc->comp[0].depth; param.mfx.FrameInfo.Shift = desc->comp[0].depth > 8; param.mfx.FrameInfo.FourCC = q->fourcc; - param.mfx.FrameInfo.Width = avctx->coded_width; - param.mfx.FrameInfo.Height = avctx->coded_height; + param.mfx.FrameInfo.Width = frame_width; + 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; _______________________________________________ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog