Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH v2] lavc/vvc: Always set flags for the current picture
@ 2024-06-27 17:53 Frank Plowman
  2024-06-28 13:43 ` Nuo Mi
  0 siblings, 1 reply; 2+ messages in thread
From: Frank Plowman @ 2024-06-27 17:53 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Frank Plowman

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.

Signed-off-by: Frank Plowman <post@frankplowman.com>
---
 libavcodec/vvc/refs.c | 2 +-
 1 file changed, 1 insertion(+), 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;
 
-- 
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".

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [FFmpeg-devel] [PATCH v2] lavc/vvc: Always set flags for the current picture
  2024-06-27 17:53 [FFmpeg-devel] [PATCH v2] lavc/vvc: Always set flags for the current picture Frank Plowman
@ 2024-06-28 13:43 ` Nuo Mi
  0 siblings, 0 replies; 2+ messages in thread
From: Nuo Mi @ 2024-06-28 13:43 UTC (permalink / raw)
  To: FFmpeg development discussions and patches; +Cc: Frank Plowman

Applied,
Thank you, Frank,

On Fri, Jun 28, 2024 at 1:53 AM 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.
>
> Signed-off-by: Frank Plowman <post@frankplowman.com>
> ---
>  libavcodec/vvc/refs.c | 2 +-
>  1 file changed, 1 insertion(+), 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;
>
> --
> 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".

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-06-28 13:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-27 17:53 [FFmpeg-devel] [PATCH v2] lavc/vvc: Always set flags for the current picture Frank Plowman
2024-06-28 13:43 ` Nuo Mi

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