[FFmpeg-devel] PATCH BlackFin yuv2rgb color space conversion

Robin Getz rgetz
Thu May 10 14:23:46 CEST 2007


On Wed 9 May 2007 21:29, Marc Hoffman pondered:
> ??? c->rmask = 0x001f * 0x00010001U;
>  ??? if (masks == 555) {
>  ??????? c->gmask = 0x03e0 * 0x00010001U;
>  ??????? c->bmask = 0x7c00 * 0x00010001U;
>  ??? } else if (masks == 565) {
>  ??????? c->gmask = 0x07e0 * 0x00010001U;
>  ??????? c->bmask = 0xf800 * 0x00010001U;
>  ??? }
>
[snip]
>
>  ??? if (masks == 555) {
>  ??????? c->rmask = 0x001f * 0x00010001U;
>  ??????? c->gmask = 0x03e0 * 0x00010001U;
>  ??????? c->bmask = 0x7c00 * 0x00010001U;
>  ??? } else if (masks == 565) {
>  ??????? c->rmask = 0x001f * 0x00010001U;
>  ??????? c->gmask = 0x07e0 * 0x00010001U;
>  ??????? c->bmask = 0xf800 * 0x00010001U;
>  ??? }

I checked with the compiler (gcc 4.1), and with -O2, the 2 code snippets are 
functionally/performance equivalent - the optimiser moves the load of rmask 
out of the if{}, so it only happens once in the 2nd case.

-Robin



More information about the ffmpeg-devel mailing list