LIBML  Version 3.2.4
LIBML DSP Software Library
Functions
DCT Type III Functions
Collaboration diagram for DCT Type III Functions:

Functions

tpt_status tpt_dct3_f32 (f32_t *aOutData, f32_t *aInData, f32_t *aScratch, size_t aLogN, bool aIdctFlag)
 Processing function for the floating-point DCT3. More...
 
tpt_status tpt_dct3_f64 (f64_t *aOutData, f64_t *aInData, f64_t *aScratch, size_t aLogN, bool aIdctFlag)
 Processing function for the floating-point DCT3. More...
 
tpt_status tpt_dct3_q15 (q15_t *aOutData, q15_t *aInData, q15_t *aScratch, size_t aLogN, bool aIdctFlag)
 Processing function for the Q15 DCT3. More...
 
tpt_status tpt_dct3_q31 (q31_t *aOutData, q31_t *aInData, q31_t *aScratch, size_t aLogN, bool aIdctFlag)
 Processing function for the Q31 DCT3. More...
 

Detailed Description

A discrete cosine transform (DCT) expresses a finite sequence of data points in terms of a sum of cosine functions oscillating at different frequencies. In particular, a DCT is a Fourier-related transform similar to the discrete Fourier transform (DFT), but using only real numbers.

Algorithm
This function implements DCT Type III (IDCT type II) Function:
           N-1
    x[k] = sum { c[n] * y[n] * cos(PI * (2 * k + 1) * n / (2 * N)) }
           n=0
  
where c[0] = 1 / 2.0 and c[n] = 1 for n != 0. The N-point DCT3 internally uses N-point CFFT implementation. It supports lengths of [16, 32, 64, ..., 1024] and the corresponding aLogN value is [4, 5, 6, ..., 10].
Normalizing factor
The normalizing factor is 1.0. If necessary, the caller should calculate the normalizing factor separately.

Function Documentation

◆ tpt_dct3_f32()

tpt_status tpt_dct3_f32 ( f32_t aOutData,
f32_t aInData,
f32_t aScratch,
size_t  aLogN,
bool  aIdctFlag 
)

Processing function for the floating-point DCT3.

Parameters
[out]aOutDatapoints to the output buffer.
[in]aInDatapoints to the input buffer.
[in]aScratchpoints to a temporary buffer of size 2^(aLogN+1).
[in]aLogNThe length is 2^aLogN.
Returns
execution status

◆ tpt_dct3_f64()

tpt_status tpt_dct3_f64 ( f64_t aOutData,
f64_t aInData,
f64_t aScratch,
size_t  aLogN,
bool  aIdctFlag 
)

Processing function for the floating-point DCT3.

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

◆ tpt_dct3_q15()

tpt_status tpt_dct3_q15 ( q15_t aOutData,
q15_t aInData,
q15_t aScratch,
size_t  aLogN,
bool  aIdctFlag 
)

Processing function for the Q15 DCT3.

Parameters
[out]aOutDatapoints to the output buffer.
[in]aInDatapoints to the input buffer.
[in]aScratchpoints to a temporary buffer of size 2^(aLogN+1).
[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 DCT3
aLogNDCT3 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_dct3_q31()

tpt_status tpt_dct3_q31 ( q31_t aOutData,
q31_t aInData,
q31_t aScratch,
size_t  aLogN,
bool  aIdctFlag 
)

Processing function for the Q31 DCT3.

Parameters
[out]aOutDatapoints to the output buffer.
[in]aInDatapoints to the input buffer.
[in]aScratchpoints to a temporary buffer of size 2^(aLogN+1).
[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 DCT3
aLogNDCT3 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
......