mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 09:10:36 +00:00
msdkmjpegenc: convert UYVY to YUY2 instead of NV12
Before this fix, the chroma subsampling of the output is 4:2:0. It is 4:2:2 with this fix, which is better for UYVY input
This commit is contained in:
parent
e1b8b81e84
commit
1dd3ef24b1
2 changed files with 19 additions and 6 deletions
|
@ -322,12 +322,21 @@ gst_msdkenc_init_encoder (GstMsdkEnc * thiz)
|
|||
|
||||
thiz->vpp_param.vpp.Out = thiz->vpp_param.vpp.In;
|
||||
|
||||
if (encoder_input_fmt == GST_VIDEO_FORMAT_P010_10LE) {
|
||||
switch (encoder_input_fmt) {
|
||||
case GST_VIDEO_FORMAT_P010_10LE:
|
||||
thiz->vpp_param.vpp.Out.FourCC = MFX_FOURCC_P010;
|
||||
thiz->vpp_param.vpp.Out.ChromaFormat = MFX_CHROMAFORMAT_YUV420;
|
||||
} else {
|
||||
break;
|
||||
|
||||
case GST_VIDEO_FORMAT_YUY2:
|
||||
thiz->vpp_param.vpp.Out.FourCC = MFX_FOURCC_YUY2;
|
||||
thiz->vpp_param.vpp.Out.ChromaFormat = MFX_CHROMAFORMAT_YUV422;
|
||||
break;
|
||||
|
||||
default:
|
||||
thiz->vpp_param.vpp.Out.FourCC = MFX_FOURCC_NV12;
|
||||
thiz->vpp_param.vpp.Out.ChromaFormat = MFX_CHROMAFORMAT_YUV420;
|
||||
break;
|
||||
}
|
||||
|
||||
/* validate parameters and allow the Media SDK to make adjustments */
|
||||
|
|
|
@ -141,6 +141,10 @@ gst_msdkmjpegenc_need_conversion (GstMsdkEnc * encoder, GstVideoInfo * info,
|
|||
case GST_VIDEO_FORMAT_BGRA:
|
||||
return FALSE;
|
||||
|
||||
case GST_VIDEO_FORMAT_UYVY:
|
||||
*out_format = GST_VIDEO_FORMAT_YUY2;
|
||||
return TRUE;
|
||||
|
||||
default:
|
||||
*out_format = GST_VIDEO_FORMAT_NV12;
|
||||
return TRUE;
|
||||
|
|
Loading…
Reference in a new issue