Merge commit '22e18ea39e371030cc78973d1b46aae45a7ea215'
* commit '22e18ea39e371030cc78973d1b46aae45a7ea215': jpeg2000: Optimize output sample conversion jpeg2000: Reset s->numX/Ytiles on tile deallocation jpeg2000: Optimize dequantization jpeg2000: Do not assume a single tile jpeg2000: Speed up jpeg2000_decode_tile() jpeg2000: Use EBCOT's CAUSAL and BYPASS mode in decode_cblk() Conflicts: libavcodec/jpeg2000dec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
5eb23e6b0a
@ -942,9 +942,10 @@ static int decode_cblk(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *codsty,
|
|||||||
Jpeg2000T1Context *t1, Jpeg2000Cblk *cblk,
|
Jpeg2000T1Context *t1, Jpeg2000Cblk *cblk,
|
||||||
int width, int height, int bandpos)
|
int width, int height, int bandpos)
|
||||||
{
|
{
|
||||||
int passno = cblk->npasses, pass_t = 2, bpno = cblk->nonzerobits - 1, y, clnpass_cnt = 0;
|
int passno = cblk->npasses, pass_t = 2, bpno = cblk->nonzerobits - 1, y;
|
||||||
int bpass_csty_symbol = JPEG2000_CBLK_BYPASS & codsty->cblk_style;
|
int clnpass_cnt = 0;
|
||||||
int vert_causal_ctx_csty_symbol = JPEG2000_CBLK_VSC & codsty->cblk_style;
|
int bpass_csty_symbol = codsty->cblk_style & JPEG2000_CBLK_BYPASS;
|
||||||
|
int vert_causal_ctx_csty_symbol = codsty->cblk_style & JPEG2000_CBLK_VSC;
|
||||||
|
|
||||||
for (y = 0; y < height; y++)
|
for (y = 0; y < height; y++)
|
||||||
memset(t1->data[y], 0, width * sizeof(**t1->data));
|
memset(t1->data[y], 0, width * sizeof(**t1->data));
|
||||||
@ -964,7 +965,8 @@ static int decode_cblk(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *codsty,
|
|||||||
switch(pass_t) {
|
switch(pass_t) {
|
||||||
case 0:
|
case 0:
|
||||||
decode_sigpass(t1, width, height, bpno + 1, bandpos,
|
decode_sigpass(t1, width, height, bpno + 1, bandpos,
|
||||||
bpass_csty_symbol && (clnpass_cnt >= 4), vert_causal_ctx_csty_symbol);
|
bpass_csty_symbol && (clnpass_cnt >= 4),
|
||||||
|
vert_causal_ctx_csty_symbol);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
decode_refpass(t1, width, height, bpno + 1);
|
decode_refpass(t1, width, height, bpno + 1);
|
||||||
@ -973,7 +975,8 @@ static int decode_cblk(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *codsty,
|
|||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
decode_clnpass(s, t1, width, height, bpno + 1, bandpos,
|
decode_clnpass(s, t1, width, height, bpno + 1, bandpos,
|
||||||
codsty->cblk_style & JPEG2000_CBLK_SEGSYM, vert_causal_ctx_csty_symbol);
|
codsty->cblk_style & JPEG2000_CBLK_SEGSYM,
|
||||||
|
vert_causal_ctx_csty_symbol);
|
||||||
clnpass_cnt = clnpass_cnt + 1;
|
clnpass_cnt = clnpass_cnt + 1;
|
||||||
if (bpass_csty_symbol && clnpass_cnt >= 4)
|
if (bpass_csty_symbol && clnpass_cnt >= 4)
|
||||||
ff_mqc_initdec(&t1->mqc, cblk->data);
|
ff_mqc_initdec(&t1->mqc, cblk->data);
|
||||||
@ -1116,7 +1119,8 @@ static int jpeg2000_decode_tile(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile,
|
|||||||
|
|
||||||
bandpos = bandno + (reslevelno > 0);
|
bandpos = bandno + (reslevelno > 0);
|
||||||
|
|
||||||
if (band->coord[0][0] == band->coord[0][1] || band->coord[1][0] == band->coord[1][1])
|
if (band->coord[0][0] == band->coord[0][1] ||
|
||||||
|
band->coord[1][0] == band->coord[1][1])
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
nb_precincts = rlevel->num_precincts_x * rlevel->num_precincts_y;
|
nb_precincts = rlevel->num_precincts_x * rlevel->num_precincts_y;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user