pub enum Lacer {
Xiph,
FixedSize,
Ebml,
}Expand description
Handler for lacing and delacing operations on frame data.
Variants§
Xiph
Xiph lacing (variable-size frames with size prefixes)
The Xiph lacing uses the same coding of size as found in the Ogg container [@?RFC3533]. The bits 5-6 of the Block Header flags are set to 01. The Block data with laced frames is stored as follows: Lacing Head on 1 Octet: Number of frames in the lace minus 1. Lacing size of each frame except the last one. Binary data of each frame consecutively. The lacing size is split into 255 values, stored as unsigned octets – for example, 500 is coded 255;245 or [0xFF 0xF5]. A frame with a size multiple of 255 is coded with a 0 at the end of the size – for example, 765 is coded 255;255;255;0 or [0xFF 0xFF 0xFF 0x00]. The size of the last frame is deduced from the size remaining in the Block after the other frames.
FixedSize
Fixed-size lacing (all frames have the same size)
Ebml
EBML lacing (variable-size frames with EBML-encoded sizes)
The EBML lacing encodes the frame size with an EBML-like encoding [@!RFC8794]. The bits 5-6 of the Block Header flags are set to 11.
The Block data with laced frames is stored as follows: Lacing Head on 1 Octet: Number of frames in the lace minus 1. Lacing size of each frame except the last one. Binary data of each frame consecutively.
The first frame size is encoded as an EBML Variable-Size Integer value, also known as VINT in [@!RFC8794]. The remaining frame sizes are encoded as signed values using the difference between the frame size and the previous frame size. These signed values are encoded as VINT, with a mapping from signed to unsigned numbers. Decoding the unsigned number stored in the VINT to a signed number is done by subtracting 2^((7*n)-1)-1, where n is the octet size of the VINT.