coefficients for aliasing reduction derived from Table B.9 of ISO/IEC 11172-3 c[] = { -0.6, -0.535, -0.33, -0.185, -0.095, -0.041, -0.0142, -0.0037 } cs[i] = 1 / sqrt(1 + c[i]^2) ca[i] = c[i] / sqrt(1 + c[i]^2) */
| 375 | ca[i] = c[i] / sqrt(1 + c[i]^2) |
| 376 | */ |
| 377 | static inline mad_fixed_t cs(int i) |
| 378 | { |
| 379 | static mad_fixed_t const cs_val[8] PROGMEM = { |
| 380 | +MAD_F(0x0db84a81) /* +0.857492926 */, +MAD_F(0x0e1b9d7f) /* +0.881741997 */, |
| 381 | +MAD_F(0x0f31adcf) /* +0.949628649 */, +MAD_F(0x0fbba815) /* +0.983314592 */, |
| 382 | +MAD_F(0x0feda417) /* +0.995517816 */, +MAD_F(0x0ffc8fc8) /* +0.999160558 */, |
| 383 | +MAD_F(0x0fff964c) /* +0.999899195 */, +MAD_F(0x0ffff8d3) /* +0.999993155 */ |
| 384 | }; |
| 385 | volatile uint32_t a = *(uint32_t*)&cs_val[i]; |
| 386 | return *(mad_fixed_t*)&a; |
| 387 | } |
| 388 | |
| 389 | static inline mad_fixed_t ca(int i) |
| 390 | { |