int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4],

                             int srcRange, const int table[4], int dstRange,

                             int brightness, int contrast, int saturation)

{

    const AVPixFmtDescriptor *desc_dst = av_pix_fmt_desc_get(c->dstFormat);

    const AVPixFmtDescriptor *desc_src = av_pix_fmt_desc_get(c->srcFormat);

    memcpy(c->srcColorspaceTable, inv_table, sizeof(int) * 4);

    memcpy(c->dstColorspaceTable, table, sizeof(int) * 4);



    c->brightness = brightness;

    c->contrast   = contrast;

    c->saturation = saturation;

    c->srcRange   = srcRange;

    c->dstRange   = dstRange;

    if (isYUV(c->dstFormat) || isGray(c->dstFormat))

        return -1;



    c->dstFormatBpp = av_get_bits_per_pixel(desc_dst);

    c->srcFormatBpp = av_get_bits_per_pixel(desc_src);



    ff_yuv2rgb_c_init_tables(c, inv_table, srcRange, brightness,

                             contrast, saturation);

    // FIXME factorize



    if (HAVE_ALTIVEC && av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC)

        ff_yuv2rgb_init_tables_altivec(c, inv_table, brightness,

                                       contrast, saturation);

    return 0;

}

int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4],

                             int srcRange, const int table[4], int dstRange,

                             int brightness, int contrast, int saturation)

{

    const AVPixFmtDescriptor *desc_dst = av_pix_fmt_desc_get(c->dstFormat);

    const AVPixFmtDescriptor *desc_src = av_pix_fmt_desc_get(c->srcFormat);

    memcpy(c->srcColorspaceTable, inv_table, sizeof(int) * 4);

    memcpy(c->dstColorspaceTable, table, sizeof(int) * 4);



    c->brightness = brightness;

    c->contrast   = contrast;

    c->saturation = saturation;

    c->srcRange   = srcRange;

    c->dstRange   = dstRange;

    if (isYUV(c->dstFormat) || isGray(c->dstFormat))

        return -1;



    c->dstFormatBpp = av_get_bits_per_pixel(desc_dst);

    c->srcFormatBpp = av_get_bits_per_pixel(desc_src);



    ff_yuv2rgb_c_init_tables(c, inv_table, srcRange, brightness,

                             contrast, saturation);

    



    if (HAVE_ALTIVEC && av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC)

        ff_yuv2rgb_init_tables_altivec(c, inv_table, brightness,

                                       contrast, saturation);

    return 0;

}

int FUNC_0(struct SwsContext *VAR_0, const int VAR_1[4],

                             int VAR_2, const int VAR_3[4], int VAR_4,

                             int VAR_5, int VAR_6, int VAR_7)

{

    const AVPixFmtDescriptor *VAR_8 = av_pix_fmt_desc_get(VAR_0->dstFormat);

    const AVPixFmtDescriptor *VAR_9 = av_pix_fmt_desc_get(VAR_0->srcFormat);

    memcpy(VAR_0->srcColorspaceTable, VAR_1, sizeof(int) * 4);

    memcpy(VAR_0->dstColorspaceTable, VAR_3, sizeof(int) * 4);



    VAR_0->VAR_5 = VAR_5;

    VAR_0->VAR_6   = VAR_6;

    VAR_0->VAR_7 = VAR_7;

    VAR_0->VAR_2   = VAR_2;

    VAR_0->VAR_4   = VAR_4;

    if (isYUV(VAR_0->dstFormat) || isGray(VAR_0->dstFormat))

        return -1;



    VAR_0->dstFormatBpp = av_get_bits_per_pixel(VAR_8);

    VAR_0->srcFormatBpp = av_get_bits_per_pixel(VAR_9);



    ff_yuv2rgb_c_init_tables(VAR_0, VAR_1, VAR_2, VAR_5,

                             VAR_6, VAR_7);

    



    if (HAVE_ALTIVEC && av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC)

        ff_yuv2rgb_init_tables_altivec(VAR_0, VAR_1, VAR_5,

                                       VAR_6, VAR_7);

    return 0;

}

int FUNC_0(struct SwsContext *VAR_0, const int VAR_1[4],
int VAR_2, const int VAR_3[4], int VAR_4,
int VAR_5, int VAR_6, int VAR_7)
{ const AVPixFmtDescriptor *VAR_8 = av_pix_fmt_desc_get(VAR_0->dstFormat); const AVPixFmtDescriptor *VAR_9 = av_pix_fmt_desc_get(VAR_0->srcFormat); memcpy(VAR_0->srcColorspaceTable, VAR_1, sizeof(int) * 4); memcpy(VAR_0->dstColorspaceTable, VAR_3, sizeof(int) * 4); VAR_0->VAR_5 = VAR_5; VAR_0->VAR_6   = VAR_6; VAR_0->VAR_7 = VAR_7; VAR_0->VAR_2   = VAR_2; VAR_0->VAR_4   = VAR_4; if (isYUV(VAR_0->dstFormat) || isGray(VAR_0->dstFormat))
return -1; VAR_0->dstFormatBpp = av_get_bits_per_pixel(VAR_8); VAR_0->srcFormatBpp = av_get_bits_per_pixel(VAR_9); ff_yuv2rgb_c_init_tables(VAR_0, VAR_1, VAR_2, VAR_5,
VAR_6, VAR_7); if (HAVE_ALTIVEC && av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC)
ff_yuv2rgb_init_tables_altivec(VAR_0, VAR_1, VAR_5,
VAR_6, VAR_7); return 0; }