[FFmpeg-devel] [PATCH v1 3/4] libavcodec/webp: add support for animated WebP decoding

Thilo Borgmann thilo.borgmann at mail.de
Wed Jun 14 13:40:22 EEST 2023


Am 14.06.23 um 04:04 schrieb James Zern:
> On Thu, Jun 8, 2023 at 7:21 AM Thilo Borgmann <thilo.borgmann at mail.de> wrote:
>>
>> From: Josef Zlomek <josef at 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 at pex.com>
>> ---
>>   Changelog               |   1 +
>>   libavcodec/codec_desc.c |   3 +-
>>   libavcodec/version.h    |   2 +-
>>   libavcodec/webp.c       | 714 ++++++++++++++++++++++++++++++++++++----
>>   4 files changed, 658 insertions(+), 62 deletions(-)
>>
>> [...]
>> +
>> +            bytestream2_skip(&gb, 2); // loop count is ignored
> 
> TODO? APNG and GIF support looping and have -ignore_loop to control it.

Will look into this maybe supporting it in v2. Otherwise making it a TODO.

Thanks,
Thilo


More information about the ffmpeg-devel mailing list