This file contains the code of the interpolation filter.
Definition in file dsp16_filt_interpolation.c.
#include "dsp.h"
Go to the source code of this file.
Defines | |
#define | DSP16_INTERPOLATION_KERNEL_X_FCT(x_num, data) |
#define | DSP16_INTERPOLATION_NO_LOOP_KERNEL_X_FCT(x_num, data) |
#define | DSP16_INTREPOLATION_FILTER(x_num, data) sum += ph[(x_num+data)] * pvect2[-(x_num+data)]; |
#define | DSP16_INTREPOLATION_FILTER_FUNCTION_NAME(x_num, data) TPASTE2(dsp16_filt_interpolation_kernel_x, x_num), |
#define | DSP16_INTREPOLATION_NO_LOOP_FILTER_FUNCTION_NAME(x_num, data) TPASTE2(dsp16_filt_interpolation_no_loop_kernel_x, x_num), |
#define | LOOP_UNROLL 6 |
#define | LOOP_UNROLL_PLUS_ONE 7 |
Functions | |
void | dsp16_filt_interpolation (dsp16_t *vect1, dsp16_t *vect2, int vect2_size, dsp16_t *h, int h_size, int interpolation_ratio) |
This function interpolates a vector. | |
static void | dsp16_filt_interpolation_no_loop_kernel_x0 (dsp16_t *vect1, dsp16_t *vect2, int vect2_size, dsp16_t *h, int h_size, int interpolation_ratio) |
#define DSP16_INTERPOLATION_KERNEL_X_FCT | ( | x_num, | |||
data | ) |
Value:
static void TPASTE2(dsp16_filt_interpolation_kernel_x, x_num)(dsp16_t *vect1, dsp16_t *vect2, int vect2_size, dsp16_t *h, int h_size, int interpolation_ratio) \ { \ S32 sum = 0; \ int i, k, n; \ int n_tap; \ dsp16_t *ph; \ dsp16_t *pvect1; \ dsp16_t *pvect2; \ \ pvect1 = vect1; \ n_tap = h_size / interpolation_ratio; \ \ for(n=0; n<vect2_size; n++) \ { \ for(k=0; k<interpolation_ratio; k++) \ { \ sum = 0; \ ph = &h[k*n_tap]; \ pvect2 = &vect2[n + n_tap - 1]; \ for(i=0; i<n_tap - LOOP_UNROLL + 1; i += LOOP_UNROLL) \ { \ MREPEAT(LOOP_UNROLL, DSP16_INTREPOLATION_FILTER, 0) \ ph += LOOP_UNROLL; \ pvect2 -= LOOP_UNROLL; \ } \ MREPEAT(x_num, DSP16_INTREPOLATION_FILTER, 0); \ *pvect1++ = sum >> DSP16_QB; \ } \ } \ }
Definition at line 69 of file dsp16_filt_interpolation.c.
#define DSP16_INTERPOLATION_NO_LOOP_KERNEL_X_FCT | ( | x_num, | |||
data | ) |
Value:
static void TPASTE2(dsp16_filt_interpolation_no_loop_kernel_x, x_num)(dsp16_t *vect1, dsp16_t *vect2, int vect2_size, dsp16_t *h, int h_size, int interpolation_ratio) \ { \ S32 sum = 0; \ int k, n; \ int n_tap; \ dsp16_t *ph; \ dsp16_t *pvect1; \ dsp16_t *pvect2; \ \ pvect1 = vect1; \ n_tap = h_size / interpolation_ratio; \ \ for(n=0; n<vect2_size; n++) \ { \ pvect2 = &vect2[n + n_tap - 1]; \ for(k=0; k<interpolation_ratio; k++) \ { \ sum = 0; \ ph = &h[k*n_tap]; \ MREPEAT(x_num, DSP16_INTREPOLATION_FILTER, 0) \ *pvect1++ = sum >> DSP16_QB; \ } \ } \ }
Definition at line 135 of file dsp16_filt_interpolation.c.
#define DSP16_INTREPOLATION_FILTER | ( | x_num, | |||
data | ) | sum += ph[(x_num+data)] * pvect2[-(x_num+data)]; |
Definition at line 64 of file dsp16_filt_interpolation.c.
#define DSP16_INTREPOLATION_FILTER_FUNCTION_NAME | ( | x_num, | |||
data | ) | TPASTE2(dsp16_filt_interpolation_kernel_x, x_num), |
#define DSP16_INTREPOLATION_NO_LOOP_FILTER_FUNCTION_NAME | ( | x_num, | |||
data | ) | TPASTE2(dsp16_filt_interpolation_no_loop_kernel_x, x_num), |
#define LOOP_UNROLL 6 |
Definition at line 55 of file dsp16_filt_interpolation.c.
#define LOOP_UNROLL_PLUS_ONE 7 |
Definition at line 56 of file dsp16_filt_interpolation.c.
static void dsp16_filt_interpolation_no_loop_kernel_x0 | ( | dsp16_t * | vect1, | |
dsp16_t * | vect2, | |||
int | vect2_size, | |||
dsp16_t * | h, | |||
int | h_size, | |||
int | interpolation_ratio | |||
) | [static] |
Definition at line 161 of file dsp16_filt_interpolation.c.
00162 { 00163 int k, n; 00164 dsp16_t *pvect1; 00165 dsp16_t *pvect2; 00166 00167 pvect1 = vect1; 00168 00169 for(n=0; n<vect2_size; n++) 00170 { 00171 pvect2 = &vect2[n + 1]; 00172 for(k=0; k<interpolation_ratio; k++) 00173 *pvect1++ = *pvect2; 00174 } 00175 }