Table of Contents

NAME

QccMatrixDCT, QccMatrixInverseDCT - two-dimensional discrete cosine transform (DCT) and inverse transform of a matrix

SYNOPSIS

#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);

DESCRIPTION

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.

RETURN VALUE

Both QccMatrixDCT() and QccMatrixInverseDCT() return 0 on success, 1 on error.

IMPLEMENTATION

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.

SEE ALSO

QccVectorDCT(3) , QccFastDCTForwardTransform2D(3) , QccMatrix(3) , QccPack(3)

A. K. Jain, Fundamentals of Digital Image Processing. Englewood Cliffs, NJ: Prentice Hall, 1989.

AUTHOR

Copyright (C) 1997-2021 James E. Fowler


Table of Contents



Get QccPack at SourceForge.net. Fast, secure and Free Open Source software downloads