From: Nuo Mi <nuomi2021@gmail.com> To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Cc: Frank Plowman <post@frankplowman.com> Subject: Re: [FFmpeg-devel] [PATCH] lavc/vvc: Always set flags for the current picture Date: Thu, 27 Jun 2024 20:52:55 +0800 Message-ID: <CAFXK13cUBx_QJ_zJPm8VP3vK8V2J_aJUvAh-3QiYmTQj7eRbUg@mail.gmail.com> (raw) In-Reply-To: <20240624153021.16399-1-post@frankplowman.com> On Mon, Jun 24, 2024 at 11:30 PM Frank Plowman <post@frankplowman.com> wrote: > ff_vvc_frame_rpl uses the flags to detect whether a frame is in use. > Therefore, in the case of a CVSS AU (RASL/GDR with > NoOutputBeforeRecoveryFlag) with ph_non_ref_pic_flag = 1, the frame > would be freed before it is used. Fix this by always marking the > current frame with VVC_FRAME_FLAG_SHORT_REF, as is done by the HEVC > decoder. > > Additionally, add an assert0 to mitigate the effects of a frame being > freed before it is used. > > Signed-off-by: Frank Plowman <post@frankplowman.com> > --- > libavcodec/vvc/refs.c | 2 +- > libavcodec/vvc/thread.c | 2 ++ > 2 files changed, 3 insertions(+), 1 deletion(-) > > diff --git a/libavcodec/vvc/refs.c b/libavcodec/vvc/refs.c > index 8b7ba639a3..26a5b0b34c 100644 > --- a/libavcodec/vvc/refs.c > +++ b/libavcodec/vvc/refs.c > @@ -191,7 +191,7 @@ int ff_vvc_set_new_ref(VVCContext *s, VVCFrameContext > *fc, AVFrame **frame) > fc->ref = ref; > > if (s->no_output_before_recovery_flag && (IS_RASL(s) || > !GDR_IS_RECOVERED(s))) > - ref->flags = 0; > + ref->flags = VVC_FRAME_FLAG_SHORT_REF; > else if (ph->r->ph_pic_output_flag) > ref->flags = VVC_FRAME_FLAG_OUTPUT; > > diff --git a/libavcodec/vvc/thread.c b/libavcodec/vvc/thread.c > index 5b01dd2d20..e87ed5b676 100644 > --- a/libavcodec/vvc/thread.c > +++ b/libavcodec/vvc/thread.c > @@ -801,6 +801,8 @@ int ff_vvc_frame_wait(VVCContext *s, VVCFrameContext > *fc) > { > VVCFrameThread *ft = fc->ft; > > + av_assert0(fc->ref->progress); > + > Hi Frank, Thank you for the patch. We have a mission to remove all assert0s in the decoder, right? :) If it's only for debugging, maybe we don't need it. > ff_mutex_lock(&ft->lock); > > while (atomic_load(&ft->nb_scheduled_tasks) || > atomic_load(&ft->nb_scheduled_listeners)) > -- > 2.45.1 > > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". > _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next prev parent reply other threads:[~2024-06-27 12:53 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-06-24 15:30 Frank Plowman 2024-06-27 12:52 ` Nuo Mi [this message] 2024-06-27 17:54 ` Frank Plowman
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=CAFXK13cUBx_QJ_zJPm8VP3vK8V2J_aJUvAh-3QiYmTQj7eRbUg@mail.gmail.com \ --to=nuomi2021@gmail.com \ --cc=ffmpeg-devel@ffmpeg.org \ --cc=post@frankplowman.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git