From: Michael Niedermayer <michael@niedermayer.cc>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH 2/3] avcodec/j2kenc: Add alpha support
Date: Thu, 6 Apr 2023 21:18:28 +0200
Message-ID: <20230406191828.GC1164690@pb2> (raw)
In-Reply-To: <ee5e0d0c-c0f6-b2a5-8f9d-02ed2e468737@gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 1816 bytes --]
On Thu, Apr 06, 2023 at 10:15:48AM -0400, Leo Izen wrote:
>
>
> On 4/2/23 17:34, Michael Niedermayer wrote:
> > On Fri, Mar 31, 2023 at 01:14:40AM +0200, Michael Niedermayer wrote:
> > > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > > ---
> > > libavcodec/j2kenc.c | 28 ++++++++++++++++++----------
> > > 1 file changed, 18 insertions(+), 10 deletions(-)
> > >
> > > 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)
> > > for (i = 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<<s->chroma_shift[0]:1);
> > > - bytestream_put_byte(&s->buf, i?1<<s->chroma_shift[1]:1);
> > > + bytestream_put_byte(&s->buf, (i%3)?1<<s->chroma_shift[0]:1);
> > > + bytestream_put_byte(&s->buf, (i%3)?1<<s->chroma_shift[1]:1);
> >
> > i will replace the %3 by +1&2 to avoid slow modulo before applying
> >
> >
>
> (i % 3) and (i + 1) & 2 aren't the same tho, and won't be nonzero at the
> same time. `(i + 1) & 2` is equivalent to `(i + 1) % 4`.
they are non zero in the same cases for the first 4 planes and we support
just 4. So its the same for us. Its a good argument though why gcc may
have difficulty doing this substitution on its own
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
If you fake or manipulate statistics in a paper in physics you will never
get a job again.
If you fake or manipulate statistics in a paper in medicin you will get
a job for life at the pharma industry.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
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".
next prev parent reply other threads:[~2023-04-06 19:18 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-30 23:14 [FFmpeg-devel] [PATCH 1/3] avcodec/j2kenc: Add forgotten yuv440 variants Michael Niedermayer
2023-03-30 23:14 ` [FFmpeg-devel] [PATCH 2/3] avcodec/j2kenc: Add alpha support Michael Niedermayer
2023-04-02 21:34 ` Michael Niedermayer
2023-04-05 12:50 ` Tomas Härdin
2023-04-05 23:36 ` Michael Niedermayer
2023-04-06 14:15 ` Leo Izen
2023-04-06 19:18 ` Michael Niedermayer [this message]
2023-03-30 23:14 ` [FFmpeg-devel] [PATCH 3/3] [RFC] Remove libopenjpegenc Michael Niedermayer
2023-03-30 23:26 ` Pierre-Anthony Lemieux
2023-03-30 23:31 ` Michael Bradshaw
2023-04-01 23:37 ` Stefano Sabatini
2023-04-05 12:55 ` Tomas Härdin
2023-04-12 1:48 ` Pierre-Anthony Lemieux
2023-04-02 21:24 ` [FFmpeg-devel] [PATCH 1/3] avcodec/j2kenc: Add forgotten yuv440 variants Michael Niedermayer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230406191828.GC1164690@pb2 \
--to=michael@niedermayer.cc \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git