From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id BE1DD4608D for ; Sun, 31 Dec 2023 12:15:03 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1377E68CCB3; Sun, 31 Dec 2023 14:15:00 +0200 (EET) Received: from shout01.mail.de (shout01.mail.de [62.201.172.24]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 879DB68B1FF for ; Sun, 31 Dec 2023 14:14:53 +0200 (EET) Received: from postfix01.mail.de (postfix01.bt.mail.de [10.0.121.125]) by shout01.mail.de (Postfix) with ESMTP id 77D13240A74 for ; Sun, 31 Dec 2023 13:14:52 +0100 (CET) Received: from smtp01.mail.de (smtp03.bt.mail.de [10.0.121.213]) by postfix01.mail.de (Postfix) with ESMTP id 5F9258016D for ; Sun, 31 Dec 2023 13:14:52 +0100 (CET) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp01.mail.de (Postfix) with ESMTPSA id 32F522409FC for ; Sun, 31 Dec 2023 13:14:51 +0100 (CET) Message-ID: Date: Sun, 31 Dec 2023 13:14:51 +0100 MIME-Version: 1.0 Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: <20231215195917.91300-1-thilo.borgmann@mail.de> <20231215195917.91300-3-thilo.borgmann@mail.de> In-Reply-To: X-purgate: clean X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate-type: clean X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate: clean X-purgate-size: 2149 X-purgate-ID: 154282::1704024892-33E201F9-EFD85C56/0/0 Subject: Re: [FFmpeg-devel] [PATCH v8 2/5] libavcodec/webp: add support for animated WebP decoding X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Thilo Borgmann via ffmpeg-devel Reply-To: FFmpeg development discussions and patches Cc: Thilo Borgmann Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Am 21.12.23 um 23:18 schrieb Andreas Rheinhardt: > Thilo Borgmann via ffmpeg-devel: >> From: Josef Zlomek >> >> 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 >> --- >> 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".