src/utility/yuv2rgb.c
static void convert_c(
    const uint8_t *srcY, const uint8_t *srcU, const uint8_t *srcV,
    uint8_t *dest, int width)
{
    int x;
    for (x = 0; x < width/2; x++) {
        int Y, U, V, R, G, B;
        Y = (srcY[x*2] - 0x10) * 9539;
        U = srcU[x] - 0x80;
        V = srcV[x] - 0x80;
        R = (Y           + 13075*V + (1<<12)) >> 13;
        G = (Y -  3209*U -  6660*V + (1<<12)) >> 13;
        B = (Y + 16525*U           + (1<<12)) >> 13;
        dest[x*8+0] = bound(R, 0, 255);
        dest[x*8+1] = bound(G, 0, 255);
        dest[x*8+2] = bound(B, 0, 255);
        dest[x*8+3] = 0xFF;
        Y = (srcY[x*2+1] - 0x10) * 9539;
        R = (Y           + 13075*V + (1<<12)) >> 13;
        G = (Y -  3209*U -  6660*V + (1<<12)) >> 13;
        B = (Y + 16525*U           + (1<<12)) >> 13;
        dest[x*8+4] = bound(R, 0, 255);
        dest[x*8+5] = bound(G, 0, 255);
        dest[x*8+6] = bound(B, 0, 255);
        dest[x*8+7] = 0xFF;
    }
}
/*************************************************************************/
/******** Single-line conversion functions: Platform-agnostic C **********/
/*************************************************************************/
Single-line conversion functions: Platform-agnostic C
Single - line conversion functions : Platform - agnostic C
static void convert_c(
    const uint8_t *srcY, const uint8_t *srcU, const uint8_t *srcV,
    uint8_t *dest, int width)
{
    int x;
    for (x = 0; x < width/2; x++) {
        int Y, U, V, R, G, B;
        Y = (srcY[x*2] - 0x10) * 9539;
        U = srcU[x] - 0x80;
        V = srcV[x] - 0x80;
        R = (Y           + 13075*V + (1<<12)) >> 13;
        G = (Y -  3209*U -  6660*V + (1<<12)) >> 13;
        B = (Y + 16525*U           + (1<<12)) >> 13;
        dest[x*8+0] = bound(R, 0, 255);
        dest[x*8+1] = bound(G, 0, 255);
        dest[x*8+2] = bound(B, 0, 255);
        dest[x*8+3] = 0xFF;
        Y = (srcY[x*2+1] - 0x10) * 9539;
        R = (Y           + 13075*V + (1<<12)) >> 13;
        G = (Y -  3209*U -  6660*V + (1<<12)) >> 13;
        B = (Y + 16525*U           + (1<<12)) >> 13;
        dest[x*8+4] = bound(R, 0, 255);
        dest[x*8+5] = bound(G, 0, 255);
        dest[x*8+6] = bound(B, 0, 255);
        dest[x*8+7] = 0xFF;
    }
}
static void convert_c ( const uint8_t * srcY , const uint8_t * srcU , const uint8_t * srcV , uint8_t * dest , int width ) { int x ; for ( x = 0 ; x < width / 2 ; x ++ ) { int Y , U , V , R , G , B ; Y = ( srcY [ x * 2 ] - 0x10 ) * 9539 ; U = srcU [ x ] - 0x80 ; V = srcV [ x ] - 0x80 ; R = ( Y + 13075 * V + ( 1 << 12 ) ) >> 13 ; G = ( Y - 3209 * U - 6660 * V + ( 1 << 12 ) ) >> 13 ; B = ( Y + 16525 * U + ( 1 << 12 ) ) >> 13 ; dest [ x * 8 + 0 ] = bound ( R , 0 , 255 ) ; dest [ x * 8 + 1 ] = bound ( G , 0 , 255 ) ; dest [ x * 8 + 2 ] = bound ( B , 0 , 255 ) ; dest [ x * 8 + 3 ] = 0xFF ; Y = ( srcY [ x * 2 + 1 ] - 0x10 ) * 9539 ; R = ( Y + 13075 * V + ( 1 << 12 ) ) >> 13 ; G = ( Y - 3209 * U - 6660 * V + ( 1 << 12 ) ) >> 13 ; B = ( Y + 16525 * U + ( 1 << 12 ) ) >> 13 ; dest [ x * 8 + 4 ] = bound ( R , 0 , 255 ) ; dest [ x * 8 + 5 ] = bound ( G , 0 , 255 ) ; dest [ x * 8 + 6 ] = bound ( B , 0 , 255 ) ; dest [ x * 8 + 7 ] = 0xFF ; } }
Single-line conversion functions: Platform-agnostic C
Single - line conversion functions : Platform - agnostic C