rgb16_32ToUV_c_template(uint8_t *dstU, uint8_t *dstV,

                        const uint8_t *src, int width,

                        enum PixelFormat origin,

                        int shr,   int shg,   int shb, int shp,

                        int maskr, int maskg, int maskb,

                        int rsh,   int gsh,   int bsh, int S)

{

    const int ru = RU << rsh, gu = GU << gsh, bu = BU << bsh,

              rv = RV << rsh, gv = GV << gsh, bv = BV << bsh,

              rnd = 257 << (S - 1);

    int i;



    for (i = 0; i < width; i++) {

        int px = input_pixel(i) >> shp;

        int b = (px & maskb) >> shb;

        int g = (px & maskg) >> shg;

        int r = (px & maskr) >> shr;



        dstU[i] = (ru * r + gu * g + bu * b + rnd) >> S;

        dstV[i] = (rv * r + gv * g + bv * b + rnd) >> S;

    }

}

rgb16_32ToUV_c_template(uint8_t *dstU, uint8_t *dstV,

                        const uint8_t *src, int width,

                        enum PixelFormat origin,

                        int shr,   int shg,   int shb, int shp,

                        int maskr, int maskg, int maskb,

                        int rsh,   int gsh,   int bsh, int S)

{

    const int ru = RU << rsh, gu = GU << gsh, bu = BU << bsh,

              rv = RV << rsh, gv = GV << gsh, bv = BV << bsh,

              rnd = 257 << (S - 1);

    int i;



    for (i = 0; i < width; i++) {

        int px = input_pixel(i) >> shp;

        int b = (px & maskb) >> shb;

        int g = (px & maskg) >> shg;

        int r = (px & maskr) >> shr;



        dstU[i] = (ru * r + gu * g + bu * b + rnd) >> S;

        dstV[i] = (rv * r + gv * g + bv * b + rnd) >> S;

    }

}

              rv = RV << rsh, gv = GV << gsh, bv = BV << bsh,               rnd = 257 << (S - 1);
FUNC_0(uint8_t *VAR_0, uint8_t *VAR_1,

                        const uint8_t *VAR_2, int VAR_3,

                        enum PixelFormat VAR_4,

                        int VAR_5,   int VAR_6,   int VAR_7, int VAR_8,

                        int VAR_9, int VAR_10, int VAR_11,

                        int VAR_12,   int VAR_13,   int VAR_14, int VAR_15)

{

    const int VAR_16 = RU << VAR_12, VAR_17 = GU << VAR_13, VAR_18 = BU << VAR_14,

              VAR_19 = RV << VAR_12, VAR_20 = GV << VAR_13, VAR_21 = BV << VAR_14,

              VAR_22 = 257 << (VAR_15 - 1);

    int VAR_23;



    for (VAR_23 = 0; VAR_23 < VAR_3; VAR_23++) {

        int VAR_24 = input_pixel(VAR_23) >> VAR_8;

        int VAR_25 = (VAR_24 & VAR_11) >> VAR_7;

        int VAR_26 = (VAR_24 & VAR_10) >> VAR_6;

        int VAR_27 = (VAR_24 & VAR_9) >> VAR_5;



        VAR_0[VAR_23] = (VAR_16 * VAR_27 + VAR_17 * VAR_26 + VAR_18 * VAR_25 + VAR_22) >> VAR_15;

        VAR_1[VAR_23] = (VAR_19 * VAR_27 + VAR_20 * VAR_26 + VAR_21 * VAR_25 + VAR_22) >> VAR_15;

    }

}

FUNC_0(uint8_t *VAR_0, uint8_t *VAR_1,
const uint8_t *VAR_2, int VAR_3,
enum PixelFormat VAR_4,
int VAR_5,   int VAR_6,   int VAR_7, int VAR_8,
int VAR_9, int VAR_10, int VAR_11,
int VAR_12,   int VAR_13,   int VAR_14, int VAR_15)
{ const int VAR_16 = RU << VAR_12, VAR_17 = GU << VAR_13, VAR_18 = BU << VAR_14,
VAR_19 = RV << VAR_12, VAR_20 = GV << VAR_13, VAR_21 = BV << VAR_14,
VAR_22 = 257 << (VAR_15 - 1); int VAR_23; for (VAR_23 = 0; VAR_23 < VAR_3; VAR_23++) { int VAR_24 = input_pixel(VAR_23) >> VAR_8; int VAR_25 = (VAR_24 & VAR_11) >> VAR_7; int VAR_26 = (VAR_24 & VAR_10) >> VAR_6; int VAR_27 = (VAR_24 & VAR_9) >> VAR_5; VAR_0[VAR_23] = (VAR_16 * VAR_27 + VAR_17 * VAR_26 + VAR_18 * VAR_25 + VAR_22) >> VAR_15; VAR_1[VAR_23] = (VAR_19 * VAR_27 + VAR_20 * VAR_26 + VAR_21 * VAR_25 + VAR_22) >> VAR_15; } }