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 0593A452E3 for ; Sun, 19 Mar 2023 19:27:31 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 755ED68C3C3; Sun, 19 Mar 2023 21:27:29 +0200 (EET) Received: from relay10.mail.gandi.net (relay10.mail.gandi.net [217.70.178.230]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 12FDB68C2E1 for ; Sun, 19 Mar 2023 21:27:23 +0200 (EET) Received: (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id 49098240004 for ; Sun, 19 Mar 2023 19:27:20 +0000 (UTC) Date: Sun, 19 Mar 2023 20:27:18 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20230319192718.GI375355@pb2> References: <20230319141514.28134-1-michael@niedermayer.cc> <0f6d6b0c-8cae-5f61-6710-f9860ae83d5c@gmail.com> MIME-Version: 1.0 In-Reply-To: <0f6d6b0c-8cae-5f61-6710-f9860ae83d5c@gmail.com> Subject: Re: [FFmpeg-devel] [PATCH 1/2] avcodec/snowenc: AV_CODEC_CAP_ENCODER_RECON_FRAME support 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: , Reply-To: FFmpeg development discussions and patches Content-Type: multipart/mixed; boundary="===============0776545695548350343==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============0776545695548350343== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Q59ABw34pTSIagmi" Content-Disposition: inline --Q59ABw34pTSIagmi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Mar 19, 2023 at 12:34:50PM -0300, James Almer wrote: > On 3/19/2023 11:15 AM, Michael Niedermayer wrote: > > Signed-off-by: Michael Niedermayer > > --- > > libavcodec/snowenc.c | 10 +++++++++- > > 1 file changed, 9 insertions(+), 1 deletion(-) > >=20 > > diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c > > index 658684c575..a03e4292ee 100644 > > --- a/libavcodec/snowenc.c > > +++ b/libavcodec/snowenc.c > > @@ -26,6 +26,7 @@ > > #include "avcodec.h" > > #include "codec_internal.h" > > #include "encode.h" > > +#include "internal.h" //For AVCodecInternal.recon_frame > > #include "me_cmp.h" > > #include "packet_internal.h" > > #include "snow_dwt.h" > > @@ -1576,6 +1577,7 @@ static int encode_frame(AVCodecContext *avctx, AV= Packet *pkt, > > { > > SnowContext *s =3D avctx->priv_data; > > RangeCoder * const c=3D &s->c; > > + AVCodecInternal *avci =3D avctx->internal; > > AVFrame *pic; > > const int width=3D s->avctx->width; > > const int height=3D s->avctx->height; > > @@ -1877,6 +1879,10 @@ redo_frame: > > s->encoding_error, > > (s->avctx->flags&AV_CODEC_FLAG_PSN= R) ? SNOW_MAX_PLANES : 0, > > s->current_picture->pict_type); > > + if (avci->recon_frame) { >=20 > The proper check is (s->avctx->flags & AV_CODEC_FLAG_RECON_FRAME). > avci->recon_frame could start being allocated unconditionally in the futu= re > for whatever reason. The docomentation says: /** * When the AV_CODEC_FLAG_RECON_FRAME flag is used. the encoder should = store * here the reconstructed frame corresponding to the last returned pack= et. * * Not allocated in other cases. */ AVFrame *recon_frame; =20 If thats not meant to be assumed to be true, the documentation should state this differently thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB I do not agree with what you have to say, but I'll defend to the death your right to say it. -- Voltaire --Q59ABw34pTSIagmi Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZBdiDQAKCRBhHseHBAsP q6WBAJ914YVqpl0dCVAj2LVJtvCYW/UaegCgkYxcivykXbtUkvCTlczrdyEloy0= =n/Hg -----END PGP SIGNATURE----- --Q59ABw34pTSIagmi-- --===============0776545695548350343== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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". --===============0776545695548350343==--