From 8af9b4674882fed0100c5f553f458da2c9e16ce9 Mon Sep 17 00:00:00 2001 From: He Junyan Date: Thu, 30 Jul 2020 23:21:06 +0800 Subject: libs: decoder: H265: Add MAIN_444_12 profile supporting. Part-of: --- gst-libs/gst/vaapi/gstvaapidecoder_h265.c | 3 ++- gst-libs/gst/vaapi/gstvaapiprofile.c | 2 ++ gst-libs/gst/vaapi/gstvaapiprofile.h | 1 + gst-libs/gst/vaapi/gstvaapiutils_h265.c | 8 ++++++++ gst-libs/gst/vaapi/video-format.c | 2 ++ 5 files changed, 15 insertions(+), 1 deletion(-) (limited to 'gst-libs') diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_h265.c b/gst-libs/gst/vaapi/gstvaapidecoder_h265.c index fcbe5ce7..992c0c02 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_h265.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder_h265.c @@ -533,7 +533,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_MAIN12) + || profile == GST_VAAPI_PROFILE_H265_MAIN12 + || profile == GST_VAAPI_PROFILE_H265_MAIN_444_12) return TRUE; return FALSE; } diff --git a/gst-libs/gst/vaapi/gstvaapiprofile.c b/gst-libs/gst/vaapi/gstvaapiprofile.c index cbf2db57..0a538972 100644 --- a/gst-libs/gst/vaapi/gstvaapiprofile.c +++ b/gst-libs/gst/vaapi/gstvaapiprofile.c @@ -130,6 +130,8 @@ static const GstVaapiProfileMap gst_vaapi_profiles[] = { "video/x-h265", "main-444-10"}, {GST_VAAPI_PROFILE_H265_MAIN12, VAProfileHEVCMain12, "video/x-h265", "main-12"}, + {GST_VAAPI_PROFILE_H265_MAIN_444_12, VAProfileHEVCMain444_12, + "video/x-h265", "main-444-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 3ba23f69..38ec59ab 100644 --- a/gst-libs/gst/vaapi/gstvaapiprofile.h +++ b/gst-libs/gst/vaapi/gstvaapiprofile.h @@ -190,6 +190,7 @@ typedef enum { 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_H265_MAIN_444_12 = GST_VAAPI_MAKE_PROFILE(H265,12), 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 189f256e..44973a01 100644 --- a/gst-libs/gst/vaapi/gstvaapiutils_h265.c +++ b/gst-libs/gst/vaapi/gstvaapiutils_h265.c @@ -181,6 +181,11 @@ gst_vaapi_utils_h265_get_profile (GstH265SPS * sps) case GST_H265_PROFILE_MAIN_444_10_INTRA: vaapi_profile = GST_VAAPI_PROFILE_H265_MAIN_444_10; break; + case GST_H265_PROFILE_MAIN_444_12: + /* Main 444_12 Intra, recognize it as MAIN_444_12 */ + case GST_H265_PROFILE_MAIN_444_12_INTRA: + vaapi_profile = GST_VAAPI_PROFILE_H265_MAIN_444_12; + break; case GST_H265_PROFILE_SCREEN_EXTENDED_MAIN: vaapi_profile = GST_VAAPI_PROFILE_H265_SCREEN_EXTENDED_MAIN; break; @@ -375,6 +380,8 @@ gst_vaapi_utils_h265_get_chroma_type (guint chroma_format_idc, chroma_type = GST_VAAPI_CHROMA_TYPE_YUV444; else if (depth > 8 && depth <= 10) chroma_type = GST_VAAPI_CHROMA_TYPE_YUV444_10BPP; + else if (depth > 10 && depth <= 12) + chroma_type = GST_VAAPI_CHROMA_TYPE_YUV444_12BPP; break; default: break; @@ -407,6 +414,7 @@ gst_vaapi_utils_h265_get_chroma_format_idc (GstVaapiChromaType chroma_type) break; case GST_VAAPI_CHROMA_TYPE_YUV444: case GST_VAAPI_CHROMA_TYPE_YUV444_10BPP: + case GST_VAAPI_CHROMA_TYPE_YUV444_12BPP: chroma_format_idc = 3; break; default: diff --git a/gst-libs/gst/vaapi/video-format.c b/gst-libs/gst/vaapi/video-format.c index d189b6fd..fc81407f 100644 --- a/gst-libs/gst/vaapi/video-format.c +++ b/gst-libs/gst/vaapi/video-format.c @@ -467,6 +467,8 @@ gst_vaapi_video_format_from_chroma (guint chroma_type) return GST_VIDEO_FORMAT_Y210; case GST_VAAPI_CHROMA_TYPE_YUV444_10BPP: return GST_VIDEO_FORMAT_Y410; + case GST_VAAPI_CHROMA_TYPE_YUV444_12BPP: + return GST_VIDEO_FORMAT_Y412_LE; default: return GST_VIDEO_FORMAT_UNKNOWN; } -- cgit v1.2.3