[FFmpeg-devel] [PATCH v2] lavc/cbs_av1: restore CodedBitstreamAV1Context when AVERROR(ENOSPC)

Xiang, Haihao haihao.xiang at intel.com
Fri Oct 7 06:04:23 EEST 2022


On Wed, 2022-10-05 at 09:55 -0300, James Almer wrote:
> On 9/27/2022 10:39 PM, Xiang, Haihao wrote:
> > From: Haihao Xiang <haihao.xiang at intel.com>
> > 
> > The current pbc might be small for an obu frame, so a new pbc is
> > required then parse this obu frame again. Because
> > CodedBitstreamAV1Context has already been updated for this obu frame, we
> > need to restore CodedBitstreamAV1Context, otherwise
> > CodedBitstreamAV1Context doesn't match this obu frame when parsing obu
> > frame again, e.g. CodedBitstreamAV1Context.order_hint.
> > 
> > $ ffmpeg -i input.ivf -c:v copy -f null -
> > [...]
> > [av1_frame_merge @ 0x558bc3d6f880] ref_order_hint[i] does not match
> > inferred value: 20, but should be 22.
> > [av1_frame_merge @ 0x558bc3d6f880] Failed to write unit 1 (type 6).
> > [av1_frame_merge @ 0x558bc3d6f880] Failed to write packet.
> > [obu @ 0x558bc3d6e040] av1_frame_merge filter failed to send output
> > packet
> > ---
> >   libavcodec/cbs_av1.c | 64 ++++++++++++++++++++++++++++++++------------
> >   1 file changed, 47 insertions(+), 17 deletions(-)
> 
> Should be ok.

Thanks for review, applied.

-Haihao



More information about the ffmpeg-devel mailing list