mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 03:35:21 +00:00
h265parser: select the right profile for high throughput SCC stream
Currently screen-extended-high-throughput-444 is recognized as screen-extended-main-444, screen-extended-high-throughput-444-10 is recognized as screen-extended-main-444-10 because they have the same extension flags, so without this patch, it is possible that a decoder which supports SCC but doesn't support throughput SCC will try to decode a throughput SCC stream. e.g. https://www.itu.int/wftp3/av-arch/jctvc-site/bitstream_exchange/draft_conformance/SCC/HT_A_SCC_Apple_2.zip Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1328>
This commit is contained in:
parent
2f5904c20d
commit
626af12498
2 changed files with 23 additions and 14 deletions
|
@ -3582,14 +3582,6 @@ get_screen_content_coding_extensions_profile (GstH265ProfileTierLevel * ptl)
|
|||
1, 1, 1, 1, 0, 0, 0, 0, 0, TRUE, 2},
|
||||
{GST_H265_PROFILE_SCREEN_EXTENDED_MAIN_444_10,
|
||||
1, 1, 1, 0, 0, 0, 0, 0, 0, TRUE, 3},
|
||||
/* identical to screen-extended-main-444 */
|
||||
{GST_H265_PROFILE_SCREEN_EXTENDED_HIGH_THROUGHPUT_444,
|
||||
1, 1, 1, 1, 0, 0, 0, 0, 0, TRUE, 4},
|
||||
/* identical to screen-extended-main-444-10 */
|
||||
{GST_H265_PROFILE_SCREEN_EXTENDED_HIGH_THROUGHPUT_444_10,
|
||||
1, 1, 1, 0, 0, 0, 0, 0, 0, TRUE, 5},
|
||||
{GST_H265_PROFILE_SCREEN_EXTENDED_HIGH_THROUGHPUT_444_14,
|
||||
1, 0, 0, 0, 0, 0, 0, 0, 0, TRUE, 6},
|
||||
};
|
||||
|
||||
return get_extension_profile (profiles, G_N_ELEMENTS (profiles), ptl);
|
||||
|
@ -3612,6 +3604,22 @@ get_scalable_format_range_extensions_profile (GstH265ProfileTierLevel * ptl)
|
|||
return get_extension_profile (profiles, G_N_ELEMENTS (profiles), ptl);
|
||||
}
|
||||
|
||||
static GstH265Profile
|
||||
get_screen_content_coding_extensions_high_throughput_profile
|
||||
(GstH265ProfileTierLevel * ptl)
|
||||
{
|
||||
static H265ExtensionProfile profiles[] = {
|
||||
{GST_H265_PROFILE_SCREEN_EXTENDED_HIGH_THROUGHPUT_444,
|
||||
1, 1, 1, 1, 0, 0, 0, 0, 0, TRUE, 0},
|
||||
{GST_H265_PROFILE_SCREEN_EXTENDED_HIGH_THROUGHPUT_444_10,
|
||||
1, 1, 1, 0, 0, 0, 0, 0, 0, TRUE, 1},
|
||||
{GST_H265_PROFILE_SCREEN_EXTENDED_HIGH_THROUGHPUT_444_14,
|
||||
1, 0, 0, 0, 0, 0, 0, 0, 0, TRUE, 2},
|
||||
};
|
||||
|
||||
return get_extension_profile (profiles, G_N_ELEMENTS (profiles), ptl);
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_h265_profile_tier_level_get_profile:
|
||||
* @ptl: a #GstH265ProfileTierLevel
|
||||
|
@ -3657,16 +3665,18 @@ gst_h265_profile_tier_level_get_profile (GstH265ProfileTierLevel * ptl)
|
|||
return get_3d_profile (ptl);
|
||||
|
||||
if (ptl->profile_idc == GST_H265_PROFILE_IDC_SCREEN_CONTENT_CODING
|
||||
|| ptl->profile_compatibility_flag[9]
|
||||
|| ptl->profile_idc ==
|
||||
GST_H265_PROFILE_IDC_HIGH_THROUGHPUT_SCREEN_CONTENT_CODING_EXTENSION
|
||||
|| ptl->profile_compatibility_flag[11])
|
||||
|| ptl->profile_compatibility_flag[9])
|
||||
return get_screen_content_coding_extensions_profile (ptl);
|
||||
|
||||
if (ptl->profile_idc == GST_H265_PROFILE_IDC_SCALABLE_FORMAT_RANGE_EXTENSION
|
||||
|| ptl->profile_compatibility_flag[10])
|
||||
return get_scalable_format_range_extensions_profile (ptl);
|
||||
|
||||
if (ptl->profile_idc ==
|
||||
GST_H265_PROFILE_IDC_HIGH_THROUGHPUT_SCREEN_CONTENT_CODING_EXTENSION
|
||||
|| ptl->profile_compatibility_flag[11])
|
||||
return get_screen_content_coding_extensions_high_throughput_profile (ptl);
|
||||
|
||||
return GST_H265_PROFILE_INVALID;
|
||||
}
|
||||
|
||||
|
|
|
@ -499,9 +499,8 @@ GST_START_TEST (test_h265_format_range_profiles_exact_match)
|
|||
|
||||
ptl.profile_idc = 11;
|
||||
set_format_range_fields (&ptl, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1);
|
||||
/* identical to screen-extended-main-444-10 */
|
||||
g_assert_cmpuint (gst_h265_profile_tier_level_get_profile (&ptl), ==,
|
||||
GST_H265_PROFILE_SCREEN_EXTENDED_MAIN_444_10);
|
||||
GST_H265_PROFILE_SCREEN_EXTENDED_HIGH_THROUGHPUT_444_10);
|
||||
}
|
||||
|
||||
GST_END_TEST;
|
||||
|
|
Loading…
Reference in a new issue