0
.SUBSUBSECTION "the Residual"
0
Though the FLAC format allows for different forms of
0
residual coding, two forms of partitioned Rice are the only ones
0
In this example, @\[*D] sup 1@'s value of 26 is the smallest.
0
Therefore, when compressing this set of samples in a FIXED subframe,
0
-it
is best to use a predictor order of 1.
0
+it
's best to use a predictor order of 1.
0
The predictor order indicates how many warm-up samples to take from
0
4:@"Residual" sub i = "Sample" sub i~~-~~((4 * "Sample" sub {i~-~1})~~-~~(6 * "Sample" sub {i~-~2})~~+~~(4 * "Sample" sub {i~-~3})~~-~~"Sample" sub {i~-~4})@
0
+.\"In this example, the residual values are: -1 1 1 1 0 3 0 -4 -1 0 1 1 1 4 -3 1 4 -1 -1
0
+.SUBSUBSECTION "the Residual"
0
+Given a stream of residual values, one must place them in one or more
0
+partitions, each with its own Rice parameter, and prepended with a
0
+\(dg See page \n(ZR for full details of how the residual is organized.
0
+The residual's coding method is typically 0, unless one is encoding
0
+audio with more than 16 bits-per-sample and one of the partitions
0
+requests a Rice parameter higher than @2 sup 4@.
0
+The residual's partition order is chosen exhaustively, which means
0
+trying all of them within a certain range (e.g. 0 to 5) such that
0
+the residuals can be divided evenly between them and then the partiton
0
+order which uses the smallest estimated amount of space is chosen.
0
+Choosing the best Rice parameter is a matter of selecting the smallest
0
+value of `x' such that:
0
+"sample count" * {2 sup x}~~>~~{sum from {i = 0} to {"residual count"~-~1}
0
+Again, this is easier to understand with a block of example residuals,
0
+index:@residual sub i@:@|~{residual sub i}~|@
0
+@|~{roman "sum"}~|@::29
0
+@19 * {2 sup 0}@ is not larger than 29.
0
+@19 * {2 sup 1}@ is larger than 29, so the best Rice parameter
0
+for this block of residuals is 1.
Comments
No one has commented yet.