Home » Extra libraries, Code snippets, applications etc. » C++ language problems and code snippets » Inverse palette conversion algorithm...
Re: Inverse palette conversion algorithm... [message #2306 is a reply to message #2244] |
Fri, 07 April 2006 13:16   |
mr_ped
Messages: 826 Registered: November 2005 Location: Czech Republic - Praha
|
Experienced Contributor |
|
|
1) why to use indexed color? (ok, sometimes it's still really needed, but usually 32b ARGB is the way to go)
2) so you speeded up 20 times code which is run single time during init and takes under 100ms even with brute-force algorithm, and you needed 3 days to do that.
2 - related) in case you generate the conversion table more than one time, there's something fishy about that. (and looks like you can speed up the thing much more just by omiting multiple initialization of the same table)
While I like the actual trick and will probably check it more deeply to understand fully your approarch, I'm not sure it was worth of the effort in "economical" sense. 
Than again, if you enjoyed it, it was probably worth of it anyway. 
Ad my trick:
Beware it will stop to work if you get negative numbers in ((4-RASTER_SHIFT_X)*2) formula (i.e. RASTER_MAP_X is under 16).
(Also using signed "int" is not really safe when working with ARGB color channels, because the ">>" will be compiled as SAL, not SHL. As long as you are sure the MSb is zero it doesn't matter, but once you start to use alpha channel or "signed short" on 16bpp colors you are asking for trouble ... usually it's best to keep colors and channels in unsigned byte/word/dword)
|
|
|
 |
|
Inverse palette conversion algorithm...
By: mirek on Wed, 05 April 2006 10:11
|
 |
|
Re: Inverse palette conversion algorithm...
By: mr_ped on Fri, 07 April 2006 10:05
|
 |
|
Re: Inverse palette conversion algorithm...
By: mirek on Fri, 07 April 2006 11:16
|
 |
|
Re: Inverse palette conversion algorithm...
By: mr_ped on Fri, 07 April 2006 13:23
|
 |
|
Re: Inverse palette conversion algorithm...
By: mirek on Fri, 07 April 2006 13:34
|
 |
|
Re: Inverse palette conversion algorithm...
By: mr_ped on Fri, 07 April 2006 13:16
|
 |
|
Re: Inverse palette conversion algorithm...
By: mirek on Fri, 07 April 2006 13:33
|
 |
|
Re: Inverse palette conversion algorithm...
By: mr_ped on Fri, 07 April 2006 17:30
|
 |
|
Re: Inverse palette conversion algorithm...
By: mr_ped on Fri, 07 April 2006 17:46
|
 |
|
Re: Inverse palette conversion algorithm...
By: mirek on Sat, 08 April 2006 14:00
|
 |
|
Re: Inverse palette conversion algorithm...
By: mr_ped on Mon, 10 April 2006 17:58
|
 |
|
Re: Inverse palette conversion algorithm...
By: mr_ped on Sun, 21 May 2006 15:40
|
 |
|
Re: Inverse palette conversion algorithm...
By: mr_ped on Sun, 21 May 2006 15:46
|
 |
|
Re: Inverse palette conversion algorithm...
By: mirek on Sun, 21 May 2006 16:01
|
Goto Forum:
Current Time: Fri Jul 18 07:30:46 CEST 2025
Total time taken to generate the page: 0.03662 seconds
|