libs: decoder: h264: decode SVC base layer only
authorOrestis Floros <orestisf1993@gmail.com>
Tue, 29 Aug 2017 00:32:57 +0000 (17:32 -0700)
committerSreerenj Balachandran <sreerenj.balachandran@intel.com>
Tue, 29 Aug 2017 00:32:57 +0000 (17:32 -0700)
commit09557528983edc36414e8d62b836fc012027db7a
treea88d7cdce053147f43c2f589f2a367ce324702bd
parenta016aa181b8239e11ab1795c2630c407a7d64811
libs: decoder: h264: decode SVC base layer only

Drops non-base NALs when the base-only property is set to TRUE.
This modifies the behavior for MVC streams with base-only too: All the
non-base units are dropped before they are decoded instead of dropping
the non-base frames.

The relevant part from the H264 spec is:
> Decoders that conform to one or more of the profiles specified in
Annex A rather than the profiles specified in Annexes G or H shall
ignore (remove from the bitstream and discard) the contents of all NAL
units with nal_unit_type equal to 14, 15, or 20.

To eliminate side effects from the offending units:
- PPS's with a broken seq_parameter_set_id (referring to dropped subset
SPS's) are ignored.
- The NAL parsing is skipped and their flags are set to
GST_VAAPI_DECODER_UNIT_FLAG_SKIP.
- Prefix units are not stored in prev_pi. Otherwise, parse_slice() would
use them even if they are flagged to be skipped. Subset SPS's and slice
extension units are not stored there either.

https://bugzilla.gnome.org/show_bug.cgi?id=732266

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
gst-libs/gst/vaapi/gstvaapidecoder_h264.c