summaryrefslogtreecommitdiff
path: root/gst-libs
diff options
context:
space:
mode:
authorHe Junyan <junyan.he@intel.com>2020-07-14 18:13:56 +0800
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2020-07-20 16:26:32 +0000
commitf82850c6d387ba8e3a50465f564dffe0106f0523 (patch)
tree80a19b4811699d6fd369da6573ad53675634ae8d /gst-libs
parent7d3a19baceed25403e631fd6316c9a605d51ec10 (diff)
libs: decoder: H265: Add MAIN_12 profile supporting.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/359>
Diffstat (limited to 'gst-libs')
-rw-r--r--gst-libs/gst/vaapi/gstvaapidecoder_h265.c3
-rw-r--r--gst-libs/gst/vaapi/gstvaapiprofile.c2
-rw-r--r--gst-libs/gst/vaapi/gstvaapiprofile.h1
-rw-r--r--gst-libs/gst/vaapi/gstvaapiutils_h265.c24
-rw-r--r--gst-libs/gst/vaapi/video-format.c2
5 files changed, 31 insertions, 1 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_h265.c b/gst-libs/gst/vaapi/gstvaapidecoder_h265.c
index cd718f42..dc81c6ac 100644
--- a/gst-libs/gst/vaapi/gstvaapidecoder_h265.c
+++ b/gst-libs/gst/vaapi/gstvaapidecoder_h265.c
@@ -532,7 +532,8 @@ is_range_extension_profile (GstVaapiProfile profile)
{
if (profile == GST_VAAPI_PROFILE_H265_MAIN_422_10
|| profile == GST_VAAPI_PROFILE_H265_MAIN_444
- || profile == GST_VAAPI_PROFILE_H265_MAIN_444_10)
+ || profile == GST_VAAPI_PROFILE_H265_MAIN_444_10
+ || profile == GST_VAAPI_PROFILE_H265_MAIN12)
return TRUE;
return FALSE;
}
diff --git a/gst-libs/gst/vaapi/gstvaapiprofile.c b/gst-libs/gst/vaapi/gstvaapiprofile.c
index dc9b07ff..e1980e01 100644
--- a/gst-libs/gst/vaapi/gstvaapiprofile.c
+++ b/gst-libs/gst/vaapi/gstvaapiprofile.c
@@ -128,6 +128,8 @@ static const GstVaapiProfileMap gst_vaapi_profiles[] = {
"video/x-h265", "main-444"},
{GST_VAAPI_PROFILE_H265_MAIN_444_10, VAProfileHEVCMain444_10,
"video/x-h265", "main-444-10"},
+ {GST_VAAPI_PROFILE_H265_MAIN12, VAProfileHEVCMain12,
+ "video/x-h265", "main-12"},
{GST_VAAPI_PROFILE_H265_SCREEN_EXTENDED_MAIN, VAProfileHEVCSccMain,
"video/x-h265", "screen-extended-main"},
{GST_VAAPI_PROFILE_H265_SCREEN_EXTENDED_MAIN_10, VAProfileHEVCSccMain10,
diff --git a/gst-libs/gst/vaapi/gstvaapiprofile.h b/gst-libs/gst/vaapi/gstvaapiprofile.h
index 3d2e42ea..c3080f4e 100644
--- a/gst-libs/gst/vaapi/gstvaapiprofile.h
+++ b/gst-libs/gst/vaapi/gstvaapiprofile.h
@@ -189,6 +189,7 @@ typedef enum {
GST_VAAPI_MAKE_PROFILE(H265,9),
GST_VAAPI_PROFILE_H265_SCREEN_EXTENDED_MAIN_444_10 =
GST_VAAPI_MAKE_PROFILE(H265,10),
+ GST_VAAPI_PROFILE_H265_MAIN12 = GST_VAAPI_MAKE_PROFILE(H265,11),
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),
diff --git a/gst-libs/gst/vaapi/gstvaapiutils_h265.c b/gst-libs/gst/vaapi/gstvaapiutils_h265.c
index 7f6c7437..06597bfc 100644
--- a/gst-libs/gst/vaapi/gstvaapiutils_h265.c
+++ b/gst-libs/gst/vaapi/gstvaapiutils_h265.c
@@ -241,6 +241,27 @@ gst_vaapi_utils_h265_get_profile (GstH265SPS * sps)
/* Main 422_10 Intra, recognize it as MAIN_422_10 */
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 == 0
+ && sps->profile_tier_level.max_8bit_constraint_flag == 0
+ && sps->profile_tier_level.max_422chroma_constraint_flag == 1
+ && sps->profile_tier_level.max_420chroma_constraint_flag == 1
+ && 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) {
+ profile = GST_VAAPI_PROFILE_H265_MAIN12;
+ break;
+ } else if (sps->profile_tier_level.max_12bit_constraint_flag == 1
+ && sps->profile_tier_level.max_10bit_constraint_flag == 0
+ && sps->profile_tier_level.max_8bit_constraint_flag == 0
+ && sps->profile_tier_level.max_422chroma_constraint_flag == 1
+ && sps->profile_tier_level.max_420chroma_constraint_flag == 1
+ && sps->profile_tier_level.max_monochrome_constraint_flag == 0
+ && sps->profile_tier_level.intra_constraint_flag == 1
+ && sps->profile_tier_level.one_picture_only_constraint_flag == 0) {
+ /* Main 12 Intra, recognize it as MAIN12 */
+ profile = GST_VAAPI_PROFILE_H265_MAIN12;
+ break;
}
case GST_H265_PROFILE_IDC_SCREEN_CONTENT_CODING:
if (sps->profile_tier_level.max_14bit_constraint_flag == 1
@@ -458,6 +479,8 @@ gst_vaapi_utils_h265_get_chroma_type (guint chroma_format_idc,
chroma_type = GST_VAAPI_CHROMA_TYPE_YUV420;
else if (depth > 8 && depth <= 10)
chroma_type = GST_VAAPI_CHROMA_TYPE_YUV420_10BPP;
+ else if (depth > 10 && depth <= 12)
+ chroma_type = GST_VAAPI_CHROMA_TYPE_YUV420_12BPP;
break;
case 2:
if (depth == 8)
@@ -493,6 +516,7 @@ gst_vaapi_utils_h265_get_chroma_format_idc (GstVaapiChromaType chroma_type)
break;
case GST_VAAPI_CHROMA_TYPE_YUV420:
case GST_VAAPI_CHROMA_TYPE_YUV420_10BPP:
+ case GST_VAAPI_CHROMA_TYPE_YUV420_12BPP:
chroma_format_idc = 1;
break;
case GST_VAAPI_CHROMA_TYPE_YUV422:
diff --git a/gst-libs/gst/vaapi/video-format.c b/gst-libs/gst/vaapi/video-format.c
index 5b22054e..7fb1b1a5 100644
--- a/gst-libs/gst/vaapi/video-format.c
+++ b/gst-libs/gst/vaapi/video-format.c
@@ -445,6 +445,8 @@ gst_vaapi_video_format_from_chroma (guint chroma_type)
return GST_VIDEO_FORMAT_NV12;
case GST_VAAPI_CHROMA_TYPE_YUV420_10BPP:
return GST_VIDEO_FORMAT_P010_10LE;
+ case GST_VAAPI_CHROMA_TYPE_YUV420_12BPP:
+ return GST_VIDEO_FORMAT_P012_LE;
case GST_VAAPI_CHROMA_TYPE_YUV444:
return GST_VIDEO_FORMAT_VUYA;
case GST_VAAPI_CHROMA_TYPE_YUV422_10BPP: