Documentation
¶
Index ¶
- func DecodeFrame(data []byte, info streaminfo.StreamInfo) (*flac.Frame, error)
- func DecodeResidual(r *bits.Reader, blockSize, predictorOrder int) ([]int64, error)
- func DecodeResidualInto(r *bits.Reader, residual []int64, blockSize, predictorOrder int) error
- func DecodeSubframe(r *bits.Reader, samples []int64, bitsPerSample int) error
- func Decorrelate(samples [][]int64, assignment uint8)
- type Decoder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeFrame ¶
func DecodeFrame(data []byte, info streaminfo.StreamInfo) (*flac.Frame, error)
func DecodeResidual ¶
DecodeResidual reads a FLAC residual coding block. Structural validity checks here (reserved coding method, partition math, decoded size) are FLAC-spec requirements and always return an error. The per-sample reads inside each partition are the hot path, so they use the Fast tier (no per-call error); a truncated stream in that inner loop surfaces later via Reader.Overrun() rather than aborting this function early.
func DecodeResidualInto ¶
func Decorrelate ¶
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
func NewDecoder ¶
func NewDecoder(stream media.StreamInfo, cfg config.DecoderConfig, pool *registry.WorkerPool) *Decoder
NewDecoder builds a decoder. pool may be nil, in which case packets are decoded synchronously; otherwise it must be a pool this decoder is allowed to submit work to for its entire lifetime (the caller retains ownership and is responsible for closing it once every stage sharing it has finished).
func (*Decoder) Close ¶
Close stops accepting further work without releasing pending frames. It does not close the pool: that is shared with other stages and owned by whoever constructed this decoder. Safe whether or not Flush ran first, and safe to call more than once.
func (*Decoder) OutputReady ¶
func (d *Decoder) OutputReady() <-chan struct{}