mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2025-10-20 07:35:25 +08:00
j2k/jpeg2000: split stepsize in float & int variables
This is more clear and less prone to mistakes. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -930,7 +930,7 @@ static void dequantization_float(int x, int y, Jpeg2000Cblk *cblk,
|
||||
for (j = 0; j < (cblk->coord[1][1] - cblk->coord[1][0]); ++j)
|
||||
for (i = 0; i < (cblk->coord[0][1] - cblk->coord[0][0]); ++i) {
|
||||
idx = (comp->coord[0][1] - comp->coord[0][0]) * j + i;
|
||||
datap[idx] = (float)(t1->data[j][i]) * ((float)band->stepsize);
|
||||
datap[idx] = (float)(t1->data[j][i]) * band->f_stepsize;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -946,7 +946,7 @@ static void dequantization_int(int x, int y, Jpeg2000Cblk *cblk,
|
||||
for (i = 0; i < (cblk->coord[0][1] - cblk->coord[0][0]); ++i) {
|
||||
idx = (comp->coord[0][1] - comp->coord[0][0]) * j + i;
|
||||
datap[idx] =
|
||||
((int32_t)(t1->data[j][i]) * ((int32_t)band->stepsize) + (1 << 15)) >> 16;
|
||||
((int32_t)(t1->data[j][i]) * band->i_stepsize + (1 << 15)) >> 16;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user