ref: 494ce976e20d4854af2918ac8bae2b1bb10dc33f
parent: fe741259c1050baa5c828444dd5a968ed658d1fb
author: Koen Vos <[email protected]>
date: Mon May 2 06:01:10 EDT 2011
Squashed commit of the following: commit dfe4d46f9abf6b0e96e66370d428da4e283204ce Author: Jean-Marc Valin <[email protected]> Date: Mon May 2 09:59:45 2011 -0400 SILK file list update commit 5faf541d86445eb8ce1775ea206e88afe83c7107 Author: Jean-Marc Valin <[email protected]> Date: Mon May 2 09:51:29 2011 -0400 Makefiles update commit f5d70b3ccbe209cc07a1a604fffca93ea34bc64b Author: Koen Vos <[email protected]> Date: Mon May 2 09:50:33 2011 -0400 SILK stereo update and MSVC build update
--- a/Makefile.draft
+++ b/Makefile.draft
@@ -62,6 +62,8 @@
# Directives
CINCLUDES += silk/ \
+ silk/float/ \
+ silk/fixed/ \
libcelt/ \
src/
--- a/libcelt/libcelt.vcxproj
+++ b/libcelt/libcelt.vcxproj
@@ -45,7 +45,7 @@
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\msvc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>..\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@@ -61,7 +61,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\msvc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>..\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@@ -74,6 +74,7 @@
<None Include="ReadMe.txt" />
</ItemGroup>
<ItemGroup>
+ <ClInclude Include="..\..\win32\config.h" />
<ClInclude Include="..\msvc\config.h" />
<ClInclude Include="arch.h" />
<ClInclude Include="bands.h" />
--- a/libcelt/libcelt.vcxproj.filters
+++ b/libcelt/libcelt.vcxproj.filters
@@ -96,6 +96,9 @@
<ClInclude Include="..\msvc\config.h">
<Filter>Header Files</Filter>
</ClInclude>
+ <ClInclude Include="..\..\win32\config.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="bands.c">
--- a/opus.sln
+++ b/opus.sln
@@ -1,44 +1,16 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "opus", "src\hybrid.vcxproj", "{219EC965-228A-1824-174D-96449D05F88A}"
- ProjectSection(ProjectDependencies) = postProject
- {8484C90D-1561-402F-A91D-2DB10F8C5171} = {8484C90D-1561-402F-A91D-2DB10F8C5171}
- {9C4961D2-5DDB-40C7-9BE8-CA918DC4E782} = {9C4961D2-5DDB-40C7-9BE8-CA918DC4E782}
- {245603E3-F580-41A5-9632-B25FE3372CBF} = {245603E3-F580-41A5-9632-B25FE3372CBF}
- {C303D2FC-FF97-49B8-9DDD-467B4C9A0B16} = {C303D2FC-FF97-49B8-9DDD-467B4C9A0B16}
- EndProjectSection
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "silk_common", "silk\silk_common.vcxproj", "{C303D2FC-FF97-49B8-9DDD-467B4C9A0B16}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcelt", "celt\libcelt\libcelt.vcxproj", "{245603E3-F580-41A5-9632-B25FE3372CBF}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "opus", "src\opus.vcxproj", "{219EC965-228A-1824-174D-96449D05F88A}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "src_common", "silk\src_common\src_common.vcxproj", "{C303D2FC-FF97-49B8-9DDD-467B4C9A0B16}"
- ProjectSection(ProjectDependencies) = postProject
- {245603E3-F580-41A5-9632-B25FE3372CBF} = {245603E3-F580-41A5-9632-B25FE3372CBF}
- EndProjectSection
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "silk_fixed", "silk\fixed\silk_fixed.vcxproj", "{8484C90D-1561-402F-A91D-2DB10F8C5171}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "src_SigProc_FIX", "silk\src_SigProc_FIX\src_SigProc_FIX.vcxproj", "{950F7176-3D29-4CBF-8C40-58B918EAEBB2}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "silk_float", "silk\float\silk_float.vcxproj", "{9C4961D2-5DDB-40C7-9BE8-CA918DC4E782}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "src_SigProc_FLP", "silk\src_SigProc_FLP\src_SigProc_FLP.vcxproj", "{06D10292-A23C-4C5E-9C0F-28737769206F}"
- ProjectSection(ProjectDependencies) = postProject
- {950F7176-3D29-4CBF-8C40-58B918EAEBB2} = {950F7176-3D29-4CBF-8C40-58B918EAEBB2}
- EndProjectSection
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcelt", "libcelt\libcelt.vcxproj", "{245603E3-F580-41A5-9632-B25FE3372CBF}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "src_FIX", "silk\src_FIX\src_FIX.vcxproj", "{8484C90D-1561-402F-A91D-2DB10F8C5171}"
- ProjectSection(ProjectDependencies) = postProject
- {950F7176-3D29-4CBF-8C40-58B918EAEBB2} = {950F7176-3D29-4CBF-8C40-58B918EAEBB2}
- {06D10292-A23C-4C5E-9C0F-28737769206F} = {06D10292-A23C-4C5E-9C0F-28737769206F}
- {245603E3-F580-41A5-9632-B25FE3372CBF} = {245603E3-F580-41A5-9632-B25FE3372CBF}
- {C303D2FC-FF97-49B8-9DDD-467B4C9A0B16} = {C303D2FC-FF97-49B8-9DDD-467B4C9A0B16}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "src_FLP", "silk\src_FLP\src_FLP.vcxproj", "{9C4961D2-5DDB-40C7-9BE8-CA918DC4E782}"
- ProjectSection(ProjectDependencies) = postProject
- {950F7176-3D29-4CBF-8C40-58B918EAEBB2} = {950F7176-3D29-4CBF-8C40-58B918EAEBB2}
- {06D10292-A23C-4C5E-9C0F-28737769206F} = {06D10292-A23C-4C5E-9C0F-28737769206F}
- {245603E3-F580-41A5-9632-B25FE3372CBF} = {245603E3-F580-41A5-9632-B25FE3372CBF}
- {C303D2FC-FF97-49B8-9DDD-467B4C9A0B16} = {C303D2FC-FF97-49B8-9DDD-467B4C9A0B16}
- EndProjectSection
-EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@@ -45,26 +17,14 @@
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {219EC965-228A-1824-174D-96449D05F88A}.Debug|Win32.ActiveCfg = Debug|Win32
- {219EC965-228A-1824-174D-96449D05F88A}.Debug|Win32.Build.0 = Debug|Win32
- {219EC965-228A-1824-174D-96449D05F88A}.Release|Win32.ActiveCfg = Release|Win32
- {219EC965-228A-1824-174D-96449D05F88A}.Release|Win32.Build.0 = Release|Win32
- {245603E3-F580-41A5-9632-B25FE3372CBF}.Debug|Win32.ActiveCfg = Debug|Win32
- {245603E3-F580-41A5-9632-B25FE3372CBF}.Debug|Win32.Build.0 = Debug|Win32
- {245603E3-F580-41A5-9632-B25FE3372CBF}.Release|Win32.ActiveCfg = Release|Win32
- {245603E3-F580-41A5-9632-B25FE3372CBF}.Release|Win32.Build.0 = Release|Win32
{C303D2FC-FF97-49B8-9DDD-467B4C9A0B16}.Debug|Win32.ActiveCfg = Debug|Win32
{C303D2FC-FF97-49B8-9DDD-467B4C9A0B16}.Debug|Win32.Build.0 = Debug|Win32
{C303D2FC-FF97-49B8-9DDD-467B4C9A0B16}.Release|Win32.ActiveCfg = Release|Win32
{C303D2FC-FF97-49B8-9DDD-467B4C9A0B16}.Release|Win32.Build.0 = Release|Win32
- {950F7176-3D29-4CBF-8C40-58B918EAEBB2}.Debug|Win32.ActiveCfg = Debug|Win32
- {950F7176-3D29-4CBF-8C40-58B918EAEBB2}.Debug|Win32.Build.0 = Debug|Win32
- {950F7176-3D29-4CBF-8C40-58B918EAEBB2}.Release|Win32.ActiveCfg = Release|Win32
- {950F7176-3D29-4CBF-8C40-58B918EAEBB2}.Release|Win32.Build.0 = Release|Win32
- {06D10292-A23C-4C5E-9C0F-28737769206F}.Debug|Win32.ActiveCfg = Debug|Win32
- {06D10292-A23C-4C5E-9C0F-28737769206F}.Debug|Win32.Build.0 = Debug|Win32
- {06D10292-A23C-4C5E-9C0F-28737769206F}.Release|Win32.ActiveCfg = Release|Win32
- {06D10292-A23C-4C5E-9C0F-28737769206F}.Release|Win32.Build.0 = Release|Win32
+ {219EC965-228A-1824-174D-96449D05F88A}.Debug|Win32.ActiveCfg = Debug|Win32
+ {219EC965-228A-1824-174D-96449D05F88A}.Debug|Win32.Build.0 = Debug|Win32
+ {219EC965-228A-1824-174D-96449D05F88A}.Release|Win32.ActiveCfg = Release|Win32
+ {219EC965-228A-1824-174D-96449D05F88A}.Release|Win32.Build.0 = Release|Win32
{8484C90D-1561-402F-A91D-2DB10F8C5171}.Debug|Win32.ActiveCfg = Debug|Win32
{8484C90D-1561-402F-A91D-2DB10F8C5171}.Debug|Win32.Build.0 = Debug|Win32
{8484C90D-1561-402F-A91D-2DB10F8C5171}.Release|Win32.ActiveCfg = Release|Win32
@@ -73,6 +33,10 @@
{9C4961D2-5DDB-40C7-9BE8-CA918DC4E782}.Debug|Win32.Build.0 = Debug|Win32
{9C4961D2-5DDB-40C7-9BE8-CA918DC4E782}.Release|Win32.ActiveCfg = Release|Win32
{9C4961D2-5DDB-40C7-9BE8-CA918DC4E782}.Release|Win32.Build.0 = Release|Win32
+ {245603E3-F580-41A5-9632-B25FE3372CBF}.Debug|Win32.ActiveCfg = Debug|Win32
+ {245603E3-F580-41A5-9632-B25FE3372CBF}.Debug|Win32.Build.0 = Debug|Win32
+ {245603E3-F580-41A5-9632-B25FE3372CBF}.Release|Win32.ActiveCfg = Release|Win32
+ {245603E3-F580-41A5-9632-B25FE3372CBF}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
--- a/silk/SKP_Silk_Inlines.h
+++ b/silk/SKP_Silk_Inlines.h
@@ -151,7 +151,7 @@
/* Convert to Qres domain */
lshift = 29 + a_headrm - b_headrm - Qres;
- if( lshift <= 0 ) {
+ if( lshift < 0 ) {
return SKP_LSHIFT_SAT32(result, -lshift);
} else {
if( lshift < 32){
--- a/silk/SKP_Silk_LPC_analysis_filter.c
+++ b/silk/SKP_Silk_LPC_analysis_filter.c
@@ -73,7 +73,4 @@
/* Saturate output */
out[ ix ] = ( SKP_int16 )SKP_SAT16( out32 );
}
-
- /* Set first LPC d samples to zero instead of undefined */
- SKP_memset( out, 0, d * sizeof( SKP_int16 ) );
}
--- a/silk/SKP_Silk_LPC_inv_pred_gain_FLP.c
+++ /dev/null
@@ -1,81 +1,0 @@
-/***********************************************************************
-Copyright (c) 2006-2011, Skype Limited. All rights reserved.
-Redistribution and use in source and binary forms, with or without
-modification, (subject to the limitations in the disclaimer below)
-are permitted provided that the following conditions are met:
-- Redistributions of source code must retain the above copyright notice,
-this list of conditions and the following disclaimer.
-- Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
-- Neither the name of Skype Limited, nor the names of specific
-contributors, may be used to endorse or promote products derived from
-this software without specific prior written permission.
-NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED
-BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
-BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-***********************************************************************/
-
-/* *
- * SKP_Silk_LPC_inverse_pred_gain.c *
- * *
- * compute inverse of LPC prediction gain, and *
- * test if LPC coefficients are stable (all poles within unit circle) *
- * *
- * Copyright 2008 (c), Skype Limited *
- * */
-#include "SKP_Silk_SigProc_FIX.h"
-#include "SKP_Silk_SigProc_FLP.h"
-
-#define RC_THRESHOLD 0.9999f
-
-/* compute inverse of LPC prediction gain, and */
-/* test if LPC coefficients are stable (all poles within unit circle) */
-/* this code is based on SKP_Silk_a2k_FLP() */
-SKP_int SKP_Silk_LPC_inverse_pred_gain_FLP( /* O: returns 1 if unstable, otherwise 0 */
- SKP_float *invGain, /* O: inverse prediction gain, energy domain */
- const SKP_float *A, /* I: prediction coefficients [order] */
- SKP_int32 order /* I: prediction order */
-)
-{
- SKP_int k, n;
- double rc, rc_mult1, rc_mult2;
- SKP_float Atmp[ 2 ][ SKP_Silk_MAX_ORDER_LPC ];
- SKP_float *Aold, *Anew;
-
- Anew = Atmp[ order & 1 ];
- SKP_memcpy( Anew, A, order * sizeof(SKP_float) );
-
- *invGain = 1.0f;
- for( k = order - 1; k > 0; k-- ) {
- rc = -Anew[ k ];
- if (rc > RC_THRESHOLD || rc < -RC_THRESHOLD) {
- return 1;
- }
- rc_mult1 = 1.0f - rc * rc;
- rc_mult2 = 1.0f / rc_mult1;
- *invGain *= (SKP_float)rc_mult1;
- /* swap pointers */
- Aold = Anew;
- Anew = Atmp[ k & 1 ];
- for( n = 0; n < k; n++ ) {
- Anew[ n ] = (SKP_float)( ( Aold[ n ] - Aold[ k - n - 1 ] * rc ) * rc_mult2 );
- }
- }
- rc = -Anew[ 0 ];
- if ( rc > RC_THRESHOLD || rc < -RC_THRESHOLD ) {
- return 1;
- }
- rc_mult1 = 1.0f - rc * rc;
- *invGain *= (SKP_float)rc_mult1;
- return 0;
-}
--- a/silk/SKP_Silk_LP_variable_cutoff.c
+++ b/silk/SKP_Silk_LP_variable_cutoff.c
@@ -63,7 +63,6 @@
fac_Q16 );
}
} else { /* ( fac_Q16 - ( 1 << 16 ) ) is in range of a 16-bit int */
-
SKP_assert( fac_Q16 - ( 1 << 16 ) == SKP_SAT16( fac_Q16 - ( 1 << 16 ) ) );
/* Piece-wise linear interpolation of B and A */
for( nb = 0; nb < TRANSITION_NB; nb++ ) {
@@ -106,7 +105,7 @@
SKP_assert( psLP->transition_frame_no >= 0 && psLP->transition_frame_no <= TRANSITION_FRAMES );
- /* Interpolate filter coefficients if needed */
+ /* Run filter if needed */
if( psLP->mode != 0 ) {
/* Calculate index and interpolation factor for interpolation */
#if( TRANSITION_INT_STEPS == 64 )
--- a/silk/SKP_Silk_SigProc_FLP.h
+++ /dev/null
@@ -1,215 +1,0 @@
-/***********************************************************************
-Copyright (c) 2006-2011, Skype Limited. All rights reserved.
-Redistribution and use in source and binary forms, with or without
-modification, (subject to the limitations in the disclaimer below)
-are permitted provided that the following conditions are met:
-- Redistributions of source code must retain the above copyright notice,
-this list of conditions and the following disclaimer.
-- Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
-- Neither the name of Skype Limited, nor the names of specific
-contributors, may be used to endorse or promote products derived from
-this software without specific prior written permission.
-NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED
-BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
-BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-***********************************************************************/
-
-
-#ifndef _SKP_SILK_SIGPROC_FLP_H_
-#define _SKP_SILK_SIGPROC_FLP_H_
-
-#include "SKP_Silk_SigProc_FIX.h"
-#include "float_cast.h"
-#include <math.h>
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-/********************************************************************/
-/* SIGNAL PROCESSING FUNCTIONS */
-/********************************************************************/
-
-/* Chirp (bw expand) LP AR filter */
-void SKP_Silk_bwexpander_FLP(
- SKP_float *ar, /* io AR filter to be expanded (without leading 1) */
- const SKP_int d, /* i length of ar */
- const SKP_float chirp /* i chirp factor (typically in range (0..1) ) */
-);
-
-/* compute inverse of LPC prediction gain, and */
-/* test if LPC coefficients are stable (all poles within unit circle) */
-/* this code is based on SKP_Silk_FLP_a2k() */
-SKP_int SKP_Silk_LPC_inverse_pred_gain_FLP( /* O: returns 1 if unstable, otherwise 0 */
- SKP_float *invGain, /* O: inverse prediction gain, energy domain */
- const SKP_float *A, /* I: prediction coefficients [order] */
- SKP_int32 order /* I: prediction order */
-);
-
-SKP_float SKP_Silk_schur_FLP( /* O returns residual energy */
- SKP_float refl_coef[], /* O reflection coefficients (length order) */
- const SKP_float auto_corr[], /* I autocorrelation sequence (length order+1) */
- SKP_int order /* I order */
-);
-
-void SKP_Silk_k2a_FLP(
- SKP_float *A, /* O: prediction coefficients [order] */
- const SKP_float *rc, /* I: reflection coefficients [order] */
- SKP_int32 order /* I: prediction order */
-);
-
-/* Solve the normal equations using the Levinson-Durbin recursion */
-SKP_float SKP_Silk_levinsondurbin_FLP( /* O prediction error energy */
- SKP_float A[], /* O prediction coefficients [order] */
- const SKP_float corr[], /* I input auto-correlations [order + 1] */
- const SKP_int order /* I prediction order */
-);
-
-/* compute autocorrelation */
-void SKP_Silk_autocorrelation_FLP(
- SKP_float *results, /* o result (length correlationCount) */
- const SKP_float *inputData, /* i input data to correlate */
- SKP_int inputDataSize, /* i length of input */
- SKP_int correlationCount /* i number of correlation taps to compute */
-);
-
-/* Pitch estimator */
-#define SigProc_PE_MIN_COMPLEX 0
-#define SigProc_PE_MID_COMPLEX 1
-#define SigProc_PE_MAX_COMPLEX 2
-
-SKP_int SKP_Silk_pitch_analysis_core_FLP( /* O voicing estimate: 0 voiced, 1 unvoiced */
- const SKP_float *signal, /* I signal of length PE_FRAME_LENGTH_MS*Fs_kHz */
- SKP_int *pitch_out, /* O 4 pitch lag values */
- SKP_int16 *lagIndex, /* O lag Index */
- SKP_int8 *contourIndex, /* O pitch contour Index */
- SKP_float *LTPCorr, /* I/O normalized correlation; input: value from previous frame */
- SKP_int prevLag, /* I last lag of previous frame; set to zero is unvoiced */
- const SKP_float search_thres1, /* I first stage threshold for lag candidates 0 - 1 */
- const SKP_float search_thres2, /* I final threshold for lag candidates 0 - 1 */
- const SKP_int Fs_kHz, /* I sample frequency (kHz) */
- const SKP_int complexity, /* I Complexity setting, 0-2, where 2 is highest */
- const SKP_int nb_subfr /* I number of 5 ms subframes */
-);
-
-#define PI (3.1415926536f)
-
-void SKP_Silk_insertion_sort_decreasing_FLP(
- SKP_float *a, /* I/O: Unsorted / Sorted vector */
- SKP_int *index, /* O: Index vector for the sorted elements */
- const SKP_int L, /* I: Vector length */
- const SKP_int K /* I: Number of correctly sorted positions */
-);
-
-/* Compute reflection coefficients from input signal */
-SKP_float SKP_Silk_burg_modified_FLP( /* O returns residual energy */
- SKP_float A[], /* O prediction coefficients (length order) */
- const SKP_float x[], /* I input signal, length: nb_subfr*(D+L_sub) */
- const SKP_int subfr_length, /* I input signal subframe length (including D preceeding samples) */
- const SKP_int nb_subfr, /* I number of subframes stacked in x */
- const SKP_float WhiteNoiseFrac, /* I fraction added to zero-lag autocorrelation */
- const SKP_int D /* I order */
-);
-
-/* multiply a vector by a constant */
-void SKP_Silk_scale_vector_FLP(
- SKP_float *data1,
- SKP_float gain,
- SKP_int dataSize
-);
-
-/* copy and multiply a vector by a constant */
-void SKP_Silk_scale_copy_vector_FLP(
- SKP_float *data_out,
- const SKP_float *data_in,
- SKP_float gain,
- SKP_int dataSize
-);
-
-/* inner product of two SKP_float arrays, with result as double */
-double SKP_Silk_inner_product_FLP(
- const SKP_float *data1,
- const SKP_float *data2,
- SKP_int dataSize
-);
-
-/* sum of squares of a SKP_float array, with result as double */
-double SKP_Silk_energy_FLP(
- const SKP_float *data,
- SKP_int dataSize
-);
-
-/********************************************************************/
-/* MACROS */
-/********************************************************************/
-
-#define SKP_min_float(a, b) (((a) < (b)) ? (a) : (b))
-#define SKP_max_float(a, b) (((a) > (b)) ? (a) : (b))
-#define SKP_abs_float(a) ((SKP_float)fabs(a))
-
-#define SKP_LIMIT_float( a, limit1, limit2) ((limit1) > (limit2) ? ((a) > (limit1) ? (limit1) : ((a) < (limit2) ? (limit2) : (a))) \
- : ((a) > (limit2) ? (limit2) : ((a) < (limit1) ? (limit1) : (a))))
-
-/* sigmoid function */
-SKP_INLINE SKP_float SKP_sigmoid(SKP_float x)
-{
- return (SKP_float)(1.0 / (1.0 + exp(-x)));
-}
-
-/* floating-point to integer conversion (rounding) */
-#if 1
-/* use implementation in float_cast.h */
-#define SKP_float2int(x) float2int(x)
-#else
-SKP_INLINE SKP_int32 SKP_float2int(SKP_float x)
-{
- double y = x;
- return (SKP_int32)( ( y > 0 ) ? y + 0.5 : y - 0.5 );
-}
-#endif
-
-/* floating-point to integer conversion (rounding) */
-SKP_INLINE void SKP_float2short_array(
- SKP_int16 *out,
- const SKP_float *in,
- SKP_int32 length
-)
-{
- SKP_int32 k;
- for (k = length-1; k >= 0; k--) {
- out[k] = (SKP_int16)SKP_SAT16( float2int( in[k] ) );
- }
-}
-
-/* integer to floating-point conversion */
-SKP_INLINE void SKP_short2float_array(
- SKP_float *out,
- const SKP_int16 *in,
- SKP_int32 length
-)
-{
- SKP_int32 k;
- for (k = length-1; k >= 0; k--) {
- out[k] = (SKP_float)in[k];
- }
-}
-
-#define SKP_round(x) (SKP_float)((x)>=0 ? (SKP_int64)((x)+0.5) : (SKP_int64)((x)-0.5))
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
--- a/silk/SKP_Silk_assembler_FLP.h
+++ /dev/null
@@ -1,42 +1,0 @@
-/***********************************************************************
-Copyright (c) 2006-2011, Skype Limited. All rights reserved.
-Redistribution and use in source and binary forms, with or without
-modification, (subject to the limitations in the disclaimer below)
-are permitted provided that the following conditions are met:
-- Redistributions of source code must retain the above copyright notice,
-this list of conditions and the following disclaimer.
-- Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
-- Neither the name of Skype Limited, nor the names of specific
-contributors, may be used to endorse or promote products derived from
-this software without specific prior written permission.
-NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED
-BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
-BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-***********************************************************************/
-
-#ifndef SKP_SILK_ASSEMBLER_FLP_H
-#define SKP_SILK_ASSEMBLER_FLP_H
-
-#include "SKP_Silk_typedef.h"
-
-/* Declaration of assembler functions */
-
-void SKP_Silk_LPC_ana_sse(
- float *r_LPC, /* O LPC residual signal */
- const float *coefs, /* I LPC coefficients */
- const float *speech, /* I Input signal */
- int len /* I Length of input signal */
-);
-
-#endif
--- a/silk/SKP_Silk_autocorrelation_FLP.c
+++ /dev/null
@@ -1,48 +1,0 @@
-/***********************************************************************
-Copyright (c) 2006-2011, Skype Limited. All rights reserved.
-Redistribution and use in source and binary forms, with or without
-modification, (subject to the limitations in the disclaimer below)
-are permitted provided that the following conditions are met:
-- Redistributions of source code must retain the above copyright notice,
-this list of conditions and the following disclaimer.
-- Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
-- Neither the name of Skype Limited, nor the names of specific
-contributors, may be used to endorse or promote products derived from
-this software without specific prior written permission.
-NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED
-BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
-BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-***********************************************************************/
-
-#include "SKP_Silk_typedef.h"
-#include "SKP_Silk_SigProc_FLP.h"
-
-/* compute autocorrelation */
-void SKP_Silk_autocorrelation_FLP(
- SKP_float *results, /* O result (length correlationCount) */
- const SKP_float *inputData, /* I input data to correlate */
- SKP_int inputDataSize, /* I length of input */
- SKP_int correlationCount /* I number of correlation taps to compute */
-)
-{
- SKP_int i;
-
- if ( correlationCount > inputDataSize ) {
- correlationCount = inputDataSize;
- }
-
- for( i = 0; i < correlationCount; i++ ) {
- results[ i ] = (SKP_float)SKP_Silk_inner_product_FLP( inputData, inputData + i, inputDataSize - i );
- }
-}
--- a/silk/SKP_Silk_burg_modified_FLP.c
+++ /dev/null
@@ -1,154 +1,0 @@
-/***********************************************************************
-Copyright (c) 2006-2011, Skype Limited. All rights reserved.
-Redistribution and use in source and binary forms, with or without
-modification, (subject to the limitations in the disclaimer below)
-are permitted provided that the following conditions are met:
-- Redistributions of source code must retain the above copyright notice,
-this list of conditions and the following disclaimer.
-- Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
-- Neither the name of Skype Limited, nor the names of specific
-contributors, may be used to endorse or promote products derived from
-this software without specific prior written permission.
-NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED
-BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
-BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-***********************************************************************/
-
-/* *
- * SKP_Silk_burg_modified.c *
- * *
- * Calculates the reflection coefficients from the input vector *
- * Input vector contains nb_subfr sub vectors of length L_sub + D *
- * *
- * Copyright 2009 (c), Skype Limited *
- * Date: 091130 *
- */
-
-#include "SKP_Silk_SigProc_FLP.h"
-
-#define MAX_FRAME_SIZE 384 // subfr_length * nb_subfr = ( 0.005 * 16000 + 16 ) * 4 = 384
-#define MAX_NB_SUBFR 4
-
-/* Compute reflection coefficients from input signal */
-SKP_float SKP_Silk_burg_modified_FLP( /* O returns residual energy */
- SKP_float A[], /* O prediction coefficients (length order) */
- const SKP_float x[], /* I input signal, length: nb_subfr*(D+L_sub) */
- const SKP_int subfr_length, /* I input signal subframe length (including D preceeding samples) */
- const SKP_int nb_subfr, /* I number of subframes stacked in x */
- const SKP_float WhiteNoiseFrac, /* I fraction added to zero-lag autocorrelation */
- const SKP_int D /* I order */
-)
-{
- SKP_int k, n, s;
- double C0, num, nrg_f, nrg_b, rc, Atmp, tmp1, tmp2;
- const SKP_float *x_ptr;
- double C_first_row[ SKP_Silk_MAX_ORDER_LPC ], C_last_row[ SKP_Silk_MAX_ORDER_LPC ];
- double CAf[ SKP_Silk_MAX_ORDER_LPC + 1 ], CAb[ SKP_Silk_MAX_ORDER_LPC + 1 ];
- double Af[ SKP_Silk_MAX_ORDER_LPC ];
-
- SKP_assert( subfr_length * nb_subfr <= MAX_FRAME_SIZE );
- SKP_assert( nb_subfr <= MAX_NB_SUBFR );
-
- /* Compute autocorrelations, added over subframes */
- C0 = SKP_Silk_energy_FLP( x, nb_subfr * subfr_length );
- SKP_memset( C_first_row, 0, SKP_Silk_MAX_ORDER_LPC * sizeof( double ) );
- for( s = 0; s < nb_subfr; s++ ) {
- x_ptr = x + s * subfr_length;
- for( n = 1; n < D + 1; n++ ) {
- C_first_row[ n - 1 ] += SKP_Silk_inner_product_FLP( x_ptr, x_ptr + n, subfr_length - n );
- }
- }
- SKP_memcpy( C_last_row, C_first_row, SKP_Silk_MAX_ORDER_LPC * sizeof( double ) );
-
- /* Initialize */
- CAb[ 0 ] = CAf[ 0 ] = C0 + WhiteNoiseFrac * C0 + 1e-9f;
-
- for( n = 0; n < D; n++ ) {
- /* Update first row of correlation matrix (without first element) */
- /* Update last row of correlation matrix (without last element, stored in reversed order) */
- /* Update C * Af */
- /* Update C * flipud(Af) (stored in reversed order) */
- for( s = 0; s < nb_subfr; s++ ) {
- x_ptr = x + s * subfr_length;
- tmp1 = x_ptr[ n ];
- tmp2 = x_ptr[ subfr_length - n - 1 ];
- for( k = 0; k < n; k++ ) {
- C_first_row[ k ] -= x_ptr[ n ] * x_ptr[ n - k - 1 ];
- C_last_row[ k ] -= x_ptr[ subfr_length - n - 1 ] * x_ptr[ subfr_length - n + k ];
- Atmp = Af[ k ];
- tmp1 += x_ptr[ n - k - 1 ] * Atmp;
- tmp2 += x_ptr[ subfr_length - n + k ] * Atmp;
- }
- for( k = 0; k <= n; k++ ) {
- CAf[ k ] -= tmp1 * x_ptr[ n - k ];
- CAb[ k ] -= tmp2 * x_ptr[ subfr_length - n + k - 1 ];
- }
- }
- tmp1 = C_first_row[ n ];
- tmp2 = C_last_row[ n ];
- for( k = 0; k < n; k++ ) {
- Atmp = Af[ k ];
- tmp1 += C_last_row[ n - k - 1 ] * Atmp;
- tmp2 += C_first_row[ n - k - 1 ] * Atmp;
- }
- CAf[ n + 1 ] = tmp1;
- CAb[ n + 1 ] = tmp2;
-
- /* Calculate nominator and denominator for the next order reflection (parcor) coefficient */
- num = CAb[ n + 1 ];
- nrg_b = CAb[ 0 ];
- nrg_f = CAf[ 0 ];
- for( k = 0; k < n; k++ ) {
- Atmp = Af[ k ];
- num += CAb[ n - k ] * Atmp;
- nrg_b += CAb[ k + 1 ] * Atmp;
- nrg_f += CAf[ k + 1 ] * Atmp;
- }
- SKP_assert( nrg_f > 0.0 );
- SKP_assert( nrg_b > 0.0 );
-
- /* Calculate the next order reflection (parcor) coefficient */
- rc = -2.0 * num / ( nrg_f + nrg_b );
- SKP_assert( rc > -1.0 && rc < 1.0 );
-
- /* Update the AR coefficients */
- for( k = 0; k < (n + 1) >> 1; k++ ) {
- tmp1 = Af[ k ];
- tmp2 = Af[ n - k - 1 ];
- Af[ k ] = tmp1 + rc * tmp2;
- Af[ n - k - 1 ] = tmp2 + rc * tmp1;
- }
- Af[ n ] = rc;
-
- /* Update C * Af and C * Ab */
- for( k = 0; k <= n + 1; k++ ) {
- tmp1 = CAf[ k ];
- CAf[ k ] += rc * CAb[ n - k + 1 ];
- CAb[ n - k + 1 ] += rc * tmp1;
- }
- }
-
- /* Return residual energy */
- nrg_f = CAf[ 0 ];
- tmp1 = 1.0;
- for( k = 0; k < D; k++ ) {
- Atmp = Af[ k ];
- nrg_f += CAf[ k + 1 ] * Atmp;
- tmp1 += Atmp * Atmp;
- A[ k ] = (SKP_float)(-Atmp);
- }
- nrg_f -= WhiteNoiseFrac * C0 * tmp1;
-
- return (SKP_float)nrg_f;
-}
--- a/silk/SKP_Silk_bwexpander_FLP.c
+++ /dev/null
@@ -1,47 +1,0 @@
-/***********************************************************************
-Copyright (c) 2006-2011, Skype Limited. All rights reserved.
-Redistribution and use in source and binary forms, with or without
-modification, (subject to the limitations in the disclaimer below)
-are permitted provided that the following conditions are met:
-- Redistributions of source code must retain the above copyright notice,
-this list of conditions and the following disclaimer.
-- Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
-- Neither the name of Skype Limited, nor the names of specific
-contributors, may be used to endorse or promote products derived from
-this software without specific prior written permission.
-NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED
-BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
-BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-***********************************************************************/
-
-
-#include "SKP_Silk_SigProc_FLP.h"
-
-
-/* Chirp (bw expand) LP AR filter */
-void SKP_Silk_bwexpander_FLP(
- SKP_float *ar, /* I/O AR filter to be expanded (without leading 1) */
- const SKP_int d, /* I length of ar */
- const SKP_float chirp /* I chirp factor (typically in range (0..1) ) */
-)
-{
- SKP_int i;
- SKP_float cfac = chirp;
-
- for( i = 0; i < d - 1; i++ ) {
- ar[ i ] *= cfac;
- cfac *= chirp;
- }
- ar[ d - 1 ] *= cfac;
-}
--- a/silk/SKP_Silk_control_codec.c
+++ b/silk/SKP_Silk_control_codec.c
@@ -25,12 +25,8 @@
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
#include "SKP_Silk_tuning_parameters.h"
-#if FIXED_POINT
+#ifdef FIXED_POINT
#include "SKP_Silk_main_FIX.h"
#define SKP_Silk_encoder_state_Fxx SKP_Silk_encoder_state_FIX
#else
@@ -64,8 +60,9 @@
SKP_int SKP_Silk_control_encoder(
SKP_Silk_encoder_state_Fxx *psEnc, /* I/O Pointer to Silk encoder state */
SKP_SILK_SDK_EncControlStruct *encControl, /* I: Control structure */
- const SKP_int32 TargetRate_bps, /* I Target max bitrate (bps) */
- const SKP_int allow_bw_switch /* I Flag to allow switching audio bandwidth */
+ const SKP_int32 TargetRate_bps, /* I Target max bitrate (bps) */
+ const SKP_int allow_bw_switch, /* I Flag to allow switching audio bandwidth */
+ const SKP_int channelNb /* I Channel number */
)
{
SKP_int fs_kHz, ret = 0;
@@ -77,7 +74,9 @@
psEnc->sCmn.minInternal_fs_Hz = encControl->minInternalSampleRate;
psEnc->sCmn.desiredInternal_fs_Hz = encControl->desiredInternalSampleRate;
psEnc->sCmn.useInBandFEC = encControl->useInBandFEC;
+ psEnc->sCmn.nChannels = encControl->nChannels;
psEnc->sCmn.allow_bandwidth_switch = allow_bw_switch;
+ psEnc->sCmn.channelNb = channelNb;
if( psEnc->sCmn.controlled_since_last_payload != 0 && psEnc->sCmn.prefillFlag == 0 ) {
if( psEnc->sCmn.API_fs_Hz != psEnc->sCmn.prev_API_fs_Hz && psEnc->sCmn.fs_kHz > 0 ) {
@@ -140,7 +139,7 @@
} else {
/* Allocate space for worst case temporary upsampling, 8 to 48 kHz, so a factor 6 */
SKP_int16 x_buf_API_fs_Hz[ ( 2 * MAX_FRAME_LENGTH + LA_SHAPE_MAX ) * ( MAX_API_FS_KHZ / 8 ) ];
-#if FIXED_POINT
+#ifdef FIXED_POINT
SKP_int16 *x_bufFIX = psEnc->x_buf;
#else
SKP_int16 x_bufFIX[ 2 * MAX_FRAME_LENGTH + LA_SHAPE_MAX ];
@@ -148,7 +147,7 @@
nSamples_temp = SKP_LSHIFT( psEnc->sCmn.frame_length, 1 ) + LA_SHAPE_MS * psEnc->sCmn.fs_kHz;
-#if !FIXED_POINT
+#ifndef FIXED_POINT
SKP_float2short_array( x_bufFIX, psEnc->x_buf, nSamples_temp );
#endif
@@ -178,7 +177,7 @@
/* Correct resampler state (unless resampling by a factor 1) by resampling buffered data from API_fs_Hz to fs_kHz */
ret += SKP_Silk_resampler( &psEnc->sCmn.resampler_state, x_bufFIX, x_buf_API_fs_Hz, nSamples_temp );
}
-#if !FIXED_POINT
+#ifndef FIXED_POINT
SKP_short2float_array( psEnc->x_buf, x_bufFIX, ( 2 * MAX_FRAME_LENGTH_MS + LA_SHAPE_MS ) * fs_kHz );
#endif
}
@@ -235,7 +234,7 @@
SKP_assert( psEnc->sCmn.nb_subfr == 2 || psEnc->sCmn.nb_subfr == 4 );
if( psEnc->sCmn.fs_kHz != fs_kHz ) {
/* reset part of the state */
-#if FIXED_POINT
+#ifdef FIXED_POINT
SKP_memset( &psEnc->sShape, 0, sizeof( SKP_Silk_shape_state_FIX ) );
SKP_memset( &psEnc->sPrefilt, 0, sizeof( SKP_Silk_prefilter_state_FIX ) );
#else
--- a/silk/SKP_Silk_dec_API.c
+++ b/silk/SKP_Silk_dec_API.c
@@ -31,7 +31,9 @@
#include "SKP_Silk_SDK_API.h"
#include "SKP_Silk_main.h"
+/************************/
/* Decoder Super Struct */
+/************************/
typedef struct {
SKP_Silk_decoder_state channel_state[ DECODER_NUM_CHANNELS ];
stereo_state sStereo;
@@ -38,7 +40,6 @@
SKP_int nChannels;
} SKP_Silk_decoder;
-
/*********************/
/* Decoder functions */
/*********************/
@@ -78,10 +79,11 @@
SKP_int32 *nSamplesOut /* O: Number of samples decoded */
)
{
- SKP_int i, n, prev_fs_kHz, doResample, flags, nFlags, MS_predictorIx, ret = SKP_SILK_NO_ERROR;
+ SKP_int i, n, prev_fs_kHz, doResample, flags, nFlags, ret = SKP_SILK_NO_ERROR;
SKP_int32 nSamplesOutDec, LBRR_symbol;
SKP_int16 samplesOut1_tmp[ 2 * MAX_FS_KHZ * MAX_FRAME_LENGTH_MS ];
SKP_int16 samplesOut2_tmp[ MAX_API_FS_KHZ * MAX_FRAME_LENGTH_MS ];
+ SKP_int MS_pred_Q14[ 2 ] = { 0 };
SKP_int16 *dec_out_ptr, *resample_out_ptr;
SKP_Silk_decoder *psDec = ( SKP_Silk_decoder * )decState;
SKP_Silk_decoder_state *channel_state = psDec->channel_state;
@@ -200,7 +202,7 @@
/* Get MS predictor index */
if( decControl->nChannels == 2 ) {
- MS_predictorIx = ec_dec_icdf( psRangeDec, SKP_Silk_stereo_predictor_iCDF, 8 );
+ SKP_Silk_stereo_decode_pred( psRangeDec, MS_pred_Q14 );
}
/* Call decoder for one frame */
@@ -210,7 +212,7 @@
/* Convert Mid/Side to Left/Right */
if( decControl->nChannels == 2 ) {
- SKP_Silk_stereo_MS_to_LR( &psDec->sStereo, dec_out_ptr, &dec_out_ptr[ MAX_FS_KHZ * MAX_FRAME_LENGTH_MS ], MS_predictorIx, channel_state[ 0 ].fs_kHz, nSamplesOutDec );
+ SKP_Silk_stereo_MS_to_LR( &psDec->sStereo, dec_out_ptr, &dec_out_ptr[ MAX_FS_KHZ * MAX_FRAME_LENGTH_MS ], MS_pred_Q14, channel_state[ 0 ].fs_kHz, nSamplesOutDec );
}
/* Number of output samples */
--- a/silk/SKP_Silk_decode_core.c
+++ b/silk/SKP_Silk_decode_core.c
@@ -164,7 +164,7 @@
LTP_pred_Q14 = SKP_SMLAWB( LTP_pred_Q14, pred_lag_ptr[ -4 ], B_Q14[ 4 ] );
pred_lag_ptr++;
- /* Generate LPC residual */
+ /* Generate LPC excitation */
pres_Q10[ i ] = SKP_ADD32( pexc_Q10[ i ], SKP_RSHIFT_ROUND( LTP_pred_Q14, 4 ) );
/* Update states */
@@ -196,7 +196,7 @@
LPC_pred_Q10 = SKP_SMLAWB( LPC_pred_Q10, psDec->sLPC_Q14[ MAX_LPC_ORDER + i - j - 1 ], A_Q12_tmp[ j ] );
}
- /* Add prediction to LPC residual */
+ /* Add prediction to LPC excitation */
vec_Q10[ i ] = SKP_ADD32( pres_Q10[ i ], LPC_pred_Q10 );
/* Update states */
--- a/silk/SKP_Silk_define.h
+++ b/silk/SKP_Silk_define.h
@@ -47,10 +47,6 @@
#define MAX_FRAMES_PER_PACKET 3
-#ifndef FIXED_POINT
-# define FIXED_POINT 0
-#endif
-
/* Limits on bitrate */
#define MIN_TARGET_RATE_BPS 5000
#define MAX_TARGET_RATE_BPS 80000
@@ -78,9 +74,9 @@
#define TYPE_VOICED 2
/* Setting for stereo processing */
-#define STEREO_QUANT_STEPS 15
-#define STEREO_QUANT_HYSTERESIS 0.25
-#define STEREO_INTERPOL_LENGTH_MS 10
+#define STEREO_QUANT_TAB_SIZE 16
+#define STEREO_QUANT_SUB_STEPS 5
+#define STEREO_INTERP_LEN_MS 8 /* must be even */
/* Range of pitch lag estimates */
#define PITCH_EST_MIN_LAG_MS 2 /* 2 ms -> 500 Hz */
--- a/silk/SKP_Silk_enc_API.c
+++ b/silk/SKP_Silk_enc_API.c
@@ -25,9 +25,6 @@
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
#include "SKP_Silk_define.h"
#include "SKP_Silk_SDK_API.h"
@@ -35,7 +32,7 @@
#include "SKP_Silk_typedef.h"
#include "SKP_Silk_structs.h"
#include "SKP_Silk_tuning_parameters.h"
-#if FIXED_POINT
+#ifdef FIXED_POINT
#include "SKP_Silk_main_FIX.h"
#define SKP_Silk_encoder_state_Fxx SKP_Silk_encoder_state_FIX
#define SKP_Silk_encode_frame_Fxx SKP_Silk_encode_frame_FIX
@@ -142,11 +139,12 @@
const SKP_int prefillFlag /* I: Flag to indicate prefilling buffers; no coding */
)
{
- SKP_int n, i, nBits, flags, tmp_payloadSize_ms, tmp_complexity, MS_predictorIx = 0, ret = 0;
+ SKP_int n, i, nBits, flags, tmp_payloadSize_ms, tmp_complexity, ret = 0;
SKP_int nSamplesToBuffer, nBlocksOf10ms, nSamplesFromInput = 0;
SKP_int speech_act_thr_for_switch_Q8;
SKP_int32 TargetRate_bps, channelRate_bps, LBRR_symbol;
SKP_Silk_encoder *psEnc = ( SKP_Silk_encoder * )encState;
+ SKP_int MS_predictorIx[ 2 ] = { 0 };
SKP_int16 buf[ MAX_FRAME_LENGTH_MS * MAX_API_FS_KHZ ];
/* Check values in encoder control structure */
@@ -201,7 +199,7 @@
TargetRate_bps = SKP_RSHIFT32( encControl->bitRate, encControl->nChannels - 1 );
for( n = 0; n < encControl->nChannels; n++ ) {
- if( ( ret = SKP_Silk_control_encoder( &psEnc->state_Fxx[ n ], encControl, TargetRate_bps, psEnc->allowBandwidthSwitch ) ) != 0 ) {
+ if( ( ret = SKP_Silk_control_encoder( &psEnc->state_Fxx[ n ], encControl, TargetRate_bps, psEnc->allowBandwidthSwitch, n ) ) != 0 ) {
SKP_assert( 0 );
return ret;
}
@@ -287,9 +285,8 @@
/* Convert Left/Right to Mid/Side */
if( encControl->nChannels == 2 ) {
- SKP_Silk_stereo_LR_to_MS( &psEnc->sStereo, psEnc->state_Fxx[ 0 ].sCmn.inputBuf, psEnc->state_Fxx[ 1 ].sCmn.inputBuf,
- &MS_predictorIx, psEnc->state_Fxx[ 0 ].sCmn.fs_kHz, psEnc->state_Fxx[ 0 ].sCmn.frame_length );
- ec_enc_icdf( psRangeEnc, MS_predictorIx, SKP_Silk_stereo_predictor_iCDF, 8 );
+ SKP_Silk_stereo_LR_to_MS( psRangeEnc, &psEnc->sStereo, psEnc->state_Fxx[ 0 ].sCmn.inputBuf, psEnc->state_Fxx[ 1 ].sCmn.inputBuf,
+ psEnc->state_Fxx[ 0 ].sCmn.fs_kHz, psEnc->state_Fxx[ 0 ].sCmn.frame_length );
}
@@ -316,12 +313,11 @@
if( encControl->nChannels == 1 ) {
channelRate_bps = TargetRate_bps;
} else if( n == 0 ) {
- channelRate_bps = SKP_SMULWW( TargetRate_bps, SKP_FIX_CONST( 0.6, 16 ) );
+ channelRate_bps = SKP_RSHIFT( TargetRate_bps, 1 ) + 2000;
} else {
- channelRate_bps = SKP_SMULWB( TargetRate_bps, SKP_FIX_CONST( 0.4, 16 ) );
+ channelRate_bps = SKP_RSHIFT( TargetRate_bps, 1 ) - 2000;
}
SKP_Silk_control_SNR( &psEnc->state_Fxx[ n ].sCmn, channelRate_bps );
- //SKP_Silk_control_SNR( &psEnc->state_Fxx[ n ].sCmn, TargetRate_bps / 2 );
if( ( ret = SKP_Silk_encode_frame_Fxx( &psEnc->state_Fxx[ n ], nBytesOut, psRangeEnc ) ) != 0 ) {
SKP_assert( 0 );
}
--- a/silk/SKP_Silk_energy_FLP.c
+++ /dev/null
@@ -1,56 +1,0 @@
-/***********************************************************************
-Copyright (c) 2006-2011, Skype Limited. All rights reserved.
-Redistribution and use in source and binary forms, with or without
-modification, (subject to the limitations in the disclaimer below)
-are permitted provided that the following conditions are met:
-- Redistributions of source code must retain the above copyright notice,
-this list of conditions and the following disclaimer.
-- Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
-- Neither the name of Skype Limited, nor the names of specific
-contributors, may be used to endorse or promote products derived from
-this software without specific prior written permission.
-NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED
-BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
-BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-***********************************************************************/
-
-#include "SKP_Silk_SigProc_FLP.h"
-
-/* sum of squares of a SKP_float array, with result as double */
-double SKP_Silk_energy_FLP(
- const SKP_float *data,
- SKP_int dataSize
-)
-{
- SKP_int i, dataSize4;
- double result;
-
- /* 4x unrolled loop */
- result = 0.0f;
- dataSize4 = dataSize & 0xFFFC;
- for( i = 0; i < dataSize4; i += 4 ) {
- result += data[ i + 0 ] * data[ i + 0 ] +
- data[ i + 1 ] * data[ i + 1 ] +
- data[ i + 2 ] * data[ i + 2 ] +
- data[ i + 3 ] * data[ i + 3 ];
- }
-
- /* add any remaining products */
- for( ; i < dataSize; i++ ) {
- result += data[ i ] * data[ i ];
- }
-
- SKP_assert( result >= 0.0 );
- return result;
-}
--- a/silk/SKP_Silk_init_encoder.c
+++ b/silk/SKP_Silk_init_encoder.c
@@ -25,11 +25,7 @@
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
***********************************************************************/
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#if FIXED_POINT
+#ifdef FIXED_POINT
#include "SKP_Silk_main_FIX.h"
#define SKP_Silk_encoder_state_Fxx SKP_Silk_encoder_state_FIX
#else
--- a/silk/SKP_Silk_inner_product_FLP.c
+++ /dev/null
@@ -1,56 +1,0 @@
-/***********************************************************************
-Copyright (c) 2006-2011, Skype Limited. All rights reserved.
-Redistribution and use in source and binary forms, with or without
-modification, (subject to the limitations in the disclaimer below)
-are permitted provided that the following conditions are met:
-- Redistributions of source code must retain the above copyright notice,
-this list of conditions and the following disclaimer.
-- Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
-- Neither the name of Skype Limited, nor the names of specific
-contributors, may be used to endorse or promote products derived from
-this software without specific prior written permission.
-NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED
-BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
-BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-***********************************************************************/
-
-#include "SKP_Silk_SigProc_FLP.h"
-
-/* inner product of two SKP_float arrays, with result as double */
-double SKP_Silk_inner_product_FLP( /* O result */
- const SKP_float *data1, /* I vector 1 */
- const SKP_float *data2, /* I vector 2 */
- SKP_int dataSize /* I length of vectors */
-)
-{
- SKP_int i, dataSize4;
- double result;
-
- /* 4x unrolled loop */
- result = 0.0f;
- dataSize4 = dataSize & 0xFFFC;
- for( i = 0; i < dataSize4; i += 4 ) {
- result += data1[ i + 0 ] * data2[ i + 0 ] +
- data1[ i + 1 ] * data2[ i + 1 ] +
- data1[ i + 2 ] * data2[ i + 2 ] +
- data1[ i + 3 ] * data2[ i + 3 ];
- }
-
- /* add any remaining products */
- for( ; i < dataSize; i++ ) {
- result += data1[ i ] * data2[ i ];
- }
-
- return result;
-}
--- a/silk/SKP_Silk_k2a_FLP.c
+++ /dev/null
@@ -1,58 +1,0 @@
-/***********************************************************************
-Copyright (c) 2006-2011, Skype Limited. All rights reserved.
-Redistribution and use in source and binary forms, with or without
-modification, (subject to the limitations in the disclaimer below)
-are permitted provided that the following conditions are met:
-- Redistributions of source code must retain the above copyright notice,
-this list of conditions and the following disclaimer.
-- Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
-- Neither the name of Skype Limited, nor the names of specific
-contributors, may be used to endorse or promote products derived from
-this software without specific prior written permission.
-NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED
-BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
-BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-***********************************************************************/
-
-/* *
- * SKP_Silk_k2a.c *
- * *
- * step up function, converts reflection coefficients to prediction *
- * coefficients *
- * *
- * Copyright 2008 (c), Skype Limited *
- * Date: 080103 *
- * */
-#include "SKP_Silk_SigProc_FLP.h"
-
-/* step up function, converts reflection coefficients to prediction coefficients */
-void SKP_Silk_k2a_FLP(
- SKP_float *A, /* O: prediction coefficients [order] */
- const SKP_float *rc, /* I: reflection coefficients [order] */
- SKP_int32 order /* I: prediction order */
-)
-{
- SKP_int k, n;
- SKP_float Atmp[ SKP_Silk_MAX_ORDER_LPC ];
-
- for( k = 0; k < order; k++ ){
- for( n = 0; n < k; n++ ){
- Atmp[ n ] = A[ n ];
- }
- for( n = 0; n < k; n++ ) {
- A[ n ] += Atmp[ k - n - 1 ] * rc[ k ];
- }
- A[ k ] = -rc[ k ];
- }
-}
--- a/silk/SKP_Silk_levinsondurbin_FLP.c
+++ /dev/null
@@ -1,77 +1,0 @@
-/***********************************************************************
-Copyright (c) 2006-2011, Skype Limited. All rights reserved.
-Redistribution and use in source and binary forms, with or without
-modification, (subject to the limitations in the disclaimer below)
-are permitted provided that the following conditions are met:
-- Redistributions of source code must retain the above copyright notice,
-this list of conditions and the following disclaimer.
-- Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
-- Neither the name of Skype Limited, nor the names of specific
-contributors, may be used to endorse or promote products derived from
-this software without specific prior written permission.
-NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED
-BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
-BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-***********************************************************************/
-
-#include "SKP_Silk_SigProc_FLP.h"
-
-/* Solve the normal equations using the Levinson-Durbin recursion */
-SKP_float SKP_Silk_levinsondurbin_FLP( /* O prediction error energy */
- SKP_float A[], /* O prediction coefficients [order] */
- const SKP_float corr[], /* I input auto-correlations [order + 1] */
- const SKP_int order /* I prediction order */
-)
-{
- SKP_int i, mHalf, m;
- SKP_float min_nrg, nrg, t, km, Atmp1, Atmp2;
-
- min_nrg = 1e-12f * corr[ 0 ] + 1e-9f;
- nrg = corr[ 0 ];
- nrg = SKP_max_float(min_nrg, nrg);
- A[ 0 ] = corr[ 1 ] / nrg;
- nrg -= A[ 0 ] * corr[ 1 ];
- nrg = SKP_max_float(min_nrg, nrg);
-
- for( m = 1; m < order; m++ )
- {
- t = corr[ m + 1 ];
- for( i = 0; i < m; i++ ) {
- t -= A[ i ] * corr[ m - i ];
- }
-
- /* reflection coefficient */
- km = t / nrg;
-
- /* residual energy */
- nrg -= km * t;
- nrg = SKP_max_float(min_nrg, nrg);
-
- mHalf = m >> 1;
- for( i = 0; i < mHalf; i++ ) {
- Atmp1 = A[ i ];
- Atmp2 = A[ m - i - 1 ];
- A[ m - i - 1 ] -= km * Atmp1;
- A[ i ] -= km * Atmp2;
- }
- if( m & 1 ) {
- A[ mHalf ] -= km * A[ mHalf ];
- }
- A[ m ] = km;
- }
-
- /* return the residual energy */
- return nrg;
-}
-
--- a/silk/SKP_Silk_main.h
+++ b/silk/SKP_Silk_main.h
@@ -52,10 +52,10 @@
/* Convert Left/Right stereo signal to adaptive Mid/Side representation */
void SKP_Silk_stereo_LR_to_MS(
+ ec_enc *psRangeEnc, /* I/O Compressor data structure */
stereo_state *state, /* I/O State */
SKP_int16 x1[], /* I/O Left input signal, becomes mid signal */
SKP_int16 x2[], /* I/O Right input signal, becomes side signal */
- SKP_int *predictorIx, /* O Index for predictor filter */
SKP_int fs_kHz, /* I Samples rate (kHz) */
SKP_int frame_length /* I Number of samples */
);
@@ -65,9 +65,28 @@
stereo_state *state, /* I/O State */
SKP_int16 x1[], /* I/O Left input signal, becomes mid signal */
SKP_int16 x2[], /* I/O Right input signal, becomes side signal */
- SKP_int predictorIx, /* I Index for predictor filter */
+ const SKP_int32 pred_Q13[], /* I Predictors */
SKP_int fs_kHz, /* I Samples rate (kHz) */
SKP_int frame_length /* I Number of samples */
+);
+
+/* Find least-squares prediction gain for one signal based on another and quantize it */
+SKP_int32 SKP_Silk_stereo_find_predictor( /* O Returns predictor in Q13 */
+ const SKP_int16 x[], /* I Basis signal */
+ const SKP_int16 y[], /* I Target signal */
+ SKP_int length /* I Number of samples */
+);
+
+/* Quantize mid/side predictors and entropy code the quantization indices */
+void SKP_Silk_stereo_encode_pred(
+ ec_enc *psRangeEnc, /* I/O Compressor data structure */
+ SKP_int32 pred_Q13[] /* I/O Predictors (out: quantized) */
+);
+
+/* Decode mid/side predictors */
+void SKP_Silk_stereo_decode_pred(
+ ec_dec *psRangeDec, /* I/O Compressor data structure */
+ SKP_int32 pred_Q13[] /* O Predictors */
);
/* Encodes signs of excitation */
--- a/silk/SKP_Silk_main_FIX.h
+++ /dev/null
@@ -1,244 +1,0 @@
-/***********************************************************************
-Copyright (c) 2006-2011, Skype Limited. All rights reserved.
-Redistribution and use in source and binary forms, with or without
-modification, (subject to the limitations in the disclaimer below)
-are permitted provided that the following conditions are met:
-- Redistributions of source code must retain the above copyright notice,
-this list of conditions and the following disclaimer.
-- Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
-- Neither the name of Skype Limited, nor the names of specific
-contributors, may be used to endorse or promote products derived from
-this software without specific prior written permission.
-NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED
-BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
-BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-***********************************************************************/
-
-#ifndef SKP_SILK_MAIN_FIX_H
-#define SKP_SILK_MAIN_FIX_H
-
-#include "SKP_Silk_SigProc_FIX.h"
-#include "SKP_Silk_structs_FIX.h"
-#include "SKP_Silk_control.h"
-#include "SKP_Silk_main.h"
-#include "SKP_Silk_PLC.h"
-#include "SKP_debug.h"
-#include "entenc.h"
-
-#ifndef FORCE_CPP_BUILD
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-#endif
-
-/*********************/
-/* Encoder Functions */
-/*********************/
-
-/* Encoder main function */
-SKP_int SKP_Silk_encode_frame_FIX(
- SKP_Silk_encoder_state_FIX *psEnc, /* I/O Pointer to Silk FIX encoder state */
- SKP_int32 *pnBytesOut, /* O Pointer to number of payload bytes; */
- ec_enc *psRangeEnc /* I/O compressor data structure */
-);
-
-/* Low Bitrate Redundancy (LBRR) encoding. Reuse all parameters but encode with lower bitrate */
-void SKP_Silk_LBRR_encode_FIX(
- SKP_Silk_encoder_state_FIX *psEnc, /* I/O Pointer to Silk FIX encoder state */
- SKP_Silk_encoder_control_FIX *psEncCtrl, /* I/O Pointer to Silk FIX encoder control struct */
- const SKP_int16 xfw[] /* I Input signal */
-);
-
-/* Initializes the Silk encoder state */
-SKP_int SKP_Silk_init_encoder(
- SKP_Silk_encoder_state_FIX *psEnc /* I/O Pointer to Silk FIX encoder state */
-);
-
-/* Control the Silk encoder */
-SKP_int SKP_Silk_control_encoder(
- SKP_Silk_encoder_state_FIX *psEnc, /* I/O Pointer to Silk encoder state */
- SKP_SILK_SDK_EncControlStruct *encControl, /* I: Control structure */
- const SKP_int32 TargetRate_bps, /* I Target max bitrate (bps) */
- const SKP_int allow_bw_switch /* I Flag to allow switching audio bandwidth */
-);
-
-/****************/
-/* Prefiltering */
-/****************/
-void SKP_Silk_prefilter_FIX(
- SKP_Silk_encoder_state_FIX *psEnc, /* I/O Encoder state */
- const SKP_Silk_encoder_control_FIX *psEncCtrl, /* I Encoder control */
- SKP_int16 xw[], /* O Weighted signal */
- const SKP_int16 x[] /* I Speech signal */
-);
-
-/**************************/
-/* Noise shaping analysis */
-/**************************/
-/* Compute noise shaping coefficients and initial gain values */
-void SKP_Silk_noise_shape_analysis_FIX(
- SKP_Silk_encoder_state_FIX *psEnc, /* I/O Encoder state FIX */
- SKP_Silk_encoder_control_FIX *psEncCtrl, /* I/O Encoder control FIX */
- const SKP_int16 *pitch_res, /* I LPC residual from pitch analysis */
- const SKP_int16 *x /* I Input signal [ frame_length + la_shape ] */
-);
-
-/* Autocorrelations for a warped frequency axis */
-void SKP_Silk_warped_autocorrelation_FIX(
- SKP_int32 *corr, /* O Result [order + 1] */
- SKP_int *scale, /* O Scaling of the correlation vector */
- const SKP_int16 *input, /* I Input data to correlate */
- const SKP_int warping_Q16, /* I Warping coefficient */
- const SKP_int length, /* I Length of input */
- const SKP_int order /* I Correlation order (even) */
-);
-
-/* Calculation of LTP state scaling */
-void SKP_Silk_LTP_scale_ctrl_FIX(
- SKP_Silk_encoder_state_FIX *psEnc, /* I/O encoder state */
- SKP_Silk_encoder_control_FIX *psEncCtrl /* I/O encoder control */
-);
-
-/**********************************************/
-/* Prediction Analysis */
-/**********************************************/
-/* Find pitch lags */
-void SKP_Silk_find_pitch_lags_FIX(
- SKP_Silk_encoder_state_FIX *psEnc, /* I/O encoder state */
- SKP_Silk_encoder_control_FIX *psEncCtrl, /* I/O encoder control */
- SKP_int16 res[], /* O residual */
- const SKP_int16 x[] /* I Speech signal */
-);
-
-/* Find LPC and LTP coefficients */
-void SKP_Silk_find_pred_coefs_FIX(
- SKP_Silk_encoder_state_FIX *psEnc, /* I/O encoder state */
- SKP_Silk_encoder_control_FIX *psEncCtrl, /* I/O encoder control */
- const SKP_int16 res_pitch[], /* I Residual from pitch analysis */
- const SKP_int16 x[] /* I Speech signal */
-);
-
-/* LPC analysis */
-void SKP_Silk_find_LPC_FIX(
- SKP_int16 NLSF_Q15[], /* O NLSFs */
- SKP_int8 *interpIndex, /* O NLSF interpolation index, only used for NLSF interpolation */
- const SKP_int16 prev_NLSFq_Q15[], /* I previous NLSFs, only used for NLSF interpolation */
- const SKP_int useInterpNLSFs, /* I Flag */
- const SKP_int firstFrameAfterReset, /* I Flag */
- const SKP_int LPC_order, /* I LPC order */
- const SKP_int16 x[], /* I Input signal */
- const SKP_int subfr_length, /* I Input signal subframe length including preceeding samples */
- const SKP_int nb_subfr /* I: Number of subframes */
-);
-
-/* LTP analysis */
-void SKP_Silk_find_LTP_FIX(
- SKP_int16 b_Q14[ MAX_NB_SUBFR * LTP_ORDER ], /* O LTP coefs */
- SKP_int32 WLTP[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /* O Weight for LTP quantization */
- SKP_int *LTPredCodGain_Q7, /* O LTP coding gain */
- const SKP_int16 r_lpc[], /* I residual signal after LPC signal + state for first 10 ms */
- const SKP_int lag[ MAX_NB_SUBFR ], /* I LTP lags */
- const SKP_int32 Wght_Q15[ MAX_NB_SUBFR ], /* I weights */
- const SKP_int subfr_length, /* I subframe length */
- const SKP_int nb_subfr, /* I number of subframes */
- const SKP_int mem_offset, /* I number of samples in LTP memory */
- SKP_int corr_rshifts[ MAX_NB_SUBFR ] /* O right shifts applied to correlations */
-);
-
-void SKP_Silk_LTP_analysis_filter_FIX(
- SKP_int16 *LTP_res, /* O: LTP residual signal of length MAX_NB_SUBFR * ( pre_length + subfr_length ) */
- const SKP_int16 *x, /* I: Pointer to input signal with at least max( pitchL ) preceeding samples */
- const SKP_int16 LTPCoef_Q14[ LTP_ORDER * MAX_NB_SUBFR ],/* I: LTP_ORDER LTP coefficients for each MAX_NB_SUBFR subframe */
- const SKP_int pitchL[ MAX_NB_SUBFR ], /* I: Pitch lag, one for each subframe */
- const SKP_int32 invGains_Q16[ MAX_NB_SUBFR ], /* I: Inverse quantization gains, one for each subframe */
- const SKP_int subfr_length, /* I: Length of each subframe */
- const SKP_int nb_subfr, /* I: Number of subframes */
- const SKP_int pre_length /* I: Length of the preceeding samples starting at &x[0] for each subframe */
-);
-
-/* Calculates residual energies of input subframes where all subframes have LPC_order */
-/* of preceeding samples */
-void SKP_Silk_residual_energy_FIX(
- SKP_int32 nrgs[ MAX_NB_SUBFR ], /* O Residual energy per subframe */
- SKP_int nrgsQ[ MAX_NB_SUBFR ], /* O Q value per subframe */
- const SKP_int16 x[], /* I Input signal */
- const SKP_int16 a_Q12[ 2 ][ MAX_LPC_ORDER ], /* I AR coefs for each frame half */
- const SKP_int32 gains[ MAX_NB_SUBFR ], /* I Quantization gains */
- const SKP_int subfr_length, /* I Subframe length */
- const SKP_int nb_subfr, /* I Number of subframes */
- const SKP_int LPC_order /* I LPC order */
-);
-
-/* Residual energy: nrg = wxx - 2 * wXx * c + c' * wXX * c */
-SKP_int32 SKP_Silk_residual_energy16_covar_FIX(
- const SKP_int16 *c, /* I Prediction vector */
- const SKP_int32 *wXX, /* I Correlation matrix */
- const SKP_int32 *wXx, /* I Correlation vector */
- SKP_int32 wxx, /* I Signal energy */
- SKP_int D, /* I Dimension */
- SKP_int cQ /* I Q value for c vector 0 - 15 */
-);
-
-/* Processing of gains */
-void SKP_Silk_process_gains_FIX(
- SKP_Silk_encoder_state_FIX *psEnc, /* I/O Encoder state */
- SKP_Silk_encoder_control_FIX *psEncCtrl /* I/O Encoder control */
-);
-
-/******************/
-/* Linear Algebra */
-/******************/
-/* Calculates correlation matrix X'*X */
-void SKP_Silk_corrMatrix_FIX(
- const SKP_int16 *x, /* I x vector [L + order - 1] used to form data matrix X */
- const SKP_int L, /* I Length of vectors */
- const SKP_int order, /* I Max lag for correlation */
- const SKP_int head_room, /* I Desired headroom */
- SKP_int32 *XX, /* O Pointer to X'*X correlation matrix [ order x order ]*/
- SKP_int *rshifts /* I/O Right shifts of correlations */
-);
-
-/* Calculates correlation vector X'*t */
-void SKP_Silk_corrVector_FIX(
- const SKP_int16 *x, /* I x vector [L + order - 1] used to form data matrix X */
- const SKP_int16 *t, /* I Target vector [L] */
- const SKP_int L, /* I Length of vectors */
- const SKP_int order, /* I Max lag for correlation */
- SKP_int32 *Xt, /* O Pointer to X'*t correlation vector [order] */
- const SKP_int rshifts /* I Right shifts of correlations */
-);
-
-/* Add noise to matrix diagonal */
-void SKP_Silk_regularize_correlations_FIX(
- SKP_int32 *XX, /* I/O Correlation matrices */
- SKP_int32 *xx, /* I/O Correlation values */
- SKP_int32 noise, /* I Noise to add */
- SKP_int D /* I Dimension of XX */
-);
-
-/* Solves Ax = b, assuming A is symmetric */
-void SKP_Silk_solve_LDL_FIX(
- SKP_int32 *A, /* I Pointer to symetric square matrix A */
- SKP_int M, /* I Size of matrix */
- const SKP_int32 *b, /* I Pointer to b vector */
- SKP_int32 *x_Q16 /* O Pointer to x solution vector */
-);
-
-#ifndef FORCE_CPP_BUILD
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-#endif /* FORCE_CPP_BUILD */
-#endif /* SKP_SILK_MAIN_FIX_H */
--- a/silk/SKP_Silk_main_FLP.h
+++ /dev/null
@@ -1,319 +1,0 @@
-/***********************************************************************
-Copyright (c) 2006-2011, Skype Limited. All rights reserved.
-Redistribution and use in source and binary forms, with or without
-modification, (subject to the limitations in the disclaimer below)
-are permitted provided that the following conditions are met:
-- Redistributions of source code must retain the above copyright notice,
-this list of conditions and the following disclaimer.
-- Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
-- Neither the name of Skype Limited, nor the names of specific
-contributors, may be used to endorse or promote products derived from
-this software without specific prior written permission.
-NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED
-BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
-BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-***********************************************************************/
-
-#ifndef SKP_SILK_MAIN_FLP_H
-#define SKP_SILK_MAIN_FLP_H
-
-#include "SKP_Silk_SigProc_FLP.h"
-#include "SKP_Silk_SigProc_FIX.h"
-#include "SKP_Silk_structs_FLP.h"
-#include "SKP_Silk_main.h"
-#include "SKP_Silk_define.h"
-#include "SKP_debug.h"
-#include "entenc.h"
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-/*********************/
-/* Encoder Functions */
-/*********************/
-
-/* Encoder main function */
-SKP_int SKP_Silk_encode_frame_FLP(
- SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */
- SKP_int32 *pnBytesOut, /* O Number of payload bytes; */
- ec_enc *psRangeEnc /* I/O compressor data structure */
-);
-
-/* Low Bitrate Redundancy (LBRR) encoding. Reuse all parameters but encode with lower bitrate */
-void SKP_Silk_LBRR_encode_FLP(
- SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */
- SKP_Silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */
- const SKP_float xfw[] /* I Input signal */
-);
-
-/* Initializes the Silk encoder state */
-SKP_int SKP_Silk_init_encoder(
- SKP_Silk_encoder_state_FLP *psEnc /* I/O Encoder state FLP */
-);
-
-/* Control the Silk encoder */
-SKP_int SKP_Silk_control_encoder(
- SKP_Silk_encoder_state_FLP *psEnc, /* I/O Pointer to Silk encoder state FLP */
- SKP_SILK_SDK_EncControlStruct *encControl, /* I: Control structure */
- const SKP_int32 TargetRate_bps, /* I Target max bitrate (bps) */
- const SKP_int allow_bw_switch /* I Flag to allow switching audio bandwidth */
-);
-
-/****************/
-/* Prefiltering */
-/****************/
-void SKP_Silk_prefilter_FLP(
- SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */
- const SKP_Silk_encoder_control_FLP *psEncCtrl, /* I Encoder control FLP */
- SKP_float xw[], /* O Weighted signal */
- const SKP_float x[] /* I Speech signal */
-);
-
-/**************************/
-/* Noise shaping analysis */
-/**************************/
-/* Compute noise shaping coefficients and initial gain values */
-void SKP_Silk_noise_shape_analysis_FLP(
- SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */
- SKP_Silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */
- const SKP_float *pitch_res, /* I LPC residual from pitch analysis */
- const SKP_float *x /* I Input signal [frame_length + la_shape] */
-);
-
-/* Autocorrelations for a warped frequency axis */
-void SKP_Silk_warped_autocorrelation_FLP(
- SKP_float *corr, /* O Result [order + 1] */
- const SKP_float *input, /* I Input data to correlate */
- const SKP_float warping, /* I Warping coefficient */
- const SKP_int length, /* I Length of input */
- const SKP_int order /* I Correlation order (even) */
-);
-
-/* Calculation of LTP state scaling */
-void SKP_Silk_LTP_scale_ctrl_FLP(
- SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */
- SKP_Silk_encoder_control_FLP *psEncCtrl /* I/O Encoder control FLP */
-);
-
-/**********************************************/
-/* Prediction Analysis */
-/**********************************************/
-/* Find pitch lags */
-void SKP_Silk_find_pitch_lags_FLP(
- SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */
- SKP_Silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */
- SKP_float res[], /* O Residual */
- const SKP_float x[] /* I Speech signal */
-);
-
-/* Find LPC and LTP coefficients */
-void SKP_Silk_find_pred_coefs_FLP(
- SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */
- SKP_Silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */
- const SKP_float res_pitch[], /* I Residual from pitch analysis */
- const SKP_float x[] /* I Speech signal */
-);
-
-/* LPC analysis */
-void SKP_Silk_find_LPC_FLP(
- SKP_int16 NLSF_Q15[], /* O NLSFs */
- SKP_int8 *interpIndex, /* O NLSF interp. index for NLSF interp. */
- const SKP_int16 prev_NLSFq_Q15[], /* I Previous NLSFs, for NLSF interpolation */
- const SKP_int useInterpNLSFs, /* I Flag */
- const SKP_int firstFrameAfterReset, /* I Flag */
- const SKP_int LPC_order, /* I LPC order */
- const SKP_float x[], /* I Input signal */
- const SKP_int subfr_length, /* I Subframe length incl preceeding samples */
- const SKP_int nb_subfr /* I: Number of subframes */
-);
-
-/* LTP analysis */
-void SKP_Silk_find_LTP_FLP(
- SKP_float b[ MAX_NB_SUBFR * LTP_ORDER ], /* O LTP coefs */
- SKP_float WLTP[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /* O Weight for LTP quantization */
- SKP_float *LTPredCodGain, /* O LTP coding gain */
- const SKP_float r_lpc[], /* I LPC residual */
- const SKP_int lag[ MAX_NB_SUBFR ], /* I LTP lags */
- const SKP_float Wght[ MAX_NB_SUBFR ], /* I Weights */
- const SKP_int subfr_length, /* I Subframe length */
- const SKP_int nb_subfr, /* I number of subframes */
- const SKP_int mem_offset /* I Number of samples in LTP memory */
-);
-
-void SKP_Silk_LTP_analysis_filter_FLP(
- SKP_float *LTP_res, /* O LTP res MAX_NB_SUBFR*(pre_lgth+subfr_lngth) */
- const SKP_float *x, /* I Input signal, with preceeding samples */
- const SKP_float B[ LTP_ORDER * MAX_NB_SUBFR ], /* I LTP coefficients for each subframe */
- const SKP_int pitchL[ MAX_NB_SUBFR ], /* I Pitch lags */
- const SKP_float invGains[ MAX_NB_SUBFR ], /* I Inverse quantization gains */
- const SKP_int subfr_length, /* I Length of each subframe */
- const SKP_int nb_subfr, /* I number of subframes */
- const SKP_int pre_length /* I Preceeding samples for each subframe */
-);
-
-/* Calculates residual energies of input subframes where all subframes have LPC_order */
-/* of preceeding samples */
-void SKP_Silk_residual_energy_FLP(
- SKP_float nrgs[ MAX_NB_SUBFR ], /* O Residual energy per subframe */
- const SKP_float x[], /* I Input signal */
- const SKP_float a[ 2 ][ MAX_LPC_ORDER ],/* I AR coefs for each frame half */
- const SKP_float gains[], /* I Quantization gains */
- const SKP_int subfr_length, /* I Subframe length */
- const SKP_int nb_subfr, /* I number of subframes */
- const SKP_int LPC_order /* I LPC order */
-);
-
-/* 16th order LPC analysis filter */
-void SKP_Silk_LPC_analysis_filter_FLP(
- SKP_float r_LPC[], /* O LPC residual signal */
- const SKP_float PredCoef[], /* I LPC coefficients */
- const SKP_float s[], /* I Input signal */
- const SKP_int length, /* I Length of input signal */
- const SKP_int Order /* I LPC order */
-);
-
-/* LTP tap quantizer */
-void SKP_Silk_quant_LTP_gains_FLP(
- SKP_float B[ MAX_NB_SUBFR * LTP_ORDER ], /* I/O (Un-)quantized LTP gains */
- SKP_int8 cbk_index[ MAX_NB_SUBFR ], /* O Codebook index */
- SKP_int8 *periodicity_index, /* O Periodicity index */
- const SKP_float W[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /* I Error weights */
- const SKP_int mu_Q10, /* I Mu value (R/D tradeoff) */
- const SKP_int lowComplexity, /* I Flag for low complexity */
- const SKP_int nb_subfr /* I number of subframes */
-);
-
-/******************/
-/* NLSF Quantizer */
-/******************/
-/* Limit, stabilize, and quantize NLSFs */
-void SKP_Silk_process_NLSFs_FLP(
- SKP_Silk_encoder_state *psEncC, /* I/O Encoder state */
- SKP_float PredCoef[ 2 ][ MAX_LPC_ORDER ], /* O Prediction coefficients */
- SKP_int16 NLSF_Q15[ MAX_LPC_ORDER ], /* I/O Normalized LSFs (quant out) (0 - (2^15-1)) */
- const SKP_int16 prev_NLSF_Q15[ MAX_LPC_ORDER ] /* I Previous Normalized LSFs (0 - (2^15-1)) */
-);
-
-/* Residual energy: nrg = wxx - 2 * wXx * c + c' * wXX * c */
-SKP_float SKP_Silk_residual_energy_covar_FLP( /* O Weighted residual energy */
- const SKP_float *c, /* I Filter coefficients */
- SKP_float *wXX, /* I/O Weighted correlation matrix, reg. out */
- const SKP_float *wXx, /* I Weighted correlation vector */
- const SKP_float wxx, /* I Weighted correlation value */
- const SKP_int D /* I Dimension */
-);
-
-/* Entropy constrained MATRIX-weighted VQ, for a single input data vector */
-void SKP_Silk_VQ_WMat_EC_FLP(
- SKP_int *ind, /* O Index of best codebook vector */
- SKP_float *rate_dist, /* O Best weighted quant. error + mu * rate */
- const SKP_float *in, /* I Input vector to be quantized */
- const SKP_float *W, /* I Weighting matrix */
- const SKP_int16 *cb, /* I Codebook */
- const SKP_int16 *cl_Q6, /* I Code length for each codebook vector */
- const SKP_float mu, /* I Tradeoff between WSSE and rate */
- const SKP_int L /* I Number of vectors in codebook */
-);
-
-/* Processing of gains */
-void SKP_Silk_process_gains_FLP(
- SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */
- SKP_Silk_encoder_control_FLP *psEncCtrl /* I/O Encoder control FLP */
-);
-
-/******************/
-/* Linear Algebra */
-/******************/
-/* Calculates correlation matrix X'*X */
-void SKP_Silk_corrMatrix_FLP(
- const SKP_float *x, /* I x vector [ L+order-1 ] used to create X */
- const SKP_int L, /* I Length of vectors */
- const SKP_int Order, /* I Max lag for correlation */
- SKP_float *XX /* O X'*X correlation matrix [order x order] */
-);
-
-/* Calculates correlation vector X'*t */
-void SKP_Silk_corrVector_FLP(
- const SKP_float *x, /* I x vector [L+order-1] used to create X */
- const SKP_float *t, /* I Target vector [L] */
- const SKP_int L, /* I Length of vecors */
- const SKP_int Order, /* I Max lag for correlation */
- SKP_float *Xt /* O X'*t correlation vector [order] */
-);
-
-/* Add noise to matrix diagonal */
-void SKP_Silk_regularize_correlations_FLP(
- SKP_float *XX, /* I/O Correlation matrices */
- SKP_float *xx, /* I/O Correlation values */
- const SKP_float noise, /* I Noise energy to add */
- const SKP_int D /* I Dimension of XX */
-);
-
-/* Function to solve linear equation Ax = b, where A is an MxM symmetric matrix */
-void SKP_Silk_solve_LDL_FLP(
- SKP_float *A, /* I/O Symmetric square matrix, out: reg. */
- const SKP_int M, /* I Size of matrix */
- const SKP_float *b, /* I Pointer to b vector */
- SKP_float *x /* O Pointer to x solution vector */
-);
-
-/* Apply sine window to signal vector. */
-/* Window types: */
-/* 1 -> sine window from 0 to pi/2 */
-/* 2 -> sine window from pi/2 to pi */
-void SKP_Silk_apply_sine_window_FLP(
- SKP_float px_win[], /* O Pointer to windowed signal */
- const SKP_float px[], /* I Pointer to input signal */
- const SKP_int win_type, /* I Selects a window type */
- const SKP_int length /* I Window length, multiple of 4 */
-);
-
-/* Wrappers. Calls flp / fix code */
-
-/* Convert AR filter coefficients to NLSF parameters */
-void SKP_Silk_A2NLSF_FLP(
- SKP_int16 *NLSF_Q15, /* O NLSF vector [ LPC_order ] */
- const SKP_float *pAR, /* I LPC coefficients [ LPC_order ] */
- const SKP_int LPC_order /* I LPC order */
-);
-
-/* Convert NLSF parameters to AR prediction filter coefficients */
-void SKP_Silk_NLSF2A_stable_FLP(
- SKP_float *pAR, /* O LPC coefficients [ LPC_order ] */
- const SKP_int16 *NLSF_Q15, /* I NLSF vector [ LPC_order ] */
- const SKP_int LPC_order /* I LPC order */
-);
-
-/****************************************/
-/* Floating-point Silk NSQ wrapper */
-/****************************************/
-void SKP_Silk_NSQ_wrapper_FLP(
- SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */
- SKP_Silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */
- SideInfoIndices *psIndices, /* I/O Quantization indices */
- SKP_Silk_nsq_state *psNSQ, /* I/O Noise Shaping Quantzation state */
- SKP_int8 pulses[], /* O Quantized pulse signal */
- const SKP_float x[] /* I Prefiltered input signal */
-);
-
-/* using log2() helps the fixed-point conversion */
-SKP_INLINE SKP_float SKP_Silk_log2( double x ) { return ( SKP_float )( 3.32192809488736 * log10( x ) ); }
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
--- a/silk/SKP_Silk_pitch_analysis_core_FLP.c
+++ /dev/null
@@ -1,635 +1,0 @@
-/***********************************************************************
-Copyright (c) 2006-2011, Skype Limited. All rights reserved.
-Redistribution and use in source and binary forms, with or without
-modification, (subject to the limitations in the disclaimer below)
-are permitted provided that the following conditions are met:
-- Redistributions of source code must retain the above copyright notice,
-this list of conditions and the following disclaimer.
-- Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
-- Neither the name of Skype Limited, nor the names of specific
-contributors, may be used to endorse or promote products derived from
-this software without specific prior written permission.
-NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED
-BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
-BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-***********************************************************************/
-
-/*****************************************************************************
-*
-* Pitch analyser function
-*
-******************************************************************************/
-#include "SKP_Silk_SigProc_FLP.h"
-#include "SKP_Silk_SigProc_FIX.h"
-#include "SKP_Silk_pitch_est_defines.h"
-
-#define SCRATCH_SIZE 22
-
-/************************************************************/
-/* Definitions */
-/************************************************************/
-#define eps 1.192092896e-07f
-
-/* using log2() helps the fixed-point conversion */
-SKP_INLINE SKP_float SKP_P_log2(double x) { return (SKP_float)(3.32192809488736 * log10(x)); }
-
-/************************************************************/
-/* Internally used functions */
-/************************************************************/
-static void SKP_P_Ana_calc_corr_st3(
- SKP_float cross_corr_st3[ PE_MAX_NB_SUBFR ][ PE_NB_CBKS_STAGE3_MAX ][ PE_NB_STAGE3_LAGS ], /* O 3 DIM correlation array */
- const SKP_float signal[], /* I vector to correlate */
- SKP_int start_lag, /* I start lag */
- SKP_int sf_length, /* I sub frame length */
- SKP_int nb_subfr, /* I number of subframes */
- SKP_int complexity /* I Complexity setting */
-);
-
-static void SKP_P_Ana_calc_energy_st3(
- SKP_float energies_st3[ PE_MAX_NB_SUBFR ][ PE_NB_CBKS_STAGE3_MAX ][ PE_NB_STAGE3_LAGS ], /* O 3 DIM correlation array */
- const SKP_float signal[], /* I vector to correlate */
- SKP_int start_lag, /* I start lag */
- SKP_int sf_length, /* I sub frame length */
- SKP_int nb_subfr, /* I number of subframes */
- SKP_int complexity /* I Complexity setting */
-);
-
-//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-//% CORE PITCH ANALYSIS FUNCTION %
-//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-SKP_int SKP_Silk_pitch_analysis_core_FLP( /* O voicing estimate: 0 voiced, 1 unvoiced */
- const SKP_float *signal, /* I signal of length PE_FRAME_LENGTH_MS*Fs_kHz */
- SKP_int *pitch_out, /* O 4 pitch lag values */
- SKP_int16 *lagIndex, /* O lag Index */
- SKP_int8 *contourIndex, /* O pitch contour Index */
- SKP_float *LTPCorr, /* I/O normalized correlation; input: value from previous frame */
- SKP_int prevLag, /* I last lag of previous frame; set to zero is unvoiced */
- const SKP_float search_thres1, /* I first stage threshold for lag candidates 0 - 1 */
- const SKP_float search_thres2, /* I final threshold for lag candidates 0 - 1 */
- const SKP_int Fs_kHz, /* I sample frequency (kHz) */
- const SKP_int complexity, /* I Complexity setting, 0-2, where 2 is highest */
- const SKP_int nb_subfr /* I number of 5 ms subframes */
-)
-{
- SKP_int i, k, d, j;
- SKP_float signal_8kHz[ PE_MAX_FRAME_LENGTH_MS * 8 ];
- SKP_float signal_4kHz[ PE_MAX_FRAME_LENGTH_MS * 4 ];
- SKP_int16 signal_8_FIX[ PE_MAX_FRAME_LENGTH_MS * 8 ];
- SKP_int16 signal_4_FIX[ PE_MAX_FRAME_LENGTH_MS * 4 ];
- SKP_int32 filt_state[ 6 ];
- SKP_float threshold, contour_bias;
- SKP_float C[ PE_MAX_NB_SUBFR][ (PE_MAX_LAG >> 1) + 5 ];
- SKP_float CC[ PE_NB_CBKS_STAGE2_EXT ];
- const SKP_float *target_ptr, *basis_ptr;
- double cross_corr, normalizer, energy, energy_tmp;
- SKP_int d_srch[ PE_D_SRCH_LENGTH ];
- SKP_int16 d_comp[ (PE_MAX_LAG >> 1) + 5 ];
- SKP_int length_d_srch, length_d_comp;
- SKP_float Cmax, CCmax, CCmax_b, CCmax_new_b, CCmax_new;
- SKP_int CBimax, CBimax_new, lag, start_lag, end_lag, lag_new;
- SKP_int cbk_size;
- SKP_float lag_log2, prevLag_log2, delta_lag_log2_sqr;
- SKP_float energies_st3[ PE_MAX_NB_SUBFR ][ PE_NB_CBKS_STAGE3_MAX ][ PE_NB_STAGE3_LAGS ];
- SKP_float cross_corr_st3[ PE_MAX_NB_SUBFR ][ PE_NB_CBKS_STAGE3_MAX ][ PE_NB_STAGE3_LAGS ];
- SKP_int lag_counter;
- SKP_int frame_length, frame_length_8kHz, frame_length_4kHz;
- SKP_int sf_length, sf_length_8kHz, sf_length_4kHz;
- SKP_int min_lag, min_lag_8kHz, min_lag_4kHz;
- SKP_int max_lag, max_lag_8kHz, max_lag_4kHz;
- SKP_int nb_cbk_search;
- const SKP_int8 *Lag_CB_ptr;
-
- /* Check for valid sampling frequency */
- SKP_assert( Fs_kHz == 8 || Fs_kHz == 12 || Fs_kHz == 16 );
-
- /* Check for valid complexity setting */
- SKP_assert( complexity >= SigProc_PE_MIN_COMPLEX );
- SKP_assert( complexity <= SigProc_PE_MAX_COMPLEX );
-
- SKP_assert( search_thres1 >= 0.0f && search_thres1 <= 1.0f );
- SKP_assert( search_thres2 >= 0.0f && search_thres2 <= 1.0f );
-
- /* Setup frame lengths max / min lag for the sampling frequency */
- frame_length = ( PE_LTP_MEM_LENGTH_MS + nb_subfr * PE_SUBFR_LENGTH_MS ) * Fs_kHz;
- frame_length_4kHz = ( PE_LTP_MEM_LENGTH_MS + nb_subfr * PE_SUBFR_LENGTH_MS ) * 4;
- frame_length_8kHz = ( PE_LTP_MEM_LENGTH_MS + nb_subfr * PE_SUBFR_LENGTH_MS ) * 8;
- sf_length = PE_SUBFR_LENGTH_MS * Fs_kHz;
- sf_length_4kHz = PE_SUBFR_LENGTH_MS * 4;
- sf_length_8kHz = PE_SUBFR_LENGTH_MS * 8;
- min_lag = PE_MIN_LAG_MS * Fs_kHz;
- min_lag_4kHz = PE_MIN_LAG_MS * 4;
- min_lag_8kHz = PE_MIN_LAG_MS * 8;
- max_lag = PE_MAX_LAG_MS * Fs_kHz - 1;
- max_lag_4kHz = PE_MAX_LAG_MS * 4;
- max_lag_8kHz = PE_MAX_LAG_MS * 8 - 1;
-
- SKP_memset(C, 0, sizeof(SKP_float) * nb_subfr * ((PE_MAX_LAG >> 1) + 5));
-
- /* Resample from input sampled at Fs_kHz to 8 kHz */
- if( Fs_kHz == 16 ) {
- /* Resample to 16 -> 8 khz */
- SKP_int16 signal_16_FIX[ 16 * PE_MAX_FRAME_LENGTH_MS ];
- SKP_float2short_array( signal_16_FIX, signal, frame_length );
- SKP_memset( filt_state, 0, 2 * sizeof( SKP_int32 ) );
- SKP_Silk_resampler_down2( filt_state, signal_8_FIX, signal_16_FIX, frame_length );
- SKP_short2float_array( signal_8kHz, signal_8_FIX, frame_length_8kHz );
- } else if( Fs_kHz == 12 ) {
- /* Resample to 12 -> 8 khz */
- SKP_int16 signal_12_FIX[ 12 * PE_MAX_FRAME_LENGTH_MS ];
- SKP_float2short_array( signal_12_FIX, signal, frame_length );
- SKP_memset( filt_state, 0, 6 * sizeof( SKP_int32 ) );
- SKP_Silk_resampler_down2_3( filt_state, signal_8_FIX, signal_12_FIX, frame_length );
- SKP_short2float_array( signal_8kHz, signal_8_FIX, frame_length_8kHz );
- } else {
- SKP_assert( Fs_kHz == 8 );
- SKP_float2short_array( signal_8_FIX, signal, frame_length_8kHz );
- }
-
- /* Decimate again to 4 kHz */
- SKP_memset( filt_state, 0, 2 * sizeof( SKP_int32 ) );
- SKP_Silk_resampler_down2( filt_state, signal_4_FIX, signal_8_FIX, frame_length_8kHz );
- SKP_short2float_array( signal_4kHz, signal_4_FIX, frame_length_4kHz );
-
- /* Low-pass filter */
- for( i = frame_length_4kHz - 1; i > 0; i-- ) {
- signal_4kHz[ i ] += signal_4kHz[ i - 1 ];
- }
-
- /******************************************************************************
- * FIRST STAGE, operating in 4 khz
- ******************************************************************************/
- target_ptr = &signal_4kHz[ SKP_LSHIFT( sf_length_4kHz, 2 ) ];
- for( k = 0; k < nb_subfr >> 1; k++ ) {
- /* Check that we are within range of the array */
- SKP_assert( target_ptr >= signal_4kHz );
- SKP_assert( target_ptr + sf_length_8kHz <= signal_4kHz + frame_length_4kHz );
-
- basis_ptr = target_ptr - min_lag_4kHz;
-
- /* Check that we are within range of the array */
- SKP_assert( basis_ptr >= signal_4kHz );
- SKP_assert( basis_ptr + sf_length_8kHz <= signal_4kHz + frame_length_4kHz );
-
- /* Calculate first vector products before loop */
- cross_corr = SKP_Silk_inner_product_FLP( target_ptr, basis_ptr, sf_length_8kHz );
- normalizer = SKP_Silk_energy_FLP( basis_ptr, sf_length_8kHz ) + sf_length_8kHz * 4000.0f;
-
- C[ 0 ][ min_lag_4kHz ] += (SKP_float)(cross_corr / sqrt(normalizer));
-
- /* From now on normalizer is computed recursively */
- for(d = min_lag_4kHz + 1; d <= max_lag_4kHz; d++) {
- basis_ptr--;
-
- /* Check that we are within range of the array */
- SKP_assert( basis_ptr >= signal_4kHz );
- SKP_assert( basis_ptr + sf_length_8kHz <= signal_4kHz + frame_length_4kHz );
-
- cross_corr = SKP_Silk_inner_product_FLP(target_ptr, basis_ptr, sf_length_8kHz);
-
- /* 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 ];
- C[ 0 ][ d ] += (SKP_float)(cross_corr / sqrt( normalizer ));
- }
- /* Update target pointer */
- target_ptr += sf_length_8kHz;
- }
-
- /* Apply short-lag bias */
- for( i = max_lag_4kHz; i >= min_lag_4kHz; i-- ) {
- C[ 0 ][ i ] -= C[ 0 ][ i ] * i / 4096.0f;
- }
-
- /* Sort */
- length_d_srch = 4 + 2 * complexity;
- SKP_assert( 3 * length_d_srch <= PE_D_SRCH_LENGTH );
- SKP_Silk_insertion_sort_decreasing_FLP( &C[ 0 ][ min_lag_4kHz ], d_srch, max_lag_4kHz - min_lag_4kHz + 1, length_d_srch );
-
- /* Escape if correlation is very low already here */
- Cmax = C[ 0 ][ min_lag_4kHz ];
- target_ptr = &signal_4kHz[ SKP_SMULBB( sf_length_4kHz, nb_subfr ) ];
- energy = 1000.0f;
- for( i = 0; i < SKP_LSHIFT( sf_length_4kHz, 2 ); i++ ) {
- energy += target_ptr[i] * target_ptr[i];
- }
- threshold = Cmax * Cmax;
- if( energy / 16.0f > threshold ) {
- SKP_memset( pitch_out, 0, nb_subfr * sizeof( SKP_int ) );
- *LTPCorr = 0.0f;
- *lagIndex = 0;
- *contourIndex = 0;
- return 1;
- }
-
- threshold = search_thres1 * Cmax;
- for( i = 0; i < length_d_srch; i++ ) {
- /* Convert to 8 kHz indices for the sorted correlation that exceeds the threshold */
- if( C[ 0 ][ min_lag_4kHz + i ] > threshold ) {
- d_srch[ i ] = SKP_LSHIFT( d_srch[ i ] + min_lag_4kHz, 1 );
- } else {
- length_d_srch = i;
- break;
- }
- }
- SKP_assert( length_d_srch > 0 );
-
- for( i = min_lag_8kHz - 5; i < max_lag_8kHz + 5; i++ ) {
- d_comp[ i ] = 0;
- }
- for( i = 0; i < length_d_srch; i++ ) {
- d_comp[ d_srch[ i ] ] = 1;
- }
-
- /* Convolution */
- for( i = max_lag_8kHz + 3; i >= min_lag_8kHz; i-- ) {
- d_comp[ i ] += d_comp[ i - 1 ] + d_comp[ i - 2 ];
- }
-
- length_d_srch = 0;
- for( i = min_lag_8kHz; i < max_lag_8kHz + 1; i++ ) {
- if( d_comp[ i + 1 ] > 0 ) {
- d_srch[ length_d_srch ] = i;
- length_d_srch++;
- }
- }
-
- /* Convolution */
- for( i = max_lag_8kHz + 3; i >= min_lag_8kHz; i-- ) {
- d_comp[ i ] += d_comp[ i - 1 ] + d_comp[ i - 2 ] + d_comp[ i - 3 ];
- }
-
- length_d_comp = 0;
- for( i = min_lag_8kHz; i < max_lag_8kHz + 4; i++ ) {
- if( d_comp[ i ] > 0 ) {
- d_comp[ length_d_comp ] = i - 2;
- length_d_comp++;
- }
- }
-
- /**********************************************************************************
- ** SECOND STAGE, operating at 8 kHz, on lag sections with high correlation
- *************************************************************************************/
- /*********************************************************************************
- * Find energy of each subframe projected onto its history, for a range of delays
- *********************************************************************************/
- SKP_memset( C, 0, PE_MAX_NB_SUBFR*((PE_MAX_LAG >> 1) + 5) * sizeof(SKP_float)); // Is this needed?
-
- if( Fs_kHz == 8 ) {
- target_ptr = &signal[ PE_LTP_MEM_LENGTH_MS * 8 ];
- } else {
- target_ptr = &signal_8kHz[ PE_LTP_MEM_LENGTH_MS * 8 ];
- }
- for( k = 0; k < nb_subfr; k++ ) {
- energy_tmp = SKP_Silk_energy_FLP( target_ptr, sf_length_8kHz );
- for( j = 0; j < length_d_comp; j++ ) {
- d = d_comp[ j ];
- basis_ptr = target_ptr - d;
- cross_corr = SKP_Silk_inner_product_FLP( basis_ptr, target_ptr, sf_length_8kHz );
- energy = SKP_Silk_energy_FLP( basis_ptr, sf_length_8kHz );
- if (cross_corr > 0.0f) {
- C[ k ][ d ] = (SKP_float)(cross_corr * cross_corr / (energy * energy_tmp + eps));
- } else {
- C[ k ][ d ] = 0.0f;
- }
- }
- target_ptr += sf_length_8kHz;
- }
-
- /* search over lag range and lags codebook */
- /* scale factor for lag codebook, as a function of center lag */
-
- CCmax = 0.0f; /* This value doesn't matter */
- CCmax_b = -1000.0f;
-
- CBimax = 0; /* To avoid returning undefined lag values */
- lag = -1; /* To check if lag with strong enough correlation has been found */
-
- if( prevLag > 0 ) {
- if( Fs_kHz == 12 ) {
- prevLag = SKP_LSHIFT( prevLag, 1 ) / 3;
- } else if( Fs_kHz == 16 ) {
- prevLag = SKP_RSHIFT( prevLag, 1 );
- }
- prevLag_log2 = SKP_P_log2((SKP_float)prevLag);
- } else {
- prevLag_log2 = 0;
- }
-
- /* Setup stage 2 codebook based on number of subframes */
- if( nb_subfr == PE_MAX_NB_SUBFR ) {
- cbk_size = PE_NB_CBKS_STAGE2_EXT;
- Lag_CB_ptr = &SKP_Silk_CB_lags_stage2[ 0 ][ 0 ];
- if( Fs_kHz == 8 && complexity > SigProc_PE_MIN_COMPLEX ) {
- /* If input is 8 khz use a larger codebook here because it is last stage */
- nb_cbk_search = PE_NB_CBKS_STAGE2_EXT;
- } else {
- nb_cbk_search = PE_NB_CBKS_STAGE2;
- }
- } else {
- cbk_size = PE_NB_CBKS_STAGE2_10MS;
- Lag_CB_ptr = &SKP_Silk_CB_lags_stage2_10_ms[ 0 ][ 0 ];
- nb_cbk_search = PE_NB_CBKS_STAGE2_10MS;
- }
-
- for( k = 0; k < length_d_srch; k++ ) {
- d = d_srch[ k ];
- for( j = 0; j < nb_cbk_search; j++ ) {
- CC[j] = 0.0f;
- for( i = 0; i < nb_subfr; i++ ) {
- /* Try all codebooks */
- CC[ j ] += C[ i ][ d + matrix_ptr( Lag_CB_ptr, i, j, cbk_size )];
- }
- }
- /* Find best codebook */
- CCmax_new = -1000.0f;
- CBimax_new = 0;
- for( i = 0; i < nb_cbk_search; i++ ) {
- if( CC[ i ] > CCmax_new ) {
- CCmax_new = CC[ i ];
- CBimax_new = i;
- }
- }
- CCmax_new = SKP_max_float(CCmax_new, 0.0f); /* To avoid taking square root of negative number later */
- CCmax_new_b = CCmax_new;
-
- /* Bias towards shorter lags */
- lag_log2 = SKP_P_log2((SKP_float)d);
- CCmax_new_b -= PE_SHORTLAG_BIAS * nb_subfr * lag_log2;
-
- /* Bias towards previous lag */
- if ( prevLag > 0 ) {
- delta_lag_log2_sqr = lag_log2 - prevLag_log2;
- delta_lag_log2_sqr *= delta_lag_log2_sqr;
- CCmax_new_b -= PE_PREVLAG_BIAS * nb_subfr * (*LTPCorr) * delta_lag_log2_sqr / (delta_lag_log2_sqr + 0.5f);
- }
-
- if ( CCmax_new_b > CCmax_b && /* Find maximum biased correlation */
- CCmax_new > nb_subfr * search_thres2 * search_thres2 && /* Correlation needs to be high enough to be voiced */
- SKP_Silk_CB_lags_stage2[ 0 ][ CBimax_new ] <= min_lag_8kHz /* Lag must be in range */
- ) {
- CCmax_b = CCmax_new_b;
- CCmax = CCmax_new;
- lag = d;
- CBimax = CBimax_new;
- }
- }
-
- if( lag == -1 ) {
- /* No suitable candidate found */
- SKP_memset( pitch_out, 0, PE_MAX_NB_SUBFR * sizeof(SKP_int) );
- *LTPCorr = 0.0f;
- *lagIndex = 0;
- *contourIndex = 0;
- return 1;
- }
-
- if( Fs_kHz > 8 ) {
- /* Search in original signal */
-
- /* Compensate for decimation */
- SKP_assert( lag == SKP_SAT16( lag ) );
- if( Fs_kHz == 12 ) {
- lag = SKP_RSHIFT_ROUND( SKP_SMULBB( lag, 3 ), 1 );
- } else if( Fs_kHz == 16 ) {
- lag = SKP_LSHIFT( lag, 1 );
- } else {
- lag = SKP_SMULBB( lag, 3 );
- }
-
- lag = SKP_LIMIT_int( lag, min_lag, max_lag );
- start_lag = SKP_max_int( lag - 2, min_lag );
- end_lag = SKP_min_int( lag + 2, max_lag );
- lag_new = lag; /* to avoid undefined lag */
- CBimax = 0; /* to avoid undefined lag */
- SKP_assert( CCmax >= 0.0f );
- *LTPCorr = (SKP_float)sqrt( CCmax / nb_subfr ); /* Output normalized correlation */
-
- CCmax = -1000.0f;
-
- /* Calculate the correlations and energies needed in stage 3 */
- SKP_P_Ana_calc_corr_st3( cross_corr_st3, signal, start_lag, sf_length, nb_subfr, complexity );
- SKP_P_Ana_calc_energy_st3( energies_st3, signal, start_lag, sf_length, nb_subfr, complexity );
-
- lag_counter = 0;
- SKP_assert( lag == SKP_SAT16( lag ) );
- contour_bias = PE_FLATCONTOUR_BIAS / lag;
-
- /* Setup cbk parameters acording to complexity setting and frame length */
- if( nb_subfr == PE_MAX_NB_SUBFR ) {
- nb_cbk_search = (SKP_int)SKP_Silk_nb_cbk_searchs_stage3[ complexity ];
- cbk_size = PE_NB_CBKS_STAGE3_MAX;
- Lag_CB_ptr = &SKP_Silk_CB_lags_stage3[ 0 ][ 0 ];
- } else {
- nb_cbk_search = PE_NB_CBKS_STAGE3_10MS;
- cbk_size = PE_NB_CBKS_STAGE3_10MS;
- Lag_CB_ptr = &SKP_Silk_CB_lags_stage3_10_ms[ 0 ][ 0 ];
- }
-
- for( d = start_lag; d <= end_lag; d++ ) {
- for( j = 0; j < nb_cbk_search; j++ ) {
- cross_corr = 0.0;
- energy = eps;
- for( k = 0; k < nb_subfr; k++ ) {
- energy += energies_st3[ k ][ j ][ lag_counter ];
- cross_corr += cross_corr_st3[ k ][ j ][ lag_counter ];
- }
- if( cross_corr > 0.0 ) {
- CCmax_new = (SKP_float)(cross_corr * cross_corr / energy);
- /* Reduce depending on flatness of contour */
- CCmax_new *= 1.0f - contour_bias * j;
- } else {
- CCmax_new = 0.0f;
- }
-
- if( CCmax_new > CCmax &&
- ( d + (SKP_int)SKP_Silk_CB_lags_stage3[ 0 ][ j ] ) <= max_lag
- ) {
- CCmax = CCmax_new;
- lag_new = d;
- CBimax = j;
- }
- }
- lag_counter++;
- }
-
- for( k = 0; k < nb_subfr; k++ ) {
- pitch_out[ k ] = lag_new + matrix_ptr( Lag_CB_ptr, k, CBimax, cbk_size );
- }
- *lagIndex = (SKP_int16)( lag_new - min_lag );
- *contourIndex = (SKP_int8)CBimax;
- } else {
- /* Save Lags and correlation */
- SKP_assert( CCmax >= 0.0f );
- *LTPCorr = (SKP_float)sqrt( CCmax / nb_subfr ); /* Output normalized correlation */
- for( k = 0; k < nb_subfr; k++ ) {
- pitch_out[ k ] = lag + matrix_ptr( Lag_CB_ptr, k, CBimax, cbk_size );
- }
- *lagIndex = (SKP_int16)( lag - min_lag );
- *contourIndex = (SKP_int8)CBimax;
- }
- SKP_assert( *lagIndex >= 0 );
- /* return as voiced */
- return 0;
-}
-
-static void SKP_P_Ana_calc_corr_st3(
- SKP_float cross_corr_st3[ PE_MAX_NB_SUBFR ][ PE_NB_CBKS_STAGE3_MAX ][ PE_NB_STAGE3_LAGS ], /* O 3 DIM correlation array */
- const SKP_float signal[], /* I vector to correlate */
- SKP_int start_lag, /* I start lag */
- SKP_int sf_length, /* I sub frame length */
- SKP_int nb_subfr, /* I number of subframes */
- SKP_int complexity /* I Complexity setting */
-)
- /***********************************************************************
- Calculates the correlations used in stage 3 search. In order to cover
- the whole lag codebook for all the searched offset lags (lag +- 2),
- the following correlations are needed in each sub frame:
-
- sf1: lag range [-8,...,7] total 16 correlations
- sf2: lag range [-4,...,4] total 9 correlations
- sf3: lag range [-3,....4] total 8 correltions
- sf4: lag range [-6,....8] total 15 correlations
-
- In total 48 correlations. The direct implementation computed in worst case
- 4*12*5 = 240 correlations, but more likely around 120.
- **********************************************************************/
-{
- const SKP_float *target_ptr, *basis_ptr;
- SKP_int i, j, k, lag_counter, lag_low, lag_high;
- SKP_int nb_cbk_search, delta, idx, cbk_size;
- SKP_float scratch_mem[ SCRATCH_SIZE ];
- const SKP_int8 *Lag_range_ptr, *Lag_CB_ptr;
-
- SKP_assert( complexity >= SigProc_PE_MIN_COMPLEX );
- SKP_assert( complexity <= SigProc_PE_MAX_COMPLEX );
-
- if( nb_subfr == PE_MAX_NB_SUBFR ){
- Lag_range_ptr = &SKP_Silk_Lag_range_stage3[ complexity ][ 0 ][ 0 ];
- Lag_CB_ptr = &SKP_Silk_CB_lags_stage3[ 0 ][ 0 ];
- nb_cbk_search = SKP_Silk_nb_cbk_searchs_stage3[ complexity ];
- cbk_size = PE_NB_CBKS_STAGE3_MAX;
- } else {
- SKP_assert( nb_subfr == PE_MAX_NB_SUBFR >> 1);
- Lag_range_ptr = &SKP_Silk_Lag_range_stage3_10_ms[ 0 ][ 0 ];
- Lag_CB_ptr = &SKP_Silk_CB_lags_stage3_10_ms[ 0 ][ 0 ];
- nb_cbk_search = PE_NB_CBKS_STAGE3_10MS;
- cbk_size = PE_NB_CBKS_STAGE3_10MS;
- }
-
- target_ptr = &signal[ SKP_LSHIFT( sf_length, 2 ) ]; /* Pointer to middle of frame */
- for( k = 0; k < nb_subfr; k++ ) {
- lag_counter = 0;
-
- /* Calculate the correlations for each subframe */
- lag_low = matrix_ptr( Lag_range_ptr, k, 0, 2 );
- lag_high = matrix_ptr( Lag_range_ptr, k, 1, 2 );
- for( j = lag_low; j <= lag_high; j++ ) {
- basis_ptr = target_ptr - ( start_lag + j );
- SKP_assert( lag_counter < SCRATCH_SIZE );
- scratch_mem[ lag_counter ] = (SKP_float)SKP_Silk_inner_product_FLP( target_ptr, basis_ptr, sf_length );
- lag_counter++;
- }
-
- delta = matrix_ptr( Lag_range_ptr, k, 0, 2 );
- for( i = 0; i < nb_cbk_search; i++ ) {
- /* Fill out the 3 dim array that stores the correlations for */
- /* each code_book vector for each start lag */
- idx = matrix_ptr( Lag_CB_ptr, k, i, cbk_size ) - delta;
- for( j = 0; j < PE_NB_STAGE3_LAGS; j++ ) {
- SKP_assert( idx + j < SCRATCH_SIZE );
- SKP_assert( idx + j < lag_counter );
- cross_corr_st3[ k ][ i ][ j ] = scratch_mem[ idx + j ];
- }
- }
- target_ptr += sf_length;
- }
-}
-
-static void SKP_P_Ana_calc_energy_st3(
- SKP_float energies_st3[ PE_MAX_NB_SUBFR ][ PE_NB_CBKS_STAGE3_MAX ][ PE_NB_STAGE3_LAGS ], /* O 3 DIM correlation array */
- const SKP_float signal[], /* I vector to correlate */
- SKP_int start_lag, /* I start lag */
- SKP_int sf_length, /* I sub frame length */
- SKP_int nb_subfr, /* I number of subframes */
- SKP_int complexity /* I Complexity setting */
-)
-/****************************************************************
-Calculate the energies for first two subframes. The energies are
-calculated recursively.
-****************************************************************/
-{
- const SKP_float *target_ptr, *basis_ptr;
- double energy;
- SKP_int k, i, j, lag_counter;
- SKP_int nb_cbk_search, delta, idx, cbk_size, lag_diff;
- SKP_float scratch_mem[ SCRATCH_SIZE ];
- const SKP_int8 *Lag_range_ptr, *Lag_CB_ptr;
-
- SKP_assert( complexity >= SigProc_PE_MIN_COMPLEX );
- SKP_assert( complexity <= SigProc_PE_MAX_COMPLEX );
-
- if( nb_subfr == PE_MAX_NB_SUBFR ){
- Lag_range_ptr = &SKP_Silk_Lag_range_stage3[ complexity ][ 0 ][ 0 ];
- Lag_CB_ptr = &SKP_Silk_CB_lags_stage3[ 0 ][ 0 ];
- nb_cbk_search = SKP_Silk_nb_cbk_searchs_stage3[ complexity ];
- cbk_size = PE_NB_CBKS_STAGE3_MAX;
- } else {
- SKP_assert( nb_subfr == PE_MAX_NB_SUBFR >> 1);
- Lag_range_ptr = &SKP_Silk_Lag_range_stage3_10_ms[ 0 ][ 0 ];
- Lag_CB_ptr = &SKP_Silk_CB_lags_stage3_10_ms[ 0 ][ 0 ];
- nb_cbk_search = PE_NB_CBKS_STAGE3_10MS;
- cbk_size = PE_NB_CBKS_STAGE3_10MS;
- }
-
- target_ptr = &signal[ SKP_LSHIFT( sf_length, 2 ) ];
- for( k = 0; k < nb_subfr; k++ ) {
- lag_counter = 0;
-
- /* Calculate the energy for first lag */
- basis_ptr = target_ptr - ( start_lag + matrix_ptr( Lag_range_ptr, k, 0, 2 ) );
- energy = SKP_Silk_energy_FLP( basis_ptr, sf_length ) + 1e-3;
- SKP_assert( energy >= 0.0 );
- scratch_mem[lag_counter] = (SKP_float)energy;
- lag_counter++;
-
- lag_diff = ( matrix_ptr( Lag_range_ptr, k, 1, 2 ) - matrix_ptr( Lag_range_ptr, k, 0, 2 ) + 1 );
- for( i = 1; i < lag_diff; i++ ) {
- /* remove part outside new window */
- energy -= basis_ptr[sf_length - i] * basis_ptr[sf_length - i];
- SKP_assert( energy >= 0.0 );
-
- /* add part that comes into window */
- energy += basis_ptr[ -i ] * basis_ptr[ -i ];
- SKP_assert( energy >= 0.0 );
- SKP_assert( lag_counter < SCRATCH_SIZE );
- scratch_mem[lag_counter] = (SKP_float)energy;
- lag_counter++;
- }
-
- delta = matrix_ptr( Lag_range_ptr, k, 0, 2 );
- for( i = 0; i < nb_cbk_search; i++ ) {
- /* Fill out the 3 dim array that stores the correlations for */
- /* each code_book vector for each start lag */
- idx = matrix_ptr( Lag_CB_ptr, k, i, cbk_size ) - delta;
- for( j = 0; j < PE_NB_STAGE3_LAGS; j++ ) {
- SKP_assert( idx + j < SCRATCH_SIZE );
- SKP_assert( idx + j < lag_counter );
- energies_st3[ k ][ i ][ j ] = scratch_mem[ idx + j ];
- SKP_assert( energies_st3[ k ][ i ][ j ] >= 0.0f );
- }
- }
- target_ptr += sf_length;
- }
-}
--- a/silk/SKP_Silk_scale_copy_vector_FLP.c
+++ /dev/null
@@ -1,53 +1,0 @@
-/***********************************************************************
-Copyright (c) 2006-2011, Skype Limited. All rights reserved.
-Redistribution and use in source and binary forms, with or without
-modification, (subject to the limitations in the disclaimer below)
-are permitted provided that the following conditions are met:
-- Redistributions of source code must retain the above copyright notice,
-this list of conditions and the following disclaimer.
-- Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
-- Neither the name of Skype Limited, nor the names of specific
-contributors, may be used to endorse or promote products derived from
-this software without specific prior written permission.
-NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED
-BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
-BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-***********************************************************************/
-
-#include "SKP_Silk_SigProc_FLP.h"
-
-/* copy and multiply a vector by a constant */
-void SKP_Silk_scale_copy_vector_FLP(
- SKP_float *data_out,
- const SKP_float *data_in,
- SKP_float gain,
- SKP_int dataSize
-)
-{
- SKP_int i, dataSize4;
-
- /* 4x unrolled loop */
- dataSize4 = dataSize & 0xFFFC;
- for( i = 0; i < dataSize4; i += 4 ) {
- data_out[ i + 0 ] = gain * data_in[ i + 0 ];
- data_out[ i + 1 ] = gain * data_in[ i + 1 ];
- data_out[ i + 2 ] = gain * data_in[ i + 2 ];
- data_out[ i + 3 ] = gain * data_in[ i + 3 ];
- }
-
- /* any remaining elements */
- for( ; i < dataSize; i++ ) {
- data_out[ i ] = gain * data_in[ i ];
- }
-}
--- a/silk/SKP_Silk_scale_vector_FLP.c
+++ /dev/null
@@ -1,52 +1,0 @@
-/***********************************************************************
-Copyright (c) 2006-2011, Skype Limited. All rights reserved.
-Redistribution and use in source and binary forms, with or without
-modification, (subject to the limitations in the disclaimer below)
-are permitted provided that the following conditions are met:
-- Redistributions of source code must retain the above copyright notice,
-this list of conditions and the following disclaimer.
-- Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
-- Neither the name of Skype Limited, nor the names of specific
-contributors, may be used to endorse or promote products derived from
-this software without specific prior written permission.
-NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED
-BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
-BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-***********************************************************************/
-
-#include "SKP_Silk_SigProc_FLP.h"
-
-/* multiply a vector by a constant */
-void SKP_Silk_scale_vector_FLP(
- SKP_float *data1,
- SKP_float gain,
- SKP_int dataSize
-)
-{
- SKP_int i, dataSize4;
-
- /* 4x unrolled loop */
- dataSize4 = dataSize & 0xFFFC;
- for( i = 0; i < dataSize4; i += 4 ) {
- data1[ i + 0 ] *= gain;
- data1[ i + 1 ] *= gain;
- data1[ i + 2 ] *= gain;
- data1[ i + 3 ] *= gain;
- }
-
- /* any remaining elements */
- for( ; i < dataSize; i++ ) {
- data1[ i ] *= gain;
- }
-}
--- a/silk/SKP_Silk_schur_FLP.c
+++ /dev/null
@@ -1,73 +1,0 @@
-/***********************************************************************
-Copyright (c) 2006-2011, Skype Limited. All rights reserved.
-Redistribution and use in source and binary forms, with or without
-modification, (subject to the limitations in the disclaimer below)
-are permitted provided that the following conditions are met:
-- Redistributions of source code must retain the above copyright notice,
-this list of conditions and the following disclaimer.
-- Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
-- Neither the name of Skype Limited, nor the names of specific
-contributors, may be used to endorse or promote products derived from
-this software without specific prior written permission.
-NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED
-BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
-BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-***********************************************************************/
-
-/* *
- * SKP_Silk_schur.c *
- * *
- * Calculates the reflection coefficients from the correlation sequence *
- * *
- * Copyright 2008 (c), Skype Limited *
- * Date: 080103 *
- */
-
-#include "SKP_Silk_SigProc_FLP.h"
-
-SKP_float SKP_Silk_schur_FLP( /* O returns residual energy */
- SKP_float refl_coef[], /* O reflection coefficients (length order) */
- const SKP_float auto_corr[], /* I autotcorrelation sequence (length order+1) */
- SKP_int order /* I order */
-)
-{
- SKP_int k, n;
- SKP_float C[ SKP_Silk_MAX_ORDER_LPC + 1 ][ 2 ];
- SKP_float Ctmp1, Ctmp2, rc_tmp;
-
- /* Copy correlations */
- for( k = 0; k < order+1; k++ ) {
- C[ k ][ 0 ] = C[ k ][ 1 ] = auto_corr[ k ];
- }
-
- for( k = 0; k < order; k++ ) {
- /* Get reflection coefficient */
- rc_tmp = -C[ k + 1 ][ 0 ] / SKP_max_float( C[ 0 ][ 1 ], 1e-9f );
-
- /* Save the output */
- refl_coef[ k ] = rc_tmp;
-
- /* Update correlations */
- for( n = 0; n < order - k; n++ ){
- Ctmp1 = C[ n + k + 1 ][ 0 ];
- Ctmp2 = C[ n ][ 1 ];
- C[ n + k + 1 ][ 0 ] = Ctmp1 + Ctmp2 * rc_tmp;
- C[ n ][ 1 ] = Ctmp2 + Ctmp1 * rc_tmp;
- }
- }
-
- /* Return residual energy */
- return C[ 0 ][ 1 ];
-}
-
--- a/silk/SKP_Silk_sort_FLP.c
+++ /dev/null
@@ -1,79 +1,0 @@
-/***********************************************************************
-Copyright (c) 2006-2011, Skype Limited. All rights reserved.
-Redistribution and use in source and binary forms, with or without
-modification, (subject to the limitations in the disclaimer below)
-are permitted provided that the following conditions are met:
-- Redistributions of source code must retain the above copyright notice,
-this list of conditions and the following disclaimer.
-- Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
-- Neither the name of Skype Limited, nor the names of specific
-contributors, may be used to endorse or promote products derived from
-this software without specific prior written permission.
-NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED
-BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
-BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-***********************************************************************/
-
-/* Insertion sort (fast for already almost sorted arrays): */
-/* Best case: O(n) for an already sorted array */
-/* Worst case: O(n^2) for an inversely sorted array */
-
-#include "SKP_Silk_typedef.h"
-#include "SKP_Silk_SigProc_FLP.h"
-
-void SKP_Silk_insertion_sort_decreasing_FLP(
- SKP_float *a, /* I/O: Unsorted / Sorted vector */
- SKP_int *index, /* O: Index vector for the sorted elements */
- const SKP_int L, /* I: Vector length */
- const SKP_int K /* I: Number of correctly sorted positions */
-)
-{
- SKP_float value;
- SKP_int i, j;
-
- /* Safety checks */
- SKP_assert( K > 0 );
- SKP_assert( L > 0 );
- SKP_assert( L >= K );
-
- /* Write start indices in index vector */
- for( i = 0; i < K; i++ ) {
- index[ i ] = i;
- }
-
- /* Sort vector elements by value, decreasing order */
- for( i = 1; i < K; i++ ) {
- value = a[ i ];
- for( j = i - 1; ( j >= 0 ) && ( value > a[ j ] ); j-- ) {
- a[ j + 1 ] = a[ j ]; /* Shift value */
- index[ j + 1 ] = index[ j ]; /* Shift index */
- }
- a[ j + 1 ] = value; /* Write value */
- index[ j + 1 ] = i; /* Write index */
- }
-
- /* If less than L values are asked check the remaining values, */
- /* but only spend CPU to ensure that the K first values are correct */
- for( i = K; i < L; i++ ) {
- value = a[ i ];
- if( value > a[ K - 1 ] ) {
- for( j = K - 2; ( j >= 0 ) && ( value > a[ j ] ); j-- ) {
- a[ j + 1 ] = a[ j ]; /* Shift value */
- index[ j + 1 ] = index[ j ]; /* Shift index */
- }
- a[ j + 1 ] = value; /* Write value */
- index[ j + 1 ] = i; /* Write index */
- }
- }
-}
--- a/silk/SKP_Silk_stereo_LR_to_MS.c
+++ b/silk/SKP_Silk_stereo_LR_to_MS.c
@@ -29,66 +29,79 @@
/* Convert Left/Right stereo signal to adaptive Mid/Side representation */
void SKP_Silk_stereo_LR_to_MS(
+ ec_enc *psRangeEnc, /* I/O Compressor data structure */
stereo_state *state, /* I/O State */
SKP_int16 x1[], /* I/O Left input signal, becomes mid signal */
SKP_int16 x2[], /* I/O Right input signal, becomes side signal */
- SKP_int *predictorIx, /* O Index for predictor filter */
SKP_int fs_kHz, /* I Samples rate (kHz) */
SKP_int frame_length /* I Number of samples */
)
{
- SKP_int n, scale, scale1, scale2;
- SKP_int32 sum, diff, nrg1, nrg2, corr, predictor_Q16, pred_Q16, delta_Q16;
+ SKP_int n, denom_Q16, delta0_Q13, delta1_Q13;
+ SKP_int32 sum, diff, pred_Q13[ 2 ], pred0_Q13, pred1_Q13;
+ SKP_int16 mid[ MAX_FRAME_LENGTH + 2 ], side[ MAX_FRAME_LENGTH + 2 ];
+ SKP_int16 LP_mid[ MAX_FRAME_LENGTH ], HP_mid[ MAX_FRAME_LENGTH ];
+ SKP_int16 LP_side[ MAX_FRAME_LENGTH ], HP_side[ MAX_FRAME_LENGTH ];
/* Convert to basic mid/side signals */
for( n = 0; n < frame_length; n++ ) {
sum = x1[ n ] + (SKP_int32)x2[ n ];
diff = x1[ n ] - (SKP_int32)x2[ n ];
- x1[ n ] = (SKP_int16)SKP_RSHIFT32( sum + 1, 1 );
- x2[ n ] = (SKP_int16)SKP_RSHIFT32( diff, 1 );
+ mid[ n + 2 ] = (SKP_int16)SKP_RSHIFT_ROUND( sum, 1 );
+ side[ n + 2 ] = (SKP_int16)SKP_SAT16( SKP_RSHIFT_ROUND( diff, 1 ) );
}
- /* Find predictor */
- SKP_Silk_sum_sqr_shift( &nrg1, &scale1, x1, frame_length );
- SKP_Silk_sum_sqr_shift( &nrg2, &scale2, x2, frame_length );
- if( scale1 > scale2 ) {
- scale = scale1;
- } else {
- scale = scale2;
- nrg1 = SKP_RSHIFT32( nrg1, scale2 - scale1 );
+ /* Buffering */
+ SKP_memcpy( mid, state->sMid, 2 * sizeof( SKP_int16 ) );
+ SKP_memcpy( side, state->sSide, 2 * sizeof( SKP_int16 ) );
+ SKP_memcpy( state->sMid, &mid[ frame_length ], 2 * sizeof( SKP_int16 ) );
+ SKP_memcpy( state->sSide, &side[ frame_length ], 2 * sizeof( SKP_int16 ) );
+
+ /* LP and HP filter mid signal */
+ for( n = 0; n < frame_length; n++ ) {
+ sum = SKP_RSHIFT_ROUND( SKP_ADD_LSHIFT( mid[ n ] + mid[ n + 2 ], mid[ n + 1 ], 1 ), 2 );
+ LP_mid[ n ] = sum;
+ HP_mid[ n ] = mid[ n + 1 ] - sum;
}
- corr = SKP_Silk_inner_prod_aligned_scale( x1, x2, scale, frame_length );
- predictor_Q16 = SKP_DIV32_varQ( corr, nrg1 + 1, 16 );
- /* Hysteresis */
- if( predictor_Q16 > state->predictor_prev_Q16 ) {
- predictor_Q16 -= SKP_FIX_CONST( STEREO_QUANT_HYSTERESIS / STEREO_QUANT_STEPS, 16 );
- } else {
- predictor_Q16 += SKP_FIX_CONST( STEREO_QUANT_HYSTERESIS / STEREO_QUANT_STEPS, 16 );
+ /* LP and HP filter side signal */
+ for( n = 0; n < frame_length; n++ ) {
+ sum = SKP_RSHIFT_ROUND( SKP_ADD_LSHIFT( side[ n ] + side[ n + 2 ], side[ n + 1 ], 1 ), 2 );
+ LP_side[ n ] = sum;
+ HP_side[ n ] = side[ n + 1 ] - sum;
}
- /* Quantize */
- *predictorIx = SKP_RSHIFT_ROUND( SKP_MUL( predictor_Q16 + 65536, STEREO_QUANT_STEPS - 1 ), 17 );
- *predictorIx = SKP_LIMIT( *predictorIx, 0, STEREO_QUANT_STEPS - 1 );
+ /* Find predictors */
+ pred_Q13[ 0 ] = SKP_Silk_stereo_find_predictor( LP_mid, LP_side, frame_length );
+ pred_Q13[ 1 ] = SKP_Silk_stereo_find_predictor( HP_mid, HP_side, frame_length );
- predictor_Q16 = SKP_SMLABB( -65536, *predictorIx, ( 1 << 17 ) / ( STEREO_QUANT_STEPS - 1 ) );
+ /* Quantize and encode predictors */
+ SKP_Silk_stereo_encode_pred( psRangeEnc, pred_Q13 );
- /* Subtract prediction from side channel */
- if( predictor_Q16 != state->predictor_prev_Q16 ) {
- /* Interpolate predictor */
- pred_Q16 = -state->predictor_prev_Q16;
- delta_Q16 = -SKP_DIV32_16( predictor_Q16 - state->predictor_prev_Q16, STEREO_INTERPOL_LENGTH_MS * fs_kHz );
- for( n = 0; n < STEREO_INTERPOL_LENGTH_MS * fs_kHz; n++ ) {
- pred_Q16 += delta_Q16;
- x2[ n ] = (SKP_int16)SKP_SAT16( SKP_SMLAWB( x2[ n ], pred_Q16, x1[ n ] ) );
- }
- } else {
- n = 0;
+ /* Interpolate predictors and subtract prediction from side channel */
+ pred0_Q13 = -state->pred_prev_Q13[ 0 ];
+ pred1_Q13 = -state->pred_prev_Q13[ 1 ];
+ denom_Q16 = SKP_DIV32_16( 1 << 16, STEREO_INTERP_LEN_MS * fs_kHz );
+ delta0_Q13 = -SKP_RSHIFT_ROUND( SKP_SMULBB( pred_Q13[ 0 ] - state->pred_prev_Q13[ 0 ], denom_Q16 ), 16 );
+ delta1_Q13 = -SKP_RSHIFT_ROUND( SKP_SMULBB( pred_Q13[ 1 ] - state->pred_prev_Q13[ 1 ], denom_Q16 ), 16 );
+ for( n = 0; n < STEREO_INTERP_LEN_MS * fs_kHz; n++ ) {
+ pred0_Q13 += delta0_Q13;
+ pred1_Q13 += delta1_Q13;
+ sum = SKP_LSHIFT( SKP_ADD_LSHIFT( mid[ n ] + mid[ n + 2 ], mid[ n + 1 ], 1 ), 9 ); /* Q11 */
+ sum = SKP_SMLAWB( SKP_LSHIFT( ( SKP_int32 )side[ n + 1 ], 8 ), sum, pred0_Q13 ); /* Q8 */
+ sum = SKP_SMLAWB( sum, SKP_LSHIFT( ( SKP_int32 )mid[ n + 1 ], 11 ), pred1_Q13 ); /* Q8 */
+ x2[ n ] = (SKP_int16)SKP_SAT16( SKP_RSHIFT_ROUND( sum, 8 ) );
}
- pred_Q16 = -predictor_Q16;
- for( ; n < frame_length; n++ ) {
- x2[ n ] = (SKP_int16)SKP_SAT16( SKP_SMLAWB( x2[ n ], pred_Q16, x1[ n ] ) );
+ pred0_Q13 = -pred_Q13[ 0 ];
+ pred1_Q13 = -pred_Q13[ 1 ];
+ for( n = STEREO_INTERP_LEN_MS * fs_kHz; n < frame_length; n++ ) {
+ sum = SKP_LSHIFT( SKP_ADD_LSHIFT( mid[ n ] + mid[ n + 2 ], mid[ n + 1 ], 1 ), 9 ); /* Q11 */
+ sum = SKP_SMLAWB( SKP_LSHIFT( ( SKP_int32 )side[ n + 1 ], 8 ), sum, pred0_Q13 ); /* Q8 */
+ sum = SKP_SMLAWB( sum, SKP_LSHIFT( ( SKP_int32 )mid[ n + 1 ], 11 ), pred1_Q13 ); /* Q8 */
+ x2[ n ] = (SKP_int16)SKP_SAT16( SKP_RSHIFT_ROUND( sum, 8 ) );
}
+ state->pred_prev_Q13[ 0 ] = pred_Q13[ 0 ];
+ state->pred_prev_Q13[ 1 ] = pred_Q13[ 1 ];
- state->predictor_prev_Q16 = predictor_Q16;
+ SKP_memcpy( x1, mid + 1, frame_length * sizeof( SKP_int16 ) );
}
--- a/silk/SKP_Silk_stereo_MS_to_LR.c
+++ b/silk/SKP_Silk_stereo_MS_to_LR.c
@@ -32,40 +32,52 @@
stereo_state *state, /* I/O State */
SKP_int16 x1[], /* I/O Left input signal, becomes mid signal */
SKP_int16 x2[], /* I/O Right input signal, becomes side signal */
- SKP_int predictorIx, /* I Index for predictor filter */
+ const SKP_int32 pred_Q13[], /* I Predictors */
SKP_int fs_kHz, /* I Samples rate (kHz) */
SKP_int frame_length /* I Number of samples */
)
{
- SKP_int n;
- SKP_int32 sum, diff, predictor_Q16, pred_Q16, delta_Q16;
+ SKP_int n, denom_Q16, delta0_Q13, delta1_Q13;
+ SKP_int32 sum, diff, pred0_Q13, pred1_Q13;
+ SKP_int16 mid[ MAX_FRAME_LENGTH + 2 ], side[ MAX_FRAME_LENGTH + 2 ];
- /* Dequantize */
- predictor_Q16 = SKP_SMLABB( -65536, predictorIx, ( 1 << 17 ) / ( STEREO_QUANT_STEPS - 1 ) );
+ /* Buffering */
+ SKP_memcpy( mid, state->sMid, 2 * sizeof( SKP_int16 ) );
+ SKP_memcpy( side, state->sSide, 2 * sizeof( SKP_int16 ) );
+ SKP_memcpy( mid + 2, x1, frame_length * sizeof( SKP_int16 ) );
+ SKP_memcpy( side + 2, x2, frame_length * sizeof( SKP_int16 ) );
+ SKP_memcpy( state->sMid, &mid[ frame_length ], 2 * sizeof( SKP_int16 ) );
+ SKP_memcpy( state->sSide, &side[ frame_length ], 2 * sizeof( SKP_int16 ) );
- /* Add prediction to side channel */
- if( predictor_Q16 != state->predictor_prev_Q16 ) {
- /* Interpolate predictor */
- pred_Q16 = state->predictor_prev_Q16;
- delta_Q16 = SKP_DIV32_16( predictor_Q16 - state->predictor_prev_Q16, STEREO_INTERPOL_LENGTH_MS * fs_kHz );
- for( n = 0; n < STEREO_INTERPOL_LENGTH_MS * fs_kHz; n++ ) {
- pred_Q16 += delta_Q16;
- x2[ n ] = (SKP_int16)SKP_SAT16( SKP_SMLAWB( x2[ n ], pred_Q16, x1[ n ] ) );
- }
- } else {
- n = 0;
+ /* Interpolate predictors and add prediction to side channel */
+ pred0_Q13 = state->pred_prev_Q13[ 0 ];
+ pred1_Q13 = state->pred_prev_Q13[ 1 ];
+ denom_Q16 = SKP_DIV32_16( 1 << 16, STEREO_INTERP_LEN_MS * fs_kHz );
+ delta0_Q13 = SKP_RSHIFT_ROUND( SKP_SMULBB( pred_Q13[ 0 ] - state->pred_prev_Q13[ 0 ], denom_Q16 ), 16 );
+ delta1_Q13 = SKP_RSHIFT_ROUND( SKP_SMULBB( pred_Q13[ 1 ] - state->pred_prev_Q13[ 1 ], denom_Q16 ), 16 );
+ for( n = 0; n < STEREO_INTERP_LEN_MS * fs_kHz; n++ ) {
+ pred0_Q13 += delta0_Q13;
+ pred1_Q13 += delta1_Q13;
+ sum = SKP_LSHIFT( SKP_ADD_LSHIFT( mid[ n ] + mid[ n + 2 ], mid[ n + 1 ], 1 ), 9 ); /* Q11 */
+ sum = SKP_SMLAWB( SKP_LSHIFT( ( SKP_int32 )side[ n + 1 ], 8 ), sum, pred0_Q13 ); /* Q8 */
+ sum = SKP_SMLAWB( sum, SKP_LSHIFT( ( SKP_int32 )mid[ n + 1 ], 11 ), pred1_Q13 ); /* Q8 */
+ side[ n + 1 ] = (SKP_int16)SKP_SAT16( SKP_RSHIFT_ROUND( sum, 8 ) );
}
- pred_Q16 = predictor_Q16;
- for( ; n < frame_length; n++ ) {
- x2[ n ] = (SKP_int16)SKP_SAT16( SKP_SMLAWB( x2[ n ], pred_Q16, x1[ n ] ) );
+ pred0_Q13 = pred_Q13[ 0 ];
+ pred1_Q13 = pred_Q13[ 1 ];
+ for( n = STEREO_INTERP_LEN_MS * fs_kHz; n < frame_length; n++ ) {
+ sum = SKP_LSHIFT( SKP_ADD_LSHIFT( mid[ n ] + mid[ n + 2 ], mid[ n + 1 ], 1 ), 9 ); /* Q11 */
+ sum = SKP_SMLAWB( SKP_LSHIFT( ( SKP_int32 )side[ n + 1 ], 8 ), sum, pred0_Q13 ); /* Q8 */
+ sum = SKP_SMLAWB( sum, SKP_LSHIFT( ( SKP_int32 )mid[ n + 1 ], 11 ), pred1_Q13 ); /* Q8 */
+ side[ n + 1 ] = (SKP_int16)SKP_SAT16( SKP_RSHIFT_ROUND( sum, 8 ) );
}
+ state->pred_prev_Q13[ 0 ] = pred_Q13[ 0 ];
+ state->pred_prev_Q13[ 1 ] = pred_Q13[ 1 ];
- state->predictor_prev_Q16 = predictor_Q16;
-
/* Convert to left/right signals */
for( n = 0; n < frame_length; n++ ) {
- sum = x1[ n ] + (SKP_int32)x2[ n ];
- diff = x1[ n ] - (SKP_int32)x2[ n ];
+ sum = mid[ n + 1 ] + (SKP_int32)side[ n + 1 ];
+ diff = mid[ n + 1 ] - (SKP_int32)side[ n + 1 ];
x1[ n ] = (SKP_int16)SKP_SAT16( sum );
x2[ n ] = (SKP_int16)SKP_SAT16( diff );
}
--- /dev/null
+++ b/silk/SKP_Silk_stereo_decode_pred.c
@@ -1,0 +1,59 @@
+/***********************************************************************
+Copyright (c) 2006-2011, Skype Limited. All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, (subject to the limitations in the disclaimer below)
+are permitted provided that the following conditions are met:
+- Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+- Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+- Neither the name of Skype Limited, nor the names of specific
+contributors, may be used to endorse or promote products derived from
+this software without specific prior written permission.
+NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED
+BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
+BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+***********************************************************************/
+
+#include "SKP_Silk_main.h"
+
+/* Decode mid/side predictors */
+void SKP_Silk_stereo_decode_pred(
+ ec_dec *psRangeDec, /* I/O Compressor data structure */
+ SKP_int32 pred_Q13[] /* O Predictors */
+)
+{
+ SKP_int n, ibest[ 2 ] = { 0 }, jbest[ 2 ] = { 0 }, kbest[ 2 ];
+ SKP_int32 low_Q13, step_Q13;
+
+ /* Entropy decoding */
+ n = ec_dec_icdf( psRangeDec, SKP_Silk_stereo_pred_joint_iCDF, 8 );
+ kbest[ 0 ] = SKP_DIV32_16( n, 5 );
+ kbest[ 1 ] = n - 5 * kbest[ 0 ];
+ for( n = 0; n < 2; n++ ) {
+ ibest[ n ] = ec_dec_icdf( psRangeDec, SKP_Silk_uniform3_iCDF, 8 );
+ ibest[ n ] += 3 * kbest[ n ];
+ jbest[ n ] = ec_dec_icdf( psRangeDec, SKP_Silk_uniform5_iCDF, 8 );
+ }
+
+ /* Dequantize */
+ for( n = 0; n < 2; n++ ) {
+ low_Q13 = SKP_Silk_stereo_pred_quant_Q13[ ibest[ n ] ];
+ step_Q13 = SKP_SMULWB( SKP_Silk_stereo_pred_quant_Q13[ ibest[ n ] + 1 ] - low_Q13,
+ SKP_FIX_CONST( 0.5 / STEREO_QUANT_SUB_STEPS, 16 ) );
+ pred_Q13[ n ] = SKP_SMLABB( low_Q13, step_Q13, 2 * jbest[ n ] + 1 );
+ }
+
+ /* Subtract second from first predictor (helps when actually applying these) */
+ pred_Q13[ 0 ] -= pred_Q13[ 1 ];
+}
--- /dev/null
+++ b/silk/SKP_Silk_stereo_encode_pred.c
@@ -1,0 +1,80 @@
+/***********************************************************************
+Copyright (c) 2006-2011, Skype Limited. All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, (subject to the limitations in the disclaimer below)
+are permitted provided that the following conditions are met:
+- Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+- Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+- Neither the name of Skype Limited, nor the names of specific
+contributors, may be used to endorse or promote products derived from
+this software without specific prior written permission.
+NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED
+BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
+BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+***********************************************************************/
+
+#include "SKP_Silk_main.h"
+
+/* Quantize mid/side predictors and entropy code the quantization indices */
+void SKP_Silk_stereo_encode_pred(
+ ec_enc *psRangeEnc, /* I/O Compressor data structure */
+ SKP_int32 pred_Q13[] /* I/O Predictors (out: quantized) */
+)
+{
+ SKP_int i, j, n, ibest[ 2 ] = { 0 }, jbest[ 2 ] = { 0 }, kbest[ 2 ];
+ SKP_int32 low_Q13, step_Q13, lvl_Q13, err_min_Q13, err_Q13, quant_pred_Q13 = 0;
+
+ /* Quantize */
+ for( n = 0; n < 2; n++ ) {
+ /* Brute-force search over quantization levels */
+ err_min_Q13 = SKP_int32_MAX;
+ for( i = 0; i < STEREO_QUANT_TAB_SIZE - 1; i++ ) {
+ low_Q13 = SKP_Silk_stereo_pred_quant_Q13[ i ];
+ step_Q13 = SKP_SMULWB( SKP_Silk_stereo_pred_quant_Q13[ i + 1 ] - low_Q13,
+ SKP_FIX_CONST( 0.5 / STEREO_QUANT_SUB_STEPS, 16 ) );
+ for( j = 0; j < STEREO_QUANT_SUB_STEPS; j++ ) {
+ lvl_Q13 = SKP_SMLABB( low_Q13, step_Q13, 2 * j + 1 );
+ err_Q13 = SKP_abs( pred_Q13[ n ] - lvl_Q13 );
+ if( err_Q13 < err_min_Q13 ) {
+ err_min_Q13 = err_Q13;
+ quant_pred_Q13 = lvl_Q13;
+ ibest[ n ] = i;
+ jbest[ n ] = j;
+ } else {
+ /* Error increasing, so we're past the optimum */
+ goto done;
+ }
+ }
+ }
+ done:
+ kbest[ n ] = SKP_DIV32_16( ibest[ n ], 3 );
+ ibest[ n ] -= kbest[ n ] * 3;
+ pred_Q13[ n ] = quant_pred_Q13;
+ }
+
+ /* Subtract second from first predictor (helps when actually applying these) */
+ pred_Q13[ 0 ] -= pred_Q13[ 1 ];
+
+ /* Entropy coding */
+ i = 5 * kbest[ 0 ] + kbest[ 1 ];
+ SKP_assert( i < 25 );
+ ec_enc_icdf( psRangeEnc, i, SKP_Silk_stereo_pred_joint_iCDF, 8 );
+ for( n = 0; n < 2; n++ ) {
+ SKP_assert( ibest[ n ] < 3 );
+ SKP_assert( jbest[ n ] < STEREO_QUANT_SUB_STEPS );
+ ec_enc_icdf( psRangeEnc, ibest[ n ], SKP_Silk_uniform3_iCDF, 8 );
+ ec_enc_icdf( psRangeEnc, jbest[ n ], SKP_Silk_uniform5_iCDF, 8 );
+ }
+}
--- /dev/null
+++ b/silk/SKP_Silk_stereo_find_predictor.c
@@ -1,0 +1,54 @@
+/***********************************************************************
+Copyright (c) 2006-2011, Skype Limited. All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, (subject to the limitations in the disclaimer below)
+are permitted provided that the following conditions are met:
+- Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+- Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+- Neither the name of Skype Limited, nor the names of specific
+contributors, may be used to endorse or promote products derived from
+this software without specific prior written permission.
+NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED
+BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
+BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+***********************************************************************/
+
+#include "SKP_Silk_main.h"
+
+/* Find least-squares prediction gain for one signal based on another and quantize it */
+SKP_int32 SKP_Silk_stereo_find_predictor( /* O Returns predictor in Q13 */
+ const SKP_int16 x[], /* I Basis signal */
+ const SKP_int16 y[], /* I Target signal */
+ SKP_int length /* I Number of samples */
+)
+{
+ SKP_int scale, scale1, scale2;
+ SKP_int32 nrg1, nrg2, corr, pred_Q13;
+
+ /* Find predictor */
+ SKP_Silk_sum_sqr_shift( &nrg1, &scale1, x, length );
+ SKP_Silk_sum_sqr_shift( &nrg2, &scale2, y, length );
+ if( scale1 > scale2 ) {
+ scale = scale1;
+ } else {
+ scale = scale2;
+ nrg1 = SKP_RSHIFT32( nrg1, scale2 - scale1 );
+ }
+ corr = SKP_Silk_inner_prod_aligned_scale( x, y, scale, length );
+ pred_Q13 = SKP_DIV32_varQ( corr, SKP_max( nrg1, 1 ), 13 );
+ pred_Q13 = SKP_LIMIT( pred_Q13, -SKP_FIX_CONST( 10, 13 ), SKP_FIX_CONST( 10, 13 ) );
+
+ return pred_Q13;
+}
--- a/silk/SKP_Silk_structs.h
+++ b/silk/SKP_Silk_structs.h
@@ -28,9 +28,9 @@
#ifndef SKP_SILK_STRUCTS_H
#define SKP_SILK_STRUCTS_H
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#include "SKP_Silk_typedef.h"
#include "SKP_Silk_SigProc_FIX.h"
@@ -99,7 +99,9 @@
} SKP_Silk_NLSF_CB_struct;
typedef struct {
- SKP_int32 predictor_prev_Q16;
+ SKP_int32 pred_prev_Q13[ 2 ];
+ SKP_int16 sMid[ 2 ];
+ SKP_int16 sSide[ 2 ];
} stereo_state;
typedef struct {
@@ -187,6 +189,9 @@
SKP_int nFramesPerPacket;
SKP_int nFramesAnalyzed; /* Number of frames analyzed in current packet */
+ SKP_int nChannels;
+ SKP_int channelNb;
+
/* Parameters For LTP scaling Control */
SKP_int frames_since_onset;
@@ -300,6 +305,7 @@
SKP_int16 LTPCoef_Q14[ LTP_ORDER * MAX_NB_SUBFR ];
SKP_int LTP_scale_Q14;
} SKP_Silk_decoder_control;
+
#ifdef __cplusplus
}
--- a/silk/SKP_Silk_structs_FIX.h
+++ /dev/null
@@ -1,119 +1,0 @@
-/***********************************************************************
-Copyright (c) 2006-2011, Skype Limited. All rights reserved.
-Redistribution and use in source and binary forms, with or without
-modification, (subject to the limitations in the disclaimer below)
-are permitted provided that the following conditions are met:
-- Redistributions of source code must retain the above copyright notice,
-this list of conditions and the following disclaimer.
-- Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
-- Neither the name of Skype Limited, nor the names of specific
-contributors, may be used to endorse or promote products derived from
-this software without specific prior written permission.
-NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED
-BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
-BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-***********************************************************************/
-
-#ifndef SKP_SILK_STRUCTS_FIX_H
-#define SKP_SILK_STRUCTS_FIX_H
-
-#include "SKP_Silk_typedef.h"
-#include "SKP_Silk_main.h"
-#include "SKP_Silk_structs.h"
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-/********************************/
-/* Noise shaping analysis state */
-/********************************/
-typedef struct {
- SKP_int8 LastGainIndex;
- SKP_int32 HarmBoost_smth_Q16;
- SKP_int32 HarmShapeGain_smth_Q16;
- SKP_int32 Tilt_smth_Q16;
-} SKP_Silk_shape_state_FIX;
-
-/********************************/
-/* Prefilter state */
-/********************************/
-typedef struct {
- SKP_int16 sLTP_shp[ LTP_BUF_LENGTH ];
- SKP_int32 sAR_shp[ MAX_SHAPE_LPC_ORDER + 1 ];
- SKP_int sLTP_shp_buf_idx;
- SKP_int32 sLF_AR_shp_Q12;
- SKP_int32 sLF_MA_shp_Q12;
- SKP_int sHarmHP;
- SKP_int32 rand_seed;
- SKP_int lagPrev;
-} SKP_Silk_prefilter_state_FIX;
-
-/********************************/
-/* Encoder state FIX */
-/********************************/
-typedef struct {
- SKP_Silk_encoder_state sCmn; /* Common struct, shared with floating-point code */
- SKP_Silk_shape_state_FIX sShape; /* Shape state */
- SKP_Silk_prefilter_state_FIX sPrefilt; /* Prefilter State */
-
- /* Buffer for find pitch and noise shape analysis */
- SKP_DWORD_ALIGN SKP_int16 x_buf[ 2 * MAX_FRAME_LENGTH + LA_SHAPE_MAX ];
- SKP_int LTPCorr_Q15; /* Normalized correlation from pitch lag estimator */
-
- /* Parameters For LTP scaling Control */
- SKP_int prevLTPredCodGain_Q7;
- SKP_int HPLTPredCodGain_Q7;
-} SKP_Silk_encoder_state_FIX;
-
-/************************/
-/* Encoder control FIX */
-/************************/
-typedef struct {
- /* Prediction and coding parameters */
- SKP_int32 Gains_Q16[ MAX_NB_SUBFR ];
- SKP_DWORD_ALIGN SKP_int16 PredCoef_Q12[ 2 ][ MAX_LPC_ORDER ];
- SKP_int16 LTPCoef_Q14[ LTP_ORDER * MAX_NB_SUBFR ];
- SKP_int LTP_scale_Q14;
- SKP_int pitchL[ MAX_NB_SUBFR ];
-
- /* Noise shaping parameters */
- /* Testing */
- SKP_DWORD_ALIGN SKP_int16 AR1_Q13[ MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER ];
- SKP_DWORD_ALIGN SKP_int16 AR2_Q13[ MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER ];
- SKP_int32 LF_shp_Q14[ MAX_NB_SUBFR ]; /* Packs two int16 coefficients per int32 value */
- SKP_int GainsPre_Q14[ MAX_NB_SUBFR ];
- SKP_int HarmBoost_Q14[ MAX_NB_SUBFR ];
- SKP_int Tilt_Q14[ MAX_NB_SUBFR ];
- SKP_int HarmShapeGain_Q14[ MAX_NB_SUBFR ];
- SKP_int Lambda_Q10;
- SKP_int input_quality_Q14;
- SKP_int coding_quality_Q14;
-
- /* measures */
- SKP_int sparseness_Q8;
- SKP_int32 predGain_Q16;
- SKP_int LTPredCodGain_Q7;
- SKP_int32 ResNrg[ MAX_NB_SUBFR ]; /* Residual energy per subframe */
- SKP_int ResNrgQ[ MAX_NB_SUBFR ]; /* Q domain for the residual energy > 0 */
-
-} SKP_Silk_encoder_control_FIX;
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
--- a/silk/SKP_Silk_structs_FLP.h
+++ /dev/null
@@ -1,116 +1,0 @@
-/***********************************************************************
-Copyright (c) 2006-2011, Skype Limited. All rights reserved.
-Redistribution and use in source and binary forms, with or without
-modification, (subject to the limitations in the disclaimer below)
-are permitted provided that the following conditions are met:
-- Redistributions of source code must retain the above copyright notice,
-this list of conditions and the following disclaimer.
-- Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
-- Neither the name of Skype Limited, nor the names of specific
-contributors, may be used to endorse or promote products derived from
-this software without specific prior written permission.
-NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED
-BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
-BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-***********************************************************************/
-
-#ifndef SKP_SILK_STRUCTS_FLP_H
-#define SKP_SILK_STRUCTS_FLP_H
-
-#include "SKP_Silk_typedef.h"
-#include "SKP_Silk_main.h"
-#include "SKP_Silk_structs.h"
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-/********************************/
-/* Noise shaping analysis state */
-/********************************/
-typedef struct {
- SKP_int8 LastGainIndex;
- SKP_float HarmBoost_smth;
- SKP_float HarmShapeGain_smth;
- SKP_float Tilt_smth;
-} SKP_Silk_shape_state_FLP;
-
-/********************************/
-/* Prefilter state */
-/********************************/
-typedef struct {
- SKP_float sLTP_shp[ LTP_BUF_LENGTH ];
- SKP_float sAR_shp[ MAX_SHAPE_LPC_ORDER + 1 ];
- SKP_int sLTP_shp_buf_idx;
- SKP_float sLF_AR_shp;
- SKP_float sLF_MA_shp;
- SKP_float sHarmHP;
- SKP_int32 rand_seed;
- SKP_int lagPrev;
-} SKP_Silk_prefilter_state_FLP;
-
-/********************************/
-/* Encoder state FLP */
-/********************************/
-typedef struct {
- SKP_Silk_encoder_state sCmn; /* Common struct, shared with fixed-point code */
- SKP_Silk_shape_state_FLP sShape; /* Noise shaping state */
- SKP_Silk_prefilter_state_FLP sPrefilt; /* Prefilter State */
-
- /* Buffer for find pitch and noise shape analysis */
- SKP_float x_buf[ 2 * MAX_FRAME_LENGTH + LA_SHAPE_MAX ];/* Buffer for find pitch and noise shape analysis */
- SKP_float LTPCorr; /* Normalized correlation from pitch lag estimator */
-
- /* Parameters for LTP scaling control */
- SKP_float prevLTPredCodGain;
- SKP_float HPLTPredCodGain;
-} SKP_Silk_encoder_state_FLP;
-
-/************************/
-/* Encoder control FLP */
-/************************/
-typedef struct {
- /* Prediction and coding parameters */
- SKP_float Gains[MAX_NB_SUBFR];
- SKP_float PredCoef[ 2 ][ MAX_LPC_ORDER ]; /* holds interpolated and final coefficients */
- SKP_float LTPCoef[LTP_ORDER * MAX_NB_SUBFR];
- SKP_float LTP_scale;
- SKP_int pitchL[ MAX_NB_SUBFR ];
-
- /* Noise shaping parameters */
- SKP_float AR1[ MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER ];
- SKP_float AR2[ MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER ];
- SKP_float LF_MA_shp[ MAX_NB_SUBFR ];
- SKP_float LF_AR_shp[ MAX_NB_SUBFR ];
- SKP_float GainsPre[ MAX_NB_SUBFR ];
- SKP_float HarmBoost[ MAX_NB_SUBFR ];
- SKP_float Tilt[ MAX_NB_SUBFR ];
- SKP_float HarmShapeGain[ MAX_NB_SUBFR ];
- SKP_float Lambda;
- SKP_float input_quality;
- SKP_float coding_quality;
-
- /* Measures */
- SKP_float sparseness;
- SKP_float predGain;
- SKP_float LTPredCodGain;
- SKP_float ResNrg[ MAX_NB_SUBFR ]; /* Residual energy per subframe */
-} SKP_Silk_encoder_control_FLP;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
--- a/silk/SKP_Silk_tables.h
+++ b/silk/SKP_Silk_tables.h
@@ -44,8 +44,8 @@
extern const SKP_uint8 SKP_Silk_pitch_delta_iCDF[ 21 ]; /* 21 */
extern const SKP_uint8 SKP_Silk_pitch_contour_iCDF[ 34 ]; /* 34 */
extern const SKP_uint8 SKP_Silk_pitch_contour_NB_iCDF[ 11 ]; /* 11 */
-extern const SKP_uint8 SKP_Silk_pitch_contour_10_ms_iCDF[ 12 ]; /* 12 */
-extern const SKP_uint8 SKP_Silk_pitch_contour_10_ms_NB_iCDF[ 3 ]; /* 3 */
+extern const SKP_uint8 SKP_Silk_pitch_contour_10_ms_iCDF[ 12 ]; /* 12 */
+extern const SKP_uint8 SKP_Silk_pitch_contour_10_ms_NB_iCDF[ 3 ]; /* 3 */
extern const SKP_uint8 SKP_Silk_pulses_per_block_iCDF[ N_RATE_LEVELS ][ MAX_PULSES + 2 ]; /* 180 */
extern const SKP_uint8 SKP_Silk_pulses_per_block_BITS_Q5[ N_RATE_LEVELS - 1 ][ MAX_PULSES + 2 ]; /* 162 */
@@ -65,12 +65,14 @@
extern const SKP_uint8 SKP_Silk_sign_iCDF[ 36 ]; /* 36 */
-extern const SKP_uint8 SKP_Silk_uniform2_iCDF[ 2 ]; /* 2 */
-extern const SKP_uint8 SKP_Silk_uniform4_iCDF[ 4 ]; /* 4 */
-extern const SKP_uint8 SKP_Silk_uniform6_iCDF[ 6 ]; /* 6 */
-extern const SKP_uint8 SKP_Silk_uniform8_iCDF[ 8 ]; /* 8 */
+extern const SKP_uint8 SKP_Silk_uniform2_iCDF[ 2 ]; /* 2 */
+extern const SKP_uint8 SKP_Silk_uniform3_iCDF[ 3 ]; /* 3 */
+extern const SKP_uint8 SKP_Silk_uniform4_iCDF[ 4 ]; /* 4 */
+extern const SKP_uint8 SKP_Silk_uniform5_iCDF[ 5 ]; /* 5 */
+extern const SKP_uint8 SKP_Silk_uniform6_iCDF[ 6 ]; /* 6 */
+extern const SKP_uint8 SKP_Silk_uniform8_iCDF[ 8 ]; /* 8 */
-extern const SKP_uint8 SKP_Silk_NLSF_EXT_iCDF[ 7 ]; /* 7 */
+extern const SKP_uint8 SKP_Silk_NLSF_EXT_iCDF[ 7 ]; /* 7 */
extern const SKP_uint8 SKP_Silk_LTP_per_index_iCDF[ 3 ]; /* 3 */
extern const SKP_uint8 * const SKP_Silk_LTP_gain_iCDF_ptrs[ NB_LTP_CBKS ]; /* 3 */
@@ -82,10 +84,11 @@
extern const SKP_uint8 SKP_Silk_LTPscale_iCDF[ 3 ]; /* 4 */
extern const SKP_int16 SKP_Silk_LTPScales_table_Q14[ 3 ];
-extern const SKP_uint8 SKP_Silk_type_offset_VAD_iCDF[ 4 ]; /* 4 */
-extern const SKP_uint8 SKP_Silk_type_offset_no_VAD_iCDF[ 2 ]; /* 2 */
+extern const SKP_uint8 SKP_Silk_type_offset_VAD_iCDF[ 4 ]; /* 4 */
+extern const SKP_uint8 SKP_Silk_type_offset_no_VAD_iCDF[ 2 ]; /* 2 */
-extern const SKP_uint8 SKP_Silk_stereo_predictor_iCDF[ STEREO_QUANT_STEPS + 1 ];
+extern const SKP_int16 SKP_Silk_stereo_pred_quant_Q13[ STEREO_QUANT_TAB_SIZE ]; /* 32 */
+extern const SKP_uint8 SKP_Silk_stereo_pred_joint_iCDF[ 25 ]; /* 25 */
extern const SKP_uint8 * const SKP_Silk_LBRR_flags_iCDF_ptr[ 2 ]; /* 10 */
@@ -104,8 +107,8 @@
extern const SKP_int16 SKP_Silk_Quantization_Offsets_Q10[ 2 ][ 2 ];
/* Interpolation points for filter coefficients used in the bandwidth transition smoother */
-extern const SKP_int32 SKP_Silk_Transition_LP_B_Q28[ TRANSITION_INT_NUM ][ TRANSITION_NB ];
-extern const SKP_int32 SKP_Silk_Transition_LP_A_Q28[ TRANSITION_INT_NUM ][ TRANSITION_NA ];
+extern const SKP_int32 SKP_Silk_Transition_LP_B_Q28[ TRANSITION_INT_NUM ][ TRANSITION_NB ];
+extern const SKP_int32 SKP_Silk_Transition_LP_A_Q28[ TRANSITION_INT_NUM ][ TRANSITION_NA ];
#ifdef __cplusplus
}
--- a/silk/SKP_Silk_tables_other.c
+++ b/silk/SKP_Silk_tables_other.c
@@ -48,9 +48,18 @@
19, 29, 35, 39, 44, 50, 60, 80
};
-/* Table for stereo predictor coding */
-/* p = [2.^(-7:-1), 1, fliplr(2.^(-7:-1))]+2e-2; p = p/sum(p); fprintf('%d, ', round(256 - 256 * cumsum(p(1:end-1)))) */
-const SKP_uint8 SKP_Silk_stereo_predictor_iCDF[ STEREO_QUANT_STEPS + 1 ] = { 254, 251, 247, 241, 229, 208, 168, 88, 48, 27, 15, 9, 5, 2 };
+/* Tables for stereo predictor coding */
+const SKP_int16 SKP_Silk_stereo_pred_quant_Q13[ STEREO_QUANT_TAB_SIZE ] = {
+ -13732, -10050, -8266, -7526, -6500, -5000, -2950, -820,
+ 820, 2950, 5000, 6500, 7526, 8266, 10050, 13732
+};
+const SKP_uint8 SKP_Silk_stereo_pred_joint_iCDF[ 25 ] = {
+ 249, 247, 246, 245, 244,
+ 234, 210, 202, 201, 200,
+ 197, 174, 82, 59, 56,
+ 55, 54, 46, 22, 12,
+ 11, 10, 9, 7, 0
+};
/* Tables for LBRR flags */
const SKP_uint8 SKP_Silk_LBRR_flags_2_iCDF[ 3 ] = { 203, 150, 0 };
@@ -87,7 +96,9 @@
/* Uniform entropy tables */
const SKP_uint8 SKP_Silk_uniform2_iCDF[ 2 ] = { 128, 0 };
+const SKP_uint8 SKP_Silk_uniform3_iCDF[ 3 ] = { 171, 85, 0 };
const SKP_uint8 SKP_Silk_uniform4_iCDF[ 4 ] = { 192, 128, 64, 0 };
+const SKP_uint8 SKP_Silk_uniform5_iCDF[ 5 ] = { 205, 154, 102, 51, 0 };
const SKP_uint8 SKP_Silk_uniform6_iCDF[ 6 ] = { 213, 171, 128, 85, 43, 0 };
const SKP_uint8 SKP_Silk_uniform8_iCDF[ 8 ] = { 224, 192, 160, 128, 96, 64, 32, 0 };
--- a/silk/fixed/SKP_Silk_encode_frame_FIX.c
+++ b/silk/fixed/SKP_Silk_encode_frame_FIX.c
@@ -108,13 +108,6 @@
SKP_Silk_noise_shape_analysis_FIX( psEnc, &sEncCtrl, res_pitch_frame, x_frame );
TOC(NOISE_SHAPE_ANALYSIS)
- /*****************************************/
- /* Prefiltering for noise shaper */
- /*****************************************/
-TIC(PREFILTER)
- SKP_Silk_prefilter_FIX( psEnc, &sEncCtrl, xfw, x_frame );
-TOC(PREFILTER)
-
/***************************************************/
/* Find linear prediction coefficients (LPC + LTP) */
/***************************************************/
@@ -135,6 +128,13 @@
TIC(LBRR)
SKP_Silk_LBRR_encode_FIX( psEnc, &sEncCtrl, xfw );
TOC(LBRR)
+
+ /*****************************************/
+ /* Prefiltering for noise shaper */
+ /*****************************************/
+TIC(PREFILTER)
+ SKP_Silk_prefilter_FIX( psEnc, &sEncCtrl, xfw, x_frame );
+TOC(PREFILTER)
/*****************************************/
/* Noise shaping quantization */
--- a/silk/fixed/SKP_Silk_find_pred_coefs_FIX.c
+++ b/silk/fixed/SKP_Silk_find_pred_coefs_FIX.c
@@ -85,8 +85,8 @@
SKP_Silk_LTP_scale_ctrl_FIX( psEnc, psEncCtrl );
/* Create LTP residual */
- SKP_Silk_LTP_analysis_filter_FIX( LPC_in_pre, psEnc->x_buf + psEnc->sCmn.ltp_mem_length - psEnc->sCmn.predictLPCOrder,
- psEncCtrl->LTPCoef_Q14, psEncCtrl->pitchL, invGains_Q16, psEnc->sCmn.subfr_length, psEnc->sCmn.nb_subfr, psEnc->sCmn.predictLPCOrder );
+ SKP_Silk_LTP_analysis_filter_FIX( LPC_in_pre, x - psEnc->sCmn.predictLPCOrder, psEncCtrl->LTPCoef_Q14,
+ psEncCtrl->pitchL, invGains_Q16, psEnc->sCmn.subfr_length, psEnc->sCmn.nb_subfr, psEnc->sCmn.predictLPCOrder );
} else {
/************/
--- /dev/null
+++ b/silk/fixed/SKP_Silk_main_FIX.h
@@ -1,0 +1,245 @@
+/***********************************************************************
+Copyright (c) 2006-2011, Skype Limited. All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, (subject to the limitations in the disclaimer below)
+are permitted provided that the following conditions are met:
+- Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+- Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+- Neither the name of Skype Limited, nor the names of specific
+contributors, may be used to endorse or promote products derived from
+this software without specific prior written permission.
+NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED
+BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
+BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+***********************************************************************/
+
+#ifndef SKP_SILK_MAIN_FIX_H
+#define SKP_SILK_MAIN_FIX_H
+
+#include "SKP_Silk_SigProc_FIX.h"
+#include "SKP_Silk_structs_FIX.h"
+#include "SKP_Silk_control.h"
+#include "SKP_Silk_main.h"
+#include "SKP_Silk_PLC.h"
+#include "SKP_debug.h"
+#include "entenc.h"
+
+#ifndef FORCE_CPP_BUILD
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+#endif
+
+/*********************/
+/* Encoder Functions */
+/*********************/
+
+/* Encoder main function */
+SKP_int SKP_Silk_encode_frame_FIX(
+ SKP_Silk_encoder_state_FIX *psEnc, /* I/O Pointer to Silk FIX encoder state */
+ SKP_int32 *pnBytesOut, /* O Pointer to number of payload bytes; */
+ ec_enc *psRangeEnc /* I/O compressor data structure */
+);
+
+/* Low Bitrate Redundancy (LBRR) encoding. Reuse all parameters but encode with lower bitrate */
+void SKP_Silk_LBRR_encode_FIX(
+ SKP_Silk_encoder_state_FIX *psEnc, /* I/O Pointer to Silk FIX encoder state */
+ SKP_Silk_encoder_control_FIX *psEncCtrl, /* I/O Pointer to Silk FIX encoder control struct */
+ const SKP_int16 xfw[] /* I Input signal */
+);
+
+/* Initializes the Silk encoder state */
+SKP_int SKP_Silk_init_encoder(
+ SKP_Silk_encoder_state_FIX *psEnc /* I/O Pointer to Silk FIX encoder state */
+);
+
+/* Control the Silk encoder */
+SKP_int SKP_Silk_control_encoder(
+ SKP_Silk_encoder_state_FIX *psEnc, /* I/O Pointer to Silk encoder state */
+ SKP_SILK_SDK_EncControlStruct *encControl, /* I: Control structure */
+ const SKP_int32 TargetRate_bps, /* I Target max bitrate (bps) */
+ const SKP_int allow_bw_switch, /* I Flag to allow switching audio bandwidth */
+ const SKP_int channelNb /* I Channel number */
+);
+
+/****************/
+/* Prefiltering */
+/****************/
+void SKP_Silk_prefilter_FIX(
+ SKP_Silk_encoder_state_FIX *psEnc, /* I/O Encoder state */
+ const SKP_Silk_encoder_control_FIX *psEncCtrl, /* I Encoder control */
+ SKP_int16 xw[], /* O Weighted signal */
+ const SKP_int16 x[] /* I Speech signal */
+);
+
+/**************************/
+/* Noise shaping analysis */
+/**************************/
+/* Compute noise shaping coefficients and initial gain values */
+void SKP_Silk_noise_shape_analysis_FIX(
+ SKP_Silk_encoder_state_FIX *psEnc, /* I/O Encoder state FIX */
+ SKP_Silk_encoder_control_FIX *psEncCtrl, /* I/O Encoder control FIX */
+ const SKP_int16 *pitch_res, /* I LPC residual from pitch analysis */
+ const SKP_int16 *x /* I Input signal [ frame_length + la_shape ] */
+);
+
+/* Autocorrelations for a warped frequency axis */
+void SKP_Silk_warped_autocorrelation_FIX(
+ SKP_int32 *corr, /* O Result [order + 1] */
+ SKP_int *scale, /* O Scaling of the correlation vector */
+ const SKP_int16 *input, /* I Input data to correlate */
+ const SKP_int warping_Q16, /* I Warping coefficient */
+ const SKP_int length, /* I Length of input */
+ const SKP_int order /* I Correlation order (even) */
+);
+
+/* Calculation of LTP state scaling */
+void SKP_Silk_LTP_scale_ctrl_FIX(
+ SKP_Silk_encoder_state_FIX *psEnc, /* I/O encoder state */
+ SKP_Silk_encoder_control_FIX *psEncCtrl /* I/O encoder control */
+);
+
+/**********************************************/
+/* Prediction Analysis */
+/**********************************************/
+/* Find pitch lags */
+void SKP_Silk_find_pitch_lags_FIX(
+ SKP_Silk_encoder_state_FIX *psEnc, /* I/O encoder state */
+ SKP_Silk_encoder_control_FIX *psEncCtrl, /* I/O encoder control */
+ SKP_int16 res[], /* O residual */
+ const SKP_int16 x[] /* I Speech signal */
+);
+
+/* Find LPC and LTP coefficients */
+void SKP_Silk_find_pred_coefs_FIX(
+ SKP_Silk_encoder_state_FIX *psEnc, /* I/O encoder state */
+ SKP_Silk_encoder_control_FIX *psEncCtrl, /* I/O encoder control */
+ const SKP_int16 res_pitch[], /* I Residual from pitch analysis */
+ const SKP_int16 x[] /* I Speech signal */
+);
+
+/* LPC analysis */
+void SKP_Silk_find_LPC_FIX(
+ SKP_int16 NLSF_Q15[], /* O NLSFs */
+ SKP_int8 *interpIndex, /* O NLSF interpolation index, only used for NLSF interpolation */
+ const SKP_int16 prev_NLSFq_Q15[], /* I previous NLSFs, only used for NLSF interpolation */
+ const SKP_int useInterpNLSFs, /* I Flag */
+ const SKP_int firstFrameAfterReset, /* I Flag */
+ const SKP_int LPC_order, /* I LPC order */
+ const SKP_int16 x[], /* I Input signal */
+ const SKP_int subfr_length, /* I Input signal subframe length including preceeding samples */
+ const SKP_int nb_subfr /* I: Number of subframes */
+);
+
+/* LTP analysis */
+void SKP_Silk_find_LTP_FIX(
+ SKP_int16 b_Q14[ MAX_NB_SUBFR * LTP_ORDER ], /* O LTP coefs */
+ SKP_int32 WLTP[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /* O Weight for LTP quantization */
+ SKP_int *LTPredCodGain_Q7, /* O LTP coding gain */
+ const SKP_int16 r_lpc[], /* I residual signal after LPC signal + state for first 10 ms */
+ const SKP_int lag[ MAX_NB_SUBFR ], /* I LTP lags */
+ const SKP_int32 Wght_Q15[ MAX_NB_SUBFR ], /* I weights */
+ const SKP_int subfr_length, /* I subframe length */
+ const SKP_int nb_subfr, /* I number of subframes */
+ const SKP_int mem_offset, /* I number of samples in LTP memory */
+ SKP_int corr_rshifts[ MAX_NB_SUBFR ] /* O right shifts applied to correlations */
+);
+
+void SKP_Silk_LTP_analysis_filter_FIX(
+ SKP_int16 *LTP_res, /* O: LTP residual signal of length MAX_NB_SUBFR * ( pre_length + subfr_length ) */
+ const SKP_int16 *x, /* I: Pointer to input signal with at least max( pitchL ) preceeding samples */
+ const SKP_int16 LTPCoef_Q14[ LTP_ORDER * MAX_NB_SUBFR ],/* I: LTP_ORDER LTP coefficients for each MAX_NB_SUBFR subframe */
+ const SKP_int pitchL[ MAX_NB_SUBFR ], /* I: Pitch lag, one for each subframe */
+ const SKP_int32 invGains_Q16[ MAX_NB_SUBFR ], /* I: Inverse quantization gains, one for each subframe */
+ const SKP_int subfr_length, /* I: Length of each subframe */
+ const SKP_int nb_subfr, /* I: Number of subframes */
+ const SKP_int pre_length /* I: Length of the preceeding samples starting at &x[0] for each subframe */
+);
+
+/* Calculates residual energies of input subframes where all subframes have LPC_order */
+/* of preceeding samples */
+void SKP_Silk_residual_energy_FIX(
+ SKP_int32 nrgs[ MAX_NB_SUBFR ], /* O Residual energy per subframe */
+ SKP_int nrgsQ[ MAX_NB_SUBFR ], /* O Q value per subframe */
+ const SKP_int16 x[], /* I Input signal */
+ const SKP_int16 a_Q12[ 2 ][ MAX_LPC_ORDER ], /* I AR coefs for each frame half */
+ const SKP_int32 gains[ MAX_NB_SUBFR ], /* I Quantization gains */
+ const SKP_int subfr_length, /* I Subframe length */
+ const SKP_int nb_subfr, /* I Number of subframes */
+ const SKP_int LPC_order /* I LPC order */
+);
+
+/* Residual energy: nrg = wxx - 2 * wXx * c + c' * wXX * c */
+SKP_int32 SKP_Silk_residual_energy16_covar_FIX(
+ const SKP_int16 *c, /* I Prediction vector */
+ const SKP_int32 *wXX, /* I Correlation matrix */
+ const SKP_int32 *wXx, /* I Correlation vector */
+ SKP_int32 wxx, /* I Signal energy */
+ SKP_int D, /* I Dimension */
+ SKP_int cQ /* I Q value for c vector 0 - 15 */
+);
+
+/* Processing of gains */
+void SKP_Silk_process_gains_FIX(
+ SKP_Silk_encoder_state_FIX *psEnc, /* I/O Encoder state */
+ SKP_Silk_encoder_control_FIX *psEncCtrl /* I/O Encoder control */
+);
+
+/******************/
+/* Linear Algebra */
+/******************/
+/* Calculates correlation matrix X'*X */
+void SKP_Silk_corrMatrix_FIX(
+ const SKP_int16 *x, /* I x vector [L + order - 1] used to form data matrix X */
+ const SKP_int L, /* I Length of vectors */
+ const SKP_int order, /* I Max lag for correlation */
+ const SKP_int head_room, /* I Desired headroom */
+ SKP_int32 *XX, /* O Pointer to X'*X correlation matrix [ order x order ]*/
+ SKP_int *rshifts /* I/O Right shifts of correlations */
+);
+
+/* Calculates correlation vector X'*t */
+void SKP_Silk_corrVector_FIX(
+ const SKP_int16 *x, /* I x vector [L + order - 1] used to form data matrix X */
+ const SKP_int16 *t, /* I Target vector [L] */
+ const SKP_int L, /* I Length of vectors */
+ const SKP_int order, /* I Max lag for correlation */
+ SKP_int32 *Xt, /* O Pointer to X'*t correlation vector [order] */
+ const SKP_int rshifts /* I Right shifts of correlations */
+);
+
+/* Add noise to matrix diagonal */
+void SKP_Silk_regularize_correlations_FIX(
+ SKP_int32 *XX, /* I/O Correlation matrices */
+ SKP_int32 *xx, /* I/O Correlation values */
+ SKP_int32 noise, /* I Noise to add */
+ SKP_int D /* I Dimension of XX */
+);
+
+/* Solves Ax = b, assuming A is symmetric */
+void SKP_Silk_solve_LDL_FIX(
+ SKP_int32 *A, /* I Pointer to symetric square matrix A */
+ SKP_int M, /* I Size of matrix */
+ const SKP_int32 *b, /* I Pointer to b vector */
+ SKP_int32 *x_Q16 /* O Pointer to x solution vector */
+);
+
+#ifndef FORCE_CPP_BUILD
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+#endif /* FORCE_CPP_BUILD */
+#endif /* SKP_SILK_MAIN_FIX_H */
--- /dev/null
+++ b/silk/fixed/SKP_Silk_structs_FIX.h
@@ -1,0 +1,119 @@
+/***********************************************************************
+Copyright (c) 2006-2011, Skype Limited. All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, (subject to the limitations in the disclaimer below)
+are permitted provided that the following conditions are met:
+- Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+- Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+- Neither the name of Skype Limited, nor the names of specific
+contributors, may be used to endorse or promote products derived from
+this software without specific prior written permission.
+NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED
+BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
+BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+***********************************************************************/
+
+#ifndef SKP_SILK_STRUCTS_FIX_H
+#define SKP_SILK_STRUCTS_FIX_H
+
+#include "SKP_Silk_typedef.h"
+#include "SKP_Silk_main.h"
+#include "SKP_Silk_structs.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/********************************/
+/* Noise shaping analysis state */
+/********************************/
+typedef struct {
+ SKP_int8 LastGainIndex;
+ SKP_int32 HarmBoost_smth_Q16;
+ SKP_int32 HarmShapeGain_smth_Q16;
+ SKP_int32 Tilt_smth_Q16;
+} SKP_Silk_shape_state_FIX;
+
+/********************************/
+/* Prefilter state */
+/********************************/
+typedef struct {
+ SKP_int16 sLTP_shp[ LTP_BUF_LENGTH ];
+ SKP_int32 sAR_shp[ MAX_SHAPE_LPC_ORDER + 1 ];
+ SKP_int sLTP_shp_buf_idx;
+ SKP_int32 sLF_AR_shp_Q12;
+ SKP_int32 sLF_MA_shp_Q12;
+ SKP_int sHarmHP;
+ SKP_int32 rand_seed;
+ SKP_int lagPrev;
+} SKP_Silk_prefilter_state_FIX;
+
+/********************************/
+/* Encoder state FIX */
+/********************************/
+typedef struct {
+ SKP_Silk_encoder_state sCmn; /* Common struct, shared with floating-point code */
+ SKP_Silk_shape_state_FIX sShape; /* Shape state */
+ SKP_Silk_prefilter_state_FIX sPrefilt; /* Prefilter State */
+
+ /* Buffer for find pitch and noise shape analysis */
+ SKP_DWORD_ALIGN SKP_int16 x_buf[ 2 * MAX_FRAME_LENGTH + LA_SHAPE_MAX ];
+ SKP_int LTPCorr_Q15; /* Normalized correlation from pitch lag estimator */
+
+ /* Parameters For LTP scaling Control */
+ SKP_int prevLTPredCodGain_Q7;
+ SKP_int HPLTPredCodGain_Q7;
+} SKP_Silk_encoder_state_FIX;
+
+/************************/
+/* Encoder control FIX */
+/************************/
+typedef struct {
+ /* Prediction and coding parameters */
+ SKP_int32 Gains_Q16[ MAX_NB_SUBFR ];
+ SKP_DWORD_ALIGN SKP_int16 PredCoef_Q12[ 2 ][ MAX_LPC_ORDER ];
+ SKP_int16 LTPCoef_Q14[ LTP_ORDER * MAX_NB_SUBFR ];
+ SKP_int LTP_scale_Q14;
+ SKP_int pitchL[ MAX_NB_SUBFR ];
+
+ /* Noise shaping parameters */
+ /* Testing */
+ SKP_DWORD_ALIGN SKP_int16 AR1_Q13[ MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER ];
+ SKP_DWORD_ALIGN SKP_int16 AR2_Q13[ MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER ];
+ SKP_int32 LF_shp_Q14[ MAX_NB_SUBFR ]; /* Packs two int16 coefficients per int32 value */
+ SKP_int GainsPre_Q14[ MAX_NB_SUBFR ];
+ SKP_int HarmBoost_Q14[ MAX_NB_SUBFR ];
+ SKP_int Tilt_Q14[ MAX_NB_SUBFR ];
+ SKP_int HarmShapeGain_Q14[ MAX_NB_SUBFR ];
+ SKP_int Lambda_Q10;
+ SKP_int input_quality_Q14;
+ SKP_int coding_quality_Q14;
+
+ /* measures */
+ SKP_int sparseness_Q8;
+ SKP_int32 predGain_Q16;
+ SKP_int LTPredCodGain_Q7;
+ SKP_int32 ResNrg[ MAX_NB_SUBFR ]; /* Residual energy per subframe */
+ SKP_int ResNrgQ[ MAX_NB_SUBFR ]; /* Q domain for the residual energy > 0 */
+
+} SKP_Silk_encoder_control_FIX;
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null
+++ b/silk/fixed/silk_fixed.vcxproj
@@ -1,0 +1,113 @@
+<?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>{8484C90D-1561-402F-A91D-2DB10F8C5171}</ProjectGuid>
+ <Keyword>Win32Proj</Keyword>
+ <RootNamespace>src_FIX</RootNamespace>
+ <ProjectName>silk_fixed</ProjectName>
+ </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 Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetName>$(ProjectName)</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <TargetName>$(ProjectName)</TargetName>
+ </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;../../libcelt</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ <Lib>
+ <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+ </Lib>
+ </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;../../libcelt</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ <Lib>
+ <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+ </Lib>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <None Include="ReadMe.txt" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="SKP_Silk_corrMatrix_FIX.c" />
+ <ClCompile Include="SKP_Silk_encode_frame_FIX.c" />
+ <ClCompile Include="SKP_Silk_find_LPC_FIX.c" />
+ <ClCompile Include="SKP_Silk_find_LTP_FIX.c" />
+ <ClCompile Include="SKP_Silk_find_pitch_lags_FIX.c" />
+ <ClCompile Include="SKP_Silk_find_pred_coefs_FIX.c" />
+ <ClCompile Include="SKP_Silk_LTP_analysis_filter_FIX.c" />
+ <ClCompile Include="SKP_Silk_LTP_scale_ctrl_FIX.c" />
+ <ClCompile Include="SKP_Silk_noise_shape_analysis_FIX.c" />
+ <ClCompile Include="SKP_Silk_prefilter_FIX.c" />
+ <ClCompile Include="SKP_Silk_process_gains_FIX.c" />
+ <ClCompile Include="SKP_Silk_regularize_correlations_FIX.c" />
+ <ClCompile Include="SKP_Silk_residual_energy16_FIX.c" />
+ <ClCompile Include="SKP_Silk_residual_energy_FIX.c" />
+ <ClCompile Include="SKP_Silk_solve_LS_FIX.c" />
+ <ClCompile Include="SKP_Silk_warped_autocorrelation_FIX.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="SKP_Silk_main_FIX.h" />
+ <ClInclude Include="SKP_Silk_structs_FIX.h" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file
--- /dev/null
+++ b/silk/fixed/silk_fixed.vcxproj.filters
@@ -1,0 +1,78 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="ReadMe.txt" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="SKP_Silk_LTP_scale_ctrl_FIX.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_noise_shape_analysis_FIX.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_prefilter_FIX.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_process_gains_FIX.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_regularize_correlations_FIX.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_residual_energy_FIX.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_residual_energy16_FIX.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_solve_LS_FIX.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_warped_autocorrelation_FIX.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_corrMatrix_FIX.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_encode_frame_FIX.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_find_LPC_FIX.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_find_LTP_FIX.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_find_pitch_lags_FIX.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_find_pred_coefs_FIX.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_LTP_analysis_filter_FIX.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="SKP_Silk_main_FIX.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="SKP_Silk_structs_FIX.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file
--- a/silk/float/SKP_Silk_LPC_analysis_filter_FLP.c
+++ b/silk/float/SKP_Silk_LPC_analysis_filter_FLP.c
@@ -233,6 +233,13 @@
}
}
+/*******************************************/
+/* LPC analysis filter */
+/* NB! State is kept internally and the */
+/* filter always starts with zero state */
+/* first Order output samples are not set */
+/*******************************************/
+
void SKP_Silk_LPC_analysis_filter_FLP(
SKP_float r_LPC[], /* O LPC residual signal */
const SKP_float PredCoef[], /* I LPC coefficients */
@@ -272,8 +279,5 @@
SKP_assert( 0 );
break;
}
-
- /* Set first LPC Order samples to zero instead of undefined */
- SKP_memset( r_LPC, 0, Order * sizeof( SKP_float ) );
}
--- /dev/null
+++ b/silk/float/SKP_Silk_LPC_inv_pred_gain_FLP.c
@@ -1,0 +1,81 @@
+/***********************************************************************
+Copyright (c) 2006-2011, Skype Limited. All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, (subject to the limitations in the disclaimer below)
+are permitted provided that the following conditions are met:
+- Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+- Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+- Neither the name of Skype Limited, nor the names of specific
+contributors, may be used to endorse or promote products derived from
+this software without specific prior written permission.
+NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED
+BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
+BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+***********************************************************************/
+
+/* *
+ * SKP_Silk_LPC_inverse_pred_gain.c *
+ * *
+ * compute inverse of LPC prediction gain, and *
+ * test if LPC coefficients are stable (all poles within unit circle) *
+ * *
+ * Copyright 2008 (c), Skype Limited *
+ * */
+#include "SKP_Silk_SigProc_FIX.h"
+#include "SKP_Silk_SigProc_FLP.h"
+
+#define RC_THRESHOLD 0.9999f
+
+/* compute inverse of LPC prediction gain, and */
+/* test if LPC coefficients are stable (all poles within unit circle) */
+/* this code is based on SKP_Silk_a2k_FLP() */
+SKP_int SKP_Silk_LPC_inverse_pred_gain_FLP( /* O: returns 1 if unstable, otherwise 0 */
+ SKP_float *invGain, /* O: inverse prediction gain, energy domain */
+ const SKP_float *A, /* I: prediction coefficients [order] */
+ SKP_int32 order /* I: prediction order */
+)
+{
+ SKP_int k, n;
+ double rc, rc_mult1, rc_mult2;
+ SKP_float Atmp[ 2 ][ SKP_Silk_MAX_ORDER_LPC ];
+ SKP_float *Aold, *Anew;
+
+ Anew = Atmp[ order & 1 ];
+ SKP_memcpy( Anew, A, order * sizeof(SKP_float) );
+
+ *invGain = 1.0f;
+ for( k = order - 1; k > 0; k-- ) {
+ rc = -Anew[ k ];
+ if (rc > RC_THRESHOLD || rc < -RC_THRESHOLD) {
+ return 1;
+ }
+ rc_mult1 = 1.0f - rc * rc;
+ rc_mult2 = 1.0f / rc_mult1;
+ *invGain *= (SKP_float)rc_mult1;
+ /* swap pointers */
+ Aold = Anew;
+ Anew = Atmp[ k & 1 ];
+ for( n = 0; n < k; n++ ) {
+ Anew[ n ] = (SKP_float)( ( Aold[ n ] - Aold[ k - n - 1 ] * rc ) * rc_mult2 );
+ }
+ }
+ rc = -Anew[ 0 ];
+ if ( rc > RC_THRESHOLD || rc < -RC_THRESHOLD ) {
+ return 1;
+ }
+ rc_mult1 = 1.0f - rc * rc;
+ *invGain *= (SKP_float)rc_mult1;
+ return 0;
+}
--- /dev/null
+++ b/silk/float/SKP_Silk_SigProc_FLP.h
@@ -1,0 +1,215 @@
+/***********************************************************************
+Copyright (c) 2006-2011, Skype Limited. All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, (subject to the limitations in the disclaimer below)
+are permitted provided that the following conditions are met:
+- Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+- Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+- Neither the name of Skype Limited, nor the names of specific
+contributors, may be used to endorse or promote products derived from
+this software without specific prior written permission.
+NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED
+BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
+BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+***********************************************************************/
+
+
+#ifndef _SKP_SILK_SIGPROC_FLP_H_
+#define _SKP_SILK_SIGPROC_FLP_H_
+
+#include "SKP_Silk_SigProc_FIX.h"
+#include "float_cast.h"
+#include <math.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/********************************************************************/
+/* SIGNAL PROCESSING FUNCTIONS */
+/********************************************************************/
+
+/* Chirp (bw expand) LP AR filter */
+void SKP_Silk_bwexpander_FLP(
+ SKP_float *ar, /* io AR filter to be expanded (without leading 1) */
+ const SKP_int d, /* i length of ar */
+ const SKP_float chirp /* i chirp factor (typically in range (0..1) ) */
+);
+
+/* compute inverse of LPC prediction gain, and */
+/* test if LPC coefficients are stable (all poles within unit circle) */
+/* this code is based on SKP_Silk_FLP_a2k() */
+SKP_int SKP_Silk_LPC_inverse_pred_gain_FLP( /* O: returns 1 if unstable, otherwise 0 */
+ SKP_float *invGain, /* O: inverse prediction gain, energy domain */
+ const SKP_float *A, /* I: prediction coefficients [order] */
+ SKP_int32 order /* I: prediction order */
+);
+
+SKP_float SKP_Silk_schur_FLP( /* O returns residual energy */
+ SKP_float refl_coef[], /* O reflection coefficients (length order) */
+ const SKP_float auto_corr[], /* I autocorrelation sequence (length order+1) */
+ SKP_int order /* I order */
+);
+
+void SKP_Silk_k2a_FLP(
+ SKP_float *A, /* O: prediction coefficients [order] */
+ const SKP_float *rc, /* I: reflection coefficients [order] */
+ SKP_int32 order /* I: prediction order */
+);
+
+/* Solve the normal equations using the Levinson-Durbin recursion */
+SKP_float SKP_Silk_levinsondurbin_FLP( /* O prediction error energy */
+ SKP_float A[], /* O prediction coefficients [order] */
+ const SKP_float corr[], /* I input auto-correlations [order + 1] */
+ const SKP_int order /* I prediction order */
+);
+
+/* compute autocorrelation */
+void SKP_Silk_autocorrelation_FLP(
+ SKP_float *results, /* o result (length correlationCount) */
+ const SKP_float *inputData, /* i input data to correlate */
+ SKP_int inputDataSize, /* i length of input */
+ SKP_int correlationCount /* i number of correlation taps to compute */
+);
+
+/* Pitch estimator */
+#define SigProc_PE_MIN_COMPLEX 0
+#define SigProc_PE_MID_COMPLEX 1
+#define SigProc_PE_MAX_COMPLEX 2
+
+SKP_int SKP_Silk_pitch_analysis_core_FLP( /* O voicing estimate: 0 voiced, 1 unvoiced */
+ const SKP_float *signal, /* I signal of length PE_FRAME_LENGTH_MS*Fs_kHz */
+ SKP_int *pitch_out, /* O 4 pitch lag values */
+ SKP_int16 *lagIndex, /* O lag Index */
+ SKP_int8 *contourIndex, /* O pitch contour Index */
+ SKP_float *LTPCorr, /* I/O normalized correlation; input: value from previous frame */
+ SKP_int prevLag, /* I last lag of previous frame; set to zero is unvoiced */
+ const SKP_float search_thres1, /* I first stage threshold for lag candidates 0 - 1 */
+ const SKP_float search_thres2, /* I final threshold for lag candidates 0 - 1 */
+ const SKP_int Fs_kHz, /* I sample frequency (kHz) */
+ const SKP_int complexity, /* I Complexity setting, 0-2, where 2 is highest */
+ const SKP_int nb_subfr /* I number of 5 ms subframes */
+);
+
+#define PI (3.1415926536f)
+
+void SKP_Silk_insertion_sort_decreasing_FLP(
+ SKP_float *a, /* I/O: Unsorted / Sorted vector */
+ SKP_int *index, /* O: Index vector for the sorted elements */
+ const SKP_int L, /* I: Vector length */
+ const SKP_int K /* I: Number of correctly sorted positions */
+);
+
+/* Compute reflection coefficients from input signal */
+SKP_float SKP_Silk_burg_modified_FLP( /* O returns residual energy */
+ SKP_float A[], /* O prediction coefficients (length order) */
+ const SKP_float x[], /* I input signal, length: nb_subfr*(D+L_sub) */
+ const SKP_int subfr_length, /* I input signal subframe length (including D preceeding samples) */
+ const SKP_int nb_subfr, /* I number of subframes stacked in x */
+ const SKP_float WhiteNoiseFrac, /* I fraction added to zero-lag autocorrelation */
+ const SKP_int D /* I order */
+);
+
+/* multiply a vector by a constant */
+void SKP_Silk_scale_vector_FLP(
+ SKP_float *data1,
+ SKP_float gain,
+ SKP_int dataSize
+);
+
+/* copy and multiply a vector by a constant */
+void SKP_Silk_scale_copy_vector_FLP(
+ SKP_float *data_out,
+ const SKP_float *data_in,
+ SKP_float gain,
+ SKP_int dataSize
+);
+
+/* inner product of two SKP_float arrays, with result as double */
+double SKP_Silk_inner_product_FLP(
+ const SKP_float *data1,
+ const SKP_float *data2,
+ SKP_int dataSize
+);
+
+/* sum of squares of a SKP_float array, with result as double */
+double SKP_Silk_energy_FLP(
+ const SKP_float *data,
+ SKP_int dataSize
+);
+
+/********************************************************************/
+/* MACROS */
+/********************************************************************/
+
+#define SKP_min_float(a, b) (((a) < (b)) ? (a) : (b))
+#define SKP_max_float(a, b) (((a) > (b)) ? (a) : (b))
+#define SKP_abs_float(a) ((SKP_float)fabs(a))
+
+#define SKP_LIMIT_float( a, limit1, limit2) ((limit1) > (limit2) ? ((a) > (limit1) ? (limit1) : ((a) < (limit2) ? (limit2) : (a))) \
+ : ((a) > (limit2) ? (limit2) : ((a) < (limit1) ? (limit1) : (a))))
+
+/* sigmoid function */
+SKP_INLINE SKP_float SKP_sigmoid(SKP_float x)
+{
+ return (SKP_float)(1.0 / (1.0 + exp(-x)));
+}
+
+/* floating-point to integer conversion (rounding) */
+#if 1
+/* use implementation in float_cast.h */
+#define SKP_float2int(x) float2int(x)
+#else
+SKP_INLINE SKP_int32 SKP_float2int(SKP_float x)
+{
+ double y = x;
+ return (SKP_int32)( ( y > 0 ) ? y + 0.5 : y - 0.5 );
+}
+#endif
+
+/* floating-point to integer conversion (rounding) */
+SKP_INLINE void SKP_float2short_array(
+ SKP_int16 *out,
+ const SKP_float *in,
+ SKP_int32 length
+)
+{
+ SKP_int32 k;
+ for (k = length-1; k >= 0; k--) {
+ out[k] = (SKP_int16)SKP_SAT16( float2int( in[k] ) );
+ }
+}
+
+/* integer to floating-point conversion */
+SKP_INLINE void SKP_short2float_array(
+ SKP_float *out,
+ const SKP_int16 *in,
+ SKP_int32 length
+)
+{
+ SKP_int32 k;
+ for (k = length-1; k >= 0; k--) {
+ out[k] = (SKP_float)in[k];
+ }
+}
+
+#define SKP_round(x) (SKP_float)((x)>=0 ? (SKP_int64)((x)+0.5) : (SKP_int64)((x)-0.5))
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null
+++ b/silk/float/SKP_Silk_autocorrelation_FLP.c
@@ -1,0 +1,48 @@
+/***********************************************************************
+Copyright (c) 2006-2011, Skype Limited. All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, (subject to the limitations in the disclaimer below)
+are permitted provided that the following conditions are met:
+- Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+- Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+- Neither the name of Skype Limited, nor the names of specific
+contributors, may be used to endorse or promote products derived from
+this software without specific prior written permission.
+NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED
+BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
+BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+***********************************************************************/
+
+#include "SKP_Silk_typedef.h"
+#include "SKP_Silk_SigProc_FLP.h"
+
+/* compute autocorrelation */
+void SKP_Silk_autocorrelation_FLP(
+ SKP_float *results, /* O result (length correlationCount) */
+ const SKP_float *inputData, /* I input data to correlate */
+ SKP_int inputDataSize, /* I length of input */
+ SKP_int correlationCount /* I number of correlation taps to compute */
+)
+{
+ SKP_int i;
+
+ if ( correlationCount > inputDataSize ) {
+ correlationCount = inputDataSize;
+ }
+
+ for( i = 0; i < correlationCount; i++ ) {
+ results[ i ] = (SKP_float)SKP_Silk_inner_product_FLP( inputData, inputData + i, inputDataSize - i );
+ }
+}
--- /dev/null
+++ b/silk/float/SKP_Silk_burg_modified_FLP.c
@@ -1,0 +1,154 @@
+/***********************************************************************
+Copyright (c) 2006-2011, Skype Limited. All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, (subject to the limitations in the disclaimer below)
+are permitted provided that the following conditions are met:
+- Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+- Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+- Neither the name of Skype Limited, nor the names of specific
+contributors, may be used to endorse or promote products derived from
+this software without specific prior written permission.
+NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED
+BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
+BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+***********************************************************************/
+
+/* *
+ * SKP_Silk_burg_modified.c *
+ * *
+ * Calculates the reflection coefficients from the input vector *
+ * Input vector contains nb_subfr sub vectors of length L_sub + D *
+ * *
+ * Copyright 2009 (c), Skype Limited *
+ * Date: 091130 *
+ */
+
+#include "SKP_Silk_SigProc_FLP.h"
+
+#define MAX_FRAME_SIZE 384 // subfr_length * nb_subfr = ( 0.005 * 16000 + 16 ) * 4 = 384
+#define MAX_NB_SUBFR 4
+
+/* Compute reflection coefficients from input signal */
+SKP_float SKP_Silk_burg_modified_FLP( /* O returns residual energy */
+ SKP_float A[], /* O prediction coefficients (length order) */
+ const SKP_float x[], /* I input signal, length: nb_subfr*(D+L_sub) */
+ const SKP_int subfr_length, /* I input signal subframe length (including D preceeding samples) */
+ const SKP_int nb_subfr, /* I number of subframes stacked in x */
+ const SKP_float WhiteNoiseFrac, /* I fraction added to zero-lag autocorrelation */
+ const SKP_int D /* I order */
+)
+{
+ SKP_int k, n, s;
+ double C0, num, nrg_f, nrg_b, rc, Atmp, tmp1, tmp2;
+ const SKP_float *x_ptr;
+ double C_first_row[ SKP_Silk_MAX_ORDER_LPC ], C_last_row[ SKP_Silk_MAX_ORDER_LPC ];
+ double CAf[ SKP_Silk_MAX_ORDER_LPC + 1 ], CAb[ SKP_Silk_MAX_ORDER_LPC + 1 ];
+ double Af[ SKP_Silk_MAX_ORDER_LPC ];
+
+ SKP_assert( subfr_length * nb_subfr <= MAX_FRAME_SIZE );
+ SKP_assert( nb_subfr <= MAX_NB_SUBFR );
+
+ /* Compute autocorrelations, added over subframes */
+ C0 = SKP_Silk_energy_FLP( x, nb_subfr * subfr_length );
+ SKP_memset( C_first_row, 0, SKP_Silk_MAX_ORDER_LPC * sizeof( double ) );
+ for( s = 0; s < nb_subfr; s++ ) {
+ x_ptr = x + s * subfr_length;
+ for( n = 1; n < D + 1; n++ ) {
+ C_first_row[ n - 1 ] += SKP_Silk_inner_product_FLP( x_ptr, x_ptr + n, subfr_length - n );
+ }
+ }
+ SKP_memcpy( C_last_row, C_first_row, SKP_Silk_MAX_ORDER_LPC * sizeof( double ) );
+
+ /* Initialize */
+ CAb[ 0 ] = CAf[ 0 ] = C0 + WhiteNoiseFrac * C0 + 1e-9f;
+
+ for( n = 0; n < D; n++ ) {
+ /* Update first row of correlation matrix (without first element) */
+ /* Update last row of correlation matrix (without last element, stored in reversed order) */
+ /* Update C * Af */
+ /* Update C * flipud(Af) (stored in reversed order) */
+ for( s = 0; s < nb_subfr; s++ ) {
+ x_ptr = x + s * subfr_length;
+ tmp1 = x_ptr[ n ];
+ tmp2 = x_ptr[ subfr_length - n - 1 ];
+ for( k = 0; k < n; k++ ) {
+ C_first_row[ k ] -= x_ptr[ n ] * x_ptr[ n - k - 1 ];
+ C_last_row[ k ] -= x_ptr[ subfr_length - n - 1 ] * x_ptr[ subfr_length - n + k ];
+ Atmp = Af[ k ];
+ tmp1 += x_ptr[ n - k - 1 ] * Atmp;
+ tmp2 += x_ptr[ subfr_length - n + k ] * Atmp;
+ }
+ for( k = 0; k <= n; k++ ) {
+ CAf[ k ] -= tmp1 * x_ptr[ n - k ];
+ CAb[ k ] -= tmp2 * x_ptr[ subfr_length - n + k - 1 ];
+ }
+ }
+ tmp1 = C_first_row[ n ];
+ tmp2 = C_last_row[ n ];
+ for( k = 0; k < n; k++ ) {
+ Atmp = Af[ k ];
+ tmp1 += C_last_row[ n - k - 1 ] * Atmp;
+ tmp2 += C_first_row[ n - k - 1 ] * Atmp;
+ }
+ CAf[ n + 1 ] = tmp1;
+ CAb[ n + 1 ] = tmp2;
+
+ /* Calculate nominator and denominator for the next order reflection (parcor) coefficient */
+ num = CAb[ n + 1 ];
+ nrg_b = CAb[ 0 ];
+ nrg_f = CAf[ 0 ];
+ for( k = 0; k < n; k++ ) {
+ Atmp = Af[ k ];
+ num += CAb[ n - k ] * Atmp;
+ nrg_b += CAb[ k + 1 ] * Atmp;
+ nrg_f += CAf[ k + 1 ] * Atmp;
+ }
+ SKP_assert( nrg_f > 0.0 );
+ SKP_assert( nrg_b > 0.0 );
+
+ /* Calculate the next order reflection (parcor) coefficient */
+ rc = -2.0 * num / ( nrg_f + nrg_b );
+ SKP_assert( rc > -1.0 && rc < 1.0 );
+
+ /* Update the AR coefficients */
+ for( k = 0; k < (n + 1) >> 1; k++ ) {
+ tmp1 = Af[ k ];
+ tmp2 = Af[ n - k - 1 ];
+ Af[ k ] = tmp1 + rc * tmp2;
+ Af[ n - k - 1 ] = tmp2 + rc * tmp1;
+ }
+ Af[ n ] = rc;
+
+ /* Update C * Af and C * Ab */
+ for( k = 0; k <= n + 1; k++ ) {
+ tmp1 = CAf[ k ];
+ CAf[ k ] += rc * CAb[ n - k + 1 ];
+ CAb[ n - k + 1 ] += rc * tmp1;
+ }
+ }
+
+ /* Return residual energy */
+ nrg_f = CAf[ 0 ];
+ tmp1 = 1.0;
+ for( k = 0; k < D; k++ ) {
+ Atmp = Af[ k ];
+ nrg_f += CAf[ k + 1 ] * Atmp;
+ tmp1 += Atmp * Atmp;
+ A[ k ] = (SKP_float)(-Atmp);
+ }
+ nrg_f -= WhiteNoiseFrac * C0 * tmp1;
+
+ return (SKP_float)nrg_f;
+}
--- /dev/null
+++ b/silk/float/SKP_Silk_bwexpander_FLP.c
@@ -1,0 +1,47 @@
+/***********************************************************************
+Copyright (c) 2006-2011, Skype Limited. All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, (subject to the limitations in the disclaimer below)
+are permitted provided that the following conditions are met:
+- Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+- Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+- Neither the name of Skype Limited, nor the names of specific
+contributors, may be used to endorse or promote products derived from
+this software without specific prior written permission.
+NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED
+BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
+BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+***********************************************************************/
+
+
+#include "SKP_Silk_SigProc_FLP.h"
+
+
+/* Chirp (bw expand) LP AR filter */
+void SKP_Silk_bwexpander_FLP(
+ SKP_float *ar, /* I/O AR filter to be expanded (without leading 1) */
+ const SKP_int d, /* I length of ar */
+ const SKP_float chirp /* I chirp factor (typically in range (0..1) ) */
+)
+{
+ SKP_int i;
+ SKP_float cfac = chirp;
+
+ for( i = 0; i < d - 1; i++ ) {
+ ar[ i ] *= cfac;
+ cfac *= chirp;
+ }
+ ar[ d - 1 ] *= cfac;
+}
--- a/silk/float/SKP_Silk_encode_frame_FLP.c
+++ b/silk/float/SKP_Silk_encode_frame_FLP.c
@@ -119,13 +119,6 @@
SKP_Silk_noise_shape_analysis_FLP( psEnc, &sEncCtrl, res_pitch_frame, x_frame );
TOC(NOISE_SHAPE_ANALYSIS)
- /*****************************************/
- /* Prefiltering for noise shaper */
- /*****************************************/
-TIC(PREFILTER)
- SKP_Silk_prefilter_FLP( psEnc, &sEncCtrl, xfw, x_frame );
-TOC(PREFILTER)
-
/***************************************************/
/* Find linear prediction coefficients (LPC + LTP) */
/***************************************************/
@@ -139,7 +132,7 @@
TIC(PROCESS_GAINS)
SKP_Silk_process_gains_FLP( psEnc, &sEncCtrl );
TOC(PROCESS_GAINS)
-
+
/****************************************/
/* Low Bitrate Redundant Encoding */
/****************************************/
@@ -146,6 +139,13 @@
TIC(LBRR)
SKP_Silk_LBRR_encode_FLP( psEnc, &sEncCtrl, xfw );
TOC(LBRR)
+
+ /*****************************************/
+ /* Prefiltering for noise shaper */
+ /*****************************************/
+TIC(PREFILTER)
+ SKP_Silk_prefilter_FLP( psEnc, &sEncCtrl, xfw, x_frame );
+TOC(PREFILTER)
/*****************************************/
/* Noise shaping quantization */
--- /dev/null
+++ b/silk/float/SKP_Silk_energy_FLP.c
@@ -1,0 +1,56 @@
+/***********************************************************************
+Copyright (c) 2006-2011, Skype Limited. All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, (subject to the limitations in the disclaimer below)
+are permitted provided that the following conditions are met:
+- Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+- Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+- Neither the name of Skype Limited, nor the names of specific
+contributors, may be used to endorse or promote products derived from
+this software without specific prior written permission.
+NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED
+BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
+BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+***********************************************************************/
+
+#include "SKP_Silk_SigProc_FLP.h"
+
+/* sum of squares of a SKP_float array, with result as double */
+double SKP_Silk_energy_FLP(
+ const SKP_float *data,
+ SKP_int dataSize
+)
+{
+ SKP_int i, dataSize4;
+ double result;
+
+ /* 4x unrolled loop */
+ result = 0.0f;
+ dataSize4 = dataSize & 0xFFFC;
+ for( i = 0; i < dataSize4; i += 4 ) {
+ result += data[ i + 0 ] * data[ i + 0 ] +
+ data[ i + 1 ] * data[ i + 1 ] +
+ data[ i + 2 ] * data[ i + 2 ] +
+ data[ i + 3 ] * data[ i + 3 ];
+ }
+
+ /* add any remaining products */
+ for( ; i < dataSize; i++ ) {
+ result += data[ i ] * data[ i ];
+ }
+
+ SKP_assert( result >= 0.0 );
+ return result;
+}
--- a/silk/float/SKP_Silk_find_pred_coefs_FLP.c
+++ b/silk/float/SKP_Silk_find_pred_coefs_FLP.c
@@ -66,14 +66,14 @@
/* Quantize LTP gain parameters */
SKP_Silk_quant_LTP_gains_FLP( psEncCtrl->LTPCoef, psEnc->sCmn.indices.LTPIndex, &psEnc->sCmn.indices.PERIndex,
- WLTP, psEnc->sCmn.mu_LTP_Q9, psEnc->sCmn.LTPQuantLowComplexity , psEnc->sCmn.nb_subfr );
+ WLTP, psEnc->sCmn.mu_LTP_Q9, psEnc->sCmn.LTPQuantLowComplexity, psEnc->sCmn.nb_subfr );
/* Control LTP scaling */
SKP_Silk_LTP_scale_ctrl_FLP( psEnc, psEncCtrl );
/* Create LTP residual */
- SKP_Silk_LTP_analysis_filter_FLP( LPC_in_pre, psEnc->x_buf + psEnc->sCmn.ltp_mem_length - psEnc->sCmn.predictLPCOrder,
- psEncCtrl->LTPCoef, psEncCtrl->pitchL, invGains, psEnc->sCmn.subfr_length, psEnc->sCmn.nb_subfr, psEnc->sCmn.predictLPCOrder );
+ SKP_Silk_LTP_analysis_filter_FLP( LPC_in_pre, x - psEnc->sCmn.predictLPCOrder, psEncCtrl->LTPCoef,
+ psEncCtrl->pitchL, invGains, psEnc->sCmn.subfr_length, psEnc->sCmn.nb_subfr, psEnc->sCmn.predictLPCOrder );
} else {
/************/
@@ -97,7 +97,6 @@
SKP_Silk_find_LPC_FLP( NLSF_Q15, &psEnc->sCmn.indices.NLSFInterpCoef_Q2, psEnc->sCmn.prev_NLSFq_Q15,
psEnc->sCmn.useInterpolatedNLSFs, psEnc->sCmn.first_frame_after_reset, psEnc->sCmn.predictLPCOrder,
LPC_in_pre, psEnc->sCmn.subfr_length + psEnc->sCmn.predictLPCOrder, psEnc->sCmn.nb_subfr );
-
/* Quantize LSFs */
TIC(LSF_quant);
--- /dev/null
+++ b/silk/float/SKP_Silk_inner_product_FLP.c
@@ -1,0 +1,56 @@
+/***********************************************************************
+Copyright (c) 2006-2011, Skype Limited. All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, (subject to the limitations in the disclaimer below)
+are permitted provided that the following conditions are met:
+- Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+- Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+- Neither the name of Skype Limited, nor the names of specific
+contributors, may be used to endorse or promote products derived from
+this software without specific prior written permission.
+NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED
+BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
+BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+***********************************************************************/
+
+#include "SKP_Silk_SigProc_FLP.h"
+
+/* inner product of two SKP_float arrays, with result as double */
+double SKP_Silk_inner_product_FLP( /* O result */
+ const SKP_float *data1, /* I vector 1 */
+ const SKP_float *data2, /* I vector 2 */
+ SKP_int dataSize /* I length of vectors */
+)
+{
+ SKP_int i, dataSize4;
+ double result;
+
+ /* 4x unrolled loop */
+ result = 0.0f;
+ dataSize4 = dataSize & 0xFFFC;
+ for( i = 0; i < dataSize4; i += 4 ) {
+ result += data1[ i + 0 ] * data2[ i + 0 ] +
+ data1[ i + 1 ] * data2[ i + 1 ] +
+ data1[ i + 2 ] * data2[ i + 2 ] +
+ data1[ i + 3 ] * data2[ i + 3 ];
+ }
+
+ /* add any remaining products */
+ for( ; i < dataSize; i++ ) {
+ result += data1[ i ] * data2[ i ];
+ }
+
+ return result;
+}
--- /dev/null
+++ b/silk/float/SKP_Silk_k2a_FLP.c
@@ -1,0 +1,58 @@
+/***********************************************************************
+Copyright (c) 2006-2011, Skype Limited. All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, (subject to the limitations in the disclaimer below)
+are permitted provided that the following conditions are met:
+- Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+- Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+- Neither the name of Skype Limited, nor the names of specific
+contributors, may be used to endorse or promote products derived from
+this software without specific prior written permission.
+NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED
+BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
+BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+***********************************************************************/
+
+/* *
+ * SKP_Silk_k2a.c *
+ * *
+ * step up function, converts reflection coefficients to prediction *
+ * coefficients *
+ * *
+ * Copyright 2008 (c), Skype Limited *
+ * Date: 080103 *
+ * */
+#include "SKP_Silk_SigProc_FLP.h"
+
+/* step up function, converts reflection coefficients to prediction coefficients */
+void SKP_Silk_k2a_FLP(
+ SKP_float *A, /* O: prediction coefficients [order] */
+ const SKP_float *rc, /* I: reflection coefficients [order] */
+ SKP_int32 order /* I: prediction order */
+)
+{
+ SKP_int k, n;
+ SKP_float Atmp[ SKP_Silk_MAX_ORDER_LPC ];
+
+ for( k = 0; k < order; k++ ){
+ for( n = 0; n < k; n++ ){
+ Atmp[ n ] = A[ n ];
+ }
+ for( n = 0; n < k; n++ ) {
+ A[ n ] += Atmp[ k - n - 1 ] * rc[ k ];
+ }
+ A[ k ] = -rc[ k ];
+ }
+}
--- /dev/null
+++ b/silk/float/SKP_Silk_levinsondurbin_FLP.c
@@ -1,0 +1,77 @@
+/***********************************************************************
+Copyright (c) 2006-2011, Skype Limited. All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, (subject to the limitations in the disclaimer below)
+are permitted provided that the following conditions are met:
+- Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+- Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+- Neither the name of Skype Limited, nor the names of specific
+contributors, may be used to endorse or promote products derived from
+this software without specific prior written permission.
+NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED
+BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
+BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+***********************************************************************/
+
+#include "SKP_Silk_SigProc_FLP.h"
+
+/* Solve the normal equations using the Levinson-Durbin recursion */
+SKP_float SKP_Silk_levinsondurbin_FLP( /* O prediction error energy */
+ SKP_float A[], /* O prediction coefficients [order] */
+ const SKP_float corr[], /* I input auto-correlations [order + 1] */
+ const SKP_int order /* I prediction order */
+)
+{
+ SKP_int i, mHalf, m;
+ SKP_float min_nrg, nrg, t, km, Atmp1, Atmp2;
+
+ min_nrg = 1e-12f * corr[ 0 ] + 1e-9f;
+ nrg = corr[ 0 ];
+ nrg = SKP_max_float(min_nrg, nrg);
+ A[ 0 ] = corr[ 1 ] / nrg;
+ nrg -= A[ 0 ] * corr[ 1 ];
+ nrg = SKP_max_float(min_nrg, nrg);
+
+ for( m = 1; m < order; m++ )
+ {
+ t = corr[ m + 1 ];
+ for( i = 0; i < m; i++ ) {
+ t -= A[ i ] * corr[ m - i ];
+ }
+
+ /* reflection coefficient */
+ km = t / nrg;
+
+ /* residual energy */
+ nrg -= km * t;
+ nrg = SKP_max_float(min_nrg, nrg);
+
+ mHalf = m >> 1;
+ for( i = 0; i < mHalf; i++ ) {
+ Atmp1 = A[ i ];
+ Atmp2 = A[ m - i - 1 ];
+ A[ m - i - 1 ] -= km * Atmp1;
+ A[ i ] -= km * Atmp2;
+ }
+ if( m & 1 ) {
+ A[ mHalf ] -= km * A[ mHalf ];
+ }
+ A[ m ] = km;
+ }
+
+ /* return the residual energy */
+ return nrg;
+}
+
--- /dev/null
+++ b/silk/float/SKP_Silk_main_FLP.h
@@ -1,0 +1,320 @@
+/***********************************************************************
+Copyright (c) 2006-2011, Skype Limited. All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, (subject to the limitations in the disclaimer below)
+are permitted provided that the following conditions are met:
+- Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+- Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+- Neither the name of Skype Limited, nor the names of specific
+contributors, may be used to endorse or promote products derived from
+this software without specific prior written permission.
+NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED
+BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
+BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+***********************************************************************/
+
+#ifndef SKP_SILK_MAIN_FLP_H
+#define SKP_SILK_MAIN_FLP_H
+
+#include "SKP_Silk_SigProc_FLP.h"
+#include "SKP_Silk_SigProc_FIX.h"
+#include "SKP_Silk_structs_FLP.h"
+#include "SKP_Silk_main.h"
+#include "SKP_Silk_define.h"
+#include "SKP_debug.h"
+#include "entenc.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/*********************/
+/* Encoder Functions */
+/*********************/
+
+/* Encoder main function */
+SKP_int SKP_Silk_encode_frame_FLP(
+ SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */
+ SKP_int32 *pnBytesOut, /* O Number of payload bytes; */
+ ec_enc *psRangeEnc /* I/O compressor data structure */
+);
+
+/* Low Bitrate Redundancy (LBRR) encoding. Reuse all parameters but encode with lower bitrate */
+void SKP_Silk_LBRR_encode_FLP(
+ SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */
+ SKP_Silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */
+ const SKP_float xfw[] /* I Input signal */
+);
+
+/* Initializes the Silk encoder state */
+SKP_int SKP_Silk_init_encoder(
+ SKP_Silk_encoder_state_FLP *psEnc /* I/O Encoder state FLP */
+);
+
+/* Control the Silk encoder */
+SKP_int SKP_Silk_control_encoder(
+ SKP_Silk_encoder_state_FLP *psEnc, /* I/O Pointer to Silk encoder state FLP */
+ SKP_SILK_SDK_EncControlStruct *encControl, /* I: Control structure */
+ const SKP_int32 TargetRate_bps, /* I Target max bitrate (bps) */
+ const SKP_int allow_bw_switch, /* I Flag to allow switching audio bandwidth */
+ const SKP_int channelNb /* I Channel number */
+);
+
+/****************/
+/* Prefiltering */
+/****************/
+void SKP_Silk_prefilter_FLP(
+ SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */
+ const SKP_Silk_encoder_control_FLP *psEncCtrl, /* I Encoder control FLP */
+ SKP_float xw[], /* O Weighted signal */
+ const SKP_float x[] /* I Speech signal */
+);
+
+/**************************/
+/* Noise shaping analysis */
+/**************************/
+/* Compute noise shaping coefficients and initial gain values */
+void SKP_Silk_noise_shape_analysis_FLP(
+ SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */
+ SKP_Silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */
+ const SKP_float *pitch_res, /* I LPC residual from pitch analysis */
+ const SKP_float *x /* I Input signal [frame_length + la_shape] */
+);
+
+/* Autocorrelations for a warped frequency axis */
+void SKP_Silk_warped_autocorrelation_FLP(
+ SKP_float *corr, /* O Result [order + 1] */
+ const SKP_float *input, /* I Input data to correlate */
+ const SKP_float warping, /* I Warping coefficient */
+ const SKP_int length, /* I Length of input */
+ const SKP_int order /* I Correlation order (even) */
+);
+
+/* Calculation of LTP state scaling */
+void SKP_Silk_LTP_scale_ctrl_FLP(
+ SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */
+ SKP_Silk_encoder_control_FLP *psEncCtrl /* I/O Encoder control FLP */
+);
+
+/**********************************************/
+/* Prediction Analysis */
+/**********************************************/
+/* Find pitch lags */
+void SKP_Silk_find_pitch_lags_FLP(
+ SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */
+ SKP_Silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */
+ SKP_float res[], /* O Residual */
+ const SKP_float x[] /* I Speech signal */
+);
+
+/* Find LPC and LTP coefficients */
+void SKP_Silk_find_pred_coefs_FLP(
+ SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */
+ SKP_Silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */
+ const SKP_float res_pitch[], /* I Residual from pitch analysis */
+ const SKP_float x[] /* I Speech signal */
+);
+
+/* LPC analysis */
+void SKP_Silk_find_LPC_FLP(
+ SKP_int16 NLSF_Q15[], /* O NLSFs */
+ SKP_int8 *interpIndex, /* O NLSF interp. index for NLSF interp. */
+ const SKP_int16 prev_NLSFq_Q15[], /* I Previous NLSFs, for NLSF interpolation */
+ const SKP_int useInterpNLSFs, /* I Flag */
+ const SKP_int firstFrameAfterReset, /* I Flag */
+ const SKP_int LPC_order, /* I LPC order */
+ const SKP_float x[], /* I Input signal */
+ const SKP_int subfr_length, /* I Subframe length incl preceeding samples */
+ const SKP_int nb_subfr /* I: Number of subframes */
+);
+
+/* LTP analysis */
+void SKP_Silk_find_LTP_FLP(
+ SKP_float b[ MAX_NB_SUBFR * LTP_ORDER ], /* O LTP coefs */
+ SKP_float WLTP[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /* O Weight for LTP quantization */
+ SKP_float *LTPredCodGain, /* O LTP coding gain */
+ const SKP_float r_lpc[], /* I LPC residual */
+ const SKP_int lag[ MAX_NB_SUBFR ], /* I LTP lags */
+ const SKP_float Wght[ MAX_NB_SUBFR ], /* I Weights */
+ const SKP_int subfr_length, /* I Subframe length */
+ const SKP_int nb_subfr, /* I number of subframes */
+ const SKP_int mem_offset /* I Number of samples in LTP memory */
+);
+
+void SKP_Silk_LTP_analysis_filter_FLP(
+ SKP_float *LTP_res, /* O LTP res MAX_NB_SUBFR*(pre_lgth+subfr_lngth) */
+ const SKP_float *x, /* I Input signal, with preceeding samples */
+ const SKP_float B[ LTP_ORDER * MAX_NB_SUBFR ], /* I LTP coefficients for each subframe */
+ const SKP_int pitchL[ MAX_NB_SUBFR ], /* I Pitch lags */
+ const SKP_float invGains[ MAX_NB_SUBFR ], /* I Inverse quantization gains */
+ const SKP_int subfr_length, /* I Length of each subframe */
+ const SKP_int nb_subfr, /* I number of subframes */
+ const SKP_int pre_length /* I Preceeding samples for each subframe */
+);
+
+/* Calculates residual energies of input subframes where all subframes have LPC_order */
+/* of preceeding samples */
+void SKP_Silk_residual_energy_FLP(
+ SKP_float nrgs[ MAX_NB_SUBFR ], /* O Residual energy per subframe */
+ const SKP_float x[], /* I Input signal */
+ const SKP_float a[ 2 ][ MAX_LPC_ORDER ],/* I AR coefs for each frame half */
+ const SKP_float gains[], /* I Quantization gains */
+ const SKP_int subfr_length, /* I Subframe length */
+ const SKP_int nb_subfr, /* I number of subframes */
+ const SKP_int LPC_order /* I LPC order */
+);
+
+/* 16th order LPC analysis filter */
+void SKP_Silk_LPC_analysis_filter_FLP(
+ SKP_float r_LPC[], /* O LPC residual signal */
+ const SKP_float PredCoef[], /* I LPC coefficients */
+ const SKP_float s[], /* I Input signal */
+ const SKP_int length, /* I Length of input signal */
+ const SKP_int Order /* I LPC order */
+);
+
+/* LTP tap quantizer */
+void SKP_Silk_quant_LTP_gains_FLP(
+ SKP_float B[ MAX_NB_SUBFR * LTP_ORDER ], /* I/O (Un-)quantized LTP gains */
+ SKP_int8 cbk_index[ MAX_NB_SUBFR ], /* O Codebook index */
+ SKP_int8 *periodicity_index, /* O Periodicity index */
+ const SKP_float W[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /* I Error weights */
+ const SKP_int mu_Q10, /* I Mu value (R/D tradeoff) */
+ const SKP_int lowComplexity, /* I Flag for low complexity */
+ const SKP_int nb_subfr /* I number of subframes */
+);
+
+/******************/
+/* NLSF Quantizer */
+/******************/
+/* Limit, stabilize, and quantize NLSFs */
+void SKP_Silk_process_NLSFs_FLP(
+ SKP_Silk_encoder_state *psEncC, /* I/O Encoder state */
+ SKP_float PredCoef[ 2 ][ MAX_LPC_ORDER ], /* O Prediction coefficients */
+ SKP_int16 NLSF_Q15[ MAX_LPC_ORDER ], /* I/O Normalized LSFs (quant out) (0 - (2^15-1)) */
+ const SKP_int16 prev_NLSF_Q15[ MAX_LPC_ORDER ] /* I Previous Normalized LSFs (0 - (2^15-1)) */
+);
+
+/* Residual energy: nrg = wxx - 2 * wXx * c + c' * wXX * c */
+SKP_float SKP_Silk_residual_energy_covar_FLP( /* O Weighted residual energy */
+ const SKP_float *c, /* I Filter coefficients */
+ SKP_float *wXX, /* I/O Weighted correlation matrix, reg. out */
+ const SKP_float *wXx, /* I Weighted correlation vector */
+ const SKP_float wxx, /* I Weighted correlation value */
+ const SKP_int D /* I Dimension */
+);
+
+/* Entropy constrained MATRIX-weighted VQ, for a single input data vector */
+void SKP_Silk_VQ_WMat_EC_FLP(
+ SKP_int *ind, /* O Index of best codebook vector */
+ SKP_float *rate_dist, /* O Best weighted quant. error + mu * rate */
+ const SKP_float *in, /* I Input vector to be quantized */
+ const SKP_float *W, /* I Weighting matrix */
+ const SKP_int16 *cb, /* I Codebook */
+ const SKP_int16 *cl_Q6, /* I Code length for each codebook vector */
+ const SKP_float mu, /* I Tradeoff between WSSE and rate */
+ const SKP_int L /* I Number of vectors in codebook */
+);
+
+/* Processing of gains */
+void SKP_Silk_process_gains_FLP(
+ SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */
+ SKP_Silk_encoder_control_FLP *psEncCtrl /* I/O Encoder control FLP */
+);
+
+/******************/
+/* Linear Algebra */
+/******************/
+/* Calculates correlation matrix X'*X */
+void SKP_Silk_corrMatrix_FLP(
+ const SKP_float *x, /* I x vector [ L+order-1 ] used to create X */
+ const SKP_int L, /* I Length of vectors */
+ const SKP_int Order, /* I Max lag for correlation */
+ SKP_float *XX /* O X'*X correlation matrix [order x order] */
+);
+
+/* Calculates correlation vector X'*t */
+void SKP_Silk_corrVector_FLP(
+ const SKP_float *x, /* I x vector [L+order-1] used to create X */
+ const SKP_float *t, /* I Target vector [L] */
+ const SKP_int L, /* I Length of vecors */
+ const SKP_int Order, /* I Max lag for correlation */
+ SKP_float *Xt /* O X'*t correlation vector [order] */
+);
+
+/* Add noise to matrix diagonal */
+void SKP_Silk_regularize_correlations_FLP(
+ SKP_float *XX, /* I/O Correlation matrices */
+ SKP_float *xx, /* I/O Correlation values */
+ const SKP_float noise, /* I Noise energy to add */
+ const SKP_int D /* I Dimension of XX */
+);
+
+/* Function to solve linear equation Ax = b, where A is an MxM symmetric matrix */
+void SKP_Silk_solve_LDL_FLP(
+ SKP_float *A, /* I/O Symmetric square matrix, out: reg. */
+ const SKP_int M, /* I Size of matrix */
+ const SKP_float *b, /* I Pointer to b vector */
+ SKP_float *x /* O Pointer to x solution vector */
+);
+
+/* Apply sine window to signal vector. */
+/* Window types: */
+/* 1 -> sine window from 0 to pi/2 */
+/* 2 -> sine window from pi/2 to pi */
+void SKP_Silk_apply_sine_window_FLP(
+ SKP_float px_win[], /* O Pointer to windowed signal */
+ const SKP_float px[], /* I Pointer to input signal */
+ const SKP_int win_type, /* I Selects a window type */
+ const SKP_int length /* I Window length, multiple of 4 */
+);
+
+/* Wrappers. Calls flp / fix code */
+
+/* Convert AR filter coefficients to NLSF parameters */
+void SKP_Silk_A2NLSF_FLP(
+ SKP_int16 *NLSF_Q15, /* O NLSF vector [ LPC_order ] */
+ const SKP_float *pAR, /* I LPC coefficients [ LPC_order ] */
+ const SKP_int LPC_order /* I LPC order */
+);
+
+/* Convert NLSF parameters to AR prediction filter coefficients */
+void SKP_Silk_NLSF2A_stable_FLP(
+ SKP_float *pAR, /* O LPC coefficients [ LPC_order ] */
+ const SKP_int16 *NLSF_Q15, /* I NLSF vector [ LPC_order ] */
+ const SKP_int LPC_order /* I LPC order */
+);
+
+/****************************************/
+/* Floating-point Silk NSQ wrapper */
+/****************************************/
+void SKP_Silk_NSQ_wrapper_FLP(
+ SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder state FLP */
+ SKP_Silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control FLP */
+ SideInfoIndices *psIndices, /* I/O Quantization indices */
+ SKP_Silk_nsq_state *psNSQ, /* I/O Noise Shaping Quantzation state */
+ SKP_int8 pulses[], /* O Quantized pulse signal */
+ const SKP_float x[] /* I Prefiltered input signal */
+);
+
+/* using log2() helps the fixed-point conversion */
+SKP_INLINE SKP_float SKP_Silk_log2( double x ) { return ( SKP_float )( 3.32192809488736 * log10( x ) ); }
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null
+++ b/silk/float/SKP_Silk_pitch_analysis_core_FLP.c
@@ -1,0 +1,635 @@
+/***********************************************************************
+Copyright (c) 2006-2011, Skype Limited. All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, (subject to the limitations in the disclaimer below)
+are permitted provided that the following conditions are met:
+- Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+- Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+- Neither the name of Skype Limited, nor the names of specific
+contributors, may be used to endorse or promote products derived from
+this software without specific prior written permission.
+NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED
+BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
+BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+***********************************************************************/
+
+/*****************************************************************************
+*
+* Pitch analyser function
+*
+******************************************************************************/
+#include "SKP_Silk_SigProc_FLP.h"
+#include "SKP_Silk_SigProc_FIX.h"
+#include "SKP_Silk_pitch_est_defines.h"
+
+#define SCRATCH_SIZE 22
+
+/************************************************************/
+/* Definitions */
+/************************************************************/
+#define eps 1.192092896e-07f
+
+/* using log2() helps the fixed-point conversion */
+SKP_INLINE SKP_float SKP_P_log2(double x) { return (SKP_float)(3.32192809488736 * log10(x)); }
+
+/************************************************************/
+/* Internally used functions */
+/************************************************************/
+static void SKP_P_Ana_calc_corr_st3(
+ SKP_float cross_corr_st3[ PE_MAX_NB_SUBFR ][ PE_NB_CBKS_STAGE3_MAX ][ PE_NB_STAGE3_LAGS ], /* O 3 DIM correlation array */
+ const SKP_float signal[], /* I vector to correlate */
+ SKP_int start_lag, /* I start lag */
+ SKP_int sf_length, /* I sub frame length */
+ SKP_int nb_subfr, /* I number of subframes */
+ SKP_int complexity /* I Complexity setting */
+);
+
+static void SKP_P_Ana_calc_energy_st3(
+ SKP_float energies_st3[ PE_MAX_NB_SUBFR ][ PE_NB_CBKS_STAGE3_MAX ][ PE_NB_STAGE3_LAGS ], /* O 3 DIM correlation array */
+ const SKP_float signal[], /* I vector to correlate */
+ SKP_int start_lag, /* I start lag */
+ SKP_int sf_length, /* I sub frame length */
+ SKP_int nb_subfr, /* I number of subframes */
+ SKP_int complexity /* I Complexity setting */
+);
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+//% CORE PITCH ANALYSIS FUNCTION %
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+SKP_int SKP_Silk_pitch_analysis_core_FLP( /* O voicing estimate: 0 voiced, 1 unvoiced */
+ const SKP_float *signal, /* I signal of length PE_FRAME_LENGTH_MS*Fs_kHz */
+ SKP_int *pitch_out, /* O 4 pitch lag values */
+ SKP_int16 *lagIndex, /* O lag Index */
+ SKP_int8 *contourIndex, /* O pitch contour Index */
+ SKP_float *LTPCorr, /* I/O normalized correlation; input: value from previous frame */
+ SKP_int prevLag, /* I last lag of previous frame; set to zero is unvoiced */
+ const SKP_float search_thres1, /* I first stage threshold for lag candidates 0 - 1 */
+ const SKP_float search_thres2, /* I final threshold for lag candidates 0 - 1 */
+ const SKP_int Fs_kHz, /* I sample frequency (kHz) */
+ const SKP_int complexity, /* I Complexity setting, 0-2, where 2 is highest */
+ const SKP_int nb_subfr /* I number of 5 ms subframes */
+)
+{
+ SKP_int i, k, d, j;
+ SKP_float signal_8kHz[ PE_MAX_FRAME_LENGTH_MS * 8 ];
+ SKP_float signal_4kHz[ PE_MAX_FRAME_LENGTH_MS * 4 ];
+ SKP_int16 signal_8_FIX[ PE_MAX_FRAME_LENGTH_MS * 8 ];
+ SKP_int16 signal_4_FIX[ PE_MAX_FRAME_LENGTH_MS * 4 ];
+ SKP_int32 filt_state[ 6 ];
+ SKP_float threshold, contour_bias;
+ SKP_float C[ PE_MAX_NB_SUBFR][ (PE_MAX_LAG >> 1) + 5 ];
+ SKP_float CC[ PE_NB_CBKS_STAGE2_EXT ];
+ const SKP_float *target_ptr, *basis_ptr;
+ double cross_corr, normalizer, energy, energy_tmp;
+ SKP_int d_srch[ PE_D_SRCH_LENGTH ];
+ SKP_int16 d_comp[ (PE_MAX_LAG >> 1) + 5 ];
+ SKP_int length_d_srch, length_d_comp;
+ SKP_float Cmax, CCmax, CCmax_b, CCmax_new_b, CCmax_new;
+ SKP_int CBimax, CBimax_new, lag, start_lag, end_lag, lag_new;
+ SKP_int cbk_size;
+ SKP_float lag_log2, prevLag_log2, delta_lag_log2_sqr;
+ SKP_float energies_st3[ PE_MAX_NB_SUBFR ][ PE_NB_CBKS_STAGE3_MAX ][ PE_NB_STAGE3_LAGS ];
+ SKP_float cross_corr_st3[ PE_MAX_NB_SUBFR ][ PE_NB_CBKS_STAGE3_MAX ][ PE_NB_STAGE3_LAGS ];
+ SKP_int lag_counter;
+ SKP_int frame_length, frame_length_8kHz, frame_length_4kHz;
+ SKP_int sf_length, sf_length_8kHz, sf_length_4kHz;
+ SKP_int min_lag, min_lag_8kHz, min_lag_4kHz;
+ SKP_int max_lag, max_lag_8kHz, max_lag_4kHz;
+ SKP_int nb_cbk_search;
+ const SKP_int8 *Lag_CB_ptr;
+
+ /* Check for valid sampling frequency */
+ SKP_assert( Fs_kHz == 8 || Fs_kHz == 12 || Fs_kHz == 16 );
+
+ /* Check for valid complexity setting */
+ SKP_assert( complexity >= SigProc_PE_MIN_COMPLEX );
+ SKP_assert( complexity <= SigProc_PE_MAX_COMPLEX );
+
+ SKP_assert( search_thres1 >= 0.0f && search_thres1 <= 1.0f );
+ SKP_assert( search_thres2 >= 0.0f && search_thres2 <= 1.0f );
+
+ /* Setup frame lengths max / min lag for the sampling frequency */
+ frame_length = ( PE_LTP_MEM_LENGTH_MS + nb_subfr * PE_SUBFR_LENGTH_MS ) * Fs_kHz;
+ frame_length_4kHz = ( PE_LTP_MEM_LENGTH_MS + nb_subfr * PE_SUBFR_LENGTH_MS ) * 4;
+ frame_length_8kHz = ( PE_LTP_MEM_LENGTH_MS + nb_subfr * PE_SUBFR_LENGTH_MS ) * 8;
+ sf_length = PE_SUBFR_LENGTH_MS * Fs_kHz;
+ sf_length_4kHz = PE_SUBFR_LENGTH_MS * 4;
+ sf_length_8kHz = PE_SUBFR_LENGTH_MS * 8;
+ min_lag = PE_MIN_LAG_MS * Fs_kHz;
+ min_lag_4kHz = PE_MIN_LAG_MS * 4;
+ min_lag_8kHz = PE_MIN_LAG_MS * 8;
+ max_lag = PE_MAX_LAG_MS * Fs_kHz - 1;
+ max_lag_4kHz = PE_MAX_LAG_MS * 4;
+ max_lag_8kHz = PE_MAX_LAG_MS * 8 - 1;
+
+ SKP_memset(C, 0, sizeof(SKP_float) * nb_subfr * ((PE_MAX_LAG >> 1) + 5));
+
+ /* Resample from input sampled at Fs_kHz to 8 kHz */
+ if( Fs_kHz == 16 ) {
+ /* Resample to 16 -> 8 khz */
+ SKP_int16 signal_16_FIX[ 16 * PE_MAX_FRAME_LENGTH_MS ];
+ SKP_float2short_array( signal_16_FIX, signal, frame_length );
+ SKP_memset( filt_state, 0, 2 * sizeof( SKP_int32 ) );
+ SKP_Silk_resampler_down2( filt_state, signal_8_FIX, signal_16_FIX, frame_length );
+ SKP_short2float_array( signal_8kHz, signal_8_FIX, frame_length_8kHz );
+ } else if( Fs_kHz == 12 ) {
+ /* Resample to 12 -> 8 khz */
+ SKP_int16 signal_12_FIX[ 12 * PE_MAX_FRAME_LENGTH_MS ];
+ SKP_float2short_array( signal_12_FIX, signal, frame_length );
+ SKP_memset( filt_state, 0, 6 * sizeof( SKP_int32 ) );
+ SKP_Silk_resampler_down2_3( filt_state, signal_8_FIX, signal_12_FIX, frame_length );
+ SKP_short2float_array( signal_8kHz, signal_8_FIX, frame_length_8kHz );
+ } else {
+ SKP_assert( Fs_kHz == 8 );
+ SKP_float2short_array( signal_8_FIX, signal, frame_length_8kHz );
+ }
+
+ /* Decimate again to 4 kHz */
+ SKP_memset( filt_state, 0, 2 * sizeof( SKP_int32 ) );
+ SKP_Silk_resampler_down2( filt_state, signal_4_FIX, signal_8_FIX, frame_length_8kHz );
+ SKP_short2float_array( signal_4kHz, signal_4_FIX, frame_length_4kHz );
+
+ /* Low-pass filter */
+ for( i = frame_length_4kHz - 1; i > 0; i-- ) {
+ signal_4kHz[ i ] += signal_4kHz[ i - 1 ];
+ }
+
+ /******************************************************************************
+ * FIRST STAGE, operating in 4 khz
+ ******************************************************************************/
+ target_ptr = &signal_4kHz[ SKP_LSHIFT( sf_length_4kHz, 2 ) ];
+ for( k = 0; k < nb_subfr >> 1; k++ ) {
+ /* Check that we are within range of the array */
+ SKP_assert( target_ptr >= signal_4kHz );
+ SKP_assert( target_ptr + sf_length_8kHz <= signal_4kHz + frame_length_4kHz );
+
+ basis_ptr = target_ptr - min_lag_4kHz;
+
+ /* Check that we are within range of the array */
+ SKP_assert( basis_ptr >= signal_4kHz );
+ SKP_assert( basis_ptr + sf_length_8kHz <= signal_4kHz + frame_length_4kHz );
+
+ /* Calculate first vector products before loop */
+ cross_corr = SKP_Silk_inner_product_FLP( target_ptr, basis_ptr, sf_length_8kHz );
+ normalizer = SKP_Silk_energy_FLP( basis_ptr, sf_length_8kHz ) + sf_length_8kHz * 4000.0f;
+
+ C[ 0 ][ min_lag_4kHz ] += (SKP_float)(cross_corr / sqrt(normalizer));
+
+ /* From now on normalizer is computed recursively */
+ for(d = min_lag_4kHz + 1; d <= max_lag_4kHz; d++) {
+ basis_ptr--;
+
+ /* Check that we are within range of the array */
+ SKP_assert( basis_ptr >= signal_4kHz );
+ SKP_assert( basis_ptr + sf_length_8kHz <= signal_4kHz + frame_length_4kHz );
+
+ cross_corr = SKP_Silk_inner_product_FLP(target_ptr, basis_ptr, sf_length_8kHz);
+
+ /* 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 ];
+ C[ 0 ][ d ] += (SKP_float)(cross_corr / sqrt( normalizer ));
+ }
+ /* Update target pointer */
+ target_ptr += sf_length_8kHz;
+ }
+
+ /* Apply short-lag bias */
+ for( i = max_lag_4kHz; i >= min_lag_4kHz; i-- ) {
+ C[ 0 ][ i ] -= C[ 0 ][ i ] * i / 4096.0f;
+ }
+
+ /* Sort */
+ length_d_srch = 4 + 2 * complexity;
+ SKP_assert( 3 * length_d_srch <= PE_D_SRCH_LENGTH );
+ SKP_Silk_insertion_sort_decreasing_FLP( &C[ 0 ][ min_lag_4kHz ], d_srch, max_lag_4kHz - min_lag_4kHz + 1, length_d_srch );
+
+ /* Escape if correlation is very low already here */
+ Cmax = C[ 0 ][ min_lag_4kHz ];
+ target_ptr = &signal_4kHz[ SKP_SMULBB( sf_length_4kHz, nb_subfr ) ];
+ energy = 1000.0f;
+ for( i = 0; i < SKP_LSHIFT( sf_length_4kHz, 2 ); i++ ) {
+ energy += target_ptr[i] * target_ptr[i];
+ }
+ threshold = Cmax * Cmax;
+ if( energy / 16.0f > threshold ) {
+ SKP_memset( pitch_out, 0, nb_subfr * sizeof( SKP_int ) );
+ *LTPCorr = 0.0f;
+ *lagIndex = 0;
+ *contourIndex = 0;
+ return 1;
+ }
+
+ threshold = search_thres1 * Cmax;
+ for( i = 0; i < length_d_srch; i++ ) {
+ /* Convert to 8 kHz indices for the sorted correlation that exceeds the threshold */
+ if( C[ 0 ][ min_lag_4kHz + i ] > threshold ) {
+ d_srch[ i ] = SKP_LSHIFT( d_srch[ i ] + min_lag_4kHz, 1 );
+ } else {
+ length_d_srch = i;
+ break;
+ }
+ }
+ SKP_assert( length_d_srch > 0 );
+
+ for( i = min_lag_8kHz - 5; i < max_lag_8kHz + 5; i++ ) {
+ d_comp[ i ] = 0;
+ }
+ for( i = 0; i < length_d_srch; i++ ) {
+ d_comp[ d_srch[ i ] ] = 1;
+ }
+
+ /* Convolution */
+ for( i = max_lag_8kHz + 3; i >= min_lag_8kHz; i-- ) {
+ d_comp[ i ] += d_comp[ i - 1 ] + d_comp[ i - 2 ];
+ }
+
+ length_d_srch = 0;
+ for( i = min_lag_8kHz; i < max_lag_8kHz + 1; i++ ) {
+ if( d_comp[ i + 1 ] > 0 ) {
+ d_srch[ length_d_srch ] = i;
+ length_d_srch++;
+ }
+ }
+
+ /* Convolution */
+ for( i = max_lag_8kHz + 3; i >= min_lag_8kHz; i-- ) {
+ d_comp[ i ] += d_comp[ i - 1 ] + d_comp[ i - 2 ] + d_comp[ i - 3 ];
+ }
+
+ length_d_comp = 0;
+ for( i = min_lag_8kHz; i < max_lag_8kHz + 4; i++ ) {
+ if( d_comp[ i ] > 0 ) {
+ d_comp[ length_d_comp ] = i - 2;
+ length_d_comp++;
+ }
+ }
+
+ /**********************************************************************************
+ ** SECOND STAGE, operating at 8 kHz, on lag sections with high correlation
+ *************************************************************************************/
+ /*********************************************************************************
+ * Find energy of each subframe projected onto its history, for a range of delays
+ *********************************************************************************/
+ SKP_memset( C, 0, PE_MAX_NB_SUBFR*((PE_MAX_LAG >> 1) + 5) * sizeof(SKP_float)); // Is this needed?
+
+ if( Fs_kHz == 8 ) {
+ target_ptr = &signal[ PE_LTP_MEM_LENGTH_MS * 8 ];
+ } else {
+ target_ptr = &signal_8kHz[ PE_LTP_MEM_LENGTH_MS * 8 ];
+ }
+ for( k = 0; k < nb_subfr; k++ ) {
+ energy_tmp = SKP_Silk_energy_FLP( target_ptr, sf_length_8kHz );
+ for( j = 0; j < length_d_comp; j++ ) {
+ d = d_comp[ j ];
+ basis_ptr = target_ptr - d;
+ cross_corr = SKP_Silk_inner_product_FLP( basis_ptr, target_ptr, sf_length_8kHz );
+ energy = SKP_Silk_energy_FLP( basis_ptr, sf_length_8kHz );
+ if (cross_corr > 0.0f) {
+ C[ k ][ d ] = (SKP_float)(cross_corr * cross_corr / (energy * energy_tmp + eps));
+ } else {
+ C[ k ][ d ] = 0.0f;
+ }
+ }
+ target_ptr += sf_length_8kHz;
+ }
+
+ /* search over lag range and lags codebook */
+ /* scale factor for lag codebook, as a function of center lag */
+
+ CCmax = 0.0f; /* This value doesn't matter */
+ CCmax_b = -1000.0f;
+
+ CBimax = 0; /* To avoid returning undefined lag values */
+ lag = -1; /* To check if lag with strong enough correlation has been found */
+
+ if( prevLag > 0 ) {
+ if( Fs_kHz == 12 ) {
+ prevLag = SKP_LSHIFT( prevLag, 1 ) / 3;
+ } else if( Fs_kHz == 16 ) {
+ prevLag = SKP_RSHIFT( prevLag, 1 );
+ }
+ prevLag_log2 = SKP_P_log2((SKP_float)prevLag);
+ } else {
+ prevLag_log2 = 0;
+ }
+
+ /* Setup stage 2 codebook based on number of subframes */
+ if( nb_subfr == PE_MAX_NB_SUBFR ) {
+ cbk_size = PE_NB_CBKS_STAGE2_EXT;
+ Lag_CB_ptr = &SKP_Silk_CB_lags_stage2[ 0 ][ 0 ];
+ if( Fs_kHz == 8 && complexity > SigProc_PE_MIN_COMPLEX ) {
+ /* If input is 8 khz use a larger codebook here because it is last stage */
+ nb_cbk_search = PE_NB_CBKS_STAGE2_EXT;
+ } else {
+ nb_cbk_search = PE_NB_CBKS_STAGE2;
+ }
+ } else {
+ cbk_size = PE_NB_CBKS_STAGE2_10MS;
+ Lag_CB_ptr = &SKP_Silk_CB_lags_stage2_10_ms[ 0 ][ 0 ];
+ nb_cbk_search = PE_NB_CBKS_STAGE2_10MS;
+ }
+
+ for( k = 0; k < length_d_srch; k++ ) {
+ d = d_srch[ k ];
+ for( j = 0; j < nb_cbk_search; j++ ) {
+ CC[j] = 0.0f;
+ for( i = 0; i < nb_subfr; i++ ) {
+ /* Try all codebooks */
+ CC[ j ] += C[ i ][ d + matrix_ptr( Lag_CB_ptr, i, j, cbk_size )];
+ }
+ }
+ /* Find best codebook */
+ CCmax_new = -1000.0f;
+ CBimax_new = 0;
+ for( i = 0; i < nb_cbk_search; i++ ) {
+ if( CC[ i ] > CCmax_new ) {
+ CCmax_new = CC[ i ];
+ CBimax_new = i;
+ }
+ }
+ CCmax_new = SKP_max_float(CCmax_new, 0.0f); /* To avoid taking square root of negative number later */
+ CCmax_new_b = CCmax_new;
+
+ /* Bias towards shorter lags */
+ lag_log2 = SKP_P_log2((SKP_float)d);
+ CCmax_new_b -= PE_SHORTLAG_BIAS * nb_subfr * lag_log2;
+
+ /* Bias towards previous lag */
+ if ( prevLag > 0 ) {
+ delta_lag_log2_sqr = lag_log2 - prevLag_log2;
+ delta_lag_log2_sqr *= delta_lag_log2_sqr;
+ CCmax_new_b -= PE_PREVLAG_BIAS * nb_subfr * (*LTPCorr) * delta_lag_log2_sqr / (delta_lag_log2_sqr + 0.5f);
+ }
+
+ if ( CCmax_new_b > CCmax_b && /* Find maximum biased correlation */
+ CCmax_new > nb_subfr * search_thres2 * search_thres2 && /* Correlation needs to be high enough to be voiced */
+ SKP_Silk_CB_lags_stage2[ 0 ][ CBimax_new ] <= min_lag_8kHz /* Lag must be in range */
+ ) {
+ CCmax_b = CCmax_new_b;
+ CCmax = CCmax_new;
+ lag = d;
+ CBimax = CBimax_new;
+ }
+ }
+
+ if( lag == -1 ) {
+ /* No suitable candidate found */
+ SKP_memset( pitch_out, 0, PE_MAX_NB_SUBFR * sizeof(SKP_int) );
+ *LTPCorr = 0.0f;
+ *lagIndex = 0;
+ *contourIndex = 0;
+ return 1;
+ }
+
+ if( Fs_kHz > 8 ) {
+ /* Search in original signal */
+
+ /* Compensate for decimation */
+ SKP_assert( lag == SKP_SAT16( lag ) );
+ if( Fs_kHz == 12 ) {
+ lag = SKP_RSHIFT_ROUND( SKP_SMULBB( lag, 3 ), 1 );
+ } else if( Fs_kHz == 16 ) {
+ lag = SKP_LSHIFT( lag, 1 );
+ } else {
+ lag = SKP_SMULBB( lag, 3 );
+ }
+
+ lag = SKP_LIMIT_int( lag, min_lag, max_lag );
+ start_lag = SKP_max_int( lag - 2, min_lag );
+ end_lag = SKP_min_int( lag + 2, max_lag );
+ lag_new = lag; /* to avoid undefined lag */
+ CBimax = 0; /* to avoid undefined lag */
+ SKP_assert( CCmax >= 0.0f );
+ *LTPCorr = (SKP_float)sqrt( CCmax / nb_subfr ); /* Output normalized correlation */
+
+ CCmax = -1000.0f;
+
+ /* Calculate the correlations and energies needed in stage 3 */
+ SKP_P_Ana_calc_corr_st3( cross_corr_st3, signal, start_lag, sf_length, nb_subfr, complexity );
+ SKP_P_Ana_calc_energy_st3( energies_st3, signal, start_lag, sf_length, nb_subfr, complexity );
+
+ lag_counter = 0;
+ SKP_assert( lag == SKP_SAT16( lag ) );
+ contour_bias = PE_FLATCONTOUR_BIAS / lag;
+
+ /* Setup cbk parameters acording to complexity setting and frame length */
+ if( nb_subfr == PE_MAX_NB_SUBFR ) {
+ nb_cbk_search = (SKP_int)SKP_Silk_nb_cbk_searchs_stage3[ complexity ];
+ cbk_size = PE_NB_CBKS_STAGE3_MAX;
+ Lag_CB_ptr = &SKP_Silk_CB_lags_stage3[ 0 ][ 0 ];
+ } else {
+ nb_cbk_search = PE_NB_CBKS_STAGE3_10MS;
+ cbk_size = PE_NB_CBKS_STAGE3_10MS;
+ Lag_CB_ptr = &SKP_Silk_CB_lags_stage3_10_ms[ 0 ][ 0 ];
+ }
+
+ for( d = start_lag; d <= end_lag; d++ ) {
+ for( j = 0; j < nb_cbk_search; j++ ) {
+ cross_corr = 0.0;
+ energy = eps;
+ for( k = 0; k < nb_subfr; k++ ) {
+ energy += energies_st3[ k ][ j ][ lag_counter ];
+ cross_corr += cross_corr_st3[ k ][ j ][ lag_counter ];
+ }
+ if( cross_corr > 0.0 ) {
+ CCmax_new = (SKP_float)(cross_corr * cross_corr / energy);
+ /* Reduce depending on flatness of contour */
+ CCmax_new *= 1.0f - contour_bias * j;
+ } else {
+ CCmax_new = 0.0f;
+ }
+
+ if( CCmax_new > CCmax &&
+ ( d + (SKP_int)SKP_Silk_CB_lags_stage3[ 0 ][ j ] ) <= max_lag
+ ) {
+ CCmax = CCmax_new;
+ lag_new = d;
+ CBimax = j;
+ }
+ }
+ lag_counter++;
+ }
+
+ for( k = 0; k < nb_subfr; k++ ) {
+ pitch_out[ k ] = lag_new + matrix_ptr( Lag_CB_ptr, k, CBimax, cbk_size );
+ }
+ *lagIndex = (SKP_int16)( lag_new - min_lag );
+ *contourIndex = (SKP_int8)CBimax;
+ } else {
+ /* Save Lags and correlation */
+ SKP_assert( CCmax >= 0.0f );
+ *LTPCorr = (SKP_float)sqrt( CCmax / nb_subfr ); /* Output normalized correlation */
+ for( k = 0; k < nb_subfr; k++ ) {
+ pitch_out[ k ] = lag + matrix_ptr( Lag_CB_ptr, k, CBimax, cbk_size );
+ }
+ *lagIndex = (SKP_int16)( lag - min_lag );
+ *contourIndex = (SKP_int8)CBimax;
+ }
+ SKP_assert( *lagIndex >= 0 );
+ /* return as voiced */
+ return 0;
+}
+
+static void SKP_P_Ana_calc_corr_st3(
+ SKP_float cross_corr_st3[ PE_MAX_NB_SUBFR ][ PE_NB_CBKS_STAGE3_MAX ][ PE_NB_STAGE3_LAGS ], /* O 3 DIM correlation array */
+ const SKP_float signal[], /* I vector to correlate */
+ SKP_int start_lag, /* I start lag */
+ SKP_int sf_length, /* I sub frame length */
+ SKP_int nb_subfr, /* I number of subframes */
+ SKP_int complexity /* I Complexity setting */
+)
+ /***********************************************************************
+ Calculates the correlations used in stage 3 search. In order to cover
+ the whole lag codebook for all the searched offset lags (lag +- 2),
+ the following correlations are needed in each sub frame:
+
+ sf1: lag range [-8,...,7] total 16 correlations
+ sf2: lag range [-4,...,4] total 9 correlations
+ sf3: lag range [-3,....4] total 8 correltions
+ sf4: lag range [-6,....8] total 15 correlations
+
+ In total 48 correlations. The direct implementation computed in worst case
+ 4*12*5 = 240 correlations, but more likely around 120.
+ **********************************************************************/
+{
+ const SKP_float *target_ptr, *basis_ptr;
+ SKP_int i, j, k, lag_counter, lag_low, lag_high;
+ SKP_int nb_cbk_search, delta, idx, cbk_size;
+ SKP_float scratch_mem[ SCRATCH_SIZE ];
+ const SKP_int8 *Lag_range_ptr, *Lag_CB_ptr;
+
+ SKP_assert( complexity >= SigProc_PE_MIN_COMPLEX );
+ SKP_assert( complexity <= SigProc_PE_MAX_COMPLEX );
+
+ if( nb_subfr == PE_MAX_NB_SUBFR ){
+ Lag_range_ptr = &SKP_Silk_Lag_range_stage3[ complexity ][ 0 ][ 0 ];
+ Lag_CB_ptr = &SKP_Silk_CB_lags_stage3[ 0 ][ 0 ];
+ nb_cbk_search = SKP_Silk_nb_cbk_searchs_stage3[ complexity ];
+ cbk_size = PE_NB_CBKS_STAGE3_MAX;
+ } else {
+ SKP_assert( nb_subfr == PE_MAX_NB_SUBFR >> 1);
+ Lag_range_ptr = &SKP_Silk_Lag_range_stage3_10_ms[ 0 ][ 0 ];
+ Lag_CB_ptr = &SKP_Silk_CB_lags_stage3_10_ms[ 0 ][ 0 ];
+ nb_cbk_search = PE_NB_CBKS_STAGE3_10MS;
+ cbk_size = PE_NB_CBKS_STAGE3_10MS;
+ }
+
+ target_ptr = &signal[ SKP_LSHIFT( sf_length, 2 ) ]; /* Pointer to middle of frame */
+ for( k = 0; k < nb_subfr; k++ ) {
+ lag_counter = 0;
+
+ /* Calculate the correlations for each subframe */
+ lag_low = matrix_ptr( Lag_range_ptr, k, 0, 2 );
+ lag_high = matrix_ptr( Lag_range_ptr, k, 1, 2 );
+ for( j = lag_low; j <= lag_high; j++ ) {
+ basis_ptr = target_ptr - ( start_lag + j );
+ SKP_assert( lag_counter < SCRATCH_SIZE );
+ scratch_mem[ lag_counter ] = (SKP_float)SKP_Silk_inner_product_FLP( target_ptr, basis_ptr, sf_length );
+ lag_counter++;
+ }
+
+ delta = matrix_ptr( Lag_range_ptr, k, 0, 2 );
+ for( i = 0; i < nb_cbk_search; i++ ) {
+ /* Fill out the 3 dim array that stores the correlations for */
+ /* each code_book vector for each start lag */
+ idx = matrix_ptr( Lag_CB_ptr, k, i, cbk_size ) - delta;
+ for( j = 0; j < PE_NB_STAGE3_LAGS; j++ ) {
+ SKP_assert( idx + j < SCRATCH_SIZE );
+ SKP_assert( idx + j < lag_counter );
+ cross_corr_st3[ k ][ i ][ j ] = scratch_mem[ idx + j ];
+ }
+ }
+ target_ptr += sf_length;
+ }
+}
+
+static void SKP_P_Ana_calc_energy_st3(
+ SKP_float energies_st3[ PE_MAX_NB_SUBFR ][ PE_NB_CBKS_STAGE3_MAX ][ PE_NB_STAGE3_LAGS ], /* O 3 DIM correlation array */
+ const SKP_float signal[], /* I vector to correlate */
+ SKP_int start_lag, /* I start lag */
+ SKP_int sf_length, /* I sub frame length */
+ SKP_int nb_subfr, /* I number of subframes */
+ SKP_int complexity /* I Complexity setting */
+)
+/****************************************************************
+Calculate the energies for first two subframes. The energies are
+calculated recursively.
+****************************************************************/
+{
+ const SKP_float *target_ptr, *basis_ptr;
+ double energy;
+ SKP_int k, i, j, lag_counter;
+ SKP_int nb_cbk_search, delta, idx, cbk_size, lag_diff;
+ SKP_float scratch_mem[ SCRATCH_SIZE ];
+ const SKP_int8 *Lag_range_ptr, *Lag_CB_ptr;
+
+ SKP_assert( complexity >= SigProc_PE_MIN_COMPLEX );
+ SKP_assert( complexity <= SigProc_PE_MAX_COMPLEX );
+
+ if( nb_subfr == PE_MAX_NB_SUBFR ){
+ Lag_range_ptr = &SKP_Silk_Lag_range_stage3[ complexity ][ 0 ][ 0 ];
+ Lag_CB_ptr = &SKP_Silk_CB_lags_stage3[ 0 ][ 0 ];
+ nb_cbk_search = SKP_Silk_nb_cbk_searchs_stage3[ complexity ];
+ cbk_size = PE_NB_CBKS_STAGE3_MAX;
+ } else {
+ SKP_assert( nb_subfr == PE_MAX_NB_SUBFR >> 1);
+ Lag_range_ptr = &SKP_Silk_Lag_range_stage3_10_ms[ 0 ][ 0 ];
+ Lag_CB_ptr = &SKP_Silk_CB_lags_stage3_10_ms[ 0 ][ 0 ];
+ nb_cbk_search = PE_NB_CBKS_STAGE3_10MS;
+ cbk_size = PE_NB_CBKS_STAGE3_10MS;
+ }
+
+ target_ptr = &signal[ SKP_LSHIFT( sf_length, 2 ) ];
+ for( k = 0; k < nb_subfr; k++ ) {
+ lag_counter = 0;
+
+ /* Calculate the energy for first lag */
+ basis_ptr = target_ptr - ( start_lag + matrix_ptr( Lag_range_ptr, k, 0, 2 ) );
+ energy = SKP_Silk_energy_FLP( basis_ptr, sf_length ) + 1e-3;
+ SKP_assert( energy >= 0.0 );
+ scratch_mem[lag_counter] = (SKP_float)energy;
+ lag_counter++;
+
+ lag_diff = ( matrix_ptr( Lag_range_ptr, k, 1, 2 ) - matrix_ptr( Lag_range_ptr, k, 0, 2 ) + 1 );
+ for( i = 1; i < lag_diff; i++ ) {
+ /* remove part outside new window */
+ energy -= basis_ptr[sf_length - i] * basis_ptr[sf_length - i];
+ SKP_assert( energy >= 0.0 );
+
+ /* add part that comes into window */
+ energy += basis_ptr[ -i ] * basis_ptr[ -i ];
+ SKP_assert( energy >= 0.0 );
+ SKP_assert( lag_counter < SCRATCH_SIZE );
+ scratch_mem[lag_counter] = (SKP_float)energy;
+ lag_counter++;
+ }
+
+ delta = matrix_ptr( Lag_range_ptr, k, 0, 2 );
+ for( i = 0; i < nb_cbk_search; i++ ) {
+ /* Fill out the 3 dim array that stores the correlations for */
+ /* each code_book vector for each start lag */
+ idx = matrix_ptr( Lag_CB_ptr, k, i, cbk_size ) - delta;
+ for( j = 0; j < PE_NB_STAGE3_LAGS; j++ ) {
+ SKP_assert( idx + j < SCRATCH_SIZE );
+ SKP_assert( idx + j < lag_counter );
+ energies_st3[ k ][ i ][ j ] = scratch_mem[ idx + j ];
+ SKP_assert( energies_st3[ k ][ i ][ j ] >= 0.0f );
+ }
+ }
+ target_ptr += sf_length;
+ }
+}
--- /dev/null
+++ b/silk/float/SKP_Silk_scale_copy_vector_FLP.c
@@ -1,0 +1,53 @@
+/***********************************************************************
+Copyright (c) 2006-2011, Skype Limited. All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, (subject to the limitations in the disclaimer below)
+are permitted provided that the following conditions are met:
+- Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+- Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+- Neither the name of Skype Limited, nor the names of specific
+contributors, may be used to endorse or promote products derived from
+this software without specific prior written permission.
+NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED
+BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
+BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+***********************************************************************/
+
+#include "SKP_Silk_SigProc_FLP.h"
+
+/* copy and multiply a vector by a constant */
+void SKP_Silk_scale_copy_vector_FLP(
+ SKP_float *data_out,
+ const SKP_float *data_in,
+ SKP_float gain,
+ SKP_int dataSize
+)
+{
+ SKP_int i, dataSize4;
+
+ /* 4x unrolled loop */
+ dataSize4 = dataSize & 0xFFFC;
+ for( i = 0; i < dataSize4; i += 4 ) {
+ data_out[ i + 0 ] = gain * data_in[ i + 0 ];
+ data_out[ i + 1 ] = gain * data_in[ i + 1 ];
+ data_out[ i + 2 ] = gain * data_in[ i + 2 ];
+ data_out[ i + 3 ] = gain * data_in[ i + 3 ];
+ }
+
+ /* any remaining elements */
+ for( ; i < dataSize; i++ ) {
+ data_out[ i ] = gain * data_in[ i ];
+ }
+}
--- /dev/null
+++ b/silk/float/SKP_Silk_scale_vector_FLP.c
@@ -1,0 +1,52 @@
+/***********************************************************************
+Copyright (c) 2006-2011, Skype Limited. All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, (subject to the limitations in the disclaimer below)
+are permitted provided that the following conditions are met:
+- Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+- Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+- Neither the name of Skype Limited, nor the names of specific
+contributors, may be used to endorse or promote products derived from
+this software without specific prior written permission.
+NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED
+BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
+BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+***********************************************************************/
+
+#include "SKP_Silk_SigProc_FLP.h"
+
+/* multiply a vector by a constant */
+void SKP_Silk_scale_vector_FLP(
+ SKP_float *data1,
+ SKP_float gain,
+ SKP_int dataSize
+)
+{
+ SKP_int i, dataSize4;
+
+ /* 4x unrolled loop */
+ dataSize4 = dataSize & 0xFFFC;
+ for( i = 0; i < dataSize4; i += 4 ) {
+ data1[ i + 0 ] *= gain;
+ data1[ i + 1 ] *= gain;
+ data1[ i + 2 ] *= gain;
+ data1[ i + 3 ] *= gain;
+ }
+
+ /* any remaining elements */
+ for( ; i < dataSize; i++ ) {
+ data1[ i ] *= gain;
+ }
+}
--- /dev/null
+++ b/silk/float/SKP_Silk_schur_FLP.c
@@ -1,0 +1,73 @@
+/***********************************************************************
+Copyright (c) 2006-2011, Skype Limited. All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, (subject to the limitations in the disclaimer below)
+are permitted provided that the following conditions are met:
+- Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+- Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+- Neither the name of Skype Limited, nor the names of specific
+contributors, may be used to endorse or promote products derived from
+this software without specific prior written permission.
+NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED
+BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
+BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+***********************************************************************/
+
+/* *
+ * SKP_Silk_schur.c *
+ * *
+ * Calculates the reflection coefficients from the correlation sequence *
+ * *
+ * Copyright 2008 (c), Skype Limited *
+ * Date: 080103 *
+ */
+
+#include "SKP_Silk_SigProc_FLP.h"
+
+SKP_float SKP_Silk_schur_FLP( /* O returns residual energy */
+ SKP_float refl_coef[], /* O reflection coefficients (length order) */
+ const SKP_float auto_corr[], /* I autotcorrelation sequence (length order+1) */
+ SKP_int order /* I order */
+)
+{
+ SKP_int k, n;
+ SKP_float C[ SKP_Silk_MAX_ORDER_LPC + 1 ][ 2 ];
+ SKP_float Ctmp1, Ctmp2, rc_tmp;
+
+ /* Copy correlations */
+ for( k = 0; k < order+1; k++ ) {
+ C[ k ][ 0 ] = C[ k ][ 1 ] = auto_corr[ k ];
+ }
+
+ for( k = 0; k < order; k++ ) {
+ /* Get reflection coefficient */
+ rc_tmp = -C[ k + 1 ][ 0 ] / SKP_max_float( C[ 0 ][ 1 ], 1e-9f );
+
+ /* Save the output */
+ refl_coef[ k ] = rc_tmp;
+
+ /* Update correlations */
+ for( n = 0; n < order - k; n++ ){
+ Ctmp1 = C[ n + k + 1 ][ 0 ];
+ Ctmp2 = C[ n ][ 1 ];
+ C[ n + k + 1 ][ 0 ] = Ctmp1 + Ctmp2 * rc_tmp;
+ C[ n ][ 1 ] = Ctmp2 + Ctmp1 * rc_tmp;
+ }
+ }
+
+ /* Return residual energy */
+ return C[ 0 ][ 1 ];
+}
+
--- /dev/null
+++ b/silk/float/SKP_Silk_sort_FLP.c
@@ -1,0 +1,79 @@
+/***********************************************************************
+Copyright (c) 2006-2011, Skype Limited. All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, (subject to the limitations in the disclaimer below)
+are permitted provided that the following conditions are met:
+- Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+- Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+- Neither the name of Skype Limited, nor the names of specific
+contributors, may be used to endorse or promote products derived from
+this software without specific prior written permission.
+NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED
+BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
+BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+***********************************************************************/
+
+/* Insertion sort (fast for already almost sorted arrays): */
+/* Best case: O(n) for an already sorted array */
+/* Worst case: O(n^2) for an inversely sorted array */
+
+#include "SKP_Silk_typedef.h"
+#include "SKP_Silk_SigProc_FLP.h"
+
+void SKP_Silk_insertion_sort_decreasing_FLP(
+ SKP_float *a, /* I/O: Unsorted / Sorted vector */
+ SKP_int *index, /* O: Index vector for the sorted elements */
+ const SKP_int L, /* I: Vector length */
+ const SKP_int K /* I: Number of correctly sorted positions */
+)
+{
+ SKP_float value;
+ SKP_int i, j;
+
+ /* Safety checks */
+ SKP_assert( K > 0 );
+ SKP_assert( L > 0 );
+ SKP_assert( L >= K );
+
+ /* Write start indices in index vector */
+ for( i = 0; i < K; i++ ) {
+ index[ i ] = i;
+ }
+
+ /* Sort vector elements by value, decreasing order */
+ for( i = 1; i < K; i++ ) {
+ value = a[ i ];
+ for( j = i - 1; ( j >= 0 ) && ( value > a[ j ] ); j-- ) {
+ a[ j + 1 ] = a[ j ]; /* Shift value */
+ index[ j + 1 ] = index[ j ]; /* Shift index */
+ }
+ a[ j + 1 ] = value; /* Write value */
+ index[ j + 1 ] = i; /* Write index */
+ }
+
+ /* If less than L values are asked check the remaining values, */
+ /* but only spend CPU to ensure that the K first values are correct */
+ for( i = K; i < L; i++ ) {
+ value = a[ i ];
+ if( value > a[ K - 1 ] ) {
+ for( j = K - 2; ( j >= 0 ) && ( value > a[ j ] ); j-- ) {
+ a[ j + 1 ] = a[ j ]; /* Shift value */
+ index[ j + 1 ] = index[ j ]; /* Shift index */
+ }
+ a[ j + 1 ] = value; /* Write value */
+ index[ j + 1 ] = i; /* Write index */
+ }
+ }
+}
--- /dev/null
+++ b/silk/float/SKP_Silk_structs_FLP.h
@@ -1,0 +1,116 @@
+/***********************************************************************
+Copyright (c) 2006-2011, Skype Limited. All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, (subject to the limitations in the disclaimer below)
+are permitted provided that the following conditions are met:
+- Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+- Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+- Neither the name of Skype Limited, nor the names of specific
+contributors, may be used to endorse or promote products derived from
+this software without specific prior written permission.
+NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED
+BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
+BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+***********************************************************************/
+
+#ifndef SKP_SILK_STRUCTS_FLP_H
+#define SKP_SILK_STRUCTS_FLP_H
+
+#include "SKP_Silk_typedef.h"
+#include "SKP_Silk_main.h"
+#include "SKP_Silk_structs.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/********************************/
+/* Noise shaping analysis state */
+/********************************/
+typedef struct {
+ SKP_int8 LastGainIndex;
+ SKP_float HarmBoost_smth;
+ SKP_float HarmShapeGain_smth;
+ SKP_float Tilt_smth;
+} SKP_Silk_shape_state_FLP;
+
+/********************************/
+/* Prefilter state */
+/********************************/
+typedef struct {
+ SKP_float sLTP_shp[ LTP_BUF_LENGTH ];
+ SKP_float sAR_shp[ MAX_SHAPE_LPC_ORDER + 1 ];
+ SKP_int sLTP_shp_buf_idx;
+ SKP_float sLF_AR_shp;
+ SKP_float sLF_MA_shp;
+ SKP_float sHarmHP;
+ SKP_int32 rand_seed;
+ SKP_int lagPrev;
+} SKP_Silk_prefilter_state_FLP;
+
+/********************************/
+/* Encoder state FLP */
+/********************************/
+typedef struct {
+ SKP_Silk_encoder_state sCmn; /* Common struct, shared with fixed-point code */
+ SKP_Silk_shape_state_FLP sShape; /* Noise shaping state */
+ SKP_Silk_prefilter_state_FLP sPrefilt; /* Prefilter State */
+
+ /* Buffer for find pitch and noise shape analysis */
+ SKP_float x_buf[ 2 * MAX_FRAME_LENGTH + LA_SHAPE_MAX ];/* Buffer for find pitch and noise shape analysis */
+ SKP_float LTPCorr; /* Normalized correlation from pitch lag estimator */
+
+ /* Parameters for LTP scaling control */
+ SKP_float prevLTPredCodGain;
+ SKP_float HPLTPredCodGain;
+} SKP_Silk_encoder_state_FLP;
+
+/************************/
+/* Encoder control FLP */
+/************************/
+typedef struct {
+ /* Prediction and coding parameters */
+ SKP_float Gains[ MAX_NB_SUBFR ];
+ SKP_float PredCoef[ 2 ][ MAX_LPC_ORDER ]; /* holds interpolated and final coefficients */
+ SKP_float LTPCoef[LTP_ORDER * MAX_NB_SUBFR];
+ SKP_float LTP_scale;
+ SKP_int pitchL[ MAX_NB_SUBFR ];
+
+ /* Noise shaping parameters */
+ SKP_float AR1[ MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER ];
+ SKP_float AR2[ MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER ];
+ SKP_float LF_MA_shp[ MAX_NB_SUBFR ];
+ SKP_float LF_AR_shp[ MAX_NB_SUBFR ];
+ SKP_float GainsPre[ MAX_NB_SUBFR ];
+ SKP_float HarmBoost[ MAX_NB_SUBFR ];
+ SKP_float Tilt[ MAX_NB_SUBFR ];
+ SKP_float HarmShapeGain[ MAX_NB_SUBFR ];
+ SKP_float Lambda;
+ SKP_float input_quality;
+ SKP_float coding_quality;
+
+ /* Measures */
+ SKP_float sparseness;
+ SKP_float predGain;
+ SKP_float LTPredCodGain;
+ SKP_float ResNrg[ MAX_NB_SUBFR ]; /* Residual energy per subframe */
+} SKP_Silk_encoder_control_FLP;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null
+++ b/silk/float/silk_float.vcxproj
@@ -1,0 +1,130 @@
+<?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>{9C4961D2-5DDB-40C7-9BE8-CA918DC4E782}</ProjectGuid>
+ <Keyword>Win32Proj</Keyword>
+ <RootNamespace>src_FLP</RootNamespace>
+ <ProjectName>silk_float</ProjectName>
+ </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 Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetName>$(ProjectName)</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <TargetName>$(ProjectName)</TargetName>
+ </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>../;../fixed;../../win32;../../libcelt</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ <Lib>
+ <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+ </Lib>
+ </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>../;../fixed;../../win32;../../libcelt</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ <Lib>
+ <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+ </Lib>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <None Include="ReadMe.txt" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="SKP_Silk_apply_sine_window_FLP.c" />
+ <ClCompile Include="SKP_Silk_autocorrelation_FLP.c" />
+ <ClCompile Include="SKP_Silk_burg_modified_FLP.c" />
+ <ClCompile Include="SKP_Silk_bwexpander_FLP.c" />
+ <ClCompile Include="SKP_Silk_corrMatrix_FLP.c" />
+ <ClCompile Include="SKP_Silk_encode_frame_FLP.c" />
+ <ClCompile Include="SKP_Silk_energy_FLP.c" />
+ <ClCompile Include="SKP_Silk_find_LPC_FLP.c" />
+ <ClCompile Include="SKP_Silk_find_LTP_FLP.c" />
+ <ClCompile Include="SKP_Silk_find_pitch_lags_FLP.c" />
+ <ClCompile Include="SKP_Silk_find_pred_coefs_FLP.c" />
+ <ClCompile Include="SKP_Silk_inner_product_FLP.c" />
+ <ClCompile Include="SKP_Silk_k2a_FLP.c" />
+ <ClCompile Include="SKP_Silk_levinsondurbin_FLP.c" />
+ <ClCompile Include="SKP_Silk_LPC_analysis_filter_FLP.c" />
+ <ClCompile Include="SKP_Silk_LPC_inv_pred_gain_FLP.c" />
+ <ClCompile Include="SKP_Silk_LTP_analysis_filter_FLP.c" />
+ <ClCompile Include="SKP_Silk_LTP_scale_ctrl_FLP.c" />
+ <ClCompile Include="SKP_Silk_noise_shape_analysis_FLP.c" />
+ <ClCompile Include="SKP_Silk_pitch_analysis_core_FLP.c" />
+ <ClCompile Include="SKP_Silk_prefilter_FLP.c" />
+ <ClCompile Include="SKP_Silk_process_gains_FLP.c" />
+ <ClCompile Include="SKP_Silk_regularize_correlations_FLP.c" />
+ <ClCompile Include="SKP_Silk_residual_energy_FLP.c" />
+ <ClCompile Include="SKP_Silk_scale_copy_vector_FLP.c" />
+ <ClCompile Include="SKP_Silk_scale_vector_FLP.c" />
+ <ClCompile Include="SKP_Silk_schur_FLP.c" />
+ <ClCompile Include="SKP_Silk_solve_LS_FLP.c" />
+ <ClCompile Include="SKP_Silk_sort_FLP.c" />
+ <ClCompile Include="SKP_Silk_warped_autocorrelation_FLP.c" />
+ <ClCompile Include="SKP_Silk_wrappers_FLP.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\win32\config.h" />
+ <ClInclude Include="SKP_Silk_main_FLP.h" />
+ <ClInclude Include="SKP_Silk_SigProc_FLP.h" />
+ <ClInclude Include="SKP_Silk_structs_FLP.h" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file
--- /dev/null
+++ b/silk/float/silk_float.vcxproj.filters
@@ -1,0 +1,129 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="ReadMe.txt" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="SKP_Silk_LPC_analysis_filter_FLP.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_LPC_inv_pred_gain_FLP.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_LTP_analysis_filter_FLP.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_LTP_scale_ctrl_FLP.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_noise_shape_analysis_FLP.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_pitch_analysis_core_FLP.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_prefilter_FLP.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_process_gains_FLP.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_regularize_correlations_FLP.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_residual_energy_FLP.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_scale_copy_vector_FLP.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_scale_vector_FLP.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_schur_FLP.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_solve_LS_FLP.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_sort_FLP.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_warped_autocorrelation_FLP.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_wrappers_FLP.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_apply_sine_window_FLP.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_autocorrelation_FLP.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_burg_modified_FLP.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_bwexpander_FLP.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_corrMatrix_FLP.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_encode_frame_FLP.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_energy_FLP.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_find_LPC_FLP.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_find_LTP_FLP.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_find_pitch_lags_FLP.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_find_pred_coefs_FLP.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_inner_product_FLP.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_k2a_FLP.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_levinsondurbin_FLP.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="SKP_Silk_main_FLP.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="SKP_Silk_SigProc_FLP.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="SKP_Silk_structs_FLP.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\win32\config.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file
--- /dev/null
+++ b/silk/silk_common.vcxproj
@@ -1,0 +1,212 @@
+<?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>{C303D2FC-FF97-49B8-9DDD-467B4C9A0B16}</ProjectGuid>
+ <Keyword>Win32Proj</Keyword>
+ <RootNamespace>src_common</RootNamespace>
+ <ProjectName>silk_common</ProjectName>
+ </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 Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetName>$(ProjectName)</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <TargetName>$(ProjectName)</TargetName>
+ </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>fixed;float;../win32;../libcelt</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ <Lib>
+ <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+ </Lib>
+ </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>fixed;float;../win32;../libcelt</AdditionalIncludeDirectories>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ <Lib>
+ <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+ </Lib>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <None Include="ReadMe.txt" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="SKP_Silk_A2NLSF.c" />
+ <ClCompile Include="SKP_Silk_ana_filt_bank_1.c" />
+ <ClCompile Include="SKP_Silk_apply_sine_window.c" />
+ <ClCompile Include="SKP_Silk_array_maxabs.c" />
+ <ClCompile Include="SKP_Silk_autocorr.c" />
+ <ClCompile Include="SKP_Silk_biquad_alt.c" />
+ <ClCompile Include="SKP_Silk_burg_modified.c" />
+ <ClCompile Include="SKP_Silk_bwexpander.c" />
+ <ClCompile Include="SKP_Silk_bwexpander_32.c" />
+ <ClCompile Include="SKP_Silk_check_control_input.c" />
+ <ClCompile Include="SKP_Silk_CNG.c" />
+ <ClCompile Include="SKP_Silk_code_signs.c" />
+ <ClCompile Include="SKP_Silk_control_audio_bandwidth.c" />
+ <ClCompile Include="SKP_Silk_control_codec.c" />
+ <ClCompile Include="SKP_Silk_control_SNR.c" />
+ <ClCompile Include="SKP_Silk_create_init_destroy.c" />
+ <ClCompile Include="SKP_Silk_debug.c" />
+ <ClCompile Include="SKP_Silk_decoder_set_fs.c" />
+ <ClCompile Include="SKP_Silk_decode_core.c" />
+ <ClCompile Include="SKP_Silk_decode_frame.c" />
+ <ClCompile Include="SKP_Silk_decode_indices.c" />
+ <ClCompile Include="SKP_Silk_decode_parameters.c" />
+ <ClCompile Include="SKP_Silk_decode_pitch.c" />
+ <ClCompile Include="SKP_Silk_decode_pulses.c" />
+ <ClCompile Include="SKP_Silk_dec_API.c" />
+ <ClCompile Include="SKP_Silk_encode_indices.c" />
+ <ClCompile Include="SKP_Silk_encode_pulses.c" />
+ <ClCompile Include="SKP_Silk_enc_API.c" />
+ <ClCompile Include="SKP_Silk_gain_quant.c" />
+ <ClCompile Include="SKP_Silk_HP_variable_cutoff.c" />
+ <ClCompile Include="SKP_Silk_init_encoder.c" />
+ <ClCompile Include="SKP_Silk_inner_prod_aligned.c" />
+ <ClCompile Include="SKP_Silk_interpolate.c" />
+ <ClCompile Include="SKP_Silk_k2a.c" />
+ <ClCompile Include="SKP_Silk_k2a_Q16.c" />
+ <ClCompile Include="SKP_Silk_lin2log.c" />
+ <ClCompile Include="SKP_Silk_log2lin.c" />
+ <ClCompile Include="SKP_Silk_LPC_analysis_filter.c" />
+ <ClCompile Include="SKP_Silk_LPC_inv_pred_gain.c" />
+ <ClCompile Include="SKP_Silk_LPC_stabilize.c" />
+ <ClCompile Include="SKP_Silk_LPC_synthesis_filter.c" />
+ <ClCompile Include="SKP_Silk_LPC_synthesis_order16.c" />
+ <ClCompile Include="SKP_Silk_LP_variable_cutoff.c" />
+ <ClCompile Include="SKP_Silk_LSF_cos_table.c" />
+ <ClCompile Include="SKP_Silk_NLSF2A.c" />
+ <ClCompile Include="SKP_Silk_NLSF2A_stable.c" />
+ <ClCompile Include="SKP_Silk_NLSF_decode.c" />
+ <ClCompile Include="SKP_Silk_NLSF_del_dec_quant.c" />
+ <ClCompile Include="SKP_Silk_NLSF_encode.c" />
+ <ClCompile Include="SKP_Silk_NLSF_stabilize.c" />
+ <ClCompile Include="SKP_Silk_NLSF_unpack.c" />
+ <ClCompile Include="SKP_Silk_NLSF_VQ.c" />
+ <ClCompile Include="SKP_Silk_NLSF_VQ_weights_laroia.c" />
+ <ClCompile Include="SKP_Silk_NSQ.c" />
+ <ClCompile Include="SKP_Silk_NSQ_del_dec.c" />
+ <ClCompile Include="SKP_Silk_pitch_analysis_core.c" />
+ <ClCompile Include="SKP_Silk_pitch_est_tables.c" />
+ <ClCompile Include="SKP_Silk_PLC.c" />
+ <ClCompile Include="SKP_Silk_process_NLSFs.c" />
+ <ClCompile Include="SKP_Silk_quant_LTP_gains.c" />
+ <ClCompile Include="SKP_Silk_resampler.c" />
+ <ClCompile Include="SKP_Silk_resampler_down2.c" />
+ <ClCompile Include="SKP_Silk_resampler_down2_3.c" />
+ <ClCompile Include="SKP_Silk_resampler_down3.c" />
+ <ClCompile Include="SKP_Silk_resampler_private_AR2.c" />
+ <ClCompile Include="SKP_Silk_resampler_private_ARMA4.c" />
+ <ClCompile Include="SKP_Silk_resampler_private_copy.c" />
+ <ClCompile Include="SKP_Silk_resampler_private_down4.c" />
+ <ClCompile Include="SKP_Silk_resampler_private_down_FIR.c" />
+ <ClCompile Include="SKP_Silk_resampler_private_IIR_FIR.c" />
+ <ClCompile Include="SKP_Silk_resampler_private_up2_HQ.c" />
+ <ClCompile Include="SKP_Silk_resampler_private_up4.c" />
+ <ClCompile Include="SKP_Silk_resampler_rom.c" />
+ <ClCompile Include="SKP_Silk_resampler_up2.c" />
+ <ClCompile Include="SKP_Silk_scale_copy_vector16.c" />
+ <ClCompile Include="SKP_Silk_scale_vector.c" />
+ <ClCompile Include="SKP_Silk_schur.c" />
+ <ClCompile Include="SKP_Silk_schur64.c" />
+ <ClCompile Include="SKP_Silk_shell_coder.c" />
+ <ClCompile Include="SKP_Silk_sigm_Q15.c" />
+ <ClCompile Include="SKP_Silk_sort.c" />
+ <ClCompile Include="SKP_Silk_stereo_decode_pred.c" />
+ <ClCompile Include="SKP_Silk_stereo_encode_pred.c" />
+ <ClCompile Include="SKP_Silk_stereo_find_predictor.c" />
+ <ClCompile Include="SKP_Silk_stereo_LR_to_MS.c" />
+ <ClCompile Include="SKP_Silk_stereo_MS_to_LR.c" />
+ <ClCompile Include="SKP_Silk_sum_sqr_shift.c" />
+ <ClCompile Include="SKP_Silk_tables_gain.c" />
+ <ClCompile Include="SKP_Silk_tables_LTP.c" />
+ <ClCompile Include="SKP_Silk_tables_NLSF_CB_NB_MB.c" />
+ <ClCompile Include="SKP_Silk_tables_NLSF_CB_WB.c" />
+ <ClCompile Include="SKP_Silk_tables_other.c" />
+ <ClCompile Include="SKP_Silk_tables_pitch_lag.c" />
+ <ClCompile Include="SKP_Silk_tables_pulses_per_block.c" />
+ <ClCompile Include="SKP_Silk_VAD.c" />
+ <ClCompile Include="SKP_Silk_VQ_WMat_EC.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\win32\config.h" />
+ <ClInclude Include="float\SKP_Silk_main_FLP.h" />
+ <ClInclude Include="SKP_Silk_control.h" />
+ <ClInclude Include="SKP_Silk_define.h" />
+ <ClInclude Include="SKP_Silk_errors.h" />
+ <ClInclude Include="SKP_Silk_Inlines.h" />
+ <ClInclude Include="SKP_Silk_MacroCount.h" />
+ <ClInclude Include="SKP_Silk_MacroDebug.h" />
+ <ClInclude Include="SKP_Silk_macros.h" />
+ <ClInclude Include="SKP_Silk_main.h" />
+ <ClInclude Include="SKP_Silk_pitch_est_defines.h" />
+ <ClInclude Include="SKP_Silk_PLC.h" />
+ <ClInclude Include="SKP_Silk_resampler_private.h" />
+ <ClInclude Include="SKP_Silk_resampler_rom.h" />
+ <ClInclude Include="SKP_Silk_resampler_structs.h" />
+ <ClInclude Include="SKP_Silk_SDK_API.h" />
+ <ClInclude Include="SKP_Silk_SigProc_FIX.h" />
+ <ClInclude Include="SKP_Silk_structs.h" />
+ <ClInclude Include="SKP_Silk_tables.h" />
+ <ClInclude Include="SKP_Silk_tuning_parameters.h" />
+ <ClInclude Include="SKP_Silk_typedef.h" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file
--- /dev/null
+++ b/silk/silk_common.vcxproj.filters
@@ -1,0 +1,375 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="ReadMe.txt" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="SKP_Silk_A2NLSF.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_ana_filt_bank_1.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_apply_sine_window.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_array_maxabs.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_autocorr.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_biquad_alt.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_burg_modified.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_bwexpander.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_bwexpander_32.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_check_control_input.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_CNG.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_code_signs.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_control_audio_bandwidth.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_control_codec.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_control_SNR.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_create_init_destroy.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_debug.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_dec_API.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_decode_core.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_decode_frame.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_decode_indices.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_decode_parameters.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_decode_pitch.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_decode_pulses.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_decoder_set_fs.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_enc_API.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_encode_indices.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_encode_pulses.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_gain_quant.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_HP_variable_cutoff.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_init_encoder.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_inner_prod_aligned.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_interpolate.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_k2a.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_k2a_Q16.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_lin2log.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_log2lin.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_LP_variable_cutoff.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_LPC_analysis_filter.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_LPC_inv_pred_gain.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_LPC_stabilize.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_LPC_synthesis_filter.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_LPC_synthesis_order16.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_LSF_cos_table.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_NLSF_decode.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_NLSF_del_dec_quant.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_NLSF_encode.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_NLSF_stabilize.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_NLSF_unpack.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_NLSF_VQ.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_NLSF_VQ_weights_laroia.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_NLSF2A.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_NLSF2A_stable.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_NSQ.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_NSQ_del_dec.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_pitch_analysis_core.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_pitch_est_tables.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_PLC.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_process_NLSFs.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_quant_LTP_gains.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_resampler.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_resampler_down2.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_resampler_down2_3.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_resampler_down3.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_resampler_private_AR2.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_resampler_private_ARMA4.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_resampler_private_copy.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_resampler_private_down_FIR.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_resampler_private_down4.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_resampler_private_IIR_FIR.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_resampler_private_up2_HQ.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_resampler_private_up4.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_resampler_rom.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_resampler_up2.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_scale_copy_vector16.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_scale_vector.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_schur.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_schur64.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_shell_coder.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_sigm_Q15.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_sort.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_stereo_decode_pred.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_stereo_encode_pred.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_stereo_find_predictor.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_stereo_LR_to_MS.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_stereo_MS_to_LR.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_sum_sqr_shift.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_tables_gain.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_tables_LTP.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_tables_NLSF_CB_NB_MB.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_tables_NLSF_CB_WB.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_tables_other.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_tables_pitch_lag.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_tables_pulses_per_block.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_VAD.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SKP_Silk_VQ_WMat_EC.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="SKP_Silk_typedef.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="SKP_Silk_control.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="SKP_Silk_define.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="SKP_Silk_errors.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="SKP_Silk_Inlines.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="SKP_Silk_MacroCount.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="SKP_Silk_MacroDebug.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="SKP_Silk_macros.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="SKP_Silk_main.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="SKP_Silk_pitch_est_defines.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="SKP_Silk_PLC.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="SKP_Silk_resampler_private.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="SKP_Silk_resampler_rom.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="SKP_Silk_resampler_structs.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="SKP_Silk_SDK_API.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="SKP_Silk_SigProc_FIX.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="SKP_Silk_structs.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="SKP_Silk_tables.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="SKP_Silk_tuning_parameters.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\win32\config.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="float\SKP_Silk_main_FLP.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file
--- a/silk/src_FIX.vcxproj
+++ /dev/null
@@ -1,101 +1,0 @@
-<?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>{8484C90D-1561-402F-A91D-2DB10F8C5171}</ProjectGuid>
- <Keyword>Win32Proj</Keyword>
- <RootNamespace>src_FIX</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>../interface;../src_SigProc_FIX;../src_common;../../celt/msvc;../../celt/libcelt</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>../interface;../src_SigProc_FIX;../src_common;../../celt/msvc;../../celt/libcelt</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="SKP_Silk_main_FIX.h" />
- <ClInclude Include="SKP_Silk_structs_FIX.h" />
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="SKP_Silk_corrMatrix_FIX.c" />
- <ClCompile Include="SKP_Silk_encode_frame_FIX.c" />
- <ClCompile Include="SKP_Silk_find_LPC_FIX.c" />
- <ClCompile Include="SKP_Silk_find_LTP_FIX.c" />
- <ClCompile Include="SKP_Silk_find_pitch_lags_FIX.c" />
- <ClCompile Include="SKP_Silk_find_pred_coefs_FIX.c" />
- <ClCompile Include="SKP_Silk_LTP_analysis_filter_FIX.c" />
- <ClCompile Include="SKP_Silk_LTP_scale_ctrl_FIX.c" />
- <ClCompile Include="SKP_Silk_noise_shape_analysis_FIX.c" />
- <ClCompile Include="SKP_Silk_prefilter_FIX.c" />
- <ClCompile Include="SKP_Silk_process_gains_FIX.c" />
- <ClCompile Include="SKP_Silk_regularize_correlations_FIX.c" />
- <ClCompile Include="SKP_Silk_residual_energy16_FIX.c" />
- <ClCompile Include="SKP_Silk_residual_energy_FIX.c" />
- <ClCompile Include="SKP_Silk_solve_LS_FIX.c" />
- <ClCompile Include="SKP_Silk_warped_autocorrelation_FIX.c" />
- </ItemGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- <ImportGroup Label="ExtensionTargets">
- </ImportGroup>
-</Project>
\ No newline at end of file
--- a/silk/src_FIX.vcxproj.filters
+++ /dev/null
@@ -1,78 +1,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup>
- <Filter Include="Source Files">
- <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
- <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
- </Filter>
- <Filter Include="Header Files">
- <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
- <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
- </Filter>
- <Filter Include="Resource Files">
- <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
- <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
- </Filter>
- </ItemGroup>
- <ItemGroup>
- <None Include="ReadMe.txt" />
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="SKP_Silk_main_FIX.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="SKP_Silk_structs_FIX.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="SKP_Silk_corrMatrix_FIX.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_encode_frame_FIX.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_find_LPC_FIX.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_find_LTP_FIX.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_find_pitch_lags_FIX.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_find_pred_coefs_FIX.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_LTP_analysis_filter_FIX.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_LTP_scale_ctrl_FIX.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_noise_shape_analysis_FIX.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_prefilter_FIX.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_process_gains_FIX.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_regularize_correlations_FIX.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_residual_energy_FIX.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_residual_energy16_FIX.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_solve_LS_FIX.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_warped_autocorrelation_FIX.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- </ItemGroup>
-</Project>
\ No newline at end of file
--- a/silk/src_FLP.vcxproj
+++ /dev/null
@@ -1,104 +1,0 @@
-<?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>{9C4961D2-5DDB-40C7-9BE8-CA918DC4E782}</ProjectGuid>
- <Keyword>Win32Proj</Keyword>
- <RootNamespace>src_FLP</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>../interface;../src_SigProc_FLP;../src_SigProc_FIX;../src_common;../../celt/msvc;../../celt/libcelt</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>../interface;../src_SigProc_FLP;../src_SigProc_FIX;../src_common;../../celt/msvc;../../celt/libcelt</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="SKP_Silk_assembler_FLP.h" />
- <ClInclude Include="SKP_Silk_main_FLP.h" />
- <ClInclude Include="SKP_Silk_structs_FLP.h" />
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="SKP_Silk_apply_sine_window_FLP.c" />
- <ClCompile Include="SKP_Silk_corrMatrix_FLP.c" />
- <ClCompile Include="SKP_Silk_encode_frame_FLP.c" />
- <ClCompile Include="SKP_Silk_find_LPC_FLP.c" />
- <ClCompile Include="SKP_Silk_find_LTP_FLP.c" />
- <ClCompile Include="SKP_Silk_find_pitch_lags_FLP.c" />
- <ClCompile Include="SKP_Silk_find_pred_coefs_FLP.c" />
- <ClCompile Include="SKP_Silk_LPC_analysis_filter_FLP.c" />
- <ClCompile Include="SKP_Silk_LTP_analysis_filter_FLP.c" />
- <ClCompile Include="SKP_Silk_LTP_scale_ctrl_FLP.c" />
- <ClCompile Include="SKP_Silk_noise_shape_analysis_FLP.c" />
- <ClCompile Include="SKP_Silk_prefilter_FLP.c" />
- <ClCompile Include="SKP_Silk_process_gains_FLP.c" />
- <ClCompile Include="SKP_Silk_regularize_correlations_FLP.c" />
- <ClCompile Include="SKP_Silk_residual_energy_FLP.c" />
- <ClCompile Include="SKP_Silk_solve_LS_FLP.c" />
- <ClCompile Include="SKP_Silk_warped_autocorrelation_FLP.c" />
- <ClCompile Include="SKP_Silk_wrappers_FLP.c" />
- </ItemGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- <ImportGroup Label="ExtensionTargets">
- </ImportGroup>
-</Project>
\ No newline at end of file
--- a/silk/src_FLP.vcxproj.filters
+++ /dev/null
@@ -1,87 +1,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup>
- <Filter Include="Source Files">
- <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
- <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
- </Filter>
- <Filter Include="Header Files">
- <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
- <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
- </Filter>
- <Filter Include="Resource Files">
- <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
- <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
- </Filter>
- </ItemGroup>
- <ItemGroup>
- <None Include="ReadMe.txt" />
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="SKP_Silk_assembler_FLP.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="SKP_Silk_main_FLP.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="SKP_Silk_structs_FLP.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="SKP_Silk_apply_sine_window_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_corrMatrix_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_encode_frame_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_find_LPC_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_find_LTP_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_find_pitch_lags_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_find_pred_coefs_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_LPC_analysis_filter_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_LTP_analysis_filter_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_LTP_scale_ctrl_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_noise_shape_analysis_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_prefilter_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_process_gains_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_regularize_correlations_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_residual_energy_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_solve_LS_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_warped_autocorrelation_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_wrappers_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- </ItemGroup>
-</Project>
\ No newline at end of file
--- a/silk/src_SigProc_FIX.vcxproj
+++ /dev/null
@@ -1,141 +1,0 @@
-<?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>{950F7176-3D29-4CBF-8C40-58B918EAEBB2}</ProjectGuid>
- <Keyword>Win32Proj</Keyword>
- <RootNamespace>src_SigProc_FIX</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>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>../interface;..\..\celt\libcelt</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>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>../interface;..\..\celt\libcelt</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="..\interface\SKP_debug.h" />
- <ClInclude Include="SKP_Silk_pitch_est_defines.h" />
- <ClInclude Include="SKP_Silk_Inlines.h" />
- <ClInclude Include="SKP_Silk_MacroCount.h" />
- <ClInclude Include="SKP_Silk_MacroDebug.h" />
- <ClInclude Include="SKP_Silk_macros.h" />
- <ClInclude Include="SKP_Silk_resampler_private.h" />
- <ClInclude Include="SKP_Silk_resampler_rom.h" />
- <ClInclude Include="SKP_Silk_resampler_structs.h" />
- <ClInclude Include="SKP_Silk_SigProc_FIX.h" />
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="SKP_Silk_A2NLSF.c" />
- <ClCompile Include="SKP_Silk_ana_filt_bank_1.c" />
- <ClCompile Include="SKP_Silk_apply_sine_window.c" />
- <ClCompile Include="SKP_Silk_array_maxabs.c" />
- <ClCompile Include="SKP_Silk_autocorr.c" />
- <ClCompile Include="SKP_Silk_biquad_alt.c" />
- <ClCompile Include="SKP_Silk_burg_modified.c" />
- <ClCompile Include="SKP_Silk_bwexpander.c" />
- <ClCompile Include="SKP_Silk_bwexpander_32.c" />
- <ClCompile Include="SKP_Silk_debug.c" />
- <ClCompile Include="SKP_Silk_decode_pitch.c" />
- <ClCompile Include="SKP_Silk_inner_prod_aligned.c" />
- <ClCompile Include="SKP_Silk_k2a.c" />
- <ClCompile Include="SKP_Silk_k2a_Q16.c" />
- <ClCompile Include="SKP_Silk_lin2log.c" />
- <ClCompile Include="SKP_Silk_log2lin.c" />
- <ClCompile Include="SKP_Silk_LPC_inv_pred_gain.c" />
- <ClCompile Include="SKP_Silk_LPC_stabilize.c" />
- <ClCompile Include="SKP_Silk_LPC_synthesis_filter.c" />
- <ClCompile Include="SKP_Silk_LPC_synthesis_order16.c" />
- <ClCompile Include="SKP_Silk_LSF_cos_table.c" />
- <ClCompile Include="SKP_Silk_LPC_analysis_filter.c" />
- <ClCompile Include="SKP_Silk_NLSF2A.c" />
- <ClCompile Include="SKP_Silk_NLSF_stabilize.c" />
- <ClCompile Include="SKP_Silk_NLSF_VQ_weights_laroia.c" />
- <ClCompile Include="SKP_Silk_pitch_analysis_core.c" />
- <ClCompile Include="SKP_Silk_pitch_est_tables.c" />
- <ClCompile Include="SKP_Silk_resampler.c" />
- <ClCompile Include="SKP_Silk_resampler_down2.c" />
- <ClCompile Include="SKP_Silk_resampler_down2_3.c" />
- <ClCompile Include="SKP_Silk_resampler_down3.c" />
- <ClCompile Include="SKP_Silk_resampler_private_AR2.c" />
- <ClCompile Include="SKP_Silk_resampler_private_ARMA4.c" />
- <ClCompile Include="SKP_Silk_resampler_private_copy.c" />
- <ClCompile Include="SKP_Silk_resampler_private_down4.c" />
- <ClCompile Include="SKP_Silk_resampler_private_down_FIR.c" />
- <ClCompile Include="SKP_Silk_resampler_private_IIR_FIR.c" />
- <ClCompile Include="SKP_Silk_resampler_private_up2_HQ.c" />
- <ClCompile Include="SKP_Silk_resampler_private_up4.c" />
- <ClCompile Include="SKP_Silk_resampler_rom.c" />
- <ClCompile Include="SKP_Silk_resampler_up2.c" />
- <ClCompile Include="SKP_Silk_scale_copy_vector16.c" />
- <ClCompile Include="SKP_Silk_scale_vector.c" />
- <ClCompile Include="SKP_Silk_schur.c" />
- <ClCompile Include="SKP_Silk_schur64.c" />
- <ClCompile Include="SKP_Silk_sigm_Q15.c" />
- <ClCompile Include="SKP_Silk_sort.c" />
- <ClCompile Include="SKP_Silk_sum_sqr_shift.c" />
- </ItemGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- <ImportGroup Label="ExtensionTargets">
- </ImportGroup>
-</Project>
\ No newline at end of file
--- a/silk/src_SigProc_FIX.vcxproj.filters
+++ /dev/null
@@ -1,198 +1,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup>
- <Filter Include="Source Files">
- <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
- <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
- </Filter>
- <Filter Include="Header Files">
- <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
- <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
- </Filter>
- <Filter Include="Resource Files">
- <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
- <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
- </Filter>
- </ItemGroup>
- <ItemGroup>
- <None Include="ReadMe.txt" />
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="SKP_Silk_Inlines.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="SKP_Silk_MacroCount.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="SKP_Silk_MacroDebug.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="SKP_Silk_macros.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="SKP_Silk_resampler_private.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="SKP_Silk_resampler_rom.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="SKP_Silk_resampler_structs.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="SKP_Silk_SigProc_FIX.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="SKP_Silk_pitch_est_defines.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="..\interface\SKP_debug.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="SKP_Silk_A2NLSF.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_ana_filt_bank_1.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_apply_sine_window.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_array_maxabs.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_autocorr.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_biquad_alt.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_burg_modified.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_bwexpander.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_bwexpander_32.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_decode_pitch.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_inner_prod_aligned.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_k2a.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_k2a_Q16.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_lin2log.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_log2lin.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_LPC_inv_pred_gain.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_LPC_stabilize.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_LPC_synthesis_filter.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_LPC_synthesis_order16.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_LSF_cos_table.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_NLSF_stabilize.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_NLSF_VQ_weights_laroia.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_NLSF2A.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_pitch_analysis_core.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_pitch_est_tables.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_resampler.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_resampler_down2.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_resampler_down2_3.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_resampler_down3.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_resampler_private_AR2.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_resampler_private_ARMA4.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_resampler_private_copy.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_resampler_private_down_FIR.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_resampler_private_down4.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_resampler_private_IIR_FIR.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_resampler_private_up2_HQ.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_resampler_private_up4.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_resampler_rom.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_resampler_up2.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_scale_copy_vector16.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_scale_vector.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_schur.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_schur64.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_sigm_Q15.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_sort.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_sum_sqr_shift.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_debug.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_LPC_analysis_filter.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- </ItemGroup>
-</Project>
\ No newline at end of file
--- a/silk/src_SigProc_FLP.vcxproj
+++ /dev/null
@@ -1,97 +1,0 @@
-<?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>{06D10292-A23C-4C5E-9C0F-28737769206F}</ProjectGuid>
- <Keyword>Win32Proj</Keyword>
- <RootNamespace>src_SigProc_FLP</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>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\celt\libcelt;../interface;../src_SigProc_FIX</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>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>..\..\celt\libcelt;../interface;../src_SigProc_FIX</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="SKP_Silk_SigProc_FLP.h" />
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="SKP_Silk_autocorrelation_FLP.c" />
- <ClCompile Include="SKP_Silk_burg_modified_FLP.c" />
- <ClCompile Include="SKP_Silk_bwexpander_FLP.c" />
- <ClCompile Include="SKP_Silk_energy_FLP.c" />
- <ClCompile Include="SKP_Silk_inner_product_FLP.c" />
- <ClCompile Include="SKP_Silk_k2a_FLP.c" />
- <ClCompile Include="SKP_Silk_levinsondurbin_FLP.c" />
- <ClCompile Include="SKP_Silk_LPC_inv_pred_gain_FLP.c" />
- <ClCompile Include="SKP_Silk_pitch_analysis_core_FLP.c" />
- <ClCompile Include="SKP_Silk_scale_copy_vector_FLP.c" />
- <ClCompile Include="SKP_Silk_scale_vector_FLP.c" />
- <ClCompile Include="SKP_Silk_schur_FLP.c" />
- <ClCompile Include="SKP_Silk_sort_FLP.c" />
- </ItemGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- <ImportGroup Label="ExtensionTargets">
- </ImportGroup>
-</Project>
\ No newline at end of file
--- a/silk/src_SigProc_FLP.vcxproj.filters
+++ /dev/null
@@ -1,66 +1,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup>
- <Filter Include="Source Files">
- <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
- <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
- </Filter>
- <Filter Include="Header Files">
- <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
- <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
- </Filter>
- <Filter Include="Resource Files">
- <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
- <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
- </Filter>
- </ItemGroup>
- <ItemGroup>
- <None Include="ReadMe.txt" />
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="SKP_Silk_SigProc_FLP.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="SKP_Silk_autocorrelation_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_burg_modified_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_bwexpander_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_energy_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_inner_product_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_k2a_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_levinsondurbin_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_LPC_inv_pred_gain_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_pitch_analysis_core_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_scale_copy_vector_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_scale_vector_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_schur_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_sort_FLP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- </ItemGroup>
-</Project>
\ No newline at end of file
--- a/silk/src_common.vcxproj
+++ /dev/null
@@ -1,136 +1,0 @@
-<?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>{C303D2FC-FF97-49B8-9DDD-467B4C9A0B16}</ProjectGuid>
- <Keyword>Win32Proj</Keyword>
- <RootNamespace>src_common</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>../interface/;../src_SigProc_FIX;../src_SigProc_FLP;../src_FIX;../src_FLP;../../celt/libcelt;../../celt/msvc</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>../interface/;../src_SigProc_FIX;../src_SigProc_FLP;../src_FIX;../src_FLP;../../celt/libcelt;../../celt/msvc</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="..\interface\SKP_Silk_control.h" />
- <ClInclude Include="..\interface\SKP_Silk_errors.h" />
- <ClInclude Include="SKP_Silk_define.h" />
- <ClInclude Include="SKP_Silk_main.h" />
- <ClInclude Include="SKP_Silk_PLC.h" />
- <ClInclude Include="SKP_Silk_structs.h" />
- <ClInclude Include="SKP_Silk_tables.h" />
- <ClInclude Include="SKP_Silk_tuning_parameters.h" />
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="SKP_Silk_check_control_input.c" />
- <ClCompile Include="SKP_Silk_CNG.c" />
- <ClCompile Include="SKP_Silk_code_signs.c" />
- <ClCompile Include="SKP_Silk_control_audio_bandwidth.c" />
- <ClCompile Include="SKP_Silk_control_codec.c" />
- <ClCompile Include="SKP_Silk_control_SNR.c" />
- <ClCompile Include="SKP_Silk_create_init_destroy.c" />
- <ClCompile Include="SKP_Silk_decoder_set_fs.c" />
- <ClCompile Include="SKP_Silk_decode_core.c" />
- <ClCompile Include="SKP_Silk_decode_frame.c" />
- <ClCompile Include="SKP_Silk_decode_indices.c" />
- <ClCompile Include="SKP_Silk_decode_parameters.c" />
- <ClCompile Include="SKP_Silk_decode_pulses.c" />
- <ClCompile Include="SKP_Silk_dec_API.c" />
- <ClCompile Include="SKP_Silk_encode_indices.c" />
- <ClCompile Include="SKP_Silk_encode_pulses.c" />
- <ClCompile Include="SKP_Silk_enc_API.c" />
- <ClCompile Include="SKP_Silk_gain_quant.c" />
- <ClCompile Include="SKP_Silk_HP_variable_cutoff.c" />
- <ClCompile Include="SKP_Silk_init_encoder.c" />
- <ClCompile Include="SKP_Silk_interpolate.c" />
- <ClCompile Include="SKP_Silk_LP_variable_cutoff.c" />
- <ClCompile Include="SKP_Silk_NLSF2A_stable.c" />
- <ClCompile Include="SKP_Silk_NLSF_decode.c" />
- <ClCompile Include="SKP_Silk_NLSF_del_dec_quant.c" />
- <ClCompile Include="SKP_Silk_NLSF_encode.c" />
- <ClCompile Include="SKP_Silk_NLSF_unpack.c" />
- <ClCompile Include="SKP_Silk_NLSF_VQ.c" />
- <ClCompile Include="SKP_Silk_NSQ.c" />
- <ClCompile Include="SKP_Silk_NSQ_del_dec.c" />
- <ClCompile Include="SKP_Silk_PLC.c" />
- <ClCompile Include="SKP_Silk_process_NLSFs.c" />
- <ClCompile Include="SKP_Silk_quant_LTP_gains.c" />
- <ClCompile Include="SKP_Silk_shell_coder.c" />
- <ClCompile Include="SKP_Silk_stereo_LR_to_MS.c" />
- <ClCompile Include="SKP_Silk_stereo_MS_to_LR.c" />
- <ClCompile Include="SKP_Silk_tables_gain.c" />
- <ClCompile Include="SKP_Silk_tables_LTP.c" />
- <ClCompile Include="SKP_Silk_tables_NLSF_CB_NB_MB.c" />
- <ClCompile Include="SKP_Silk_tables_NLSF_CB_WB.c" />
- <ClCompile Include="SKP_Silk_tables_other.c" />
- <ClCompile Include="SKP_Silk_tables_pitch_lag.c" />
- <ClCompile Include="SKP_Silk_tables_pulses_per_block.c" />
- <ClCompile Include="SKP_Silk_VAD.c" />
- <ClCompile Include="SKP_Silk_VQ_WMat_EC.c" />
- </ItemGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- <ImportGroup Label="ExtensionTargets">
- </ImportGroup>
-</Project>
\ No newline at end of file
--- a/silk/src_common.vcxproj.filters
+++ /dev/null
@@ -1,183 +1,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup>
- <Filter Include="Source Files">
- <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
- <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
- </Filter>
- <Filter Include="Header Files">
- <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
- <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
- </Filter>
- <Filter Include="Resource Files">
- <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
- <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
- </Filter>
- </ItemGroup>
- <ItemGroup>
- <None Include="ReadMe.txt" />
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="SKP_Silk_define.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="SKP_Silk_main.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="SKP_Silk_PLC.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="SKP_Silk_structs.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="SKP_Silk_tables.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="SKP_Silk_tuning_parameters.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="..\interface\SKP_Silk_control.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="..\interface\SKP_Silk_errors.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="SKP_Silk_CNG.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_code_signs.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_create_init_destroy.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_decode_core.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_decode_frame.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_decode_indices.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_decode_parameters.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_decode_pulses.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_decoder_set_fs.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_enc_API.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_encode_pulses.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_gain_quant.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_interpolate.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_LP_variable_cutoff.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_NLSF2A_stable.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_NSQ.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_NSQ_del_dec.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_PLC.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_shell_coder.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_tables_gain.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_tables_LTP.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_tables_other.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_tables_pitch_lag.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_tables_pulses_per_block.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_VAD.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_dec_API.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_control_audio_bandwidth.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_quant_LTP_gains.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_VQ_WMat_EC.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_encode_indices.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_process_NLSFs.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_HP_variable_cutoff.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_NLSF_encode.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_NLSF_decode.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_tables_NLSF_CB_WB.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_NLSF_unpack.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_tables_NLSF_CB_NB_MB.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_NLSF_VQ.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_NLSF_del_dec_quant.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_control_SNR.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_control_codec.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_check_control_input.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_init_encoder.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_stereo_LR_to_MS.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="SKP_Silk_stereo_MS_to_LR.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- </ItemGroup>
-</Project>
\ No newline at end of file
--- a/silk_headers.txt
+++ b/silk_headers.txt
@@ -9,11 +9,6 @@
silk/SKP_Silk_structs.h
silk/SKP_Silk_tables.h
silk/SKP_Silk_tuning_parameters.h
-silk/SKP_Silk_main_FIX.h
-silk/SKP_Silk_structs_FIX.h
-silk/SKP_Silk_assembler_FLP.h
-silk/SKP_Silk_main_FLP.h
-silk/SKP_Silk_structs_FLP.h
silk/SKP_Silk_Inlines.h
silk/SKP_Silk_MacroCount.h
silk/SKP_Silk_MacroDebug.h
@@ -23,4 +18,8 @@
silk/SKP_Silk_resampler_rom.h
silk/SKP_Silk_resampler_structs.h
silk/SKP_Silk_SigProc_FIX.h
-silk/SKP_Silk_SigProc_FLP.h
+silk/fixed/SKP_Silk_main_FIX.h
+silk/fixed/SKP_Silk_structs_FIX.h
+silk/float/SKP_Silk_main_FLP.h
+silk/float/SKP_Silk_structs_FLP.h
+silk/float/SKP_Silk_SigProc_FLP.h
--- a/silk_sources.mk
+++ b/silk_sources.mk
@@ -11,6 +11,7 @@
silk/SKP_Silk_dec_API.c \
silk/SKP_Silk_enc_API.c \
silk/SKP_Silk_encode_indices.c \
+silk/SKP_Silk_stereo_encode_pred.c \
silk/SKP_Silk_encode_pulses.c \
silk/SKP_Silk_gain_quant.c \
silk/SKP_Silk_interpolate.c \
@@ -92,21 +93,12 @@
silk/SKP_Silk_sigm_Q15.c \
silk/SKP_Silk_sort.c \
silk/SKP_Silk_sum_sqr_shift.c \
-silk/SKP_Silk_autocorrelation_FLP.c \
-silk/SKP_Silk_burg_modified_FLP.c \
-silk/SKP_Silk_bwexpander_FLP.c \
-silk/SKP_Silk_energy_FLP.c \
-silk/SKP_Silk_inner_product_FLP.c \
-silk/SKP_Silk_k2a_FLP.c \
-silk/SKP_Silk_levinsondurbin_FLP.c \
-silk/SKP_Silk_LPC_inv_pred_gain_FLP.c \
-silk/SKP_Silk_pitch_analysis_core_FLP.c \
-silk/SKP_Silk_scale_copy_vector_FLP.c \
-silk/SKP_Silk_scale_vector_FLP.c \
-silk/SKP_Silk_schur_FLP.c \
-silk/SKP_Silk_sort_FLP.c
+silk/SKP_Silk_stereo_decode_pred.c \
+silk/SKP_Silk_stereo_encode_pred.c \
+silk/SKP_Silk_stereo_find_predictor.c
-if FIXED_POINT
+
+ifdef FIXED_POINT
SILK_SOURCES += \
silk/fixed/SKP_Silk_LTP_analysis_filter_FIX.c \
silk/fixed/SKP_Silk_LTP_scale_ctrl_FIX.c \
@@ -143,5 +135,18 @@
silk/float/SKP_Silk_residual_energy_FLP.c \
silk/float/SKP_Silk_solve_LS_FLP.c \
silk/float/SKP_Silk_warped_autocorrelation_FLP.c \
-silk/float/SKP_Silk_wrappers_FLP.c
+silk/float/SKP_Silk_wrappers_FLP.c \
+silk/float/SKP_Silk_autocorrelation_FLP.c \
+silk/float/SKP_Silk_burg_modified_FLP.c \
+silk/float/SKP_Silk_bwexpander_FLP.c \
+silk/float/SKP_Silk_energy_FLP.c \
+silk/float/SKP_Silk_inner_product_FLP.c \
+silk/float/SKP_Silk_k2a_FLP.c \
+silk/float/SKP_Silk_levinsondurbin_FLP.c \
+silk/float/SKP_Silk_LPC_inv_pred_gain_FLP.c \
+silk/float/SKP_Silk_pitch_analysis_core_FLP.c \
+silk/float/SKP_Silk_scale_copy_vector_FLP.c \
+silk/float/SKP_Silk_scale_vector_FLP.c \
+silk/float/SKP_Silk_schur_FLP.c \
+silk/float/SKP_Silk_sort_FLP.c
endif
--- a/src/hybrid.vcxproj
+++ /dev/null
@@ -1,96 +1,0 @@
-<?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">
- <Keyword>Win32Proj</Keyword>
- <ProjectName>opus</ProjectName>
- <ProjectGuid>{219EC965-228A-1824-174D-96449D05F88A}</ProjectGuid>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <UseDebugLibraries>true</UseDebugLibraries>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <UseDebugLibraries>false</UseDebugLibraries>
- </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 Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <LinkIncremental>true</LinkIncremental>
- <TargetName>$(ProjectName)_debug</TargetName>
- <OutDir>$(SolutionDir)\bin\</OutDir>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <LinkIncremental>false</LinkIncremental>
- <OutDir>$(SolutionDir)\bin\</OutDir>
- </PropertyGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <ClCompile>
- <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>../;../silk/interface;../celt/libcelt;../celt/msvc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- <Optimization>Disabled</Optimization>
- </ClCompile>
- <Link>
- <TargetMachine>MachineX86</TargetMachine>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- <AdditionalLibraryDirectories>$(SolutionDir)$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
- <AdditionalDependencies>libcelt.lib;src_common.lib;src_FIX.lib;src_FLP.lib;src_SigProc_FIX.lib;src_SigProc_FLP.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ClCompile>
- <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>../;../silk/interface;../celt/libcelt;../celt/msvc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- </ClCompile>
- <Link>
- <TargetMachine>MachineX86</TargetMachine>
- <GenerateDebugInformation>false</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- <OptimizeReferences>true</OptimizeReferences>
- <AdditionalDependencies>libcelt.lib;src_common.lib;src_FIX.lib;src_FLP.lib;src_SigProc_FIX.lib;src_SigProc_FLP.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <AdditionalLibraryDirectories>$(SolutionDir)$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
- <LinkStatus>false</LinkStatus>
- </Link>
- </ItemDefinitionGroup>
- <ItemGroup>
- <ClCompile Include="opus_decoder.c" />
- <ClCompile Include="opus_encoder.c" />
- <ClCompile Include="test_opus.c" />
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="..\silk\interface\SKP_Silk_SDK_API.h" />
- <ClInclude Include="opus.h" />
- <ClInclude Include="opus_decoder.h" />
- <ClInclude Include="opus_encoder.h" />
- </ItemGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- <ImportGroup Label="ExtensionTargets">
- </ImportGroup>
-</Project>
\ No newline at end of file
--- a/src/hybrid.vcxproj.filters
+++ /dev/null
@@ -1,42 +1,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup>
- <Filter Include="Source Files">
- <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
- <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
- </Filter>
- <Filter Include="Header Files">
- <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
- <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
- </Filter>
- <Filter Include="Resource Files">
- <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
- <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
- </Filter>
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="opus_decoder.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="opus_encoder.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="test_opus.c">
- <Filter>Source Files</Filter>
- </ClCompile>
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="opus_decoder.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="opus_encoder.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="opus.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="..\silk\interface\SKP_Silk_SDK_API.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- </ItemGroup>
-</Project>
\ No newline at end of file
--- /dev/null
+++ b/src/opus.vcxproj
@@ -1,0 +1,97 @@
+<?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">
+ <Keyword>Win32Proj</Keyword>
+ <ProjectName>opus</ProjectName>
+ <ProjectGuid>{219EC965-228A-1824-174D-96449D05F88A}</ProjectGuid>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ </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 Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LinkIncremental>true</LinkIncremental>
+ <TargetName>$(ProjectName)_debug</TargetName>
+ <OutDir>$(SolutionDir)\bin\</OutDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(SolutionDir)\bin\</OutDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>../silk;../libcelt;../win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <Optimization>Disabled</Optimization>
+ </ClCompile>
+ <Link>
+ <TargetMachine>MachineX86</TargetMachine>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <AdditionalLibraryDirectories>$(SolutionDir)$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalDependencies>libcelt.lib;silk_common.lib;silk_fixed.lib;silk_float.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>../silk;../libcelt;../win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <TargetMachine>MachineX86</TargetMachine>
+ <GenerateDebugInformation>false</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <AdditionalDependencies>libcelt.lib;silk_common.lib;silk_fixed.lib;silk_float.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalLibraryDirectories>$(SolutionDir)$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <LinkStatus>false</LinkStatus>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="opus_decoder.c" />
+ <ClCompile Include="opus_encoder.c" />
+ <ClCompile Include="test_opus.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\silk\interface\SKP_Silk_SDK_API.h" />
+ <ClInclude Include="..\win32\config.h" />
+ <ClInclude Include="opus.h" />
+ <ClInclude Include="opus_decoder.h" />
+ <ClInclude Include="opus_encoder.h" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file
--- /dev/null
+++ b/src/opus.vcxproj.filters
@@ -1,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="opus_decoder.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="opus_encoder.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="test_opus.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="opus_decoder.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="opus_encoder.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="opus.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\silk\interface\SKP_Silk_SDK_API.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\win32\config.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file
--- a/win32/config.h
+++ b/win32/config.h
@@ -1,11 +1,12 @@
#ifndef CONFIG_H
#define CONFIG_H
-#define CELT_BUILD 1
+#define CELT_BUILD 1
+
#define restrict
#define inline __inline
-#define USE_ALLOCA 1
+#define USE_ALLOCA 1
/* Comment out the next line for floating-point code */
//#define FIXED_POINT 1