vc1

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: 3 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 vc1 decodes SMPTE 421M (VC-1) Advanced Profile video in Go: progressive, interlaced frame and interlaced field pictures, 4:2:0 8-bit, as Blu-ray and HD DVD carry it. It is a fallback where no GPU decodes a disc's VC-1.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decoder

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

Decoder decodes a VC-1 Advanced Profile elementary stream, access unit by access unit (each a frame: its start codes and their units).

func New

func New() *Decoder

New makes a decoder.

func (*Decoder) Decode

func (d *Decoder) Decode(au []byte, pts int64, out func(*Picture) error) error

Decode decodes an access unit given at pts, giving out the pictures that are complete, in display order.

func (*Decoder) Errors

func (d *Decoder) Errors() int

Errors is how many pictures or slices could not be decoded (and were concealed by what was there).

func (*Decoder) Flush

func (d *Decoder) Flush(out func(*Picture) error) error

Flush gives out the last reference frame.

type Picture

type Picture struct {
	Width, Height    int
	Y, Cb, Cr        []byte
	StrideY, StrideC int
	PTS              int64
	// Interlaced frames' fields are of two moments, TopFieldFirst says
	// which comes first.
	Interlaced, TopFieldFirst bool
	// FrameRateNum and FrameRateDen are the sequence's frame rate (0 when
	// it does not say).
	FrameRateNum, FrameRateDen int
	// Primaries, Transfer and Matrix are the sequence's colour description
	// (H.273 code points; 2, unspecified, when there is none).
	Primaries, Transfer, Matrix int
}

Picture is a decoded frame, in display order: 8-bit 4:2:0 planes, the coded size of a larger buffer.

Jump to

Keyboard shortcuts

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