Reduce the runtime of some ACM tests in modules_tests
By reducing the length of the audio input, the total runtime of
$ out/Debug/modules_tests --gtest_filter=AudioCodingModuleTest.*
is reduced by more than 10x, when run single-threaded.
The PCMFile helper class is extended with a FastForward method (to
skip initial silence in the test files) and a limiter on how much to
read.
BUG=webrtc:2463
R=ivoc@webrtc.org
Review URL: https://codereview.webrtc.org/1513223002 .
Cr-Commit-Position: refs/heads/master@{#10973}
diff --git a/webrtc/modules/audio_coding/test/EncodeDecodeTest.cc b/webrtc/modules/audio_coding/test/EncodeDecodeTest.cc
index ef45705..e0222af 100644
--- a/webrtc/modules/audio_coding/test/EncodeDecodeTest.cc
+++ b/webrtc/modules/audio_coding/test/EncodeDecodeTest.cc
@@ -63,6 +63,10 @@
if (channels == 2) {
_pcmFile.ReadStereo(true);
}
+ // Set test length to 500 ms (50 blocks of 10 ms each).
+ _pcmFile.SetNum10MsBlocksToRead(50);
+ // Fast-forward 1 second (100 blocks) since the file starts with silence.
+ _pcmFile.FastForward(100);
// Set the codec for the current test.
if ((testMode == 0) || (testMode == 1)) {