[theora-dev] DCT-coefficients in
Timothy B. Terriberry
tterribe at xiph.org
Mon Apr 4 02:54:05 PDT 2011
> Why for white-pixel image, oc_enc_fdct8x8_c() returns
> the matrix with non-zero AC-coefficients?
Theora defines an exact-integer inverse DCT in the specification, that
only approximately corresponds to the "real" DCT, and includes some
scaling. See section 7.9.3 of the specification for details.
An encoder is allowed to use any forward DCT it wants, but a poor choice
can have a substantial impact on quality, especially at high rates. A
naive implementation (e.g., like VP3 used, which is the one currently
referenced in the specification) or a direct matrix multiply will
introduce significant round-trip error. The forward DCT used in
libtheora is designed to minimize this round-trip error, and as such has
a small amount of DC leakage (nothing that would exceed the minimum
quantization threshold, however). See
http://people.xiph.org/~xiphmont/demo/theora/demo7.html for some
I should probably update the (non-normative) description of the forward
DCT in the spcification to match libtheora's, but for the moment the C
code should be fairly straightforward.
More information about the theora-dev