6.4.3 DCT

Description

DCT computes the Discrete Cosine Transform of a source vector.

Prototype

fractcomplex* DCT (int log2N, fractional* dstCV, fractcomplex* srcCV, fractcomplex* cosFactors, fractcomplex* twidFactors);

Arguments

Parameters

Description

log2N

Base 2 logarithm of N (number of complex elements in source vector)

dstCV

Pointer to the destination vector

srcCV

Pointer to the source vector

cosFactors

Pointer to the cosine factors

twidFactors

Pointer to the twiddle factors

Return

Pointer to the base address of the destination sample.

Remarks

This function internally uses DCTIP and the VectorZeroPad function.

N must be an integer power of 2.

A vector of size 2N elements must already have been allocated and assigned to dstCV.

The dstCV vector must be allocated in the Y-Data space with address alignment to a modulo of N.

The results of the computation are stored in the first N elements of destination vector.

To avoid saturation (overflow) during computation, the values of the source vector should be in the range [-0.5, 0.5].

Only the first N/2 cosine factors are needed.

Only the first N/2 twiddle factors are needed.

The twiddle factors must be initialized with conjFlag set to a value different than zero.

Output is scaled by the factor of N.

Source File

  • dctoop_aa.s

Function Profile

Program Words

64

Cycle Count

33

Note:
  1. The above-mentioned program word and cycle counts pertains solely to DCT. However, as this function inherently utilizes DCTIP and VectorZeroPad, the respective counts for DCTIP and VectorZeroPad must also be considered.
  2. In the description of DCTIP and VectorZeroPad, the number of cycles reported includes four cycles of C-function call overhead. Thus, the number of actual cycles from DCTIP and VectorZeroPad to add to DCT is 2x4 less than whatever number is reported for a stand-alone DCTIP/VectorZeroPad.

System resource usage

The below system resource usages exclude that of DCTIP and VectorZeroPad.

  • W0…W5 - used, not restored
  • REPEAT instruction usage - None