config

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultEncoderBlockSize     = 4096
	DefaultEncoderMaxFixedOrder = 4
	DefaultEncoderMaxLPCOrder   = 32
	DefaultEncoderMaxRiceOrder  = 8
	DefaultLPCPrecision         = 15
)
View Source
const (
	MinPresetLevel = 0
	MaxPresetLevel = 23
)

Variables

View Source
var DefaultDecoderConfig = DecoderConfig{
	Strict: false,
}
View Source
var DefaultEncoderConfig = GetPreset(12)

Functions

This section is empty.

Types

type BlockSplitMode

type BlockSplitMode string
const (
	BlockSplitEstimated BlockSplitMode = "estimated"
	BlockSplitExact     BlockSplitMode = "exact"
)

func (BlockSplitMode) Valid

func (v BlockSplitMode) Valid() bool

type DecoderConfig

type DecoderConfig struct {
	Strict bool `name:"strict" help:"Enable strict decoding mode"`
}

type EncoderConfig

type EncoderConfig struct {

	// Compression parameters.
	BlockSize             int             `name:"block-size" help:"FLAC block size in samples"`
	MaxFixedOrder         int             `name:"max-fixed-order" help:"Maximum fixed predictor order"`
	MaxLPCOrder           int             `name:"max-lpc-order" help:"Maximum LPC predictor order"`
	MaxRicePartitionOrder int             `name:"max-rice-partition-order" help:"Maximum Rice partition order"`
	LPCPrecision          int             `name:"lpc-precision" help:"LPC coefficient precision"`
	EnablePrecisionSearch bool            `name:"precision-search" help:"Enable LPC precision search"`
	EnableWastedBits      bool            `name:"wasted-bits" help:"Enable wasted-bits optimization"`
	StereoMode            StereoMode      `name:"stereo-mode" help:"Stereo coding mode"`
	FixedOrderSearch      OrderSearchMode `name:"fixed-order-search" help:"Fixed predictor order search"`
	LPCOrderSearch        OrderSearchMode `name:"lpc-order-search" help:"LPC predictor order search"`
	RiceCost              RiceCostMode    `name:"rice-cost" help:"Rice parameter cost mode"`
	Apodizations          []flac.Apodization
	BlockSplitDepth       int            `name:"block-split-depth" help:"Block split depth"`
	BlockSplitMode        BlockSplitMode `name:"block-split-mode" help:"Block split strategy"`
	StreamableSubset      bool           `name:"streamable-subset" help:"Restrict output to the FLAC streamable subset"`
	// contains filtered or unexported fields
}

func GetPreset

func GetPreset(level int) EncoderConfig

func MergeEncoderConfigForFactory

func MergeEncoderConfigForFactory(cfg EncoderConfig, stream media.StreamInfo) EncoderConfig

func (EncoderConfig) BitsPerSample

func (c EncoderConfig) BitsPerSample() int

func (EncoderConfig) Channels

func (c EncoderConfig) Channels() int

func (EncoderConfig) SampleRate

func (c EncoderConfig) SampleRate() int

func (EncoderConfig) Validate

func (c EncoderConfig) Validate() error

type OrderSearchMode

type OrderSearchMode string

OrderSearchMode controls how predictor orders are selected. Estimated mode only narrows candidates; emitted frames and their final costs stay exact.

const (
	OrderSearchEstimated  OrderSearchMode = "estimated"
	OrderSearchExhaustive OrderSearchMode = "exhaustive"
)

func (OrderSearchMode) Valid

func (v OrderSearchMode) Valid() bool

type RiceCostMode

type RiceCostMode string

RiceCostMode controls Rice parameter selection. Estimated mode only selects parameters approximately; the selected coding is always costed exactly.

const (
	RiceCostEstimated RiceCostMode = "estimated"
	RiceCostExact     RiceCostMode = "exact"
)

func (RiceCostMode) Valid

func (v RiceCostMode) Valid() bool

type StereoMode

type StereoMode string
const (
	StereoIndependent StereoMode = "independent"
	StereoAdaptive    StereoMode = "adaptive"
	StereoExhaustive  StereoMode = "exhaustive"
)

func (StereoMode) Valid

func (v StereoMode) Valid() bool

Jump to

Keyboard shortcuts

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