yuv2ya8_2_c(SwsContext *c, const int16_t *buf[2],

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

            const int16_t *abuf[2], uint8_t *dest, int dstW,

            int yalpha, int uvalpha, int y)

{

    int hasAlpha = abuf[0] && abuf[1];

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

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

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

    int  yalpha1 = 4096 - yalpha;

    int i;



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

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

        int A;



        Y = av_clip_uint8(Y);



        if (hasAlpha) {

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

            A = av_clip_uint8(A);

        }



        dest[i * 2    ] = Y;

        dest[i * 2 + 1] = hasAlpha ? A : 255;

    }

}

yuv2ya8_2_c(SwsContext *c, const int16_t *buf[2],

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

            const int16_t *abuf[2], uint8_t *dest, int dstW,

            int yalpha, int uvalpha, int y)

{

    int hasAlpha = abuf[0] && abuf[1];

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

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

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

    int  yalpha1 = 4096 - yalpha;

    int i;



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

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

        int A;



        Y = av_clip_uint8(Y);



        if (hasAlpha) {

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

            A = av_clip_uint8(A);

        }



        dest[i * 2    ] = Y;

        dest[i * 2 + 1] = hasAlpha ? A : 255;

    }

}

    int hasAlpha = abuf[0] && abuf[1];
FUNC_0(SwsContext *VAR_0, const int16_t *VAR_1[2],

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

            const int16_t *VAR_4[2], uint8_t *VAR_5, int VAR_6,

            int VAR_7, int VAR_8, int VAR_9)

{

    int VAR_10 = VAR_4[0] && VAR_4[1];

    const int16_t *VAR_11  = VAR_1[0],  *buf1  = VAR_1[1],

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

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

    int  VAR_12 = 4096 - VAR_7;

    int VAR_13;



    for (VAR_13 = 0; VAR_13 < VAR_6; VAR_13++) {

        int VAR_14 = (VAR_11[VAR_13 * 2] * VAR_12 + buf1[VAR_13 * 2] * VAR_7) >> 19;

        int VAR_15;



        VAR_14 = av_clip_uint8(VAR_14);



        if (VAR_10) {

            VAR_15 = (abuf0[VAR_13 * 2] * VAR_12 + abuf1[VAR_13 * 2] * VAR_7) >> 19;

            VAR_15 = av_clip_uint8(VAR_15);

        }



        VAR_5[VAR_13 * 2    ] = VAR_14;

        VAR_5[VAR_13 * 2 + 1] = VAR_10 ? VAR_15 : 255;

    }

}

FUNC_0(SwsContext *VAR_0, const int16_t *VAR_1[2],
const int16_t *VAR_2[2], const int16_t *VAR_3[2],
const int16_t *VAR_4[2], uint8_t *VAR_5, int VAR_6,
int VAR_7, int VAR_8, int VAR_9)
{ int VAR_10 = VAR_4[0] && VAR_4[1]; const int16_t *VAR_11  = VAR_1[0],  *buf1  = VAR_1[1],
*abuf0 = VAR_10 ? VAR_4[0] : NULL,
*abuf1 = VAR_10 ? VAR_4[1] : NULL; int  VAR_12 = 4096 - VAR_7; int VAR_13; for (VAR_13 = 0; VAR_13 < VAR_6; VAR_13++) { int VAR_14 = (VAR_11[VAR_13 * 2] * VAR_12 + buf1[VAR_13 * 2] * VAR_7) >> 19; int VAR_15; VAR_14 = av_clip_uint8(VAR_14); if (VAR_10) { VAR_15 = (abuf0[VAR_13 * 2] * VAR_12 + abuf1[VAR_13 * 2] * VAR_7) >> 19; VAR_15 = av_clip_uint8(VAR_15); } VAR_5[VAR_13 * 2    ] = VAR_14; VAR_5[VAR_13 * 2 + 1] = VAR_10 ? VAR_15 : 255; } }