From: Caleb Etemesi <etemesicaleb@gmail.com>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH v2 2/3] avcodec/jpeg2000dec: add support for HTJ2K block decoding
Date: Fri, 14 Apr 2023 17:13:35 +0300
Message-ID: <CAF7=sGKArMaHM7t83mYc=rwd=DP1n4=-BjBP4DAoa8b3rvkBuw@mail.gmail.com> (raw)
In-Reply-To: <d6e1f73a46bc8e79277f5f9b588da8b1fa70fb77.camel@haerdin.se>
On Fri, 14 Apr 2023, 16:04 Tomas Härdin, <git@haerdin.se> wrote:
> > #define JP2_SIG_TYPE 0x6A502020
> > #define JP2_SIG_VALUE 0x0D0A870A
> > @@ -436,12 +437,13 @@ static int get_cox(Jpeg2000DecoderContext *s,
> > Jpeg2000CodingStyle *c)
> > c->cblk_style = bytestream2_get_byteu(&s->g);
> > if (c->cblk_style != 0) { // cblk style
> > if (c->cblk_style & JPEG2000_CTSY_HTJ2K_M || c->cblk_style &
> > JPEG2000_CTSY_HTJ2K_F) {
> > - av_log(s->avctx, AV_LOG_ERROR, "Support for High
> > throughput JPEG 2000 is not yet available\n");
> > - return AVERROR_PATCHWELCOME;
> > + av_log(s->avctx,AV_LOG_TRACE,"High Throughput jpeg 2000
> > codestream.\n");
> > + s->is_htj2k = 1;
>
> Still no support for per-CB style? Or, this still looks a bit strange,
> see below
>
There is a bit further down, i.e the `& JPEG2000_CTSY_HTJ2K_F` does the CB
check
+
+ if (codsty->cblk_style & JPEG2000_CTSY_HTJ2K_F)
+ ret = ff_jpeg2000_decode_htj2k(s, codsty, &t1,
cblk,
+
cblk->coord[0][1] - cblk->coord[0][0],
+
cblk->coord[1][1] - cblk->coord[1][0],
+ magp,
comp->roi_shift);
+ else
+ ret = decode_cblk(s, codsty, &t1, cblk,
+ cblk->coord[0][1] -
cblk->coord[0][0],
+ cblk->coord[1][1] -
cblk->coord[1][0],
+ bandpos, comp->roi_shift);
+
> - if ((ret = get_bits(s, av_log2(newpasses1) + cblk-
> > >lblock)) < 0)
> > - return ret;
> > + if (newpasses > 1 && s->is_htj2k) {
>
> Is this not per-tile? See codsty further down
>
> > @@ -1863,9 +1882,12 @@ static inline void tile_codeblocks(const
> > Jpeg2000DecoderContext *s, Jpeg2000Tile
> >
> > /* Loop on tile components */
> > for (compno = 0; compno < s->ncomponents; compno++) {
> > - Jpeg2000Component *comp = tile->comp + compno;
> > - Jpeg2000CodingStyle *codsty = tile->codsty + compno;
> > + Jpeg2000Component *comp = tile->comp + compno;
> > + Jpeg2000CodingStyle *codsty = tile->codsty + compno;
>
> Here
>
> > for (cblkno = 0;
> > cblkno < prec->nb_codeblocks_width * prec-
> > >nb_codeblocks_height;
> > cblkno++) {
> > - int x, y;
> > + int x, y, ret;
> > + /* See Rec. ITU-T T.800, Equation E-2 */
> > + int magp = quantsty->expn[subbandno] +
> > quantsty->nguardbits - 1;
> > +
> > Jpeg2000Cblk *cblk = prec->cblk + cblkno;
> > - int ret = decode_cblk(s, codsty, &t1, cblk,
> > - cblk->coord[0][1] - cblk-
> > >coord[0][0],
> > - cblk->coord[1][1] - cblk-
> > >coord[1][0],
> > - bandpos, comp->roi_shift);
> > +
> > + if (codsty->cblk_style &
> > JPEG2000_CTSY_HTJ2K_F)
>
> And here
>
Fixing, sending updated patch in a few
> /Tomas
>
> _______________________________________________
> 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".
>
_______________________________________________
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-14 14:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-11 18:28 [FFmpeg-devel] [PATCH v2 1/3] avcodec/jpeg2000dec: move decoder structs to a header file pal
2023-04-11 18:28 ` [FFmpeg-devel] [PATCH v2 2/3] avcodec/jpeg2000dec: add support for HTJ2K block decoding pal
2023-04-14 13:04 ` Tomas Härdin
2023-04-14 14:13 ` Caleb Etemesi [this message]
2023-04-14 19:17 ` Pierre-Anthony Lemieux
2023-04-11 18:28 ` [FFmpeg-devel] [PATCH v2 3/3] fate/jpeg2000: add JPEG 2000 tests using ITU/ISO conformance materials pal
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='CAF7=sGKArMaHM7t83mYc=rwd=DP1n4=-BjBP4DAoa8b3rvkBuw@mail.gmail.com' \
--to=etemesicaleb@gmail.com \
--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