yuv2rgb_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 PixelFormat 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 = 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, hasAlpha ? A1 : 0, hasAlpha ? A2 : 0,
                      r, g, b, y, target, hasAlpha);
    }
}
yuv2rgb_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 PixelFormat 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 = 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, hasAlpha ? A1 : 0, hasAlpha ? A2 : 0,
                      r, g, b, y, target, hasAlpha);
    }
}
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 PixelFormat 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 = 4095 - VAR_7;
    int VAR_14 = 4095 - VAR_8;
    int VAR_15;
    for (VAR_15 = 0; VAR_15 < (VAR_6 >> 1); VAR_15++) {
        int VAR_16 = (VAR_12[VAR_15 * 2]     * VAR_13  + buf1[VAR_15 * 2]     * VAR_7)  >> 19;
        int VAR_17 = (VAR_12[VAR_15 * 2 + 1] * VAR_13  + buf1[VAR_15 * 2 + 1] * VAR_7)  >> 19;
        int VAR_18  = (ubuf0[VAR_15]        * VAR_14 + ubuf1[VAR_15]        * VAR_8) >> 19;
        int VAR_19  = (vbuf0[VAR_15]        * VAR_14 + vbuf1[VAR_15]        * VAR_8) >> 19;
        int VAR_20, VAR_21;
        const void *VAR_22 =  VAR_0->table_rV[VAR_19],
                   *VAR_23 = (VAR_0->table_gU[VAR_18] + VAR_0->table_gV[VAR_19]),
                   *VAR_24 =  VAR_0->table_bU[VAR_18];
        if (VAR_11) {
            VAR_20 = (abuf0[VAR_15 * 2    ] * VAR_13 + abuf1[VAR_15 * 2    ] * VAR_7) >> 19;
            VAR_21 = (abuf0[VAR_15 * 2 + 1] * VAR_13 + abuf1[VAR_15 * 2 + 1] * VAR_7) >> 19;
        }
        yuv2rgb_write(VAR_5, VAR_15, VAR_16, VAR_17, VAR_11 ? VAR_20 : 0, VAR_11 ? VAR_21 : 0,
                      VAR_22, VAR_23, VAR_24, VAR_9, VAR_10, VAR_11);
    }
}
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 PixelFormat 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 = 4095 - VAR_7; int VAR_14 = 4095 - VAR_8; int VAR_15; for (VAR_15 = 0; VAR_15 < (VAR_6 >> 1); VAR_15++) { int VAR_16 = (VAR_12[VAR_15 * 2]     * VAR_13  + buf1[VAR_15 * 2]     * VAR_7)  >> 19; int VAR_17 = (VAR_12[VAR_15 * 2 + 1] * VAR_13  + buf1[VAR_15 * 2 + 1] * VAR_7)  >> 19; int VAR_18  = (ubuf0[VAR_15]        * VAR_14 + ubuf1[VAR_15]        * VAR_8) >> 19; int VAR_19  = (vbuf0[VAR_15]        * VAR_14 + vbuf1[VAR_15]        * VAR_8) >> 19; int VAR_20, VAR_21; const void *VAR_22 =  VAR_0->table_rV[VAR_19],
*VAR_23 = (VAR_0->table_gU[VAR_18] + VAR_0->table_gV[VAR_19]),
*VAR_24 =  VAR_0->table_bU[VAR_18]; if (VAR_11) { VAR_20 = (abuf0[VAR_15 * 2    ] * VAR_13 + abuf1[VAR_15 * 2    ] * VAR_7) >> 19; VAR_21 = (abuf0[VAR_15 * 2 + 1] * VAR_13 + abuf1[VAR_15 * 2 + 1] * VAR_7) >> 19; } yuv2rgb_write(VAR_5, VAR_15, VAR_16, VAR_17, VAR_11 ? VAR_20 : 0, VAR_11 ? VAR_21 : 0,
VAR_22, VAR_23, VAR_24, VAR_9, VAR_10, VAR_11); } }