static void copy_frame(Jpeg2000EncoderContext *s)

{

    int tileno, compno, i, y, x;

    uint8_t *line;

    for (tileno = 0; tileno < s->numXtiles * s->numYtiles; tileno++){

        Jpeg2000Tile *tile = s->tile + tileno;

        if (s->planar){

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

                Jpeg2000Component *comp = tile->comp + compno;

                int *dst = comp->data;

                line = s->picture.data[compno]

                       + comp->coord[1][0] * s->picture.linesize[compno]

                       + comp->coord[0][0];

                for (y = comp->coord[1][0]; y < comp->coord[1][1]; y++){

                    uint8_t *ptr = line;

                    for (x = comp->coord[0][0]; x < comp->coord[0][1]; x++)

                        *dst++ = *ptr++ - (1 << 7);

                    line += s->picture.linesize[compno];

                }

            }

        } else{

            line = s->picture.data[0] + tile->comp[0].coord[1][0] * s->picture.linesize[0]

                   + tile->comp[0].coord[0][0] * s->ncomponents;



            i = 0;

            for (y = tile->comp[0].coord[1][0]; y < tile->comp[0].coord[1][1]; y++){

                uint8_t *ptr = line;

                for (x = tile->comp[0].coord[0][0]; x < tile->comp[0].coord[0][1]; x++, i++){

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

                        tile->comp[compno].data[i] = *ptr++  - (1 << 7);

                    }

                }

                line += s->picture.linesize[0];

            }

        }

    }

}

static void copy_frame(Jpeg2000EncoderContext *s)

{

    int tileno, compno, i, y, x;

    uint8_t *line;

    for (tileno = 0; tileno < s->numXtiles * s->numYtiles; tileno++){

        Jpeg2000Tile *tile = s->tile + tileno;

        if (s->planar){

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

                Jpeg2000Component *comp = tile->comp + compno;

                int *dst = comp->data;

                line = s->picture.data[compno]

                       + comp->coord[1][0] * s->picture.linesize[compno]

                       + comp->coord[0][0];

                for (y = comp->coord[1][0]; y < comp->coord[1][1]; y++){

                    uint8_t *ptr = line;

                    for (x = comp->coord[0][0]; x < comp->coord[0][1]; x++)

                        *dst++ = *ptr++ - (1 << 7);

                    line += s->picture.linesize[compno];

                }

            }

        } else{

            line = s->picture.data[0] + tile->comp[0].coord[1][0] * s->picture.linesize[0]

                   + tile->comp[0].coord[0][0] * s->ncomponents;



            i = 0;

            for (y = tile->comp[0].coord[1][0]; y < tile->comp[0].coord[1][1]; y++){

                uint8_t *ptr = line;

                for (x = tile->comp[0].coord[0][0]; x < tile->comp[0].coord[0][1]; x++, i++){

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

                        tile->comp[compno].data[i] = *ptr++  - (1 << 7);

                    }

                }

                line += s->picture.linesize[0];

            }

        }

    }

}

                int *dst = comp->data;                         tile->comp[compno].data[i] = *ptr++  - (1 << 7);
static void FUNC_0(Jpeg2000EncoderContext *VAR_0)

{

    int VAR_1, VAR_2, VAR_3, VAR_4, VAR_5;

    uint8_t *line;

    for (VAR_1 = 0; VAR_1 < VAR_0->numXtiles * VAR_0->numYtiles; VAR_1++){

        Jpeg2000Tile *tile = VAR_0->tile + VAR_1;

        if (VAR_0->planar){

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

                Jpeg2000Component *comp = tile->comp + VAR_2;

                int *dst = comp->data;

                line = VAR_0->picture.data[VAR_2]

                       + comp->coord[1][0] * VAR_0->picture.linesize[VAR_2]

                       + comp->coord[0][0];

                for (VAR_4 = comp->coord[1][0]; VAR_4 < comp->coord[1][1]; VAR_4++){

                    uint8_t *ptr = line;

                    for (VAR_5 = comp->coord[0][0]; VAR_5 < comp->coord[0][1]; VAR_5++)

                        *dst++ = *ptr++ - (1 << 7);

                    line += VAR_0->picture.linesize[VAR_2];

                }

            }

        } else{

            line = VAR_0->picture.data[0] + tile->comp[0].coord[1][0] * VAR_0->picture.linesize[0]

                   + tile->comp[0].coord[0][0] * VAR_0->ncomponents;



            VAR_3 = 0;

            for (VAR_4 = tile->comp[0].coord[1][0]; VAR_4 < tile->comp[0].coord[1][1]; VAR_4++){

                uint8_t *ptr = line;

                for (VAR_5 = tile->comp[0].coord[0][0]; VAR_5 < tile->comp[0].coord[0][1]; VAR_5++, VAR_3++){

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

                        tile->comp[VAR_2].data[VAR_3] = *ptr++  - (1 << 7);

                    }

                }

                line += VAR_0->picture.linesize[0];

            }

        }

    }

}

static void FUNC_0(Jpeg2000EncoderContext *VAR_0)
{ int VAR_1, VAR_2, VAR_3, VAR_4, VAR_5; uint8_t *line; for (VAR_1 = 0; VAR_1 < VAR_0->numXtiles * VAR_0->numYtiles; VAR_1++){ Jpeg2000Tile *tile = VAR_0->tile + VAR_1; if (VAR_0->planar){ for (VAR_2 = 0; VAR_2 < VAR_0->ncomponents; VAR_2++){ Jpeg2000Component *comp = tile->comp + VAR_2; int *dst = comp->data; line = VAR_0->picture.data[VAR_2]
+ comp->coord[1][0] * VAR_0->picture.linesize[VAR_2]
+ comp->coord[0][0]; for (VAR_4 = comp->coord[1][0]; VAR_4 < comp->coord[1][1]; VAR_4++){ uint8_t *ptr = line; for (VAR_5 = comp->coord[0][0]; VAR_5 < comp->coord[0][1]; VAR_5++) *dst++ = *ptr++ - (1 << 7); line += VAR_0->picture.linesize[VAR_2]; } } } else{ line = VAR_0->picture.data[0] + tile->comp[0].coord[1][0] * VAR_0->picture.linesize[0]
+ tile->comp[0].coord[0][0] * VAR_0->ncomponents; VAR_3 = 0; for (VAR_4 = tile->comp[0].coord[1][0]; VAR_4 < tile->comp[0].coord[1][1]; VAR_4++){ uint8_t *ptr = line; for (VAR_5 = tile->comp[0].coord[0][0]; VAR_5 < tile->comp[0].coord[0][1]; VAR_5++, VAR_3++){ for (VAR_2 = 0; VAR_2 < VAR_0->ncomponents; VAR_2++){ tile->comp[VAR_2].data[VAR_3] = *ptr++  - (1 << 7); } } line += VAR_0->picture.linesize[0]; } } } }