Documentation ¶
Overview ¶
Package video provides common code to run ARC binary tests for video encoding.
Package video provides common code for arc.VideoDecodeAccel* tests.
Package video provides common code to run ARC binary tests for video encoding.
Index ¶
- Constants
- Variables
- func RunARCPerfVideoTest(ctx context.Context, s *testing.State, a *arc.ARC, opts EncodeTestOptions, ...)
- func RunARCVideoPerfTest(ctx context.Context, s *testing.State, opts DecodeTestOptions)
- func RunARCVideoTest(ctx context.Context, s *testing.State, a *arc.ARC, opts EncodeTestOptions, ...)
- func RunAllARCVideoTests(ctx context.Context, s *testing.State, opts DecodeTestOptions)
- type DecodeTestOptions
- type DecoderType
- type EncodeTestOptions
- type EncoderType
Constants ¶
const ( // PerfTestRuntime is the runtime for a single performance test case // * 2 because two sets of perf measurements are gathered per test (rendering, no rendering) PerfTestRuntime = (perfMeasurementDuration * 2) + perfTestSlack )
Variables ¶
var Bear192P = encoding.StreamParams{ Name: "bear-320x192.vp9.webm", Size: coords.NewSize(320, 192), Bitrate: 200000, }
Bear192P is the test parameters of video_encode_accelerator_unittest for "bear_320x192_40frames.yuv".
var Crowd1080P = encoding.StreamParams{ Name: "crowd-1920x1080.vp9.webm", Size: coords.NewSize(1920, 1080), Bitrate: 4000000, }
Crowd1080P is the test parameters of video_encode_accelerator_unittest for the raw data obtained by decoding "crowd1920x1080.webm".
var EncoderAllowlistVPxVM = []string{
"hatch",
}
EncoderAllowlistVPxVM is the list of devices on which the ARCVM VP8/9 HW encoder is enabled. TODO(b/155138243): Remove allowlist once VP8/9 HW encoding is enabled on all devices. Note: Combining this allowlist with the above blocklist works fine, entries in this list won't
override entries in the blocklist.
var EncoderBlocklistVM = []string{
"grunt-arc-r",
}
EncoderBlocklistVM is the list of devices on which the ARCVM HW encoder is not enabled. TODO(b/155138175): Remove devices from this list once the ARCVM HW encoder is enabled.
var Tulip360P = encoding.StreamParams{ Name: "tulip2-640x360.vp9.webm", Size: coords.NewSize(640, 360), Bitrate: 500000, }
Tulip360P is the test parameters of video_encode_accelerator_unittest for the raw data obtained by decoding "tulip2-640x360.webm".
var Tulip720P = encoding.StreamParams{ Name: "tulip2-1280x720.vp9.webm", Size: coords.NewSize(1280, 720), Bitrate: 1200000, }
Tulip720P is the test parameters of video_encode_accelerator_unittest for the raw data obtained by decoding "tulip2-1280x720.webm".
Functions ¶
func RunARCPerfVideoTest ¶
func RunARCPerfVideoTest(ctx context.Context, s *testing.State, a *arc.ARC, opts EncodeTestOptions, cacheExtractedVideo bool)
RunARCPerfVideoTest runs all perf tests of arcvideoencoder_test in ARC.
func RunARCVideoPerfTest ¶
func RunARCVideoPerfTest(ctx context.Context, s *testing.State, opts DecodeTestOptions)
RunARCVideoPerfTest runs testFPS in c2_e2e_test and sets as perf metric.
func RunARCVideoTest ¶
func RunARCVideoTest(ctx context.Context, s *testing.State, a *arc.ARC, opts EncodeTestOptions, pullEncodedVideo, cacheExtractedVideo bool)
RunARCVideoTest runs all non-perf tests of arcvideoencoder_test in ARC.
func RunAllARCVideoTests ¶
func RunAllARCVideoTests(ctx context.Context, s *testing.State, opts DecodeTestOptions)
RunAllARCVideoTests runs all tests in c2_e2e_test.
Types ¶
type DecodeTestOptions ¶
type DecodeTestOptions struct { // TestVideo stores the test video's name. TestVideo string // DecoderType indicates whether a HW or SW decoder will be used. DecoderType DecoderType BatteryDischargeMode setup.BatteryDischargeMode }
DecodeTestOptions contains all options for the video decoder test.
type DecoderType ¶
type DecoderType int
DecoderType represents the type of video decoder that can be used.
const ( // HardwareDecoder is the decoder type that uses hardware decoding. HardwareDecoder DecoderType = iota // SoftwareDecoder is the decoder type that uses software decoding. SoftwareDecoder )
type EncodeTestOptions ¶
type EncodeTestOptions struct { // Profile specifies the codec profile to use when encoding. Profile videotype.CodecProfile // Params contains the test parameters for the e2e video encode test. Params encoding.StreamParams // PixelFormat is the format of the raw input video data. PixelFormat videotype.PixelFormat // EncoderType indicates whether a HW or SW encoder will be used. EncoderType EncoderType // BatteryDischargeMode specifies battery usage during a test. BatteryDischargeMode setup.BatteryDischargeMode }
EncodeTestOptions contains all options for the video encoder test.
type EncoderType ¶
type EncoderType int
EncoderType represents the type of video encoder that can be used.
const ( // HardwareEncoder is the encoder type that uses hardware encoding. HardwareEncoder EncoderType = iota // SoftwareEncoder is the encoder type that uses software encoding. SoftwareEncoder )