diff options
author | Nils Wallménius <nils@rockbox.org> | 2014-01-19 16:31:59 +0100 |
---|---|---|
committer | Nils Wallménius <nils@rockbox.org> | 2014-07-13 11:12:40 +0200 |
commit | 9b7ec42403073ee887efc531c153e6b1b6c15bab (patch) | |
tree | 07e72fe9d817c65a6fede22955344a870842d5e6 /lib/rbcodec/codecs/libopus/celt/bands.h | |
parent | e557951c94c1efa769900257e466900f0ffeb53b (diff) | |
download | rockbox-9b7ec42403073ee887efc531c153e6b1b6c15bab.tar.gz rockbox-9b7ec42403073ee887efc531c153e6b1b6c15bab.zip |
Sync to upstream libopus
Sync to commit bb4b6885a139644cf3ac14e7deda9f633ec2d93c
This brings in a bunch of optimizations to decode speed
and memory usage. Allocations are switched from using
the pseudostack to using the real stack. Enabled hacks
to reduce stack usage.
This should fix crashes on sansa clip, although some
files will not play due to failing allocations in the
codec buffer.
Speeds up decoding of the following test files:
H300 (cf) C200 (arm7tdmi) ipod classic (arm9e)
16 kbps (silk) 14.28 MHz 4.00 MHz 2.61 MHz
64 kbps (celt) 4.09 MHz 8.08 MHz 6.24 MHz
128 kbps (celt) 1.93 MHz 8.83 MHz 6.53 MHz
Change-Id: I851733a8a5824b61feb363a173091bc7e6629b58
Diffstat (limited to 'lib/rbcodec/codecs/libopus/celt/bands.h')
-rw-r--r-- | lib/rbcodec/codecs/libopus/celt/bands.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/rbcodec/codecs/libopus/celt/bands.h b/lib/rbcodec/codecs/libopus/celt/bands.h index 96ba52a649..69901b1e33 100644 --- a/lib/rbcodec/codecs/libopus/celt/bands.h +++ b/lib/rbcodec/codecs/libopus/celt/bands.h | |||
@@ -41,7 +41,7 @@ | |||
41 | * @param X Spectrum | 41 | * @param X Spectrum |
42 | * @param bandE Square root of the energy for each band (returned) | 42 | * @param bandE Square root of the energy for each band (returned) |
43 | */ | 43 | */ |
44 | void compute_band_energies(const CELTMode *m, const celt_sig *X, celt_ener *bandE, int end, int C, int M); | 44 | void compute_band_energies(const CELTMode *m, const celt_sig *X, celt_ener *bandE, int end, int C, int LM); |
45 | 45 | ||
46 | /*void compute_noise_energies(const CELTMode *m, const celt_sig *X, const opus_val16 *tonality, celt_ener *bandE);*/ | 46 | /*void compute_noise_energies(const CELTMode *m, const celt_sig *X, const opus_val16 *tonality, celt_ener *bandE);*/ |
47 | 47 | ||
@@ -59,14 +59,15 @@ void normalise_bands(const CELTMode *m, const celt_sig * OPUS_RESTRICT freq, cel | |||
59 | * @param bandE Square root of the energy for each band | 59 | * @param bandE Square root of the energy for each band |
60 | */ | 60 | */ |
61 | void denormalise_bands(const CELTMode *m, const celt_norm * OPUS_RESTRICT X, | 61 | void denormalise_bands(const CELTMode *m, const celt_norm * OPUS_RESTRICT X, |
62 | celt_sig * OPUS_RESTRICT freq, const opus_val16 *bandE, int start, int end, int C, int M); | 62 | celt_sig * OPUS_RESTRICT freq, const opus_val16 *bandE, int start, |
63 | int end, int M, int downsample, int silence); | ||
63 | 64 | ||
64 | #define SPREAD_NONE (0) | 65 | #define SPREAD_NONE (0) |
65 | #define SPREAD_LIGHT (1) | 66 | #define SPREAD_LIGHT (1) |
66 | #define SPREAD_NORMAL (2) | 67 | #define SPREAD_NORMAL (2) |
67 | #define SPREAD_AGGRESSIVE (3) | 68 | #define SPREAD_AGGRESSIVE (3) |
68 | 69 | ||
69 | int spreading_decision(const CELTMode *m, celt_norm *X, int *average, | 70 | int spreading_decision(const CELTMode *m, const celt_norm *X, int *average, |
70 | int last_decision, int *hf_average, int *tapset_decision, int update_hf, | 71 | int last_decision, int *hf_average, int *tapset_decision, int update_hf, |
71 | int end, int C, int M); | 72 | int end, int C, int M); |
72 | 73 | ||
@@ -104,8 +105,8 @@ void quant_all_bands(int encode, const CELTMode *m, int start, int end, | |||
104 | opus_int32 total_bits, opus_int32 balance, ec_ctx *ec, int M, int codedBands, opus_uint32 *seed); | 105 | opus_int32 total_bits, opus_int32 balance, ec_ctx *ec, int M, int codedBands, opus_uint32 *seed); |
105 | 106 | ||
106 | void anti_collapse(const CELTMode *m, celt_norm *X_, unsigned char *collapse_masks, int LM, int C, int size, | 107 | void anti_collapse(const CELTMode *m, celt_norm *X_, unsigned char *collapse_masks, int LM, int C, int size, |
107 | int start, int end, opus_val16 *logE, opus_val16 *prev1logE, | 108 | int start, int end, const opus_val16 *logE, const opus_val16 *prev1logE, |
108 | opus_val16 *prev2logE, int *pulses, opus_uint32 seed); | 109 | const opus_val16 *prev2logE, const int *pulses, opus_uint32 seed); |
109 | 110 | ||
110 | opus_uint32 celt_lcg_rand(opus_uint32 seed); | 111 | opus_uint32 celt_lcg_rand(opus_uint32 seed); |
111 | 112 | ||