mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-02-04 06:08:26 +02:00
avcodec/jpeg2000dec: Add 5/3 de-quantization special case for the lossless case
This avoids a multiplication and 64bits Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
8ff09e9098
commit
05ef6324d1
@ -1436,8 +1436,14 @@ static void dequantization_int(int x, int y, Jpeg2000Cblk *cblk,
|
||||
for (j = 0; j < (cblk->coord[1][1] - cblk->coord[1][0]); ++j) {
|
||||
int32_t *datap = &comp->i_data[(comp->coord[0][1] - comp->coord[0][0]) * (y + j) + x];
|
||||
int *src = t1->data[j];
|
||||
for (i = 0; i < w; ++i)
|
||||
datap[i] = (src[i] * (int64_t)band->i_stepsize) / 32768;
|
||||
if (band->i_stepsize == 16384) {
|
||||
for (i = 0; i < w; ++i)
|
||||
datap[i] = src[i] / 2;
|
||||
} else {
|
||||
// This should be VERY uncommon
|
||||
for (i = 0; i < w; ++i)
|
||||
datap[i] = (src[i] * (int64_t)band->i_stepsize) / 32768;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user