The bits-per-sample bits in the frame header must be 001-110.
@@ -471,7 +471,7 @@
<36>
|
- Total samples in stream. 'Samples' means channel-wide sample, i.e. one second of 44.1Khz audio will have 44100 samples regardless of the number of channels. A value of zero here means the number of total samples is unknown.
+ Total samples in stream. 'Samples' means inter-channel sample, i.e. one second of 44.1Khz audio will have 44100 samples regardless of the number of channels. A value of zero here means the number of total samples is unknown.
|
@@ -578,6 +578,14 @@
Zero-padding to byte alignment.
+
+ |
+ FRAME_FOOTER
+ |
+
+
+ |
+
@@ -592,33 +600,24 @@
|
- <9>
+ <14>
|
- sync code '111111110'
+ Sync code '11111111111110'
|
|
- <3>
+ <2>
|
- block size in channel-wide samples:
+ Reserved:
-
- 000 : get from STREAMINFO metadata block
+ 00 : mandatory value
-
- 001 : 192 samples
-
- -
- 010-101 : 576 * (2^(n-2)) samples, i.e. 576/1152/2304/4608
-
- -
- 110 : get 8 bit (blocksize-1) from end of header
-
- -
- 111 : get 16 bit (blocksize-1) from end of header
+ 01-11 : reserved for future use
|
@@ -628,7 +627,35 @@
<4>
- sample rate:
+ Block size in inter-channel samples:
+
+ -
+ 0000 : get from STREAMINFO metadata block
+
+ -
+ 0001 : 192 samples
+
+ -
+ 0010-0101 : 576 * (2^(n-2)) samples, i.e. 576/1152/2304/4608
+
+ -
+ 0110 : get 8 bit (blocksize-1) from end of header
+
+ -
+ 0111 : get 16 bit (blocksize-1) from end of header
+
+ -
+ 1000-1111 : 256 * (2^(n-8)) samples, i.e. 256/512/1024/2048/4096/8192/16384/32768
+
+
+ |
+
+
+ |
+ <4>
+ |
+
+ Sample rate:
-
0000 : get from STREAMINFO metadata block
@@ -680,7 +707,7 @@
<4>
|
- channel assignment
+ Channel assignment
-
0000-0111 : (number of independent channels)-1. when == 0001, channel 0 is the left channel and channel 1 is the right
@@ -705,7 +732,7 @@
<3>
|
- sample size in bits:
+ Sample size in bits:
-
000 : get from STREAMINFO metadata block
@@ -739,7 +766,7 @@
<1>
|
- zero bit padding, to prevent sync-fooling string of 1s
+ Zero bit padding, to prevent sync-fooling string of 1s
|
@@ -776,7 +803,7 @@
<8>
|
- CRC-8 (polynomial = x^8 + x^2 + x + 1) of everything before the crc, including the sync code
+ CRC-8 (polynomial = x^8 + x^2 + x^1 + x^0, initialized with 0) of everything before the crc, including the sync code
|
@@ -786,7 +813,7 @@
NOTES
-
- The blocksize bits 000-101 may only be used if the blocksize is fixed throughout the entire stream. Blocksize bits 110-111 may be used in any case but the decoder will have to pessimistically guess that it is a variable-blocksize stream. There is only one special case: the encoder may use blocksize bits 110-111 on the last frame of a fixed-blocksize stream, as long as the blocksize is not greater than the stream blocksize.
+ The blocksize bits 0000-0101 and 1000-1111 may only be used if the blocksize is fixed throughout the entire stream. Blocksize bits 0110-0111 may be used in any case but the decoder will have to pessimistically guess that it is a variable-blocksize stream. There is only one special case: the encoder may use blocksize bits 0110-0111 on the last frame of a fixed-blocksize stream, as long as the blocksize is not greater than the stream blocksize.
-
The "UTF-8" coding used for the sample/frame number is the same variable length code used to store compressed UCS-2, extended to handle larger input.
@@ -798,6 +825,26 @@
+
+
+
+
+ |
+ FRAME_FOOTER
+ |
+
+
+ |
+ <16>
+ |
+
+ CRC-16 (polynomial = x^16 + x^15 + x^2 + x^0, initialized with 0) of everything before the crc, back to and including the frame header sync code
+ |
+
+
+ |
+
+
@@ -836,41 +883,58 @@
|
- <8>
+ <1>
+ |
+
+ Zero bit padding, to prevent sync-fooling string of 1s
+ |
+
+
+ |
+ <6>
|
Subframe type:
|
+
+ |
+ <1+k>
+ |
+
+ 'Wasted bits-per-sample' flag:
+
+ -
+ 0 : no wasted bits-per-sample in source subblock, k=0
+
+ -
+ 1 : k wasted bits-per-sample in source subblock, k-1 follows, unary coded; i.e. k=3 => 001 follows, k=7 => 0000001 follows.
+
+ |
+
|
@@ -944,7 +1008,7 @@
<4>
- (quantized linear predictor coefficients' precision in bits)-1 (1111 = invalid).
+ (Quantized linear predictor coefficients' precision in bits)-1 (1111 = invalid).
|