acelp_vectors.h File Reference

#include <stdint.h>

Go to the source code of this file.

Functions

void ff_acelp_fc_pulse_per_track (int16_t *fc_v, const uint8_t *tab1, const uint8_t *tab2, int pulse_indexes, int pulse_signs, int pulse_count, int bits)
 Decode fixed-codebook vector (3.8 and D.5.8 of G.729, 5.7.1 of AMR).
void ff_acelp_weighted_vector_sum (int16_t *out, const int16_t *in_a, const int16_t *in_b, int16_t weight_coeff_a, int16_t weight_coeff_b, int16_t rounder, int shift, int length)
 weighted sum of two vectors with rounding

Variables

const uint8_t ff_fc_4pulses_8bits_tracks_13 [16]
const uint8_t ff_fc_4pulses_8bits_track_4 [32]
const uint8_t ff_fc_2pulses_9bits_track1 [16]
const uint8_t ff_fc_2pulses_9bits_track1_gray [16]
const uint8_t ff_fc_2pulses_9bits_track2_gray [32]


Function Documentation

void ff_acelp_fc_pulse_per_track ( int16_t *  fc_v,
const uint8_t *  tab1,
const uint8_t *  tab2,
int  pulse_indexes,
int  pulse_signs,
int  pulse_count,
int  bits 
)

Decode fixed-codebook vector (3.8 and D.5.8 of G.729, 5.7.1 of AMR).

Parameters:
fc_v [out] decoded fixed codebook vector (2.13)
tab1 table used for first pulse_count pulses
tab2 table used for last pulse
pulse_indexes fixed codebook indexes
pulse_signs signs of the excitation pulses (0 bit value means negative sign)
bits number of bits per one pulse index
pulse_count number of pulses decoded using first table
bits length of one pulse index in bits
Used in G.729 , G.729 .4k, G.729 .4k, AMR .95k, AMR .40k

Definition at line 105 of file acelp_vectors.c.

References mask.

00113 {
00114     int mask = (1 << bits) - 1;
00115     int i;
00116 
00117     for(i=0; i<pulse_count; i++)
00118     {
00119         fc_v[i + tab1[pulse_indexes & mask]] +=
00120                 (pulse_signs & 1) ? 8191 : -8192; // +/-1 in (2.13)
00121 
00122         pulse_indexes >>= bits;
00123         pulse_signs >>= 1;
00124     }
00125 
00126     fc_v[tab2[pulse_indexes]] += (pulse_signs & 1) ? 8191 : -8192;
00127 }

void ff_acelp_weighted_vector_sum ( int16_t *  out,
const int16_t *  in_a,
const int16_t *  in_b,
int16_t  weight_coeff_a,
int16_t  weight_coeff_b,
int16_t  rounder,
int  shift,
int  length 
)

weighted sum of two vectors with rounding

Parameters:
out [out] result of addition
in_a first vector
in_b second vector
weight_coeff_a first vector weight coefficient
weight_coeff_a second vector weight coefficient
rounder this value will be added to the sum of the two vectors
shift result will be shifted to right by this value
length vectors length
Note:
It is safe to pass the same buffer for out and in_a or in_b.
out[i] = (in_a[i]*weight_a+in_b[i]*weight_b+rounder) >> shift

Definition at line 129 of file acelp_vectors.c.

References av_clip_int16().

00138 {
00139     int i;
00140 
00141     // Clipping required here; breaks OVERFLOW test.
00142     for(i=0; i<length; i++)
00143         out[i] = av_clip_int16((
00144                  in_a[i] * weight_coeff_a +
00145                  in_b[i] * weight_coeff_b +
00146                  rounder) >> shift);
00147 }


Variable Documentation

const uint8_t ff_fc_2pulses_9bits_track1[16]

Definition at line 27 of file acelp_vectors.c.

const uint8_t ff_fc_2pulses_9bits_track1_gray[16]

Definition at line 38 of file acelp_vectors.c.

const uint8_t ff_fc_2pulses_9bits_track2_gray[32]

Definition at line 50 of file acelp_vectors.c.

const uint8_t ff_fc_4pulses_8bits_track_4[32]

Definition at line 75 of file acelp_vectors.c.

const uint8_t ff_fc_4pulses_8bits_tracks_13[16]

Definition at line 70 of file acelp_vectors.c.


Generated on Thu Aug 28 16:44:30 2008 for libextractor by  doxygen 1.5.1