The allocated frame size may be larger than the coded dimensions.
mfxSession session = NULL;
int iopattern = 0;
mfxVideoParam param = { { 0 } };
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);
int ret;
desc = av_pix_fmt_desc_get(avctx->sw_pix_fmt);
else if (frames_hwctx->frame_type & MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET)
iopattern = MFX_IOPATTERN_OUT_VIDEO_MEMORY;
}
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;
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.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;
param.IOPattern = q->iopattern;
param.mfx.FrameInfo.ChromaFormat = MFX_CHROMAFORMAT_YUV420;
param.IOPattern = q->iopattern;