Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWenbin Chen <wenbin.chen-at-intel.com@ffmpeg.org>2022-02-21 10:28:33 +0300
committerHaihao Xiang <haihao.xiang@intel.com>2022-02-28 07:39:52 +0300
commit4869ccb3f38a606401a1c3e3a31f18d35eb7dc39 (patch)
treeccde8122644c13c0548c6b565ce942041de52509 /libavcodec/qsvenc.c
parentd165ce22a4a7cc4ed60238ce8f3d5dcbbad3e266 (diff)
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>
Diffstat (limited to 'libavcodec/qsvenc.c')
-rw-r--r--libavcodec/qsvenc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 40d60cde3c..3008f329e5 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -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.AspectRatioW = avctx->sample_aspect_ratio.num;
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.BitDepthChroma = desc->comp[0].depth;
q->param.mfx.FrameInfo.Shift = desc->comp[0].depth > 8;