celp_filters.c File Reference
#include <inttypes.h>
#include "avcodec.h"
#include "celp_filters.h"
#include "libavutil/avassert.h"
#include "libavutil/common.h"
Include dependency graph for celp_filters.c:

Go to the source code of this file.

Functions

void ff_celp_convolve_circ (int16_t *fc_out, const int16_t *fc_in, const int16_t *filter, int len)
 Circularly convolve fixed vector with a phase dispersion impulse response filter (D.6.2 of G.729 and 6.1.5 of AMR). More...
 
void ff_celp_circ_addf (float *out, const float *in, const float *lagged, int lag, float fac, int n)
 Add an array to a rotated array. More...
 
int ff_celp_lp_synthesis_filter (int16_t *out, const int16_t *filter_coeffs, const int16_t *in, int buffer_length, int filter_length, int stop_on_overflow, int shift, int rounder)
 LP synthesis filter. More...
 
void ff_celp_lp_synthesis_filterf (float *out, const float *filter_coeffs, const float *in, int buffer_length, int filter_length)
 LP synthesis filter. More...
 
void ff_celp_lp_zero_synthesis_filterf (float *out, const float *filter_coeffs, const float *in, int buffer_length, int filter_length)
 LP zero synthesis filter. More...
 
void ff_celp_filter_init (CELPFContext *c)
 Initialize CELPFContext. More...
 

Function Documentation

void ff_celp_circ_addf ( float *  out,
const float *  in,
const float *  lagged,
int  lag,
float  fac,
int  n 
)

Add an array to a rotated array.

out[k] = in[k] + fac * lagged[k-lag] with wrap-around

Parameters
outresult vector
insamples to be added unfiltered
laggedsamples to be rotated, multiplied and added
laglagged vector delay in the range [0, n]
facscalefactor for lagged samples
nnumber of samples

Definition at line 50 of file celp_filters.c.

Referenced by anti_sparseness(), and apply_ir_filter().

void ff_celp_convolve_circ ( int16_t *  fc_out,
const int16_t *  fc_in,
const int16_t *  filter,
int  len 
)

Circularly convolve fixed vector with a phase dispersion impulse response filter (D.6.2 of G.729 and 6.1.5 of AMR).

Parameters
fc_outvector with filter applied
fc_insource vector
filterphase filter coefficients

fc_out[n] = sum(i,0,len-1){ fc_in[i] * filter[(len + n - i)len] }

Note
fc_in and fc_out should not overlap!

Definition at line 30 of file celp_filters.c.

Referenced by g729d_get_new_exc().

void ff_celp_filter_init ( CELPFContext c)

Initialize CELPFContext.

Definition at line 212 of file celp_filters.c.

Referenced by amrnb_decode_init(), and amrwb_decode_init().

int ff_celp_lp_synthesis_filter ( int16_t *  out,
const int16_t *  filter_coeffs,
const int16_t *  in,
int  buffer_length,
int  filter_length,
int  stop_on_overflow,
int  shift,
int  rounder 
)

LP synthesis filter.

Parameters
[out]outpointer to output buffer
filter_coeffsfilter coefficients (-0x8000 <= (3.12) < 0x8000)
ininput signal
buffer_lengthamount of data to process
filter_lengthfilter length (10 for 10th order LP filter)
stop_on_overflow1 - return immediately if overflow occurs 0 - ignore overflows
shiftthe result is shifted right by this value
rounderthe amount to add for rounding (usually 0x800 or 0xfff)
Returns
1 if overflow occurred, 0 - otherwise
Note
Output buffer must contain filter_length samples of past speech data before pointer.

Routine applies 1/A(z) filter to given speech data.

Definition at line 60 of file celp_filters.c.

Referenced by decode_frame(), ff_g729_postfilter(), ff_subblock_synthesis(), g723_1_decode_frame(), and get_tilt_comp().

void ff_celp_lp_synthesis_filterf ( float *  out,
const float *  filter_coeffs,
const float *  in,
int  buffer_length,
int  filter_length 
)

LP synthesis filter.

Parameters
[out]outpointer to output buffer
  • the array out[-filter_length, -1] must contain the previous result of this filter
filter_coeffsfilter coefficients.
ininput signal
buffer_lengthamount of data to process
filter_lengthfilter length (10 for 10th order LP filter). Must be greater than 4 and even.
Note
Output buffer must contain filter_length samples of past speech data before pointer.

Routine applies 1/A(z) filter to given speech data.

Definition at line 84 of file celp_filters.c.

Referenced by adaptive_cb_search(), cng_decode_frame(), decode(), decode_frame(), eval_ir(), ff_celp_filter_init(), ff_sipr_decode_frame_16k(), fixed_cb_search(), get_match_score(), postfilter(), postfilter_5k0(), qcelp_decode_frame(), ra144_encode_subblock(), and synth_block().

void ff_celp_lp_zero_synthesis_filterf ( float *  out,
const float *  filter_coeffs,
const float *  in,
int  buffer_length,
int  filter_length 
)

LP zero synthesis filter.

Parameters
[out]outpointer to output buffer
filter_coeffsfilter coefficients.
ininput signal
  • the array in[-filter_length, -1] must contain the previous input of this filter
buffer_lengthamount of data to process
filter_lengthfilter length (10 for 10th order LP filter)
Note
Output buffer must contain filter_length samples of past speech data before pointer.

Routine applies A(z) filter to given speech data.

Definition at line 199 of file celp_filters.c.

Referenced by ff_celp_filter_init(), postfilter(), and postfilter_5k0().