[theora-dev] Bug in reference idct.
chrisb at codian.com
Wed Mar 5 13:43:53 PST 2008
The Theora specification states, in section 7.9.3 ("The 1D Inverse DCT")
14. Assign T the value T - T.
15. Truncate T to a 16-bit representation by dropping any higher-order
16. Assign T the value C4 * (-T) >> 16.
However, the relevant section of code in the reference decoder
(lib/dec/idct.c line 50) is:
i.e. T (the result of T-T) is not inverted before being
multiplied by C4.
Lines 106, 150 and 190 in idct.c do the same thing - the spec says the
result of (T - T) should be negated before being multiplied. I
believe this is a bug in the reference implementation.
The experimental "from-scratch" theora-exp has this same bug.
Further, the spec states in the same section, on step 50:
50. Assign X the value T - T.
This is impossible as X is defined to be an array. I believe the intent
was to assign R the value of (T - T). The reference decoder states:
which would achieve the same result as assigning to R. I believe this is a
bug in the spec.
More information about the theora-dev