mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 06:58:56 +00:00
va: H265: Add odd bit depth and chroma depth in get_rtformat.
In H265, the stream may have odd bit depth such as 9 or 11. And the bit depth of luma and chroma may differ. For example, the stream with luma depth of 8 and chroma depth of 9 should use the 10 bit rtformat as the decoded picture format. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2420>
This commit is contained in:
parent
130205629f
commit
0c8d41b8b0
1 changed files with 9 additions and 4 deletions
|
@ -869,9 +869,12 @@ error:
|
||||||
|
|
||||||
static guint
|
static guint
|
||||||
_get_rtformat (GstVaH265Dec * self, guint8 bit_depth_luma,
|
_get_rtformat (GstVaH265Dec * self, guint8 bit_depth_luma,
|
||||||
guint8 chroma_format_idc)
|
guint8 bit_depth_chroma, guint8 chroma_format_idc)
|
||||||
{
|
{
|
||||||
switch (bit_depth_luma) {
|
guint8 bit_num = MAX (bit_depth_luma, bit_depth_chroma);
|
||||||
|
|
||||||
|
switch (bit_num) {
|
||||||
|
case 11:
|
||||||
case 12:
|
case 12:
|
||||||
if (chroma_format_idc == 3)
|
if (chroma_format_idc == 3)
|
||||||
return VA_RT_FORMAT_YUV444_12;
|
return VA_RT_FORMAT_YUV444_12;
|
||||||
|
@ -880,6 +883,7 @@ _get_rtformat (GstVaH265Dec * self, guint8 bit_depth_luma,
|
||||||
else
|
else
|
||||||
return VA_RT_FORMAT_YUV420_12;
|
return VA_RT_FORMAT_YUV420_12;
|
||||||
break;
|
break;
|
||||||
|
case 9:
|
||||||
case 10:
|
case 10:
|
||||||
if (chroma_format_idc == 3)
|
if (chroma_format_idc == 3)
|
||||||
return VA_RT_FORMAT_YUV444_10;
|
return VA_RT_FORMAT_YUV444_10;
|
||||||
|
@ -898,7 +902,8 @@ _get_rtformat (GstVaH265Dec * self, guint8 bit_depth_luma,
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
GST_ERROR_OBJECT (self, "Unsupported chroma format: %d "
|
GST_ERROR_OBJECT (self, "Unsupported chroma format: %d "
|
||||||
"(with depth luma: %d)", chroma_format_idc, bit_depth_luma);
|
"(with depth luma: %d, with depth chroma: %d)",
|
||||||
|
chroma_format_idc, bit_depth_luma, bit_depth_chroma);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1049,7 +1054,7 @@ gst_va_h265_dec_new_sequence (GstH265Decoder * decoder, const GstH265SPS * sps,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
rt_format = _get_rtformat (self, sps->bit_depth_luma_minus8 + 8,
|
rt_format = _get_rtformat (self, sps->bit_depth_luma_minus8 + 8,
|
||||||
sps->chroma_format_idc);
|
sps->bit_depth_chroma_minus8 + 8, sps->chroma_format_idc);
|
||||||
if (rt_format == 0)
|
if (rt_format == 0)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue