summaryrefslogtreecommitdiff
path: root/silk/resampler_private_up2_HQ.c
diff options
context:
space:
mode:
authorKoen Vos <koen.vos@skype.net>2011-12-13 14:47:31 -0500
committerJean-Marc Valin <jmvalin@jmvalin.ca>2011-12-13 14:47:31 -0500
commitbf75c8ec4d0dded188bc7793de6da56c7ff0be1c (patch)
treec21bb05faf0a203b73e8f8aae90fc63dac27625d /silk/resampler_private_up2_HQ.c
parent6619a736376221f2782cecff55d051c3ecfc2ff7 (diff)
downloadopus-bf75c8ec4d0dded188bc7793de6da56c7ff0be1c.tar.gz
SILK fixes following last codec WG meeting
decoder: - fixed incorrect scaling of filter states for the smallest quantization step sizes - NLSF2A now limits the prediction gain of LPC filters encoder: - increased damping of LTP coefficients in LTP analysis - increased white noise fraction in noise shaping LPC analysis - introduced maximum total prediction gain. Used by Burg's method to exit early if prediction gain is exceeded. This improves packet loss robustness and numerical robustness in Burg's method - Prefiltered signal is now in int32 Q10 domain, from int16 Q0 - Increased max number of iterations in CBR gain control loop from 5 to 6 - Removed useless code from LTP scaling control - Optimization: smarter LPC loop unrolling - Switched default win32 compile mode to be floating-point resampler: - made resampler have constant delay of 0.75 ms; removed delay compensation from silk code. - removed obsolete table entries (~850 Bytes) - increased downsampling filter order from 16 to 18/24/36 (depending on frequency ratio) - reoptimized filter coefficients
Diffstat (limited to 'silk/resampler_private_up2_HQ.c')
-rw-r--r--silk/resampler_private_up2_HQ.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/silk/resampler_private_up2_HQ.c b/silk/resampler_private_up2_HQ.c
index 05e6afb3..09dc9c7d 100644
--- a/silk/resampler_private_up2_HQ.c
+++ b/silk/resampler_private_up2_HQ.c
@@ -46,9 +46,11 @@ void silk_resampler_private_up2_HQ(
opus_int32 in32, out32_1, out32_2, Y, X;
silk_assert( silk_resampler_up2_hq_0[ 0 ] > 0 );
- silk_assert( silk_resampler_up2_hq_0[ 1 ] < 0 );
+ silk_assert( silk_resampler_up2_hq_0[ 1 ] > 0 );
+ silk_assert( silk_resampler_up2_hq_0[ 2 ] < 0 );
silk_assert( silk_resampler_up2_hq_1[ 0 ] > 0 );
- silk_assert( silk_resampler_up2_hq_1[ 1 ] < 0 );
+ silk_assert( silk_resampler_up2_hq_1[ 1 ] > 0 );
+ silk_assert( silk_resampler_up2_hq_1[ 2 ] < 0 );
/* Internal variables and state are in Q10 format */
for( k = 0; k < len; k++ ) {
@@ -63,41 +65,39 @@ void silk_resampler_private_up2_HQ(
/* Second all-pass section for even output sample */
Y = silk_SUB32( out32_1, S[ 1 ] );
- X = silk_SMLAWB( Y, Y, silk_resampler_up2_hq_0[ 1 ] );
+ X = silk_SMULWB( Y, silk_resampler_up2_hq_0[ 1 ] );
out32_2 = silk_ADD32( S[ 1 ], X );
S[ 1 ] = silk_ADD32( out32_1, X );
- /* Biquad notch filter */
- out32_2 = silk_SMLAWB( out32_2, S[ 5 ], silk_resampler_up2_hq_notch[ 2 ] );
- out32_2 = silk_SMLAWB( out32_2, S[ 4 ], silk_resampler_up2_hq_notch[ 1 ] );
- out32_1 = silk_SMLAWB( out32_2, S[ 4 ], silk_resampler_up2_hq_notch[ 0 ] );
- S[ 5 ] = silk_SUB32( out32_2, S[ 5 ] );
+ /* Third all-pass section for even output sample */
+ Y = silk_SUB32( out32_2, S[ 2 ] );
+ X = silk_SMLAWB( Y, Y, silk_resampler_up2_hq_0[ 2 ] );
+ out32_1 = silk_ADD32( S[ 2 ], X );
+ S[ 2 ] = silk_ADD32( out32_2, X );
/* Apply gain in Q15, convert back to int16 and store to output */
- out[ 2 * k ] = (opus_int16)silk_SAT16( silk_RSHIFT32(
- silk_SMLAWB( 256, out32_1, silk_resampler_up2_hq_notch[ 3 ] ), 9 ) );
+ out[ 2 * k ] = (opus_int16)silk_SAT16( silk_RSHIFT_ROUND( out32_1, 10 ) );
/* First all-pass section for odd output sample */
- Y = silk_SUB32( in32, S[ 2 ] );
+ Y = silk_SUB32( in32, S[ 3 ] );
X = silk_SMULWB( Y, silk_resampler_up2_hq_1[ 0 ] );
- out32_1 = silk_ADD32( S[ 2 ], X );
- S[ 2 ] = silk_ADD32( in32, X );
+ out32_1 = silk_ADD32( S[ 3 ], X );
+ S[ 3 ] = silk_ADD32( in32, X );
/* Second all-pass section for odd output sample */
- Y = silk_SUB32( out32_1, S[ 3 ] );
- X = silk_SMLAWB( Y, Y, silk_resampler_up2_hq_1[ 1 ] );
- out32_2 = silk_ADD32( S[ 3 ], X );
- S[ 3 ] = silk_ADD32( out32_1, X );
+ Y = silk_SUB32( out32_1, S[ 4 ] );
+ X = silk_SMULWB( Y, silk_resampler_up2_hq_1[ 1 ] );
+ out32_2 = silk_ADD32( S[ 4 ], X );
+ S[ 4 ] = silk_ADD32( out32_1, X );
- /* Biquad notch filter */
- out32_2 = silk_SMLAWB( out32_2, S[ 4 ], silk_resampler_up2_hq_notch[ 2 ] );
- out32_2 = silk_SMLAWB( out32_2, S[ 5 ], silk_resampler_up2_hq_notch[ 1 ] );
- out32_1 = silk_SMLAWB( out32_2, S[ 5 ], silk_resampler_up2_hq_notch[ 0 ] );
- S[ 4 ] = silk_SUB32( out32_2, S[ 4 ] );
+ /* Third all-pass section for odd output sample */
+ Y = silk_SUB32( out32_2, S[ 5 ] );
+ X = silk_SMLAWB( Y, Y, silk_resampler_up2_hq_1[ 2 ] );
+ out32_1 = silk_ADD32( S[ 5 ], X );
+ S[ 5 ] = silk_ADD32( out32_2, X );
/* Apply gain in Q15, convert back to int16 and store to output */
- out[ 2 * k + 1 ] = (opus_int16)silk_SAT16( silk_RSHIFT32(
- silk_SMLAWB( 256, out32_1, silk_resampler_up2_hq_notch[ 3 ] ), 9 ) );
+ out[ 2 * k + 1 ] = (opus_int16)silk_SAT16( silk_RSHIFT_ROUND( out32_1, 10 ) );
}
}