[MPlayer-dev-eng] [PATCH] color SPU - Part 5/2

Benjamin Zores ben at geexbox.org
Sun Jun 22 13:02:46 CEST 2008


compn a écrit :
> On Wed, 28 May 2008 20:47:52 +0200, Ötvös Attila <dc at chello.hu> wrote:
>> Hi All!
> 
> +  case DEST_PLANES_RB:
> +    for(y=0;y<h;y++){
> +        register unsigned short *dst = (unsigned short*) dstbase;
> +        register int x;
> +        for(x=0;x<w;x++){
> +            if(srca[x]){
> +                unsigned char r=dst[x]&0x1F;
> +                unsigned char g=(dst[x]>>5)&0x1F;
> +                unsigned char b=(dst[x]>>10)&0x1F;
> +                r=(((r*srca[x])>>5)+src[x])>>3;
> +                dst[x]=(b<<10)|(g<<5)|r;
> +            }
> +        }
> +        src+=srcstride;
> +        srca+=srcstride;
> +        dstbase+=dststride;
> +    }
> +    return;
> +  case DEST_PLANES_G:
> +    for(y=0;y<h;y++){
> +        register unsigned short *dst = (unsigned short*) dstbase;
> +        register int x;
> +        for(x=0;x<w;x++){
> +            if(srca[x]){
> +                unsigned char r=dst[x]&0x1F;
> +                unsigned char g=(dst[x]>>5)&0x1F;
> +                unsigned char b=(dst[x]>>10)&0x1F;
> +                g=(((g*srca[x])>>5)+src[x])>>3;
> +                dst[x]=(b<<10)|(g<<5)|r;
> +            }
> +        }
> +        src+=srcstride;
> +        srca+=srcstride;
> +        dstbase+=dststride;
> +    }
> 
> 
> could these cases be merged?
> only the r= and g= lines differ.
> (rest of patch not reviewed)

Of course they can, and they will.
I never said I'm gonna apply 170k of patches as it.
What I'd like to know is if someone's against the way it is done.

Ben



More information about the MPlayer-dev-eng mailing list