static inline void libopenjpeg_copyto16(AVFrame *picture, opj_image_t *image) {

    int *comp_data;

    uint16_t *img_ptr;

    int index, x, y;

    int adjust[4];

    for (x = 0; x < image->numcomps; x++)

        adjust[x] = FFMAX(FFMIN(av_pix_fmt_desc_get(picture->format)->comp[x].depth_minus1 + 1 - image->comps[x].prec, 8), 0);



    for (index = 0; index < image->numcomps; index++) {

        comp_data = image->comps[index].data;

        for (y = 0; y < image->comps[index].h; y++) {

            img_ptr = (uint16_t*) (picture->data[index] + y * picture->linesize[index]);

            for (x = 0; x < image->comps[index].w; x++) {

                *img_ptr = 0x8000 * image->comps[index].sgnd + (*comp_data << adjust[index]);

                img_ptr++;

                comp_data++;

            }

        }

    }

}

static inline void libopenjpeg_copyto16(AVFrame *picture, opj_image_t *image) {

    int *comp_data;

    uint16_t *img_ptr;

    int index, x, y;

    int adjust[4];

    for (x = 0; x < image->numcomps; x++)

        adjust[x] = FFMAX(FFMIN(av_pix_fmt_desc_get(picture->format)->comp[x].depth_minus1 + 1 - image->comps[x].prec, 8), 0);



    for (index = 0; index < image->numcomps; index++) {

        comp_data = image->comps[index].data;

        for (y = 0; y < image->comps[index].h; y++) {

            img_ptr = (uint16_t*) (picture->data[index] + y * picture->linesize[index]);

            for (x = 0; x < image->comps[index].w; x++) {

                *img_ptr = 0x8000 * image->comps[index].sgnd + (*comp_data << adjust[index]);

                img_ptr++;

                comp_data++;

            }

        }

    }

}

                *img_ptr = 0x8000 * image->comps[index].sgnd + (*comp_data << adjust[index]);
static inline void FUNC_0(AVFrame *VAR_0, opj_image_t *VAR_1) {

    int *VAR_2;

    uint16_t *img_ptr;

    int VAR_3, VAR_4, VAR_5;

    int VAR_6[4];

    for (VAR_4 = 0; VAR_4 < VAR_1->numcomps; VAR_4++)

        VAR_6[VAR_4] = FFMAX(FFMIN(av_pix_fmt_desc_get(VAR_0->format)->comp[VAR_4].depth_minus1 + 1 - VAR_1->comps[VAR_4].prec, 8), 0);



    for (VAR_3 = 0; VAR_3 < VAR_1->numcomps; VAR_3++) {

        VAR_2 = VAR_1->comps[VAR_3].data;

        for (VAR_5 = 0; VAR_5 < VAR_1->comps[VAR_3].h; VAR_5++) {

            img_ptr = (uint16_t*) (VAR_0->data[VAR_3] + VAR_5 * VAR_0->linesize[VAR_3]);

            for (VAR_4 = 0; VAR_4 < VAR_1->comps[VAR_3].w; VAR_4++) {

                *img_ptr = 0x8000 * VAR_1->comps[VAR_3].sgnd + (*VAR_2 << VAR_6[VAR_3]);

                img_ptr++;

                VAR_2++;

            }

        }

    }

}

static inline void FUNC_0(AVFrame *VAR_0, opj_image_t *VAR_1) { int *VAR_2; uint16_t *img_ptr; int VAR_3, VAR_4, VAR_5; int VAR_6[4]; for (VAR_4 = 0; VAR_4 < VAR_1->numcomps; VAR_4++) VAR_6[VAR_4] = FFMAX(FFMIN(av_pix_fmt_desc_get(VAR_0->format)->comp[VAR_4].depth_minus1 + 1 - VAR_1->comps[VAR_4].prec, 8), 0); for (VAR_3 = 0; VAR_3 < VAR_1->numcomps; VAR_3++) { VAR_2 = VAR_1->comps[VAR_3].data; for (VAR_5 = 0; VAR_5 < VAR_1->comps[VAR_3].h; VAR_5++) { img_ptr = (uint16_t*) (VAR_0->data[VAR_3] + VAR_5 * VAR_0->linesize[VAR_3]); for (VAR_4 = 0; VAR_4 < VAR_1->comps[VAR_3].w; VAR_4++) { *img_ptr = 0x8000 * VAR_1->comps[VAR_3].sgnd + (*VAR_2 << VAR_6[VAR_3]); img_ptr++; VAR_2++; } } } }