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 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 } | 555 } |
556 | 556 |
557 TEST_F(AudioDecoderIsacFloatTest, SetTargetBitrate) { | 557 TEST_F(AudioDecoderIsacFloatTest, SetTargetBitrate) { |
558 TestSetAndGetTargetBitratesWithFixedCodec(audio_encoder_.get(), 32000); | 558 TestSetAndGetTargetBitratesWithFixedCodec(audio_encoder_.get(), 32000); |
559 } | 559 } |
560 | 560 |
561 TEST_F(AudioDecoderIsacSwbTest, EncodeDecode) { | 561 TEST_F(AudioDecoderIsacSwbTest, EncodeDecode) { |
562 int tolerance = 19757; | 562 int tolerance = 19757; |
563 double mse = 8.18e6; | 563 double mse = 8.18e6; |
564 int delay = 160; // Delay from input to output. | 564 int delay = 160; // Delay from input to output. |
565 EXPECT_TRUE(CodecSupported(kDecoderISACswb)); | |
566 EncodeDecodeTest(0, tolerance, mse, delay); | 565 EncodeDecodeTest(0, tolerance, mse, delay); |
567 ReInitTest(); | 566 ReInitTest(); |
568 EXPECT_FALSE(decoder_->HasDecodePlc()); | 567 EXPECT_FALSE(decoder_->HasDecodePlc()); |
569 } | 568 } |
570 | 569 |
571 TEST_F(AudioDecoderIsacSwbTest, SetTargetBitrate) { | 570 TEST_F(AudioDecoderIsacSwbTest, SetTargetBitrate) { |
572 TestSetAndGetTargetBitratesWithFixedCodec(audio_encoder_.get(), 32000); | 571 TestSetAndGetTargetBitratesWithFixedCodec(audio_encoder_.get(), 32000); |
573 } | 572 } |
574 | 573 |
575 // Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4198 | 574 // Fails Android ARM64. https://code.google.com/p/webrtc/issues/detail?id=4198 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
669 TestOpusSetTargetBitrates(audio_encoder_.get()); | 668 TestOpusSetTargetBitrates(audio_encoder_.get()); |
670 } | 669 } |
671 | 670 |
672 TEST(AudioDecoder, CodecSampleRateHz) { | 671 TEST(AudioDecoder, CodecSampleRateHz) { |
673 EXPECT_EQ(8000, CodecSampleRateHz(kDecoderPCMu)); | 672 EXPECT_EQ(8000, CodecSampleRateHz(kDecoderPCMu)); |
674 EXPECT_EQ(8000, CodecSampleRateHz(kDecoderPCMa)); | 673 EXPECT_EQ(8000, CodecSampleRateHz(kDecoderPCMa)); |
675 EXPECT_EQ(8000, CodecSampleRateHz(kDecoderPCMu_2ch)); | 674 EXPECT_EQ(8000, CodecSampleRateHz(kDecoderPCMu_2ch)); |
676 EXPECT_EQ(8000, CodecSampleRateHz(kDecoderPCMa_2ch)); | 675 EXPECT_EQ(8000, CodecSampleRateHz(kDecoderPCMa_2ch)); |
677 EXPECT_EQ(8000, CodecSampleRateHz(kDecoderILBC)); | 676 EXPECT_EQ(8000, CodecSampleRateHz(kDecoderILBC)); |
678 EXPECT_EQ(16000, CodecSampleRateHz(kDecoderISAC)); | 677 EXPECT_EQ(16000, CodecSampleRateHz(kDecoderISAC)); |
| 678 #ifndef WEBRTC_ARCH_ARM |
679 EXPECT_EQ(32000, CodecSampleRateHz(kDecoderISACswb)); | 679 EXPECT_EQ(32000, CodecSampleRateHz(kDecoderISACswb)); |
680 EXPECT_EQ(32000, CodecSampleRateHz(kDecoderISACfb)); | 680 EXPECT_EQ(32000, CodecSampleRateHz(kDecoderISACfb)); |
| 681 #endif |
681 EXPECT_EQ(8000, CodecSampleRateHz(kDecoderPCM16B)); | 682 EXPECT_EQ(8000, CodecSampleRateHz(kDecoderPCM16B)); |
682 EXPECT_EQ(16000, CodecSampleRateHz(kDecoderPCM16Bwb)); | 683 EXPECT_EQ(16000, CodecSampleRateHz(kDecoderPCM16Bwb)); |
683 EXPECT_EQ(32000, CodecSampleRateHz(kDecoderPCM16Bswb32kHz)); | 684 EXPECT_EQ(32000, CodecSampleRateHz(kDecoderPCM16Bswb32kHz)); |
684 EXPECT_EQ(48000, CodecSampleRateHz(kDecoderPCM16Bswb48kHz)); | 685 EXPECT_EQ(48000, CodecSampleRateHz(kDecoderPCM16Bswb48kHz)); |
685 EXPECT_EQ(8000, CodecSampleRateHz(kDecoderPCM16B_2ch)); | 686 EXPECT_EQ(8000, CodecSampleRateHz(kDecoderPCM16B_2ch)); |
686 EXPECT_EQ(16000, CodecSampleRateHz(kDecoderPCM16Bwb_2ch)); | 687 EXPECT_EQ(16000, CodecSampleRateHz(kDecoderPCM16Bwb_2ch)); |
687 EXPECT_EQ(32000, CodecSampleRateHz(kDecoderPCM16Bswb32kHz_2ch)); | 688 EXPECT_EQ(32000, CodecSampleRateHz(kDecoderPCM16Bswb32kHz_2ch)); |
688 EXPECT_EQ(48000, CodecSampleRateHz(kDecoderPCM16Bswb48kHz_2ch)); | 689 EXPECT_EQ(48000, CodecSampleRateHz(kDecoderPCM16Bswb48kHz_2ch)); |
689 EXPECT_EQ(8000, CodecSampleRateHz(kDecoderPCM16B_5ch)); | 690 EXPECT_EQ(8000, CodecSampleRateHz(kDecoderPCM16B_5ch)); |
690 EXPECT_EQ(16000, CodecSampleRateHz(kDecoderG722)); | 691 EXPECT_EQ(16000, CodecSampleRateHz(kDecoderG722)); |
691 EXPECT_EQ(16000, CodecSampleRateHz(kDecoderG722_2ch)); | 692 EXPECT_EQ(16000, CodecSampleRateHz(kDecoderG722_2ch)); |
692 EXPECT_EQ(-1, CodecSampleRateHz(kDecoderRED)); | 693 EXPECT_EQ(-1, CodecSampleRateHz(kDecoderRED)); |
693 EXPECT_EQ(-1, CodecSampleRateHz(kDecoderAVT)); | 694 EXPECT_EQ(-1, CodecSampleRateHz(kDecoderAVT)); |
694 EXPECT_EQ(8000, CodecSampleRateHz(kDecoderCNGnb)); | 695 EXPECT_EQ(8000, CodecSampleRateHz(kDecoderCNGnb)); |
695 EXPECT_EQ(16000, CodecSampleRateHz(kDecoderCNGwb)); | 696 EXPECT_EQ(16000, CodecSampleRateHz(kDecoderCNGwb)); |
696 EXPECT_EQ(32000, CodecSampleRateHz(kDecoderCNGswb32kHz)); | 697 EXPECT_EQ(32000, CodecSampleRateHz(kDecoderCNGswb32kHz)); |
697 EXPECT_EQ(48000, CodecSampleRateHz(kDecoderOpus)); | 698 EXPECT_EQ(48000, CodecSampleRateHz(kDecoderOpus)); |
698 EXPECT_EQ(48000, CodecSampleRateHz(kDecoderOpus_2ch)); | 699 EXPECT_EQ(48000, CodecSampleRateHz(kDecoderOpus_2ch)); |
699 // TODO(tlegrand): Change 32000 to 48000 below once ACM has 48 kHz support. | 700 // TODO(tlegrand): Change 32000 to 48000 below once ACM has 48 kHz support. |
700 EXPECT_EQ(32000, CodecSampleRateHz(kDecoderCNGswb48kHz)); | 701 EXPECT_EQ(32000, CodecSampleRateHz(kDecoderCNGswb48kHz)); |
701 EXPECT_EQ(-1, CodecSampleRateHz(kDecoderArbitrary)); | 702 EXPECT_EQ(-1, CodecSampleRateHz(kDecoderArbitrary)); |
702 } | 703 } |
703 | 704 |
704 TEST(AudioDecoder, CodecSupported) { | 705 TEST(AudioDecoder, CodecSupported) { |
| 706 #ifdef WEBRTC_ARCH_ARM |
| 707 static const bool has_isac_swb = false; |
| 708 #else |
| 709 static const bool has_isac_swb = true; |
| 710 #endif |
705 EXPECT_TRUE(CodecSupported(kDecoderPCMu)); | 711 EXPECT_TRUE(CodecSupported(kDecoderPCMu)); |
706 EXPECT_TRUE(CodecSupported(kDecoderPCMa)); | 712 EXPECT_TRUE(CodecSupported(kDecoderPCMa)); |
707 EXPECT_TRUE(CodecSupported(kDecoderPCMu_2ch)); | 713 EXPECT_TRUE(CodecSupported(kDecoderPCMu_2ch)); |
708 EXPECT_TRUE(CodecSupported(kDecoderPCMa_2ch)); | 714 EXPECT_TRUE(CodecSupported(kDecoderPCMa_2ch)); |
709 EXPECT_TRUE(CodecSupported(kDecoderILBC)); | 715 EXPECT_TRUE(CodecSupported(kDecoderILBC)); |
710 EXPECT_TRUE(CodecSupported(kDecoderISAC)); | 716 EXPECT_TRUE(CodecSupported(kDecoderISAC)); |
711 EXPECT_TRUE(CodecSupported(kDecoderISACswb)); | 717 EXPECT_EQ(has_isac_swb, CodecSupported(kDecoderISACswb)); |
712 EXPECT_TRUE(CodecSupported(kDecoderISACfb)); | 718 EXPECT_EQ(has_isac_swb, CodecSupported(kDecoderISACfb)); |
713 EXPECT_TRUE(CodecSupported(kDecoderPCM16B)); | 719 EXPECT_TRUE(CodecSupported(kDecoderPCM16B)); |
714 EXPECT_TRUE(CodecSupported(kDecoderPCM16Bwb)); | 720 EXPECT_TRUE(CodecSupported(kDecoderPCM16Bwb)); |
715 EXPECT_TRUE(CodecSupported(kDecoderPCM16Bswb32kHz)); | 721 EXPECT_TRUE(CodecSupported(kDecoderPCM16Bswb32kHz)); |
716 EXPECT_TRUE(CodecSupported(kDecoderPCM16Bswb48kHz)); | 722 EXPECT_TRUE(CodecSupported(kDecoderPCM16Bswb48kHz)); |
717 EXPECT_TRUE(CodecSupported(kDecoderPCM16B_2ch)); | 723 EXPECT_TRUE(CodecSupported(kDecoderPCM16B_2ch)); |
718 EXPECT_TRUE(CodecSupported(kDecoderPCM16Bwb_2ch)); | 724 EXPECT_TRUE(CodecSupported(kDecoderPCM16Bwb_2ch)); |
719 EXPECT_TRUE(CodecSupported(kDecoderPCM16Bswb32kHz_2ch)); | 725 EXPECT_TRUE(CodecSupported(kDecoderPCM16Bswb32kHz_2ch)); |
720 EXPECT_TRUE(CodecSupported(kDecoderPCM16Bswb48kHz_2ch)); | 726 EXPECT_TRUE(CodecSupported(kDecoderPCM16Bswb48kHz_2ch)); |
721 EXPECT_TRUE(CodecSupported(kDecoderPCM16B_5ch)); | 727 EXPECT_TRUE(CodecSupported(kDecoderPCM16B_5ch)); |
722 EXPECT_TRUE(CodecSupported(kDecoderG722)); | 728 EXPECT_TRUE(CodecSupported(kDecoderG722)); |
723 EXPECT_TRUE(CodecSupported(kDecoderG722_2ch)); | 729 EXPECT_TRUE(CodecSupported(kDecoderG722_2ch)); |
724 EXPECT_TRUE(CodecSupported(kDecoderRED)); | 730 EXPECT_TRUE(CodecSupported(kDecoderRED)); |
725 EXPECT_TRUE(CodecSupported(kDecoderAVT)); | 731 EXPECT_TRUE(CodecSupported(kDecoderAVT)); |
726 EXPECT_TRUE(CodecSupported(kDecoderCNGnb)); | 732 EXPECT_TRUE(CodecSupported(kDecoderCNGnb)); |
727 EXPECT_TRUE(CodecSupported(kDecoderCNGwb)); | 733 EXPECT_TRUE(CodecSupported(kDecoderCNGwb)); |
728 EXPECT_TRUE(CodecSupported(kDecoderCNGswb32kHz)); | 734 EXPECT_TRUE(CodecSupported(kDecoderCNGswb32kHz)); |
729 EXPECT_TRUE(CodecSupported(kDecoderCNGswb48kHz)); | 735 EXPECT_TRUE(CodecSupported(kDecoderCNGswb48kHz)); |
730 EXPECT_TRUE(CodecSupported(kDecoderArbitrary)); | 736 EXPECT_TRUE(CodecSupported(kDecoderArbitrary)); |
731 EXPECT_TRUE(CodecSupported(kDecoderOpus)); | 737 EXPECT_TRUE(CodecSupported(kDecoderOpus)); |
732 EXPECT_TRUE(CodecSupported(kDecoderOpus_2ch)); | 738 EXPECT_TRUE(CodecSupported(kDecoderOpus_2ch)); |
733 } | 739 } |
734 | 740 |
735 } // namespace webrtc | 741 } // namespace webrtc |
OLD | NEW |