[Bug 732266] vaapidecode: h264: add support for decoding SVC base layers only

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Thu Aug 24 10:06:06 UTC 2017


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

--- Comment #42 from Orestis Floros <orestisf1993 at gmail.com> ---
(In reply to sreerenj from comment #40)
> (In reply to Orestis Floros from comment #38)
> > (In reply to sreerenj from comment #35)
> > > (In reply to Orestis Floros from comment #34)
> > > > Created attachment 358103 [details] [review] [review] [review] [review]
> > > > libs: decoder: h264: decode SVC base view only
> > > >
> > > > (In reply to sreerenj from comment #33)
> > > > > Review of attachment 358041 [details] [review] [review] [review] [review] [review]:
> > > > >
> > > > > ::: gst-libs/gst/vaapi/gstvaapidecoder_h264.c
> > > > > @@ +1793,3 @@
> > > > >
> > > > > +  if (priv->base_only && !GST_H264_IS_MVC_NALU (&pi->nalu))
> > > > > +    result = gst_h264_parse_sps (&pi->nalu, sps, FALSE);
> > > > >
> > > > > Why does it only for SVC? svc and mvc base-only mode should behave
> > > > > similarly. right?
> > > >
> > > > I don't know how I missed it, this part is buggy and breaks MVC streams with
> > > > base-only=TRUE right now. This patch should do it.
> > > >
> > > > I don't know why they behave differently here, I made the distinction
> > > > through trial and error.
> > >
> > > Hm, we need an explanation other than trial-and-error-fix-this.
> >
> > I think it is related to nalparser. I'd bet that it has something to do with
> > lack of SVC support in codecparsers/gsth264parser.c. This was the change
> > that fixed the issue from:
>
> Can you investigate for the real issue?

Why SVCHS-2.264 fails with
"lt-gst-launch-1.0: gen75_mfd.c:556: gen75_mfd_avc_img_state: Assertion
`pic_param->pic_fields.bits.field_pic_flag == 0' failed"
when this check isn't enabled:

The stream has one sps and one subset sps unit with the following
frame_mbs_only_flag values:

- sps: frame_mbs_only_flag=1
- subset: frame_mbs_only_flag=0

according to 7.3.3 - Slice header syntax:

if( !frame_mbs_only_flag ) {
    field_pic_flag
    if( field_pic_flag )
        bottom_field_flag
}


For the annex-A slices codecparsers/gsth264parser.c:2092 uses the subset sps
while it should have used the normal sps, thus !frame_mbs_only_flag == 1 and
field_pic_flag gets read.


I don't know why this causes problems for MVC streams:

diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_h264.c
b/gst-libs/gst/vaapi/gstvaapidecoder_h264.c
index e727a652..47482c3d 100644
--- a/gst-libs/gst/vaapi/gstvaapidecoder_h264.c
+++ b/gst-libs/gst/vaapi/gstvaapidecoder_h264.c
@@ -1793,7 +1793,7 @@ parse_subset_sps (GstVaapiDecoderH264 * decoder,
GstVaapiDecoderUnit * unit)

   if (priv->base_only)
     result = gst_h264_parse_sps (&pi->nalu, sps, FALSE);
-  if (!priv->base_only || !is_svc_profile (sps->profile_idc))
+  else
     result =
         gst_h264_parser_parse_subset_sps (priv->parser, &pi->nalu, sps, TRUE);
   if (result != GST_H264_PARSER_OK)


For example with MVCDS3.264 the pipeline freezes (at least on my end) and I
don't know how to debug it.

-- 
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