govpx

package module
v0.0.0-...-e048aad Latest Latest
Warning

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

Go to latest
Published: May 12, 2026 License: BSD-3-Clause Imports: 14 Imported by: 0

README

govpx

CI Go Reference

Pure-Go VP8 encoder and decoder for raw VP8 frame payloads.

govpx is for Go programs that need VP8 without cgo and without a libvpx runtime dependency. It is intentionally VP8-only: no VP9, no AV1, no WebM muxer, no RTP packetizer, no libvpx C API compatibility layer. Transport framing is the caller's responsibility.

Behavior is validated against a pinned libvpx v1.16.0 oracle. The public API uses Go types and methods; libvpx names appear only when they identify upstream behavior, controls, or validation tooling.

Install

Go 1.26 or newer is required. The module pins the default toolchain to Go 1.26.3 so local go commands use the same patch level as CI.

go get github.com/thesyncim/govpx

Build with -tags purego for a scalar build. The tag excludes govpx's architecture-specific assembly and selects the Go fallbacks under internal/vp8/dsp and internal/vp8/encoder.

Decode

dec, err := govpx.NewVP8Decoder(govpx.DecoderOptions{})
if err != nil {
    return err
}
defer dec.Close()

if err := dec.Decode(packet); err != nil {
    return err
}
if frame, ok := dec.NextFrame(); ok {
    _ = frame // I420; planes alias decoder-owned storage until the next call.
}

NextFrame returns decoder-owned storage that stays valid until the next Decode, Reset, or Close. Use DecodeInto / DecodeIntoWithPTS when the caller owns the destination buffers.

Decoder features: configurable threading, error concealment, granular postprocess (deblock, demacroblock, MFQE, additive noise), maximum dimensions, resolution-change rejection, frame metadata, and LAST / GOLDEN / ALTREF reference-buffer set/copy.

Encode

enc, err := govpx.NewVP8Encoder(govpx.EncoderOptions{
    Width:             640,
    Height:            480,
    FPS:               30,
    RateControlMode:   govpx.RateControlCBR,
    TargetBitrateKbps: 1500,
    Deadline:          govpx.DeadlineRealtime,
})
if err != nil {
    return err
}
defer enc.Close()

packet := make([]byte, 256*1024)
for i, src := range frames {
    res, err := enc.EncodeInto(packet, src, uint64(i), 1, 0)
    if err != nil {
        return err
    }
    if res.Dropped {
        continue
    }
    writePacket(res.Data) // res.Data aliases packet; copy if it must outlive packet.
}

Input images are planar 8-bit 4:2:0 (Image{Y,U,V,*Stride}). Output is one raw VP8 payload per packet — not IVF, not WebM.

Capability Knobs
Rate control RateControlMode (VBR / CBR / CQ / Q), one-pass + two-pass VBR, runtime bitrate and target updates, frame dropping, buffer model, min/max quantizers, max intra bitrate
Realtime / WebRTC Error resilience, temporal scalability, keyframe forcing, runtime CPU-used / deadline, VP8 RTC external rate control, reference set/copy
Quality and tools Adaptive keyframes, lookahead, auto alt-ref, ARNR, denoise, token partitions, loop-filter sharpness, screen-content mode, static threshold, active maps, ROI maps, PSNR/SSIM tuning, multi-threaded row encode

Lookahead and auto-alt-ref can make EncodeInto return ErrFrameNotReady while frames are queued. Call FlushInto at end of stream until it returns no more data.

API Map

Task API
Decode one packet Decode, then NextFrame
Decode into caller-owned buffers DecodeInto, DecodeIntoWithPTS
Inspect a packet header PeekVP8StreamInfo
Encode one frame EncodeInto
Drain delayed encoder output FlushInto
Force a keyframe ForceKeyFrame (sticky) or the EncodeForceKeyFrame flag (one frame)
Runtime bitrate/FPS update SetRealtimeTarget
Toggle frame dropping only SetFrameDropAllowed or RealtimeTarget.FrameDrop
Runtime rate-control replacement SetRateControl
Two-pass encode CollectFirstPassStats, govpx.FinalizeFirstPassStats, SetTwoPassStats
Reference buffer control SetReferenceFrame, CopyReferenceFrame
Last decoded/encoded metadata LastFrameInfo, LastQuantizer, EncodeResult

WebRTC profile

For WebRTC senders, start with realtime CBR, error resilience, frame dropping, and RTC external rate control:

enc, err := govpx.NewVP8Encoder(govpx.EncoderOptions{
    Width:                  1280,
    Height:                 720,
    FPS:                    30,
    RateControlMode:        govpx.RateControlCBR,
    TargetBitrateKbps:      2500,
    MinQuantizer:           4,
    MaxQuantizer:           56,
    BufferSizeMs:           600,
    BufferInitialSizeMs:    400,
    BufferOptimalSizeMs:    500,
    DropFrameAllowed:       true,
    DropFrameWaterMark:     60,
    Deadline:               govpx.DeadlineRealtime,
    ErrorResilient:         true,
    RTCExternalRateControl: true,
})
  • Use ForceKeyFrame() or the EncodeForceKeyFrame flag on the next EncodeInto for PLI/FIR.
  • Use SetRealtimeTarget for bandwidth-estimation updates. The zero value of RealtimeTarget.FrameDrop leaves frame dropping unchanged, so bitrate-only BWE updates do not accidentally disable dropping.
  • Drive caller-driven runtime resolution change through SetRealtimeTarget by setting a new Width / Height pair: size-dependent buffers are resized in place (capacity is reused), the LAST / GOLDEN / ALTREF references are invalidated, and the next encoded frame is forced to be a key frame at the new size. Mirrors libvpx's vpx_codec_enc_config_set with a new width / height. The spatial resampler (VP8E_SET_SCALEMODE, rc_resize_*) is out of scope. The decoder also handles key-frame resolution change; see DecoderOptions.RejectResolutionChange.

See examples/webrtc-vp8 for a separate-module demo that streams govpx VP8 through pion/webrtc to a browser.

Validation

Fast local checks:

make ci                          # fmt + tests + purego tests
go test ./... -count=1
go test -tags purego ./... -count=1
go vet ./...

Parity gates:

make verify-decoder-parity   # cheaper: decoder-only oracle proof
make verify-production       # full encoder + decoder oracle gate

verify-production builds the pinned libvpx tools under internal/coracle/build, fetches VP8 conformance data, and runs decoder plus encoder oracle tests. Encoder parity compares libvpx-decoded frame checksums, key/show decisions, internal qindex, and packet-size ratchets for the covered realtime/WebRTC settings. Use make verify-decoder-parity when only decoder changes need re-checking.

Oracle trace and scoreboard code lives behind the govpx_oracle_trace build tag or in *_test.go files, so it is not linked into normal production builds. UPSTREAM.md documents the parity scope and known deviations in detail.

Benchmarking

go run ./cmd/govpx-bench
go run ./cmd/govpx-bench -decode -frames=120
go run ./cmd/govpx-bench -format=json

By default the encode benchmark compares against libvpx when cmd/govpx-bench can find internal/coracle/build/vpxenc or vpxenc on PATH. Pass -libvpx-vpxenc=/path/to/vpxenc to pin a binary or -auto-libvpx=false for a govpx-only run. Use -build-libvpx=true to let the bench build the pinned tools when no binary is found. Decoder reference timing uses govpx-vpx-oracle only in -decode mode.

Plotting is optional and requires an ffmpeg binary with both the libvpx encoder and the libvmaf filter:

go run ./cmd/govpx-bench \
    -plot benchmarks/govpx-vs-libvpx.svg \
    -width=1280 -height=720 -frames=120 -fps=30 \
    -bitrate=2500 -mode=realtime -threads=1

The plot path encodes the libvpx reference with ffmpeg -c:v libvpx, scores govpx and libvpx with ffmpeg's libvmaf, psnr, and ssim filters, and writes an SVG plus sibling CSV/JSON files.

README numbers are not performance data. Measure on the Go version, CPU, frame size, bitrate, deadline, thread count, and build tags that match your workload.

cmd/govpx-bench/default.pgo is checked in intentionally so go build's default -pgo=auto picks it up for the benchmark command. Refresh it after material hot-path changes:

make pgo-refresh

Repository layout

.                         public govpx package
internal/vp8/common       VP8 shared state, headers, loop filter, quant tables
internal/vp8/decoder      decoder internals
internal/vp8/encoder      packet, token, transform, quant, motion helpers
internal/vp8/dsp          scalar and architecture-specific pixel kernels
internal/coracle          pinned libvpx oracle build and comparison helpers
cmd/govpx-bench           encode/decode benchmark CLI
cmd/govpx-oracle          oracle wrapper command
cmd/scoreboard-report     oracle scoreboard runner
examples/webrtc-vp8       separate-module WebRTC example
testdata                  oracle scoreboard baselines

Contributing

  • Keep hot paths allocation-aware. Steady-state EncodeInto and Decode reuse caller- and codec-owned buffers; the test suite enforces this.
  • Keep oracle diagnostics out of normal builds. Trace hooks are either build-tagged (govpx_oracle_trace) or test-only, and optional measurements live behind explicit caller-owned state.
  • Run make ci before opening a PR. Run make verify-production when a change touches parity-sensitive code or oracle baselines.

License

BSD-3-Clause. See LICENSE, NOTICE, LICENSE.libvpx, PATENTS.libvpx, and UPSTREAM.md.

Documentation

Overview

Package govpx is a pure-Go VP8 encoder and decoder.

The package is VP8-only by design. There is no VP9, no AV1, no WebM muxer, no RTP packetizer, and no libvpx C API compatibility layer. It produces and consumes raw VP8 frame payloads — one frame per packet — and leaves transport framing to the caller.

govpx targets two main consumers: low-latency realtime senders (WebRTC, SFU edges, screen capture) and offline encoders that want a pure-Go dependency. Behavior is validated against a pinned libvpx v1.16.0 oracle; see UpstreamLibvpxVersion.

Decoding

Construct a VP8Decoder once and feed it raw VP8 packets:

dec, err := govpx.NewVP8Decoder(govpx.DecoderOptions{})
if err != nil {
    return err
}
defer dec.Close()

if err := dec.Decode(packet); err != nil {
    return err
}
if frame, ok := dec.NextFrame(); ok {
    // frame is I420; planes alias decoder-owned storage until the next
    // Decode, Reset, or Close call.
    _ = frame
}

Use VP8Decoder.DecodeInto or VP8Decoder.DecodeIntoWithPTS when the caller owns the output buffers and wants them filled in place.

Encoding

Construct a VP8Encoder once and reuse a single output buffer across frames. EncodeResult.Data aliases the caller-provided destination buffer.

enc, err := govpx.NewVP8Encoder(govpx.EncoderOptions{
    Width:             1280,
    Height:            720,
    FPS:               30,
    RateControlMode:   govpx.RateControlCBR,
    TargetBitrateKbps: 2500,
    Deadline:          govpx.DeadlineRealtime,
})
if err != nil {
    return err
}
defer enc.Close()

packet := make([]byte, 256*1024)
res, err := enc.EncodeInto(packet, img, pts, duration, 0)
if err != nil {
    return err
}
if !res.Dropped {
    send(res.Data) // copy if res.Data must outlive packet.
}

Lookahead, auto-alt-ref, and two-pass encoders may withhold output and return ErrFrameNotReady; call VP8Encoder.FlushInto at end of stream to drain queued frames.

Errors and zero values

Sentinel errors live in this package: ErrInvalidData, ErrNeedKeyFrame, ErrFrameNotReady, ErrBufferTooSmall, ErrFrameRejected, ErrInvalidConfig, ErrInvalidBitrate, ErrInvalidQuantizer, and ErrClosed. Compare with errors.Is. ErrUnsupportedFeature is reserved for future use and is not currently returned by any path.

The zero value of EncoderOptions is not a valid configuration: Width, Height, FPS (or TimebaseNum/Den), and TargetBitrateKbps must be set. The zero value of DecoderOptions is valid and produces a single-threaded decoder with no postprocessing.

Build tags

  • The default build links the native architecture's pixel kernels.
  • The "purego" build tag forces scalar Go fallbacks across internal/vp8/dsp and internal/vp8/encoder.
  • The "govpx_oracle_trace" build tag links the encoder oracle trace hooks; normal builds leave them out.

See the repository README for build, benchmarking, and validation commands, the WebRTC demo under examples/webrtc-vp8, and UPSTREAM.md for libvpx parity scope.

Index

Examples

Constants

View Source
const (
	// Version is the package-level compatibility label for this govpx
	// build. It is intended for crash reports and bug templates, not for
	// programmatic feature gating.
	Version = "govpx-v0"
	// UpstreamLibvpxVersion is the libvpx release tag used for parity
	// porting and the oracle test corpus. Matches the tag pinned by
	// internal/coracle.
	UpstreamLibvpxVersion = "v1.16.0"
)
View Source
const (
	// MaxTemporalLayers is the largest VP8 temporal-layer count exposed by
	// govpx. It bounds [TemporalScalabilityConfig.LayerTargetBitrateKbps]
	// and the per-layer counters on [EncodeResult].
	MaxTemporalLayers = 5
)

Variables

View Source
var (
	// ErrInvalidData reports malformed or unsupported VP8 bitstream data.
	ErrInvalidData = errors.New("govpx: invalid VP8 data")
	// ErrUnsupportedFeature is reserved for future use to report a valid
	// VP8 feature that govpx does not implement. No public API path
	// currently returns it; it is retained as a stable sentinel so future
	// support can be added without breaking callers that compare with
	// errors.Is.
	ErrUnsupportedFeature = errors.New("govpx: unsupported VP8 feature")
	// ErrNeedKeyFrame reports an inter frame before reference state has been
	// initialized by a key frame.
	ErrNeedKeyFrame = errors.New("govpx: need VP8 keyframe")
	// ErrFrameNotReady reports that a lookahead encoder accepted input but has
	// not emitted an output packet yet.
	ErrFrameNotReady = errors.New("govpx: frame not ready")
	// ErrBufferTooSmall reports that the caller-provided encoded output buffer
	// cannot hold the next VP8 frame.
	ErrBufferTooSmall = errors.New("govpx: output buffer too small")
	// ErrFrameRejected reports a frame rejected by configured decoder limits.
	ErrFrameRejected = errors.New("govpx: VP8 frame rejected by decoder options")

	// ErrInvalidConfig reports an invalid option, runtime control, image shape,
	// or reference selector.
	ErrInvalidConfig = errors.New("govpx: invalid config")
	// ErrInvalidBitrate reports a bitrate or buffer-model value outside the
	// supported encoder range.
	ErrInvalidBitrate = errors.New("govpx: invalid bitrate")
	// ErrInvalidQuantizer reports a public quantizer outside [0, 63] or outside
	// the active min/max range.
	ErrInvalidQuantizer = errors.New("govpx: invalid quantizer")
	// ErrClosed reports use of a nil or closed encoder/decoder.
	ErrClosed = errors.New("govpx: codec is closed")
)

Functions

This section is empty.

Types

type Codec

type Codec int

Codec identifies a codec family supported by govpx. Reserved for future multi-codec selection; for now the package only implements VP8.

const (
	// CodecVP8 selects the VP8 bitstream format.
	CodecVP8 Codec = iota + 1
)

type Deadline

type Deadline int

Deadline selects the encoder speed/quality operating mode.

const (
	// DeadlineBestQuality favors quality and exhaustive decisions.
	DeadlineBestQuality Deadline = iota
	// DeadlineGoodQuality favors quality with bounded speed features.
	DeadlineGoodQuality
	// DeadlineRealtime favors low-latency realtime decisions.
	DeadlineRealtime
)

type DecoderOptions

type DecoderOptions struct {
	// Threads selects the decoder worker count. 0 and 1 use the serial
	// path; values >=2 enable the two-stage row pipeline when the frame
	// has more than one macroblock row. Negative values are rejected
	// with [ErrInvalidConfig].
	Threads int

	// ErrorConcealment enables libvpx-style concealment for corrupt interframes
	// after a clean keyframe has initialized references.
	ErrorConcealment bool
	// ErrorResilient is kept as a compatibility alias for ErrorConcealment.
	ErrorResilient bool
	// PostProcess enables the legacy libvpx-style postprocess chain
	// (Deblock | Demacroblock | MFQE, plus AddNoise when
	// PostProcessNoiseLevel > 0). Prefer PostProcessFlags for new code.
	PostProcess bool
	// PostProcessFlags selects individual libvpx-style postprocess filters.
	// Zero disables postprocessing unless PostProcess is set.
	PostProcessFlags PostProcessFlag
	// PostProcessNoiseLevel enables libvpx-style additive luma noise when
	// PostProcess is true or PostProcessAddNoise is set. Zero disables
	// additive noise; valid range is [0, 16].
	PostProcessNoiseLevel int

	// MaxWidth and MaxHeight reject key frames larger than the configured
	// dimensions when non-zero.
	MaxWidth  int
	MaxHeight int

	// RejectResolutionChange, when true, makes Decode return
	// [ErrFrameRejected] on a key frame whose dimensions differ from the
	// active stream. When false (the default) the decoder reallocates
	// its internal frame buffers on the resolution-change key frame.
	RejectResolutionChange bool
}

DecoderOptions configures a VP8 decoder.

type EncodeFlags

type EncodeFlags uint32

EncodeFlags controls per-frame VP8 reference and packet behavior on a single VP8Encoder.EncodeInto call. The zero value asks the encoder to use its configured defaults. Flag bits mirror libvpx's VPX_EFLAG_FORCE_* / VP8_EFLAG_NO_REF_* / VP8_EFLAG_NO_UPD_* / VP8_EFLAG_NO_UPD_ENTROPY / VP8_EFLAG_FORCE_GF / VP8_EFLAG_FORCE_ARF.

const (
	// EncodeForceKeyFrame forces the next encoded packet to be a key frame.
	EncodeForceKeyFrame EncodeFlags = 1 << iota

	// EncodeInvisibleFrame encodes a hidden frame that updates references but
	// is not displayed.
	EncodeInvisibleFrame

	// EncodeNoReferenceLast prevents inter prediction from LAST.
	EncodeNoReferenceLast
	// EncodeNoReferenceGolden prevents inter prediction from GOLDEN.
	EncodeNoReferenceGolden
	// EncodeNoReferenceAltRef prevents inter prediction from ALTREF.
	EncodeNoReferenceAltRef

	// EncodeNoUpdateLast prevents refreshing LAST from this frame.
	EncodeNoUpdateLast
	// EncodeNoUpdateGolden prevents refreshing GOLDEN from this frame.
	EncodeNoUpdateGolden
	// EncodeNoUpdateAltRef prevents refreshing ALTREF from this frame.
	EncodeNoUpdateAltRef

	// EncodeNoUpdateEntropy prevents the frame from committing updated entropy
	// probabilities.
	EncodeNoUpdateEntropy

	// EncodeForceGoldenFrame forces a GOLDEN refresh from this frame.
	EncodeForceGoldenFrame
	// EncodeForceAltRefFrame forces an ALTREF refresh from this frame.
	EncodeForceAltRefFrame
)

type EncodeResult

type EncodeResult struct {
	// Data aliases the caller-provided output buffer passed to EncodeInto or
	// FlushInto. Copy it if it must outlive that buffer.
	Data []byte

	// KeyFrame reports whether Data is a VP8 key frame.
	KeyFrame bool
	// Dropped reports that rate control intentionally emitted no packet.
	Dropped bool
	// Droppable reports libvpx's encoded-frame discardability signal: true
	// when the frame updates no reference, entropy, or segmentation state.
	Droppable bool
	// SceneCut reports that adaptive or two-pass scene-cut logic promoted this
	// frame to a keyframe.
	SceneCut bool
	// LookaheadDepth reports queued future frames remaining after this frame.
	LookaheadDepth int
	// ARNRFiltered reports that the frame used alt-ref noise reduction.
	ARNRFiltered bool
	// Denoised reports that denoiser preprocessing changed the source.
	Denoised bool
	// FirstPassStats is populated from TwoPassStats when second-pass planning
	// drives this frame.
	FirstPassStats FirstPassFrameStats
	// TwoPassFrameTargetBits reports the second-pass VBR target when
	// TwoPassStats drives the frame.
	TwoPassFrameTargetBits int

	// PTS and Duration echo the caller-provided frame timing values.
	PTS      uint64
	Duration uint64

	// Quantizer is the public 0..63 quantizer. InternalQuantizer is the VP8
	// base qindex reported by libvpx's VP8E_GET_LAST_QUANTIZER control.
	Quantizer         int
	InternalQuantizer int

	// SizeBytes is len(Data) for emitted frames.
	SizeBytes int

	// TargetBitrateKbps is the active total target bitrate.
	TargetBitrateKbps int
	// FrameTargetBits is the final rate-control target for this frame.
	FrameTargetBits int
	// BufferLevelBits is the post-frame rate-control buffer level.
	BufferLevelBits int

	// TemporalLayerID is the emitted frame's temporal-layer index.
	TemporalLayerID int
	// TemporalLayerCount is the active temporal layer count.
	TemporalLayerCount int
	// TemporalLayerSync reports a WebRTC-style temporal sync frame.
	TemporalLayerSync bool
	// TL0PICIDX is the temporal-layer-zero picture index.
	TL0PICIDX uint8
	// TemporalLayerTargetBitrateKbps is the instantaneous bitrate assigned to
	// TemporalLayerID.
	TemporalLayerTargetBitrateKbps int
	// TemporalLayerCumulativeBitrateKbps reports the cumulative libvpx
	// ts_target_bitrate[] entry for TemporalLayerID.
	TemporalLayerCumulativeBitrateKbps int
	// TemporalLayerFrameBandwidthBits is the per-frame budget for the layer.
	TemporalLayerFrameBandwidthBits int
	// TemporalLayerBufferLevelBits is the post-frame layer buffer level.
	TemporalLayerBufferLevelBits int
	// TemporalLayerMaximumBufferBits is the layer buffer cap.
	TemporalLayerMaximumBufferBits int
	// TemporalLayerInputFrames counts input frames assigned to the layer.
	TemporalLayerInputFrames int
	// TemporalLayerEncodedFrames counts non-dropped frames assigned to the layer.
	TemporalLayerEncodedFrames int
	// TemporalLayerTotalEncodedFrames counts all encoded frames up to this frame.
	TemporalLayerTotalEncodedFrames int
	// TemporalLayerEncodedBits accumulates layer output bits.
	TemporalLayerEncodedBits int

	// PSNRHint is reserved for a future per-frame quality hint. It is
	// not currently populated and always reads as zero.
	PSNRHint float64
}

EncodeResult is the value returned by VP8Encoder.EncodeInto and VP8Encoder.FlushInto for one call. Data is empty when the call produced no output (frame dropped by rate control or buffered by lookahead). PTS and Duration echo the caller-supplied values; the rate-control and temporal-layer accounting fields are populated even when Data is empty so callers can drive feedback loops on dropped frames.

type EncoderOptions

type EncoderOptions struct {
	// Width and Height are the fixed visible dimensions accepted by EncodeInto.
	Width  int
	Height int

	// FPS sets a 1/FPS timebase when TimebaseNum and TimebaseDen are zero.
	FPS int

	// TimebaseNum is the numerator of the caller timebase.
	TimebaseNum int
	// TimebaseDen is the denominator of the caller timebase.
	TimebaseDen int

	// Threads selects the worker-goroutine count for the inter-frame
	// row-threaded macroblock pipeline.
	//
	//   - 0 is treated as 1.
	//   - 1 uses the serial reference path: no row-worker pool, no
	//     atomics or channel work in the reconstruction hot path.
	//   - Values >1 allocate a persistent row-worker pool and enable
	//     the libvpx-style wave-front inter-frame encode when the
	//     frame is large enough and oracle tracing is disabled.
	//     Thread counts are deterministic but produce a bitstream
	//     that may differ from Threads=1, matching libvpx.
	//   - Negative values return [ErrInvalidConfig].
	//
	// Mirrors libvpx's --threads / cpi->oxcf.multi_threaded.
	Threads int

	// RateControlMode selects VBR, CBR, constrained-quality, or VPX_Q behavior.
	RateControlMode RateControlMode
	// TargetBitrateKbps is the total target bitrate in kbps. Required.
	TargetBitrateKbps int
	// MinBitrateKbps optionally bounds runtime bitrate updates from below.
	// Zero means no lower bound.
	MinBitrateKbps int
	// MaxBitrateKbps optionally bounds runtime bitrate updates from above.
	// Zero means no upper bound.
	MaxBitrateKbps int

	// MinQuantizer is the lowest public 0..63 quantizer the encoder may use.
	// Zero is treated as 0 (no floor above the codec minimum).
	MinQuantizer int
	// MaxQuantizer is the highest public 0..63 quantizer the encoder may use.
	// Zero is treated as 63 (no ceiling below the codec maximum).
	MaxQuantizer int
	// CQLevel mirrors libvpx's VP8E_SET_CQ_LEVEL. [RateControlCQ] applies
	// it as a floor; [RateControlQ] validates and stores it like libvpx
	// VPX_Q. Zero uses libvpx's default level after MinQuantizer
	// resolution (a zero MinQuantizer is itself promoted to 4 first).
	CQLevel int

	// UndershootPct caps libvpx-style downward rate adjustment as a percentage
	// of the target frame size; valid range is [0, 100]. Zero uses the libvpx
	// default.
	UndershootPct int
	// OvershootPct caps libvpx-style upward rate adjustment as a percentage of
	// the target frame size; valid range is [0, 1000]. Zero uses the libvpx
	// default.
	OvershootPct int

	// BufferSizeMs is the virtual rate-control buffer size in milliseconds.
	// Zero selects libvpx's default sizing.
	BufferSizeMs int
	// BufferInitialSizeMs is the initial virtual buffer fill in milliseconds.
	// Zero selects libvpx's default.
	BufferInitialSizeMs int
	// BufferOptimalSizeMs is the target virtual buffer fill in milliseconds.
	// Zero selects libvpx's default.
	BufferOptimalSizeMs int
	// MaxIntraBitratePct caps key-frame bitrate as a percentage of the
	// per-frame target. Zero disables the cap; valid range is non-negative.
	MaxIntraBitratePct int
	// GFCBRBoostPct controls golden-frame boost in CBR mode as a percentage of
	// the per-frame target. Zero uses libvpx's default; valid range is
	// non-negative.
	GFCBRBoostPct int

	// DropFrameAllowed enables rate-control frame dropping.
	DropFrameAllowed bool
	// DropFrameWaterMark is the percentage of optimal_buffer_level at
	// which rate control begins dropping frames. When DropFrameAllowed
	// is true this defaults to 60 if left zero; when DropFrameAllowed
	// is false no frame drops fire regardless of this value. Mirrors
	// libvpx's rc_dropframe_thresh / oxcf.drop_frames_water_mark.
	DropFrameWaterMark int

	// TemporalScalability configures automatic temporal-layer scheduling.
	TemporalScalability TemporalScalabilityConfig

	// Deadline selects the encoder speed/quality operating mode.
	Deadline Deadline
	// CpuUsed selects the libvpx-style speed preset in [-16, 16].
	CpuUsed int
	// Tuning selects the PSNR or SSIM visual quality model.
	Tuning Tuning

	// KeyFrameInterval is the maximum GOP distance in frames. Zero disables
	// interval-forced key frames.
	KeyFrameInterval int
	// LookaheadFrames enables buffered encoding. When positive, EncodeInto
	// queues input frames and returns ErrFrameNotReady until enough future
	// frames are available; FlushInto drains the queue at end of stream.
	LookaheadFrames int
	// AutoAltRef gates automatic alternate-reference scheduling. When true,
	// LookaheadFrames > 1, and ErrorResilient is false, the driver inserts
	// hidden alt-ref frames from the lookahead window and flips the
	// alt-ref sign bias on the matching deferred show frame. Mirrors
	// libvpx's oxcf.play_alternate.
	AutoAltRef bool
	// AdaptiveKeyFrames enables one-pass scene-cut detection. When a large
	// source/reference error shift is detected, the frame is promoted to a
	// keyframe before rate control and mode decision run; non-realtime
	// one-pass encodes also mirror libvpx's post-inter auto-key recode when
	// the committed inter-mode map crosses the intra-percentage thresholds.
	AdaptiveKeyFrames bool

	// ErrorResilient writes frames that reset inter-frame entropy adaptation.
	ErrorResilient bool
	// ErrorResilientPartitions mirrors libvpx's
	// VPX_ERROR_RESILIENT_PARTITIONS bit (set via `--error-resilient=2` or
	// `--error-resilient=3`). It enables the independent-prev-coef-context
	// algorithm in vp8_update_coef_probs (bitstream.c:879-928) so a lost
	// partition cannot corrupt the per-context coefficient-probability
	// tables. Off by default; the plain ErrorResilient bool maps to
	// VPX_ERROR_RESILIENT_DEFAULT, which does NOT touch the per-context
	// algorithm.
	ErrorResilientPartitions bool
	// TokenPartitions is VP8's token partition selector: 0=one, 1=two, 2=four, 3=eight.
	TokenPartitions int

	// FastLoopFilterPick switches the loop-filter fast-pick gate to the
	// partial-frame trial picker whenever speed >= 4 (libvpx uses > 4).
	// Off by default. Opt-in departure from libvpx parity that recovers
	// ~20-30% of EncodeInto wall time at cold-start
	// realtime+positive-cpu_used. Turn on only after verifying the
	// resulting loop-filter level drift is acceptable for the use case.
	FastLoopFilterPick bool
	// Sharpness is the VP8 loop-filter sharpness level in [0, 7].
	Sharpness int
	// NoiseSensitivity mirrors libvpx's VP8E_SET_NOISE_SENSITIVITY: 0=off,
	// 1=Y denoise, 2=YUV denoise, 3..6=more aggressive YUV denoise.
	NoiseSensitivity int
	// ARNRMaxFrames is the alt-ref noise reduction temporal window in frames.
	// Mirrors libvpx's VP8E_SET_ARNR_MAXFRAMES. Zero disables ARNR.
	ARNRMaxFrames int
	// ARNRStrength is the alt-ref noise reduction filter strength in [0, 6].
	// Mirrors libvpx's VP8E_SET_ARNR_STRENGTH.
	ARNRStrength int
	// ARNRType selects the alt-ref filter direction: 1=backward, 2=forward,
	// 3=centered. Mirrors libvpx's VP8E_SET_ARNR_TYPE. Zero defaults to 3
	// (centered), matching libvpx.
	ARNRType int
	// TwoPassStats enables second-pass VBR planning when non-empty.
	TwoPassStats []FirstPassFrameStats
	// TwoPassVBRBiasPct controls second-pass VBR bias when stats are present.
	TwoPassVBRBiasPct int
	// TwoPassMinPct sets the second-pass minimum section bitrate percentage.
	TwoPassMinPct int
	// TwoPassMaxPct sets the second-pass maximum section bitrate percentage.
	TwoPassMaxPct int
	// ScreenContentMode mirrors libvpx's VP8E_SET_SCREEN_CONTENT_MODE:
	// 0=off, 1=on, 2=on with more aggressive rate control.
	ScreenContentMode int
	// RTCExternalRateControl mirrors libvpx's VP8E_SET_RTC_EXTERNAL_RATECTRL.
	// For VP8 this disables cyclic refresh and post-encode overshoot recode
	// while keeping rate-correction-factor updates active.
	RTCExternalRateControl bool
	// StaticThreshold mirrors libvpx's VP8E_SET_STATIC_THRESHOLD /
	// oxcf.encode_breakout for first-pass and inter-frame static skips.
	StaticThreshold int

	// PhaseStats, when non-nil, receives coarse per-attempt encoder phase
	// timings and SAD/subpel hot-path counters during EncodeInto. The
	// caller owns the pointed-to value and may [EncoderPhaseStats.Reset]
	// it between warmup and measured passes. Leave nil in normal builds
	// to skip all clock reads and counter updates.
	PhaseStats *EncoderPhaseStats
}

EncoderOptions configures a VP8 encoder.

type EncoderPhaseStats

type EncoderPhaseStats struct {
	// InterReconstructNS is time spent rebuilding inter-frame prediction and
	// residual planes.
	InterReconstructNS int64 `json:"inter_reconstruct_ns"`
	// KeyReconstructNS is time spent rebuilding key-frame prediction and
	// residual planes.
	KeyReconstructNS int64 `json:"key_reconstruct_ns"`
	// LoopFilterPickNS is time spent selecting loop-filter parameters.
	LoopFilterPickNS int64 `json:"loop_filter_pick_ns"`
	// LoopFilterApplyNS is time spent applying the loop filter to committed
	// frames.
	LoopFilterApplyNS int64 `json:"loop_filter_apply_ns"`
	// PacketWriteNS is time spent packing VP8 frame data.
	PacketWriteNS int64 `json:"packet_write_ns"`
	// InterAttempts counts inter-frame encode attempts, including recodes.
	InterAttempts int64 `json:"inter_attempts"`
	// KeyAttempts counts key-frame encode attempts, including recodes.
	KeyAttempts int64 `json:"key_attempts"`

	// LoopFilterTrials counts candidate filter-strength evaluations.
	LoopFilterTrials int64 `json:"loop_filter_trials"`
	// LoopFilterTrialCopyNS is time spent copying trial frame buffers.
	LoopFilterTrialCopyNS int64 `json:"loop_filter_trial_copy_ns"`
	// LoopFilterTrialFilterNS is time spent filtering trial frame buffers.
	LoopFilterTrialFilterNS int64 `json:"loop_filter_trial_filter_ns"`
	// LoopFilterTrialSSENS is time spent scoring loop-filter trials.
	LoopFilterTrialSSENS int64 `json:"loop_filter_trial_sse_ns"`

	// InterRDCoeffCacheRequests counts inter RD coefficient-cache lookups.
	InterRDCoeffCacheRequests int64 `json:"inter_rd_coeff_cache_requests"`
	// InterRDCoeffCacheDCTHits counts cached DCT/residual reuse hits.
	InterRDCoeffCacheDCTHits int64 `json:"inter_rd_coeff_cache_dct_hits"`
	// InterCoefTokenRecords counts token-rate records produced during inter RD.
	InterCoefTokenRecords int64 `json:"inter_coef_token_records"`

	// FullPelSADCalls counts full-pixel SAD search invocations.
	FullPelSADCalls int64 `json:"fullpel_sad_calls"`
	// FullPelSADCandidates counts full-pixel candidate positions scored.
	FullPelSADCandidates int64 `json:"fullpel_sad_candidates"`
	// FullPelBatchCalls counts vectorized multi-candidate SAD batches.
	FullPelBatchCalls int64 `json:"fullpel_batch_calls"`
	// FullPelBoundsRejects counts full-pixel candidates outside legal bounds.
	FullPelBoundsRejects int64 `json:"fullpel_bounds_rejects"`
	// FullPelEarlyBreaks counts SAD evaluations stopped by an existing best.
	FullPelEarlyBreaks int64 `json:"fullpel_early_breaks"`
	// SubpelCandidates counts sub-pixel candidate positions scored.
	SubpelCandidates int64 `json:"subpel_candidates"`
	// SubpelVarianceCalls counts sub-pixel variance evaluations.
	SubpelVarianceCalls int64 `json:"subpel_variance_calls"`
	// SubpelCacheHits counts sub-pixel predictor-cache hits.
	SubpelCacheHits int64 `json:"subpel_cache_hits"`
	// SubpelBoundsRejects counts sub-pixel candidates outside legal bounds.
	SubpelBoundsRejects int64 `json:"subpel_bounds_rejects"`
	// SubpelEarlyBreaks counts sub-pixel evaluations stopped by an existing best.
	SubpelEarlyBreaks int64 `json:"subpel_early_breaks"`
}

EncoderPhaseStats accumulates opt-in coarse encoder phase timing in nanoseconds and counters for the SAD/subpel search hot path. The encoder updates the caller-owned value only when EncoderOptions.PhaseStats is non-nil; normal encodes do not read the clock or atomically update these counters. The caller owns the value, may EncoderPhaseStats.Reset it between warmup and measurement, and may sample it concurrently with EncodeInto only under its own synchronization.

func (*EncoderPhaseStats) Reset

func (s *EncoderPhaseStats) Reset()

Reset clears all accumulated phase counters.

type FirstPassFrameStats

type FirstPassFrameStats struct {
	// Frame is the source-frame ordinal accumulated by libvpx first pass.
	Frame uint64
	// IntraError is the intra prediction error.
	IntraError float64
	// CodedError is the selected coded prediction error.
	CodedError float64
	// SSIMWeightedPredErr is the SSIM-weighted prediction error.
	SSIMWeightedPredErr float64
	// PcntInter is the fraction of macroblocks coded as inter.
	PcntInter float64
	// PcntMotion is the fraction of macroblocks with non-zero motion.
	PcntMotion float64
	// PcntSecondRef is the fraction using the second reference.
	PcntSecondRef float64
	// PcntNeutral is libvpx's neutral-block fraction.
	PcntNeutral float64
	// MVr accumulates signed row motion vectors.
	MVr float64
	// MVrAbs accumulates absolute row motion vectors.
	MVrAbs float64
	// MVc accumulates signed column motion vectors.
	MVc float64
	// MVcAbs accumulates absolute column motion vectors.
	MVcAbs float64
	// MVrv accumulates row motion-vector variance terms.
	MVrv float64
	// MVcv accumulates column motion-vector variance terms.
	MVcv float64
	// MVInOutCount is libvpx's in/out motion-vector accumulator.
	MVInOutCount float64
	// NewMVCount counts macroblocks that selected a new motion vector.
	NewMVCount float64
	// Duration is the frame duration in caller timebase units.
	Duration float64
	// Count is the number of frames represented by this record.
	Count float64
	// IsTotal marks an entry as the libvpx terminal "total stats" packet
	// emitted at end-of-encode (vp8_end_first_pass). The total mirrors
	// cpi->twopass.total_stats: a running aggregate of every per-frame
	// FIRSTPASS_STATS produced by vp8_first_pass via accumulate_stats.
	// When set, the entry is the last element of a finalized stats slice
	// and is consumed by the second-pass setup driven by SetTwoPassStats.
	IsTotal bool
}

FirstPassFrameStats mirrors libvpx FIRSTPASS_STATS for one analyzed frame or for the finalized sequence total.

func FinalizeFirstPassStats

func FinalizeFirstPassStats(stats []FirstPassFrameStats) []FirstPassFrameStats

FinalizeFirstPassStats appends the libvpx-style terminal total-stats record to a slice of per-frame FirstPassFrameStats records produced by VP8Encoder.CollectFirstPassStats. Each per-frame entry is folded into a running aggregate, which is appended with IsTotal=true so VP8Encoder.SetTwoPassStats can recover the sequence-wide totals libvpx's second pass expects.

If the input already ends with an IsTotal entry, or is empty, the slice is returned unchanged.

type FrameInfo

type FrameInfo struct {
	// Width and Height are the visible output dimensions.
	Width  int
	Height int

	// KeyFrame reports whether the frame is a key frame.
	KeyFrame bool
	// ShowFrame reports whether the packet produced visible output.
	ShowFrame bool
	// Corrupted reports decoder corruption or concealment state.
	Corrupted bool

	// Quantizer is the public 0..63 quantizer mapped from
	// InternalQuantizer.
	Quantizer int
	// InternalQuantizer is the raw VP8 base qindex (libvpx's
	// VPXD_GET_LAST_QUANTIZER).
	InternalQuantizer int
	// RefUpdates reports reference buffers refreshed by the frame.
	RefUpdates ReferenceFlags
	// RefUsed reports reference buffers used by inter prediction in the frame.
	RefUsed ReferenceFlags

	// PTS is the caller-provided presentation timestamp.
	PTS uint64
}

FrameInfo describes the most recently decoded VP8 frame. It is returned by VP8Decoder.LastFrameInfo and the DecodeInto family.

type Image

type Image struct {
	// Width and Height are the visible luma dimensions in pixels.
	Width  int
	Height int

	// Y, U, and V hold visible plane data plus any caller-owned stride padding.
	// U and V use 4:2:0 chroma dimensions: (Width+1)/2 by (Height+1)/2.
	Y []byte
	U []byte
	V []byte

	// YStride, UStride, and VStride are bytes between adjacent rows in each
	// plane. They must be at least the visible width of their plane.
	YStride int
	UStride int
	VStride int
}

Image is an I420/YV12-style planar 8-bit 4:2:0 image.

Plane slices may include stride padding. Width and Height define the visible image size, and callers must honor the per-plane strides. The zero value is not a usable image: Width, Height, the three plane slices, and the three strides must all be set before passing the value to EncodeInto or DecodeInto.

type PostProcessFlag

type PostProcessFlag uint32

PostProcessFlag selects optional libvpx-style decoder postprocessing.

const (
	// PostProcessDeblock enables VP8 deblocking postprocess.
	PostProcessDeblock PostProcessFlag = 1 << iota
	// PostProcessDemacroblock enables block-edge smoothing postprocess.
	PostProcessDemacroblock
	// PostProcessAddNoise enables luma noise restoration postprocess.
	PostProcessAddNoise
	// PostProcessMFQE enables multi-frame quality enhancement.
	PostProcessMFQE
)

type ROIMap

type ROIMap struct {
	// Enabled turns the ROI map on. A nil *ROIMap, Enabled=false, nil
	// SegmentID, or an all-zero delta/threshold configuration disables ROI.
	Enabled bool
	// Rows is the number of macroblock rows in SegmentID.
	Rows int
	// Cols is the number of macroblock columns in SegmentID.
	Cols int
	// SegmentID contains one segment id per macroblock in row-major order.
	SegmentID []uint8
	// DeltaQuantizer contains per-segment public quantizer deltas.
	DeltaQuantizer [vp8common.MaxMBSegments]int
	// DeltaLoopFilter contains per-segment loop-filter deltas.
	DeltaLoopFilter [vp8common.MaxMBSegments]int
	// StaticThreshold contains per-segment static encode-breakout thresholds.
	StaticThreshold [vp8common.MaxMBSegments]int
}

ROIMap configures libvpx-style per-macroblock region-of-interest segments. SegmentID is a row-major rows*cols map of 16x16 macroblocks; each value must be in [0, 3]. DeltaQuantizer uses libvpx public quantizer deltas in [-63, 63] and is translated to VP8 qindex deltas internally. DeltaLoopFilter uses raw VP8 loop-filter deltas in [-63, 63]. StaticThreshold sets per-segment encode-breakout thresholds for inter frames.

type RateControlConfig

type RateControlConfig struct {
	// Mode selects VBR, CBR, constrained-quality, or VPX_Q behavior.
	Mode RateControlMode

	// TargetBitrateKbps is the total target bitrate.
	TargetBitrateKbps int
	// MinBitrateKbps and MaxBitrateKbps optionally bound runtime bitrate
	// updates.
	MinBitrateKbps int
	MaxBitrateKbps int

	// MinQuantizer and MaxQuantizer bound the public 0..63 quantizer range.
	MinQuantizer int
	MaxQuantizer int
	// CQLevel is the public quantizer level for RateControlCQ and
	// RateControlQ. RateControlCQ applies it as a floor; RateControlQ
	// mirrors libvpx's VPX_Q validation without applying the CQ floor.
	CQLevel int

	// UndershootPct and OvershootPct cap libvpx-style rate adjustment.
	UndershootPct int
	OvershootPct  int

	// BufferSizeMs, BufferInitialSizeMs, and BufferOptimalSizeMs describe the
	// virtual rate-control buffer in milliseconds.
	BufferSizeMs        int
	BufferInitialSizeMs int
	BufferOptimalSizeMs int

	// DropFrameAllowed enables rate-control frame dropping.
	DropFrameAllowed bool
	// DropFrameWaterMark is the buffer-level percentage at which rate
	// control begins dropping frames. Values >100 are clamped to 100.
	// When DropFrameAllowed is true and this is zero it defaults to
	// 60 (libvpx's typical realtime CBR knob). When DropFrameAllowed
	// is false, no drops fire regardless of this value. Mirrors
	// libvpx's oxcf.drop_frames_water_mark / rc_dropframe_thresh.
	DropFrameWaterMark int

	// MaxIntraBitratePct caps key-frame bitrate as a percentage of target.
	MaxIntraBitratePct int
	// GFCBRBoostPct controls golden-frame boost in CBR mode.
	GFCBRBoostPct int
}

RateControlConfig is the runtime-updatable subset of encoder rate-control options.

type RateControlMode

type RateControlMode int

RateControlMode selects the encoder bitrate-control strategy.

const (
	// RateControlVBR selects variable bitrate mode.
	RateControlVBR RateControlMode = iota
	// RateControlCBR selects constant bitrate mode.
	RateControlCBR
	// RateControlCQ selects constrained-quality mode.
	RateControlCQ
	// RateControlQ selects libvpx VPX_Q constant-quality mode.
	RateControlQ
)

type RealtimeFrameDropMode

type RealtimeFrameDropMode int

RealtimeFrameDropMode selects how SetRealtimeTarget changes frame dropping.

const (
	// RealtimeFrameDropUnchanged leaves the current frame-drop setting intact.
	RealtimeFrameDropUnchanged RealtimeFrameDropMode = iota
	// RealtimeFrameDropDisabled disables realtime frame dropping.
	RealtimeFrameDropDisabled
	// RealtimeFrameDropEnabled enables realtime frame dropping.
	RealtimeFrameDropEnabled
)

type RealtimeTarget

type RealtimeTarget struct {
	// BitrateKbps changes the total target bitrate when non-zero.
	// Equivalent to [VP8Encoder.SetBitrateKbps].
	BitrateKbps int
	// FPS changes the timebase to 1/FPS when non-zero. The realtime
	// adaptive-Speed timing window is reset so the auto-speed selector
	// recomputes from cold start against the new frame budget.
	FPS int

	// Width and Height drive caller-driven runtime resolution change
	// when both are positive. Setting them to the encoder's current
	// dimensions is a no-op (accepted for sparse BWE deltas that echo
	// the active size). Setting them to a new W x H pair resizes every
	// size-dependent encoder buffer in place (capacity is reused),
	// invalidates the LAST / GOLDEN / ALTREF references, and forces
	// the next encoded frame to be a key frame at the new dimensions.
	//
	// Mirrors libvpx's `vpx_codec_enc_config_set` with a new width /
	// height. The libvpx spatial resampler ([VP8E_SET_SCALEMODE],
	// `rc_resize_*`) is not implemented; callers drive the coded size
	// directly. The decoder also handles key-frame resolution change;
	// see [DecoderOptions.RejectResolutionChange].
	//
	// Resize is refused with [ErrInvalidConfig] when the lookahead
	// queue is non-empty or a hidden alt-ref input is staged; drain the
	// encoder with [VP8Encoder.FlushInto] before resizing in those
	// modes. Invalid dimensions (zero, negative, or larger than the
	// VP8 maximum) are likewise refused without mutating encoder
	// state.
	Width  int
	Height int

	// MinQuantizer and MaxQuantizer update the public 0..63 quantizer
	// range when non-zero. Mirrors the runtime side of
	// [EncoderOptions.MinQuantizer] / [EncoderOptions.MaxQuantizer].
	MinQuantizer int
	MaxQuantizer int

	// FrameDrop changes realtime frame dropping. The zero value
	// ([RealtimeFrameDropUnchanged]) leaves the current setting
	// unchanged, which is the right default for bitrate-only WebRTC
	// bandwidth-estimation updates that should not accidentally
	// disable dropping.
	FrameDrop RealtimeFrameDropMode
	// AllowFrameDrop is a legacy fallback used only when FrameDrop is
	// [RealtimeFrameDropUnchanged]; if true, it enables realtime frame
	// dropping. Prefer FrameDrop in new code — it can disable dropping
	// and makes the intent explicit. Kept for source compatibility.
	AllowFrameDrop bool
}

RealtimeTarget describes a low-latency runtime target update applied by VP8Encoder.SetRealtimeTarget.

Each field uses its zero value as "leave the current setting alone", so a bandwidth-estimator update is safe to send as a sparse delta (typically only BitrateKbps). All non-zero fields are validated before any mutation, and a validation failure leaves the encoder fully usable at its previous configuration.

Mirrors libvpx's `vpx_codec_enc_config_set` for the fields a WebRTC sender typically updates per BWE step.

type ReferenceFlags

type ReferenceFlags uint8

ReferenceFlags is a bit mask of VP8 reference buffers. It is used on [FrameInfo.RefUpdates] and [FrameInfo.RefUsed] to report which buffers a decoded frame refreshed or read.

const (
	// ReferenceFlagLast identifies the LAST reference buffer.
	ReferenceFlagLast ReferenceFlags = 1 << iota
	// ReferenceFlagGolden identifies the GOLDEN reference buffer.
	ReferenceFlagGolden
	// ReferenceFlagAltRef identifies the alternate-reference buffer.
	ReferenceFlagAltRef
)

type ReferenceFrame

type ReferenceFrame ReferenceFlags

ReferenceFrame selects one VP8 reference buffer for the set/copy controls on VP8Encoder and VP8Decoder. Unlike ReferenceFlags, it is not a bit mask: it must be exactly one of ReferenceLast, ReferenceGolden, or ReferenceAltRef.

const (
	// ReferenceLast selects the LAST reference buffer.
	ReferenceLast ReferenceFrame = ReferenceFrame(ReferenceFlagLast)
	// ReferenceGolden selects the GOLDEN reference buffer.
	ReferenceGolden ReferenceFrame = ReferenceFrame(ReferenceFlagGolden)
	// ReferenceAltRef selects the alternate-reference buffer.
	ReferenceAltRef ReferenceFrame = ReferenceFrame(ReferenceFlagAltRef)
)

type StreamInfo

type StreamInfo struct {
	// Width and Height are the visible coded dimensions carried by key frames.
	// Inter frames reuse the current stream dimensions.
	Width  int
	Height int
	// Profile is the VP8 version_number field from the frame tag. The
	// VP8 spec defines values 0..3; govpx accepts 4..7 for compatibility
	// with libvpx but treats them as version 0.
	Profile int

	// KeyFrame reports whether the packet is a VP8 key frame.
	KeyFrame bool
	// ShowFrame reports whether decoding the packet produces visible output.
	ShowFrame bool

	// FirstPartitionSize is the VP8 first-partition byte count from the frame
	// tag.
	FirstPartitionSize int
}

StreamInfo describes the VP8 frame-header fields that can be read without fully decoding a packet. It is returned by PeekVP8StreamInfo and is suitable for routing decisions before a decoder is constructed.

func PeekVP8StreamInfo

func PeekVP8StreamInfo(packet []byte) (StreamInfo, error)

PeekVP8StreamInfo parses VP8 frame-header metadata without decoding the frame. It allocates nothing and is safe to call on every received packet. Returns ErrInvalidData when the frame tag is malformed.

Example
package main

import (
	"fmt"

	"github.com/thesyncim/govpx"
)

func main() {
	packet := []byte{
		0x10, 0x00, 0x00,
		0x9d, 0x01, 0x2a,
		0x40, 0x01,
		0xf0, 0x00,
	}

	info, err := govpx.PeekVP8StreamInfo(packet)
	if err != nil {
		fmt.Println(err)
		return
	}
	fmt.Println(info.Width, info.Height, info.KeyFrame)
}
Output:
320 240 true

type TemporalLayeringMode

type TemporalLayeringMode int

TemporalLayeringMode selects a built-in temporal scalability pattern. Values mirror libvpx's VP8E_TEMPORAL_LAYERING_MODE_* enum; the underlying frame-by-frame layer IDs and reference flags follow the corresponding libvpx VP8 patterns.

const (
	// TemporalLayeringOneLayer disables temporal layering. The encoder
	// produces a single base-layer stream.
	TemporalLayeringOneLayer TemporalLayeringMode = iota
	// TemporalLayeringTwoLayers selects libvpx's two-layer 2-frame pattern.
	TemporalLayeringTwoLayers
	// TemporalLayeringTwoLayersThreeFrame selects libvpx's two-layer 3-frame
	// pattern.
	TemporalLayeringTwoLayersThreeFrame
	// TemporalLayeringThreeLayersSixFrame selects libvpx's three-layer
	// 6-frame pattern.
	TemporalLayeringThreeLayersSixFrame
	// TemporalLayeringThreeLayersNoInterLayerPrediction selects a three-layer
	// pattern with no inter-layer prediction.
	TemporalLayeringThreeLayersNoInterLayerPrediction
	// TemporalLayeringThreeLayersLayerOnePrediction selects a three-layer
	// pattern that allows prediction from layer one.
	TemporalLayeringThreeLayersLayerOnePrediction
	// TemporalLayeringThreeLayers selects libvpx's default three-layer
	// 4-frame pattern.
	TemporalLayeringThreeLayers
	// TemporalLayeringFiveLayers selects libvpx's five-layer 16-frame
	// pattern.
	TemporalLayeringFiveLayers
	// TemporalLayeringTwoLayersWithSync selects a two-layer pattern that
	// emits libvpx-style temporal sync frames.
	TemporalLayeringTwoLayersWithSync
	// TemporalLayeringThreeLayersWithSync selects a three-layer pattern that
	// emits libvpx-style temporal sync frames.
	TemporalLayeringThreeLayersWithSync
	// TemporalLayeringThreeLayersAltRefWithSync selects a three-layer
	// pattern with alt-ref-backed sync frames.
	TemporalLayeringThreeLayersAltRefWithSync
	// TemporalLayeringThreeLayersOneReference selects a three-layer pattern
	// that uses a single reference across layers.
	TemporalLayeringThreeLayersOneReference
	// TemporalLayeringThreeLayersNoSync selects a three-layer pattern that
	// omits sync signaling.
	TemporalLayeringThreeLayersNoSync
)

type TemporalScalabilityConfig

type TemporalScalabilityConfig struct {
	// Enabled turns on temporal layering when true.
	Enabled bool
	// Mode selects the built-in layer pattern.
	Mode TemporalLayeringMode

	// LayerTargetBitrateKbps holds per-layer target bitrates in cumulative
	// form, matching libvpx's ts_target_bitrate[]: entry i is the sum of
	// the bitrate budgeted to layers 0..i. Unused trailing entries must
	// be zero. The last non-zero entry should equal
	// [EncoderOptions.TargetBitrateKbps]. An all-zero array auto-derives
	// a default 60/40 split (two layers) or 40/20/40 split (three
	// layers) from TargetBitrateKbps.
	LayerTargetBitrateKbps [MaxTemporalLayers]int
}

TemporalScalabilityConfig configures automatic temporal-layer scheduling. The zero value disables temporal layering.

type Tuning

type Tuning int

Tuning selects the encoder's visual quality model.

const (
	// TunePSNR selects the default PSNR-oriented rate-distortion model.
	TunePSNR Tuning = iota
	// TuneSSIM selects libvpx-style SSIM activity masking.
	TuneSSIM
)

type VP8Decoder

type VP8Decoder struct {
	// contains filtered or unexported fields
}

VP8Decoder decodes raw VP8 frame payloads.

func NewVP8Decoder

func NewVP8Decoder(opts DecoderOptions) (*VP8Decoder, error)

NewVP8Decoder creates a VP8 decoder with validated options. The zero value of opts is valid: it produces a single-threaded decoder with no postprocessing, no error concealment, and no dimension caps.

func (*VP8Decoder) Close

func (d *VP8Decoder) Close() error

Close releases decoder state. After Close, methods that return an error return ErrClosed; VP8Decoder.NextFrame and VP8Decoder.LastFrameInfo report not-ready instead. Calling Close on a nil or already-closed decoder returns ErrClosed.

func (*VP8Decoder) CopyReferenceFrame

func (d *VP8Decoder) CopyReferenceFrame(ref ReferenceFrame, dst *Image) error

CopyReferenceFrame copies ref into dst. ref must be ReferenceLast, ReferenceGolden, or ReferenceAltRef; dst must match the stream dimensions established by the most recently decoded key frame and provide valid I420 strides. Returns ErrInvalidConfig when no key frame has been decoded yet or when dimensions or strides do not match.

func (*VP8Decoder) Decode

func (d *VP8Decoder) Decode(packet []byte) error

Decode decodes one raw VP8 frame payload. The first packet supplied to a fresh or reset decoder must be a key frame; otherwise ErrNeedKeyFrame is returned.

Visible frames are queued for the next call to NextFrame. Hidden frames (such as alt-refs) update reference buffers but produce no NextFrame output.

func (*VP8Decoder) DecodeInto

func (d *VP8Decoder) DecodeInto(packet []byte, dst *Image) (FrameInfo, error)

DecodeInto decodes one raw VP8 frame payload. If the packet is a visible frame its decoded pixels are written into the caller-owned planes of dst; for hidden frames dst is left untouched. dst must be non-nil and match the dimensions of the most recently decoded key frame (or of the packet itself, when it is a key frame).

func (*VP8Decoder) DecodeIntoWithPTS

func (d *VP8Decoder) DecodeIntoWithPTS(packet []byte, dst *Image, pts uint64) (FrameInfo, error)

DecodeIntoWithPTS is DecodeInto with an explicit presentation timestamp. pts is echoed back in the returned FrameInfo.

func (*VP8Decoder) DecodeWithPTS

func (d *VP8Decoder) DecodeWithPTS(packet []byte, pts uint64) error

DecodeWithPTS is Decode with an explicit presentation timestamp. pts is echoed back through VP8Decoder.LastFrameInfo.

func (*VP8Decoder) LastFrameInfo

func (d *VP8Decoder) LastFrameInfo() (FrameInfo, bool)

LastFrameInfo returns metadata for the most recently decoded frame. ok is false on a nil or closed decoder, and before the first successful Decode/DecodeInto call.

func (*VP8Decoder) NextFrame

func (d *VP8Decoder) NextFrame() (Image, bool)

NextFrame returns the most recent visible decoded frame and consumes it. Subsequent calls return false until the next visible frame is decoded. The returned image aliases decoder-owned storage; that storage stays valid until the next Decode, Reset, or Close call. Copy the planes if they must outlive that boundary.

Hidden VP8 frames (ShowFrame == false, including alt-refs) do not produce a NextFrame result; only their reference-buffer updates take effect.

func (*VP8Decoder) Reset

func (d *VP8Decoder) Reset()

Reset returns the decoder to its cold-start state while retaining allocated buffers and validated DecoderOptions for reuse. The next Decode must be a key frame; reference buffers, postprocess state, and queued NextFrame output are cleared.

func (*VP8Decoder) SetReferenceFrame

func (d *VP8Decoder) SetReferenceFrame(ref ReferenceFrame, src Image) error

SetReferenceFrame replaces ref with src. ref must be ReferenceLast, ReferenceGolden, or ReferenceAltRef; src must match the stream dimensions established by the most recently decoded key frame and provide valid I420 strides. Returns ErrInvalidConfig when no key frame has been decoded yet or when dimensions or strides do not match. The decoder extends reference borders after copying.

type VP8Encoder

type VP8Encoder struct {
	// contains filtered or unexported fields
}

VP8Encoder encodes caller-provided I420 images into raw VP8 frame payloads. A VP8Encoder is not safe for concurrent use by multiple goroutines; the optional worker pool selected by EncoderOptions.Threads is internal to a single encode call.

func NewVP8Encoder

func NewVP8Encoder(opts EncoderOptions) (*VP8Encoder, error)

NewVP8Encoder creates a VP8 encoder with validated options. Allocations happen here, not on the hot path: per-frame buffers, the row-worker pool when EncoderOptions.Threads > 1, and rate-control state are sized for EncoderOptions.Width and EncoderOptions.Height.

opts is validated up front; invalid combinations return ErrInvalidConfig, ErrInvalidBitrate, or ErrInvalidQuantizer without allocating any encoder state. Width, Height, FPS (or TimebaseNum/Den), and TargetBitrateKbps are required.

func (*VP8Encoder) Close

func (e *VP8Encoder) Close() error

Close releases encoder state and shuts down any row-worker pool. After Close, every method on this encoder returns ErrClosed. Calling Close on a nil or already-closed encoder also returns ErrClosed.

func (*VP8Encoder) CollectFirstPassStats

func (e *VP8Encoder) CollectFirstPassStats(src Image, pts uint64, duration uint64, flags EncodeFlags) (FirstPassFrameStats, error)

CollectFirstPassStats runs libvpx-style first-pass analysis on one source frame for two-pass VBR planning. The returned FirstPassFrameStats should be accumulated in a slice across all input frames and then passed through FinalizeFirstPassStats before being handed to a second-pass encoder via EncoderOptions.TwoPassStats or VP8Encoder.SetTwoPassStats.

First-pass analysis updates internal reference state but emits no VP8 bitstream. pts is currently accepted for API symmetry but is not consumed; duration is recorded in the returned stats. flags accepts the same EncodeFlags as EncodeInto for validation.

func (*VP8Encoder) CopyReferenceFrame

func (e *VP8Encoder) CopyReferenceFrame(ref ReferenceFrame, dst *Image) error

CopyReferenceFrame copies ref into dst. ref must be ReferenceLast, ReferenceGolden, or ReferenceAltRef; dst must be non-nil, match the encoder dimensions, and provide valid I420 strides.

Returns ErrClosed on a nil or closed encoder, or ErrInvalidConfig when dst is nil, ref is not a single valid selector, or dst does not match the encoder's shape or strides.

func (*VP8Encoder) EncodeInto

func (e *VP8Encoder) EncodeInto(dst []byte, src Image, pts uint64, duration uint64, flags EncodeFlags) (EncodeResult, error)

EncodeInto encodes one input frame into dst and returns one encoded packet. The returned EncodeResult.Data aliases dst; copy it if it must outlive the next call that reuses dst.

pts and duration are passed through unchanged and echoed in EncodeResult.PTS / EncodeResult.Duration. flags selects per-frame reference and packet behavior; pass 0 for the default policy.

When lookahead, auto-alt-ref, or two-pass planning is buffering frames EncodeInto returns ErrFrameNotReady; drain the buffer with FlushInto at end of stream. If rate control drops the frame the call succeeds with EncodeResult.Dropped set and no encoded payload.

Returns ErrClosed on a nil or closed encoder, ErrInvalidConfig if src does not match the encoder's configured dimensions or strides, ErrBufferTooSmall if dst is empty, and ErrInvalidConfig if flags combine mutually exclusive bits (for example EncodeForceGoldenFrame with EncodeNoUpdateGolden).

func (*VP8Encoder) FlushInto

func (e *VP8Encoder) FlushInto(dst []byte) (EncodeResult, error)

FlushInto drains queued frames at end of stream and emits the next pending packet into dst. Call repeatedly until it returns ErrFrameNotReady to flush all lookahead, auto-alt-ref, and two-pass state. Returns ErrClosed on a nil or closed encoder and ErrBufferTooSmall if dst is empty.

func (*VP8Encoder) ForceKeyFrame

func (e *VP8Encoder) ForceKeyFrame()

ForceKeyFrame requests that the next frame committed by EncodeInto or FlushInto be a key frame. The request is sticky until satisfied: with lookahead enabled the next visible output is forced; hidden alt-ref emissions in between do not consume it. Use the EncodeForceKeyFrame flag on EncodeInto when only that single call must be a key frame. Calls on a nil or closed encoder are no-ops.

func (*VP8Encoder) LastQuantizer

func (e *VP8Encoder) LastQuantizer() (public int, internal int, ok bool)

LastQuantizer returns the public 0..63 quantizer and the internal VP8 qindex for the most recently committed encoded frame. ok is false on a nil or closed encoder, and before any frame has been committed (which includes dropped or buffered-by-lookahead inputs).

func (*VP8Encoder) Reset

func (e *VP8Encoder) Reset()

Reset returns the encoder to its cold-start state while retaining allocated buffers and the validated EncoderOptions. Rate-control, reference, lookahead, ARNR, denoiser, two-pass, and temporal-layer state are all cleared; queued lookahead frames are discarded; the next VP8Encoder.EncodeInto starts as if from NewVP8Encoder without re-running its allocations. VP8Encoder.LastQuantizer reports ok=false again until the next committed frame. Calls on a nil encoder are no-ops.

func (*VP8Encoder) SetARNR

func (e *VP8Encoder) SetARNR(maxFrames int, strength int, filterType int) error

SetARNR changes alt-ref noise-reduction controls at runtime. maxFrames is the temporal filter window length (0 disables ARNR); strength is the filter strength in [0, 6]; filterType selects 1=backward, 2=forward, or 3=centered. See EncoderOptions.ARNRMaxFrames, ARNRStrength, ARNRType.

func (*VP8Encoder) SetActiveMap

func (e *VP8Encoder) SetActiveMap(activeMap []uint8, rows int, cols int) error

SetActiveMap installs a per-macroblock activity map. Cells equal to 0 mark inactive macroblocks; in inter frames those MBs skip mode decision and code as ZEROMV-LAST with skip=1, matching libvpx vp8_set_active_map (onyx_if.c) and the active_ptr early-exit in pickinter.c/rdopt.c. Pass a nil map to disable. Key frames ignore the map.

rows and cols must equal the encoder's macroblock dimensions; len(activeMap) must equal rows*cols.

func (*VP8Encoder) SetAdaptiveKeyFrames

func (e *VP8Encoder) SetAdaptiveKeyFrames(enabled bool) error

SetAdaptiveKeyFrames enables or disables one-pass scene-cut key frames. See EncoderOptions.AdaptiveKeyFrames for the libvpx-compatible promotion behavior this controls.

func (*VP8Encoder) SetBitrateKbps

func (e *VP8Encoder) SetBitrateKbps(kbps int) error

SetBitrateKbps changes the total encoder target bitrate, in kbps. The new value is clamped to [MinBitrateKbps, MaxBitrateKbps] when those bounds are non-zero. Temporal-layer per-layer bitrates rescale proportionally. Returns ErrInvalidBitrate if kbps is not positive.

func (*VP8Encoder) SetCPUUsed

func (e *VP8Encoder) SetCPUUsed(cpuUsed int) error

SetCPUUsed changes the libvpx-style speed preset. Valid range is [-16, 16]. The interpretation depends on the active Deadline: under realtime, positive values trigger libvpx's auto-speed selector; negative values pin a speed. See EncoderOptions.CpuUsed.

func (*VP8Encoder) SetCQLevel

func (e *VP8Encoder) SetCQLevel(level int) error

SetCQLevel changes the public 0..63 CQ/Q quantizer level. Under RateControlCQ the level is applied as a quantizer floor; under RateControlQ it pins the target quantizer like libvpx VPX_Q. Levels outside [MinQuantizer, MaxQuantizer] are rejected with ErrInvalidQuantizer when the active mode consumes the level.

func (*VP8Encoder) SetDeadline

func (e *VP8Encoder) SetDeadline(deadline Deadline) error

SetDeadline changes the encoder speed/quality operating mode. It also re-derives the effective CPU-used preset from the current EncoderOptions.CpuUsed, since the realtime path interprets that value differently than good/best quality.

func (*VP8Encoder) SetFrameDropAllowed

func (e *VP8Encoder) SetFrameDropAllowed(enabled bool) error

SetFrameDropAllowed enables or disables realtime rate-control frame dropping without touching bitrate. When enabling, the drop watermark defaults to EncoderOptions.DropFrameWaterMark or 60 if that is zero.

func (*VP8Encoder) SetGFCBRBoostPct

func (e *VP8Encoder) SetGFCBRBoostPct(pct int) error

SetGFCBRBoostPct changes the golden-frame boost percentage applied in CBR mode. Non-negative percentages are accepted. See EncoderOptions.GFCBRBoostPct.

func (*VP8Encoder) SetKeyFrameInterval

func (e *VP8Encoder) SetKeyFrameInterval(frames int) error

SetKeyFrameInterval changes the maximum GOP distance in frames. Zero disables interval-forced key frames; content-driven and explicitly forced key frames are unaffected. See EncoderOptions.KeyFrameInterval.

func (*VP8Encoder) SetMaxIntraBitratePct

func (e *VP8Encoder) SetMaxIntraBitratePct(pct int) error

SetMaxIntraBitratePct caps key-frame size as a percentage of the per-frame target. Zero disables the cap. See EncoderOptions.MaxIntraBitratePct.

func (*VP8Encoder) SetNoiseSensitivity

func (e *VP8Encoder) SetNoiseSensitivity(level int) error

SetNoiseSensitivity changes the VP8 denoiser level. Valid range is [0, 6]: 0 disables and tears down the denoiser; 1 denoises luma only; 2..6 denoise luma and chroma with increasing aggressiveness. See EncoderOptions.NoiseSensitivity.

func (*VP8Encoder) SetROIMap

func (e *VP8Encoder) SetROIMap(m *ROIMap) error

SetROIMap installs a libvpx-style region-of-interest map. ROI segmentation applies to key and inter frames and takes precedence over cyclic refresh while enabled. Pass nil, Enabled=false, nil SegmentID, or all-zero DeltaQuantizer/DeltaLoopFilter/StaticThreshold values to disable ROI.

func (*VP8Encoder) SetRTCExternalRateControl

func (e *VP8Encoder) SetRTCExternalRateControl(enabled bool) error

SetRTCExternalRateControl enables or disables libvpx's VP8 RTC external-rate-control mode. Enabling it disables cyclic refresh and post-encode overshoot recode while keeping rate-correction-factor updates active. See EncoderOptions.RTCExternalRateControl.

func (*VP8Encoder) SetRateControl

func (e *VP8Encoder) SetRateControl(cfg RateControlConfig) error

SetRateControl replaces the encoder's runtime-updatable rate-control configuration in a single atomic update. Validation is all-or-nothing: when any field is out of range no state changes and the error is returned. Use this instead of multiple Set* calls when several fields change together (mode + bitrate, quantizer bounds, buffer model).

func (*VP8Encoder) SetRealtimeTarget

func (e *VP8Encoder) SetRealtimeTarget(target RealtimeTarget) error

SetRealtimeTarget applies a WebRTC-style runtime target update.

Zero-valued fields keep their current setting, so bandwidth-estimator updates are safe to send as bitrate-only deltas. Width and Height, when both positive and different from the encoder's current dimensions, trigger a runtime resolution change: every size-dependent buffer is re-sized (reusing capacity where possible), all reference frames are invalidated, and the next encoded frame is forced to be a key frame at the new size. Mirrors libvpx's `vpx_codec_enc_config_set` with a new width / height. The libvpx spatial resampler ([VP8E_SET_SCALEMODE], `rc_resize_*`) is not implemented; callers drive the coded size directly. The decoder also handles key-frame resolution change; see [DecoderOptions.RejectResolutionChange].

Returns ErrInvalidConfig for negative numeric fields, an out-of-range FrameDrop selector, or a Width / Height pair that does not satisfy VP8 dimension limits. Resize is also rejected with ErrInvalidConfig when the lookahead queue is non-empty or a hidden alt-ref input is staged; drain the encoder with VP8Encoder.FlushInto before resizing in those modes. Returns ErrInvalidQuantizer when MinQuantizer or MaxQuantizer is outside [0, 63] or when both are non-zero and MinQuantizer > MaxQuantizer. On any validation failure the encoder state is left untouched at the previous configuration.

func (*VP8Encoder) SetReferenceFrame

func (e *VP8Encoder) SetReferenceFrame(ref ReferenceFrame, src Image) error

SetReferenceFrame replaces ref with src. ref must be ReferenceLast, ReferenceGolden, or ReferenceAltRef; src must match the encoder dimensions and provide valid I420 strides. The encoder pads coded edges, extends borders, and invalidates cached inter-prediction state tied to the previous reference identity.

Returns ErrClosed on a nil or closed encoder, or ErrInvalidConfig when ref is not a single valid selector or src does not match the encoder's shape or strides.

func (*VP8Encoder) SetScreenContentMode

func (e *VP8Encoder) SetScreenContentMode(mode int) error

SetScreenContentMode changes the libvpx-style screen-content mode: 0 = off, 1 = on, 2 = on with more aggressive rate control. See EncoderOptions.ScreenContentMode.

func (*VP8Encoder) SetSharpness

func (e *VP8Encoder) SetSharpness(sharpness int) error

SetSharpness changes the VP8 loop-filter sharpness level. Valid range is [0, 7]. See EncoderOptions.Sharpness.

func (*VP8Encoder) SetStaticThreshold

func (e *VP8Encoder) SetStaticThreshold(threshold int) error

SetStaticThreshold changes the static-macroblock breakout threshold. Non-negative values are accepted; zero disables the breakout. See EncoderOptions.StaticThreshold.

func (*VP8Encoder) SetTemporalLayerID

func (e *VP8Encoder) SetTemporalLayerID(layerID int) error

SetTemporalLayerID overrides the temporal layer assigned by the configured scheduling pattern. The override is sticky and applies to every subsequent frame until it is changed or the pattern is replaced by SetTemporalScalability. layerID must be in [0, TemporalLayerCount).

func (*VP8Encoder) SetTemporalScalability

func (e *VP8Encoder) SetTemporalScalability(cfg TemporalScalabilityConfig) error

SetTemporalScalability replaces the active temporal scheduling configuration. Set TemporalScalabilityConfig.Enabled = false (the zero value) to disable temporal layering. The per-layer bitrate vector must be cumulative across layers, matching libvpx's ts_target_bitrate[].

func (*VP8Encoder) SetTokenPartitions

func (e *VP8Encoder) SetTokenPartitions(partitions int) error

SetTokenPartitions changes the VP8 token-partition selector: 0 = one partition, 1 = two, 2 = four, 3 = eight. See EncoderOptions.TokenPartitions.

func (*VP8Encoder) SetTuning

func (e *VP8Encoder) SetTuning(tuning Tuning) error

SetTuning changes the encoder's visual quality model. TuneSSIM rebuilds the activity-mask cache on the next encode; TunePSNR releases it. See EncoderOptions.Tuning.

func (*VP8Encoder) SetTwoPassStats

func (e *VP8Encoder) SetTwoPassStats(stats []FirstPassFrameStats) error

SetTwoPassStats replaces the finalized first-pass stats used for second-pass VBR planning. Pass the slice produced by FinalizeFirstPassStats after collecting per-frame records with VP8Encoder.CollectFirstPassStats. Passing nil or an empty slice disables two-pass planning on subsequent EncodeInto calls.

Source Files

Directories

Path Synopsis
cmd
govpx-bench command
govpx-oracle command
scoreboard-report command
scoreboard-report runs the govpx scoreboard tests via `go test -json` and renders a clean per-test summary plus the reference baseline JSON for each scoreboard, instead of the raw verbose go-test output.
scoreboard-report runs the govpx scoreboard tests via `go test -json` and renders a clean per-test summary plus the reference baseline JSON for each scoreboard, instead of the raw verbose go-test output.
internal
coracle
Package coracle hosts the libvpx oracle helpers and trace comparator.
Package coracle hosts the libvpx oracle helpers and trace comparator.
cpu
Package cpu exposes a small set of runtime CPU feature flags used by the SIMD dispatch helpers in internal/vp8/dsp.
Package cpu exposes a small set of runtime CPU feature flags used by the SIMD dispatch helpers in internal/vp8/dsp.

Jump to

Keyboard shortcuts

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