diff options
author | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2011-10-20 08:39:41 +0400 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2011-10-20 08:39:41 +0400 |
commit | 294bfec27b82f879e3c3004d31bb91bcb34014f4 (patch) | |
tree | 94a6332cc1df41ec84b453ef76ee8118b95bfd8f /silk/float/pitch_analysis_core_FLP.c | |
parent | dbf2ea841e5b022f0b6d15a606dd7288f25c35dd (diff) |
Implements hard CBR for SILK
This is achieved by running the encoding process in a loop and
padding when we don't reach the exact rate. It also implements
VBR-with-cap, which means we no longer need to artificially decrease
the SILK bandwidth when it's close to the cap.
Diffstat (limited to 'silk/float/pitch_analysis_core_FLP.c')
-rw-r--r-- | silk/float/pitch_analysis_core_FLP.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/silk/float/pitch_analysis_core_FLP.c b/silk/float/pitch_analysis_core_FLP.c index 8e661590..4108d63d 100644 --- a/silk/float/pitch_analysis_core_FLP.c +++ b/silk/float/pitch_analysis_core_FLP.c @@ -202,8 +202,8 @@ opus_int silk_pitch_analysis_core_FLP( /* O voicing estimate: 0 voiced, 1 unvoic /* Add contribution of new sample and remove contribution from oldest sample */ normalizer += - basis_ptr[ 0 ] * basis_ptr[ 0 ] - - basis_ptr[ sf_length_8kHz ] * basis_ptr[ sf_length_8kHz ]; + basis_ptr[ 0 ] * (double)basis_ptr[ 0 ] - + basis_ptr[ sf_length_8kHz ] * (double)basis_ptr[ sf_length_8kHz ]; C[ 0 ][ d ] += (silk_float)(cross_corr / sqrt( normalizer )); } /* Update target pointer */ @@ -225,7 +225,7 @@ opus_int silk_pitch_analysis_core_FLP( /* O voicing estimate: 0 voiced, 1 unvoic target_ptr = &frame_4kHz[ silk_SMULBB( sf_length_4kHz, nb_subfr ) ]; energy = 1000.0f; for( i = 0; i < silk_LSHIFT( sf_length_4kHz, 2 ); i++ ) { - energy += target_ptr[i] * target_ptr[i]; + energy += target_ptr[i] * (double)target_ptr[i]; } threshold = Cmax * Cmax; if( energy / 16.0f > threshold ) { |