Fixes a minor issue on CELT->SILK switching
authorJean-Marc Valin <jmvalin@jmvalin.ca>
Mon, 31 Oct 2011 23:51:47 +0000 (19:51 -0400)
committerJean-Marc Valin <jmvalin@jmvalin.ca>
Mon, 31 Oct 2011 23:51:47 +0000 (19:51 -0400)
celt/celt.vcxproj
silk/fixed/encode_frame_FIX.c
silk/float/encode_frame_FLP.c

index f5b12d3..61a568a 100644 (file)
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
-  <ItemGroup Label="ProjectConfigurations">\r
-    <ProjectConfiguration Include="Debug|Win32">\r
-      <Configuration>Debug</Configuration>\r
-      <Platform>Win32</Platform>\r
-    </ProjectConfiguration>\r
-    <ProjectConfiguration Include="Release|Win32">\r
-      <Configuration>Release</Configuration>\r
-      <Platform>Win32</Platform>\r
-    </ProjectConfiguration>\r
-  </ItemGroup>\r
-  <PropertyGroup Label="Globals">\r
-    <ProjectGuid>{245603E3-F580-41A5-9632-B25FE3372CBF}</ProjectGuid>\r
-    <Keyword>Win32Proj</Keyword>\r
-    <RootNamespace>celt</RootNamespace>\r
-  </PropertyGroup>\r
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
-    <ConfigurationType>StaticLibrary</ConfigurationType>\r
-    <UseDebugLibraries>true</UseDebugLibraries>\r
-    <CharacterSet>Unicode</CharacterSet>\r
-  </PropertyGroup>\r
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
-    <ConfigurationType>StaticLibrary</ConfigurationType>\r
-    <UseDebugLibraries>false</UseDebugLibraries>\r
-    <WholeProgramOptimization>true</WholeProgramOptimization>\r
-    <CharacterSet>Unicode</CharacterSet>\r
-  </PropertyGroup>\r
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
-  <ImportGroup Label="ExtensionSettings">\r
-  </ImportGroup>\r
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
-  </ImportGroup>\r
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
-  </ImportGroup>\r
-  <PropertyGroup Label="UserMacros" />\r
-  <PropertyGroup />\r
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
-    <ClCompile>\r
-      <PrecompiledHeader>\r
-      </PrecompiledHeader>\r
-      <WarningLevel>Level3</WarningLevel>\r
-      <Optimization>Disabled</Optimization>\r
-      <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <AdditionalIncludeDirectories>..\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-    </ClCompile>\r
-    <Link>\r
-      <SubSystem>Windows</SubSystem>\r
-      <GenerateDebugInformation>true</GenerateDebugInformation>\r
-    </Link>\r
-  </ItemDefinitionGroup>\r
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
-    <ClCompile>\r
-      <WarningLevel>Level3</WarningLevel>\r
-      <PrecompiledHeader>\r
-      </PrecompiledHeader>\r
-      <Optimization>MaxSpeed</Optimization>\r
-      <FunctionLevelLinking>true</FunctionLevelLinking>\r
-      <IntrinsicFunctions>true</IntrinsicFunctions>\r
-      <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <AdditionalIncludeDirectories>..\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-    </ClCompile>\r
-    <Link>\r
-      <SubSystem>Windows</SubSystem>\r
-      <GenerateDebugInformation>true</GenerateDebugInformation>\r
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
-      <OptimizeReferences>true</OptimizeReferences>\r
-    </Link>\r
-  </ItemDefinitionGroup>\r
-  <ItemGroup>\r
-    <None Include="ReadMe.txt" />\r
-  </ItemGroup>\r
-  <ItemGroup>\r
-    <ClInclude Include="..\..\win32\config.h" />\r
-    <ClInclude Include="arch.h" />\r
-    <ClInclude Include="bands.h" />\r
-    <ClInclude Include="celt.h" />\r
-    <ClInclude Include="celt_header.h" />\r
-    <ClInclude Include="celt_types.h" />\r
-    <ClInclude Include="cwrs.h" />\r
-    <ClInclude Include="ecintrin.h" />\r
-    <ClInclude Include="entcode.h" />\r
-    <ClInclude Include="entdec.h" />\r
-    <ClInclude Include="entenc.h" />\r
-    <ClInclude Include="fixed_debug.h" />\r
-    <ClInclude Include="fixed_generic.h" />\r
-    <ClInclude Include="float_cast.h" />\r
-    <ClInclude Include="kiss_fft.h" />\r
-    <ClInclude Include="laplace.h" />\r
-    <ClInclude Include="mathops.h" />\r
-    <ClInclude Include="mdct.h" />\r
-    <ClInclude Include="modes.h" />\r
-    <ClInclude Include="os_support.h" />\r
-    <ClInclude Include="pitch.h" />\r
-    <ClInclude Include="celt_lpc.h" />\r
-    <ClInclude Include="quant_bands.h" />\r
-    <ClInclude Include="rate.h" />\r
-    <ClInclude Include="stack_alloc.h" />\r
-    <ClInclude Include="vq.h" />\r
-  </ItemGroup>\r
-  <ItemGroup>\r
-    <ClCompile Include="bands.c" />\r
-    <ClCompile Include="celt.c" />\r
-    <ClCompile Include="cwrs.c" />\r
-    <ClCompile Include="entcode.c" />\r
-    <ClCompile Include="entdec.c" />\r
-    <ClCompile Include="entenc.c" />\r
-    <ClCompile Include="kiss_fft.c" />\r
-    <ClCompile Include="laplace.c" />\r
-    <ClCompile Include="mathops.c" />\r
-    <ClCompile Include="mdct.c" />\r
-    <ClCompile Include="modes.c" />\r
-    <ClCompile Include="pitch.c" />\r
-    <ClCompile Include="celt_lpc.c" />\r
-    <ClCompile Include="quant_bands.c" />\r
-    <ClCompile Include="rate.c" />\r
-    <ClCompile Include="vq.c" />\r
-  </ItemGroup>\r
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
-  <ImportGroup Label="ExtensionTargets">\r
-  </ImportGroup>\r
-</Project>\r
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{245603E3-F580-41A5-9632-B25FE3372CBF}</ProjectGuid>
+    <Keyword>Win32Proj</Keyword>
+    <RootNamespace>celt</RootNamespace>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup />
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>../win32;../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>../win32;../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <None Include="ReadMe.txt" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\win32\config.h" />
+    <ClInclude Include="arch.h" />
+    <ClInclude Include="bands.h" />
+    <ClInclude Include="celt.h" />
+    <ClInclude Include="celt_header.h" />
+    <ClInclude Include="celt_types.h" />
+    <ClInclude Include="cwrs.h" />
+    <ClInclude Include="ecintrin.h" />
+    <ClInclude Include="entcode.h" />
+    <ClInclude Include="entdec.h" />
+    <ClInclude Include="entenc.h" />
+    <ClInclude Include="fixed_debug.h" />
+    <ClInclude Include="fixed_generic.h" />
+    <ClInclude Include="float_cast.h" />
+    <ClInclude Include="kiss_fft.h" />
+    <ClInclude Include="laplace.h" />
+    <ClInclude Include="mathops.h" />
+    <ClInclude Include="mdct.h" />
+    <ClInclude Include="modes.h" />
+    <ClInclude Include="os_support.h" />
+    <ClInclude Include="pitch.h" />
+    <ClInclude Include="celt_lpc.h" />
+    <ClInclude Include="quant_bands.h" />
+    <ClInclude Include="rate.h" />
+    <ClInclude Include="stack_alloc.h" />
+    <ClInclude Include="vq.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="bands.c" />
+    <ClCompile Include="celt.c" />
+    <ClCompile Include="cwrs.c" />
+    <ClCompile Include="entcode.c" />
+    <ClCompile Include="entdec.c" />
+    <ClCompile Include="entenc.c" />
+    <ClCompile Include="kiss_fft.c" />
+    <ClCompile Include="laplace.c" />
+    <ClCompile Include="mathops.c" />
+    <ClCompile Include="mdct.c" />
+    <ClCompile Include="modes.c" />
+    <ClCompile Include="pitch.c" />
+    <ClCompile Include="celt_lpc.c" />
+    <ClCompile Include="quant_bands.c" />
+    <ClCompile Include="rate.c" />
+    <ClCompile Include="vq.c" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
index 6d27916..855abdf 100644 (file)
@@ -119,47 +119,37 @@ opus_int silk_encode_frame_FIX(
     /*******************************************/
     silk_memcpy( x_frame + LA_SHAPE_MS * psEnc->sCmn.fs_kHz, psEnc->sCmn.inputBuf + 1, psEnc->sCmn.frame_length * sizeof( opus_int16 ) );
 
-    /*****************************************/
-    /* Find pitch lags, initial LPC analysis */
-    /*****************************************/
-    silk_find_pitch_lags_FIX( psEnc, &sEncCtrl, res_pitch, x_frame );
+    if( !psEnc->sCmn.prefillFlag ) {
+        /*****************************************/
+        /* Find pitch lags, initial LPC analysis */
+        /*****************************************/
+        silk_find_pitch_lags_FIX( psEnc, &sEncCtrl, res_pitch, x_frame );
 
-    /************************/
-    /* Noise shape analysis */
-    /************************/
-    silk_noise_shape_analysis_FIX( psEnc, &sEncCtrl, res_pitch_frame, x_frame );
+        /************************/
+        /* Noise shape analysis */
+        /************************/
+        silk_noise_shape_analysis_FIX( psEnc, &sEncCtrl, res_pitch_frame, x_frame );
 
-    /***************************************************/
-    /* Find linear prediction coefficients (LPC + LTP) */
-    /***************************************************/
-    silk_find_pred_coefs_FIX( psEnc, &sEncCtrl, res_pitch, x_frame, condCoding );
+        /***************************************************/
+        /* Find linear prediction coefficients (LPC + LTP) */
+        /***************************************************/
+        silk_find_pred_coefs_FIX( psEnc, &sEncCtrl, res_pitch, x_frame, condCoding );
 
-    /****************************************/
-    /* Process gains                        */
-    /****************************************/
-    silk_process_gains_FIX( psEnc, &sEncCtrl, condCoding );
+        /****************************************/
+        /* Process gains                        */
+        /****************************************/
+        silk_process_gains_FIX( psEnc, &sEncCtrl, condCoding );
 
-    /*****************************************/
-    /* Prefiltering for noise shaper         */
-    /*****************************************/
-    silk_prefilter_FIX( psEnc, &sEncCtrl, xfw, x_frame );
+        /*****************************************/
+        /* Prefiltering for noise shaper         */
+        /*****************************************/
+        silk_prefilter_FIX( psEnc, &sEncCtrl, xfw, x_frame );
 
-    /****************************************/
-    /* Low Bitrate Redundant Encoding       */
-    /****************************************/
-    silk_LBRR_encode_FIX( psEnc, &sEncCtrl, xfw, condCoding );
+        /****************************************/
+        /* Low Bitrate Redundant Encoding       */
+        /****************************************/
+        silk_LBRR_encode_FIX( psEnc, &sEncCtrl, xfw, condCoding );
 
-    if( psEnc->sCmn.prefillFlag ) {
-        if( psEnc->sCmn.nStatesDelayedDecision > 1 || psEnc->sCmn.warping_Q16 > 0 ) {
-            silk_NSQ_del_dec( &psEnc->sCmn, &psEnc->sCmn.sNSQ, &psEnc->sCmn.indices, xfw, psEnc->sCmn.pulses,
-                   sEncCtrl.PredCoef_Q12[ 0 ], sEncCtrl.LTPCoef_Q14, sEncCtrl.AR2_Q13, sEncCtrl.HarmShapeGain_Q14,
-                   sEncCtrl.Tilt_Q14, sEncCtrl.LF_shp_Q14, sEncCtrl.Gains_Q16, sEncCtrl.pitchL, sEncCtrl.Lambda_Q10, sEncCtrl.LTP_scale_Q14 );
-        } else {
-            silk_NSQ( &psEnc->sCmn, &psEnc->sCmn.sNSQ, &psEnc->sCmn.indices, xfw, psEnc->sCmn.pulses,
-                   sEncCtrl.PredCoef_Q12[ 0 ], sEncCtrl.LTPCoef_Q14, sEncCtrl.AR2_Q13, sEncCtrl.HarmShapeGain_Q14,
-                   sEncCtrl.Tilt_Q14, sEncCtrl.LF_shp_Q14, sEncCtrl.Gains_Q16, sEncCtrl.pitchL, sEncCtrl.Lambda_Q10, sEncCtrl.LTP_scale_Q14 );
-        }
-    } else {
         /* Loop over quantizer and entropy coding to control bitrate */
         maxIter = 5;
         gainMult_Q8 = SILK_FIX_CONST( 1, 8 );
index 08f3aa8..ccf5d0a 100644 (file)
@@ -128,39 +128,37 @@ opus_int silk_encode_frame_FLP(
         x_frame[ LA_SHAPE_MS * psEnc->sCmn.fs_kHz + i * ( psEnc->sCmn.frame_length >> 3 ) ] += ( 1 - ( i & 2 ) ) * 1e-6f;
     }
 
-    /*****************************************/
-    /* Find pitch lags, initial LPC analysis */
-    /*****************************************/
-    silk_find_pitch_lags_FLP( psEnc, &sEncCtrl, res_pitch, x_frame );
+    if( !psEnc->sCmn.prefillFlag ) {
+        /*****************************************/
+        /* Find pitch lags, initial LPC analysis */
+        /*****************************************/
+        silk_find_pitch_lags_FLP( psEnc, &sEncCtrl, res_pitch, x_frame );
 
-    /************************/
-    /* Noise shape analysis */
-    /************************/
-    silk_noise_shape_analysis_FLP( psEnc, &sEncCtrl, res_pitch_frame, x_frame );
+        /************************/
+        /* Noise shape analysis */
+        /************************/
+        silk_noise_shape_analysis_FLP( psEnc, &sEncCtrl, res_pitch_frame, x_frame );
 
-    /***************************************************/
-    /* Find linear prediction coefficients (LPC + LTP) */
-    /***************************************************/
-    silk_find_pred_coefs_FLP( psEnc, &sEncCtrl, res_pitch, x_frame, condCoding );
+        /***************************************************/
+        /* Find linear prediction coefficients (LPC + LTP) */
+        /***************************************************/
+        silk_find_pred_coefs_FLP( psEnc, &sEncCtrl, res_pitch, x_frame, condCoding );
 
-    /****************************************/
-    /* Process gains                        */
-    /****************************************/
-    silk_process_gains_FLP( psEnc, &sEncCtrl, condCoding );
+        /****************************************/
+        /* Process gains                        */
+        /****************************************/
+        silk_process_gains_FLP( psEnc, &sEncCtrl, condCoding );
 
-    /*****************************************/
-    /* Prefiltering for noise shaper         */
-    /*****************************************/
-    silk_prefilter_FLP( psEnc, &sEncCtrl, xfw, x_frame );
+        /*****************************************/
+        /* Prefiltering for noise shaper         */
+        /*****************************************/
+        silk_prefilter_FLP( psEnc, &sEncCtrl, xfw, x_frame );
 
-    /****************************************/
-    /* Low Bitrate Redundant Encoding       */
-    /****************************************/
-    silk_LBRR_encode_FLP( psEnc, &sEncCtrl, xfw, condCoding );
+        /****************************************/
+        /* Low Bitrate Redundant Encoding       */
+        /****************************************/
+        silk_LBRR_encode_FLP( psEnc, &sEncCtrl, xfw, condCoding );
 
-    if( psEnc->sCmn.prefillFlag ) {
-        silk_NSQ_wrapper_FLP( psEnc, &sEncCtrl, &psEnc->sCmn.indices, &psEnc->sCmn.sNSQ, psEnc->sCmn.pulses, xfw );
-    } else {
         /* Loop over quantizer and entroy coding to control bitrate */
         maxIter = 5;
         gainMult_Q8 = SILK_FIX_CONST( 1, 8 );