yuv2rgb_2_c_template(SwsContext *c, const uint16_t *buf0,

                     const uint16_t *buf1, const uint16_t *ubuf0,

                     const uint16_t *ubuf1, const uint16_t *vbuf0,

                     const uint16_t *vbuf1, const uint16_t *abuf0,

                     const uint16_t *abuf1, uint8_t *dest, int dstW,

                     int yalpha, int uvalpha, int y,

                     enum PixelFormat target, int hasAlpha)

{

    int  yalpha1 = 4095 - yalpha;

    int uvalpha1 = 4095 - uvalpha;

    int i;



    for (i = 0; i < (dstW >> 1); i++) {

        int Y1 = (buf0[i * 2]     * yalpha1  + buf1[i * 2]     * yalpha)  >> 19;

        int Y2 = (buf0[i * 2 + 1] * yalpha1  + buf1[i * 2 + 1] * yalpha)  >> 19;

        int U  = (ubuf0[i]        * uvalpha1 + ubuf1[i]        * uvalpha) >> 19;

        int V  = (vbuf0[i]        * uvalpha1 + vbuf1[i]        * uvalpha) >> 19;

        int A1, A2;

        const void *r =  c->table_rV[V],

                   *g = (c->table_gU[U] + c->table_gV[V]),

                   *b =  c->table_bU[U];



        if (hasAlpha) {

            A1 = (abuf0[i * 2    ] * yalpha1 + abuf1[i * 2    ] * yalpha) >> 19;

            A2 = (abuf0[i * 2 + 1] * yalpha1 + abuf1[i * 2 + 1] * yalpha) >> 19;

        }



        yuv2rgb_write(dest, i, Y1, Y2, U, V, hasAlpha ? A1 : 0, hasAlpha ? A2 : 0,

                      r, g, b, y, target, hasAlpha);

    }

}

yuv2rgb_2_c_template(SwsContext *c, const uint16_t *buf0,

                     const uint16_t *buf1, const uint16_t *ubuf0,

                     const uint16_t *ubuf1, const uint16_t *vbuf0,

                     const uint16_t *vbuf1, const uint16_t *abuf0,

                     const uint16_t *abuf1, uint8_t *dest, int dstW,

                     int yalpha, int uvalpha, int y,

                     enum PixelFormat target, int hasAlpha)

{

    int  yalpha1 = 4095 - yalpha;

    int uvalpha1 = 4095 - uvalpha;

    int i;



    for (i = 0; i < (dstW >> 1); i++) {

        int Y1 = (buf0[i * 2]     * yalpha1  + buf1[i * 2]     * yalpha)  >> 19;

        int Y2 = (buf0[i * 2 + 1] * yalpha1  + buf1[i * 2 + 1] * yalpha)  >> 19;

        int U  = (ubuf0[i]        * uvalpha1 + ubuf1[i]        * uvalpha) >> 19;

        int V  = (vbuf0[i]        * uvalpha1 + vbuf1[i]        * uvalpha) >> 19;

        int A1, A2;

        const void *r =  c->table_rV[V],

                   *g = (c->table_gU[U] + c->table_gV[V]),

                   *b =  c->table_bU[U];



        if (hasAlpha) {

            A1 = (abuf0[i * 2    ] * yalpha1 + abuf1[i * 2    ] * yalpha) >> 19;

            A2 = (abuf0[i * 2 + 1] * yalpha1 + abuf1[i * 2 + 1] * yalpha) >> 19;

        }



        yuv2rgb_write(dest, i, Y1, Y2, U, V, hasAlpha ? A1 : 0, hasAlpha ? A2 : 0,

                      r, g, b, y, target, hasAlpha);

    }

}

FUNC_0(SwsContext *VAR_0, const uint16_t *VAR_1,

                     const uint16_t *VAR_2, const uint16_t *VAR_3,

                     const uint16_t *VAR_4, const uint16_t *VAR_5,

                     const uint16_t *VAR_6, const uint16_t *VAR_7,

                     const uint16_t *VAR_8, uint8_t *VAR_9, int VAR_10,

                     int VAR_11, int VAR_12, int VAR_13,

                     enum PixelFormat VAR_14, int VAR_15)

{

    int  VAR_16 = 4095 - VAR_11;

    int VAR_17 = 4095 - VAR_12;

    int VAR_18;



    for (VAR_18 = 0; VAR_18 < (VAR_10 >> 1); VAR_18++) {

        int VAR_19 = (VAR_1[VAR_18 * 2]     * VAR_16  + VAR_2[VAR_18 * 2]     * VAR_11)  >> 19;

        int VAR_20 = (VAR_1[VAR_18 * 2 + 1] * VAR_16  + VAR_2[VAR_18 * 2 + 1] * VAR_11)  >> 19;

        int VAR_21  = (VAR_3[VAR_18]        * VAR_17 + VAR_4[VAR_18]        * VAR_12) >> 19;

        int VAR_22  = (VAR_5[VAR_18]        * VAR_17 + VAR_6[VAR_18]        * VAR_12) >> 19;

        int VAR_23, VAR_24;

        const void *VAR_25 =  VAR_0->table_rV[VAR_22],

                   *VAR_26 = (VAR_0->table_gU[VAR_21] + VAR_0->table_gV[VAR_22]),

                   *VAR_27 =  VAR_0->table_bU[VAR_21];



        if (VAR_15) {

            VAR_23 = (VAR_7[VAR_18 * 2    ] * VAR_16 + VAR_8[VAR_18 * 2    ] * VAR_11) >> 19;

            VAR_24 = (VAR_7[VAR_18 * 2 + 1] * VAR_16 + VAR_8[VAR_18 * 2 + 1] * VAR_11) >> 19;

        }



        yuv2rgb_write(VAR_9, VAR_18, VAR_19, VAR_20, VAR_21, VAR_22, VAR_15 ? VAR_23 : 0, VAR_15 ? VAR_24 : 0,

                      VAR_25, VAR_26, VAR_27, VAR_13, VAR_14, VAR_15);

    }

}

FUNC_0(SwsContext *VAR_0, const uint16_t *VAR_1,
const uint16_t *VAR_2, const uint16_t *VAR_3,
const uint16_t *VAR_4, const uint16_t *VAR_5,
const uint16_t *VAR_6, const uint16_t *VAR_7,
const uint16_t *VAR_8, uint8_t *VAR_9, int VAR_10,
int VAR_11, int VAR_12, int VAR_13,
enum PixelFormat VAR_14, int VAR_15)
{ int  VAR_16 = 4095 - VAR_11; int VAR_17 = 4095 - VAR_12; int VAR_18; for (VAR_18 = 0; VAR_18 < (VAR_10 >> 1); VAR_18++) { int VAR_19 = (VAR_1[VAR_18 * 2]     * VAR_16  + VAR_2[VAR_18 * 2]     * VAR_11)  >> 19; int VAR_20 = (VAR_1[VAR_18 * 2 + 1] * VAR_16  + VAR_2[VAR_18 * 2 + 1] * VAR_11)  >> 19; int VAR_21  = (VAR_3[VAR_18]        * VAR_17 + VAR_4[VAR_18]        * VAR_12) >> 19; int VAR_22  = (VAR_5[VAR_18]        * VAR_17 + VAR_6[VAR_18]        * VAR_12) >> 19; int VAR_23, VAR_24; const void *VAR_25 =  VAR_0->table_rV[VAR_22],
*VAR_26 = (VAR_0->table_gU[VAR_21] + VAR_0->table_gV[VAR_22]),
*VAR_27 =  VAR_0->table_bU[VAR_21]; if (VAR_15) { VAR_23 = (VAR_7[VAR_18 * 2    ] * VAR_16 + VAR_8[VAR_18 * 2    ] * VAR_11) >> 19; VAR_24 = (VAR_7[VAR_18 * 2 + 1] * VAR_16 + VAR_8[VAR_18 * 2 + 1] * VAR_11) >> 19; } yuv2rgb_write(VAR_9, VAR_18, VAR_19, VAR_20, VAR_21, VAR_22, VAR_15 ? VAR_23 : 0, VAR_15 ? VAR_24 : 0,
VAR_25, VAR_26, VAR_27, VAR_13, VAR_14, VAR_15); } }