j2k: remove cblk from band
cblk is now in the same place as in jpeg2000, which will simplify merging the 2 decoders Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
81ccc31f75
commit
a05db52c12
@ -306,11 +306,6 @@ int ff_j2k_init_component(Jpeg2000Component *comp,
|
||||
band->cblknx = ff_jpeg2000_ceildiv(band->cblknx, dx);
|
||||
band->cblkny = ff_jpeg2000_ceildiv(band->cblkny, dy);
|
||||
|
||||
band->cblk = av_malloc_array(band->cblknx *
|
||||
band->cblkny,
|
||||
sizeof(*band->cblk));
|
||||
if (!band->cblk)
|
||||
return AVERROR(ENOMEM);
|
||||
band->prec = av_malloc_array(reslevel->num_precincts_x *
|
||||
reslevel->num_precincts_y,
|
||||
sizeof(*band->prec));
|
||||
@ -399,11 +394,9 @@ int ff_j2k_init_component(Jpeg2000Component *comp,
|
||||
if (!prec->zerobits)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
// prec->cblk = av_malloc_array(prec->nb_codeblocks_width *
|
||||
// prec->nb_codeblocks_height,
|
||||
// sizeof(*prec->cblk));
|
||||
prec->cblk = band->cblk;
|
||||
av_assert0(nb_precincts == 1);
|
||||
prec->cblk = av_malloc_array(prec->nb_codeblocks_width *
|
||||
prec->nb_codeblocks_height,
|
||||
sizeof(*prec->cblk));
|
||||
if (!prec->cblk)
|
||||
return AVERROR(ENOMEM);
|
||||
for (cblkno = 0; cblkno < prec->nb_codeblocks_width * prec->nb_codeblocks_height; cblkno++) {
|
||||
@ -461,11 +454,11 @@ void ff_j2k_reinit(Jpeg2000Component *comp, Jpeg2000CodingStyle *codsty)
|
||||
Jpeg2000Prec *prec = band->prec + precno;
|
||||
tag_tree_zero(prec->zerobits, prec->xi1 - prec->xi0, prec->yi1 - prec->yi0);
|
||||
tag_tree_zero(prec->cblkincl, prec->xi1 - prec->xi0, prec->yi1 - prec->yi0);
|
||||
}
|
||||
for (cblkno = 0; cblkno < band->cblknx * band->cblkny; cblkno++) {
|
||||
Jpeg2000Cblk *cblk = band->cblk + cblkno;
|
||||
cblk->length = 0;
|
||||
cblk->lblock = 3;
|
||||
for (cblkno = 0; cblkno < prec->nb_codeblocks_width * prec->nb_codeblocks_height; cblkno++) {
|
||||
Jpeg2000Cblk *cblk = prec->cblk + cblkno;
|
||||
cblk->length = 0;
|
||||
cblk->lblock = 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -483,8 +476,8 @@ void ff_j2k_cleanup(Jpeg2000Component *comp, Jpeg2000CodingStyle *codsty)
|
||||
Jpeg2000Prec *prec = band->prec + precno;
|
||||
av_freep(&prec->zerobits);
|
||||
av_freep(&prec->cblkincl);
|
||||
av_freep(&prec->cblk);
|
||||
}
|
||||
av_freep(&band->cblk);
|
||||
av_freep(&band->prec);
|
||||
}
|
||||
av_freep(&reslevel->band);
|
||||
|
@ -182,7 +182,6 @@ typedef struct Jpeg2000Band {
|
||||
uint16_t cblknx, cblkny;
|
||||
uint32_t stepsize; // quantization stepsize (* 2^13)
|
||||
Jpeg2000Prec *prec;
|
||||
Jpeg2000Cblk *cblk;
|
||||
} Jpeg2000Band; // subband
|
||||
|
||||
typedef struct Jpeg2000ResLevel {
|
||||
|
Loading…
x
Reference in New Issue
Block a user