31.1 Overview
The PIC32 DSP library consists of a set of functions that are applicable to many multimedia application areas. Most of the functions, like vector operations, filters, and transforms, are commonly used in many DSP and multimedia applications.
Some functions are designed to be used in specific applications such as video decoding or voice compression. It is beyond the scope of this manual to describe the operation of such applications.
Functions whose performance is considered critical are implemented in assembly and tuned where appropriate for a particular processor pipeline implementation and instruction set features. When a function is typically not considered to be performance critical, or the benefit from an assembly implementation is not significant, it is implemented in C. Often such functions perform initialization of data structures and are used only once during the lifetime of an application.
The following table lists all the functions currently available in the DSP Library, arranged by category, with the available implementation versions. All general purpose functions work with data in 16-bit fractional format, also known as Q15. Some of the functions also have a version that operates on 32-bit data in Q31 fractional format.
Category | Function Name | Description |
---|---|---|
Vector Math Functions | mips_vec_abs16 /32 |
Compute the absolute value of each Q15/Q31 vector element. |
mips_vec_add16 /32 |
Add the corresponding elements of two Q15/Q31 vectors. | |
mips_vec_addc16 /32 |
Add a constant to all elements of a vector. | |
mips_vec_dotp16 /32 |
Compute dot product of two Q15/Q31 vectors. | |
mips_vec_mul16 /32 |
Multiply the corresponding elements of two Q15/Q31 vectors. Can be used for applying windows. | |
mips_vec_mulc16 /32 |
Multiply all elements of a vector by a constant. | |
mips_vec_sub16 /32 |
Subtract the corresponding elements of two Q15/Q31 vectors. | |
mips_vec_sum_squares16 /32 |
Calculate the sum of squares of elements of a vector in Q15/Q31 format. | |
Filters | mips_fir16 |
Applies a block FIR filter to a Q15 vector. |
mips_fir16_setup |
Prepare the filter coefficients for the mips_fir16 function. | |
mips_iir16 |
Single-sample IIR filter. | |
mips_iir16_setup |
Prepare the filter coefficients for the mips_iir16 function. | |
mips_lms16 |
Single-sample LMS filter | |
Transforms | mips_fft16 |
Compute the complex FFT of a vector containing Q15 complex samples, i.e., 16-bit fractional real and imaginary parts. |
mips_fft16_setup
(deprecated) |
Create a vector of twiddle factors used by the mips_fft16 function. | |
mips_fft32 |
Compute the complex FFT of a vector containing Q31 complex samples, i.e., 32-bit fractional real and imaginary parts. | |
mips_fft32_setup
(deprecated) |
Create a vector of twiddle factors used by the mips_fft32 function. | |
Video | mips_h264_iqt |
Inverse quantization and transform for H.264 decoding. |
mips_h264_iqt_setup |
Create inverse quantization matrix used by the mips_h264_iqt function. | |
mips_h264_mc_luma |
1/4-pixel motion compensation for luma pixels in H.264 video decoding. |