Renamed SKP_[u]int* to opus_[u]int*
[opus.git] / silk / silk_dec_API.c
index eb456f3..212b494 100644 (file)
@@ -37,17 +37,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 typedef struct {\r
     silk_decoder_state          channel_state[ DECODER_NUM_CHANNELS ];\r
     stereo_dec_state                sStereo;\r
 typedef struct {\r
     silk_decoder_state          channel_state[ DECODER_NUM_CHANNELS ];\r
     stereo_dec_state                sStereo;\r
-    SKP_int                         nChannelsAPI;\r
-    SKP_int                         nChannelsInternal;\r
+    opus_int                         nChannelsAPI;\r
+    opus_int                         nChannelsInternal;\r
 } silk_decoder;\r
 \r
 /*********************/\r
 /* Decoder functions */\r
 /*********************/\r
 \r
 } silk_decoder;\r
 \r
 /*********************/\r
 /* Decoder functions */\r
 /*********************/\r
 \r
-SKP_int silk_Get_Decoder_Size( SKP_int32 *decSizeBytes ) \r
+opus_int silk_Get_Decoder_Size( opus_int32 *decSizeBytes ) \r
 {\r
 {\r
-    SKP_int ret = SILK_NO_ERROR;\r
+    opus_int ret = SILK_NO_ERROR;\r
 \r
     *decSizeBytes = sizeof( silk_decoder );\r
 \r
 \r
     *decSizeBytes = sizeof( silk_decoder );\r
 \r
@@ -55,11 +55,11 @@ SKP_int silk_Get_Decoder_Size( SKP_int32 *decSizeBytes )
 }\r
 \r
 /* Reset decoder state */\r
 }\r
 \r
 /* Reset decoder state */\r
-SKP_int silk_InitDecoder(\r
+opus_int silk_InitDecoder(\r
     void* decState                                      /* I/O: State                                          */\r
 )\r
 {\r
     void* decState                                      /* I/O: State                                          */\r
 )\r
 {\r
-    SKP_int n, ret = SILK_NO_ERROR;\r
+    opus_int n, ret = SILK_NO_ERROR;\r
     silk_decoder_state *channel_state = ((silk_decoder *)decState)->channel_state;\r
 \r
     for( n = 0; n < DECODER_NUM_CHANNELS; n++ ) {\r
     silk_decoder_state *channel_state = ((silk_decoder *)decState)->channel_state;\r
 \r
     for( n = 0; n < DECODER_NUM_CHANNELS; n++ ) {\r
@@ -70,22 +70,22 @@ SKP_int silk_InitDecoder(
 }\r
 \r
 /* Decode a frame */\r
 }\r
 \r
 /* Decode a frame */\r
-SKP_int silk_Decode(\r
+opus_int silk_Decode(\r
     void*                               decState,       /* I/O: State                                           */\r
     silk_DecControlStruct*      decControl,     /* I/O: Control Structure                               */\r
     void*                               decState,       /* I/O: State                                           */\r
     silk_DecControlStruct*      decControl,     /* I/O: Control Structure                               */\r
-    SKP_int                             lostFlag,       /* I:   0: no loss, 1 loss, 2 decode FEC                */\r
-    SKP_int                             newPacketFlag,  /* I:   Indicates first decoder call for this packet    */\r
+    opus_int                             lostFlag,       /* I:   0: no loss, 1 loss, 2 decode FEC                */\r
+    opus_int                             newPacketFlag,  /* I:   Indicates first decoder call for this packet    */\r
     ec_dec                              *psRangeDec,    /* I/O  Compressor data structure                       */\r
     ec_dec                              *psRangeDec,    /* I/O  Compressor data structure                       */\r
-    SKP_int16                           *samplesOut,    /* O:   Decoded output speech vector                    */\r
-    SKP_int32                           *nSamplesOut    /* O:   Number of samples decoded                       */\r
+    opus_int16                           *samplesOut,    /* O:   Decoded output speech vector                    */\r
+    opus_int32                           *nSamplesOut    /* O:   Number of samples decoded                       */\r
 )\r
 {\r
 )\r
 {\r
-    SKP_int   i, n, prev_fs_kHz, decode_only_middle = 0, ret = SILK_NO_ERROR;\r
-    SKP_int32 nSamplesOutDec, LBRR_symbol;\r
-    SKP_int16 samplesOut1_tmp[ 2 ][ MAX_FS_KHZ * MAX_FRAME_LENGTH_MS + 2 ];\r
-    SKP_int16 samplesOut2_tmp[ MAX_API_FS_KHZ * MAX_FRAME_LENGTH_MS ];\r
-    SKP_int   MS_pred_Q13[ 2 ] = { 0 };\r
-    SKP_int16 *resample_out_ptr;\r
+    opus_int   i, n, prev_fs_kHz, decode_only_middle = 0, ret = SILK_NO_ERROR;\r
+    opus_int32 nSamplesOutDec, LBRR_symbol;\r
+    opus_int16 samplesOut1_tmp[ 2 ][ MAX_FS_KHZ * MAX_FRAME_LENGTH_MS + 2 ];\r
+    opus_int16 samplesOut2_tmp[ MAX_API_FS_KHZ * MAX_FRAME_LENGTH_MS ];\r
+    opus_int   MS_pred_Q13[ 2 ] = { 0 };\r
+    opus_int16 *resample_out_ptr;\r
     silk_decoder *psDec = ( silk_decoder * )decState;\r
     silk_decoder_state *channel_state = psDec->channel_state;\r
 \r
     silk_decoder *psDec = ( silk_decoder * )decState;\r
     silk_decoder_state *channel_state = psDec->channel_state;\r
 \r
@@ -111,7 +111,7 @@ SKP_int silk_Decode(
 \r
     for( n = 0; n < decControl->nChannelsInternal; n++ ) {\r
         if( channel_state[ n ].nFramesDecoded == 0 ) {\r
 \r
     for( n = 0; n < decControl->nChannelsInternal; n++ ) {\r
         if( channel_state[ n ].nFramesDecoded == 0 ) {\r
-            SKP_int fs_kHz_dec;\r
+            opus_int fs_kHz_dec;\r
             if( decControl->payloadSize_ms == 0 ) {\r
                 /* Assuming packet loss, use 10 ms */\r
                 channel_state[ n ].nFramesPerPacket = 1;\r
             if( decControl->payloadSize_ms == 0 ) {\r
                 /* Assuming packet loss, use 10 ms */\r
                 channel_state[ n ].nFramesPerPacket = 1;\r
@@ -190,7 +190,7 @@ SKP_int silk_Decode(
             for( i = 0; i < channel_state[ 0 ].nFramesPerPacket; i++ ) {\r
                 for( n = 0; n < decControl->nChannelsInternal; n++ ) {\r
                     if( channel_state[ n ].LBRR_flags[ i ] ) {\r
             for( i = 0; i < channel_state[ 0 ].nFramesPerPacket; i++ ) {\r
                 for( n = 0; n < decControl->nChannelsInternal; n++ ) {\r
                     if( channel_state[ n ].LBRR_flags[ i ] ) {\r
-                        SKP_int pulses[ MAX_FRAME_LENGTH ];\r
+                        opus_int pulses[ MAX_FRAME_LENGTH ];\r
                         if( decControl->nChannelsInternal == 2 && n == 0 ) {\r
                             silk_stereo_decode_pred( psRangeDec, &decode_only_middle, MS_pred_Q13 );\r
                         }\r
                         if( decControl->nChannelsInternal == 2 && n == 0 ) {\r
                             silk_stereo_decode_pred( psRangeDec, &decode_only_middle, MS_pred_Q13 );\r
                         }\r
@@ -219,7 +219,7 @@ SKP_int silk_Decode(
         if( n == 0 || decode_only_middle == 0 ) {\r
             ret += silk_decode_frame( &channel_state[ n ], psRangeDec, &samplesOut1_tmp[ n ][ 2 ], &nSamplesOutDec, lostFlag );\r
         } else {\r
         if( n == 0 || decode_only_middle == 0 ) {\r
             ret += silk_decode_frame( &channel_state[ n ], psRangeDec, &samplesOut1_tmp[ n ][ 2 ], &nSamplesOutDec, lostFlag );\r
         } else {\r
-            SKP_memset( &samplesOut1_tmp[ n ][ 2 ], 0, nSamplesOutDec * sizeof( SKP_int16 ) );\r
+            SKP_memset( &samplesOut1_tmp[ n ][ 2 ], 0, nSamplesOutDec * sizeof( opus_int16 ) );\r
         }\r
     }\r
 \r
         }\r
     }\r
 \r
@@ -228,8 +228,8 @@ SKP_int silk_Decode(
         silk_stereo_MS_to_LR( &psDec->sStereo, samplesOut1_tmp[ 0 ], samplesOut1_tmp[ 1 ], MS_pred_Q13, channel_state[ 0 ].fs_kHz, nSamplesOutDec );\r
     } else {\r
         /* Buffering */\r
         silk_stereo_MS_to_LR( &psDec->sStereo, samplesOut1_tmp[ 0 ], samplesOut1_tmp[ 1 ], MS_pred_Q13, channel_state[ 0 ].fs_kHz, nSamplesOutDec );\r
     } else {\r
         /* Buffering */\r
-        SKP_memcpy( samplesOut1_tmp[ 0 ], psDec->sStereo.sMid, 2 * sizeof( SKP_int16 ) );\r
-        SKP_memcpy( psDec->sStereo.sMid, &samplesOut1_tmp[ 0 ][ nSamplesOutDec ], 2 * sizeof( SKP_int16 ) );\r
+        SKP_memcpy( samplesOut1_tmp[ 0 ], psDec->sStereo.sMid, 2 * sizeof( opus_int16 ) );\r
+        SKP_memcpy( psDec->sStereo.sMid, &samplesOut1_tmp[ 0 ][ nSamplesOutDec ], 2 * sizeof( opus_int16 ) );\r
     }\r
 \r
     /* Number of output samples */\r
     }\r
 \r
     /* Number of output samples */\r
@@ -265,14 +265,14 @@ SKP_int silk_Decode(
 }\r
 \r
 /* Getting table of contents for a packet */\r
 }\r
 \r
 /* Getting table of contents for a packet */\r
-SKP_int silk_get_TOC(\r
-    const SKP_uint8                     *payload,           /* I    Payload data                                */\r
-    const SKP_int                       nBytesIn,           /* I:   Number of input bytes                       */\r
-    const SKP_int                       nFramesPerPayload,  /* I:   Number of SILK frames per payload           */\r
+opus_int silk_get_TOC(\r
+    const opus_uint8                     *payload,           /* I    Payload data                                */\r
+    const opus_int                       nBytesIn,           /* I:   Number of input bytes                       */\r
+    const opus_int                       nFramesPerPayload,  /* I:   Number of SILK frames per payload           */\r
     silk_TOC_struct                 *Silk_TOC           /* O:   Type of content                             */\r
 )\r
 {\r
     silk_TOC_struct                 *Silk_TOC           /* O:   Type of content                             */\r
 )\r
 {\r
-    SKP_int i, flags, ret = SILK_NO_ERROR;\r
+    opus_int i, flags, ret = SILK_NO_ERROR;\r
 \r
     if( nBytesIn < 1 ) {\r
         return -1;\r
 \r
     if( nBytesIn < 1 ) {\r
         return -1;\r