OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 // Mono and stereo. | 68 // Mono and stereo. |
69 {120, "opus", 48000, 960, 2, 64000}, | 69 {120, "opus", 48000, 960, 2, 64000}, |
70 #endif | 70 #endif |
71 // Comfort noise for four different sampling frequencies. | 71 // Comfort noise for four different sampling frequencies. |
72 {13, "CN", 8000, 240, 1, 0}, | 72 {13, "CN", 8000, 240, 1, 0}, |
73 {98, "CN", 16000, 480, 1, 0}, | 73 {98, "CN", 16000, 480, 1, 0}, |
74 {99, "CN", 32000, 960, 1, 0}, | 74 {99, "CN", 32000, 960, 1, 0}, |
75 #ifdef ENABLE_48000_HZ | 75 #ifdef ENABLE_48000_HZ |
76 {100, "CN", 48000, 1440, 1, 0}, | 76 {100, "CN", 48000, 1440, 1, 0}, |
77 #endif | 77 #endif |
78 #ifdef WEBRTC_CODEC_AVT | |
79 {106, "telephone-event", 8000, 240, 1, 0}, | 78 {106, "telephone-event", 8000, 240, 1, 0}, |
80 #endif | |
81 #ifdef WEBRTC_CODEC_RED | 79 #ifdef WEBRTC_CODEC_RED |
82 {127, "red", 8000, 0, 1, 0}, | 80 {127, "red", 8000, 0, 1, 0}, |
83 #endif | 81 #endif |
84 // To prevent compile errors due to trailing commas. | 82 // To prevent compile errors due to trailing commas. |
85 {-1, "Null", -1, -1, -1, -1} | 83 {-1, "Null", -1, -1, -1, -1} |
86 }; | 84 }; |
87 | 85 |
88 // Create database with all codec settings at compile time. | 86 // Create database with all codec settings at compile time. |
89 // Each entry needs the following parameters in the given order: | 87 // Each entry needs the following parameters in the given order: |
90 // Number of allowed packet sizes, a vector with the allowed packet sizes, | 88 // Number of allowed packet sizes, a vector with the allowed packet sizes, |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 // Mono and stereo. | 125 // Mono and stereo. |
128 {4, {480, 960, 1920, 2880}, 0, 2, false}, | 126 {4, {480, 960, 1920, 2880}, 0, 2, false}, |
129 #endif | 127 #endif |
130 // Comfort noise for three different sampling frequencies. | 128 // Comfort noise for three different sampling frequencies. |
131 {1, {240}, 240, 1, false}, | 129 {1, {240}, 240, 1, false}, |
132 {1, {480}, 480, 1, false}, | 130 {1, {480}, 480, 1, false}, |
133 {1, {960}, 960, 1, false}, | 131 {1, {960}, 960, 1, false}, |
134 #ifdef ENABLE_48000_HZ | 132 #ifdef ENABLE_48000_HZ |
135 {1, {1440}, 1440, 1, false}, | 133 {1, {1440}, 1440, 1, false}, |
136 #endif | 134 #endif |
137 #ifdef WEBRTC_CODEC_AVT | |
138 {1, {240}, 240, 1, false}, | 135 {1, {240}, 240, 1, false}, |
139 #endif | |
140 #ifdef WEBRTC_CODEC_RED | 136 #ifdef WEBRTC_CODEC_RED |
141 {1, {0}, 0, 1, false}, | 137 {1, {0}, 0, 1, false}, |
142 #endif | 138 #endif |
143 // To prevent compile errors due to trailing commas. | 139 // To prevent compile errors due to trailing commas. |
144 {-1, {-1}, -1, -1, false} | 140 {-1, {-1}, -1, -1, false} |
145 }; | 141 }; |
146 | 142 |
147 // Create a database of all NetEQ decoders at compile time. | 143 // Create a database of all NetEQ decoders at compile time. |
148 const NetEqDecoder ACMCodecDB::neteq_decoders_[] = { | 144 const NetEqDecoder ACMCodecDB::neteq_decoders_[] = { |
149 #if (defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX)) | 145 #if (defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX)) |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 // Mono and stereo. | 177 // Mono and stereo. |
182 kDecoderOpus, | 178 kDecoderOpus, |
183 #endif | 179 #endif |
184 // Comfort noise for three different sampling frequencies. | 180 // Comfort noise for three different sampling frequencies. |
185 kDecoderCNGnb, | 181 kDecoderCNGnb, |
186 kDecoderCNGwb, | 182 kDecoderCNGwb, |
187 kDecoderCNGswb32kHz | 183 kDecoderCNGswb32kHz |
188 #ifdef ENABLE_48000_HZ | 184 #ifdef ENABLE_48000_HZ |
189 , kDecoderCNGswb48kHz | 185 , kDecoderCNGswb48kHz |
190 #endif | 186 #endif |
191 #ifdef WEBRTC_CODEC_AVT | |
192 , kDecoderAVT | 187 , kDecoderAVT |
193 #endif | |
194 #ifdef WEBRTC_CODEC_RED | 188 #ifdef WEBRTC_CODEC_RED |
195 , kDecoderRED | 189 , kDecoderRED |
196 #endif | 190 #endif |
197 }; | 191 }; |
198 | 192 |
199 // Get codec information from database. | 193 // Get codec information from database. |
200 // TODO(tlegrand): replace memcpy with a pointer to the data base memory. | 194 // TODO(tlegrand): replace memcpy with a pointer to the data base memory. |
201 int ACMCodecDB::Codec(int codec_id, CodecInst* codec_inst) { | 195 int ACMCodecDB::Codec(int codec_id, CodecInst* codec_inst) { |
202 // Error check to see that codec_id is not out of bounds. | 196 // Error check to see that codec_id is not out of bounds. |
203 if ((codec_id < 0) || (codec_id >= kNumCodecs)) { | 197 if ((codec_id < 0) || (codec_id >= kNumCodecs)) { |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 } | 461 } |
468 | 462 |
469 bool ACMCodecDB::OwnsDecoder(int codec_id) { | 463 bool ACMCodecDB::OwnsDecoder(int codec_id) { |
470 assert(codec_id >= 0 && codec_id < ACMCodecDB::kNumCodecs); | 464 assert(codec_id >= 0 && codec_id < ACMCodecDB::kNumCodecs); |
471 return ACMCodecDB::codec_settings_[codec_id].owns_decoder; | 465 return ACMCodecDB::codec_settings_[codec_id].owns_decoder; |
472 } | 466 } |
473 | 467 |
474 } // namespace acm2 | 468 } // namespace acm2 |
475 | 469 |
476 } // namespace webrtc | 470 } // namespace webrtc |
OLD | NEW |