msdk: map Y212_LE to MFX_FOURCC_Y216

MFX_FOURCC_Y216 is used for packed 12 bits 422 YUV format in MediaSDK
This commit is contained in:
Haihao Xiang 2020-03-11 13:54:42 +08:00
parent 950aa3d1db
commit fb200ccfdd
2 changed files with 4 additions and 0 deletions

View file

@ -142,6 +142,7 @@ ensure_data (GstMsdkSystemMemory * mem)
mem->surface->Data.Pitch = mem->destination_pitches[0]; mem->surface->Data.Pitch = mem->destination_pitches[0];
break; break;
case GST_VIDEO_FORMAT_Y210: case GST_VIDEO_FORMAT_Y210:
case GST_VIDEO_FORMAT_Y212_LE:
mem->surface->Data.Y = mem->cached_data[0]; mem->surface->Data.Y = mem->cached_data[0];
mem->surface->Data.U = mem->surface->Data.Y + 2; mem->surface->Data.U = mem->surface->Data.Y + 2;
mem->surface->Data.V = mem->surface->Data.Y + 6; mem->surface->Data.V = mem->surface->Data.Y + 6;

View file

@ -70,6 +70,8 @@ static const struct map gst_msdk_video_format_to_mfx_map[] = {
#if (MFX_VERSION >= 1031) #if (MFX_VERSION >= 1031)
/* P016 is used for semi-planar 12 bits format in MSDK */ /* P016 is used for semi-planar 12 bits format in MSDK */
GST_VIDEO_INFO_TO_MFX_MAP (P012_LE, YUV420, P016), GST_VIDEO_INFO_TO_MFX_MAP (P012_LE, YUV420, P016),
/* Y216 is used for 12bit 4:2:2 format in MSDK */
GST_VIDEO_INFO_TO_MFX_MAP (Y212_LE, YUV422, Y216),
#endif #endif
{0, 0, 0} {0, 0, 0}
}; };
@ -362,6 +364,7 @@ gst_msdk_set_mfx_frame_info_from_video_info (mfxFrameInfo * mfx_info,
#if (MFX_VERSION >= 1031) #if (MFX_VERSION >= 1031)
case MFX_FOURCC_P016: case MFX_FOURCC_P016:
case MFX_FOURCC_Y216:
mfx_info->BitDepthLuma = 12; mfx_info->BitDepthLuma = 12;
mfx_info->BitDepthChroma = 12; mfx_info->BitDepthChroma = 12;
mfx_info->Shift = 1; mfx_info->Shift = 1;