Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Small Block Audio Compression
- * Goal is for a simple hardware-decodable audio codec.
- * Should allow random access to compressed audio samples.
- ** Random access disallows any dependency on prior sample values.
- Small Block 1:
- * Encodes 16 PCM samples into 32 bits (2 bits/sample).
- * ( 5: 0): Line Start (S.E3.F2)
- * (11: 6): Line End (S.E3.F2)
- * (15:12): Line Sigma ( E3.F1)
- * (31:16): Sample Selector Bits
- To decode a sample, linearly interpolate between the start and end value. The start and end values represent a line segment.
- The Sigma will represent a distance above or below this line segment, which will be either added or subtracted from the interpolated value (based on the selector bit) to get the result.
- For each selector Bit:
- * 0: V=Pred-Sigma
- * 1: V=Pred+Sigma
- Small Block 2:
- * Encodes 16 PCM samples into 64 bits (4 bits/sample).
- * ( 7: 0): Line Start (S.E3.F4)
- * (15: 8): Line End (S.E3.F4)
- * (23:16): Line Sigma (Z.E3.F4)
- * (31:24): Reserved (Zero)
- * (63:32): Sample Selector Bits
- This is based on a similar premise for Format 1, just with higher endpoint fidelity.
- While one "could" make the endpoint values bigger here, this doesn't actually gain much in terms of quality.
- The interpolation values will also be 2-bits / sample:
- * 00: Small Negative (-0.333 * Sigma)
- * 01: Large Negative (-1.000 * Sigma)
- * 10: Small Positive (+0.333 * Sigma)
- * 11: Large Positive (+1.000 * Sigma)
- Endpoints are encoded as a microfloat value which expands into a 12-bit integer format (PCM):
- 0: 00000000xxxx
- 1: 00000001xxxx
- 2: 0000001xxxx0
- 3: 000001xxxx00
- 4: 00001xxxx000
- 5: 0001xxxx0000
- 6: 001xxxx00000
- 7: 01xxxx000000
- Negative values will invert the value of the decoded sample.
- The smaller variants are similar, just with fewer fractional bits.
- Interpolation and other calculations will be performed in terms of PCM values.
- An encoder should ensure that decoded values will not go out of range.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement