Kopfbereich

Direkt zum Inhalt Direkt zur Navigation

Inhalt

The tables for 32-bit platforms
next up previous
Next: The tables for 16-bit Up: The tables and potential Previous: The tables and potential

The tables for 32-bit platforms

If USE_INACCURATE_IDCT is not defined on a 32-bit platform, the following fixed-point constants are used to implement the table of constants that are absorbed into the dequantization table:

 

524288, 475072, 262144, 166823, 262144, 111468, 262144, 94498, 
475072, 430476, 237536, 151163, 237536, 101004, 237536, 85627,
262144, 237536, 131072, 83412, 131072, 55734, 131072, 47249,
166823, 151163, 83412, 53081, 83412, 35468, 83412, 30068,
262144, 237536, 131072, 83412, 131072, 55734, 131072, 47249,
111468, 101004, 55734, 35468, 55734, 23699, 55734, 20091,
262144, 237536, 131072, 83412, 131072, 55734, 131072, 47249,
94498, 85627, 47249, 30068, 47249, 20091, 47249, 17032

This table is simply the table with the real values presented before, but scaled with 131072 = 217. In order to estimate the possibility of an overflow, we only have to observe the values in the first row (or column) since these are the highest values and thus are most likely to lead to an overflow. In the first row, only the values at odd indices and the value at index 0 are of any interest of us, because the algorithm makes no usage of all other values (therefore they are skipped during absorbing them into the dequantization constants).

The worst case during the first pass happens in the addition of the scaled value of $ \tilde{F}$(0) with the result of the addition of all other scaled values. This means that 524288 + 475072 + 166823 + 111468 + 94498 times the maximum value of 1024 must be less than 231. In fact, (524288 + 475072 + 166823 + 111468 + 94498)×1024 = 1405080576 < 231 = 2147483648. In order to avoid an overflow by adding 5 times this maximum value of 1405080576 in the second pass, it now is scaled by a right shift over 2 digits, which yields a maximum value after the first pass of 1405080576/4 = 351270144. If this value is added five times in the second pass, the final result of the second result prior to the final downscaling operation is 5×351270144 = 1756350720 which is again less than 2 31. After the final downscaling over 20 digits the pixel values in the spatial domain are obtained.

If USE_INACCURATE_IDCT is defined on a 32-bit platform, the following fixed-point constants are used to implement the table of constants that are absorbed into the dequantization table:

 

131072, 118768, 65536, 41706, 65536, 27867, 65536, 23624,
118768, 107619, 59384, 37791, 59384, 25251, 59384, 21407,
65536, 59384, 32768, 20853, 32768, 13933, 32768, 11812,
41706, 37791, 20853, 13270, 20853, 8867, 20853, 7517,
65536, 59384, 32768, 20853, 32768, 13933, 32768, 11812,
27867, 25251, 13933, 8867, 13933, 5925, 13933, 5023,
65536, 59384, 32768, 20853, 32768, 13933, 32768, 11812,
23624, 21407, 11812, 7517, 11812, 5023, 11812, 4258

Again, this table is simply the table with the real values presented before, but this time scaled with 131072 = 215. By choosing a table that is less accurate by two digits than the one before, we can omit the right shift over 2 digits after the first pass, resulting in a minimum of operations. This variant of the algorithm really requires only additions.

Last Updated on Sunday, 28 April 2002 16:19