OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 #include <string> | 10 #include <string> |
(...skipping 188 matching lines...) Loading... |
199 | 199 |
200 // We run |kRunTimeMs| milliseconds of pure silence. | 200 // We run |kRunTimeMs| milliseconds of pure silence. |
201 const int kRunTimeMs = 2000; | 201 const int kRunTimeMs = 2000; |
202 | 202 |
203 // We check that, after a |kCheckTimeMs| milliseconds (given that the CNG in | 203 // We check that, after a |kCheckTimeMs| milliseconds (given that the CNG in |
204 // Opus needs time to adapt), the absolute values of DTX decoded signal are | 204 // Opus needs time to adapt), the absolute values of DTX decoded signal are |
205 // bounded by |kOutputValueBound|. | 205 // bounded by |kOutputValueBound|. |
206 const int kCheckTimeMs = 1500; | 206 const int kCheckTimeMs = 1500; |
207 | 207 |
208 #if defined(OPUS_FIXED_POINT) | 208 #if defined(OPUS_FIXED_POINT) |
209 const uint16_t kOutputValueBound = 20; | 209 const uint16_t kOutputValueBound = 30; |
210 #else | 210 #else |
211 const uint16_t kOutputValueBound = 2; | 211 const uint16_t kOutputValueBound = 8; |
212 #endif | 212 #endif |
213 | 213 |
214 int time = 0; | 214 int time = 0; |
215 while (time < kRunTimeMs) { | 215 while (time < kRunTimeMs) { |
216 // DTX mode is maintained for maximum |max_dtx_frames| frames. | 216 // DTX mode is maintained for maximum |max_dtx_frames| frames. |
217 int i = 0; | 217 int i = 0; |
218 for (; i < max_dtx_frames; ++i) { | 218 for (; i < max_dtx_frames; ++i) { |
219 time += block_length_ms; | 219 time += block_length_ms; |
220 EXPECT_EQ(samples, | 220 EXPECT_EQ(samples, |
221 static_cast<size_t>(EncodeDecode( | 221 static_cast<size_t>(EncodeDecode( |
(...skipping 443 matching lines...) Loading... |
665 EXPECT_EQ(0, WebRtcOpus_EncoderFree(opus_encoder_)); | 665 EXPECT_EQ(0, WebRtcOpus_EncoderFree(opus_encoder_)); |
666 EXPECT_EQ(0, WebRtcOpus_DecoderFree(opus_decoder_)); | 666 EXPECT_EQ(0, WebRtcOpus_DecoderFree(opus_decoder_)); |
667 } | 667 } |
668 | 668 |
669 INSTANTIATE_TEST_CASE_P(VariousMode, | 669 INSTANTIATE_TEST_CASE_P(VariousMode, |
670 OpusTest, | 670 OpusTest, |
671 Combine(Values(1, 2), Values(0, 1))); | 671 Combine(Values(1, 2), Values(0, 1))); |
672 | 672 |
673 | 673 |
674 } // namespace webrtc | 674 } // namespace webrtc |
OLD | NEW |