Documentation ¶
Overview ¶
Package encode provides common code to run Chrome binary tests for video encoding.
Index ¶
- func RunAccelVideoPerfTest(ctxForDefer context.Context, s *testing.State, opts TestOptions) error
- func RunAccelVideoTest(ctxForDefer context.Context, s *testing.State, opts TestOptions)
- func TestData(webmFileName string) []string
- func YUVJSONFileNameFor(webMFileName string) string
- type TestOptions
- func MakeBitrateTestOptions(webMName string, profile videotype.CodecProfile, bitrate int) TestOptions
- func MakeTestOptions(webMName string, profile videotype.CodecProfile) TestOptions
- func MakeTestOptionsWithNoGlobalVaapiLock(webMName string, profile videotype.CodecProfile) TestOptions
- func MakeTestOptionsWithSVCLayers(webMName string, profile videotype.CodecProfile, svc string) TestOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunAccelVideoPerfTest ¶
RunAccelVideoPerfTest runs video_encode_accelerator_perf_tests with the specified video file. - Uncapped performance: the specified test video is encoded for 300 frames by the hardware encoder as fast as possible. This provides an estimate of the decoder's max performance (e.g. the maximum FPS). - Capped performance: the specified test video is encoded for 300 frames by the hardware encoder at 30fps. This is used to measure cpu usage and power consumption in the practical case. - Quality performance: the specified test video is encoded for 300 frames and computes the SSIM and PSNR metrics of the encoded stream. - Multiple concurrent performance: the specified test video is encoded with multiple concurrent encoders as fast as possible.
func RunAccelVideoTest ¶
func RunAccelVideoTest(ctxForDefer context.Context, s *testing.State, opts TestOptions)
RunAccelVideoTest runs all tests in video_encode_accelerator_tests.
func TestData ¶
TestData returns the files used in video.EncodeAccel(Perf), the webm file and the json file returned by encode.YUVJSONFileNameFor().
func YUVJSONFileNameFor ¶
YUVJSONFileNameFor returns the json file name used in video.EncodeAccel with |webmMFileName|. For example, if |webMFileName| is bear-320x192.vp9.webm, then bear-320x192.yuv.json is returned.
Types ¶
type TestOptions ¶
type TestOptions struct {
// contains filtered or unexported fields
}
TestOptions is the options for runAccelVideoTest.
func MakeBitrateTestOptions ¶
func MakeBitrateTestOptions(webMName string, profile videotype.CodecProfile, bitrate int) TestOptions
MakeBitrateTestOptions creates TestOptions from webMName and codec. spatialLayers and temporalLayers are set to 1. Sets bitrate for testing quality changes.
func MakeTestOptions ¶
func MakeTestOptions(webMName string, profile videotype.CodecProfile) TestOptions
MakeTestOptions creates TestOptions from webMName and profile. spatialLayers and temporalLayers are set to 1.
func MakeTestOptionsWithNoGlobalVaapiLock ¶
func MakeTestOptionsWithNoGlobalVaapiLock(webMName string, profile videotype.CodecProfile) TestOptions
MakeTestOptionsWithNoGlobalVaapiLock creates TestOptions from webMName and profile. spatialLayers and temporalLayers are set to 1. Always disables the global VAAPI lock.
func MakeTestOptionsWithSVCLayers ¶
func MakeTestOptionsWithSVCLayers(webMName string, profile videotype.CodecProfile, svc string) TestOptions
MakeTestOptionsWithSVCLayers creates TestOptions from webMName, profile, svc. svc is the string defined in https://w3c.github.io/webrtc-svc/#scalabilitymodes.