Skip to content
Snippets Groups Projects
Commit c1c40a76 authored by Timothy B. Terriberry's avatar Timothy B. Terriberry Committed by Jean-Marc Valin
Browse files

Rework coarse energy coding.

This changes how the PDF used to code coarse energy.
New features:
1) The probability of 0 (p0) is now indepedent of the decay rate
 of the remaining values; this additional flexibility will allow
 us to model the actual distribution better, though that
 improvement is not part of this patch.
2) There is a guaranteed minimum number of encodable energy
    deltas.
   This ensures that even the most extreme sudden volume changes
    can be accurately represented.
3) The tail end of the distribution has an adjustable (through a
    constant in the code) minimum probability.
   This allows us to lower the worst-case bit cost of a single
    delta.
4) The codebook is interleaved as 0, -1, +1, -2, +2, ... instead
    of the 0, +1, -1, +2, -2, ... order used before (see 5).
5) There is no restriction that p0 be even.
   Any remaining, unused part of the code is assigned to an
    additional negative value (collected inter data suggests that
    very large negative deltas are more common than very large
    positive ones).
   If the minimum probability is greater than 1, then an
    additional positive delta with a smaller probablity may also
    be added.
6) Once the tail of the distribution is reached, the energy delta
    is computed directly, instead of continuing to loop through
    the codebook.
   This reduces the worst-case computational cost.
parent 6ac26ecf
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment