mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-23 19:30:05 +00:00
avcodec/jpeg2000: Change codeblock coords to same origin as bands
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
d9841e53e2
commit
a206c13289
@ -437,22 +437,22 @@ int ff_jpeg2000_init_component(Jpeg2000Component *comp,
|
|||||||
|
|
||||||
/* Compute coordinates of codeblocks */
|
/* Compute coordinates of codeblocks */
|
||||||
/* Compute Cx0*/
|
/* Compute Cx0*/
|
||||||
Cx0 = ((prec->coord[0][0] - band->coord[0][0]) >> band->log2_cblk_width) << band->log2_cblk_width;
|
Cx0 = ((prec->coord[0][0]) >> band->log2_cblk_width) << band->log2_cblk_width;
|
||||||
Cx0 = Cx0 + ((cblkno % prec->nb_codeblocks_width) << band->log2_cblk_width);
|
Cx0 = Cx0 + ((cblkno % prec->nb_codeblocks_width) << band->log2_cblk_width);
|
||||||
cblk->coord[0][0] = FFMAX(Cx0, prec->coord[0][0] - band->coord[0][0]);
|
cblk->coord[0][0] = FFMAX(Cx0, prec->coord[0][0]);
|
||||||
|
|
||||||
/* Compute Cy0*/
|
/* Compute Cy0*/
|
||||||
Cy0 = ((prec->coord[1][0] - band->coord[1][0]) >> band->log2_cblk_height) << band->log2_cblk_height;
|
Cy0 = ((prec->coord[1][0]) >> band->log2_cblk_height) << band->log2_cblk_height;
|
||||||
Cy0 = Cy0 + ((cblkno / prec->nb_codeblocks_width) << band->log2_cblk_height);
|
Cy0 = Cy0 + ((cblkno / prec->nb_codeblocks_width) << band->log2_cblk_height);
|
||||||
cblk->coord[1][0] = FFMAX(Cy0, prec->coord[1][0] - band->coord[1][0]);
|
cblk->coord[1][0] = FFMAX(Cy0, prec->coord[1][0]);
|
||||||
|
|
||||||
/* Compute Cx1 */
|
/* Compute Cx1 */
|
||||||
cblk->coord[0][1] = FFMIN(Cx0 + (1 << band->log2_cblk_width),
|
cblk->coord[0][1] = FFMIN(Cx0 + (1 << band->log2_cblk_width),
|
||||||
prec->coord[0][1] - band->coord[0][0]);
|
prec->coord[0][1]);
|
||||||
|
|
||||||
/* Compute Cy1 */
|
/* Compute Cy1 */
|
||||||
cblk->coord[1][1] = FFMIN(Cy0 + (1 << band->log2_cblk_height),
|
cblk->coord[1][1] = FFMIN(Cy0 + (1 << band->log2_cblk_height),
|
||||||
prec->coord[1][1] - band->coord[1][0]);
|
prec->coord[1][1]);
|
||||||
/* Update code-blocks coordinates according sub-band position */
|
/* Update code-blocks coordinates according sub-band position */
|
||||||
if ((bandno + !!reslevelno) & 1) {
|
if ((bandno + !!reslevelno) & 1) {
|
||||||
cblk->coord[0][0] += comp->reslevel[reslevelno-1].coord[0][1] -
|
cblk->coord[0][0] += comp->reslevel[reslevelno-1].coord[0][1] -
|
||||||
|
@ -1524,8 +1524,8 @@ static int jpeg2000_decode_tile(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile,
|
|||||||
cblk->coord[1][1] - cblk->coord[1][0],
|
cblk->coord[1][1] - cblk->coord[1][0],
|
||||||
bandpos);
|
bandpos);
|
||||||
|
|
||||||
x = cblk->coord[0][0];
|
x = cblk->coord[0][0] - band->coord[0][0];
|
||||||
y = cblk->coord[1][0];
|
y = cblk->coord[1][0] - band->coord[1][0];
|
||||||
|
|
||||||
if (codsty->transform == FF_DWT97)
|
if (codsty->transform == FF_DWT97)
|
||||||
dequantization_float(x, y, cblk, comp, &t1, band);
|
dequantization_float(x, y, cblk, comp, &t1, band);
|
||||||
|
Loading…
Reference in New Issue
Block a user