diff options
author | Nils Wallménius <nils@rockbox.org> | 2013-05-20 22:25:57 +0200 |
---|---|---|
committer | Nils Wallménius <nils@rockbox.org> | 2013-08-31 08:30:51 +0200 |
commit | 580b307fd791c0997a8831bc800bba87797bfb7e (patch) | |
tree | 807846056f06fd944a750ce41217a877910ebd59 /lib/rbcodec/codecs/libopus/celt/rate.c | |
parent | 74761b70acd96cecc0d35450dd56a98ad9ee7d3d (diff) | |
download | rockbox-580b307fd791c0997a8831bc800bba87797bfb7e.tar.gz rockbox-580b307fd791c0997a8831bc800bba87797bfb7e.zip |
Sync opus codec to upstream git
Sync opus codec to upstream commit
02fed471a4568852d6618e041c4f2af0d7730ee2 (August 30 2013)
This brings in a lot of optimizations but also makes the diff
between our codec and the upstream much smaller as most of our
optimizations have been upstreamed or supeceded.
Speedups across the board for CELT mode files:
64kbps 128kbps
H300 9.82MHz 15.48MHz
c200 4.86MHz 9.63MHz
fuze v1 10.32MHz 15.92MHz
For the silk mode test file (16kbps) arm targets get a speedup
of about 2MHz while the H300 is 7.8MHz slower, likely because it's
now using the pseudostack more rather than the real stack which
is in iram. Patches to get around that are upcomming.
Change-Id: Ifecf963e461c51ac42e09dac1e91bc4bc3b12fa3
Diffstat (limited to 'lib/rbcodec/codecs/libopus/celt/rate.c')
-rw-r--r-- | lib/rbcodec/codecs/libopus/celt/rate.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/rbcodec/codecs/libopus/celt/rate.c b/lib/rbcodec/codecs/libopus/celt/rate.c index 3b056d8dc7..e474cf5004 100644 --- a/lib/rbcodec/codecs/libopus/celt/rate.c +++ b/lib/rbcodec/codecs/libopus/celt/rate.c | |||
@@ -27,7 +27,7 @@ | |||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #ifdef HAVE_CONFIG_H | 29 | #ifdef HAVE_CONFIG_H |
30 | #include "opus_config.h" | 30 | #include "config.h" |
31 | #endif | 31 | #endif |
32 | 32 | ||
33 | #include <math.h> | 33 | #include <math.h> |
@@ -248,7 +248,7 @@ void compute_pulse_cache(CELTMode *m, int LM) | |||
248 | static inline int interp_bits2pulses(const CELTMode *m, int start, int end, int skip_start, | 248 | static inline int interp_bits2pulses(const CELTMode *m, int start, int end, int skip_start, |
249 | const int *bits1, const int *bits2, const int *thresh, const int *cap, opus_int32 total, opus_int32 *_balance, | 249 | const int *bits1, const int *bits2, const int *thresh, const int *cap, opus_int32 total, opus_int32 *_balance, |
250 | int skip_rsv, int *intensity, int intensity_rsv, int *dual_stereo, int dual_stereo_rsv, int *bits, | 250 | int skip_rsv, int *intensity, int intensity_rsv, int *dual_stereo, int dual_stereo_rsv, int *bits, |
251 | int *ebits, int *fine_priority, int C, int LM, ec_ctx *ec, int encode, int prev) | 251 | int *ebits, int *fine_priority, int C, int LM, ec_ctx *ec, int encode, int prev, int signalBandwidth) |
252 | { | 252 | { |
253 | opus_int32 psum; | 253 | opus_int32 psum; |
254 | int lo, hi; | 254 | int lo, hi; |
@@ -353,7 +353,7 @@ static inline int interp_bits2pulses(const CELTMode *m, int start, int end, int | |||
353 | #ifdef FUZZING | 353 | #ifdef FUZZING |
354 | if ((rand()&0x1) == 0) | 354 | if ((rand()&0x1) == 0) |
355 | #else | 355 | #else |
356 | if (band_bits > ((j<prev?7:9)*band_width<<LM<<BITRES)>>4) | 356 | if (codedBands<=start+2 || (band_bits > ((j<prev?7:9)*band_width<<LM<<BITRES)>>4 && j<=signalBandwidth)) |
357 | #endif | 357 | #endif |
358 | { | 358 | { |
359 | ec_enc_bit_logp(ec, 1, 1); | 359 | ec_enc_bit_logp(ec, 1, 1); |
@@ -524,7 +524,7 @@ static inline int interp_bits2pulses(const CELTMode *m, int start, int end, int | |||
524 | } | 524 | } |
525 | 525 | ||
526 | int compute_allocation(const CELTMode *m, int start, int end, const int *offsets, const int *cap, int alloc_trim, int *intensity, int *dual_stereo, | 526 | int compute_allocation(const CELTMode *m, int start, int end, const int *offsets, const int *cap, int alloc_trim, int *intensity, int *dual_stereo, |
527 | opus_int32 total, opus_int32 *balance, int *pulses, int *ebits, int *fine_priority, int C, int LM, ec_ctx *ec, int encode, int prev) | 527 | opus_int32 total, opus_int32 *balance, int *pulses, int *ebits, int *fine_priority, int C, int LM, ec_ctx *ec, int encode, int prev, int signalBandwidth) |
528 | { | 528 | { |
529 | int lo, hi, len, j; | 529 | int lo, hi, len, j; |
530 | int codedBands; | 530 | int codedBands; |
@@ -631,7 +631,7 @@ int compute_allocation(const CELTMode *m, int start, int end, const int *offsets | |||
631 | } | 631 | } |
632 | codedBands = interp_bits2pulses(m, start, end, skip_start, bits1, bits2, thresh, cap, | 632 | codedBands = interp_bits2pulses(m, start, end, skip_start, bits1, bits2, thresh, cap, |
633 | total, balance, skip_rsv, intensity, intensity_rsv, dual_stereo, dual_stereo_rsv, | 633 | total, balance, skip_rsv, intensity, intensity_rsv, dual_stereo, dual_stereo_rsv, |
634 | pulses, ebits, fine_priority, C, LM, ec, encode, prev); | 634 | pulses, ebits, fine_priority, C, LM, ec, encode, prev, signalBandwidth); |
635 | RESTORE_STACK; | 635 | RESTORE_STACK; |
636 | return codedBands; | 636 | return codedBands; |
637 | } | 637 | } |