mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-31 03:29:50 +00:00
Add 10 HEVC 10 bit decoding support
Only supporting vaapidecode ! vaapisink combination for now. Missing dependencies: 1: No support for P010 video format in GStreamer 2: No support for P010 vaGetImage()/vaPutimage() in vaapi-intel-driver 3: As a result of 1&2 , we have no support for Vaapi Video memory mapping through GstVideoMeta. Right now we only set chroma format (YUV420 with more than 8 bits per channel) for surface pool and keeping GST_VIDEO_FORMAT as ENCODED. The underlying format of the surfaces is implementation (driver) defined, which is P010.
This commit is contained in:
parent
9ccdbce4bd
commit
61045041c4
4 changed files with 12 additions and 7 deletions
|
@ -149,8 +149,9 @@ context_create_surfaces (GstVaapiContext * context)
|
|||
|
||||
if (!context->surfaces_pool) {
|
||||
context->surfaces_pool =
|
||||
gst_vaapi_surface_pool_new (GST_VAAPI_OBJECT_DISPLAY (context),
|
||||
GST_VIDEO_FORMAT_ENCODED, cip->width, cip->height);
|
||||
gst_vaapi_surface_pool_new_with_chroma_type (GST_VAAPI_OBJECT_DISPLAY (context),
|
||||
cip->chroma_type, cip->width, cip->height);
|
||||
|
||||
if (!context->surfaces_pool)
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
@ -1102,7 +1102,7 @@ ensure_context (GstVaapiDecoderH265 * decoder, GstH265SPS * sps)
|
|||
priv->profile = profile;
|
||||
}
|
||||
|
||||
chroma_type = gst_vaapi_utils_h265_get_chroma_type (sps->chroma_format_idc);
|
||||
chroma_type = gst_vaapi_utils_h265_get_chroma_type (sps->chroma_format_idc, sps->bit_depth_luma_minus8 + 8);
|
||||
if (!chroma_type) {
|
||||
GST_ERROR ("unsupported chroma_format_idc %u", sps->chroma_format_idc);
|
||||
return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CHROMA_FORMAT;
|
||||
|
|
|
@ -281,16 +281,19 @@ gst_vaapi_utils_h265_get_level_limits_table (guint * out_length_ptr)
|
|||
|
||||
/** Returns GstVaapiChromaType from H.265 chroma_format_idc value */
|
||||
GstVaapiChromaType
|
||||
gst_vaapi_utils_h265_get_chroma_type (guint chroma_format_idc)
|
||||
gst_vaapi_utils_h265_get_chroma_type (guint chroma_format_idc, guint luma_bit_depth)
|
||||
{
|
||||
GstVaapiChromaType chroma_type;
|
||||
GstVaapiChromaType chroma_type = (GstVaapiChromaType) 0;
|
||||
|
||||
switch (chroma_format_idc) {
|
||||
case 0:
|
||||
chroma_type = GST_VAAPI_CHROMA_TYPE_YUV400;
|
||||
break;
|
||||
case 1:
|
||||
chroma_type = GST_VAAPI_CHROMA_TYPE_YUV420;
|
||||
if (luma_bit_depth == 8)
|
||||
chroma_type = GST_VAAPI_CHROMA_TYPE_YUV420;
|
||||
else if (luma_bit_depth > 8)
|
||||
chroma_type = GST_VAAPI_CHROMA_TYPE_YUV420_10BPP;
|
||||
break;
|
||||
case 2:
|
||||
chroma_type = GST_VAAPI_CHROMA_TYPE_YUV422;
|
||||
|
@ -317,6 +320,7 @@ gst_vaapi_utils_h265_get_chroma_format_idc (GstVaapiChromaType chroma_type)
|
|||
chroma_format_idc = 0;
|
||||
break;
|
||||
case GST_VAAPI_CHROMA_TYPE_YUV420:
|
||||
case GST_VAAPI_CHROMA_TYPE_YUV420_10BPP:
|
||||
chroma_format_idc = 1;
|
||||
break;
|
||||
case GST_VAAPI_CHROMA_TYPE_YUV422:
|
||||
|
|
|
@ -93,7 +93,7 @@ gst_vaapi_utils_h265_get_level_limits_table (guint * out_length_ptr);
|
|||
/* Returns GstVaapiChromaType from H.265 chroma_format_idc value */
|
||||
G_GNUC_INTERNAL
|
||||
GstVaapiChromaType
|
||||
gst_vaapi_utils_h265_get_chroma_type (guint chroma_format_idc);
|
||||
gst_vaapi_utils_h265_get_chroma_type (guint chroma_format_idc, guint luma_bit_depth);
|
||||
|
||||
/* Returns H.265 chroma_format_idc value from GstVaapiChromaType */
|
||||
G_GNUC_INTERNAL
|
||||
|
|
Loading…
Reference in a new issue