22 #define G722_SAMPLE_RATE_8000 1 27 0, 35, 72, 110, 150, 190, 233, 276,
28 323, 370, 422, 473, 530, 587, 650, 714,
29 786, 858, 940, 1023, 1121, 1219, 1339, 1458,
30 1612, 1765, 1980, 2195, 2557, 2919, 0, 0
34 0, 63, 62, 31, 30, 29, 28, 27,
35 26, 25, 24, 23, 22, 21, 20, 19,
36 18, 17, 16, 15, 14, 13, 12, 11,
37 10, 9, 8, 7, 6, 5, 4, 0
41 0, 61, 60, 59, 58, 57, 56, 55,
42 54, 53, 52, 51, 50, 49, 48, 47,
43 46, 45, 44, 43, 42, 41, 40, 39,
44 38, 37, 36, 35, 34, 33, 32, 0
48 -60, -30, 58, 172, 334, 538, 1198, 3042
52 0, 7, 6, 5, 4, 3, 2, 1, 7, 6, 5, 4, 3, 2, 1, 0
56 2048, 2093, 2139, 2186, 2233, 2282, 2332,
57 2383, 2435, 2489, 2543, 2599, 2656, 2714,
58 2774, 2834, 2896, 2960, 3025, 3091, 3158,
59 3228, 3298, 3371, 3444, 3520, 3597, 3676,
60 3756, 3838, 3922, 4008
64 0, -20456, -12896, -8968,
65 -6288, -4240, -2584, -1200,
66 20456, 12896, 8968, 6288,
71 -7408, -1616, 7408, 1616
75 3, -11, 12, 32, -210, 951, 3876, -805, 362, -156, 53, -11,
91 std::fill(
x,
x+24, 0);
97 char *pBand = (
char *)
band;
98 std::fill(pBand, pBand +
sizeof(
band), 0);
102 }
else if (rate == 56000) {
151 for (i = 0; i < 3; i++) {
167 }
else if (wd3 < -12288) {
189 wd1 = (d == 0) ? 0 : 128;
192 for (i = 1; i < 7; i++)
201 for (i = 6; i > 0; i--)
207 for (i = 2; i > 0; i--)
224 for (i = 6; i > 0; i--)
266 for (j = 0; j < len; )
270 xhigh = amp[j++] >> 1;
277 xlow = amp[j++] >> 1;
283 for (i = 0; i < 22; i++) {
294 for (i = 0; i < 12; i++)
300 xlow = (sumeven + sumodd) >> 14;
301 xhigh = (sumeven - sumodd) >> 14;
308 wd = (el >= 0) ? el : -(el + 1);
310 for (i = 1; i < 30; i++)
319 ilow = (el < 0) ?
iln[i] :
ilp[i];
340 wd3 = (wd2 < 0) ? (
ilb[wd1] << -wd2) : (
ilb[wd1] >> wd2);
356 wd = (eh >= 0) ? eh : -(eh + 1);
358 mih = (wd >= wd1) ? 2 : 1;
359 ihigh = (eh < 0) ?
ihn[mih] :
ihp[mih];
379 wd3 = (wd2 < 0) ? (
ilb[wd1] << -wd2) : (
ilb[wd1] >> wd2);
401 g722_data[g722_bytes++] = (
uint8_t) code;
void block4(int band, int d)
void init(int rate, int options)
static const int qmf_coeffs[12]
void init(int rate, int options)
struct AudioG722::g722_encode_state::@10 band[2]
#define G722_SAMPLE_RATE_8000
static const int rl42[16]
int encode(uint8_t g722_data[], const int16_t amp[], int len)
int16_t saturate(int32_t amp)