\$Id: 07-floor1.xml 7186 2004-07-20 07:19:25Z xiphmont \$ Floor type 1 setup and decode
Overview Vorbis floor type one uses a piecewise straight-line representation to encode a spectral envelope curve. The representation plots this curve mechanically on a linear frequency axis and a logarithmic (dB) amplitude axis. The integer plotting algorithm used is similar to Bresenham's algorithm.
Floor 1 format
model Floor type one represents a spectral curve as a series of line segments. Synthesis constructs a floor curve using iterative prediction in a process roughly equivalent to the following simplified description: the first line segment (base case) is a logical line spanning from x_0,y_0 to x_1,y_1 where in the base case x_0=0 and x_1=[n], the full range of the spectral floor to be computed. the induction step chooses a point x_new within an existing logical line segment and produces a y_new value at that point computed from the existing line's y value at x_new (as plotted by the line) and a difference value decoded from the bitstream packet. floor computation produces two new line segments, one running from x_0,y_0 to x_new,y_new and from x_new,y_new to x_1,y_1. This step is performed logically even if y_new represents no change to the amplitude value at x_new so that later refinement is additionally bounded at x_new. the induction step repeats, using a list of x values specified in the codec setup header at floor 1 initialization time. Computation is completed at the end of the x value list. Consider the following example, with values chosen for ease of understanding rather than representing typical configuration: For the below example, we assume a floor setup with an [n] of 128. The list of selected X values in increasing order is 0,16,32,48,64,80,96,112 and 128. In list order, the values interleave as 0, 128, 64, 32, 96, 16, 48, 80 and 112. The corresponding list-order Y values as decoded from an example packet are 110, 20, -5, -45, 0, -25, -10, 30 and -10. We compute the floor in the following way, beginning with the first line: [graph of example floor] We now draw new logical lines to reflect the correction to new_Y, and iterate for X positions 32 and 96: [graph of example floor] Although the new Y value at X position 96 is unchanged, it is still used later as an endpoint for further refinement. From here on, the pattern should be clear; we complete the floor computation as follows: [graph of example floor] [graph of example floor] A more efficient algorithm with carefully defined integer rounding behavior is used for actual decode, as described later. The actual algorithm splits Y value computation and line plotting into two steps with modifications to the above algorithm to eliminate noise accumulation through integer roundoff/truncation.