You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
libavcodec/qsvenc: add more ChromaFormat support to mjpeg_qsv
ChromaForamt for mjpeg-qsv is always set to yuv420, and this will be wrong when encode other pixel format (for example yuyv422). ChromaFormat is changed to be adaptive to pix_fmt. Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
This commit is contained in:
committed by
Haihao Xiang
parent
d165ce22a4
commit
4869ccb3f3
@@ -616,7 +616,8 @@ static int init_video_param_jpeg(AVCodecContext *avctx, QSVEncContext *q)
|
|||||||
q->param.mfx.FrameInfo.CropH = avctx->height;
|
q->param.mfx.FrameInfo.CropH = avctx->height;
|
||||||
q->param.mfx.FrameInfo.AspectRatioW = avctx->sample_aspect_ratio.num;
|
q->param.mfx.FrameInfo.AspectRatioW = avctx->sample_aspect_ratio.num;
|
||||||
q->param.mfx.FrameInfo.AspectRatioH = avctx->sample_aspect_ratio.den;
|
q->param.mfx.FrameInfo.AspectRatioH = avctx->sample_aspect_ratio.den;
|
||||||
q->param.mfx.FrameInfo.ChromaFormat = MFX_CHROMAFORMAT_YUV420;
|
q->param.mfx.FrameInfo.ChromaFormat = MFX_CHROMAFORMAT_YUV420 +
|
||||||
|
!desc->log2_chroma_w + !desc->log2_chroma_h;
|
||||||
q->param.mfx.FrameInfo.BitDepthLuma = desc->comp[0].depth;
|
q->param.mfx.FrameInfo.BitDepthLuma = desc->comp[0].depth;
|
||||||
q->param.mfx.FrameInfo.BitDepthChroma = desc->comp[0].depth;
|
q->param.mfx.FrameInfo.BitDepthChroma = desc->comp[0].depth;
|
||||||
q->param.mfx.FrameInfo.Shift = desc->comp[0].depth > 8;
|
q->param.mfx.FrameInfo.Shift = desc->comp[0].depth > 8;
|
||||||
|
Reference in New Issue
Block a user