Table of Contents

NAME

QccFastDCT - one-dimensional and two-dimensional discrete cosine transform (DCT) and inverse tranform using a fast implementation

SYNOPSIS

#include "libQccPack.h"

int QccFastDCTInitialize(QccFastDCT *transform);
int QccFastDCTCreate(QccFastDCT *transform, int length);
void QccFastDCTFree(QccFastDCT *transform);

int QccFastDCTForwardTransform1D(const QccVector input_signal, QccVector output_signal, int length, const QccFastDCT *transform);
int QccFastDCTInverseTransform1D(const QccVector input_signal, QccVector output_signal, int length, const QccFastDCT *transform);

int QccFastDCTForwardTransform2D(const QccMatrix input_block, QccMatrix output_block, int num_rows, int num_cols, const QccFastDCT *transform_horizontal, const QccFastDCT *transform_vertical);
int QccFastDCTInverseTransform2D(const QccMatrix input_block, QccMatrix output_block, int num_rows, int num_cols, const QccFastDCT *transform_horizontal, const QccFastDCT *transform_vertical);

DESCRIPTION

These routines implement a type-II DCT transform using a fast FFT-based implementation.

The DCT transform, a QccFastDCT structure, must be initialized and created before use. Specifically, QccFastDCTInitialize() should be called before any use of a QccFastDCT structure. Then, QccFastDCTCreate() is called to setup the transform for the desired length.

QccFastDCTForwardTransform1D() and QccFastDCTInverseTransform1D() implement the forward and inverse transforms for a 1D signal. The specified signal length must match the length of the specified transform.

QccFastDCTForwardTransform2D() and QccFastDCTInverseTransform2D() implement the forward and inverse transforms for a 2D block. transform_horizontal is applied horizontally across the columns of the block; transform_vertical is applied vertically across the rows of the block. The size of the block must match the lengths of the transforms; specifically, num_rows must match the length of transform_vertical, and num_cols must match the length of transform_horizontal.

RETURN VALUE

These routines return 0 on success, 1 on error.

IMPLEMENTATION

These routines implement the type-II DCT; the implementation is based on a fast FFT-based implementation as described by Jain. However, these routines rely on the GNU Scientific Library (GSL) for the FFT, so, if GSL is not available, one should use the slower routines QccVectorDCT(3) and QccMatrixDCT(3) .

SEE ALSO

QccVectorDCT(3) , QccMatrixDCT(3) , QccVector(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