diff --git a/webrtc/BUILD.gn b/webrtc/BUILD.gn index 064b1b440b..da67c093ec 100644 --- a/webrtc/BUILD.gn +++ b/webrtc/BUILD.gn @@ -591,6 +591,7 @@ if (rtc_include_tests) { webrtc_perf_tests_resources = [ "//resources/audio_coding/speech_mono_16kHz.pcm", + "//resources/audio_coding/speech_mono_32_48kHz.pcm", "//resources/audio_coding/testfile32kHz.pcm", "//resources/ConferenceMotion_1280_720_50.yuv", "//resources/difficult_photo_1850_1110.yuv", diff --git a/webrtc/modules/audio_coding/codecs/opus/opus_complexity_unittest.cc b/webrtc/modules/audio_coding/codecs/opus/opus_complexity_unittest.cc index 5339cffdfc..f242aa48c7 100644 --- a/webrtc/modules/audio_coding/codecs/opus/opus_complexity_unittest.cc +++ b/webrtc/modules/audio_coding/codecs/opus/opus_complexity_unittest.cc @@ -49,16 +49,8 @@ int64_t RunComplexityTest(const AudioEncoderOpus::Config& config) { } } // namespace -#if defined(WEBRTC_ANDROID) -#define MAYBE_AudioEncoderOpusComplexityAdaptationTest \ - DISABLED_AudioEncoderOpusComplexityAdaptationTest -#else -#define MAYBE_AudioEncoderOpusComplexityAdaptationTest \ - AudioEncoderOpusComplexityAdaptationTest -#endif - // This test encodes an audio file using Opus twice with different bitrates -// (12.5 kbps and 15.5 kbps). The runtime for each is measured, and the ratio +// (~11 kbps and 15.5 kbps). The runtime for each is measured, and the ratio // between the two is calculated and tracked. This test explicitly sets the // low_rate_complexity to 9. When running on desktop platforms, this is the same // as the regular complexity, and the expectation is that the resulting ratio @@ -67,34 +59,40 @@ int64_t RunComplexityTest(const AudioEncoderOpus::Config& config) { // mobiles, the regular complexity is 5, and we expect the resulting ratio to // be higher, since we have explicitly asked for a higher complexity setting at // the lower rate. -TEST(MAYBE_AudioEncoderOpusComplexityAdaptationTest, AdaptationOn) { +TEST(AudioEncoderOpusComplexityAdaptationTest, AdaptationOn) { // Create config. AudioEncoderOpus::Config config; - config.bitrate_bps = rtc::Optional(12500); + // The limit -- including the hysteresis window -- at which the complexity + // shuold be increased. + config.bitrate_bps = rtc::Optional(11000 - 1); config.low_rate_complexity = 9; - int64_t runtime_12500bps = RunComplexityTest(config); + int64_t runtime_10999bps = RunComplexityTest(config); config.bitrate_bps = rtc::Optional(15500); int64_t runtime_15500bps = RunComplexityTest(config); test::PrintResult("opus_encoding_complexity_ratio", "", "adaptation_on", - 100.0 * runtime_12500bps / runtime_15500bps, "percent", + 100.0 * runtime_10999bps / runtime_15500bps, "percent", true); } // This test is identical to the one above, but without the complexity // adaptation enabled (neither on desktop, nor on mobile). The expectation is // that the resulting ratio is less than 100% at all times. -TEST(MAYBE_AudioEncoderOpusComplexityAdaptationTest, AdaptationOff) { +TEST(AudioEncoderOpusComplexityAdaptationTest, AdaptationOff) { // Create config. AudioEncoderOpus::Config config; - config.bitrate_bps = rtc::Optional(12500); - int64_t runtime_12500bps = RunComplexityTest(config); + // The limit -- including the hysteresis window -- at which the complexity + // shuold be increased (but not in this test since complexity adaptation is + // disabled). + config.bitrate_bps = rtc::Optional(11000 - 1); + int64_t runtime_10999bps = RunComplexityTest(config); config.bitrate_bps = rtc::Optional(15500); int64_t runtime_15500bps = RunComplexityTest(config); test::PrintResult("opus_encoding_complexity_ratio", "", "adaptation_off", - 100.0 * runtime_12500bps / runtime_15500bps, "", true); + 100.0 * runtime_10999bps / runtime_15500bps, "percent", + true); } } // namespace webrtc