Apple Lossless Audio Coding: Difference between revisions

From MultimediaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 15: Line 15:
| ??? || 12 || ???
| ??? || 12 || ???
|-
|-
| hassize || 1 || the output sample number is stored in the header
| hasoutputsamples || 1 || the number of samples is stored in the header
|-
|-
| wasted_bytes || 2 || unknow (same as flac ???)
| wasted_bytes || 2 || unknow (same as flac ???)
Line 27: Line 27:
| } || ||
| } || ||
|}
|}
=== Verbatim frame ===
{| border="1"
! Syntax !! Number of bits !! Semantics
|-
| data || sample_size * outputsamples * channels || Unencoded subblock
|}
=== Compressed frame ===
{| border="1"
! Syntax !! Number of bits !! Semantics
|-
| interlacing_shift || 8 || 0 if no channel interlacing.
|-
| interlacing_leftweight || 8 ||
|-
| for each channel {
|-
| prediction_type || 4 || should be 0
|-
| prediction_quantitization || 4 ||
|-
| ricemodifier || 3 ||
|-
| predictor_coef_num || 5 ||
|-
| predictor_coef_table || 16 * predictor_coef_num ||
|-
| bastardized_rice_decompressed data || ||
|-
| }
|}
Channel Interlacing
It is a mid/side stereo with weight.
channel 0 is the mid(average) channel, channel 1 is the side(difference) channel.
:''right = mid - ((difference * interlacing_leftweight) >> interlacing_shift)''
:''left = right + difference''


[[Category:Lossless Audio Codecs]]
[[Category:Lossless Audio Codecs]]
[[Category:Audio Codecs]]
[[Category:Audio Codecs]]

Revision as of 10:43, 14 May 2006

Lossless audio coding using linear prediction with Golomb-Rice coding of the difference. Similar to FLAC, although the bitstreams are not compatible. Usually stored in an MP4 container, as a private extension since it is not part of the MPEG-4 standard.

Frame Header

Syntax Number of bits Semantics
channels 3 Number of channel -1 (Should be the same than in extradata ???)
??? 4 ???
??? 12 ???
hasoutputsamples 1 the number of samples is stored in the header
wasted_bytes 2 unknow (same as flac ???)
isverbatim 1 if 1, the data is not compressed
if (hassize) {
outputsamples 32 number of samples
}

Verbatim frame

Syntax Number of bits Semantics
data sample_size * outputsamples * channels Unencoded subblock

Compressed frame

Syntax Number of bits Semantics
interlacing_shift 8 0 if no channel interlacing.
interlacing_leftweight 8
for each channel {
prediction_type 4 should be 0
prediction_quantitization 4
ricemodifier 3
predictor_coef_num 5
predictor_coef_table 16 * predictor_coef_num
bastardized_rice_decompressed data
}

Channel Interlacing

It is a mid/side stereo with weight. channel 0 is the mid(average) channel, channel 1 is the side(difference) channel.

right = mid - ((difference * interlacing_leftweight) >> interlacing_shift)
left = right + difference