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 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 EXPECT_EQ(0, decoder_->DecodePlc(1, output.get())); | 351 EXPECT_EQ(0, decoder_->DecodePlc(1, output.get())); |
352 } | 352 } |
353 }; | 353 }; |
354 | 354 |
355 class AudioDecoderIsacFloatTest : public AudioDecoderTest { | 355 class AudioDecoderIsacFloatTest : public AudioDecoderTest { |
356 protected: | 356 protected: |
357 AudioDecoderIsacFloatTest() : AudioDecoderTest() { | 357 AudioDecoderIsacFloatTest() : AudioDecoderTest() { |
358 codec_input_rate_hz_ = 16000; | 358 codec_input_rate_hz_ = 16000; |
359 frame_size_ = 480; | 359 frame_size_ = 480; |
360 data_length_ = 10 * frame_size_; | 360 data_length_ = 10 * frame_size_; |
361 AudioEncoderDecoderIsac::Config config; | 361 AudioEncoderIsac::Config config; |
362 config.payload_type = payload_type_; | 362 config.payload_type = payload_type_; |
363 config.sample_rate_hz = codec_input_rate_hz_; | 363 config.sample_rate_hz = codec_input_rate_hz_; |
364 config.adaptive_mode = false; | 364 config.adaptive_mode = false; |
365 config.frame_size_ms = | 365 config.frame_size_ms = |
366 1000 * static_cast<int>(frame_size_) / codec_input_rate_hz_; | 366 1000 * static_cast<int>(frame_size_) / codec_input_rate_hz_; |
367 | 367 audio_encoder_.reset(new AudioEncoderIsac(config)); |
368 // We need to create separate AudioEncoderDecoderIsac objects for encoding | 368 decoder_ = new AudioDecoderIsac(); |
369 // and decoding, because the test class destructor destroys them both. | |
370 audio_encoder_.reset(new AudioEncoderDecoderIsac(config)); | |
371 decoder_ = new AudioEncoderDecoderIsac(config); | |
372 } | 369 } |
373 }; | 370 }; |
374 | 371 |
375 class AudioDecoderIsacSwbTest : public AudioDecoderTest { | 372 class AudioDecoderIsacSwbTest : public AudioDecoderTest { |
376 protected: | 373 protected: |
377 AudioDecoderIsacSwbTest() : AudioDecoderTest() { | 374 AudioDecoderIsacSwbTest() : AudioDecoderTest() { |
378 codec_input_rate_hz_ = 32000; | 375 codec_input_rate_hz_ = 32000; |
379 frame_size_ = 960; | 376 frame_size_ = 960; |
380 data_length_ = 10 * frame_size_; | 377 data_length_ = 10 * frame_size_; |
381 AudioEncoderDecoderIsac::Config config; | 378 AudioEncoderIsac::Config config; |
382 config.payload_type = payload_type_; | 379 config.payload_type = payload_type_; |
383 config.sample_rate_hz = codec_input_rate_hz_; | 380 config.sample_rate_hz = codec_input_rate_hz_; |
384 config.adaptive_mode = false; | 381 config.adaptive_mode = false; |
385 config.frame_size_ms = | 382 config.frame_size_ms = |
386 1000 * static_cast<int>(frame_size_) / codec_input_rate_hz_; | 383 1000 * static_cast<int>(frame_size_) / codec_input_rate_hz_; |
387 | 384 audio_encoder_.reset(new AudioEncoderIsac(config)); |
388 // We need to create separate AudioEncoderDecoderIsac objects for encoding | 385 decoder_ = new AudioDecoderIsac(); |
389 // and decoding, because the test class destructor destroys them both. | |
390 audio_encoder_.reset(new AudioEncoderDecoderIsac(config)); | |
391 decoder_ = new AudioEncoderDecoderIsac(config); | |
392 } | 386 } |
393 }; | 387 }; |
394 | 388 |
395 class AudioDecoderIsacFixTest : public AudioDecoderTest { | 389 class AudioDecoderIsacFixTest : public AudioDecoderTest { |
396 protected: | 390 protected: |
397 AudioDecoderIsacFixTest() : AudioDecoderTest() { | 391 AudioDecoderIsacFixTest() : AudioDecoderTest() { |
398 codec_input_rate_hz_ = 16000; | 392 codec_input_rate_hz_ = 16000; |
399 frame_size_ = 480; | 393 frame_size_ = 480; |
400 data_length_ = 10 * frame_size_; | 394 data_length_ = 10 * frame_size_; |
401 AudioEncoderDecoderIsacFix::Config config; | 395 AudioEncoderIsacFix::Config config; |
402 config.payload_type = payload_type_; | 396 config.payload_type = payload_type_; |
403 config.sample_rate_hz = codec_input_rate_hz_; | 397 config.sample_rate_hz = codec_input_rate_hz_; |
404 config.adaptive_mode = false; | 398 config.adaptive_mode = false; |
405 config.frame_size_ms = | 399 config.frame_size_ms = |
406 1000 * static_cast<int>(frame_size_) / codec_input_rate_hz_; | 400 1000 * static_cast<int>(frame_size_) / codec_input_rate_hz_; |
407 | 401 audio_encoder_.reset(new AudioEncoderIsacFix(config)); |
408 // We need to create separate AudioEncoderDecoderIsacFix objects for | 402 decoder_ = new AudioDecoderIsacFix(); |
409 // encoding and decoding, because the test class destructor destroys them | |
410 // both. | |
411 audio_encoder_.reset(new AudioEncoderDecoderIsacFix(config)); | |
412 decoder_ = new AudioEncoderDecoderIsacFix(config); | |
413 } | 403 } |
414 }; | 404 }; |
415 | 405 |
416 class AudioDecoderG722Test : public AudioDecoderTest { | 406 class AudioDecoderG722Test : public AudioDecoderTest { |
417 protected: | 407 protected: |
418 AudioDecoderG722Test() : AudioDecoderTest() { | 408 AudioDecoderG722Test() : AudioDecoderTest() { |
419 codec_input_rate_hz_ = 16000; | 409 codec_input_rate_hz_ = 16000; |
420 frame_size_ = 160; | 410 frame_size_ = 160; |
421 data_length_ = 10 * frame_size_; | 411 data_length_ = 10 * frame_size_; |
422 decoder_ = new AudioDecoderG722; | 412 decoder_ = new AudioDecoderG722; |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
730 EXPECT_TRUE(CodecSupported(kDecoderCNGnb)); | 720 EXPECT_TRUE(CodecSupported(kDecoderCNGnb)); |
731 EXPECT_TRUE(CodecSupported(kDecoderCNGwb)); | 721 EXPECT_TRUE(CodecSupported(kDecoderCNGwb)); |
732 EXPECT_TRUE(CodecSupported(kDecoderCNGswb32kHz)); | 722 EXPECT_TRUE(CodecSupported(kDecoderCNGswb32kHz)); |
733 EXPECT_TRUE(CodecSupported(kDecoderCNGswb48kHz)); | 723 EXPECT_TRUE(CodecSupported(kDecoderCNGswb48kHz)); |
734 EXPECT_TRUE(CodecSupported(kDecoderArbitrary)); | 724 EXPECT_TRUE(CodecSupported(kDecoderArbitrary)); |
735 EXPECT_TRUE(CodecSupported(kDecoderOpus)); | 725 EXPECT_TRUE(CodecSupported(kDecoderOpus)); |
736 EXPECT_TRUE(CodecSupported(kDecoderOpus_2ch)); | 726 EXPECT_TRUE(CodecSupported(kDecoderOpus_2ch)); |
737 } | 727 } |
738 | 728 |
739 } // namespace webrtc | 729 } // namespace webrtc |
OLD | NEW |