opus/libcelt
Timothy B. Terriberry 21af73eb21 Make collapse-detection bitexact.
Jean-Marc's original anti-collapse patch used a threshold on the
 content of a decoded band to determine whether or not it should
 be filled with random noise.
Since this is highly sensitive to the accuracy of the
 implementation, it could lead to significant decoder output
 differences even if decoding error up to that point was relatively
 small.

This patch detects collapsed bands from the output of the vector
 quantizer, using exact integer arithmetic.
It makes two simplifying assumptions:
 a) If either input to haar1() is non-zero during TF resolution
     adjustments, then the output will be non-zero.
 b) If the content of a block is non-zero in any of the bands that
     are used for folding, then the folded output will be non-zero.
b) in particular is likely to be false when SPREAD_NONE is used.
It also ignores the case where mid and side are orthogonal in
 stereo_merge, but this is relatively unlikely.
This misses just over 3% of the cases that Jean-Marc's anti-collapse
 detection strategy would catch, but does not mis-classify any (all
 detected collapses are true collapses).

This patch overloads the "fill" parameter to mark which blocks have
 non-zero content for folding.
As a consequence, if a set of blocks on one side of a split has
 collapsed, _no_ folding is done: the result would be zero anyway,
 except for short blocks with SPREAD_AGGRESSIVE that are split down
 to a single block, but a) that means a lot of bits were available
 so a collapse is unlikely and b) anti-collapse can fill the block
 anyway, if it's used.
This also means that if itheta==0 or itheta==16384, we no longer
 fold at all on that side (even with long blocks), since we'd be
 multiplying the result by zero anyway.
2011-01-19 19:43:08 -05:00
..
_kiss_fft_guts.h Updating dump_modes to include the MDCT and FFT. More work needed. 2010-08-25 18:01:50 -04:00
arch.h CELT no longer prints to stderr (unless assertions are enabled) 2010-08-27 17:52:38 -04:00
bands.c Make collapse-detection bitexact. 2011-01-19 19:43:08 -05:00
bands.h Make collapse-detection bitexact. 2011-01-19 19:43:08 -05:00
c64_fft.c Changed all the celt*int*_t types to remove the _t suffix, which is reserved 2009-10-17 14:35:13 -04:00
c64_fft.h Changed all the celt*int*_t types to remove the _t suffix, which is reserved 2009-10-17 14:35:13 -04:00
celt.c Make collapse-detection bitexact. 2011-01-19 19:43:08 -05:00
celt.h Add API support for unconstrained VBR 2010-12-05 17:22:06 -05:00
celt_header.h Updated copyright notices 2009-10-17 21:40:10 -04:00
celt_types.h MacOS X typedef fix 2010-09-13 11:23:13 -04:00
cwrs.c FFT cleanup 2010-08-25 17:15:05 -04:00
cwrs.h Removing the rest of the >32-bit PVQ code 2010-05-24 09:05:36 -04:00
dump_modes.c Add coarse energy entropy model tuning. 2010-11-09 17:54:41 +08:00
ecintrin.h Use _BitScanReverse for EC_ILOG with MSVC. 2010-12-23 11:23:50 -05:00
entcode.c Updated copyright notices 2009-10-17 21:40:10 -04:00
entcode.h Clean up some type usage. 2010-12-23 14:33:32 -05:00
entdec.c Clean up some type usage. 2010-12-23 14:33:32 -05:00
entdec.h Changes to ec_dec_cdf() to support 8-bit tables. 2011-01-08 14:57:01 -05:00
entenc.c Fix a typo in ec_byte_write_done(). 2010-12-21 20:16:24 -05:00
entenc.h Changes to ec_dec_cdf() to support 8-bit tables. 2011-01-08 14:57:01 -05:00
fixed_c5x.h Removed the _t from all the celt*_t types to avoid clashing with POSIX 2009-10-17 22:12:42 -04:00
fixed_c6x.h Removed the _t from all the celt*_t types to avoid clashing with POSIX 2009-10-17 22:12:42 -04:00
fixed_debug.h Removed the _t from all the celt*_t types to avoid clashing with POSIX 2009-10-17 22:12:42 -04:00
fixed_generic.h Removed the _t from all the celt*_t types to avoid clashing with POSIX 2009-10-17 22:12:42 -04:00
float_cast.h Optimised float->int cast for Win64 2010-10-16 18:00:54 -04:00
header.c Remove check_mode() 2010-08-27 16:10:39 -04:00
kiss_fft.c CELT no longer prints to stderr (unless assertions are enabled) 2010-08-27 17:52:38 -04:00
kiss_fft.h Fixed an old issue where the fixed-point MDCT twiddles were stored as 32-bit values 2010-08-25 22:20:35 -04:00
laplace.c Add coarse energy entropy model tuning. 2010-11-09 17:54:41 +08:00
laplace.h Add coarse energy entropy model tuning. 2010-11-09 17:54:41 +08:00
Makefile.am Add --export-symbols-regex 2011-01-11 09:33:20 -05:00
match-test.sh Simplified the folding normalisation by creating renormalise_vector(). 2008-07-20 23:14:31 -04:00
mathops.c Fixes several fixed-point overflows in the PLC code 2010-11-06 22:02:32 -04:00
mathops.h Fixes some MSVC warnings 2010-08-31 11:52:45 -04:00
mdct.c First shot at automatically adjusting the "allocation trim" for stereo. 2010-10-19 14:24:50 -04:00
mdct.h static modes update for MDCT 2010-08-25 21:21:43 -04:00
mfrngcod.h Updated copyright notices 2009-10-17 21:40:10 -04:00
modes.c Enforces bands of even size even for custom modes 2011-01-12 09:22:29 -05:00
modes.h Bump bit-stream version 2010-12-20 16:58:29 -05:00
os_support.h CELT no longer prints to stderr (unless assertions are enabled) 2010-08-27 17:52:38 -04:00
pitch.c Good catch by John Ridges 2010-11-16 10:55:38 -05:00
pitch.h Squashed commit of the following: 2010-11-04 13:24:44 -04:00
plc.c Fixes several fixed-point overflows in the PLC code 2010-11-06 22:02:32 -04:00
plc.h Removing old PCL, added plc.h 2010-06-20 23:01:33 -04:00
quant_bands.c Defines MAX_FINE_BITS to ensure that we're using the same value everywhere 2011-01-10 13:21:04 -05:00
quant_bands.h Prevent busts at low bitrates. 2011-01-09 02:06:53 -05:00
rangedec.c Changes to ec_dec_cdf() to support 8-bit tables. 2011-01-08 14:57:01 -05:00
rangeenc.c Changes to ec_dec_cdf() to support 8-bit tables. 2011-01-08 14:57:01 -05:00
rate.c Defines MAX_FINE_BITS to ensure that we're using the same value everywhere 2011-01-10 13:21:04 -05:00
rate.h Defines MAX_FINE_BITS to ensure that we're using the same value everywhere 2011-01-10 13:21:04 -05:00
stack_alloc.h _alloca() for Win32 2010-08-31 11:56:09 -04:00
testcelt.c Properly skip padding in testcelt for stereo. 2011-01-09 23:08:15 -05:00
vq.c Make collapse-detection bitexact. 2011-01-19 19:43:08 -05:00
vq.h Make collapse-detection bitexact. 2011-01-19 19:43:08 -05:00