This prevents rate reduction due to channel correlation from increasing
by more than 0.25 bit/sample between two frames. This issue was observed
on r.flac where the frame following a transient would lose nearly
1 bit/sample
This only increases the average rate by about 1.5 kb/s, but it
restores the high quality of transients from 1.0. Also it
ensures that dynalloc can never starve other bands when used
aggressively.
1) Stereo saving was being too aggressive because it only considered the LF
and because the savings were multiplied by coded_bins rather than by
just the number of "side bins" below the intensity threshold
2) In the case of bandlimited signals, dynalloc would allocate way too many
bits to the last non-zero band. We now explicitly check for the last
band with a meaningful signal.
These issues were really obvious when encoding the decoded test01.mp3
because of the strong inter-channel correlation and (especially) the 16 kHz
lowpass used by the mp3 encoder.
We had previously advised people to -Drestrict on
non-C99 compilers, but this creates problems for
some of the MSVC headers. Instead this just
uses a macro and defines it sanely.
tf_estimate was being initialized to zero and then never set because
transient_analysis() wasn't being called. This could also have affected
other frame sizes at lower complexity.
Tuned the tonality estimator to trigger on signals where only part of the
spectrum is tonal. Also tuned the pitch detector not to be confused
by short-term correlation.
- New DC rejection filter that avoids numerical issues
- Higher cap on HF dynalloc
- Proper filter memory for transient detector
- Prevents transient detector from detecting low-freq tones as transients
Fixes two leakage problems on the wood blocks sample
- Removes DC which causes leakage with no masking
- Detect leakage by comparing short-MDCT energy to long-MDCT energy
and boost allocation for bands with leakage
Also using the same int->float conversion functions for SILK as for CELT
and changed encoder implementation default to constrained VBR just to
be safe when VBR gets more aggressive.
C reserves identifiers of the from _[A-Z]+ and we have a number of
those in the code. This patch renames the various function arguments,
MACROS and preprocessor symbols to avoid the reserved form.
It also removes the CHANNELS() macro altogether. This was a
minor optimization for TI DSP to force a mono-only build,
as were the associated local 'const' versions. Since stereo
support is manditory, it wasn't worth keeping.
Thanks to John Ridges for raising the issue, and Jean-Marc Valin
and Greg Maxwell for reviewing the changes.
This fixes the tracking of the CELT anti-collapse energy. In some cases,
the energy for bands that weren't coded wasn't updated and could
come from old frames.