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

Side by Side Diff: webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus_unittest.cc

Issue 2592253004: Make a the decisions of ANA optional for the opus encoder. (Closed)
Patch Set: Respond to 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 | « webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.cc ('k') | no next file » | 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) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 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 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 EXPECT_EQ(rtc::Optional<int>(8), config.GetNewComplexity()); 436 EXPECT_EQ(rtc::Optional<int>(8), config.GetNewComplexity());
437 437
438 // Bitrate within hysteresis window. Expect empty output. 438 // Bitrate within hysteresis window. Expect empty output.
439 config.bitrate_bps = rtc::Optional<int>(12500); 439 config.bitrate_bps = rtc::Optional<int>(12500);
440 EXPECT_EQ(rtc::Optional<int>(), config.GetNewComplexity()); 440 EXPECT_EQ(rtc::Optional<int>(), config.GetNewComplexity());
441 441
442 // Bitrate above hysteresis window. Expect lower complexity. 442 // Bitrate above hysteresis window. Expect lower complexity.
443 config.bitrate_bps = rtc::Optional<int>(14001); 443 config.bitrate_bps = rtc::Optional<int>(14001);
444 EXPECT_EQ(rtc::Optional<int>(6), config.GetNewComplexity()); 444 EXPECT_EQ(rtc::Optional<int>(6), config.GetNewComplexity());
445 } 445 }
446
447 TEST(AudioEncoderOpusTest, EmptyConfigDontAffectEncoderSettings) {
ivoc 2016/12/27 13:56:56 nit: Please rename to EmptyConfigDoesntAffectEncod
448 auto states = CreateCodec(2);
449 states.encoder->EnableAudioNetworkAdaptor("", nullptr);
450
451 auto config = CreateEncoderRuntimeConfig();
452 AudioNetworkAdaptor::EncoderRuntimeConfig empty_config;
453
454 EXPECT_CALL(**states.mock_audio_network_adaptor, GetEncoderRuntimeConfig())
455 .WillOnce(Return(config))
456 .WillOnce(Return(empty_config));
457
458 constexpr size_t kOverhead = 64;
459 EXPECT_CALL(**states.mock_audio_network_adaptor, SetOverhead(kOverhead))
460 .Times(2);
461 states.encoder->OnReceivedOverhead(kOverhead);
462 states.encoder->OnReceivedOverhead(kOverhead);
463
464 CheckEncoderRuntimeConfig(states.encoder.get(), config);
465 }
466
446 } // namespace webrtc 467 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698