1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

jpeglsdec: fix bpp & limit.

Fixes: Tikcet969

Thanks-to: ITU for the freely available spec.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-02-13 23:51:37 +01:00
parent 00ab9cdae1
commit 387783749f

View File

@ -36,10 +36,8 @@ void ff_jpegls_init_state(JLSState *state){
// QBPP = ceil(log2(RANGE))
for(state->qbpp = 0; (1 << state->qbpp) < state->range; state->qbpp++);
if(state->bpp < 8)
state->limit = 16 + 2 * state->bpp - state->qbpp;
else
state->limit = (4 * state->bpp) - state->qbpp;
state->bpp = FFMAX(av_log2(state->maxval)+1, 2);
state->limit = 2*(state->bpp + FFMAX(state->bpp, 8)) - state->qbpp;
for(i = 0; i < 367; i++) {
state->A[i] = FFMAX((state->range + 32) >> 6, 2);