diff options
author | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2016-07-01 15:51:05 -0400 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2016-07-04 03:10:45 -0400 |
commit | 9d83fc16ece9cf758690b7be8b9c2d1cace78660 (patch) | |
tree | 8eac7faa2855f30974115ea72ce8f9144b0dba92 | |
parent | 8053450b8033fe4aa60fd343e5ed7c331799a723 (diff) | |
download | opus-9d83fc16ece9cf758690b7be8b9c2d1cace78660.tar.gz |
minimal fix to the SILK resampler
-rw-r--r-- | silk/resampler_private_IIR_FIR.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/silk/resampler_private_IIR_FIR.c b/silk/resampler_private_IIR_FIR.c index dbd6d9a8..91a43aaf 100644 --- a/silk/resampler_private_IIR_FIR.c +++ b/silk/resampler_private_IIR_FIR.c @@ -75,10 +75,10 @@ void silk_resampler_private_IIR_FIR( silk_resampler_state_struct *S = (silk_resampler_state_struct *)SS; opus_int32 nSamplesIn; opus_int32 max_index_Q16, index_increment_Q16; - opus_int16 buf[ RESAMPLER_MAX_BATCH_SIZE_IN + RESAMPLER_ORDER_FIR_12 ]; + opus_int16 buf[ 2*RESAMPLER_MAX_BATCH_SIZE_IN + RESAMPLER_ORDER_FIR_12 ]; /* Copy buffered samples to start of buffer */ - silk_memcpy( buf, S->sFIR, RESAMPLER_ORDER_FIR_12 * sizeof( opus_int32 ) ); + silk_memcpy( buf, S->sFIR, RESAMPLER_ORDER_FIR_12 * sizeof( opus_int16 ) ); /* Iterate over blocks of frameSizeIn input samples */ index_increment_Q16 = S->invRatio_Q16; @@ -95,13 +95,13 @@ void silk_resampler_private_IIR_FIR( if( inLen > 0 ) { /* More iterations to do; copy last part of filtered signal to beginning of buffer */ - silk_memcpy( buf, &buf[ nSamplesIn << 1 ], RESAMPLER_ORDER_FIR_12 * sizeof( opus_int32 ) ); + silk_memmove( buf, &buf[ nSamplesIn << 1 ], RESAMPLER_ORDER_FIR_12 * sizeof( opus_int16 ) ); } else { break; } } /* Copy last part of filtered signal to the state for the next call */ - silk_memcpy( S->sFIR, &buf[ nSamplesIn << 1 ], RESAMPLER_ORDER_FIR_12 * sizeof( opus_int32 ) ); + silk_memcpy( S->sFIR, &buf[ nSamplesIn << 1 ], RESAMPLER_ORDER_FIR_12 * sizeof( opus_int16 ) ); } |