yuv2rgba64_2_c_template(SwsContext *c, const int32_t *buf[2],

                       const int32_t *ubuf[2], const int32_t *vbuf[2],

                       const int32_t *abuf[2], uint16_t *dest, int dstW,

                       int yalpha, int uvalpha, int y,

                       enum AVPixelFormat target, int hasAlpha, int eightbytes)

{

    const int32_t *buf0  = buf[0],  *buf1  = buf[1],

                  *ubuf0 = ubuf[0], *ubuf1 = ubuf[1],

                  *vbuf0 = vbuf[0], *vbuf1 = vbuf[1],

                  *abuf0 = hasAlpha ? abuf[0] : NULL,

                  *abuf1 = hasAlpha ? abuf[1] : NULL;

    int  yalpha1 = 4096 - yalpha;

    int uvalpha1 = 4096 - uvalpha;

    int i;

    int A1 = 0xffff<<14, A2 = 0xffff<<14;



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

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

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

        int U  = (ubuf0[i]        * uvalpha1 + ubuf1[i]        * uvalpha + (-128 << 23)) >> 14;

        int V  = (vbuf0[i]        * uvalpha1 + vbuf1[i]        * uvalpha + (-128 << 23)) >> 14;

        int R, G, B;



        Y1 -= c->yuv2rgb_y_offset;

        Y2 -= c->yuv2rgb_y_offset;

        Y1 *= c->yuv2rgb_y_coeff;

        Y2 *= c->yuv2rgb_y_coeff;

        Y1 += 1 << 13;

        Y2 += 1 << 13;



        R = V * c->yuv2rgb_v2r_coeff;

        G = V * c->yuv2rgb_v2g_coeff + U * c->yuv2rgb_u2g_coeff;

        B =                            U * c->yuv2rgb_u2b_coeff;



        if (hasAlpha) {

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

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



            A1 += 1 << 13;

            A2 += 1 << 13;

        }



        output_pixel(&dest[0], av_clip_uintp2(R_B + Y1, 30) >> 14);

        output_pixel(&dest[1], av_clip_uintp2(  G + Y1, 30) >> 14);

        output_pixel(&dest[2], av_clip_uintp2(B_R + Y1, 30) >> 14);

        if (eightbytes) {

            output_pixel(&dest[3], av_clip_uintp2(A1      , 30) >> 14);

            output_pixel(&dest[4], av_clip_uintp2(R_B + Y2, 30) >> 14);

            output_pixel(&dest[5], av_clip_uintp2(  G + Y2, 30) >> 14);

            output_pixel(&dest[6], av_clip_uintp2(B_R + Y2, 30) >> 14);

            output_pixel(&dest[7], av_clip_uintp2(A2      , 30) >> 14);

            dest += 8;

        } else {

            output_pixel(&dest[3], av_clip_uintp2(R_B + Y2, 30) >> 14);

            output_pixel(&dest[4], av_clip_uintp2(  G + Y2, 30) >> 14);

            output_pixel(&dest[5], av_clip_uintp2(B_R + Y2, 30) >> 14);

            dest += 6;

        }

    }

}

yuv2rgba64_2_c_template(SwsContext *c, const int32_t *buf[2],

                       const int32_t *ubuf[2], const int32_t *vbuf[2],

                       const int32_t *abuf[2], uint16_t *dest, int dstW,

                       int yalpha, int uvalpha, int y,

                       enum AVPixelFormat target, int hasAlpha, int eightbytes)

{

    const int32_t *buf0  = buf[0],  *buf1  = buf[1],

                  *ubuf0 = ubuf[0], *ubuf1 = ubuf[1],

                  *vbuf0 = vbuf[0], *vbuf1 = vbuf[1],

                  *abuf0 = hasAlpha ? abuf[0] : NULL,

                  *abuf1 = hasAlpha ? abuf[1] : NULL;

    int  yalpha1 = 4096 - yalpha;

    int uvalpha1 = 4096 - uvalpha;

    int i;

    int A1 = 0xffff<<14, A2 = 0xffff<<14;



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

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

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

        int U  = (ubuf0[i]        * uvalpha1 + ubuf1[i]        * uvalpha + (-128 << 23)) >> 14;

        int V  = (vbuf0[i]        * uvalpha1 + vbuf1[i]        * uvalpha + (-128 << 23)) >> 14;

        int R, G, B;



        Y1 -= c->yuv2rgb_y_offset;

        Y2 -= c->yuv2rgb_y_offset;

        Y1 *= c->yuv2rgb_y_coeff;

        Y2 *= c->yuv2rgb_y_coeff;

        Y1 += 1 << 13;

        Y2 += 1 << 13;



        R = V * c->yuv2rgb_v2r_coeff;

        G = V * c->yuv2rgb_v2g_coeff + U * c->yuv2rgb_u2g_coeff;

        B =                            U * c->yuv2rgb_u2b_coeff;



        if (hasAlpha) {

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

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



            A1 += 1 << 13;

            A2 += 1 << 13;

        }



        output_pixel(&dest[0], av_clip_uintp2(R_B + Y1, 30) >> 14);

        output_pixel(&dest[1], av_clip_uintp2(  G + Y1, 30) >> 14);

        output_pixel(&dest[2], av_clip_uintp2(B_R + Y1, 30) >> 14);

        if (eightbytes) {

            output_pixel(&dest[3], av_clip_uintp2(A1      , 30) >> 14);

            output_pixel(&dest[4], av_clip_uintp2(R_B + Y2, 30) >> 14);

            output_pixel(&dest[5], av_clip_uintp2(  G + Y2, 30) >> 14);

            output_pixel(&dest[6], av_clip_uintp2(B_R + Y2, 30) >> 14);

            output_pixel(&dest[7], av_clip_uintp2(A2      , 30) >> 14);

            dest += 8;

        } else {

            output_pixel(&dest[3], av_clip_uintp2(R_B + Y2, 30) >> 14);

            output_pixel(&dest[4], av_clip_uintp2(  G + Y2, 30) >> 14);

            output_pixel(&dest[5], av_clip_uintp2(B_R + Y2, 30) >> 14);

            dest += 6;

        }

    }

}

FUNC_0(SwsContext *VAR_0, const int32_t *VAR_1[2],

                       const int32_t *VAR_2[2], const int32_t *VAR_3[2],

                       const int32_t *VAR_4[2], uint16_t *VAR_5, int VAR_6,

                       int VAR_7, int VAR_8, int VAR_9,

                       enum AVPixelFormat VAR_10, int VAR_11, int VAR_12)

{

    const int32_t *VAR_13  = VAR_1[0],  *buf1  = VAR_1[1],

                  *ubuf0 = VAR_2[0], *ubuf1 = VAR_2[1],

                  *vbuf0 = VAR_3[0], *vbuf1 = VAR_3[1],

                  *abuf0 = VAR_11 ? VAR_4[0] : NULL,

                  *abuf1 = VAR_11 ? VAR_4[1] : NULL;

    int  VAR_14 = 4096 - VAR_7;

    int VAR_15 = 4096 - VAR_8;

    int VAR_16;

    int VAR_17 = 0xffff<<14, VAR_18 = 0xffff<<14;



    for (VAR_16 = 0; VAR_16 < ((VAR_6 + 1) >> 1); VAR_16++) {

        int VAR_19 = (VAR_13[VAR_16 * 2]     * VAR_14  + buf1[VAR_16 * 2]     * VAR_7) >> 14;

        int VAR_20 = (VAR_13[VAR_16 * 2 + 1] * VAR_14  + buf1[VAR_16 * 2 + 1] * VAR_7) >> 14;

        int VAR_21  = (ubuf0[VAR_16]        * VAR_15 + ubuf1[VAR_16]        * VAR_8 + (-128 << 23)) >> 14;

        int VAR_22  = (vbuf0[VAR_16]        * VAR_15 + vbuf1[VAR_16]        * VAR_8 + (-128 << 23)) >> 14;

        int VAR_23, VAR_24, VAR_25;



        VAR_19 -= VAR_0->yuv2rgb_y_offset;

        VAR_20 -= VAR_0->yuv2rgb_y_offset;

        VAR_19 *= VAR_0->yuv2rgb_y_coeff;

        VAR_20 *= VAR_0->yuv2rgb_y_coeff;

        VAR_19 += 1 << 13;

        VAR_20 += 1 << 13;



        VAR_23 = VAR_22 * VAR_0->yuv2rgb_v2r_coeff;

        VAR_24 = VAR_22 * VAR_0->yuv2rgb_v2g_coeff + VAR_21 * VAR_0->yuv2rgb_u2g_coeff;

        VAR_25 =                            VAR_21 * VAR_0->yuv2rgb_u2b_coeff;



        if (VAR_11) {

            VAR_17 = (abuf0[VAR_16 * 2    ] * VAR_14 + abuf1[VAR_16 * 2    ] * VAR_7) >> 1;

            VAR_18 = (abuf0[VAR_16 * 2 + 1] * VAR_14 + abuf1[VAR_16 * 2 + 1] * VAR_7) >> 1;



            VAR_17 += 1 << 13;

            VAR_18 += 1 << 13;

        }



        output_pixel(&VAR_5[0], av_clip_uintp2(R_B + VAR_19, 30) >> 14);

        output_pixel(&VAR_5[1], av_clip_uintp2(  VAR_24 + VAR_19, 30) >> 14);

        output_pixel(&VAR_5[2], av_clip_uintp2(B_R + VAR_19, 30) >> 14);

        if (VAR_12) {

            output_pixel(&VAR_5[3], av_clip_uintp2(VAR_17      , 30) >> 14);

            output_pixel(&VAR_5[4], av_clip_uintp2(R_B + VAR_20, 30) >> 14);

            output_pixel(&VAR_5[5], av_clip_uintp2(  VAR_24 + VAR_20, 30) >> 14);

            output_pixel(&VAR_5[6], av_clip_uintp2(B_R + VAR_20, 30) >> 14);

            output_pixel(&VAR_5[7], av_clip_uintp2(VAR_18      , 30) >> 14);

            VAR_5 += 8;

        } else {

            output_pixel(&VAR_5[3], av_clip_uintp2(R_B + VAR_20, 30) >> 14);

            output_pixel(&VAR_5[4], av_clip_uintp2(  VAR_24 + VAR_20, 30) >> 14);

            output_pixel(&VAR_5[5], av_clip_uintp2(B_R + VAR_20, 30) >> 14);

            VAR_5 += 6;

        }

    }

}

FUNC_0(SwsContext *VAR_0, const int32_t *VAR_1[2],
const int32_t *VAR_2[2], const int32_t *VAR_3[2],
const int32_t *VAR_4[2], uint16_t *VAR_5, int VAR_6,
int VAR_7, int VAR_8, int VAR_9,
enum AVPixelFormat VAR_10, int VAR_11, int VAR_12)
{ const int32_t *VAR_13  = VAR_1[0],  *buf1  = VAR_1[1],
*ubuf0 = VAR_2[0], *ubuf1 = VAR_2[1],
*vbuf0 = VAR_3[0], *vbuf1 = VAR_3[1],
*abuf0 = VAR_11 ? VAR_4[0] : NULL,
*abuf1 = VAR_11 ? VAR_4[1] : NULL; int  VAR_14 = 4096 - VAR_7; int VAR_15 = 4096 - VAR_8; int VAR_16; int VAR_17 = 0xffff<<14, VAR_18 = 0xffff<<14; for (VAR_16 = 0; VAR_16 < ((VAR_6 + 1) >> 1); VAR_16++) { int VAR_19 = (VAR_13[VAR_16 * 2]     * VAR_14  + buf1[VAR_16 * 2]     * VAR_7) >> 14; int VAR_20 = (VAR_13[VAR_16 * 2 + 1] * VAR_14  + buf1[VAR_16 * 2 + 1] * VAR_7) >> 14; int VAR_21  = (ubuf0[VAR_16]        * VAR_15 + ubuf1[VAR_16]        * VAR_8 + (-128 << 23)) >> 14; int VAR_22  = (vbuf0[VAR_16]        * VAR_15 + vbuf1[VAR_16]        * VAR_8 + (-128 << 23)) >> 14; int VAR_23, VAR_24, VAR_25; VAR_19 -= VAR_0->yuv2rgb_y_offset; VAR_20 -= VAR_0->yuv2rgb_y_offset; VAR_19 *= VAR_0->yuv2rgb_y_coeff; VAR_20 *= VAR_0->yuv2rgb_y_coeff; VAR_19 += 1 << 13; VAR_20 += 1 << 13; VAR_23 = VAR_22 * VAR_0->yuv2rgb_v2r_coeff; VAR_24 = VAR_22 * VAR_0->yuv2rgb_v2g_coeff + VAR_21 * VAR_0->yuv2rgb_u2g_coeff; VAR_25 =                            VAR_21 * VAR_0->yuv2rgb_u2b_coeff; if (VAR_11) { VAR_17 = (abuf0[VAR_16 * 2    ] * VAR_14 + abuf1[VAR_16 * 2    ] * VAR_7) >> 1; VAR_18 = (abuf0[VAR_16 * 2 + 1] * VAR_14 + abuf1[VAR_16 * 2 + 1] * VAR_7) >> 1; VAR_17 += 1 << 13; VAR_18 += 1 << 13; } output_pixel(&VAR_5[0], av_clip_uintp2(R_B + VAR_19, 30) >> 14); output_pixel(&VAR_5[1], av_clip_uintp2(  VAR_24 + VAR_19, 30) >> 14); output_pixel(&VAR_5[2], av_clip_uintp2(B_R + VAR_19, 30) >> 14); if (VAR_12) { output_pixel(&VAR_5[3], av_clip_uintp2(VAR_17      , 30) >> 14); output_pixel(&VAR_5[4], av_clip_uintp2(R_B + VAR_20, 30) >> 14); output_pixel(&VAR_5[5], av_clip_uintp2(  VAR_24 + VAR_20, 30) >> 14); output_pixel(&VAR_5[6], av_clip_uintp2(B_R + VAR_20, 30) >> 14); output_pixel(&VAR_5[7], av_clip_uintp2(VAR_18      , 30) >> 14); VAR_5 += 8; } else { output_pixel(&VAR_5[3], av_clip_uintp2(R_B + VAR_20, 30) >> 14); output_pixel(&VAR_5[4], av_clip_uintp2(  VAR_24 + VAR_20, 30) >> 14); output_pixel(&VAR_5[5], av_clip_uintp2(B_R + VAR_20, 30) >> 14); VAR_5 += 6; } } }