• Home
Name Date Size #Lines LOC

..--

MediaBenchmarkTest/03-May-2024-2,9692,238

src/native/03-May-2024-2,8682,033

tests/03-May-2024-1,214867

.clang-formatD03-May-2024292 1413

Android.bpD03-May-2024685 2220

README.mdD03-May-20244.9 KiB157101

README.md

1# Benchmark tests
2
3Benchmark app analyses the time taken by MediaCodec, MediaExtractor and MediaMuxer for given set of inputs. It is used to benchmark these modules on android devices.
4Benchmark results are emitted to logcat.
5
6This page describes steps to run the NDK and SDK layer test.
7
8Run the following steps to build the test suite:
9```
10mmm frameworks/av/media/tests/benchmark/
11```
12
13# NDK
14
15To run the test suite for measuring performance of the native layer, follow the following steps:
16
17The binaries will be created in the following path : $OUT/data/nativetest64/
18
19adb push $OUT/data/nativetest64/* /data/local/tmp/
20
21Eg. adb push $OUT/data/nativetest64/extractorTest/extractorTest /data/local/tmp/
22
23To run the binary, follow the commands mentioned below under each module.
24
25The resource file for the tests is taken from [here](https://drive.google.com/open?id=1ghMr17BBJ7n0pqbm7oREiTN_MNemJUqy)
26
27Download the MediaBenchmark.zip file, unzip and push it to /data/local/tmp/ on the device.
28
29```
30unzip MediaBenchmark.zip
31adb push MediaBenchmark /data/local/tmp
32```
33
34## Extractor
35
36The test extracts elementary stream and benchmarks the extractors available in NDK.
37
38The resource files are assumed to be at /data/local/tmp/MediaBenchmark/res/. You can use a different location, but you have to modify the rest of the instructions to replace /data/local/tmp/MediaBenchmark/res/ with wherever you chose to put the files.
39
40The path to these files on the device is required to be given for the test.
41
42```
43adb shell /data/local/tmp/extractorTest -P /data/local/tmp/MediaBenchmark/res/
44```
45
46## Decoder
47
48The test decodes input stream and benchmarks the decoders available in NDK.
49
50Setup steps are same as extractor.
51
52```
53adb shell /data/local/tmp/decoderTest -P /data/local/tmp/MediaBenchmark/res/
54```
55
56## Muxer
57
58The test muxes elementary stream and benchmarks the muxers available in NDK.
59
60Setup steps are same as extractor.
61
62```
63adb shell /data/local/tmp/muxerTest -P /data/local/tmp/MediaBenchmark/res/
64```
65
66## Encoder
67
68The test encodes input stream and benchmarks the encoders available in NDK.
69
70Setup steps are same as extractor.
71
72```
73adb shell /data/local/tmp/encoderTest -P /data/local/tmp/MediaBenchmark/res/
74```
75
76# SDK
77
78To run the test suite for measuring performance of the SDK APIs, follow the following steps:
79
80The apk will be created at the following path:
81$OUT/testcases/MediaBenchmarkTest/arm64/
82
83To get the resorce files for the test follow instructions given in [NDK](#NDK)
84
85For installing the apk, run the command:
86```
87adb install -f -r $OUT/testcases/MediaBenchmarkTest/arm64/MediaBenchmarkTest.apk
88```
89
90For running all the tests, run the command:
91```
92adb shell am instrument -w -r -e package com.android.media.benchmark.tests com.android.media.benchmark/androidx.test.runner.AndroidJUnitRunner
93```
94
95## Extractor
96
97The test extracts elementary stream and benchmarks the extractors available in SDK.
98```
99adb shell am instrument -w -r -e class 'com.android.media.benchmark.tests.ExtractorTest' com.android.media.benchmark/androidx.test.runner.AndroidJUnitRunner
100```
101
102## Decoder
103
104The test decodes input stream and benchmarks the decoders available in SDK.
105```
106adb shell am instrument -w -r -e class 'com.android.media.benchmark.tests.DecoderTest' com.android.media.benchmark/androidx.test.runner.AndroidJUnitRunner
107```
108
109## Muxer
110
111The test muxes elementary stream and benchmarks different writers available in SDK.
112```
113adb shell am instrument -w -r -e class 'com.android.media.benchmark.tests.MuxerTest' com.android.media.benchmark/androidx.test.runner.AndroidJUnitRunner
114```
115
116## Encoder
117
118The test encodes input stream and benchmarks the encoders available in SDK.
119```
120adb shell am instrument -w -r -e class 'com.android.media.benchmark.tests.EncoderTest' com.android.media.benchmark/androidx.test.runner.AndroidJUnitRunner
121```
122
123# Codec2
124To run the test suite for measuring performance of the codec2 layer, follow the following steps:
125
126The 32-bit binaries will be created in the following path : ${OUT}/data/nativetest/
127The 64-bit binaries will be created in the following path : ${OUT}/data/nativetest64/
128
129To test 64-bit binary push binaries from nativetest64.
130adb push $(OUT)/data/nativetest64/* /data/local/tmp/
131Eg. adb push $(OUT)/data/nativetest64/C2DecoderTest/C2DecoderTest /data/local/tmp/
132
133To test 32-bit binary push binaries from nativetest.
134adb push $(OUT)/data/nativetest/* /data/local/tmp/
135Eg. adb push $(OUT)/data/nativetest/C2DecoderTest/C2DecoderTest /data/local/tmp/
136
137To get the resource files for the test follow instructions given in [NDK](#NDK)
138
139## C2 Decoder
140
141The test decodes input stream and benchmarks the codec2 decoders available in device.
142
143Setup steps are same as [extractor](#extractor).
144
145```
146adb shell /data/local/tmp/C2DecoderTest -P /data/local/tmp/MediaBenchmark/res/
147```
148## C2 Encoder
149
150The test encodes input stream and benchmarks the codec2 encoders available in device.
151
152Setup steps are same as [extractor](#extractor).
153
154```
155adb shell /data/local/tmp/C2EncoderTest -P /data/local/tmp/MediaBenchmark/res/
156```
157