summaryrefslogtreecommitdiff
path: root/gst-libs
diff options
context:
space:
mode:
authorHe Junyan <junyan.he@hotmail.com>2020-03-18 16:41:01 +0800
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2020-03-20 14:57:49 +0100
commit532a1e5509952ce018899b50a0412db9bbf8a614 (patch)
treecfd0bb6ec585dd4e6fc471eb67c7b723e96a0b01 /gst-libs
parenta28046a8dfc2e44c709525c52bc2cfd53a421b91 (diff)
libs,plugins: decoder: Add -intra profile support for hevc.
In hevc, we can consider the -intra profile a subset of the none -intra profile. The -intra profiles just contain I frames and we definitely can use the none -intra profiles's context to decode them. Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Diffstat (limited to 'gst-libs')
-rw-r--r--gst-libs/gst/vaapi/gstvaapiprofile.c9
-rw-r--r--gst-libs/gst/vaapi/gstvaapiutils_h265.c55
2 files changed, 64 insertions, 0 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapiprofile.c b/gst-libs/gst/vaapi/gstvaapiprofile.c
index 539ac9b3..3105b906 100644
--- a/gst-libs/gst/vaapi/gstvaapiprofile.c
+++ b/gst-libs/gst/vaapi/gstvaapiprofile.c
@@ -426,6 +426,15 @@ gst_vaapi_profile_from_caps (const GstCaps * caps)
/* HACK: qtdemux does not report profiles for h263 */
profile = m->profile;
}
+
+ /* Consider HEVC -intra profiles. Just map them to their
+ * non-intra profiles */
+ if (!profile && profile_str
+ && strncmp (name, "video/x-h265", namelen) == 0
+ && g_str_has_prefix (profile_str, m->profile_str)
+ && strncmp (profile_str + strlen (m->profile_str), "-intra", 6) == 0) {
+ profile = m->profile;
+ }
}
gst_caps_unref (caps_test);
}
diff --git a/gst-libs/gst/vaapi/gstvaapiutils_h265.c b/gst-libs/gst/vaapi/gstvaapiutils_h265.c
index 2c078e82..a276a7ba 100644
--- a/gst-libs/gst/vaapi/gstvaapiutils_h265.c
+++ b/gst-libs/gst/vaapi/gstvaapiutils_h265.c
@@ -184,6 +184,61 @@ 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_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 == 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 Intra, recognize it as MAIN */
+ profile = GST_VAAPI_PROFILE_H265_MAIN;
+ 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 == 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 10 Intra, recognize it as MAIN10 */
+ profile = GST_VAAPI_PROFILE_H265_MAIN10;
+ 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 == 1
+ && sps->profile_tier_level.one_picture_only_constraint_flag == 0) {
+ /* Main 444 Intra, recognize it as MAIN_444 */
+ 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 == 1
+ && sps->profile_tier_level.one_picture_only_constraint_flag == 0) {
+ /* Main 444_10 Intra, recognize it as MAIN_444_10 */
+ profile = GST_VAAPI_PROFILE_H265_MAIN_444_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 == 0
+ && sps->profile_tier_level.max_422chroma_constraint_flag == 1
+ && 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 == 1
+ && sps->profile_tier_level.one_picture_only_constraint_flag == 0) {
+ /* Main 422_10 Intra, recognize it as MAIN_422_10 */
+ profile = GST_VAAPI_PROFILE_H265_MAIN_422_10;
+ break;
}
default:
GST_DEBUG ("unsupported profile_idc value");