#include <bfxalu.h>
Inheritance diagram for BfxALULUT:
Public Member Functions | |
BOOL | LinearABK (double PropA, double PropB, double Offset) |
BYTE | GetLUT (UINT32 A, UINT32 B) |
Gets a value out a LUT. | |
Protected Attributes | |
BYTE | Data [256 *256] |
Private Member Functions | |
CC_DECLARE_DYNCREATE (BfxALULUT) | |
Friends | |
class | BfxALU |
Definition at line 447 of file bfxalu.h.
|
|
|
Gets a value out a LUT.
Definition at line 275 of file bfxalu.cpp. 00276 { 00277 return LUTBYTE(A,B); 00278 }
|
|
Definition at line 218 of file bfxalu.cpp. 00219 { 00220 INT32 pa=(INT32)(PropA*(1<<15)); 00221 INT32 pb=(INT32)(PropB*(1<<15)); 00222 INT32 po=(INT32)(Offset*((1<<15)*255)+/* for rounding */(1<<14)); 00223 00224 // Please note how we're *NOT* using doubles in the loop as that's 00225 // sooooo sloooooow on 486SX. We use 17.15 arithmetic throughout 00226 00227 #ifndef FASTLINEARABK 00228 INT32 a; 00229 INT32 b; 00230 INT32 r; 00231 for (a=0; a<256; a++) for (b=0; b<256; b++) 00232 { 00233 r=(a*pa+b*pb+po)>>15; /* we did the rounding in the offset calc */ 00234 LUTBYTE(a,b)=(r<0)?0:((r>255)?255:(BYTE)(INT32)(r)); 00235 } 00236 #else 00237 FastLinearABK(Data, pa, pb, po, 256); 00238 #if 0 00239 INT32 a; 00240 INT32 b; 00241 INT32 r; 00242 for (a=0; a<256; a++) for (b=0; b<256; b++) 00243 { 00244 r=(a*pa+b*pb+po)>>15; /* we did the rounding in the offset calc */ 00245 if (LUTBYTE(a,b)!=((r<0)?0:((r>255)?255:(BYTE)(INT32)(r)))) 00246 { 00247 TRACEUSER( "Alex", _T("Byte %x,%x was %x should be %x\n"),a,b, 00248 LUTBYTE(a,b),( (r<0)?0:((r>255)?255:(BYTE)(INT32)(r)) ) ); 00249 } 00250 } 00251 #endif 00252 #endif 00253 00254 00255 return(TRUE); 00256 }
|
|
|
|
|