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 709CA449C8 for ; Wed, 5 Apr 2023 23:36:22 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id F0D8868BBFD; Thu, 6 Apr 2023 02:36:18 +0300 (EEST) Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7FDF368A037 for ; Thu, 6 Apr 2023 02:36:13 +0300 (EEST) Received: (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id 208EDE0002 for ; Wed, 5 Apr 2023 23:36:11 +0000 (UTC) Date: Thu, 6 Apr 2023 01:36:11 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20230405233611.GB1164690@pb2> References: <20230330231441.8868-1-michael@niedermayer.cc> <20230330231441.8868-2-michael@niedermayer.cc> <20230402213429.GO1164690@pb2> <688cb5e84d83be56207806ecdc85ab9c43a7201a.camel@haerdin.se> MIME-Version: 1.0 In-Reply-To: <688cb5e84d83be56207806ecdc85ab9c43a7201a.camel@haerdin.se> Subject: Re: [FFmpeg-devel] [PATCH 2/3] avcodec/j2kenc: Add alpha 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="===============2852929193005318384==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============2852929193005318384== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="LMmSgwdUwKH/sMG1" Content-Disposition: inline --LMmSgwdUwKH/sMG1 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 05, 2023 at 02:50:46PM +0200, Tomas H=E4rdin wrote: > s=F6n 2023-04-02 klockan 23:34 +0200 skrev Michael Niedermayer: > > On Fri, Mar 31, 2023 at 01:14:40AM +0200, Michael Niedermayer wrote: > > > Signed-off-by: Michael Niedermayer > > > --- > > > =A0libavcodec/j2kenc.c | 28 ++++++++++++++++++---------- > > > =A01 file changed, 18 insertions(+), 10 deletions(-) > > >=20 > > > diff --git a/libavcodec/j2kenc.c b/libavcodec/j2kenc.c > > > index 97b0da1c976..b23fb73770a 100644 > > > --- a/libavcodec/j2kenc.c > > > +++ b/libavcodec/j2kenc.c > > > @@ -320,8 +320,8 @@ static int put_siz(Jpeg2000EncoderContext *s) > > > =A0 > > > =A0=A0=A0=A0 for (i =3D 0; i < s->ncomponents; i++){ // Ssiz_i XRsiz_= i, > > > YRsiz_i > > > =A0=A0=A0=A0=A0=A0=A0=A0 bytestream_put_byte(&s->buf, s->cbps[i] - 1); > > > -=A0=A0=A0=A0=A0=A0=A0 bytestream_put_byte(&s->buf, i?1<chroma_sh= ift[0]:1); > > > -=A0=A0=A0=A0=A0=A0=A0 bytestream_put_byte(&s->buf, i?1<chroma_sh= ift[1]:1); > > > +=A0=A0=A0=A0=A0=A0=A0 bytestream_put_byte(&s->buf, (i%3)?1< > > >chroma_shift[0]:1); > > > +=A0=A0=A0=A0=A0=A0=A0 bytestream_put_byte(&s->buf, (i%3)?1< > > >chroma_shift[1]:1); > >=20 > > i will replace the %3 by +1&2 to avoid slow modulo before applying >=20 > Is the compiler not smart enough to do that automagically? Not a biggie > though It seemed better to not depend on that as both variants are otherwise simil= ar I didnt check if the compiler can remove the modulo thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB If the United States is serious about tackling the national security threat= s=20 related to an insecure 5G network, it needs to rethink the extent to which = it values corporate profits and government espionage over security.-Bruce Schn= eier --LMmSgwdUwKH/sMG1 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZC4F5gAKCRBhHseHBAsP q7AmAJ49D2em7zzVGFEUN5b8xshXTXljyQCdHzvfGYDejY7DcWnc5WzEQT1Cwmk= =470t -----END PGP SIGNATURE----- --LMmSgwdUwKH/sMG1-- --===============2852929193005318384== 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". --===============2852929193005318384==--