video

package
v0.0.0-...-683b059 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2022 License: BSD-3-Clause Imports: 25 Imported by: 0

README

Video Test Overview

The Tast video tests can be used to validate various ARC video decoder and encoder implementations. A wide range of test scenarios are available to validate both correctness and performance.

To get a list of all available ARC video tests run:

tast list $HOST | grep arc.Video

[TOC]

ARC video decoder tests

These tests validate Android video decoding functionality by running the [c2_e2e_test]. This test is implemented on top of the Android [MediaCodec] interface. The test decodes a video from start to finish and validates decoded frames by comparing their checksums against expected values.

Tests are available for the H.264, VP8 and VP9 codecs. To run all tests use:

tast run $HOST arc.VideoDecodeAccel.*

ARC video decoder performance tests

These tests measure Android video decoder performance by running the above [c2_e2e_test]. Currently the performance tests measures the decoder's maximum FPS by decoding a video as fast as possible, and it measures cpu, power usage, and dropped frames while decoding and rendering a video at the appropriate FPS.

Performance tests are available for the H.264, VP8 and VP9 codecs, using 1080p and 2160p videos, both in 30 and 60fps variants. To run all performance tests use:

tast run $HOST arc.VideoDecodeAccelPerf.*

ARC video encoder tests

These tests validate Android video encoding functionality by running the [c2_e2e_test]. This test is implemented on top of the Android [MediaCodec] interface and encodes a raw video stream to verify encoding functionality.

Currently a test is only available for the H.264 codec. To run the test use:

tast run $HOST arc.VideoEncodeAccel.*

ARC video encoder performance tests

These tests measure Android video encoder performance by running the above [c2_e2e_test]. This test measures the encoder's FPS, bitrate and latency.

Currently a performance test is only available for the H.264 codec with a 1080p video stream. To run the test use:

tast run $HOST arc.VideoEncodeAccelPerf.*

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

View Source
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

View Source
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".

View Source
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".

View Source
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.
View Source
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.

View Source
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".

View Source
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
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL