Redirect logs to stderr in audioproc_f.
Notably, this displays logs from the AGC. Also add a "time per chunk" field to the perf output. R=aluebs@webrtc.org Review URL: https://webrtc-codereview.appspot.com/56509004 Cr-Commit-Position: refs/heads/master@{#9302}
This commit is contained in:
@@ -109,6 +109,7 @@
|
|||||||
'audioproc_debug_proto',
|
'audioproc_debug_proto',
|
||||||
'audioproc_test_utils',
|
'audioproc_test_utils',
|
||||||
'audioproc_protobuf_utils',
|
'audioproc_protobuf_utils',
|
||||||
|
'<(webrtc_root)/test/test.gyp:test_support',
|
||||||
'<(DEPTH)/third_party/gflags/gflags.gyp:gflags',
|
'<(DEPTH)/third_party/gflags/gflags.gyp:gflags',
|
||||||
],
|
],
|
||||||
'sources': [ 'test/audioproc_float.cc', ],
|
'sources': [ 'test/audioproc_float.cc', ],
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
#include "webrtc/modules/audio_processing/test/protobuf_utils.h"
|
#include "webrtc/modules/audio_processing/test/protobuf_utils.h"
|
||||||
#include "webrtc/modules/audio_processing/test/test_utils.h"
|
#include "webrtc/modules/audio_processing/test/test_utils.h"
|
||||||
#include "webrtc/system_wrappers/interface/tick_util.h"
|
#include "webrtc/system_wrappers/interface/tick_util.h"
|
||||||
|
#include "webrtc/test/testsupport/trace_to_stderr.h"
|
||||||
|
|
||||||
DEFINE_string(dump, "", "The name of the debug dump file to read from.");
|
DEFINE_string(dump, "", "The name of the debug dump file to read from.");
|
||||||
DEFINE_string(i, "", "The name of the input file to read from.");
|
DEFINE_string(i, "", "The name of the input file to read from.");
|
||||||
@@ -73,6 +74,7 @@ int main(int argc, char* argv[]) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test::TraceToStderr trace_to_stderr(true);
|
||||||
WavReader in_file(FLAGS_i);
|
WavReader in_file(FLAGS_i);
|
||||||
// If the output format is uninitialized, use the input format.
|
// If the output format is uninitialized, use the input format.
|
||||||
const int out_channels =
|
const int out_channels =
|
||||||
@@ -127,6 +129,8 @@ int main(int argc, char* argv[]) {
|
|||||||
int num_chunks = 0;
|
int num_chunks = 0;
|
||||||
while (in_file.ReadSamples(in_interleaved.size(),
|
while (in_file.ReadSamples(in_interleaved.size(),
|
||||||
&in_interleaved[0]) == in_interleaved.size()) {
|
&in_interleaved[0]) == in_interleaved.size()) {
|
||||||
|
// Have logs display the file time rather than wallclock time.
|
||||||
|
trace_to_stderr.SetTimeSeconds(num_chunks * 1.f / kChunksPerSecond);
|
||||||
FloatS16ToFloat(&in_interleaved[0], in_interleaved.size(),
|
FloatS16ToFloat(&in_interleaved[0], in_interleaved.size(),
|
||||||
&in_interleaved[0]);
|
&in_interleaved[0]);
|
||||||
Deinterleave(&in_interleaved[0], in_buf.num_frames(),
|
Deinterleave(&in_interleaved[0], in_buf.num_frames(),
|
||||||
@@ -155,8 +159,11 @@ int main(int argc, char* argv[]) {
|
|||||||
num_chunks++;
|
num_chunks++;
|
||||||
}
|
}
|
||||||
if (FLAGS_perf) {
|
if (FLAGS_perf) {
|
||||||
printf("Execution time: %.3fs\nFile time: %.2fs\n\n",
|
int64_t execution_time_ms = accumulated_time.Milliseconds();
|
||||||
accumulated_time.Milliseconds() * 0.001f, num_chunks * 0.01f);
|
printf("\nExecution time: %.3f s\nFile time: %.2f s\n"
|
||||||
|
"Time per chunk: %.3f ms\n",
|
||||||
|
execution_time_ms * 0.001f, num_chunks * 1.f / kChunksPerSecond,
|
||||||
|
execution_time_ms * 1.f / num_chunks);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user