[Scummvm-devel] Bitdepth/pixel format API concerns
Johannes Schickel
lordhoto at gmail.com
Sun Jun 14 17:44:47 CEST 2009
RafaĆ Rzepecki wrote:
> 2009/6/13 J Northup <upthorn at gmail.com>:
>
>> Fullscreen pixel-by-pixel RGB conversion is a significant performance
>> impact
>> compared to fullscreen CLUT lookup, even on modern multi GHZ CPUs. It is one
>> thing to do
>> putpixel(colortable[color]);
>> and another thing entirely to do
>> putpixel(((color >> 10) & 0x1F) | (((color >> 5) & 0x1F) << 6) | ((color &
>> 0x1F) << 11));
>> (which is the simplest case for RGB555 -> BGR565)
>>
>
> I beg to differ. BTW, this is hardly the simplest code for the
> aforementioned conversion, but that's not really the point.
>
> This boils down to 522 vs. 573 FPS for swizzling vs. palette lookup,
> respectively. Hardly a lifesaver, and that's for the most simple code
> there is, ie. replacing outcolor = palette[incolor] with outcolor =
> (incolor >> 10) | ((incolor & 0x3e0) << 1) | ((incolor & 0x1f) << 11);
> this means platform-specific hacks (or, heck, even compiler
> optimizations, above was with -O0) could easily snip away the
> difference.
>
> I've put the benchmarks on the pastebin so you can try it on your
> hardware: http://pastebin.com/f3c5748dd for swizzle and
> http://pastebin.com/f7d466a6 for the palette.
>
>
Well we are not talking about these problems for high end hardware
though. We still have to support some ports with processors from
200-500MHz. (mostly talking about WinCE on ARM here)
// Johannes
More information about the Scummvm-devel
mailing list