Added performance benchmarking in APM and iSAC-fix for Buildbots.
Review URL: https://webrtc-codereview.appspot.com/929022 git-svn-id: http://webrtc.googlecode.com/svn/trunk@3170 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
6e46d5b1c1
commit
4cd8f1f182
@ -8,16 +8,17 @@
|
|||||||
* be found in the AUTHORS file in the root of the source tree.
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* kenny.c - Main function for the iSAC coder */
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
#include "isacfix.h"
|
#include "webrtc/modules/audio_coding/codecs/isac/fix/interface/isacfix.h"
|
||||||
|
#include "webrtc/test/testsupport/perf_test.h"
|
||||||
|
|
||||||
|
// TODO(kma): Clean up the code and change benchmarking the whole codec to
|
||||||
|
// separate encoder and decoder.
|
||||||
|
|
||||||
/* Defines */
|
/* Defines */
|
||||||
#define SEED_FILE "randseed.txt" /* Used when running decoder on garbage data */
|
#define SEED_FILE "randseed.txt" /* Used when running decoder on garbage data */
|
||||||
@ -170,7 +171,7 @@ int main(int argc, char* argv[])
|
|||||||
" in adaptive mode.\n\n");
|
" in adaptive mode.\n\n");
|
||||||
printf("[-FL num] :Set (initial) frame length in msec. Valid length"
|
printf("[-FL num] :Set (initial) frame length in msec. Valid length"
|
||||||
" are 30 and 60 msec.\n\n");
|
" are 30 and 60 msec.\n\n");
|
||||||
printf("[-FIXED_FL] :Frame length will be fixed to initial value.\n\n");
|
printf("[-FIXED_FL] :Frame length to be fixed to initial value.\n\n");
|
||||||
printf("[-MAX num] :Set the limit for the payload size of iSAC"
|
printf("[-MAX num] :Set the limit for the payload size of iSAC"
|
||||||
" in bytes. \n");
|
" in bytes. \n");
|
||||||
printf(" Minimum 100, maximum 400.\n\n");
|
printf(" Minimum 100, maximum 400.\n\n");
|
||||||
@ -374,7 +375,8 @@ int main(int argc, char* argv[])
|
|||||||
sscanf(argv[CodingMode+1], "%s", bottleneck_file);
|
sscanf(argv[CodingMode+1], "%s", bottleneck_file);
|
||||||
f_bn = fopen(bottleneck_file, "rb");
|
f_bn = fopen(bottleneck_file, "rb");
|
||||||
if (f_bn == NULL) {
|
if (f_bn == NULL) {
|
||||||
printf("No value provided for BottleNeck and cannot read file %s\n", bottleneck_file);
|
printf("No value provided for BottleNeck and cannot read file %s\n",
|
||||||
|
bottleneck_file);
|
||||||
exit(0);
|
exit(0);
|
||||||
} else {
|
} else {
|
||||||
int aux_var;
|
int aux_var;
|
||||||
@ -565,8 +567,8 @@ int main(int argc, char* argv[])
|
|||||||
shortdata,
|
shortdata,
|
||||||
(WebRtc_Word16*)streamdata);
|
(WebRtc_Word16*)streamdata);
|
||||||
|
|
||||||
/* If packet is ready, and CE testing, call the different API functions
|
/* If packet is ready, and CE testing, call the different API
|
||||||
from the internal API. */
|
functions from the internal API. */
|
||||||
if (stream_len>0) {
|
if (stream_len>0) {
|
||||||
if (testCE == 1) {
|
if (testCE == 1) {
|
||||||
err = WebRtcIsacfix_ReadBwIndex((WebRtc_Word16*)streamdata, &bwe);
|
err = WebRtcIsacfix_ReadBwIndex((WebRtc_Word16*)streamdata, &bwe);
|
||||||
@ -808,6 +810,10 @@ int main(int argc, char* argv[])
|
|||||||
runtime, (100*runtime/length_file));
|
runtime, (100*runtime/length_file));
|
||||||
printf("\n\n_______________________________________________\n");
|
printf("\n\n_______________________________________________\n");
|
||||||
|
|
||||||
|
// Record the results with Perf test tools.
|
||||||
|
webrtc::test::PrintResult("time_per_10ms_frame", "", "isac",
|
||||||
|
(runtime * 10000) / length_file, "us", false);
|
||||||
|
|
||||||
fclose(inp);
|
fclose(inp);
|
||||||
fclose(outp);
|
fclose(outp);
|
||||||
fclose(outbits);
|
fclose(outbits);
|
@ -14,13 +14,14 @@
|
|||||||
'type': 'executable',
|
'type': 'executable',
|
||||||
'dependencies': [
|
'dependencies': [
|
||||||
'iSACFix',
|
'iSACFix',
|
||||||
|
'<(webrtc_root)/test/test.gyp:test_support',
|
||||||
],
|
],
|
||||||
'include_dirs': [
|
'include_dirs': [
|
||||||
'./fix/test',
|
'./fix/test',
|
||||||
'./fix/interface',
|
'./fix/interface',
|
||||||
],
|
],
|
||||||
'sources': [
|
'sources': [
|
||||||
'./fix/test/kenny.c',
|
'./fix/test/kenny.cc',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -58,8 +58,9 @@
|
|||||||
'dependencies': [
|
'dependencies': [
|
||||||
'audio_processing',
|
'audio_processing',
|
||||||
'audioproc_debug_proto',
|
'audioproc_debug_proto',
|
||||||
'<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
|
|
||||||
'<(DEPTH)/testing/gtest.gyp:gtest',
|
'<(DEPTH)/testing/gtest.gyp:gtest',
|
||||||
|
'<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
|
||||||
|
'<(webrtc_root)/test/test.gyp:test_support',
|
||||||
],
|
],
|
||||||
'sources': [ 'test/process_test.cc', ],
|
'sources': [ 'test/process_test.cc', ],
|
||||||
},
|
},
|
||||||
|
@ -19,11 +19,12 @@
|
|||||||
|
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
#include "audio_processing.h"
|
#include "webrtc/modules/audio_processing/include/audio_processing.h"
|
||||||
#include "cpu_features_wrapper.h"
|
#include "webrtc/modules/interface/module_common_types.h"
|
||||||
#include "module_common_types.h"
|
#include "webrtc/system_wrappers/interface/cpu_features_wrapper.h"
|
||||||
#include "scoped_ptr.h"
|
#include "webrtc/system_wrappers/interface/scoped_ptr.h"
|
||||||
#include "tick_util.h"
|
#include "webrtc/system_wrappers/interface/tick_util.h"
|
||||||
|
#include "webrtc/test/testsupport/perf_test.h"
|
||||||
#ifdef WEBRTC_ANDROID_PLATFORM_BUILD
|
#ifdef WEBRTC_ANDROID_PLATFORM_BUILD
|
||||||
#include "external/webrtc/webrtc/modules/audio_processing/debug.pb.h"
|
#include "external/webrtc/webrtc/modules/audio_processing/debug.pb.h"
|
||||||
#else
|
#else
|
||||||
@ -1032,6 +1033,9 @@ void void_main(int argc, char* argv[]) {
|
|||||||
(exec_time * 1.0) / primary_count,
|
(exec_time * 1.0) / primary_count,
|
||||||
(max_time_us + max_time_reverse_us) / 1000.0,
|
(max_time_us + max_time_reverse_us) / 1000.0,
|
||||||
(min_time_us + min_time_reverse_us) / 1000.0);
|
(min_time_us + min_time_reverse_us) / 1000.0);
|
||||||
|
// Record the results with Perf test tools.
|
||||||
|
webrtc::test::PrintResult("time_per_10ms_frame", "", "audioproc",
|
||||||
|
(exec_time * 1000) / primary_count, "us", false);
|
||||||
} else {
|
} else {
|
||||||
printf("Warning: no capture frames\n");
|
printf("Warning: no capture frames\n");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user