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:
Michael Niedermayer
2013-05-28 22:12:34 +02:00
parent aa0d11ed0b
commit fe7136ef82
7 changed files with 26 additions and 28 deletions

View File

@@ -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;
}
}