Table of Contents

NAME

QccIMGImageComponentDCT, QccIMGImageComponentInverseDCT, QccIMGImageDCT, QccIMGImageInverseDCT - block-based DCT and inverse DCT of images and image components

SYNOPSIS

#include "libQccPack.h"

int QccIMGImageComponentDCT(const QccIMGImageComponent *input_component, QccIMGImageComponent *output_component, int block_num_rows, int block_num_cols);
int QccIMGImageComponentInverseDCT(const QccIMGImageComponent *input_component, QccIMGImageComponent *output_component, int block_num_rows, int block_num_cols);

int QccIMGImageDCT(const QccIMGImage *input_image, QccIMGImage *output_image, int block_num_rows, int block_num_cols);
int QccIMGImageInverseDCT(const QccIMGImage *input_image, QccIMGImage *output_image, int block_num_rows, int block_num_cols);

DESCRIPTION

QccIMGImageComponentDCT() calculates the two-dimension discrete cosine transform (2D DCT) of blocks from input_component, returning the resulting transformed blocks in output_component. That is, QccIMGImageComponentDCT() first partitions input_component into distinct, non-overlapping blocks of size block_num_rows rows by block_num_cols columns, and then calls QccMatrixDCT(3) to perform the 2D DCT on each block. The transformed blocks are then placed into output_component, which must be allocated to the same size as input_component prior to calling QccIMGImageComponentDCT(). The size of both input_component and output_component must be evenly divisible by the block size; i.e., input_component->num_rows must be an integer multiple of block_num_rows while input_component->num_cols must be an integer multiple of block_num_cols. QccIMGImageComponentExtractBlock(3) is used to partition input_component into blocks, while QccIMGImageComponentInsertBlock(3) is used to insert the transform blocks into output_component.

QccIMGImageComponentInverseDCT() calculates the two-dimensional inverse DCT of blocks from input_component, returning the transformed blocks in output_component. Again, output_component must be allocated to the same size as input_component prior to calling QccIMGImageComponentInverseDCT(), and the size of both input_component and output_component must be evenly divisible by the block size (which must be the same block size as used initially by QccIMGImageComponentDCT() for sane results). QccIMGImageComponentInverseDCT() calls QccMatrixInverseDCT(3) to perform the inverse DCT for each block.

QccIMGImageDCT() and QccIMGImageInverseDCT() perform the forward and inverse DCT, respectively, on image by calling QccIMGImageComponentDCT() and QccIMGImageComponentInverseDCT(), respectively, on each of the Y, U, and V components of the image.

RETURN VALUE

These routines return 0 on success, 1 on failure.

SEE ALSO

QccMatrixDCT(3) , QccMatrixInverseDCT(3) , QccIMGImageComponentExtractBlock(3) , QccIMGImageComponentInsertBlock(3) , QccIMGImageComponent(3) , QccIMGImage(3) , QccPackIMG(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