| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 // This test encodes an audio file using Opus twice with different bitrates | 60 // This test encodes an audio file using Opus twice with different bitrates |
| 61 // (12.5 kbps and 15.5 kbps). The runtime for each is measured, and the ratio | 61 // (12.5 kbps and 15.5 kbps). The runtime for each is measured, and the ratio |
| 62 // between the two is calculated and tracked. This test explicitly sets the | 62 // between the two is calculated and tracked. This test explicitly sets the |
| 63 // low_rate_complexity to 9. When running on desktop platforms, this is the same | 63 // low_rate_complexity to 9. When running on desktop platforms, this is the same |
| 64 // as the regular complexity, and the expectation is that the resulting ratio | 64 // as the regular complexity, and the expectation is that the resulting ratio |
| 65 // should be less than 100% (since the encoder runs faster at lower bitrates, | 65 // should be less than 100% (since the encoder runs faster at lower bitrates, |
| 66 // given a fixed complexity setting). On the other hand, when running on | 66 // given a fixed complexity setting). On the other hand, when running on |
| 67 // mobiles, the regular complexity is 5, and we expect the resulting ratio to | 67 // mobiles, the regular complexity is 5, and we expect the resulting ratio to |
| 68 // be higher, since we have explicitly asked for a higher complexity setting at | 68 // be higher, since we have explicitly asked for a higher complexity setting at |
| 69 // the lower rate. | 69 // the lower rate. |
| 70 TEST(AudioEncoderOpusComplexityAdaptationTest, AdaptationOn) { | 70 TEST(MAYBE_AudioEncoderOpusComplexityAdaptationTest, AdaptationOn) { |
| 71 // Create config. | 71 // Create config. |
| 72 AudioEncoderOpus::Config config; | 72 AudioEncoderOpus::Config config; |
| 73 config.bitrate_bps = rtc::Optional<int>(12500); | 73 config.bitrate_bps = rtc::Optional<int>(12500); |
| 74 config.low_rate_complexity = 9; | 74 config.low_rate_complexity = 9; |
| 75 int64_t runtime_12500bps = RunComplexityTest(config); | 75 int64_t runtime_12500bps = RunComplexityTest(config); |
| 76 | 76 |
| 77 config.bitrate_bps = rtc::Optional<int>(15500); | 77 config.bitrate_bps = rtc::Optional<int>(15500); |
| 78 int64_t runtime_15500bps = RunComplexityTest(config); | 78 int64_t runtime_15500bps = RunComplexityTest(config); |
| 79 | 79 |
| 80 test::PrintResult("opus_encoding_complexity_ratio", "", "adaptation_on", | 80 test::PrintResult("opus_encoding_complexity_ratio", "", "adaptation_on", |
| 81 100.0 * runtime_12500bps / runtime_15500bps, "percent", | 81 100.0 * runtime_12500bps / runtime_15500bps, "percent", |
| 82 true); | 82 true); |
| 83 } | 83 } |
| 84 | 84 |
| 85 // This test is identical to the one above, but without the complexity | 85 // This test is identical to the one above, but without the complexity |
| 86 // adaptation enabled (neither on desktop, nor on mobile). The expectation is | 86 // adaptation enabled (neither on desktop, nor on mobile). The expectation is |
| 87 // that the resulting ratio is less than 100% at all times. | 87 // that the resulting ratio is less than 100% at all times. |
| 88 TEST(AudioEncoderOpusComplexityAdaptationTest, AdaptationOff) { | 88 TEST(MAYBE_AudioEncoderOpusComplexityAdaptationTest, AdaptationOff) { |
| 89 // Create config. | 89 // Create config. |
| 90 AudioEncoderOpus::Config config; | 90 AudioEncoderOpus::Config config; |
| 91 config.bitrate_bps = rtc::Optional<int>(12500); | 91 config.bitrate_bps = rtc::Optional<int>(12500); |
| 92 int64_t runtime_12500bps = RunComplexityTest(config); | 92 int64_t runtime_12500bps = RunComplexityTest(config); |
| 93 | 93 |
| 94 config.bitrate_bps = rtc::Optional<int>(15500); | 94 config.bitrate_bps = rtc::Optional<int>(15500); |
| 95 int64_t runtime_15500bps = RunComplexityTest(config); | 95 int64_t runtime_15500bps = RunComplexityTest(config); |
| 96 | 96 |
| 97 test::PrintResult("opus_encoding_complexity_ratio", "", "adaptation_off", | 97 test::PrintResult("opus_encoding_complexity_ratio", "", "adaptation_off", |
| 98 100.0 * runtime_12500bps / runtime_15500bps, "", true); | 98 100.0 * runtime_12500bps / runtime_15500bps, "", true); |
| 99 } | 99 } |
| 100 } // namespace webrtc | 100 } // namespace webrtc |
| OLD | NEW |