LIBDSP Version 4.1.9
LIBDSP Software Library
Loading...
Searching...
No Matches
DCT Type IV Functions
Collaboration diagram for DCT Type IV Functions:

Functions

tpt_status tpt_dct4_f16 (f16_t *aInPlace, f16_t *aScratch, size_t aLogN, bool aIdctFlag)
 Processing function for the floating-point DCT4.
tpt_status tpt_dct4_f32 (f32_t *aInPlace, f32_t *aScratch, size_t aLogN, bool aIdctFlag)
 Processing function for the floating-point DCT4.
tpt_status tpt_dct4_f64 (f64_t *aInPlace, f64_t *aScratch, size_t aLogN, bool aIdctFlag)
 Processing function for the floating-point DCT4.
tpt_status tpt_dct4_q15 (q15_t *aInPlace, q15_t *aScratch, size_t aLogN, bool aIdctFlag)
 Processing function for the Q15 DCT4.
tpt_status tpt_dct4_q31 (q31_t *aInPlace, q31_t *aScratch, size_t aLogN, bool aIdctFlag)
 Processing function for the Q31 DCT4.

Detailed Description

Representation of signals by minimum number of values is important for storage and transmission. The possibility of large discontinuity between the beginning and end of a period of a signal in DFT can be avoided by extending the signal so that it is even-symmetric. Discrete Cosine Transform (DCT) is constructed such that its energy is heavily concentrated in the lower part of the spectrum and is very widely used in signal and image coding applications. The family of DCTs (DCT type - 1,2,3,4) is the outcome of different combinations of homogeneous boundary conditions. DCT has an excellent energy-packing capability, hence has many applications and in data compression in particular.

DCT is essentially the Discrete Fourier Transform(DFT) of an even-extended real signal. Reordering of the input data makes the computation of DCT just a problem of computing the DFT of a real signal with a few additional operations. This approach provides regular, simple, and very efficient DCT algorithms for practical hardware and software implementations.

Algorithm
This function implements DCT Type IV (IDCT for type IV)
         N-1
  X[k] = sum { x[n] * cos(PI * (2 * k + 1) * (2 * n + 1) / (4 * N)) }
         n=0
The N-point DCT4 internally uses N/2-point CFFT implementation. It supports lengths of [32, 64, ..., 512] and the corresponding aLogN value is [5, 6, ..., 9].
Normalizing factor
The normalizing factor is 1.0. If necessary, the caller should calculate the normalizing factor separately.

Function Documentation

◆ tpt_dct4_f16()

tpt_status tpt_dct4_f16 ( f16_t * aInPlace,
f16_t * aScratch,
size_t aLogN,
bool aIdctFlag )

Processing function for the floating-point DCT4.

Parameters
[in,out]aInPlacepoints to the in-place input and output buffer.
[in]aScratchpoints to a temporary buffer of size 2^aLogN.
[in]aLogNThe length is 2^aLogN.
Returns
execution status

◆ tpt_dct4_f32()

tpt_status tpt_dct4_f32 ( f32_t * aInPlace,
f32_t * aScratch,
size_t aLogN,
bool aIdctFlag )

Processing function for the floating-point DCT4.

Parameters
[in,out]aInPlacepoints to the in-place input and output buffer.
[in]aScratchpoints to a temporary buffer of size 2^aLogN.
[in]aLogNThe length is 2^aLogN.
Returns
execution status

◆ tpt_dct4_f64()

tpt_status tpt_dct4_f64 ( f64_t * aInPlace,
f64_t * aScratch,
size_t aLogN,
bool aIdctFlag )

Processing function for the floating-point DCT4.

Parameters
[in,out]aInPlacepoints to the in-place input and output buffer.
[in]aScratchpoints to a temporary buffer of size 2^aLogN.
[in]aLogNThe length is 2^aLogN.
Returns
execution status

◆ tpt_dct4_q15()

tpt_status tpt_dct4_q15 ( q15_t * aInPlace,
q15_t * aScratch,
size_t aLogN,
bool aIdctFlag )

Processing function for the Q15 DCT4.

Parameters
[in,out]aInPlacepoints to the in-place input and output buffer.
[in]aScratchpoints to a temporary buffer of size 2^aLogN.
[in]aLogNThe length is 2^aLogN.
Returns
execution status
Input an output formats
Internally inputs are downscaled in the CFFT process function to avoid overflows. Number of bits downscaled, depends on the size of the transform. The input and output formats for different DCT sizes and number of bits to upscale are mentioned in the table below:
Input and Output Formats for Q15 DCT4
aLogNDCT4 SizeInput formatOutput formatNumber of bits to upscale
4 16 1.15 5.11 4
5 32 1.15 6.10 5
6 64 1.15 7.9 6
7 128 1.15 8.8 7
8 256 1.15 9.7 8
9 512 1.15 10.6 9
10 1024 1.15 11.5 10
......

◆ tpt_dct4_q31()

tpt_status tpt_dct4_q31 ( q31_t * aInPlace,
q31_t * aScratch,
size_t aLogN,
bool aIdctFlag )

Processing function for the Q31 DCT4.

Parameters
[in,out]aInPlacepoints to the in-place input and output buffer.
[in]aScratchpoints to a temporary buffer of size 2^aLogN.
[in]aLogNThe length is 2^aLogN.
Returns
execution status
Input an output formats
Internally inputs are downscaled in the CFFT process function to avoid overflows. Number of bits downscaled, depends on the size of the transform. The input and output formats for different DCT sizes and number of bits to upscale are mentioned in the table below:
Input and Output Formats for Q31 DCT4
aLogNDCT4 SizeInput formatOutput formatNumber of bits to upscale
4 16 1.31 5.27 0
5 32 1.31 6.26 5
6 64 1.31 7.25 6
7 128 1.31 8.24 7
8 256 1.31 9.23 8
9 512 1.31 10.22 9
10 1024 1.31 11.21 10
......