RGB_FUNCTIONS(rgba32)



#undef RGB_IN

#undef RGB_OUT

#undef BPP





static void rgb24_to_rgb565(AVPicture *dst, AVPicture *src,

                            int width, int height)

{

    const unsigned char *p;

    unsigned char *q;

    int r, g, b, dst_wrap, src_wrap;

    int x, y;



    p = src->data[0];

    src_wrap = src->linesize[0] - 3 * width;



    q = dst->data[0];

    dst_wrap = dst->linesize[0] - 2 * width;



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

        for(x=0;x<width;x++) {

            r = p[0];

            g = p[1];

            b = p[2];



            ((unsigned short *)q)[0] = 

                ((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3);

            q += 2;

            p += 3;

        }

        p += src_wrap;

        q += dst_wrap;

    }

}

RGB_FUNCTIONS(rgba32)



#undef RGB_IN

#undef RGB_OUT

#undef BPP





static void rgb24_to_rgb565(AVPicture *dst, AVPicture *src,

                            int width, int height)

{

    const unsigned char *p;

    unsigned char *q;

    int r, g, b, dst_wrap, src_wrap;

    int x, y;



    p = src->data[0];

    src_wrap = src->linesize[0] - 3 * width;



    q = dst->data[0];

    dst_wrap = dst->linesize[0] - 2 * width;



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

        for(x=0;x<width;x++) {

            r = p[0];

            g = p[1];

            b = p[2];



            ((unsigned short *)q)[0] = 

                ((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3);

            q += 2;

            p += 3;

        }

        p += src_wrap;

        q += dst_wrap;

    }

}

FUNC_0(VAR_0)



#undef RGB_IN

#undef RGB_OUT

#undef BPP





static void rgb24_to_rgb565(AVPicture *dst, AVPicture *src,

                            int width, int height)

{

    const unsigned char *VAR_1;

    unsigned char *VAR_2;

    int VAR_3, VAR_4, VAR_5, VAR_6, VAR_7;

    int VAR_8, VAR_9;



    VAR_1 = src->data[0];

    VAR_7 = src->linesize[0] - 3 * width;



    VAR_2 = dst->data[0];

    VAR_6 = dst->linesize[0] - 2 * width;



    for(VAR_9=0;VAR_9<height;VAR_9++) {

        for(VAR_8=0;VAR_8<width;VAR_8++) {

            VAR_3 = VAR_1[0];

            VAR_4 = VAR_1[1];

            VAR_5 = VAR_1[2];



            ((unsigned short *)VAR_2)[0] = 

                ((VAR_3 >> 3) << 11) | ((VAR_4 >> 2) << 5) | (VAR_5 >> 3);

            VAR_2 += 2;

            VAR_1 += 3;

        }

        VAR_1 += VAR_7;

        VAR_2 += VAR_6;

    }

}

FUNC_0(VAR_0)
#undef RGB_IN
#undef RGB_OUT
#undef BPP
static void rgb24_to_rgb565(AVPicture *dst, AVPicture *src,
int width, int height)
{ const unsigned char *VAR_1; unsigned char *VAR_2; int VAR_3, VAR_4, VAR_5, VAR_6, VAR_7; int VAR_8, VAR_9; VAR_1 = src->data[0]; VAR_7 = src->linesize[0] - 3 * width; VAR_2 = dst->data[0]; VAR_6 = dst->linesize[0] - 2 * width; for(VAR_9=0;VAR_9<height;VAR_9++) { for(VAR_8=0;VAR_8<width;VAR_8++) { VAR_3 = VAR_1[0]; VAR_4 = VAR_1[1]; VAR_5 = VAR_1[2]; ((unsigned short *)VAR_2)[0] =
((VAR_3 >> 3) << 11) | ((VAR_4 >> 2) << 5) | (VAR_5 >> 3); VAR_2 += 2; VAR_1 += 3; } VAR_1 += VAR_7; VAR_2 += VAR_6; } }