hdr

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: 2 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 hdr reads and writes the metadata HDR10 and HDR10+ video carries beside its pictures: the mastering display colour volume and content light level (static, SMPTE ST 2086 and CTA-861.3), and HDR10+'s dynamic metadata (SMPTE ST 2094-40, as an ITU-T T.35 message). In HEVC they are SEI messages; in AV1, metadata OBUs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AV1StaticOBUs

func AV1StaticOBUs(s Static) []byte

AV1StaticOBUs are metadata OBUs carrying the static metadata.

func AV1T35OBU

func AV1T35OBU(t35 []byte) []byte

AV1T35OBU is a metadata OBU carrying a T.35 payload (HDR10+).

func HDR10PlusPeak added in v0.14.0

func HDR10PlusPeak(t35 []byte) (nits float64, ok bool)

HDR10PlusPeak is the brightest a scene's pixels are, in cd/m², as its HDR10+ metadata (a T.35 payload, SMPTE ST 2094-40) gives it: the first window's largest maxscl. ok is false when the payload says nothing.

func HEVCStaticSEI

func HEVCStaticSEI(s Static) []byte

HEVCStaticSEI is a prefix SEI NAL unit (without start code) carrying the static metadata, or nil when there is none.

func HEVCT35SEI

func HEVCT35SEI(t35 []byte) []byte

HEVCT35SEI is a prefix SEI NAL unit carrying a T.35 payload (HDR10+).

func IsHDR10Plus

func IsHDR10Plus(t35 []byte) bool

IsHDR10Plus reports whether a T.35 payload is HDR10+ metadata.

Types

type HEVCMetadata

type HEVCMetadata struct {
	Static Static
	// HDR10Plus is the T.35 payload of HDR10+ metadata for this picture,
	// nil when there is none.
	HDR10Plus []byte
}

HEVCMetadata is what an access unit's SEI carries.

func ParseHEVC

func ParseHEVC(au []byte) HEVCMetadata

ParseHEVC reads the HDR metadata from an HEVC access unit's prefix SEI NAL units (Annex B).

type LightLevel

type LightLevel struct {
	MaxCLL, MaxFALL uint16
}

LightLevel is the content light level: the brightest pixel (MaxCLL) and the brightest frame average (MaxFALL), in cd/m².

type Mastering

type Mastering struct {
	// Primaries are green, blue and red (the SEI's order), each x then y.
	Primaries  [3][2]uint16
	WhitePoint [2]uint16
	MaxLuma    uint32
	MinLuma    uint32
}

Mastering is the mastering display's colour volume, in the units the SEI uses: chromaticities in 0.00002, luminance in 0.0001 cd/m².

type Static

type Static struct {
	Mastering *Mastering
	Light     *LightLevel
}

Static is a stream's static HDR metadata; a nil field is absent.

func (Static) Empty

func (s Static) Empty() bool

Empty reports whether there is none.

Jump to

Keyboard shortcuts

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