encoder

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: BSD-2-Clause Imports: 21 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

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrConfig    = errors.New("go264/encoder: invalid configuration")
	ErrFrameSize = errors.New("go264/encoder: frame does not match the configured size")
)

Functions

This section is empty.

Types

type AQMode added in v1.10.0

type AQMode uint8
const (
	AQOff AQMode = iota
	AQVariance
)

type Config

type Config struct {
	Width   int
	Height  int
	FPSNum  int
	FPSDen  int
	GOPSize int
	QP      int

	BitrateKbps int
	RefFrames   int
	BFrames     int

	LongTermReferences int

	CABAC         bool
	MotionSearch  MotionSearch
	ModeDecision  ModeDecision
	Slices        int
	Transform8x8  bool
	ScalingMatrix ScalingMatrix
	Trellis       bool

	WeightedPrediction WeightedPrediction
	DirectMode         DirectMode

	IntraRefresh        int
	RepeatParameterSets bool

	Deblocking         DeblockMode
	DeblockAlphaOffset int
	DeblockBetaOffset  int

	VBVBufferKbits int
	VBVMaxrateKbps int
	CBR            bool

	RateFactor float64
	QComp      float64
	IPRatio    float64
	PBRatio    float64

	AQMode     AQMode
	AQStrength float64
}

type DeblockMode added in v1.2.0

type DeblockMode uint8
const (
	DeblockingOn DeblockMode = iota
	DeblockingOff
	DeblockingNotAcrossSlices
)

type DirectMode added in v1.3.0

type DirectMode uint8
const (
	DirectSpatial DirectMode = iota
	DirectTemporal
)

type Encoder

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

func New

func New(cfg Config) (*Encoder, error)

func (*Encoder) Encode

func (e *Encoder) Encode(yuv []byte) ([]byte, error)

func (*Encoder) EncodeWithHints added in v1.1.0

func (e *Encoder) EncodeWithHints(yuv []byte, h Hints) ([]byte, error)

func (*Encoder) Flush added in v1.2.0

func (e *Encoder) Flush() ([]byte, error)

func (*Encoder) ForceKeyFrame added in v1.1.0

func (e *Encoder) ForceKeyFrame()

func (*Encoder) Headers

func (e *Encoder) Headers() ([]byte, error)

func (*Encoder) PPS

func (e *Encoder) PPS() *syntax.PPS

func (*Encoder) SPS

func (e *Encoder) SPS() *syntax.SPS

type Hints added in v1.1.0

type Hints struct {
	Changed []image.Rectangle
	Regions []Region
}

type ModeDecision added in v1.2.0

type ModeDecision uint8
const (
	ModeDecisionFast ModeDecision = iota
	ModeDecisionExhaustive
)

type MotionSearch added in v1.1.0

type MotionSearch uint8
const (
	MotionSearchFull MotionSearch = iota
	MotionSearchZero
	MotionSearchHalf
	MotionSearchInteger
)

type Region added in v1.1.0

type Region struct {
	Rect image.Rectangle
	Kind RegionKind
}

type RegionKind added in v1.1.0

type RegionKind uint8
const (
	RegionUnknown RegionKind = iota
	RegionFill
	RegionText
	RegionImage
)

type ScalingMatrix added in v1.2.0

type ScalingMatrix uint8
const (
	ScalingMatrixFlat ScalingMatrix = iota
	ScalingMatrixJVT
)

type WeightedPrediction added in v1.3.0

type WeightedPrediction uint8
const (
	WeightedPredictionOff WeightedPrediction = iota
	WeightedPredictionExplicit
	WeightedPredictionImplicit
)

Jump to

Keyboard shortcuts

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