libavcodec/celp_math.h File Reference

#include <stdint.h>

Go to the source code of this file.

Functions

int16_t ff_cos (uint16_t arg)
 fixed-point implementation of cosine in [0; PI) domain.
int ff_exp2 (uint16_t power)
 fixed-point implementation of exp2(x) in [0; 1] domain.
int ff_log2 (uint32_t value)
 Calculate log2(x).
static int bidir_sal (int value, int offset)
 Shift value left or right depending on sign of offset parameter.
int64_t ff_dot_product (const int16_t *a, const int16_t *b, int length)
 returns the dot product of 2 int16_t vectors.
float ff_dot_productf (const float *a, const float *b, int length)
 Return the dot product.


Function Documentation

static int bidir_sal ( int  value,
int  offset 
) [inline, static]

Shift value left or right depending on sign of offset parameter.

Parameters:
value value to shift
offset shift offset
Returns:
value << offset, if offset>=0; value >> -offset - otherwise

Definition at line 60 of file celp_math.h.

Referenced by ff_acelp_decode_gain_code(), and ff_g729_adaptive_gain_control().

int16_t ff_cos ( uint16_t  arg  ) 

fixed-point implementation of cosine in [0; PI) domain.

Parameters:
arg fixed-point cosine argument, 0 <= arg < 0x4000
Returns:
value of (1<<15) * cos(arg * PI / (1<<14)), -0x8000 <= result <= 0x7fff

Definition at line 138 of file celp_math.c.

Referenced by ff_acelp_lsf2lsp().

int64_t ff_dot_product ( const int16_t a,
const int16_t b,
int  length 
)

returns the dot product of 2 int16_t vectors.

Parameters:
a input data array
b input data array
length number of elements
Returns:
dot product = sum of elementwise products

Definition at line 200 of file celp_math.c.

Referenced by autocorr_max(), comp_interp_index(), comp_ppf_coeff(), formant_postfilter(), and gen_acb_excitation().

float ff_dot_productf ( const float *  a,
const float *  b,
int  length 
)

int ff_exp2 ( uint16_t  power  ) 

fixed-point implementation of exp2(x) in [0; 1] domain.

Parameters:
power argument to exp2, 0 <= power <= 0x7fff
Returns:
value of (1<<20) * exp2(power / (1<<15)) 0x8000c <= result <= 0xfffea

Definition at line 148 of file celp_math.c.

Referenced by ff_acelp_decode_gain_code().

int ff_log2 ( uint32_t  value  ) 

Calculate log2(x).

Parameters:
value function argument, 0 < value <= 7fff ffff
Returns:
value of (1<<15) * log2(value)

Definition at line 180 of file celp_math.c.

Referenced by ff_acelp_decode_gain_code(), and ff_acelp_update_past_gain().


Generated on Fri Oct 26 02:46:07 2012 for FFmpeg by  doxygen 1.5.8