[Bug 732266] vaapidecode: h264: add support for decoding SVC base layers only
GStreamer (GNOME Bugzilla)
bugzilla at gnome.org
Mon Aug 14 13:39:02 UTC 2017
https://bugzilla.gnome.org/show_bug.cgi?id=732266
--- Comment #1 from Orestis Floros <orestisf1993 at gmail.com> ---
SVC streams proved to be a bit tricky. Following the same method I used in bug
732265 doesn't work and so I try to flag NAL units 14, 15 and 20 with
GST_VAAPI_DECODER_UNIT_FLAG_SKIP in gst_vaapi_decoder_h264_parse().
The problem I am facing right now is with the
GST_VAAPI_DECODER_UNIT_FLAG_FRAME_END flag.
h264parse uses the whole stream and doesn't "detect" AU start and end
correctly, this means that at_au_end is not reliable. For example, in SVC
conformance bitstream SVCHMTS-1-L3.264 a sequence of NAL units goes like this
(where START means that GST_VAAPI_DECODER_UNIT_FLAG_FRAME_START is set and END
means that GST_VAAPI_DECODER_UNIT_FLAG_FRAME_END is set):
1. nalu 14 flags: START=1 END=0 <-- marked to be skipped
2. nalu 05 flags: START=1 END=1
3. nalu 14 flags: START=1 END=0 <-- marked to be skipped
4. nalu 05 flags: START=0 END=0
5. nalu 20 flags: START=0 END=0 <-- marked to be skipped
6. nalu 20 flags: START=0 END=0 <-- marked to be skipped
7. nalu 20 flags: START=0 END=1 <-- marked to be skipped
Now, if I remove the 14, 15, 20 units from the file before executing (a stream
that uses the main profile) the same sequence becomes:
1. nalu 5 flags: START=1 END=0
2. nalu 5 flags: START=0 END=1
It's not hard to correct the flags with the following logic (only to be used
for SVC streams):
- Mark 14, 15, 20 units as skippable and set their FRAME_START and FRAME_END
flags to 0.
- Skip the gst_vaapi_parser_info_h264_replace (&priv->prev_pi, pi) line for
units 14, 15, 20 so that prev_pi links to units that aren't going to be skipped
(shouldn't this be the default behavior btw?).
- Ignore at_au_end.
- Use is_new_picture() and is_new_access_unit() to detect FRAME_START and then
mark the previous slice as FRAME_END with prev_slice_pi.
The problem with this is that the way gstvaapidecoder.c works:
1. FRAME_END only has an effect immediately after
gst_vaapi_decoder_h264_parse() is called. If a previous unit is flagged nothing
happens.
2. It's not possible to take a peek at the next units (afaik). This is the way
h264parse does it and the way I made SVC streams to work for bug 732267: search
NAL units in the data stream until you find an Annex-A one and then use
gst_h264_parse_collect_nal()'s logic to determine AU endings.
Any ideas?
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
More information about the gstreamer-bugs
mailing list