Commit 5d0878b4 authored by wangfei's avatar wangfei Committed by Nicolas Dufresne
Browse files

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

Add 444 8bit yuv format AYUV, which can be used to decode
main-444 8bit streams. Currently, this feature is only
supported by media-driver in Icelake.

gstreamer/gstreamer-vaapi#119
parent b67fc3a5
Pipeline #8534 passed with stages
in 1 minute and 39 seconds
......@@ -135,6 +135,8 @@ static const GstVaapiProfileMap gst_vaapi_profiles[] = {
#if VA_CHECK_VERSION(1,2,0)
{GST_VAAPI_PROFILE_H265_MAIN_422_10, VAProfileHEVCMain422_10,
"video/x-h265", "main-422-10"},
{GST_VAAPI_PROFILE_H265_MAIN_444, VAProfileHEVCMain444,
"video/x-h265", "main-444"},
#endif
#if VA_CHECK_VERSION(0,38,0)
{GST_VAAPI_PROFILE_VP9_0, VAProfileVP9Profile0,
......@@ -336,6 +338,8 @@ gst_vaapi_profile_from_codec_data_h265 (GstBuffer * buffer)
return GST_VAAPI_PROFILE_H265_MAIN_STILL_PICTURE;
case 4:
return GST_VAAPI_PROFILE_H265_MAIN_422_10;
case 5:
return GST_VAAPI_PROFILE_H265_MAIN_444;
}
return 0;
}
......
......@@ -178,6 +178,7 @@ typedef enum {
GST_VAAPI_PROFILE_H265_MAIN_STILL_PICTURE =
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_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),
......
......@@ -230,6 +230,7 @@ string_of_VAProfile (VAProfile profile)
#endif
#if VA_CHECK_VERSION(1,2,0)
MAP (HEVCMain422_10);
MAP (HEVCMain444);
#endif
#if VA_CHECK_VERSION(0,37,1)
MAP (HEVCMain);
......
......@@ -161,6 +161,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_422_10;
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 == 1
&& 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;
break;
}
default:
GST_DEBUG ("unsupported profile_idc value");
......@@ -189,6 +200,9 @@ gst_vaapi_utils_h265_get_profile_idc (GstVaapiProfile profile)
case GST_VAAPI_PROFILE_H265_MAIN_422_10:
profile_idc = GST_H265_PROFILE_MAIN_422_10;
break;
case GST_VAAPI_PROFILE_H265_MAIN_444:
profile_idc = GST_H265_PROFILE_MAIN_444;
break;
default:
GST_DEBUG ("unsupported GstVaapiProfile value");
profile_idc = 0;
......
......@@ -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 }") ";"
GST_VIDEO_CAPS_MAKE("{ NV12, I420, YV12, YUY2, UYVY, Y210, P010_10LE, AYUV }") ";"
GST_VAAPI_MAKE_DMABUF_CAPS;
static GstStaticPadTemplate gst_vaapidecode_src_factory =
......
......@@ -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 }")
GST_CAPS_FEATURE_MEMORY_VAAPI_SURFACE, "{ ENCODED, NV12, I420, YV12, YUY2, UYVY, Y210, P010_10LE, AYUV }")
#define GST_VAAPI_MAKE_GLTEXUPLOAD_CAPS \
GST_VIDEO_CAPS_MAKE_WITH_FEATURES( \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment