mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-15 19:40:07 +01: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:
@@ -802,7 +802,7 @@ static void truncpasses(Jpeg2000EncoderContext *s, Jpeg2000Tile *tile)
|
||||
Jpeg2000Cblk *cblk = prec->cblk + cblkno;
|
||||
|
||||
cblk->ninclpasses = getcut(cblk, s->lambda,
|
||||
(int64_t)dwt_norms[codsty->transform][bandpos][lev] * (int64_t)band->stepsize >> 16);
|
||||
(int64_t)dwt_norms[codsty->transform][bandpos][lev] * (int64_t)band->i_stepsize >> 16);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -863,7 +863,7 @@ static int encode_tile(Jpeg2000EncoderContext *s, Jpeg2000Tile *tile, int tileno
|
||||
int *ptr = t1.data[y-yy0];
|
||||
for (x = xx0; x < xx1; x++){
|
||||
*ptr = (comp->data[(comp->coord[0][1] - comp->coord[0][0]) * y + x]);
|
||||
*ptr = (int64_t)*ptr * (int64_t)(16384 * 65536 / band->stepsize) >> 14 - NMSEDEC_FRACBITS;
|
||||
*ptr = (int64_t)*ptr * (int64_t)(16384 * 65536 / band->i_stepsize) >> 14 - NMSEDEC_FRACBITS;
|
||||
ptr++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user