/
video_encode_accel_perf.go
130 lines (124 loc) · 4.64 KB
/
video_encode_accel_perf.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
// Copyright 2019 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package arc
import (
"context"
"time"
"chromiumos/tast/common/media/caps"
"chromiumos/tast/local/arc"
"chromiumos/tast/local/bundles/cros/arc/c2e2etest"
"chromiumos/tast/local/bundles/cros/arc/video"
"chromiumos/tast/local/media/videotype"
"chromiumos/tast/testing"
"chromiumos/tast/testing/hwdep"
)
// Enable to cache the extracted raw video to speed up the test.
const veapCacheExtractedVideo = false
func init() {
testing.AddTest(&testing.Test{
Func: VideoEncodeAccelPerf,
LacrosStatus: testing.LacrosVariantUnknown,
Desc: "Measures ARC++ and ARCVM hardware video encode performance by running the arcvideoencoder_test binary",
Contacts: []string{"dstaessens@chromium.org", "chromeos-video-eng@google.com"},
Data: []string{c2e2etest.X86ApkName, c2e2etest.ArmApkName},
SoftwareDeps: []string{"chrome"},
Fixture: "arcBooted", // TODO(akahuang): Implement new precondition to boot ARC and enable verbose at chromium.
Timeout: 12 * time.Minute,
Params: []testing.Param{{
Name: "h264_1080p_i420",
Val: video.EncodeTestOptions{
Profile: videotype.H264MainProf,
Params: video.Crowd1080P,
PixelFormat: videotype.I420,
},
ExtraAttr: []string{"group:crosbolt", "crosbolt_perbuild"},
ExtraData: []string{video.Crowd1080P.Name},
ExtraSoftwareDeps: []string{"android_p", caps.HWEncodeH264},
}, {
Name: "h264_1080p_i420_sw",
Val: video.EncodeTestOptions{
Profile: videotype.H264MainProf,
Params: video.Crowd1080P,
PixelFormat: videotype.I420,
EncoderType: video.SoftwareEncoder,
},
ExtraData: []string{video.Crowd1080P.Name},
ExtraSoftwareDeps: []string{"android_p", caps.HWEncodeH264},
}, {
Name: "h264_1080p_i420_vm",
Val: video.EncodeTestOptions{
Profile: videotype.H264MainProf,
Params: video.Crowd1080P,
PixelFormat: videotype.I420,
},
ExtraAttr: []string{"group:crosbolt", "crosbolt_perbuild"},
ExtraData: []string{video.Crowd1080P.Name},
ExtraSoftwareDeps: []string{"android_vm", caps.HWEncodeH264},
ExtraHardwareDeps: hwdep.D(hwdep.SkipOnPlatform(video.EncoderBlocklistVM...)),
}, {
Name: "h264_1080p_i420_sw_vm",
Val: video.EncodeTestOptions{
Profile: videotype.H264MainProf,
Params: video.Crowd1080P,
PixelFormat: videotype.I420,
EncoderType: video.SoftwareEncoder,
},
ExtraData: []string{video.Crowd1080P.Name},
ExtraSoftwareDeps: []string{"android_vm"},
}, {
Name: "vp8_1080p_i420_vm",
Val: video.EncodeTestOptions{
Profile: videotype.VP8Prof,
Params: video.Crowd1080P,
PixelFormat: videotype.I420,
},
ExtraAttr: []string{"group:crosbolt", "crosbolt_perbuild"},
ExtraData: []string{video.Crowd1080P.Name},
ExtraSoftwareDeps: []string{"android_vm", caps.HWEncodeVP8},
ExtraHardwareDeps: hwdep.D(
hwdep.SkipOnPlatform(video.EncoderBlocklistVM...),
hwdep.Platform(video.EncoderAllowlistVPxVM...)),
}, {
Name: "vp8_1080p_i420_sw_vm",
Val: video.EncodeTestOptions{
Profile: videotype.VP8Prof,
Params: video.Crowd1080P,
PixelFormat: videotype.I420,
EncoderType: video.SoftwareEncoder,
},
ExtraData: []string{video.Crowd1080P.Name},
ExtraSoftwareDeps: []string{"android_vm"},
}, {
Name: "vp9_1080p_i420_vm",
Val: video.EncodeTestOptions{
Profile: videotype.VP9Prof,
Params: video.Crowd1080P,
PixelFormat: videotype.I420,
},
ExtraAttr: []string{"group:crosbolt", "crosbolt_perbuild"},
ExtraData: []string{video.Crowd1080P.Name},
ExtraSoftwareDeps: []string{"android_vm", caps.HWEncodeVP9},
ExtraHardwareDeps: hwdep.D(
hwdep.SkipOnPlatform(video.EncoderBlocklistVM...),
hwdep.Platform(video.EncoderAllowlistVPxVM...)),
}, {
Name: "vp9_1080p_i420_sw_vm",
Val: video.EncodeTestOptions{
Profile: videotype.VP9Prof,
Params: video.Crowd1080P,
PixelFormat: videotype.I420,
EncoderType: video.SoftwareEncoder,
},
ExtraData: []string{video.Crowd1080P.Name},
ExtraSoftwareDeps: []string{"android_vm", caps.HWEncodeVP9},
ExtraHardwareDeps: hwdep.D(
hwdep.SkipOnPlatform(video.EncoderBlocklistVM...),
hwdep.Platform(video.EncoderAllowlistVPxVM...)),
}},
})
}
func VideoEncodeAccelPerf(ctx context.Context, s *testing.State) {
video.RunARCPerfVideoTest(ctx, s, s.FixtValue().(*arc.PreData).ARC,
s.Param().(video.EncodeTestOptions), veapCacheExtractedVideo)
}