void ff_jpeg2000_cleanup(Jpeg2000Component *comp, Jpeg2000CodingStyle *codsty)

{

    int reslevelno, bandno, precno;

    for (reslevelno = 0;

         comp->reslevel && reslevelno < codsty->nreslevels;

         reslevelno++) {

        Jpeg2000ResLevel *reslevel;



        if (!comp->reslevel)

            continue;



        reslevel = comp->reslevel + reslevelno;

        for (bandno = 0; bandno < reslevel->nbands; bandno++) {

            Jpeg2000Band *band;



            if (!reslevel->band)

                continue;



            band = reslevel->band + bandno;

            for (precno = 0; precno < reslevel->num_precincts_x * reslevel->num_precincts_y; precno++) {

                if (band->prec) {

                    Jpeg2000Prec *prec = band->prec + precno;

                    av_freep(&prec->zerobits);

                    av_freep(&prec->cblkincl);

                    av_freep(&prec->cblk);

                }

            }



            av_freep(&band->prec);

        }

        av_freep(&reslevel->band);

    }



    ff_dwt_destroy(&comp->dwt);

    av_freep(&comp->reslevel);

    av_freep(&comp->i_data);

    av_freep(&comp->f_data);

}

void ff_jpeg2000_cleanup(Jpeg2000Component *comp, Jpeg2000CodingStyle *codsty)

{

    int reslevelno, bandno, precno;

    for (reslevelno = 0;

         comp->reslevel && reslevelno < codsty->nreslevels;

         reslevelno++) {

        Jpeg2000ResLevel *reslevel;



        if (!comp->reslevel)

            continue;



        reslevel = comp->reslevel + reslevelno;

        for (bandno = 0; bandno < reslevel->nbands; bandno++) {

            Jpeg2000Band *band;



            if (!reslevel->band)

                continue;



            band = reslevel->band + bandno;

            for (precno = 0; precno < reslevel->num_precincts_x * reslevel->num_precincts_y; precno++) {

                if (band->prec) {

                    Jpeg2000Prec *prec = band->prec + precno;

                    av_freep(&prec->zerobits);

                    av_freep(&prec->cblkincl);

                    av_freep(&prec->cblk);

                }

            }



            av_freep(&band->prec);

        }

        av_freep(&reslevel->band);

    }



    ff_dwt_destroy(&comp->dwt);

    av_freep(&comp->reslevel);

    av_freep(&comp->i_data);

    av_freep(&comp->f_data);

}

                    av_freep(&prec->cblk);
void FUNC_0(Jpeg2000Component *VAR_0, Jpeg2000CodingStyle *VAR_1)

{

    int VAR_2, VAR_3, VAR_4;

    for (VAR_2 = 0;

         VAR_0->reslevel && VAR_2 < VAR_1->nreslevels;

         VAR_2++) {

        Jpeg2000ResLevel *reslevel;



        if (!VAR_0->reslevel)

            continue;



        reslevel = VAR_0->reslevel + VAR_2;

        for (VAR_3 = 0; VAR_3 < reslevel->nbands; VAR_3++) {

            Jpeg2000Band *band;



            if (!reslevel->band)

                continue;



            band = reslevel->band + VAR_3;

            for (VAR_4 = 0; VAR_4 < reslevel->num_precincts_x * reslevel->num_precincts_y; VAR_4++) {

                if (band->prec) {

                    Jpeg2000Prec *prec = band->prec + VAR_4;

                    av_freep(&prec->zerobits);

                    av_freep(&prec->cblkincl);

                    av_freep(&prec->cblk);

                }

            }



            av_freep(&band->prec);

        }

        av_freep(&reslevel->band);

    }



    ff_dwt_destroy(&VAR_0->dwt);

    av_freep(&VAR_0->reslevel);

    av_freep(&VAR_0->i_data);

    av_freep(&VAR_0->f_data);

}

void FUNC_0(Jpeg2000Component *VAR_0, Jpeg2000CodingStyle *VAR_1)
{ int VAR_2, VAR_3, VAR_4; for (VAR_2 = 0; VAR_0->reslevel && VAR_2 < VAR_1->nreslevels; VAR_2++) { Jpeg2000ResLevel *reslevel; if (!VAR_0->reslevel)
continue; reslevel = VAR_0->reslevel + VAR_2; for (VAR_3 = 0; VAR_3 < reslevel->nbands; VAR_3++) { Jpeg2000Band *band; if (!reslevel->band)
continue; band = reslevel->band + VAR_3; for (VAR_4 = 0; VAR_4 < reslevel->num_precincts_x * reslevel->num_precincts_y; VAR_4++) { if (band->prec) { Jpeg2000Prec *prec = band->prec + VAR_4; av_freep(&prec->zerobits); av_freep(&prec->cblkincl); av_freep(&prec->cblk); } } av_freep(&band->prec); } av_freep(&reslevel->band); } ff_dwt_destroy(&VAR_0->dwt); av_freep(&VAR_0->reslevel); av_freep(&VAR_0->i_data); av_freep(&VAR_0->f_data); }