Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: webrtc/modules/audio_coding/acm2/audio_coding_module_unittest.cc

Issue 2571483002: Fix for integer overflow in NetEq. (Closed)
Patch Set: More comments. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/modules/audio_coding/neteq/expand.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 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 959 matching lines...) Expand 10 before | Expand all | Expand 10 after
970 EXPECT_EQ(checksum_ref, checksum_string); 970 EXPECT_EQ(checksum_ref, checksum_string);
971 971
972 // Delete the output file. 972 // Delete the output file.
973 remove(output_file_name.c_str()); 973 remove(output_file_name.c_str());
974 } 974 }
975 }; 975 };
976 976
977 #if (defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX)) && \ 977 #if (defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX)) && \
978 defined(WEBRTC_CODEC_ILBC) && defined(WEBRTC_CODEC_G722) 978 defined(WEBRTC_CODEC_ILBC) && defined(WEBRTC_CODEC_G722)
979 TEST_F(AcmReceiverBitExactnessOldApi, 8kHzOutput) { 979 TEST_F(AcmReceiverBitExactnessOldApi, 8kHzOutput) {
980 Run(8000, PlatformChecksum("dce4890259e9ded50f472455aa470a6f", 980 Run(8000, PlatformChecksum("25cda36a1b967e75c0eb580924247681",
981 "1c4ada78b12612147f3026920f8dcc14", 981 "bbfe6a07f8bca872b5370885825ee061",
982 "d804791edf2d00be2bc31c81a47368d4", 982 "d5b9ae44d03dbd7c921dd9c228e03cc5",
983 "b2611f7323ab1209d5056399d0babbf5")); 983 "4d851d1f2e4b8a2f1727fac8fba4b1e1"));
984 } 984 }
985 985
986 TEST_F(AcmReceiverBitExactnessOldApi, 16kHzOutput) { 986 TEST_F(AcmReceiverBitExactnessOldApi, 16kHzOutput) {
987 Run(16000, PlatformChecksum("27356bddffaa42b5c841b49aa3a070c5", 987 Run(16000, PlatformChecksum("9c7b6f586c4b9d6d0195372660991353",
988 "5667d1872fc351244092ae995e5a5b32", 988 "1ab45baa674e681ec394e0d3824d8605",
989 "53f5dc8088148479ca112c4c6d0e91cb", 989 "dd4e7f2521b5f47c0016b12f06c08695",
990 "4061a876d64d6cec5a38450acf4f245d")); 990 "5401b64b6dbe7f090f846e89b0d858ce"));
991 } 991 }
992 992
993 TEST_F(AcmReceiverBitExactnessOldApi, 32kHzOutput) { 993 TEST_F(AcmReceiverBitExactnessOldApi, 32kHzOutput) {
994 Run(32000, PlatformChecksum("eb326547e83292305423b0a7ea57fea1", 994 Run(32000, PlatformChecksum("599b9484ca89615641ebd767cccb149f",
995 "be7fc3140e6b5188c2e5fae0a394543b", 995 "9f7d51569647eff38026dd815d43ca91",
996 "eab9a0bff17320d6457d04f4c56563c6", 996 "78d00d2a3f8f307fc3835ca588a18f3a",
997 "b60241ef0bac4a75f66eead04e71bb12")); 997 "d335eebc72f4d087aa397a9cf8f4967b"));
998 } 998 }
999 999
1000 TEST_F(AcmReceiverBitExactnessOldApi, 48kHzOutput) { 1000 TEST_F(AcmReceiverBitExactnessOldApi, 48kHzOutput) {
1001 Run(48000, PlatformChecksum("7eb79ea39b68472a5b04cf9a56e49cda", 1001 Run(48000, PlatformChecksum("5d3b4357c9044264bb4a601b6548bd55",
1002 "f8cdd6e018688b2fff25c9b865bebdbb", 1002 "8607778183d7ad02b8ce37eeeba4f37c",
1003 "2d18f0f06e7e2fc63b74d06e3c58067f", 1003 "fd71398d336b88cbd4fb5002846e91c6",
1004 "81c3e4d24ebec23ca48f42fbaec4aba0")); 1004 "8ce7e0e1c381d920ee7b57751b257de8"));
1005 } 1005 }
1006 1006
1007 TEST_F(AcmReceiverBitExactnessOldApi, 48kHzOutputExternalDecoder) { 1007 TEST_F(AcmReceiverBitExactnessOldApi, 48kHzOutputExternalDecoder) {
1008 class ADFactory : public AudioDecoderFactory { 1008 class ADFactory : public AudioDecoderFactory {
1009 public: 1009 public:
1010 ADFactory() 1010 ADFactory()
1011 : mock_decoder_(new MockAudioDecoder()), 1011 : mock_decoder_(new MockAudioDecoder()),
1012 pcmu_decoder_(1), 1012 pcmu_decoder_(1),
1013 decode_forwarder_(&pcmu_decoder_), 1013 decode_forwarder_(&pcmu_decoder_),
1014 fact_(CreateBuiltinAudioDecoderFactory()) { 1014 fact_(CreateBuiltinAudioDecoderFactory()) {
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
1070 }; 1070 };
1071 1071
1072 std::unique_ptr<MockAudioDecoder> mock_decoder_; 1072 std::unique_ptr<MockAudioDecoder> mock_decoder_;
1073 AudioDecoderPcmU pcmu_decoder_; 1073 AudioDecoderPcmU pcmu_decoder_;
1074 DecodeForwarder decode_forwarder_; 1074 DecodeForwarder decode_forwarder_;
1075 rtc::scoped_refptr<AudioDecoderFactory> fact_; // Fallback factory. 1075 rtc::scoped_refptr<AudioDecoderFactory> fact_; // Fallback factory.
1076 }; 1076 };
1077 1077
1078 rtc::scoped_refptr<rtc::RefCountedObject<ADFactory>> factory( 1078 rtc::scoped_refptr<rtc::RefCountedObject<ADFactory>> factory(
1079 new rtc::RefCountedObject<ADFactory>); 1079 new rtc::RefCountedObject<ADFactory>);
1080 Run(48000, PlatformChecksum("7eb79ea39b68472a5b04cf9a56e49cda", 1080 Run(48000, PlatformChecksum("5d3b4357c9044264bb4a601b6548bd55",
1081 "f8cdd6e018688b2fff25c9b865bebdbb", 1081 "8607778183d7ad02b8ce37eeeba4f37c",
1082 "2d18f0f06e7e2fc63b74d06e3c58067f", 1082 "fd71398d336b88cbd4fb5002846e91c6",
1083 "81c3e4d24ebec23ca48f42fbaec4aba0"), 1083 "8ce7e0e1c381d920ee7b57751b257de8"),
1084 factory, [](AudioCodingModule* acm) { 1084 factory, [](AudioCodingModule* acm) {
1085 acm->RegisterReceiveCodec(0, {"MockPCMu", 8000, 1}); 1085 acm->RegisterReceiveCodec(0, {"MockPCMu", 8000, 1});
1086 }); 1086 });
1087 } 1087 }
1088 #endif 1088 #endif
1089 1089
1090 // This test verifies bit exactness for the send-side of ACM. The test setup is 1090 // This test verifies bit exactness for the send-side of ACM. The test setup is
1091 // a chain of three different test classes: 1091 // a chain of three different test classes:
1092 // 1092 //
1093 // test::AcmSendTest -> AcmSenderBitExactness -> test::AcmReceiveTest 1093 // test::AcmSendTest -> AcmSenderBitExactness -> test::AcmReceiveTest
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after
1835 Run(16000, 8000, 1000); 1835 Run(16000, 8000, 1000);
1836 } 1836 }
1837 1837
1838 TEST_F(AcmSwitchingOutputFrequencyOldApi, Toggle8KhzTo16Khz) { 1838 TEST_F(AcmSwitchingOutputFrequencyOldApi, Toggle8KhzTo16Khz) {
1839 Run(8000, 16000, 1000); 1839 Run(8000, 16000, 1000);
1840 } 1840 }
1841 1841
1842 #endif 1842 #endif
1843 1843
1844 } // namespace webrtc 1844 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/audio_coding/neteq/expand.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698