static void init_quantization(Jpeg2000EncoderContext *s)

{

    int compno, reslevelno, bandno;

    Jpeg2000QuantStyle  *qntsty = &s->qntsty;

    Jpeg2000CodingStyle *codsty = &s->codsty;



    for (compno = 0; compno < s->ncomponents; compno++){

        int gbandno = 0;

        for (reslevelno = 0; reslevelno < codsty->nreslevels; reslevelno++){

            int nbands, lev = codsty->nreslevels - reslevelno - 1;

            nbands = reslevelno ? 3 : 1;

            for (bandno = 0; bandno < nbands; bandno++, gbandno++){

                int expn, mant;



                if (codsty->transform == FF_DWT97){

                    int bandpos = bandno + (reslevelno>0),

                        ss = 81920000 / dwt_norms[0][bandpos][lev],

                        log = av_log2(ss);

                    mant = (11 - log < 0 ? ss >> log - 11 : ss << 11 - log) & 0x7ff;

                    expn = s->cbps[compno] - log + 13;

                } else

                    expn = ((bandno&2)>>1) + (reslevelno>0) + s->cbps[compno];



                qntsty->expn[gbandno] = expn;

                qntsty->mant[gbandno] = mant;

            }

        }

    }

}

static void init_quantization(Jpeg2000EncoderContext *s)

{

    int compno, reslevelno, bandno;

    Jpeg2000QuantStyle  *qntsty = &s->qntsty;

    Jpeg2000CodingStyle *codsty = &s->codsty;



    for (compno = 0; compno < s->ncomponents; compno++){

        int gbandno = 0;

        for (reslevelno = 0; reslevelno < codsty->nreslevels; reslevelno++){

            int nbands, lev = codsty->nreslevels - reslevelno - 1;

            nbands = reslevelno ? 3 : 1;

            for (bandno = 0; bandno < nbands; bandno++, gbandno++){

                int expn, mant;



                if (codsty->transform == FF_DWT97){

                    int bandpos = bandno + (reslevelno>0),

                        ss = 81920000 / dwt_norms[0][bandpos][lev],

                        log = av_log2(ss);

                    mant = (11 - log < 0 ? ss >> log - 11 : ss << 11 - log) & 0x7ff;

                    expn = s->cbps[compno] - log + 13;

                } else

                    expn = ((bandno&2)>>1) + (reslevelno>0) + s->cbps[compno];



                qntsty->expn[gbandno] = expn;

                qntsty->mant[gbandno] = mant;

            }

        }

    }

}

static void FUNC_0(Jpeg2000EncoderContext *VAR_0)

{

    int VAR_1, VAR_2, VAR_3;

    Jpeg2000QuantStyle  *qntsty = &VAR_0->qntsty;

    Jpeg2000CodingStyle *codsty = &VAR_0->codsty;



    for (VAR_1 = 0; VAR_1 < VAR_0->ncomponents; VAR_1++){

        int gbandno = 0;

        for (VAR_2 = 0; VAR_2 < codsty->nreslevels; VAR_2++){

            int nbands, lev = codsty->nreslevels - VAR_2 - 1;

            nbands = VAR_2 ? 3 : 1;

            for (VAR_3 = 0; VAR_3 < nbands; VAR_3++, gbandno++){

                int expn, mant;



                if (codsty->transform == FF_DWT97){

                    int bandpos = VAR_3 + (VAR_2>0),

                        ss = 81920000 / dwt_norms[0][bandpos][lev],

                        log = av_log2(ss);

                    mant = (11 - log < 0 ? ss >> log - 11 : ss << 11 - log) & 0x7ff;

                    expn = VAR_0->cbps[VAR_1] - log + 13;

                } else

                    expn = ((VAR_3&2)>>1) + (VAR_2>0) + VAR_0->cbps[VAR_1];



                qntsty->expn[gbandno] = expn;

                qntsty->mant[gbandno] = mant;

            }

        }

    }

}

static void FUNC_0(Jpeg2000EncoderContext *VAR_0)
{ int VAR_1, VAR_2, VAR_3; Jpeg2000QuantStyle  *qntsty = &VAR_0->qntsty; Jpeg2000CodingStyle *codsty = &VAR_0->codsty; for (VAR_1 = 0; VAR_1 < VAR_0->ncomponents; VAR_1++){ int gbandno = 0; for (VAR_2 = 0; VAR_2 < codsty->nreslevels; VAR_2++){ int nbands, lev = codsty->nreslevels - VAR_2 - 1; nbands = VAR_2 ? 3 : 1; for (VAR_3 = 0; VAR_3 < nbands; VAR_3++, gbandno++){ int expn, mant; if (codsty->transform == FF_DWT97){ int bandpos = VAR_3 + (VAR_2>0),
ss = 81920000 / dwt_norms[0][bandpos][lev],
log = av_log2(ss); mant = (11 - log < 0 ? ss >> log - 11 : ss << 11 - log) & 0x7ff; expn = VAR_0->cbps[VAR_1] - log + 13; } else expn = ((VAR_3&2)>>1) + (VAR_2>0) + VAR_0->cbps[VAR_1]; qntsty->expn[gbandno] = expn; qntsty->mant[gbandno] = mant; } } } }