libopus: updated to 1.1
Looks like a major update, with better performances for ARM.
diff --git a/jni/libopus/sources/silk/encode_pulses.c b/jni/libopus/sources/silk/encode_pulses.c
index b01b585..a450143 100644
--- a/jni/libopus/sources/silk/encode_pulses.c
+++ b/jni/libopus/sources/silk/encode_pulses.c
@@ -8,11 +8,11 @@
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-- Neither the name of Internet Society, IETF or IETF Trust, nor the
+- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS”
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
@@ -30,12 +30,13 @@
#endif
#include "main.h"
+#include "stack_alloc.h"
/*********************************************/
/* Encode quantization indices of excitation */
/*********************************************/
-static inline opus_int combine_and_check( /* return ok */
+static OPUS_INLINE opus_int combine_and_check( /* return ok */
opus_int *pulses_comb, /* O */
const opus_int *pulses_in, /* I */
opus_int max_pulses, /* I max value for sum of pulses */
@@ -66,14 +67,15 @@
{
opus_int i, k, j, iter, bit, nLS, scale_down, RateLevelIndex = 0;
opus_int32 abs_q, minSumBits_Q5, sumBits_Q5;
- opus_int abs_pulses[ MAX_FRAME_LENGTH ];
- opus_int sum_pulses[ MAX_NB_SHELL_BLOCKS ];
- opus_int nRshifts[ MAX_NB_SHELL_BLOCKS ];
+ VARDECL( opus_int, abs_pulses );
+ VARDECL( opus_int, sum_pulses );
+ VARDECL( opus_int, nRshifts );
opus_int pulses_comb[ 8 ];
opus_int *abs_pulses_ptr;
const opus_int8 *pulses_ptr;
const opus_uint8 *cdf_ptr;
const opus_uint8 *nBits_ptr;
+ SAVE_STACK;
silk_memset( pulses_comb, 0, 8 * sizeof( opus_int ) ); /* Fixing Valgrind reported problem*/
@@ -90,6 +92,8 @@
}
/* Take the absolute value of the pulses */
+ ALLOC( abs_pulses, iter * SHELL_CODEC_FRAME_LENGTH, opus_int );
+ silk_assert( !( SHELL_CODEC_FRAME_LENGTH & 3 ) );
for( i = 0; i < iter * SHELL_CODEC_FRAME_LENGTH; i+=4 ) {
abs_pulses[i+0] = ( opus_int )silk_abs( pulses[ i + 0 ] );
abs_pulses[i+1] = ( opus_int )silk_abs( pulses[ i + 1 ] );
@@ -98,6 +102,8 @@
}
/* Calc sum pulses per shell code frame */
+ ALLOC( sum_pulses, iter, opus_int );
+ ALLOC( nRshifts, iter, opus_int );
abs_pulses_ptr = abs_pulses;
for( i = 0; i < iter; i++ ) {
nRshifts[ i ] = 0;
@@ -196,4 +202,5 @@
/* Encode signs */
/****************/
silk_encode_signs( psRangeEnc, pulses, frame_length, signalType, quantOffsetType, sum_pulses );
+ RESTORE_STACK;
}