From: Thilo Borgmann via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Cc: Thilo Borgmann <thilo.borgmann@mail.de>
Subject: Re: [FFmpeg-devel] [PATCH v8 2/5] libavcodec/webp: add support for animated WebP decoding
Date: Sun, 31 Dec 2023 13:14:51 +0100
Message-ID: <d07616d6-c277-4af0-9a7d-5c9918389985@mail.de> (raw)
In-Reply-To: <AS8P250MB07441C4C220199C98441464C8F95A@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM>
Am 21.12.23 um 23:18 schrieb Andreas Rheinhardt:
> Thilo Borgmann via ffmpeg-devel:
>> From: Josef Zlomek <josef@pex.com>
>>
>> Fixes: 4907
>>
>> Adds support for decoding of animated WebP.
>>
>> The WebP decoder adds the animation related features according to the specs:
>> https://developers.google.com/speed/webp/docs/riff_container#animation
>> The frames of the animation may be smaller than the image canvas.
>> Therefore, the frame is decoded to a temporary frame,
>> then it is blended into the canvas, the canvas is copied to the output frame,
>> and finally the frame is disposed from the canvas.
>>
>> The output to AV_PIX_FMT_YUVA420P/AV_PIX_FMT_YUV420P is still supported.
>> The background color is specified only as BGRA in the WebP file
>> so it is converted to YUVA if YUV formats are output.
>>
>> Signed-off-by: Josef Zlomek <josef@pex.com>
>> ---
>> Changelog | 1 +
>> libavcodec/codec_desc.c | 3 +-
>> libavcodec/version.h | 2 +-
>> libavcodec/webp.c | 754 ++++++++++++++++++++++++++++++++++++----
>> 4 files changed, 696 insertions(+), 64 deletions(-)
>>
>> @@ -1298,12 +1326,12 @@ static int vp8_lossy_decode_frame(AVCodecContext *avctx, AVFrame *p,
>> int ret;
>>
>> if (!s->initialized) {
>> - ff_vp8_decode_init(avctx);
>> + VP8Context *s_vp8 = s->avctx_vp8->priv_data;
>> + s_vp8->actually_webp = 1;
>> s->initialized = 1;
>> - s->v.actually_webp = 1;
>> }
>> avctx->pix_fmt = s->has_alpha ? AV_PIX_FMT_YUVA420P : AV_PIX_FMT_YUV420P;
>> - s->lossless = 0;
>> + s->avctx_vp8->pix_fmt = avctx->pix_fmt;
>>
>
> Separating webp.c from vp8.c should be done in commit of its own. And
> you did not really separate them, because you are overwriting internals
> of the VP8 decoder.
Sending v9 with a separate commit for this.
actually_webp and pix_fmt need to be set since 9f00fa5, or we won't get the alpha channel allocated (and segfault on fate-webp-rgba-lossy-q80)
See https://github.com/FFmpeg/FFmpeg/blob/master/libavcodec/vp8.c#L2668-L2677
Thanks,
Thilo
_______________________________________________
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:[~2023-12-31 12:15 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-15 19:59 [FFmpeg-devel] [PATCH v8 0/5] webp: " Thilo Borgmann via ffmpeg-devel
2023-12-15 19:59 ` [FFmpeg-devel] [PATCH v8 1/5] avcodec/webp: remove unused definitions Thilo Borgmann via ffmpeg-devel
2023-12-15 19:59 ` [FFmpeg-devel] [PATCH v8 2/5] libavcodec/webp: add support for animated WebP decoding Thilo Borgmann via ffmpeg-devel
2023-12-21 22:18 ` Andreas Rheinhardt
2023-12-31 12:14 ` Thilo Borgmann via ffmpeg-devel [this message]
2023-12-15 19:59 ` [FFmpeg-devel] [PATCH v8 3/5] avcodec/webp: make init_canvas_frame static Thilo Borgmann via ffmpeg-devel
2023-12-15 19:59 ` [FFmpeg-devel] [PATCH v8 4/5] libavformat/webp: add WebP demuxer Thilo Borgmann via ffmpeg-devel
2023-12-15 19:59 ` [FFmpeg-devel] [PATCH v8 5/5] fate: add test for animated WebP Thilo Borgmann via ffmpeg-devel
2023-12-21 8:01 ` [FFmpeg-devel] [PATCH v8 0/5] webp: add support for animated WebP decoding Thilo Borgmann via ffmpeg-devel
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=d07616d6-c277-4af0-9a7d-5c9918389985@mail.de \
--to=ffmpeg-devel@ffmpeg.org \
--cc=thilo.borgmann@mail.de \
/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