libs: dec: h265: support decode for main-444 10bit streams.

Add 444 10bit yuv format Y410, which can be used to decode
main-444 10bit streams. Currently, this feature is only
supported by media-driver in Icelake.
This commit is contained in:
Wangfei 2018-11-27 09:47:44 -05:00
parent d8b3c0495f
commit 5e7988b2d8
7 changed files with 24 additions and 3 deletions

View file

@ -92,6 +92,7 @@ vaapi_image_is_linear (const VAImage * va_image)
case VA_FOURCC ('X', 'B', 'G', 'R'):
case VA_FOURCC ('B', 'G', 'R', 'X'):
case VA_FOURCC ('Y', '2', '1', '0'):
case VA_FOURCC ('Y', '4', '1', '0'):
data_size = 4 * width * height;
break;
case VA_FOURCC ('P', '0', '1', '0'):

View file

@ -137,6 +137,8 @@ static const GstVaapiProfileMap gst_vaapi_profiles[] = {
"video/x-h265", "main-422-10"},
{GST_VAAPI_PROFILE_H265_MAIN_444, VAProfileHEVCMain444,
"video/x-h265", "main-444"},
{GST_VAAPI_PROFILE_H265_MAIN_444_10, VAProfileHEVCMain444_10,
"video/x-h265", "main-444-10"},
#endif
#if VA_CHECK_VERSION(0,38,0)
{GST_VAAPI_PROFILE_VP9_0, VAProfileVP9Profile0,

View file

@ -179,6 +179,7 @@ typedef enum {
GST_VAAPI_MAKE_PROFILE(H265,3),
GST_VAAPI_PROFILE_H265_MAIN_422_10 = GST_VAAPI_MAKE_PROFILE(H265,4),
GST_VAAPI_PROFILE_H265_MAIN_444 = GST_VAAPI_MAKE_PROFILE(H265,5),
GST_VAAPI_PROFILE_H265_MAIN_444_10 = GST_VAAPI_MAKE_PROFILE(H265,6),
GST_VAAPI_PROFILE_VP9_0 = GST_VAAPI_MAKE_PROFILE(VP9,1),
GST_VAAPI_PROFILE_VP9_1 = GST_VAAPI_MAKE_PROFILE(VP9,2),
GST_VAAPI_PROFILE_VP9_2 = GST_VAAPI_MAKE_PROFILE(VP9,3),

View file

@ -172,6 +172,17 @@ gst_vaapi_utils_h265_get_profile (GstH265SPS * sps)
&& sps->profile_tier_level.lower_bit_rate_constraint_flag == 1) {
profile = GST_VAAPI_PROFILE_H265_MAIN_444;
break;
} else if (sps->profile_tier_level.max_12bit_constraint_flag == 1
&& sps->profile_tier_level.max_10bit_constraint_flag == 1
&& sps->profile_tier_level.max_8bit_constraint_flag == 0
&& sps->profile_tier_level.max_422chroma_constraint_flag == 0
&& sps->profile_tier_level.max_420chroma_constraint_flag == 0
&& sps->profile_tier_level.max_monochrome_constraint_flag == 0
&& sps->profile_tier_level.intra_constraint_flag == 0
&& sps->profile_tier_level.one_picture_only_constraint_flag == 0
&& sps->profile_tier_level.lower_bit_rate_constraint_flag == 1) {
profile = GST_VAAPI_PROFILE_H265_MAIN_444_10;
break;
}
default:
GST_DEBUG ("unsupported profile_idc value");
@ -337,7 +348,10 @@ gst_vaapi_utils_h265_get_chroma_type (guint chroma_format_idc,
chroma_type = GST_VAAPI_CHROMA_TYPE_YUV422_10BPP;
break;
case 3:
chroma_type = GST_VAAPI_CHROMA_TYPE_YUV444;
if (luma_bit_depth == 8)
chroma_type = GST_VAAPI_CHROMA_TYPE_YUV444;
else if (luma_bit_depth > 8)
chroma_type = GST_VAAPI_CHROMA_TYPE_YUV444_10BPP;
break;
default:
GST_DEBUG ("unsupported chroma_format_idc value");

View file

@ -65,6 +65,7 @@ static const GstVideoFormatMap gst_vaapi_video_formats[] = {
DEF_YUV (YUY2, ('Y', 'U', 'Y', '2'), 16, 422),
DEF_YUV (UYVY, ('U', 'Y', 'V', 'Y'), 16, 422),
DEF_YUV (Y210, ('Y', '2', '1', '0'), 32, 422_10BPP),
DEF_YUV (Y410, ('Y', '4', '1', '0'), 32, 444_10BPP),
DEF_YUV (AYUV, ('A', 'Y', 'U', 'V'), 32, 444),
DEF_YUV (GRAY8, ('Y', '8', '0', '0'), 8, 400),
DEF_YUV (P010_10LE, ('P', '0', '1', '0'), 24, 420_10BPP),
@ -308,6 +309,8 @@ gst_vaapi_video_format_from_chroma (guint chroma_type)
return GST_VIDEO_FORMAT_AYUV;
case GST_VAAPI_CHROMA_TYPE_YUV422_10BPP:
return GST_VIDEO_FORMAT_Y210;
case GST_VAAPI_CHROMA_TYPE_YUV444_10BPP:
return GST_VIDEO_FORMAT_Y410;
default:
return GST_VIDEO_FORMAT_UNKNOWN;
}

View file

@ -87,7 +87,7 @@ static const char gst_vaapidecode_src_caps_str[] =
#if (USE_GLX || USE_EGL)
GST_VAAPI_MAKE_GLTEXUPLOAD_CAPS ";"
#endif
GST_VIDEO_CAPS_MAKE("{ NV12, I420, YV12, YUY2, UYVY, Y210, P010_10LE, AYUV }") ";"
GST_VIDEO_CAPS_MAKE("{ NV12, I420, YV12, YUY2, UYVY, Y210, P010_10LE, AYUV, Y410 }") ";"
GST_VAAPI_MAKE_DMABUF_CAPS;
static GstStaticPadTemplate gst_vaapidecode_src_factory =

View file

@ -105,7 +105,7 @@ gst_vaapi_caps_feature_contains (const GstCaps * caps,
#define GST_VAAPI_MAKE_SURFACE_CAPS \
GST_VIDEO_CAPS_MAKE_WITH_FEATURES( \
GST_CAPS_FEATURE_MEMORY_VAAPI_SURFACE, "{ ENCODED, NV12, I420, YV12, YUY2, UYVY, Y210, P010_10LE, AYUV }")
GST_CAPS_FEATURE_MEMORY_VAAPI_SURFACE, "{ ENCODED, NV12, I420, YV12, YUY2, UYVY, Y210, P010_10LE, AYUV, Y410 }")
#define GST_VAAPI_MAKE_GLTEXUPLOAD_CAPS \
GST_VIDEO_CAPS_MAKE_WITH_FEATURES( \