NMSIS-DSP  Version 1.2.0
NMSIS DSP Software Library

Functions

riscv_status riscv_dct4_init_q31 (riscv_dct4_instance_q31 *S, riscv_rfft_instance_q31 *S_RFFT, riscv_cfft_radix4_instance_q31 *S_CFFT, uint16_t N, uint16_t Nby2, q31_t normalize)
 Initialization function for the Q31 DCT4/IDCT4. More...
 
void riscv_dct4_q31 (const riscv_dct4_instance_q31 *S, q31_t *pState, q31_t *pInlineBuffer)
 Processing function for the Q31 DCT4/IDCT4. More...
 

Detailed Description

Function Documentation

◆ riscv_dct4_init_q31()

riscv_status riscv_dct4_init_q31 ( riscv_dct4_instance_q31 S,
riscv_rfft_instance_q31 S_RFFT,
riscv_cfft_radix4_instance_q31 S_CFFT,
uint16_t  N,
uint16_t  Nby2,
q31_t  normalize 
)

Initialization function for the Q31 DCT4/IDCT4.

Deprecated:
Do not use this function. It will be removed in future versions.
Parameters
[in,out]Spoints to an instance of Q31 DCT4/IDCT4 structure.
[in]S_RFFTpoints to an instance of Q31 RFFT/RIFFT structure
[in]S_CFFTpoints to an instance of Q31 CFFT/CIFFT structure
[in]Nlength of the DCT4.
[in]Nby2half of the length of the DCT4.
[in]normalizenormalizing factor.
Returns
execution status
  • RISCV_MATH_SUCCESS : Operation successful
  • RISCV_MATH_ARGUMENT_ERROR : N is not a supported transform length
Normalizing factor:
The normalizing factor is sqrt(2/N), which depends on the size of transform N. Normalizing factors in 1.31 format are mentioned in the table below for different DCT sizes:
DCT Size Normalizing factor value (hexadecimal)
2048 0x4000000
512 0x8000000
128 0x10000000

◆ riscv_dct4_q31()

void riscv_dct4_q31 ( const riscv_dct4_instance_q31 S,
q31_t *  pState,
q31_t *  pInlineBuffer 
)

Processing function for the Q31 DCT4/IDCT4.

Deprecated:
Do not use this function. It will be removed in future versions.
Parameters
[in]Spoints to an instance of the Q31 DCT4 structure.
[in]pStatepoints to state buffer.
[in,out]pInlineBufferpoints to the in-place input and output buffer.
Returns
none
Input an output formats
Input samples need to be downscaled by 1 bit to avoid saturations in the Q31 DCT process, as the conversion from DCT2 to DCT4 involves one subtraction. Internally inputs are downscaled in the RFFT 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:
DCT Size Input format Output format Number of bits to upscale
2048 2.30 12.20 11
512 2.30 10.22 9
128 2.30 8.24 7