[FFmpeg-devel] [PATCH] lavc/h264_slice: clarify informational message in case of disabled slice multi-threaded decoding

Ronald S. Bultje rsbultje at gmail.com
Tue Jun 10 17:17:48 CEST 2014


Hi,

On Tue, Jun 10, 2014 at 8:18 AM, Stefano Sabatini <stefasab at gmail.com>
wrote:

> In data Monday 2014-06-09 14:20:25 -0400, Ronald S. Bultje ha scritto:
> > Hi,
> >
> > On Mon, Jun 9, 2014 at 1:34 PM, Stefano Sabatini <stefasab at gmail.com>
> wrote:
> >
> > > Also suggest what can be done to workaround the limitation.
> > > ---
> > >  libavcodec/h264_slice.c | 3 ++-
> > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
> > > index 5f67b54..61064e3 100644
> > > --- a/libavcodec/h264_slice.c
> > > +++ b/libavcodec/h264_slice.c
> > > @@ -1873,7 +1873,8 @@ int ff_h264_decode_slice_header(H264Context *h,
> > > H264Context *h0)
> > >              h0->max_contexts = 1;
> > >              if (!h0->single_decode_warning) {
> > >                  av_log(h->avctx, AV_LOG_INFO,
> > > -                       "Cannot parallelize deblocking type 1, decoding
> > > such frames in sequential order\n");
> > > +                       "Cannot parallelize slice decoding with
> deblocking
> > > filter type 1, decoding such frames in sequential order\n"
> > > +                       "You can use flag2 +fast to enable it\n");
> > >                  h0->single_decode_warning = 1;
> > >              }
> > >              if (h != h0) {
> > > --
> > > 1.8.3.2
> >
> >
> > You should probably also make it clear that doing so will cause
> > nondeterministic output which violates the h264 spec?
>
> This should be apparent from fast flag documentation. But I can add:
>
> "You can use flag2 +fast to enable it, but this will generate
> non-spec-compliant output"
>
> > I mean, the more appropriate things to do are:
> > - if latency is acceptable, use some other form of threading (e.g.
> frame-mt)
>
> > - if latency is not acceptable (e.g. live videochat), use
> skip-slice-edges
> > loopfilter mode (in the encoder)
>
> Can't find a reference to such mode, can you provide a link or
> reference? What codecs provide such option?
>

This is 2 lines above what you patches: h->deblocking_filter == 2 (or in
the spec: disable_deblocking_filter_idc == 2) means deblock only edges that
don't cross slices. 1 means deblock all edges, even between slices (which
means you can't mt it if you use slice-mt). 0 means no deblocking.

I don't know what mode x264 uses from the top of my head.

Ronald


More information about the ffmpeg-devel mailing list