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

Fu, Linjie linjie.fu at intel.com
Thu Mar 19 17:12:19 EET 2020


> From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf Of
> Carl Eugen Hoyos
> Sent: Thursday, March 19, 2020 22:13
> To: 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
> 
> Am Do., 19. März 2020 um 14:45 Uhr schrieb Fu, Linjie <linjie.fu at intel.com>:
> 
> > This fix [v4] intended to report errors and exit decode_frame() for the
> exact frame witch has
> > invalid mvscale factors used, and didn't mean to break the decoding for
> subsequent frames if
> > they could be decoded correctly.
> 
> How does the output look visually before this patch and how does it
> look with this patch?
> 
$ ffmpeg -i g2_decoder_case_15865.ivf -f null -

* 1. Before this patch:
Reported "Invalid ref frame dimensions" in the decode_frame_header() and abort the decoding.
(only 8 frame decode)

====
[vp9 @ 0x55e6496b3050] Invalid ref frame dimensions 1920x1088 for frame size 480x272
[vp9 @ 0x55e6496baab0] Not all references are available
[vp9 @ 0x55e6496c2510] Not all references are available
[vp9 @ 0x55e6496c5620] Not all references are available
Output #0, null, to 'pipe:':
  Metadata:
    encoder         : Lavf58.42.100
    Stream #0:0: Video: wrapped_avframe, yuv420p, 1920x1088, q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
    Metadata:
      encoder         : Lavc58.76.100 wrapped_avframe
Error while decoding stream #0:0: Invalid data found when processing input
    Last message repeated 3 times
frame=    8 fps=7.7 q=-0.0 Lsize=N/A time=00:00:00.48 bitrate=N/A speed=0.464x
====

* 2. With this patch:
All frames (12) decoded correctly (visually) with a warning in the header check.

====
Input #0, ivf, from 'g2_decoder_case_15865.ivf':
  Duration: 00:00:00.01, start: 0.000000, bitrate: 100442 kb/s
    Stream #0:0: Video: vp9 (Profile 0) (VP90 / 0x30395056), yuv420p(tv), 1920x1088, 25 fps, 25 tbr, 1k tbn, 1k tbc
Stream mapping:
  Stream #0:0 -> #0:0 (vp9 (native) -> wrapped_avframe (native))
Press [q] to stop, [?] for help
[vp9 @ 0x56072d8df080] Invalid ref frame dimensions 1920x1088 for frame size 480x272
    Last message repeated 1 times
Output #0, null, to 'pipe:':
  Metadata:
    encoder         : Lavf58.41.100
    Stream #0:0: Video: wrapped_avframe, yuv420p, 1920x1088, q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
    Metadata:
      encoder         : Lavc58.75.100 wrapped_avframe
frame=   12 fps=0.0 q=-0.0 Lsize=N/A time=00:00:00.48 bitrate=N/A speed=1.77x
====

If talking about the error out, it didn't happen in this bitstream since the invalid refs is not used.

It would take effect in the situations that invalid ref is unexpected used in either single/comp reference during
inter recon. And identical messages would be reported that invalid data found when processing input, and the
outputted frames is less than expected. 

- Linjie


More information about the ffmpeg-devel mailing list