Fixing DTX for fixed-point too, updating project files
authorJean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Fri, 18 Mar 2011 05:29:17 +0000 (01:29 -0400)
committerJean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Fri, 18 Mar 2011 05:29:17 +0000 (01:29 -0400)
12 files changed:
src_FIX/SKP_Silk_encode_frame_FIX.c
src_FIX/src_FIX.vcxproj
src_FLP/SKP_Silk_encode_frame_FLP.c
src_FLP/src_FLP.vcxproj
src_SigProc_FIX/src_SigProc_FIX.vcxproj
src_SigProc_FLP/src_SigProc_FLP.vcxproj
src_common/SKP_Silk_dec_API.c
src_common/src_common.vcxproj
test/Decoder.c
test/Encoder.c
test_silk_dec/test_silk_dec.vcxproj
test_silk_enc/test_silk_enc.vcxproj

index 36c57c7..057d3b4 100644 (file)
@@ -46,24 +46,6 @@ SKP_int SKP_Silk_encode_frame_FIX(
 \r
 TIC(ENCODE_FRAME)\r
 \r
-    if( psEnc->sCmn.nFramesAnalyzed == 0 && !psEnc->sCmn.prefillFlag && !( psEnc->sCmn.useDTX && psEnc->sCmn.inDTX ) ) {\r
-        /* Create space at start of payload for VAD and FEC flags */\r
-        SKP_uint8 iCDF[ 2 ] = { 0, 0 };\r
-        iCDF[ 0 ] = 256 - SKP_RSHIFT( 256, psEnc->sCmn.nFramesPerPacket + 1 );\r
-        ec_enc_icdf( psRangeEnc, 0, iCDF, 8 );\r
-\r
-        /* Encode any LBRR data from previous packet */\r
-        SKP_Silk_LBRR_embed( &psEnc->sCmn, psRangeEnc );\r
-\r
-        /* Reduce coding SNR depending on how many bits used by LBRR */\r
-        nBits = ec_tell( psRangeEnc );\r
-        psEnc->inBandFEC_SNR_comp_Q7 = SKP_DIV32_16( SKP_SMULBB( SKP_FIX_CONST( 6.0f, 7 ), nBits ), \r
-            SKP_SMULBB( psEnc->sCmn.nFramesPerPacket, psEnc->sCmn.frame_length ) );\r
-\r
-        /* Reset LBRR flags */\r
-        SKP_memset( psEnc->sCmn.LBRR_flags, 0, sizeof( psEnc->sCmn.LBRR_flags ) );\r
-    }\r
-\r
     psEnc->sCmn.indices.Seed = psEnc->sCmn.frameCounter++ & 3;\r
 \r
     /**************************************************************/\r
@@ -101,6 +83,24 @@ TOC(VAD)
         psEnc->sCmn.VAD_flags[ psEnc->sCmn.nFramesAnalyzed ] = 1;\r
     }\r
 \r
+    if( psEnc->sCmn.nFramesAnalyzed == 0 && !psEnc->sCmn.prefillFlag && !( psEnc->sCmn.useDTX && psEnc->sCmn.inDTX ) ) {\r
+        /* Create space at start of payload for VAD and FEC flags */\r
+        SKP_uint8 iCDF[ 2 ] = { 0, 0 };\r
+        iCDF[ 0 ] = 256 - SKP_RSHIFT( 256, psEnc->sCmn.nFramesPerPacket + 1 );\r
+        ec_enc_icdf( psRangeEnc, 0, iCDF, 8 );\r
+\r
+        /* Encode any LBRR data from previous packet */\r
+        SKP_Silk_LBRR_embed( &psEnc->sCmn, psRangeEnc );\r
+\r
+        /* Reduce coding SNR depending on how many bits used by LBRR */\r
+        nBits = ec_tell( psRangeEnc );\r
+        psEnc->inBandFEC_SNR_comp_Q7 = SKP_DIV32_16( SKP_SMULBB( SKP_FIX_CONST( 6.0f, 7 ), nBits ), \r
+            SKP_SMULBB( psEnc->sCmn.nFramesPerPacket, psEnc->sCmn.frame_length ) );\r
+\r
+        /* Reset LBRR flags */\r
+        SKP_memset( psEnc->sCmn.LBRR_flags, 0, sizeof( psEnc->sCmn.LBRR_flags ) );\r
+    }\r
+\r
     /*******************************************/\r
     /* High-pass filtering of the input signal */\r
     /*******************************************/\r
index 15da4c6..ece080e 100644 (file)
@@ -45,7 +45,7 @@
       <WarningLevel>Level3</WarningLevel>\r
       <Optimization>Disabled</Optimization>\r
       <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <AdditionalIncludeDirectories>../interface;../src_SigProc_FIX;../src_common;../../celt/libcelt</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories>../interface;../src_SigProc_FIX;../src_common;../../celt/msvc;../../celt/libcelt</AdditionalIncludeDirectories>\r
     </ClCompile>\r
     <Link>\r
       <SubSystem>Windows</SubSystem>\r
@@ -61,7 +61,7 @@
       <FunctionLevelLinking>true</FunctionLevelLinking>\r
       <IntrinsicFunctions>true</IntrinsicFunctions>\r
       <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <AdditionalIncludeDirectories>../interface;../src_SigProc_FIX;../src_common;../../celt/libcelt</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories>../interface;../src_SigProc_FIX;../src_common;../../celt/msvc;../../celt/libcelt</AdditionalIncludeDirectories>\r
     </ClCompile>\r
     <Link>\r
       <SubSystem>Windows</SubSystem>\r
index c80bcbe..2bc74a6 100644 (file)
@@ -95,14 +95,13 @@ TOC(VAD)
 \r
         /* Reduce coding SNR depending on how many bits used by LBRR */\r
         nBits = ec_tell( psRangeEnc );\r
-        psEnc->inBandFEC_SNR_comp = ( 6.0f * nBits ) /\r
-                ( psEnc->sCmn.nFramesPerPacket * psEnc->sCmn.frame_length );\r
+        psEnc->inBandFEC_SNR_comp = ( 6.0f * nBits ) / \r
+            ( psEnc->sCmn.nFramesPerPacket * psEnc->sCmn.frame_length );\r
 \r
         /* Reset LBRR flags */\r
         SKP_memset( psEnc->sCmn.LBRR_flags, 0, sizeof( psEnc->sCmn.LBRR_flags ) );\r
     }\r
 \r
-\r
     /*******************************************/\r
     /* High-pass filtering of the input signal */\r
     /*******************************************/\r
index 256ba7a..576fe4f 100644 (file)
@@ -45,7 +45,7 @@
       <WarningLevel>Level3</WarningLevel>\r
       <Optimization>Disabled</Optimization>\r
       <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <AdditionalIncludeDirectories>../interface;../src_SigProc_FLP;../src_SigProc_FIX;../src_common;../../celt/libcelt</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories>../interface;../src_SigProc_FLP;../src_SigProc_FIX;../src_common;../../celt/msvc;../../celt/libcelt</AdditionalIncludeDirectories>\r
     </ClCompile>\r
     <Link>\r
       <SubSystem>Windows</SubSystem>\r
@@ -61,7 +61,7 @@
       <FunctionLevelLinking>true</FunctionLevelLinking>\r
       <IntrinsicFunctions>true</IntrinsicFunctions>\r
       <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <AdditionalIncludeDirectories>../interface;../src_SigProc_FLP;../src_SigProc_FIX;../src_common;../../celt/libcelt</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories>../interface;../src_SigProc_FLP;../src_SigProc_FIX;../src_common;../../celt/msvc;../../celt/libcelt</AdditionalIncludeDirectories>\r
     </ClCompile>\r
     <Link>\r
       <SubSystem>Windows</SubSystem>\r
index ca8d789..fb9df8d 100644 (file)
@@ -45,7 +45,7 @@
       <WarningLevel>Level3</WarningLevel>\r
       <Optimization>Disabled</Optimization>\r
       <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <AdditionalIncludeDirectories>../interface;H:\Work\Codecs_silk_celt_experiments\ietfcodec\celt\libcelt</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories>../interface;..\..\celt\libcelt</AdditionalIncludeDirectories>\r
     </ClCompile>\r
     <Link>\r
       <SubSystem>Windows</SubSystem>\r
@@ -61,7 +61,7 @@
       <FunctionLevelLinking>true</FunctionLevelLinking>\r
       <IntrinsicFunctions>true</IntrinsicFunctions>\r
       <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <AdditionalIncludeDirectories>../interface;H:\Work\Codecs_silk_celt_experiments\ietfcodec\celt\libcelt</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories>../interface;..\..\celt\libcelt</AdditionalIncludeDirectories>\r
     </ClCompile>\r
     <Link>\r
       <SubSystem>Windows</SubSystem>\r
index 9284850..c566243 100644 (file)
@@ -45,7 +45,7 @@
       <WarningLevel>Level3</WarningLevel>\r
       <Optimization>Disabled</Optimization>\r
       <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <AdditionalIncludeDirectories>H:\Work\Codecs_silk_celt_experiments\ietfcodec\celt\libcelt;../interface;../src_SigProc_FIX</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories>..\..\celt\libcelt;../interface;../src_SigProc_FIX</AdditionalIncludeDirectories>\r
     </ClCompile>\r
     <Link>\r
       <SubSystem>Windows</SubSystem>\r
@@ -61,7 +61,7 @@
       <FunctionLevelLinking>true</FunctionLevelLinking>\r
       <IntrinsicFunctions>true</IntrinsicFunctions>\r
       <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <AdditionalIncludeDirectories>H:\Work\Codecs_silk_celt_experiments\ietfcodec\celt\libcelt;../interface;../src_SigProc_FIX</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories>..\..\celt\libcelt;../interface;../src_SigProc_FIX</AdditionalIncludeDirectories>\r
     </ClCompile>\r
     <Link>\r
       <SubSystem>Windows</SubSystem>\r
index ebf6250..ce03b9e 100644 (file)
@@ -25,6 +25,9 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
 ***********************************************************************/\r
 \r
+#ifdef HAVE_CONFIG_H\r
+#include "config.h"\r
+#endif\r
 #include "SKP_Silk_SDK_API.h"\r
 #include "SKP_Silk_main.h"\r
 \r
index e0e2bdc..c90bf51 100644 (file)
@@ -45,7 +45,7 @@
       <WarningLevel>Level3</WarningLevel>\r
       <Optimization>Disabled</Optimization>\r
       <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <AdditionalIncludeDirectories>../interface/;../src_SigProc_FIX;../src_SigProc_FLP;../src_FIX;../src_FLP;../../celt/libcelt</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories>../interface/;../src_SigProc_FIX;../src_SigProc_FLP;../src_FIX;../src_FLP;../../celt/libcelt;../../celt/msvc</AdditionalIncludeDirectories>\r
     </ClCompile>\r
     <Link>\r
       <SubSystem>Windows</SubSystem>\r
@@ -61,7 +61,7 @@
       <FunctionLevelLinking>true</FunctionLevelLinking>\r
       <IntrinsicFunctions>true</IntrinsicFunctions>\r
       <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <AdditionalIncludeDirectories>../interface/;../src_SigProc_FIX;../src_SigProc_FLP;../src_FIX;../src_FLP;../../celt/libcelt</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories>../interface/;../src_SigProc_FIX;../src_SigProc_FLP;../src_FIX;../src_FLP;../../celt/libcelt;../../celt/msvc</AdditionalIncludeDirectories>\r
     </ClCompile>\r
     <Link>\r
       <SubSystem>Windows</SubSystem>\r
index 5fc8c2e..51a6b89 100644 (file)
@@ -37,6 +37,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include <stdio.h>\r
 #include <stdlib.h>\r
 #include <string.h>\r
+\r
+#ifdef HAVE_CONFIG_H\r
+#include "config.h"\r
+#endif \r
+\r
 #include "SKP_Silk_SDK_API.h"\r
 #include "../src_SigProc_FIX/SKP_Silk_SigProc_FIX.h"\r
 \r
index ef344b1..c1566cf 100644 (file)
@@ -38,6 +38,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include <stdlib.h>\r
 #include <string.h>\r
 #include <math.h>\r
+\r
+#ifdef HAVE_CONFIG_H\r
+#include "config.h"\r
+#endif \r
+\r
 #include "SKP_Silk_SDK_API.h"\r
 #include "../src_SigProc_FIX/SKP_Silk_SigProc_FIX.h"\r
 \r
index 7cdf9af..dddc378 100644 (file)
@@ -50,7 +50,7 @@
       <WarningLevel>Level3</WarningLevel>\r
       <Optimization>Disabled</Optimization>\r
       <PreprocessorDefinitions>WIN32;HAVE_CONFIG_H;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <AdditionalIncludeDirectories>..\interface;..\..\celt\libcelt;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories>..\interface;..\..\celt\libcelt;../../celt/msvc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
     </ClCompile>\r
     <Link>\r
       <SubSystem>Console</SubSystem>\r
@@ -68,7 +68,7 @@
       <FunctionLevelLinking>true</FunctionLevelLinking>\r
       <IntrinsicFunctions>true</IntrinsicFunctions>\r
       <PreprocessorDefinitions>WIN32;HAVE_CONFIG_H;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <AdditionalIncludeDirectories>..\interface;..\..\celt\libcelt;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories>..\interface;..\..\celt\libcelt;../../celt/msvc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
     </ClCompile>\r
     <Link>\r
       <SubSystem>Console</SubSystem>\r
index cf33d59..96f216d 100644 (file)
@@ -50,7 +50,7 @@
       <WarningLevel>Level3</WarningLevel>\r
       <Optimization>Disabled</Optimization>\r
       <PreprocessorDefinitions>WIN32;HAVE_CONFIG_H;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <AdditionalIncludeDirectories>..\interface;..\..\celt\libcelt;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories>..\interface;..\..\celt\libcelt;../../celt/msvc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
     </ClCompile>\r
     <Link>\r
       <SubSystem>Console</SubSystem>\r
@@ -68,7 +68,7 @@
       <FunctionLevelLinking>true</FunctionLevelLinking>\r
       <IntrinsicFunctions>true</IntrinsicFunctions>\r
       <PreprocessorDefinitions>WIN32;HAVE_CONFIG_H;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <AdditionalIncludeDirectories>..\interface;..\..\celt\libcelt;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories>..\interface;..\..\celt\libcelt;../../celt/msvc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
     </ClCompile>\r
     <Link>\r
       <SubSystem>Console</SubSystem>\r