--- a/media/webrtc/trunk/webrtc/voice_engine/dtmf_inband.cc
+++ b/media/webrtc/trunk/webrtc/voice_engine/dtmf_inband.cc
@@ -29,16 +29,26 @@ const int16_t Dtmf_a_times2Tab16Khz[8]=
29144, 28361, 27409, 26258
};
const int16_t Dtmf_a_times2Tab32Khz[8]=
{
32462,32394, 32311, 32210, 31849, 31647, 31400, 31098
};
+const int16_t Dtmf_a_times2Tab44_1Khz[8]=
+{
+ 32607, 32571, 32527, 32474, 32283, 32176, 32045, 31885
+};
+
+const int16_t Dtmf_a_times2Tab48Khz[8]=
+{
+ 32612, 32577, 32534, 32483, 32298, 32194, 32067, 31912
+};
+
// Second table is sin(2*pi*f/fs) in Q14
const int16_t Dtmf_ym2Tab8Khz[8]=
{
8527, 9315, 10163, 11036,
13322, 14206, 15021, 15708
};
@@ -48,16 +58,26 @@ const int16_t Dtmf_ym2Tab16Khz[8]=
7490, 8207, 8979, 9801
};
const int16_t Dtmf_ym2Tab32Khz[8]=
{
2235, 2468, 2728, 3010, 3853, 4249, 4685, 5164
};
+const int16_t Dtmf_ym2Tab44_1Khz[8]=
+{
+ 1624, 1794, 1984, 2190, 2808, 3100, 3422, 3777
+};
+
+const int16_t Dtmf_ym2Tab48Khz[8]=
+{
+ 1599, 1766, 1953, 2156, 2765, 3052, 3369, 3719
+};
+
const int16_t Dtmf_dBm0kHz[37]=
{
16141, 14386, 12821, 11427, 10184, 9077,
8090, 7210, 6426, 5727, 5104, 4549,
4054, 3614, 3221, 2870, 2558, 2280,
2032, 1811, 1614, 1439, 1282, 1143,
1018, 908, 809, 721, 643, 573,
510, 455, 405, 361, 322, 287,
@@ -87,17 +107,19 @@ DtmfInband::~DtmfInband()
delete &_critSect;
}
int
DtmfInband::SetSampleRate(uint16_t frequency)
{
if (frequency != 8000 &&
frequency != 16000 &&
- frequency != 32000)
+ frequency != 32000 &&
+ frequency != 44100 &&
+ frequency != 48000)
{
// invalid sample rate
assert(false);
return -1;
}
_outputFrequencyHz = frequency;
return 0;
}
@@ -277,16 +299,22 @@ DtmfInband::DtmfFix_generate(int16_t *de
a_times2Tbl=Dtmf_a_times2Tab8Khz;
y2_Table=Dtmf_ym2Tab8Khz;
} else if (fs==16000) {
a_times2Tbl=Dtmf_a_times2Tab16Khz;
y2_Table=Dtmf_ym2Tab16Khz;
} else if (fs==32000) {
a_times2Tbl=Dtmf_a_times2Tab32Khz;
y2_Table=Dtmf_ym2Tab32Khz;
+ } else if (fs==44100) {
+ a_times2Tbl=Dtmf_a_times2Tab44_1Khz;
+ y2_Table=Dtmf_ym2Tab44_1Khz;
+ } else if (fs==48000) {
+ a_times2Tbl=Dtmf_a_times2Tab48Khz;
+ y2_Table=Dtmf_ym2Tab48Khz;
} else {
return(-1);
}
if ((value==1)||(value==2)||(value==3)||(value==12)) {
a1_times2=a_times2Tbl[0];
if (_reinit) {
_oldOutputLow[0]=y2_Table[0];