Documentation
¶
Overview ¶
Package ref is a CPU PyroWave encoder and decoder in float32, the reference the GPU kernels are tested against. It follows the same steps as the shaders, in the same order, so their outputs agree up to floating point rounding.
Index ¶
Constants ¶
const ( // MaxDrop is the most bit-planes rate control drops from a block; a drop // of MaxDrop removes the block. MaxDrop = 16 NumBuckets = 128 )
Rate control constants shared with the shaders.
Variables ¶
var ( BT709 = Matrix{0.2126, 0.0722} BT2020 = Matrix{0.2627, 0.0593} )
Functions ¶
func Bucket ¶
Bucket maps the distortion added per word saved to a log-scale bucket, about 1.5 dB apart.
Types ¶
type Decoder ¶
type Decoder struct {
L *pyrowave.Layout
// Header is the sequence header of the last frame decoded.
Header pyrowave.SequenceHeader
// contains filtered or unexported fields
}
Decoder is the CPU reference decoder.
func (*Decoder) DecodeRecords ¶
DecodeRecords decodes block records laid end to end, as Encoder.Encode returns them, without chunk framing.
type Encoder ¶
type Encoder struct {
L *pyrowave.Layout
Matrix Matrix
Header pyrowave.SequenceHeader
// Coefs[c][level][kind] holds every band, LL of each level included.
Coefs [3][pyrowave.Levels][4][]float32
// Drops is each block's dropped plane count from the last Encode.
Drops []int
// contains filtered or unexported fields
}
Encoder is the CPU reference encoder.
type Image ¶
Image is a picture as three planes of samples in [0,1], each the size of the visible picture (chroma at half size under 4:2:0).
func FromRGB ¶
FromRGB builds an image from a full-range RGB sampler; 4:2:0 chroma is the mean of each 2x2 quad (centre siting).