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:
Sreerenj Balachandran 2015-12-08 16:14:11 +02:00
parent 9ccdbce4bd
commit 61045041c4
4 changed files with 12 additions and 7 deletions

View file

@ -149,8 +149,9 @@ context_create_surfaces (GstVaapiContext * context)
if (!context->surfaces_pool) { if (!context->surfaces_pool) {
context->surfaces_pool = context->surfaces_pool =
gst_vaapi_surface_pool_new (GST_VAAPI_OBJECT_DISPLAY (context), gst_vaapi_surface_pool_new_with_chroma_type (GST_VAAPI_OBJECT_DISPLAY (context),
GST_VIDEO_FORMAT_ENCODED, cip->width, cip->height); cip->chroma_type, cip->width, cip->height);
if (!context->surfaces_pool) if (!context->surfaces_pool)
return FALSE; return FALSE;
} }

View file

@ -1102,7 +1102,7 @@ ensure_context (GstVaapiDecoderH265 * decoder, GstH265SPS * sps)
priv->profile = profile; 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) { if (!chroma_type) {
GST_ERROR ("unsupported chroma_format_idc %u", sps->chroma_format_idc); GST_ERROR ("unsupported chroma_format_idc %u", sps->chroma_format_idc);
return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CHROMA_FORMAT; return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_CHROMA_FORMAT;

View file

@ -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 */ /** Returns GstVaapiChromaType from H.265 chroma_format_idc value */
GstVaapiChromaType 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) { switch (chroma_format_idc) {
case 0: case 0:
chroma_type = GST_VAAPI_CHROMA_TYPE_YUV400; chroma_type = GST_VAAPI_CHROMA_TYPE_YUV400;
break; break;
case 1: 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; break;
case 2: case 2:
chroma_type = GST_VAAPI_CHROMA_TYPE_YUV422; 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; chroma_format_idc = 0;
break; break;
case GST_VAAPI_CHROMA_TYPE_YUV420: case GST_VAAPI_CHROMA_TYPE_YUV420:
case GST_VAAPI_CHROMA_TYPE_YUV420_10BPP:
chroma_format_idc = 1; chroma_format_idc = 1;
break; break;
case GST_VAAPI_CHROMA_TYPE_YUV422: case GST_VAAPI_CHROMA_TYPE_YUV422:

View file

@ -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 */ /* Returns GstVaapiChromaType from H.265 chroma_format_idc value */
G_GNUC_INTERNAL G_GNUC_INTERNAL
GstVaapiChromaType 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 */ /* Returns H.265 chroma_format_idc value from GstVaapiChromaType */
G_GNUC_INTERNAL G_GNUC_INTERNAL