[FFmpeg-devel] [PATCH, v4] lavc/vp9: fix reference frame dimensions check for SINGLE_REFERENCE mode

Ronald S. Bultje rsbultje at gmail.com
Tue May 5 19:21:22 EEST 2020


Hi,

On Wed, Apr 29, 2020 at 8:08 AM Fu, Linjie <linjie.fu at intel.com> wrote:

> > From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf Of Fu,
> > Linjie
> > Sent: Friday, March 20, 2020 09:49
> > To: Ronald S. Bultje <rsbultje at gmail.com>; FFmpeg development
> > discussions and patches <ffmpeg-devel at ffmpeg.org>
> > Subject: Re: [FFmpeg-devel] [PATCH, v4] lavc/vp9: fix reference frame
> > dimensions check for SINGLE_REFERENCE mode
> >
> > > From: Ronald S. Bultje <rsbultje at gmail.com>
> > > Sent: Thursday, March 19, 2020 20:10
> > > To: FFmpeg development discussions and patches <ffmpeg-
> > devel at ffmpeg.org>
> > > Cc: Fu, Linjie <linjie.fu at intel.com>
> > > Subject: Re: [FFmpeg-devel] [PATCH, v4] lavc/vp9: fix reference frame
> > dimensions check for SINGLE_REFERENCE mode
> > >
> > > Hi,
> > >
> > > On Tue, Mar 17, 2020 at 10:59 AM Linjie Fu
> > <linjie.fu at intel.com<mailto:linjie.fu at intel.com>> wrote:
> > > With the description in frame size with refs semantics (SPEC 7.2.5),
> > > it is a requirement of bitstream conformance that for at least one
> > > reference frame has the valid dimensions.
> > >
> > > Modify the check to make sure the decoder works well in
> > SINGLE_REFERENCE
> > > mode that not all reference frames have valid dimensions.
> > >
> > > Check and error out if invalid reference frame is used in inter_recon.
> > >
> > > One of the failure case is a 480x272 inter frame (SINGLE_REFERENCE
> mode)
> > > with following reference pool:
> > >
> > > 0.  960x544    LAST    valid
> > > 1. 1920x1088 GOLDEN  invalid, but not used in single reference mode
> > > 2. 1920x1088 ALTREF  invalid, but not used in single reference mode
> > > 3~7  ...     Unused
> > >
> > > Identical logic in libvpx:
> > >
> > <https://github.com/webmproject/libvpx/blob/master/vp9/decoder/vp9_d
> > ecodeframe.c#L736>
> > >
> > > Signed-off-by: Linjie Fu <linjie.fu at intel.com<mailto:
> linjie.fu at intel.com>>
> > > ---
> > > [v3]: replace assert with check/return, tested in both multi
> frame/slice
> > mode
> > > [v4]: clear error_info to make decoding still work for other frames in
> this
> > stream
> > >
> > > libavcodec/vp9.c      | 20 ++++++++++++++++++--
> > > libavcodec/vp9dec.h   |  5 +++++
> > > libavcodec/vp9recon.c | 10 ++++++++++
> > > 3 files changed, 33 insertions(+), 2 deletions(-)
> > >
> > > LGTM, thanks for the revisions. (We have been discussing this on IRC.)
> >
> > Thanks for the review and valuable suggestions.
> >
> Ping for merge, thx.


Applied.

Ronald


More information about the ffmpeg-devel mailing list