#include <inttypes.h>#include "avcodec.h"#include "acelp_vectors.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_2pulses_9bits_track1 [16] |
| const uint8_t | ff_fc_2pulses_9bits_track1_gray [16] |
| const uint8_t | ff_fc_2pulses_9bits_track2_gray [32] |
| const uint8_t | ff_fc_4pulses_8bits_tracks_13 [16] |
| const uint8_t | ff_fc_4pulses_8bits_track_4 [32] |
| 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).
| 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 |
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
| 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 |
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 }
| const uint8_t ff_fc_2pulses_9bits_track1[16] |
Initial value:
{
1, 3,
6, 8,
11, 13,
16, 18,
21, 23,
26, 28,
31, 33,
36, 38
}
Definition at line 27 of file acelp_vectors.c.
| const uint8_t ff_fc_2pulses_9bits_track1_gray[16] |
Initial value:
{
1, 3,
8, 6,
18, 16,
11, 13,
38, 36,
31, 33,
21, 23,
28, 26,
}
Definition at line 38 of file acelp_vectors.c.
| const uint8_t ff_fc_2pulses_9bits_track2_gray[32] |
Initial value:
{
0, 2,
5, 4,
12, 10,
7, 9,
25, 24,
20, 22,
14, 15,
19, 17,
36, 31,
21, 26,
1, 6,
16, 11,
27, 29,
32, 30,
39, 37,
34, 35,
}
Definition at line 50 of file acelp_vectors.c.
| const uint8_t ff_fc_4pulses_8bits_track_4[32] |
Initial value:
{
3, 4,
8, 9,
13, 14,
18, 19,
23, 24,
28, 29,
33, 34,
38, 39,
43, 44,
48, 49,
53, 54,
58, 59,
63, 64,
68, 69,
73, 74,
78, 79,
}
Definition at line 75 of file acelp_vectors.c.
| const uint8_t ff_fc_4pulses_8bits_tracks_13[16] |
Initial value:
{
0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75,
}
Definition at line 70 of file acelp_vectors.c.
1.5.1