void rgb24toyv12_c(const uint8_t *src, uint8_t *ydst, uint8_t *udst,

                   uint8_t *vdst, int width, int height, int lumStride,

                   int chromStride, int srcStride)

{

    int y;

    const int chromWidth = width >> 1;



    for (y = 0; y < height; y += 2) {

        int i;

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

            unsigned int b = src[6 * i + 0];

            unsigned int g = src[6 * i + 1];

            unsigned int r = src[6 * i + 2];



            unsigned int Y = ((RY * r + GY * g + BY * b) >> RGB2YUV_SHIFT) +  16;

            unsigned int V = ((RV * r + GV * g + BV * b) >> RGB2YUV_SHIFT) + 128;

            unsigned int U = ((RU * r + GU * g + BU * b) >> RGB2YUV_SHIFT) + 128;



            udst[i]     = U;

            vdst[i]     = V;

            ydst[2 * i] = Y;



            b = src[6 * i + 3];

            g = src[6 * i + 4];

            r = src[6 * i + 5];



            Y = ((RY * r + GY * g + BY * b) >> RGB2YUV_SHIFT) + 16;

            ydst[2 * i + 1] = Y;

        }

        ydst += lumStride;

        src  += srcStride;



        if (y+1 == height)

            break;



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

            unsigned int b = src[6 * i + 0];

            unsigned int g = src[6 * i + 1];

            unsigned int r = src[6 * i + 2];



            unsigned int Y = ((RY * r + GY * g + BY * b) >> RGB2YUV_SHIFT) + 16;



            ydst[2 * i] = Y;



            b = src[6 * i + 3];

            g = src[6 * i + 4];

            r = src[6 * i + 5];



            Y = ((RY * r + GY * g + BY * b) >> RGB2YUV_SHIFT) + 16;

            ydst[2 * i + 1] = Y;

        }

        udst += chromStride;

        vdst += chromStride;

        ydst += lumStride;

        src  += srcStride;

    }

}

void rgb24toyv12_c(const uint8_t *src, uint8_t *ydst, uint8_t *udst,

                   uint8_t *vdst, int width, int height, int lumStride,

                   int chromStride, int srcStride)

{

    int y;

    const int chromWidth = width >> 1;



    for (y = 0; y < height; y += 2) {

        int i;

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

            unsigned int b = src[6 * i + 0];

            unsigned int g = src[6 * i + 1];

            unsigned int r = src[6 * i + 2];



            unsigned int Y = ((RY * r + GY * g + BY * b) >> RGB2YUV_SHIFT) +  16;

            unsigned int V = ((RV * r + GV * g + BV * b) >> RGB2YUV_SHIFT) + 128;

            unsigned int U = ((RU * r + GU * g + BU * b) >> RGB2YUV_SHIFT) + 128;



            udst[i]     = U;

            vdst[i]     = V;

            ydst[2 * i] = Y;



            b = src[6 * i + 3];

            g = src[6 * i + 4];

            r = src[6 * i + 5];



            Y = ((RY * r + GY * g + BY * b) >> RGB2YUV_SHIFT) + 16;

            ydst[2 * i + 1] = Y;

        }

        ydst += lumStride;

        src  += srcStride;



        if (y+1 == height)

            break;



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

            unsigned int b = src[6 * i + 0];

            unsigned int g = src[6 * i + 1];

            unsigned int r = src[6 * i + 2];



            unsigned int Y = ((RY * r + GY * g + BY * b) >> RGB2YUV_SHIFT) + 16;



            ydst[2 * i] = Y;



            b = src[6 * i + 3];

            g = src[6 * i + 4];

            r = src[6 * i + 5];



            Y = ((RY * r + GY * g + BY * b) >> RGB2YUV_SHIFT) + 16;

            ydst[2 * i + 1] = Y;

        }

        udst += chromStride;

        vdst += chromStride;

        ydst += lumStride;

        src  += srcStride;

    }

}

void rgb24toyv12_c(const uint8_t *src, uint8_t *ydst, uint8_t *udst,                    uint8_t *vdst, int width, int height, int lumStride, void rgb24toyv12_c(const uint8_t *src, uint8_t *ydst, uint8_t *udst,                    int chromStride, int srcStride)             unsigned int Y = ((RY * r + GY * g + BY * b) >> RGB2YUV_SHIFT) +  16;             unsigned int V = ((RV * r + GV * g + BV * b) >> RGB2YUV_SHIFT) + 128;             unsigned int U = ((RU * r + GU * g + BU * b) >> RGB2YUV_SHIFT) + 128;             Y = ((RY * r + GY * g + BY * b) >> RGB2YUV_SHIFT) + 16;             unsigned int Y = ((RY * r + GY * g + BY * b) >> RGB2YUV_SHIFT) + 16;             Y = ((RY * r + GY * g + BY * b) >> RGB2YUV_SHIFT) + 16;
void FUNC_0(const uint8_t *VAR_0, uint8_t *VAR_1, uint8_t *VAR_2,

                   uint8_t *VAR_3, int VAR_4, int VAR_5, int VAR_6,

                   int VAR_7, int VAR_8)

{

    int VAR_9;

    const int VAR_10 = VAR_4 >> 1;



    for (VAR_9 = 0; VAR_9 < VAR_5; VAR_9 += 2) {

        int VAR_11;

        for (VAR_11 = 0; VAR_11 < VAR_10; VAR_11++) {

            unsigned int VAR_18 = VAR_0[6 * VAR_11 + 0];

            unsigned int VAR_18 = VAR_0[6 * VAR_11 + 1];

            unsigned int VAR_18 = VAR_0[6 * VAR_11 + 2];



            unsigned int VAR_18 = ((RY * VAR_18 + GY * VAR_18 + BY * VAR_18) >> RGB2YUV_SHIFT) +  16;

            unsigned int VAR_16 = ((RV * VAR_18 + GV * VAR_18 + BV * VAR_18) >> RGB2YUV_SHIFT) + 128;

            unsigned int VAR_17 = ((RU * VAR_18 + GU * VAR_18 + BU * VAR_18) >> RGB2YUV_SHIFT) + 128;



            VAR_2[VAR_11]     = VAR_17;

            VAR_3[VAR_11]     = VAR_16;

            VAR_1[2 * VAR_11] = VAR_18;



            VAR_18 = VAR_0[6 * VAR_11 + 3];

            VAR_18 = VAR_0[6 * VAR_11 + 4];

            VAR_18 = VAR_0[6 * VAR_11 + 5];



            VAR_18 = ((RY * VAR_18 + GY * VAR_18 + BY * VAR_18) >> RGB2YUV_SHIFT) + 16;

            VAR_1[2 * VAR_11 + 1] = VAR_18;

        }

        VAR_1 += VAR_6;

        VAR_0  += VAR_8;



        if (VAR_9+1 == VAR_5)

            break;



        for (VAR_11 = 0; VAR_11 < VAR_10; VAR_11++) {

            unsigned int VAR_18 = VAR_0[6 * VAR_11 + 0];

            unsigned int VAR_18 = VAR_0[6 * VAR_11 + 1];

            unsigned int VAR_18 = VAR_0[6 * VAR_11 + 2];



            unsigned int VAR_18 = ((RY * VAR_18 + GY * VAR_18 + BY * VAR_18) >> RGB2YUV_SHIFT) + 16;



            VAR_1[2 * VAR_11] = VAR_18;



            VAR_18 = VAR_0[6 * VAR_11 + 3];

            VAR_18 = VAR_0[6 * VAR_11 + 4];

            VAR_18 = VAR_0[6 * VAR_11 + 5];



            VAR_18 = ((RY * VAR_18 + GY * VAR_18 + BY * VAR_18) >> RGB2YUV_SHIFT) + 16;

            VAR_1[2 * VAR_11 + 1] = VAR_18;

        }

        VAR_2 += VAR_7;

        VAR_3 += VAR_7;

        VAR_1 += VAR_6;

        VAR_0  += VAR_8;

    }

}

void FUNC_0(const uint8_t *VAR_0, uint8_t *VAR_1, uint8_t *VAR_2,
uint8_t *VAR_3, int VAR_4, int VAR_5, int VAR_6,
int VAR_7, int VAR_8)
{ int VAR_9; const int VAR_10 = VAR_4 >> 1; for (VAR_9 = 0; VAR_9 < VAR_5; VAR_9 += 2) { int VAR_11; for (VAR_11 = 0; VAR_11 < VAR_10; VAR_11++) { unsigned int VAR_18 = VAR_0[6 * VAR_11 + 0]; unsigned int VAR_18 = VAR_0[6 * VAR_11 + 1]; unsigned int VAR_18 = VAR_0[6 * VAR_11 + 2]; unsigned int VAR_18 = ((RY * VAR_18 + GY * VAR_18 + BY * VAR_18) >> RGB2YUV_SHIFT) +  16; unsigned int VAR_16 = ((RV * VAR_18 + GV * VAR_18 + BV * VAR_18) >> RGB2YUV_SHIFT) + 128; unsigned int VAR_17 = ((RU * VAR_18 + GU * VAR_18 + BU * VAR_18) >> RGB2YUV_SHIFT) + 128; VAR_2[VAR_11]     = VAR_17; VAR_3[VAR_11]     = VAR_16; VAR_1[2 * VAR_11] = VAR_18; VAR_18 = VAR_0[6 * VAR_11 + 3]; VAR_18 = VAR_0[6 * VAR_11 + 4]; VAR_18 = VAR_0[6 * VAR_11 + 5]; VAR_18 = ((RY * VAR_18 + GY * VAR_18 + BY * VAR_18) >> RGB2YUV_SHIFT) + 16; VAR_1[2 * VAR_11 + 1] = VAR_18; } VAR_1 += VAR_6; VAR_0  += VAR_8; if (VAR_9+1 == VAR_5)
break; for (VAR_11 = 0; VAR_11 < VAR_10; VAR_11++) { unsigned int VAR_18 = VAR_0[6 * VAR_11 + 0]; unsigned int VAR_18 = VAR_0[6 * VAR_11 + 1]; unsigned int VAR_18 = VAR_0[6 * VAR_11 + 2]; unsigned int VAR_18 = ((RY * VAR_18 + GY * VAR_18 + BY * VAR_18) >> RGB2YUV_SHIFT) + 16; VAR_1[2 * VAR_11] = VAR_18; VAR_18 = VAR_0[6 * VAR_11 + 3]; VAR_18 = VAR_0[6 * VAR_11 + 4]; VAR_18 = VAR_0[6 * VAR_11 + 5]; VAR_18 = ((RY * VAR_18 + GY * VAR_18 + BY * VAR_18) >> RGB2YUV_SHIFT) + 16; VAR_1[2 * VAR_11 + 1] = VAR_18; } VAR_2 += VAR_7; VAR_3 += VAR_7; VAR_1 += VAR_6; VAR_0  += VAR_8; } }