mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 09:55:36 +00:00
va: h264dec: Try to use ConstrainedBaseline or Main to decode BaseLine.
In the h264, the Baseline profile is widely misused. A lot of streams declare that they are the Baseline, but in fact they just conform to ConstrainedBaseline. The features such as FMO and ASO are not used at all. If the decoder does not strictly conforms to the SPEC, we can just use Baseline or Main profile to decode it to avoid lots of streams failure. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2428>
This commit is contained in:
parent
0b949ec07c
commit
364a2fe08e
1 changed files with 10 additions and 2 deletions
|
@ -602,13 +602,21 @@ _get_profile (GstVaH264Dec * self, const GstH264SPS * sps, gint max_dpb_size)
|
|||
|
||||
switch (sps->profile_idc) {
|
||||
case GST_H264_PROFILE_BASELINE:
|
||||
/* A.2 compliant */
|
||||
{
|
||||
GstH264DecoderCompliance compliance = GST_H264_DECODER_COMPLIANCE_STRICT;
|
||||
|
||||
g_object_get (G_OBJECT (self), "compliance", &compliance, NULL);
|
||||
|
||||
/* A.2 compliant or not strict */
|
||||
if (sps->constraint_set0_flag || sps->constraint_set1_flag
|
||||
|| sps->constraint_set2_flag) {
|
||||
|| sps->constraint_set2_flag
|
||||
|| compliance != GST_H264_DECODER_COMPLIANCE_STRICT) {
|
||||
profiles[i++] = VAProfileH264ConstrainedBaseline;
|
||||
profiles[i++] = VAProfileH264Main;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case GST_H264_PROFILE_EXTENDED:
|
||||
if (sps->constraint_set1_flag) { /* A.2.2 (main profile) */
|
||||
profiles[i++] = VAProfileH264Main;
|
||||
|
|
Loading…
Reference in a new issue