Update SILK code using the CELT range coder
[opus.git] / src_common / SKP_Silk_decoder_set_fs.c
similarity index 86%
rename from src/SKP_Silk_decoder_set_fs.c
rename to src_common/SKP_Silk_decoder_set_fs.c
index 824a84b..b0a94f4 100644 (file)
@@ -30,13 +30,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 /* Set decoder sampling rate */\r
 void SKP_Silk_decoder_set_fs(\r
     SKP_Silk_decoder_state          *psDec,             /* I/O  Decoder state pointer                       */\r
-    SKP_int                         fs_kHz              /* I    Sampling frequency (kHz)                    */\r
+    SKP_int                         fs_kHz,             /* I    Sampling frequency (kHz)                    */\r
+    SKP_int                         nb_subfr            /* I    Number of subframes                         */\r
 )\r
 {\r
+    psDec->nb_subfr = nb_subfr;\r
+    psDec->frame_length   = SKP_SMULBB( psDec->nb_subfr, psDec->subfr_length );\r
     if( psDec->fs_kHz != fs_kHz ) {\r
         psDec->fs_kHz  = fs_kHz;\r
-        psDec->frame_length = SKP_SMULBB( FRAME_LENGTH_MS, fs_kHz );\r
-        psDec->subfr_length = SKP_SMULBB( FRAME_LENGTH_MS / NB_SUBFR, fs_kHz );\r
+        psDec->subfr_length   = SKP_SMULBB( SUB_FRAME_LENGTH_MS, fs_kHz );\r
+        psDec->frame_length   = SKP_SMULBB( psDec->nb_subfr, psDec->subfr_length );\r
+        psDec->ltp_mem_length = SKP_SMULBB( LTP_MEM_LENGTH_MS, fs_kHz );\r
         if( psDec->fs_kHz == 8 ) {\r
             psDec->LPC_order = MIN_LPC_ORDER;\r
             psDec->psNLSF_CB[ 0 ] = &SKP_Silk_NLSF_CB0_10;\r