yuv2rgb_full_2_c_template(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,

                     enum AVPixelFormat target, int hasAlpha)

{

    const int16_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 step = (target == AV_PIX_FMT_RGB24 || target == AV_PIX_FMT_BGR24) ? 3 : 4;

    int err[4] = {0};



    if(   target == AV_PIX_FMT_BGR4_BYTE || target == AV_PIX_FMT_RGB4_BYTE

       || target == AV_PIX_FMT_BGR8      || target == AV_PIX_FMT_RGB8)

        step = 1;



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

        int Y = ( buf0[i] * yalpha1  +  buf1[i] * yalpha             ) >> 10; //FIXME rounding

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

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

        int A;



        if (hasAlpha) {

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

            if (A & 0x100)

                A = av_clip_uint8(A);

        }



        yuv2rgb_write_full(c, dest, i, Y, A, U, V, y, target, hasAlpha, err);

        dest += step;

    }

    c->dither_error[0][i] = err[0];

    c->dither_error[1][i] = err[1];

    c->dither_error[2][i] = err[2];

}

yuv2rgb_full_2_c_template(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,

                     enum AVPixelFormat target, int hasAlpha)

{

    const int16_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 step = (target == AV_PIX_FMT_RGB24 || target == AV_PIX_FMT_BGR24) ? 3 : 4;

    int err[4] = {0};



    if(   target == AV_PIX_FMT_BGR4_BYTE || target == AV_PIX_FMT_RGB4_BYTE

       || target == AV_PIX_FMT_BGR8      || target == AV_PIX_FMT_RGB8)

        step = 1;



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

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

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

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

        int A;



        if (hasAlpha) {

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

            if (A & 0x100)

                A = av_clip_uint8(A);

        }



        yuv2rgb_write_full(c, dest, i, Y, A, U, V, y, target, hasAlpha, err);

        dest += step;

    }

    c->dither_error[0][i] = err[0];

    c->dither_error[1][i] = err[1];

    c->dither_error[2][i] = err[2];

}

        int A;         int A;
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,

                     enum AVPixelFormat VAR_10, int VAR_11)

{

    const int16_t *VAR_12  = 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_13 = 4096 - VAR_7;

    int VAR_14 = 4096 - VAR_8;

    int VAR_15;

    int VAR_16 = (VAR_10 == AV_PIX_FMT_RGB24 || VAR_10 == AV_PIX_FMT_BGR24) ? 3 : 4;

    int VAR_17[4] = {0};



    if(   VAR_10 == AV_PIX_FMT_BGR4_BYTE || VAR_10 == AV_PIX_FMT_RGB4_BYTE

       || VAR_10 == AV_PIX_FMT_BGR8      || VAR_10 == AV_PIX_FMT_RGB8)

        VAR_16 = 1;



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

        int VAR_18 = ( VAR_12[VAR_15] * VAR_13  +  buf1[VAR_15] * VAR_7             ) >> 10; 

        int VAR_19 = (ubuf0[VAR_15] * VAR_14 + ubuf1[VAR_15] * VAR_8-(128 << 19)) >> 10;

        int VAR_20 = (vbuf0[VAR_15] * VAR_14 + vbuf1[VAR_15] * VAR_8-(128 << 19)) >> 10;

        int VAR_21;



        if (VAR_11) {

            VAR_21 = (abuf0[VAR_15] * VAR_13 + abuf1[VAR_15] * VAR_7 + (1<<18)) >> 19;

            if (VAR_21 & 0x100)

                VAR_21 = av_clip_uint8(VAR_21);

        }



        yuv2rgb_write_full(VAR_0, VAR_5, VAR_15, VAR_18, VAR_21, VAR_19, VAR_20, VAR_9, VAR_10, VAR_11, VAR_17);

        VAR_5 += VAR_16;

    }

    VAR_0->dither_error[0][VAR_15] = VAR_17[0];

    VAR_0->dither_error[1][VAR_15] = VAR_17[1];

    VAR_0->dither_error[2][VAR_15] = VAR_17[2];

}

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,
enum AVPixelFormat VAR_10, int VAR_11)
{ const int16_t *VAR_12  = 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_13 = 4096 - VAR_7; int VAR_14 = 4096 - VAR_8; int VAR_15; int VAR_16 = (VAR_10 == AV_PIX_FMT_RGB24 || VAR_10 == AV_PIX_FMT_BGR24) ? 3 : 4; int VAR_17[4] = {0}; if(   VAR_10 == AV_PIX_FMT_BGR4_BYTE || VAR_10 == AV_PIX_FMT_RGB4_BYTE
|| VAR_10 == AV_PIX_FMT_BGR8      || VAR_10 == AV_PIX_FMT_RGB8)
VAR_16 = 1; for (VAR_15 = 0; VAR_15 < VAR_6; VAR_15++) { int VAR_18 = ( VAR_12[VAR_15] * VAR_13  +  buf1[VAR_15] * VAR_7             ) >> 10; int VAR_19 = (ubuf0[VAR_15] * VAR_14 + ubuf1[VAR_15] * VAR_8-(128 << 19)) >> 10; int VAR_20 = (vbuf0[VAR_15] * VAR_14 + vbuf1[VAR_15] * VAR_8-(128 << 19)) >> 10; int VAR_21; if (VAR_11) { VAR_21 = (abuf0[VAR_15] * VAR_13 + abuf1[VAR_15] * VAR_7 + (1<<18)) >> 19; if (VAR_21 & 0x100)
VAR_21 = av_clip_uint8(VAR_21); } yuv2rgb_write_full(VAR_0, VAR_5, VAR_15, VAR_18, VAR_21, VAR_19, VAR_20, VAR_9, VAR_10, VAR_11, VAR_17); VAR_5 += VAR_16; } VAR_0->dither_error[0][VAR_15] = VAR_17[0]; VAR_0->dither_error[1][VAR_15] = VAR_17[1]; VAR_0->dither_error[2][VAR_15] = VAR_17[2]; }