Added buildbot benchmarking in iSAC and APM into Android platform build.

Review URL: https://webrtc-codereview.appspot.com/964022

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3247 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
kma@webrtc.org 2012-12-07 15:26:28 +00:00
parent b968213f3c
commit 0e739508e0
8 changed files with 74 additions and 18 deletions

View File

@ -20,6 +20,9 @@ include $(MY_WEBRTC_ROOT_PATH)/webrtc/modules/audio_processing/utility/Android.m
include $(MY_WEBRTC_ROOT_PATH)/webrtc/modules/utility/source/Android.mk
include $(MY_WEBRTC_ROOT_PATH)/webrtc/system_wrappers/source/Android.mk
# test support
include $(MY_WEBRTC_ROOT_PATH)/webrtc/test/Android.mk
# build .so
LOCAL_PATH := $(call my-dir)

View File

@ -119,7 +119,7 @@ include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := tests
LOCAL_CPP_EXTENSION := .cc
LOCAL_SRC_FILES:= ../test/kenny.c
LOCAL_SRC_FILES:= ../test/kenny.cc
# Flags passed to both C and C++ files.
LOCAL_CFLAGS := $(MY_WEBRTC_COMMON_DEFS)
@ -131,7 +131,8 @@ LOCAL_C_INCLUDES := \
LOCAL_STATIC_LIBRARIES := \
libwebrtc_isacfix \
libwebrtc_spl \
libwebrtc_system_wrappers
libwebrtc_system_wrappers \
libwebrtc_test_support
ifeq ($(WEBRTC_BUILD_NEON_LIBS),true)
LOCAL_STATIC_LIBRARIES += \

View File

@ -8,16 +8,17 @@
* 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 <stdlib.h>
#include <string.h>
#include <time.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 */
#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");
printf("[-FL num] :Set (initial) frame length in msec. Valid length"
" 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"
" in bytes. \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);
f_bn = fopen(bottleneck_file, "rb");
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);
} else {
int aux_var;
@ -565,8 +567,8 @@ int main(int argc, char* argv[])
shortdata,
(WebRtc_Word16*)streamdata);
/* If packet is ready, and CE testing, call the different API functions
from the internal API. */
/* If packet is ready, and CE testing, call the different API
functions from the internal API. */
if (stream_len>0) {
if (testCE == 1) {
err = WebRtcIsacfix_ReadBwIndex((WebRtc_Word16*)streamdata, &bwe);
@ -808,6 +810,10 @@ int main(int argc, char* argv[])
runtime, (100*runtime/length_file));
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(outp);
fclose(outbits);

View File

@ -14,13 +14,14 @@
'type': 'executable',
'dependencies': [
'iSACFix',
'<(webrtc_root)/test/test.gyp:test_support',
],
'include_dirs': [
'./fix/test',
'./fix/interface',
],
'sources': [
'./fix/test/kenny.c',
'./fix/test/kenny.cc',
],
},
],

View File

@ -89,6 +89,7 @@ LOCAL_C_INCLUDES := \
LOCAL_STATIC_LIBRARIES := \
libgtest \
libwebrtc_test_support \
libprotobuf-cpp-2.3.0-lite
LOCAL_SHARED_LIBRARIES := \
@ -113,8 +114,7 @@ LOCAL_MODULE_TAGS := tests
LOCAL_CPP_EXTENSION := .cc
LOCAL_SRC_FILES:= \
$(call all-proto-files-under, test) \
test/unit_test.cc \
../../test/testsupport/fileutils.cc
test/unit_test.cc
# Flags passed to both C and C++ files.
LOCAL_CFLAGS := \
@ -136,6 +136,7 @@ LOCAL_C_INCLUDES := \
LOCAL_STATIC_LIBRARIES := \
libgtest \
libwebrtc_test_support \
libprotobuf-cpp-2.3.0-lite
LOCAL_SHARED_LIBRARIES := \

View File

@ -58,8 +58,9 @@
'dependencies': [
'audio_processing',
'audioproc_debug_proto',
'<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
'<(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', ],
},

View File

@ -19,11 +19,12 @@
#include "gtest/gtest.h"
#include "audio_processing.h"
#include "cpu_features_wrapper.h"
#include "module_common_types.h"
#include "scoped_ptr.h"
#include "tick_util.h"
#include "webrtc/modules/audio_processing/include/audio_processing.h"
#include "webrtc/modules/interface/module_common_types.h"
#include "webrtc/system_wrappers/interface/cpu_features_wrapper.h"
#include "webrtc/system_wrappers/interface/scoped_ptr.h"
#include "webrtc/system_wrappers/interface/tick_util.h"
#include "webrtc/test/testsupport/perf_test.h"
#ifdef WEBRTC_ANDROID_PLATFORM_BUILD
#include "external/webrtc/webrtc/modules/audio_processing/debug.pb.h"
#else
@ -1032,6 +1033,9 @@ void void_main(int argc, char* argv[]) {
(exec_time * 1.0) / primary_count,
(max_time_us + max_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 {
printf("Warning: no capture frames\n");
}

39
webrtc/test/Android.mk Normal file
View File

@ -0,0 +1,39 @@
# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
include $(LOCAL_PATH)/../../android-webrtc.mk
LOCAL_ARM_MODE := arm
LOCAL_MODULE:= libwebrtc_test_support
LOCAL_MODULE_TAGS := optional
LOCAL_CPP_EXTENSION := .cc
LOCAL_SRC_FILES:= \
testsupport/fileutils.cc \
testsupport/perf_test.cc
# Flags passed to both C and C++ files.
LOCAL_CFLAGS := \
$(MY_WEBRTC_COMMON_DEFS)
LOCAL_C_INCLUDES := \
external/gtest/include \
external/webrtc \
external/webrtc/webrtc
LOCAL_STATIC_LIBRARIES := \
libgtest
ifndef NDK_ROOT
include external/stlport/libstlport.mk
endif
include $(BUILD_STATIC_LIBRARY)