[FFmpeg-cvslog] libavcodec/qsvdec: use the parameter from decodeHeader to configure surface

Wenbin Chen git at videolan.org
Tue Feb 22 09:51:15 EET 2022


ffmpeg | branch: master | Wenbin Chen <wenbin.chen-at-intel.com at ffmpeg.org> | Fri Feb 11 10:37:36 2022 +0800| [b1c26ce9fe4da93e4ca4108a32f478ded7cfd428] | committer: Haihao Xiang

libavcodec/qsvdec: use the parameter from decodeHeader to configure surface

MSDK recognizes both yuv420p10 and yuv420p9 as MFX_FOURCC_P010, but
parameters are different. When decode yuv420p9 video, ffmpeg-qsv will use
yuv420p10le to configure surface which is different with param from
DecoderHeader and this will lead to error. Now change it use
param from decoderHeader to configure surface.

Signed-off-by: Wenbin Chen <wenbin.chen at intel.com>
Signed-off-by: Haihao Xiang <haihao.xiang at intel.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b1c26ce9fe4da93e4ca4108a32f478ded7cfd428
---

 libavcodec/qsvdec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c
index f81737ab6d..6236391357 100644
--- a/libavcodec/qsvdec.c
+++ b/libavcodec/qsvdec.c
@@ -423,13 +423,13 @@ static int alloc_frame(AVCodecContext *avctx, QSVContext *q, QSVFrame *frame)
     if (frame->frame->format == AV_PIX_FMT_QSV) {
         frame->surface = *(mfxFrameSurface1*)frame->frame->data[3];
     } else {
-        frame->surface.Info = q->frame_info;
-
         frame->surface.Data.PitchLow = frame->frame->linesize[0];
         frame->surface.Data.Y        = frame->frame->data[0];
         frame->surface.Data.UV       = frame->frame->data[1];
     }
 
+    frame->surface.Info = q->frame_info;
+
     if (q->frames_ctx.mids) {
         ret = ff_qsv_find_surface_idx(&q->frames_ctx, frame);
         if (ret < 0)



More information about the ffmpeg-cvslog mailing list