static av_always_inline void
yuv2gray16_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  yalpha1 = 4095 - yalpha;
    int i;
    const int16_t *buf0 = buf[0], *buf1 = buf[1];

    for (i = 0; i < (dstW >> 1); i++) {
        const int i2 = 2 * i;
        int Y1 = (buf0[i2  ] * yalpha1 + buf1[i2  ] * yalpha) >> 11;
        int Y2 = (buf0[i2+1] * yalpha1 + buf1[i2+1] * yalpha) >> 11;

        output_pixel(&dest[2 * i2 + 0], Y1);
        output_pixel(&dest[2 * i2 + 2], Y2);
    }
}