Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1103)

Unified Diff: third_party/opus/src/silk/LPC_analysis_filter.c

Issue 2962373002: [Opus] Update to v1.2.1 (Closed)
Patch Set: Pre-increment instead of post-increment Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/opus/src/silk/CNG.c ('k') | third_party/opus/src/silk/LPC_fit.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/opus/src/silk/LPC_analysis_filter.c
diff --git a/third_party/opus/src/silk/LPC_analysis_filter.c b/third_party/opus/src/silk/LPC_analysis_filter.c
index 20906673ff124610df2071cb765cbf9b09b33f08..7715f70f8d6763757b0ef194be4cd014ffd0c223 100644
--- a/third_party/opus/src/silk/LPC_analysis_filter.c
+++ b/third_party/opus/src/silk/LPC_analysis_filter.c
@@ -39,6 +39,13 @@ POSSIBILITY OF SUCH DAMAGE.
/* first d output samples are set to zero */
/*******************************************/
+/* OPT: Using celt_fir() for this function should be faster, but it may cause
+ integer overflows in intermediate values (not final results), which the
+ current implementation silences by casting to unsigned. Enabling
+ this should be safe in pretty much all cases, even though it is not technically
+ C89-compliant. */
+#define USE_CELT_FIR 0
+
void silk_LPC_analysis_filter(
opus_int16 *out, /* O Output signal */
const opus_int16 *in, /* I Input signal */
@@ -49,8 +56,7 @@ void silk_LPC_analysis_filter(
)
{
opus_int j;
-#ifdef FIXED_POINT
- opus_int16 mem[SILK_MAX_ORDER_LPC];
+#if defined(FIXED_POINT) && USE_CELT_FIR
opus_int16 num[SILK_MAX_ORDER_LPC];
#else
int ix;
@@ -62,15 +68,12 @@ void silk_LPC_analysis_filter(
silk_assert( (d & 1) == 0 );
silk_assert( d <= len );
-#ifdef FIXED_POINT
+#if defined(FIXED_POINT) && USE_CELT_FIR
silk_assert( d <= SILK_MAX_ORDER_LPC );
for ( j = 0; j < d; j++ ) {
num[ j ] = -B[ j ];
}
- for (j=0;j<d;j++) {
- mem[ j ] = in[ d - j - 1 ];
- }
- celt_fir( in + d, num, out + d, len - d, d, mem, arch );
+ celt_fir( in + d, num, out + d, len - d, d, arch );
for ( j = 0; j < d; j++ ) {
out[ j ] = 0;
}
« no previous file with comments | « third_party/opus/src/silk/CNG.c ('k') | third_party/opus/src/silk/LPC_fit.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698