Name Date Size #Lines LOC

..--

AacDecBenchmark.cppH A D25-Apr-202513.4 KiB321259

Android.bpH A D25-Apr-20251 KiB3431

AndroidTest.xmlH A D25-Apr-20252.1 KiB4227

DynamicConfig.xmlH A D25-Apr-2025839 215

README.mdH A D25-Apr-20254 KiB12182

README.md

1# Benchmark tests
2
3This Benchmark app analyses the time taken by AAC Decoder for given set of inputs. It is used to benchmark decoder module on android devices.
4
5This page describes steps to run the AAC decoder Benchmark test.
6
7Run the following steps to build the test suite:
8```
9mmm external/aac/tests/AacDecBenchmark/
10```
11
12# Resources
13The resource folder for the tests is taken from [here](https://dl.google.com/android-unittest/media/external/aac/tests/AacDecBenchmark/AacDecBenchmark-1.0.zip)
14
15Download the AacDecBenchmark-1.0.zip folder, unzip and push it to any path on the device, Let's say the path be /sdcard/test. You can give the path wherever you chose to put the files.
16
17```
18unzip AacDecBenchmark-1.0.zip
19adb push AacDecBenchmark-1.0 /sdcard/test
20```
21
22# <a name="BenchmarkApplication"></a> Benchmark Application
23To run the test suite for measuring performance, follow the following steps:
24
25Benchmark Application can be run in two ways.
26
27## Steps to run with atest
28Note that atest command will install Benchmark application and push the required test files to the device as well.
29
30For running the benchmark test, run the following command
31```
32atest AacDecBenchmark
33```
34
35## Steps to run without atest (push binary to the device and run)
36
37To run the test suite for measuring performance of the decoder, follow the following steps:
38
39The 64-bit binaries will be created in the following path : ${OUT}/data/benchmarktest64/
40
41The 32-bit binaries will be created in the following path : ${OUT}/data/benchmarktest/
42
43To test 64-bit binary push binaries from benchmarktest64.
44
45```
46adb push $(OUT)/data/benchmarktest64/AacDecBenchmark/AacDecBenchmark /data/local/tmp/
47```
48
49To test 32-bit binary push binaries from benchmarktest.
50
51```
52adb push $(OUT)/data/benchmarktest/AacDecBenchmark/AacDecBenchmark /data/local/tmp/
53```
54
55To get the resource files for the test follow instructions given in [Resources](#Resources)
56
57After running the above steps, /sdcard/test should contain AacDecBenchmark-1.0 folder and /data/local/tmp should contain benchmark binary to be executed.
58
59Run the following commands to see the benchmark results
60```
61adb shell
62cd /data/local/tmp/
63chmod a+x AacDecBenchmark
64./AacDecBenchmark
65```
66
67Run the below commands to generate a csv report and see the benchmark results
68```
69adb shell
70cd /data/local/tmp/
71chmod a+x AacDecBenchmark
72./AacDecBenchmark --benchmark_out=output.csv
73```
74
75if the folder path where the resource files are pushed is different from /sdcard/test/ , pass the actual folder path as an argument as shown below and run the following commands to see the benchmark results. Here let's say the path be /sdcard/test/AacDecBenchmark-1.0
76```
77adb shell
78cd /data/local/tmp/
79chmod a+x AacDecBenchmark
80./AacDecBenchmark --path=/sdcard/test/AacDecBenchmark-1.0
81```
82
83Run the below commands to store the benchmark results in an output.csv file which will be generated in the same path on the device.
84
85You can modify the output csv filename to any name and can be generated in any given absolute path.
86```
87adb shell
88cd /data/local/tmp/
89chmod a+x AacDecBenchmark
90./AacDecBenchmark --path=/sdcard/test/AacDecBenchmark-1.0 --benchmark_out=output.csv
91```
92
93# Analysis
94
95The benchmark results are stored in a CSV file if opted, which can be used for analysis.
96
97Note: This timestamp is in nano seconds and will change based on current system time.
98
99This csv file can be pulled from the device using "adb pull" command.
100```
101adb pull /data/local/tmp/output.csv ./output.csv
102```
103
104## CSV Columns
105
106Following columns are available in CSV.
107
108Note: All time values are in nano seconds
109
1101. **fileName**: The file being used as an input for the benchmark test.
111
1122. **Channels**: Number of channels does the input audio bitstream contain.
113
1143. **SampleRate**: SampleRate of the input audio bitstream.
115
1164. **FrameSize**: FrameSize of the input audio bitstream.
117
1185. **real_time**: Measures total elapsed time  from start to end of process, including wait times and delays.
119
1206. **cpu_time**: Measures total time spent by cpu actively executing instructions for a process.
121