Real Lossless Codec
Jump to navigation
Jump to search
- FOURCCs: ralf
- Company: RealNetworks
- Samples: http://samples.mplayerhq.hu/A-codecs/lossless/ (luckynight.rmvb)
This is RealNetworks lossless audio codec.
Audio header in rm files is different from other Real audio codecs; the interface of the binary decoder is also different.
Extradata format
Numbers are stored big-endian.
bytes 0- 3 - codec FOURCC, always "LSD:" bytes 4- 5 - version bytes 8- 9 - number of channels bytes 10-11 - bits per sample bytes 12-15 - sampling rate bytes 16-19 - block size in samples? bytes 20-23 - ignored?
Known decoder support only 1/2 channel 16-bit audio with sampling rate up to 96 kHz.
Frame format
Data is read MSB.
Block header
get frame length code if (stereo) decoding_mode = get_bits(2) + 1; else decoding_mode = 0;
Frame length code:
64 - 11110 128 - 11111 256 - 1110 512 - 110 1024 - 10 2048 - 0
Decoding mode specifies table sets, bits and channel recombining:
Mode | tableset1 | bits1 | tableset2 | bits2 | Channel decoupling |
---|---|---|---|---|---|
0 | 0 | 16 | n/a | n/a | mono |
1 | 0 | 16 | 0 | 16 | L, R |
2 | 0 | 16 | 2 | 17 | L+R, R |
3 | 1 | 16 | 2 | 17 | L, R-L |
4 | 2 | 17 | 2 | 17 | (L+R)/2, (L-R)/2 |