-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtab_dtx.c
69 lines (51 loc) · 2.3 KB
/
tab_dtx.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
ITU-T G.729A Annex B ANSI-C Source Code
Version 1.3 Last modified: August 1997
Copyright (c) 1996, France Telecom, Rockwell International,
Universite de Sherbrooke.
All rights reserved.
*/
/*********************************************************************/
/****** Tables used for VAD/DTX/CNG ******/
/*********************************************************************/
#include <stdio.h>
#include "typedef.h"
#include "ld8a.h"
#include "vad.h"
#include "dtx.h"
#include "tab_dtx.h"
/* VAD constants */
int16_t lbf_corr[NP+1] = {
7869, 7011, 4838, 2299, 321, -660, -782, -484, -164, 3, 39, 21, 4};
int16_t shift_fx[33] = {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 5,0};
int16_t factor_fx[33] = {32767, 16913, 17476, 18079, 18725, 19418,
20165, 20972, 21845, 22795, 23831, 24966,
26214, 27594, 29127, 30840, 32767, 17476,
18725, 20165, 21845, 23831, 26214, 29127,
32767, 18725, 21845, 26214, 32767, 21845,
32767, 32767,0};
/* Quantization of SID gain */
int16_t fact[NB_GAIN+1] = {410, 26, 13};
int16_t marg[NB_GAIN+1] = {0, 0, 1};
int16_t tab_Sidgain[32] = {
2, 5, 8, 13, 20, 32, 50, 64,
80, 101, 127, 160, 201, 253, 318, 401,
505, 635, 800, 1007, 1268, 1596, 2010, 2530,
3185, 4009, 5048, 6355, 8000,10071,12679,15962 };
/* Quantization of LSF vector */
int16_t noise_fg[MODE][MA_NP][M];
int16_t noise_fg_sum[MODE][M] = {
{7798, 8447, 8205, 8293, 8126, 8477, 8447, 8703, 9043, 8604},
{10514, 12402, 12833, 11914, 11447, 11670, 11132, 11311, 11844, 11447}
};
int16_t noise_fg_sum_inv[MODE][M] = {
{17210, 15888, 16357, 16183, 16516, 15833, 15888, 15421, 14840, 15597},
{12764, 10821, 10458, 11264, 11724, 11500, 12056, 11865, 11331, 11724}
};
int16_t PtrTab_1[32] = {96,52,20,54,86,114,82,68,36,121,48,92,18,120,
94,124,50,125,4,100,28,76,12,117,81,22,90,116,
127,21,108,66};
int16_t PtrTab_2[2][16]= {{31,21,9,3,10,2,19,26,4,3,11,29,15,27,21,12},
{16,1,0,0,8,25,22,20,19,23,20,31,4,31,20,31}};
int16_t Mp[MODE] = {8644, 16572};