encodetest

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: Apache-2.0 Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Rendered for windows/amd64

Overview

Package encodetest runs hardware encoders on synthetic GPU frames for the encode, decode and player tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Device

func Device(t testing.TB, match string) *dxgi.Device

Device opens a D3D11 device on the first adapter whose name contains match, or skips the test when there is none.

func Frames

func Frames(t testing.TB, d *dxgi.Device, f capture.Format, w, h, n int) []capture.Frame

Frames uploads n distinct synthetic frames to d as textures that live until the test ends.

func GPU

func GPU(d *dxgi.Device) gpu.Device

GPU is d as a gpu.Device.

Types

type Result

type Result struct {
	Latency   bench.Summary // ms from Encode's call to its return
	Kbps      float64       // output bit rate over the measured frames
	Keyframes int
	// AllocsPerFrame is Go heap allocations per measured frame, process wide.
	AllocsPerFrame float64
	Packets        [][]byte // every packet, warm-up included, when Keep is set
}

Result summarizes an encode run.

type Run

type Run struct {
	Frames int  // measured frames, after a 30-frame warm-up
	Paced  bool // submit at cfg.FPS instead of back to back
	FPS    int
	// ForceKey lists frame indexes (warm-up included) to force as keyframes;
	// frame 0 always is.
	ForceKey map[int]bool
	Keep     bool
	// Each, when set, runs after each frame with its index and packet.
	Each func(i int, pkt encode.Packet)
}

Run options.

func (Run) Encode

func (r Run) Encode(t testing.TB, enc encode.Encoder, frames []capture.Frame) Result

Encode feeds frames round robin to enc and measures each call.

Jump to

Keyboard shortcuts

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