msdk: Add main-422-12 profile to hevc

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6591>
This commit is contained in:
Mengkejiergeli Ba 2024-04-09 17:10:20 +08:00 committed by GStreamer Marge Bot
parent 83b1feb4f8
commit 49dee23e65
3 changed files with 16 additions and 2 deletions

View file

@ -85,7 +85,8 @@ static const Profile profs_hevc[] = {
{MFX_PROFILE_HEVC_MAIN, "main"}, {MFX_PROFILE_HEVC_MAIN, "main"},
{MFX_PROFILE_HEVC_MAIN10, "main-10, main-10-still-picture"}, {MFX_PROFILE_HEVC_MAIN10, "main-10, main-10-still-picture"},
{MFX_PROFILE_HEVC_MAINSP, "main-still-picture"}, {MFX_PROFILE_HEVC_MAINSP, "main-still-picture"},
{MFX_PROFILE_HEVC_REXT, "main-444, main-444-10, main-422-10, main-12"}, {MFX_PROFILE_HEVC_REXT,
"main-444, main-444-10, main-422-10, main-12, main-422-12"},
#if (MFX_VERSION >= 1032) #if (MFX_VERSION >= 1032)
{MFX_PROFILE_HEVC_SCC, "screen-extended-main, screen-extended-main-10, " {MFX_PROFILE_HEVC_SCC, "screen-extended-main, screen-extended-main-10, "
"screen-extended-main-444, screen-extended-main-444-10"}, "screen-extended-main-444, screen-extended-main-444-10"},

View file

@ -627,6 +627,13 @@ gst_msdkenc_init_encoder (GstMsdkEnc * thiz)
thiz->param.mfx.FrameInfo.BitDepthChroma = 12; thiz->param.mfx.FrameInfo.BitDepthChroma = 12;
thiz->param.mfx.FrameInfo.Shift = 1; thiz->param.mfx.FrameInfo.Shift = 1;
break; break;
case GST_VIDEO_FORMAT_Y212_LE:
thiz->param.mfx.FrameInfo.FourCC = MFX_FOURCC_Y216;
thiz->param.mfx.FrameInfo.ChromaFormat = MFX_CHROMAFORMAT_YUV422;
thiz->param.mfx.FrameInfo.BitDepthLuma = 12;
thiz->param.mfx.FrameInfo.BitDepthChroma = 12;
thiz->param.mfx.FrameInfo.Shift = 1;
break;
#endif #endif
default: default:
thiz->param.mfx.FrameInfo.FourCC = MFX_FOURCC_NV12; thiz->param.mfx.FrameInfo.FourCC = MFX_FOURCC_NV12;

View file

@ -386,7 +386,8 @@ gst_msdkh265enc_configure (GstMsdkEnc * encoder)
} else if (!strcmp (h265enc->profile_name, "main-444") || } else if (!strcmp (h265enc->profile_name, "main-444") ||
!strcmp (h265enc->profile_name, "main-422-10") || !strcmp (h265enc->profile_name, "main-422-10") ||
!strcmp (h265enc->profile_name, "main-444-10") || !strcmp (h265enc->profile_name, "main-444-10") ||
!strcmp (h265enc->profile_name, "main-12")) !strcmp (h265enc->profile_name, "main-12") ||
!strcmp (h265enc->profile_name, "main-422-12"))
encoder->param.mfx.CodecProfile = MFX_PROFILE_HEVC_REXT; encoder->param.mfx.CodecProfile = MFX_PROFILE_HEVC_REXT;
#if (MFX_VERSION >= 1032) #if (MFX_VERSION >= 1032)
@ -410,6 +411,7 @@ gst_msdkh265enc_configure (GstMsdkEnc * encoder)
#endif #endif
#if (MFX_VERSION >= 1031) #if (MFX_VERSION >= 1031)
case MFX_FOURCC_P016: case MFX_FOURCC_P016:
case MFX_FOURCC_Y216:
#endif #endif
encoder->param.mfx.CodecProfile = MFX_PROFILE_HEVC_REXT; encoder->param.mfx.CodecProfile = MFX_PROFILE_HEVC_REXT;
break; break;
@ -598,6 +600,10 @@ gst_msdkh265enc_set_src_caps (GstMsdkEnc * encoder)
gst_structure_set (structure, "profile", G_TYPE_STRING, "main-12", gst_structure_set (structure, "profile", G_TYPE_STRING, "main-12",
NULL); NULL);
break; break;
case MFX_FOURCC_Y216:
gst_structure_set (structure, "profile", G_TYPE_STRING, "main-422-12",
NULL);
break;
#endif #endif
default: default:
gst_structure_set (structure, "profile", G_TYPE_STRING, "main", NULL); gst_structure_set (structure, "profile", G_TYPE_STRING, "main", NULL);