decoding

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: 17 Imported by: 0

Documentation

Overview

Package decoding contains common code to interact with the video decode accelerator test binary.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunAccelVideoPerfTest

func RunAccelVideoPerfTest(ctx context.Context, outDir, filename string, parameters TestParams) error

RunAccelVideoPerfTest runs video_decode_accelerator_perf_tests with the specified video file. TestParams specifies:

  1. Whether to run the tests against the VDA or VD based video decoder implementations.
  2. If the output of the decoder is a linear buffer (this is false by default).
  3. If the global VA-API lock should be disabled.

Both capped and uncapped performance is measured. - Uncapped performance: the specified test video is decoded from start to finish as fast as possible. This provides an estimate of the decoder's max performance (e.g. the maximum FPS). - Capped decoder performance: uses a more realistic environment by decoding the test video from start to finish at its actual frame rate. Rendering is simulated and late frames are dropped. The test binary is run twice. Once to measure both capped and uncapped performance, once to measure CPU usage and power consumption while running the capped performance test. Multiple concurrent performance: the specified test video is decoded with multiple concurrent decoders as fast as possible.

func RunAccelVideoTest

func RunAccelVideoTest(ctx context.Context, outDir, filename string, parameters TestParams) error

RunAccelVideoTest runs video_decode_accelerator_tests with the specified video file. TestParams specifies:

  1. Whether to run the tests against the VDA or VD based video decoder implementations.
  2. If the output of the decoder is a linear buffer (this is false by default).
  3. If the global VA-API lock should be disabled.

func RunAccelVideoTestWithTestVectors

func RunAccelVideoTestWithTestVectors(ctx context.Context, outDir string, testVectors []string, validatorType ValidatorType) error

RunAccelVideoTestWithTestVectors runs video_decode_accelerator_tests --gtest_filter=VideoDecoderTest.FlushAtEndOfStream --validator_type=validatorType with the specified video files using the direct VideoDecoder.

Types

type DecoderType

type DecoderType int

DecoderType represents the different video decoder types.

const (
	// VDA is the video decoder type based on the VideoDecodeAccelerator
	// interface. These are set to be deprecrated.
	VDA DecoderType = iota
	// VD is the video decoder type based on the VideoDecoder interface. These
	// will replace the current VDAs.
	VD
	// VDVDA refers to an adapter between the arc.mojom VideoDecodeAccelerator
	// and the VideoDecoder-based video decode accelerator. This entry is used
	// to test interaction with older interface that expected the VDA interface.
	VDVDA
)

type TestParams

type TestParams struct {
	DecoderType            DecoderType
	LinearOutput           bool
	DisableGlobalVaapiLock bool
}

TestParams allows adjusting some of the test arguments passed in.

type ValidatorType

type ValidatorType int

ValidatorType represents the validator types used in video_decode_accelerator_tests.

const (
	// MD5 is to validate the correctness of decoded frames by comparing with
	// md5hash of expected frames.
	MD5 ValidatorType = iota
	// SSIM is to validate the correctness of decoded frames by computing SSIM
	// values with expected frames.
	SSIM
)

Jump to

Keyboard shortcuts

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