vmaf

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: Apache-2.0 Imports: 11 Imported by: 0 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

Overview

Package vmaf measures a distorted video against its reference as Netflix's VMAF does: libvmaf's integer feature extractors (VIF at four scales, ADM, motion) ported to Go, and its v0.6.1 models (the 1080p one, and the 4K one for pictures above 1080 lines). The ports follow libvmaf's arithmetic step for step, so the features and the score are the ones its vmaf tool gives.

libvmaf is Netflix's, under the BSD+Patent license, a copy of which is in LICENSE.libvmaf.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PSNR

func PSNR(ref, dis Frame) float64

PSNR is the luma's peak signal-to-noise ratio, in dB, as libvmaf's psnr feature gives it (psnr_y): the peak the depth's largest value, at most 6 dB a bit plus 12 (what identical pictures get).

func SSIM

func SSIM(ref, dis Frame) float64

SSIM is the SSIM index of a distorted picture against its reference.

Types

type Frame

type Frame struct {
	W, H, BPC int
	Y         []uint16
}

Frame is a picture's luma: W x H samples of BPC bits (8 to 16), one row after another.

type Model

type Model struct {
	Name string

	// Transform applies the model's score transform (libvmaf's
	// enable_transform), which its tool leaves off unless asked.
	Transform bool
	// contains filtered or unexported fields
}

Model is a VMAF model.

func ModelFor

func ModelFor(h int) (*Model, error)

ModelFor is the model for pictures h lines high: the 4K one above 1080 lines, else the 1080p one.

func (*Model) Predict

func (m *Model) Predict(features map[string]float64) float64

Predict is the score of a picture's features, by name.

type Pooled

type Pooled struct {
	Mean, Harmonic, Min, P1 float64
}

Pooled is a measure over a video: its mean, its harmonic mean (VMAF's usual pooling for a single number weighs the bad pictures more), the worst picture's and the 1st percentile's (from the worst).

func Pool

func Pool(v []float64) Pooled

Pool pools a measure of the pictures.

type Score

type Score struct {
	VMAF    float64
	PSNR    float64 // luma, dB
	SSIM    float64
	ADM2    float64
	Motion2 float64
	VIF     [4]float64
}

Score is a picture's measures.

type Scorer

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

Scorer measures a distorted video against its reference, a picture pair at a time, on every CPU: the pictures are measured as they come, VMAF once the next picture's motion is known (Scores).

func NewScorer

func NewScorer(h int) (*Scorer, error)

NewScorer starts measuring pictures h lines high (the model chosen by the height).

func (*Scorer) Add

func (s *Scorer) Add(ref, dis Frame)

Add measures the next picture pair. The pictures must not change after (they are read meanwhile, and the reference is the next's previous).

func (*Scorer) Scores

func (s *Scorer) Scores() []Score

Scores waits for the pictures' measures and gives them, VMAF included; the Scorer is done.

Jump to

Keyboard shortcuts

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