Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Cosmin Stejerean via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: "FFmpeg development discussions and patches" <ffmpeg-devel@ffmpeg.org>
Cc: "Cosmin Stejerean" <cosmin@cosmin.at>
Subject: Re: [FFmpeg-devel] [PATCH v5 4/7] libavcodec/webp: add support for animated WebP decoding
Date: Wed, 22 Nov 2023 02:54:28 +0000
Message-ID: <0101018bf4f35021-2d539319-d928-4619-8ffe-6b1ca31da8e6-000000@us-west-2.amazonses.com> (raw)
In-Reply-To: <aca6b551-d765-4182-8b00-93b363fc40d2@gmail.com>

On Nov 20, 2023, at 5:14 PM, James Almer <jamrial@gmail.com> wrote:

On 11/20/2023 4:22 PM, Thilo Borgmann via ffmpeg-devel wrote:
+    if (*got_frame) {
+        if (!(s->vp8x_flags & VP8X_FLAG_ANIMATION)) {
+            // no animation, output the decoded frame
+            av_frame_move_ref(p, s->frame);
+            ret = ff_attach_decode_data(p);
+            if (ret < 0)
+                return ret;

If this frame's buffers were allocated with ff_get_buffer() (or its threaded version), then a call to ff_attach_decode_data() is not necessary.

The frame returned by avcodec_receive_frame doesn’t have private_ref set on it, and eventually this null private_ref would get propagated to the other frame objects (even if allocated with ff_get_buffer) by av_frame_copy_props, and later on this would fail the assert that frames returned by codecs with AV_CODEC_CAP_DR1 have private_ref set on them.

However this patch is dealing with it in the wrong place, moving ff_attach_decode_data to right after avcodec_receive_frame would both make this more clear and fix the assert issues (currently there’s an unnecessary call to ff_attach_decode_data on an already allocated frame in a code path that doesn’t go through vp8_lossy_decode_frame).

I verified that with that change on top of the current patch set it would run the webp fate tests cleanly. I’m not sure if this is the best way to properly reference a frame that came from avcodec_receive_frame inside of another codec. But it does seem to work and a cursory search didn’t reveal a better API for this.


- Cosmin
_______________________________________________
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".

  parent reply	other threads:[~2023-11-22  2:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-20 19:22 [FFmpeg-devel] [PATCH v5 0/7] webp: " Thilo Borgmann via ffmpeg-devel
2023-11-20 19:22 ` [FFmpeg-devel] [PATCH v5 1/7] avcodec/webp: move definitions into header Thilo Borgmann via ffmpeg-devel
2023-11-20 19:22 ` [FFmpeg-devel] [PATCH v5 2/7] avcodec/webp: remove unused definitions Thilo Borgmann via ffmpeg-devel
2023-11-20 19:22 ` [FFmpeg-devel] [PATCH v5 3/7] avcodec/webp_parser: parse each frame into one packet Thilo Borgmann via ffmpeg-devel
2023-11-20 19:22 ` [FFmpeg-devel] [PATCH v5 4/7] libavcodec/webp: add support for animated WebP decoding Thilo Borgmann via ffmpeg-devel
2023-11-21  1:14   ` James Almer
     [not found]     ` <E3CBA7FF-FD87-48E7-8049-C83CA8F11339@cosmin.at>
2023-11-22  2:54       ` Cosmin Stejerean via ffmpeg-devel [this message]
2023-11-22 19:36         ` Thilo Borgmann via ffmpeg-devel
2023-11-20 19:22 ` [FFmpeg-devel] [PATCH v5 5/7] avcodec/webp: make init_canvas_frame static Thilo Borgmann via ffmpeg-devel
2023-11-21  1:10   ` Michael Niedermayer
2023-11-20 19:22 ` [FFmpeg-devel] [PATCH v5 6/7] libavformat/webp: add WebP demuxer Thilo Borgmann via ffmpeg-devel
2023-11-20 19:22 ` [FFmpeg-devel] [PATCH v5 7/7] fate: add test for animated WebP Thilo Borgmann via ffmpeg-devel
2023-11-21  1:01   ` Michael Niedermayer

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=0101018bf4f35021-2d539319-d928-4619-8ffe-6b1ca31da8e6-000000@us-west-2.amazonses.com \
    --to=ffmpeg-devel@ffmpeg.org \
    --cc=cosmin@cosmin.at \
    /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