Table of Contents
QccMatrixDCT, QccMatrixInverseDCT - two-dimensional discrete cosine
transform (DCT) and inverse transform of a matrix
#include
"libQccPack.h"
int QccMatrixDCT(const QccMatrix input_block, QccMatrix
output_block, int num_rows, int num_cols);
int QccMatrixInverseDCT(const
QccMatrix input_block, QccMatrix output_block, int num_rows, int num_cols);
QccMatrixDCT() calculates the two-dimensional discrete cosine
transform (2D DCT) of input_block, returning the result in output_block.
QccMatrixDCT() calculates the 2D DCT of input_block by first taking a
one-dimensional DCT along each row of the matrix followed by the one-dimensional
DCT along each column. QccVectorDCT(3)
is used to calculate the one-dimensional
DCT in each case.
QccMatrixInverseDCT() calculates the two-dimensional inverse
DCT of input_block, returning the result in output_block.
Both QccMatrixDCT() and QccMatrixInverseDCT() return 0 on success, 1 on
error.
These routines implement the type-II DCT applied
separably; the implementation is slow, and s based on calls to QccVectorDCT(3)
and QccVectorInverseDCT(3)
which, in turn, call directly to cos(3)
. Most
applications should probably use QccFastDCTForwardTransform2D(3)
and QccFastDCTInverseTransform2D(3)
which are based on a faster FFT-based implementation, but rely on the GNU
Scientific Library (GSL) for the FFT. QccMatrixDCT() and QccMatrixInverseDCT()
are provided for use when GSL is not available.
QccVectorDCT(3)
,
QccFastDCTForwardTransform2D(3)
, QccMatrix(3)
, QccPack(3)
A. K. Jain, Fundamentals
of Digital Image Processing. Englewood Cliffs, NJ: Prentice Hall, 1989.
Copyright (C) 1997-2021 James E. Fowler
Table of Contents