summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorHe Junyan <junyan.he@intel.com>2021-07-23 23:38:22 +0800
committerHe Junyan <junyan.he@intel.com>2021-09-13 21:51:12 +0800
commit364a2fe08e104b66c5d07a842d0c578ba9e17c72 (patch)
tree3c893a222080b25e3973fab4c8f8b0eb5110fb38 /sys
parent0b949ec07c590c1f03d6722961739f8b046c7143 (diff)
downloadgstreamer-plugins-bad-364a2fe08e104b66c5d07a842d0c578ba9e17c72.tar.gz
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>
Diffstat (limited to 'sys')
-rw-r--r--sys/va/gstvah264dec.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/va/gstvah264dec.c b/sys/va/gstvah264dec.c
index 4d342a880..aba8bab70 100644
--- a/sys/va/gstvah264dec.c
+++ b/sys/va/gstvah264dec.c
@@ -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;