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 C066B45CA5 for ; Sun, 2 Apr 2023 21:34:39 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1DE3B68BE9D; Mon, 3 Apr 2023 00:34:37 +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 7C8966806EF for ; Mon, 3 Apr 2023 00:34:30 +0300 (EEST) Received: (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id C6B9CE0005 for ; Sun, 2 Apr 2023 21:34:29 +0000 (UTC) Date: Sun, 2 Apr 2023 23:34:29 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20230402213429.GO1164690@pb2> References: <20230330231441.8868-1-michael@niedermayer.cc> <20230330231441.8868-2-michael@niedermayer.cc> MIME-Version: 1.0 In-Reply-To: <20230330231441.8868-2-michael@niedermayer.cc> 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="===============5505109410676962540==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============5505109410676962540== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="YC8Ek3FeOE8ywfXk" Content-Disposition: inline --YC8Ek3FeOE8ywfXk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 31, 2023 at 01:14:40AM +0200, Michael Niedermayer wrote: > Signed-off-by: Michael Niedermayer > --- > libavcodec/j2kenc.c | 28 ++++++++++++++++++---------- > 1 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) > =20 > for (i =3D 0; i < s->ncomponents; i++){ // Ssiz_i XRsiz_i, YRsiz_i > bytestream_put_byte(&s->buf, s->cbps[i] - 1); > - bytestream_put_byte(&s->buf, i?1<chroma_shift[0]:1); > - bytestream_put_byte(&s->buf, i?1<chroma_shift[1]:1); > + bytestream_put_byte(&s->buf, (i%3)?1<chroma_shift[0]:1); > + bytestream_put_byte(&s->buf, (i%3)?1<chroma_shift[1]:1); i will replace the %3 by +1&2 to avoid slow modulo before applying [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB You can kill me, but you cannot change the truth. --YC8Ek3FeOE8ywfXk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZCn04AAKCRBhHseHBAsP q47fAJ9QG2fra9nuf3EgLFJgwyYMIX+uHACfSe0CjVhj4f1uBd6n+8DSg2cOuGU= =2AnP -----END PGP SIGNATURE----- --YC8Ek3FeOE8ywfXk-- --===============5505109410676962540== 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". --===============5505109410676962540==--