Defines | |
| #define | SIN_LUT_SIZE 514 |
| #define | DIV_LUT_SIZE 257 |
Functions | |
| INLINE s32 | lu_sin (uint theta) |
| Look-up a sine value (2π = 0x10000). | |
| INLINE s32 | lu_cos (uint theta) |
| Look-up a cosine value (2π = 0x10000). | |
| INLINE uint | lu_div (uint x) |
| Look-up a division value between 0 and 255. | |
| INLINE int | lu_lerp32 (const s32 lut[], uint x, const uint shift) |
| Linear interpolator for 32bit LUTs. | |
| INLINE int | lu_lerp16 (const s16 lut[], uint x, const uint shift) |
| As lu_lerp32, but for 16bit LUTs. | |
Variables | |
| s32 | div_lut [257] |
| s16 | sin_lut [514] |
| #define SIN_LUT_SIZE 514 |
| INLINE s32 lu_cos | ( | uint | theta | ) |
Look-up a cosine value (2π = 0x10000).
| theta | Angle in [0,FFFFh] range |
| INLINE uint lu_div | ( | uint | x | ) |
Look-up a division value between 0 and 255.
| x | reciprocal to look up. |
| INLINE int lu_lerp32 | ( | const s32 | lut[], | |
| uint | x, | |||
| const uint | shift | |||
| ) |
Linear interpolator for 32bit LUTs.
A lut is essentially the discrete form of a function, f(x). You can get values for non-integer x via (linear) interpolation between f(x) and f(x+1).
| lut | The LUT to interpolate from. | |
| x | Fixed point number to interpolate at. | |
| shift | Number of fixed-point bits of x. |
| INLINE s32 lu_sin | ( | uint | theta | ) |
Look-up a sine value (2π = 0x10000).
| theta | Angle in [0,FFFFh] range |
1.5.3