The trans_gain tool is specialized to only compute covariance matricies and coding gain of various 1D and 2D transforms (lapped and unlapped KLT, lapped and unlapped DCT, and CDF 9/7 wavelets).
It computes the covariance matrix three possible ways. The first two are equivalent to Nathan's original full and collapsed covariance calculations, using equivalent blocking/boundary conditions, and should return equivalent answers to trans and trans2d within machine precision limits. The coding gain calculation code is de-optimized for easier reading, so machine precision will account for very small
variations.
The third covariance matrix calculation accumulates and computes the 'collapsed' covariance matrix directly. It considers each possible set of pixels for a given offset only once and operates from edge-to-edge in the image and so should show no border effects. Among other things, this means that larger covariance matricies are strict supersets of smaller matricies.
fb411a9 Add trans_gain tool for coding gain computation with arbitrary transforms
Makefile.am | 14 +
tools/trans_gain.c | 1271 +++++++++++++++++++++++++++++++++++++++++++++++++++
tools/unix/Makefile | 28 +-
3 files changed, 1311 insertions(+), 2 deletions(-)
Upstream: git.xiph.org