[FFmpeg-devel] [PATCH] set ulMaxDisplayDelay cuvidec parser option to zero if low_delay flag is on

clime clime7 at gmail.com
Sat Feb 20 01:58:55 EET 2021


On Sat, 20 Feb 2021 at 00:38, clime <clime7 at gmail.com> wrote:
>
> On Sat, 20 Feb 2021 at 00:29, Timo Rothenpieler <timo at rothenpieler.org> wrote:
> >
> > On 19.02.2021 23:33, clime wrote:
> > >       ctx->cuparseinfo.ulMaxNumDecodeSurfaces = ctx->nb_surfaces;
> > > -    ctx->cuparseinfo.ulMaxDisplayDelay = 4;
> > > +    ctx->cuparseinfo.ulMaxDisplayDelay = avctx->flags & AV_CODEC_FLAG_LOW_DELAY ? 0 : 4;
> >
> > I'd prefer this with proper braces, to make sure no compiler gets the
> > crazy idea to evaluate this as avctx->flags & 4.
> >
> > Otherwise this is probably fine, but will severely gimp the performance,
> > to the point that it might not even be able to sustain 60 FPS anymore.
> > Printing a warning might be in order.
>
> I have tested this with h264 2880x1620 120fps and some other use-cases
> and performance was fine (on Quadro RTX 4000, that is).
>
> Can I just send the fixed patch again to ffmpeg-devel at ffmpeg.org?

I have a typo in subject :( cuvidec -> cuviddec, I would like to fix
it as well if possible.
I struggled initially with sending a patch here but I think it should
be fine next time...

>
> ctx->cuparseinfo.ulMaxDisplayDelay = (avctx->flags &
> AV_CODEC_FLAG_LOW_DELAY) ? 0 : 4;
>
> Like this?
>
> Btw. there is a related ticket: https://trac.ffmpeg.org/ticket/6495
>
> Best regards
> Michal Novotny
>
> >
> > _______________________________________________
> > ffmpeg-devel mailing list
> > ffmpeg-devel at ffmpeg.org
> > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >
> > To unsubscribe, visit link above, or email
> > ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-devel mailing list