bring the code up to the release tarball

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@17026 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Brian West
2010-03-17 16:16:27 +00:00
parent 92eef1edf7
commit 5bb9d2062e
151 changed files with 26639 additions and 28320 deletions

View File

@@ -1,7 +1,7 @@
#
# Makefile for Silk SDK
#
# Copyright (c) 2009, Skype Limited
# Copyright (c) 2010, Skype Limited
# All rights reserved.
#
@@ -17,40 +17,29 @@ LIBSUFFIX = .a
OBJSUFFIX = .o
CC = $(TOOLCHAIN_PREFIX)gcc$(TOOLCHAIN_SUFFIX)
CXX = $(TOOLCHAIN_PREFIX)g++$(TOOLCHAIN_SUFFIX)
AR = $(TOOLCHAIN_PREFIX)ar
RANLIB = $(TOOLCHAIN_PREFIX)ranlib
CP = $(TOOLCHAIN_PREFIX)cp
cppflags-from-defines = $(addprefix -D,$(1))
cppflags-from-includes = $(addprefix -I,$(1))
cflags-from-defines = $(addprefix -D,$(1))
cflags-from-includes = $(addprefix -I,$(1))
ldflags-from-ldlibdirs = $(addprefix -L,$(1))
ldlibs-from-libs = $(addprefix -l,$(1))
CFLAGS += -Wall -enable-threads -O3 -fPIC
CFLAGS += -Wall -enable-threads -O3
CFLAGS += $(call cppflags-from-defines,$(CDEFINES))
CFLAGS += $(call cppflags-from-includes,$(CINCLUDES))
CFLAGS += $(call cflags-from-defines,$(CDEFINES))
CFLAGS += $(call cflags-from-includes,$(CINCLUDES))
LDFLAGS += $(call ldflags-from-ldlibdirs,$(LDLIBDIRS))
LDLIBS += $(call ldlibs-from-libs,$(LIBS))
COMPILE.c.cmdline = $(CC) -c $(CFLAGS) -o $@ $<
COMPILE.cpp.cmdline = $(CXX) -c $(CFLAGS) -o $@ $<
LINK.o = $(CXX) $(LDPREFLAGS) $(LDFLAGS)
LINK.o.cmdline = $(LINK.o) $^ $(LDLIBS) -o $@$(EXESUFFIX)
LINK.o.cmdline = $(LINK.o) -lm $^ $(LDLIBS) -o $@$(EXESUFFIX)
ARCHIVE.cmdline = $(AR) $(ARFLAGS) $@ $^ && $(RANLIB) $@
%$(OBJSUFFIX):%.c
$(COMPILE.c.cmdline)
%$(OBJSUFFIX):%.cpp
$(COMPILE.cpp.cmdline)
# Directives
CINCLUDES += interface src test
@@ -86,7 +75,7 @@ LDLIBDIRS = ./
# Rules
default: all
all: $(TARGET) encoder decoder #signalcompare
all: $(TARGET) encoder decoder signalcompare
lib: $(TARGET)
@@ -106,3 +95,4 @@ clean:
$(RM) $(TARGET)* $(OBJS) $(ENCODER_OBJS) $(DECODER_OBJS) \
$(SIGNALCMP_OBJS) $(TEST_OBJS) \
encoder$(EXESUFFIX) decoder$(EXESUFFIX) signalcompare$(EXESUFFIX)

44
libs/silk/Silk_SDK.sln Normal file
View File

@@ -0,0 +1,44 @@

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Silk_FIX", "src\Silk_FIX.vcproj", "{56B91D01-9150-4BBF-AFA1-5B68AB991B76}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Dec_SDK", "test\Dec_SDK.vcproj", "{82685D7F-0589-42BD-877C-31A952D53A8E}"
ProjectSection(ProjectDependencies) = postProject
{56B91D01-9150-4BBF-AFA1-5B68AB991B76} = {56B91D01-9150-4BBF-AFA1-5B68AB991B76}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SignalCompare", "test\SignalCompare.vcproj", "{7FE8F544-9175-40C3-A187-7F15CE9A75D8}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Enc_SDK", "test\Enc_SDK.vcproj", "{6D97A8EF-5724-4D85-8BF4-C583714BBA78}"
ProjectSection(ProjectDependencies) = postProject
{56B91D01-9150-4BBF-AFA1-5B68AB991B76} = {56B91D01-9150-4BBF-AFA1-5B68AB991B76}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{56B91D01-9150-4BBF-AFA1-5B68AB991B76}.Debug|Win32.ActiveCfg = Debug|Win32
{56B91D01-9150-4BBF-AFA1-5B68AB991B76}.Debug|Win32.Build.0 = Debug|Win32
{56B91D01-9150-4BBF-AFA1-5B68AB991B76}.Release|Win32.ActiveCfg = Release|Win32
{56B91D01-9150-4BBF-AFA1-5B68AB991B76}.Release|Win32.Build.0 = Release|Win32
{82685D7F-0589-42BD-877C-31A952D53A8E}.Debug|Win32.ActiveCfg = Debug|Win32
{82685D7F-0589-42BD-877C-31A952D53A8E}.Debug|Win32.Build.0 = Debug|Win32
{82685D7F-0589-42BD-877C-31A952D53A8E}.Release|Win32.ActiveCfg = Release|Win32
{82685D7F-0589-42BD-877C-31A952D53A8E}.Release|Win32.Build.0 = Release|Win32
{7FE8F544-9175-40C3-A187-7F15CE9A75D8}.Debug|Win32.ActiveCfg = Debug|Win32
{7FE8F544-9175-40C3-A187-7F15CE9A75D8}.Debug|Win32.Build.0 = Debug|Win32
{7FE8F544-9175-40C3-A187-7F15CE9A75D8}.Release|Win32.ActiveCfg = Release|Win32
{7FE8F544-9175-40C3-A187-7F15CE9A75D8}.Release|Win32.Build.0 = Release|Win32
{6D97A8EF-5724-4D85-8BF4-C583714BBA78}.Debug|Win32.ActiveCfg = Debug|Win32
{6D97A8EF-5724-4D85-8BF4-C583714BBA78}.Debug|Win32.Build.0 = Debug|Win32
{6D97A8EF-5724-4D85-8BF4-C583714BBA78}.Release|Win32.ActiveCfg = Release|Win32
{6D97A8EF-5724-4D85-8BF4-C583714BBA78}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -26,11 +23,6 @@ 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_SDK_API_H
@@ -47,14 +39,14 @@ extern "C"
#define SILK_MAX_FRAMES_PER_PACKET 5
/* Struct for TOC (Type Of Content) */
/* Struct for TOC (Table Of Contents) */
typedef struct {
SKP_int framesInPacket; /* Number of 20 ms frames in packet */
SKP_int fs_kHz; /* Sampling frequency in packet */
SKP_int inbandLBRR; /* Does packet include LBRR information */
SKP_int inbandLBRR; /* Does packet contain LBRR information */
SKP_int corrupt; /* Packet is corrupt */
SKP_int vadFlags[ SILK_MAX_FRAMES_PER_PACKET ]; /* VAD flags in packet */
SKP_int sigtypeFlags[ SILK_MAX_FRAMES_PER_PACKET ]; /* Signal types in packet */
SKP_int vadFlags[ SILK_MAX_FRAMES_PER_PACKET ]; /* VAD flag for each frame in packet */
SKP_int sigtypeFlags[ SILK_MAX_FRAMES_PER_PACKET ]; /* Signal type for each frame in packet */
} SKP_Silk_TOC_struct;
/****************************************/
@@ -79,11 +71,6 @@ SKP_int SKP_Silk_SDK_InitEncoder(
/***************************************/
/* Read control structure from encoder */
/***************************************/
SKP_int SKP_Silk_SDK_QueryEncoder(
const void *encState, /* I: State */
SKP_SILK_SDK_EncControlStruct *encStatus /* O: Encoder Status */
@@ -94,7 +81,7 @@ SKP_int SKP_Silk_SDK_QueryEncoder(
/**************************/
SKP_int SKP_Silk_SDK_Encode(
void *encState, /* I/O: State */
const SKP_SILK_SDK_EncControlStruct *encStatus, /* I: Control Status */
const SKP_SILK_SDK_EncControlStruct *encControl, /* I: Control status */
const SKP_int16 *samplesIn, /* I: Speech sample input vector */
SKP_int nSamplesIn, /* I: Number of samples in input vector */
SKP_uint8 *outData, /* O: Encoded output vector */
@@ -132,30 +119,25 @@ SKP_int SKP_Silk_SDK_Decode(
SKP_int16 *nSamplesOut /* I/O: Number of samples (vector/decoded) */
);
/***************************************************************/
/* Find Low Bit Rate Redundancy (LBRR) information in a packet */
/***************************************************************/
void SKP_Silk_SDK_search_for_LBRR(
void *decState, /* I/O: State Only used to update statistics */
const SKP_uint8 *indata, /* I: Encoded input vector */
void *decState, /* I: Decoder state, to select bitstream version only */
const SKP_uint8 *inData, /* I: Encoded input vector */
const SKP_int16 nBytesIn, /* I: Number of input Bytes */
SKP_int lost_offset, /* I: Offset from lost packet */
SKP_uint8 *LBRRdata, /* O: FEC payload */
SKP_int16 *nLBRRBytes /* O: Number of FEC Bytes */
SKP_uint8 *LBRRData, /* O: LBRR payload */
SKP_int16 *nLBRRBytes /* O: Number of LBRR Bytes */
);
/************************************/
/* Get type of content for a packet */
/************************************/
void SKP_Silk_SDK_get_TOC(
void *decState, /* I/O: State Only used to select bitstream version */
const SKP_uint8 *indata, /* I: Encoded input vector */
const SKP_int16 nBytesIn, /* I: Number of input Bytes */
void *decState, /* I: Decoder state, to select bitstream version only */
const SKP_uint8 *inData, /* I: Encoded input vector */
const SKP_int16 nBytesIn, /* I: Number of input bytes */
SKP_Silk_TOC_struct *Silk_TOC /* O: Type of content */
);
@@ -170,6 +152,3 @@ const char *SKP_Silk_SDK_get_version();
#endif
#endif

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -26,12 +23,6 @@ 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_CONTROL_H
@@ -49,13 +40,13 @@ extern "C"
/***********************************************/
typedef struct {
/* I: Sampling rate in Hertz; 8000/12000/16000/24000 */
SKP_int sampleRate;
SKP_int32 sampleRate;
/* I: Number of samples per packet; must be equivalent of 20, 40, 60, 80 or 100 ms */
SKP_int packetSize;
/* I: Bitrate during active speech in bits/second; internally limited */
SKP_int bitRate;
SKP_int32 bitRate;
/* I: Uplink Packet loss in pct (0...100) */
SKP_int packetLossPercentage;
@@ -64,10 +55,10 @@ typedef struct {
SKP_int complexity;
/* I: Flag to enable in-band Forward Error Correction (FEC); 0/1 */
SKP_int useInBandFec;
SKP_int useInBandFEC;
/* I: Flag to enable Discontinous Transmission; 0/1 */
SKP_int useDtx;
SKP_int useDTX;
} SKP_SILK_SDK_EncControlStruct;
/**************************************************************************/
@@ -75,24 +66,19 @@ typedef struct {
/**************************************************************************/
typedef struct {
/* I: Sampling rate in Hertz; 8000/12000/16000/24000 */
SKP_int sampleRate;
SKP_int32 sampleRate;
/* O: Number of samples per frame */
SKP_int frameSize;
/* O: Frames per packet 1, 2, 3, 4, 5 */
SKP_int framesPerPacket;
/* O: Flag to indicate that the decoder has remaining payloads internally */
SKP_int internalDecoderFrames;
SKP_int moreInternalDecoderFrames;
/* O: Distance between main payload and redundant payload in packets */
SKP_int inBandFecOffset;
SKP_int inBandFECOffset;
} SKP_SILK_SDK_DecControlStruct;
#ifdef __cplusplus
@@ -100,6 +86,3 @@ typedef struct {
#endif
#endif

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -26,12 +23,6 @@ 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_ERRORS_H
@@ -51,10 +42,12 @@ extern "C"
/* Encoder error messages */
/**************************/
/* Input length is not a multiplum of 10 ms, or length is longer than the packet length */
/* Input length is not a multiplum of 10 ms,
or length is longer than the packet length */
#define SKP_SILK_ENC_INPUT_INVALID_NO_OF_SAMPLES -1
/* Sampling frequency not 8000, 12000, 16000 or 24000 Hertz */
/* Sampling frequency not 8000, 12000, 16000
or 24000 Hertz */
#define SKP_SILK_ENC_FS_NOT_SUPPORTED -2
/* Packet size not 20, 40, 60, 80 or 100 ms */
@@ -80,14 +73,10 @@ extern "C"
/**************************/
/* Decoder error messages */
/**************************/
/* Output sampling frequency lower than internal decoded sampling frequency */
/* Output sampling frequency lower than internal
decoded sampling frequency */
#define SKP_SILK_DEC_WRONG_SAMPLING_FREQUENCY -10
/* Payload size exceeded the maximum allowed 1024 bytes */
@@ -102,5 +91,3 @@ extern "C"
#endif
#endif

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -9,11 +6,6 @@ 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
@@ -31,7 +23,6 @@ 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_API_TYPDEF_H_
@@ -62,11 +53,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#if SKP_USE_DOUBLE_PRECISION_FLOATS
# define SKP_float double
# define SKP_float_MAX DBL_MAX
#else
# define SKP_float float
@@ -110,7 +96,4 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# define SKP_assert(COND)
#endif
#endif /* _SKP_SILK_API_TYPDEF_H_ */
#endif

80
libs/silk/readme.txt Normal file
View File

@@ -0,0 +1,80 @@
************************************************************************
Fixed Point SILK SDK 1.0.2 beta source code package
Copyright 2010 (c), Skype Limited
https://developer.skype.com/silk/
************************************************************************
Date: 09/03/2010 (Format: DD/MM/YYYY)
I. Description
This package contains files for compiling and testing the fixed
point SILK SDK library. The following is included in this package:
o Source code for the fixed point SILK SDK library
o Source code for creating encoder and decoder executables
o Test vectors
o Comparison tool
o Microsoft Visual Studio solution and project files
o Makefile for GNU C-compiler (GCC)
II. Files and Folders
o doc/ - contains more information about the SILK SDK
o interface/ - contains API header files
o src/ - contains all SILK SDK library source files
o test/ - contains source files for testing the SILK SDK
o test_vectors/ - contains test vectors
o Makefile - Makefile for compiling with GCC
o readme.txt - this file
o Silk_SDK.sln - Visual Studio solution for all SILK SDK code
III. How to use the Makefile
1. How to clean and compile the SILK SDK library:
make clean lib
2. How to compile an encoder executable:
make encoder
3. How to compile a decoder executable:
make decoder
4. How to compile the comparison tool:
make signalcompare
5. How to clean and compile all of the above:
make clean all
6. How to use the comparison tool:
See 'How to use the test vectors.txt' in the test_vectors folder.
IV. History
Version 1.0.2 - Updated with various bugfixes and improvements
Version 1.0.1 - First beta source code release
V. Compatibility
This package has been tested under the following platforms:
Windows XP Home and Professional
Windows Vista, 32-bit version
Mac OS X Version 10.5.8
Ubuntu Linux 9.10, 64-bit version
VI. Known Issues
None
VII. Additional Resources
For more information, visit the SILK SDK web site at:
<https://developer.skype.com/silk/>

View File

@@ -1,10 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -29,7 +23,6 @@ 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.
***********************************************************************/
/* Conversion between prediction filter coefficients and NLSFs */
@@ -51,11 +44,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/* Helper function for A2NLSF(..) */
/* Transforms polynomials from cos(n*f) to cos(f)^n */
SKP_INLINE void SKP_Silk_A2NLSF_trans_poly(
SKP_int32 *p, /* I/O Polynomial */
const SKP_int dd /* I Polynomial order (= filter order / 2 ) */
)
@@ -104,11 +92,6 @@ SKP_INLINE void SKP_Silk_A2NLSF_init(
for( k = 0; k < dd; k++ ) {
#if( QPoly < 16 )
P[ k ] = SKP_RSHIFT_ROUND( -a_Q16[ dd - k - 1 ] - a_Q16[ dd + k ], 16 - QPoly ); /* QPoly */
Q[ k ] = SKP_RSHIFT_ROUND( -a_Q16[ dd - k - 1 ] + a_Q16[ dd + k ], 16 - QPoly ); /* QPoly */
#elif( Qpoly == 16 )
P[ k ] = -a_Q16[ dd - k - 1 ] - a_Q16[ dd + k ]; // QPoly
@@ -157,11 +140,6 @@ void SKP_Silk_A2NLSF(
SKP_Silk_A2NLSF_init( a_Q16, P, Q, dd );
/* Find roots, alternating between P and Q */
p = P; /* Pointer to polynomial */
@@ -210,11 +188,6 @@ void SKP_Silk_A2NLSF(
yhi = ymid;
} else {
/* Increase frequency */
xlo = xmid;
ylo = ymid;
#if OVERSAMPLE_COSINE_TABLE
@@ -263,11 +236,6 @@ void SKP_Silk_A2NLSF(
xlo = SKP_Silk_LSFCosTab_FIX_Q12[ k - 1 ]; // Q12
#endif
ylo = SKP_LSHIFT( 1 - ( root_ix & 2 ), 12 );
} else {
/* Increment loop counter */
k++;
@@ -310,5 +278,3 @@ void SKP_Silk_A2NLSF(
}
}
}

View File

@@ -1,13 +1,5 @@
/***********************************************************************
Copyright (c) 2006-2010, 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:
@@ -31,16 +23,15 @@ 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_FIX.h"
/* Generates excitation for CNG LPC synthesis */
SKP_INLINE void SKP_Silk_cng_exe(
SKP_INLINE void SKP_Silk_CNG_exc(
SKP_int16 residual[], /* O CNG residual signal Q0 */
SKP_int32 exc_buf_Q10[], /* I Random samples buffer Q10 */
SKP_int32 Gain_Q16, /* I Gain to aply */
SKP_int32 Gain_Q16, /* I Gain to apply */
SKP_int length, /* I Length */
SKP_int32 *rand_seed /* I/O Seed to random index generator */
)
@@ -56,11 +47,6 @@ SKP_INLINE void SKP_Silk_cng_exe(
seed = *rand_seed;
for( i = 0; i < length; i++ ) {
seed = SKP_RAND( seed );
idx = ( SKP_int )( SKP_RSHIFT( seed, 24 ) & exc_mask );
SKP_assert( idx >= 0 );
SKP_assert( idx <= CNG_BUF_MASK_MAX );
@@ -109,11 +95,6 @@ void SKP_Silk_CNG(
if( psDec->lossCnt == 0 && psDec->vadFlag == NO_VOICE_ACTIVITY ) {
/* Update CNG parameters */
/* Smoothing of LSF's */
for( i = 0; i < psDec->LPC_order; i++ ) {
psCNG->CNG_smth_NLSF_Q15[ i ] += SKP_SMULWB( psDec->prevNLSF_Q15[ i ] - psCNG->CNG_smth_NLSF_Q15[ i ], CNG_NLSF_SMTH_Q16 );
@@ -141,7 +122,7 @@ void SKP_Silk_CNG(
if( psDec->lossCnt ) {//|| psDec->vadFlag == NO_VOICE_ACTIVITY ) {
/* Generate CNG excitation */
SKP_Silk_cng_exe( CNG_sig, psCNG->CNG_exc_buf_Q10,
SKP_Silk_CNG_exc( CNG_sig, psCNG->CNG_exc_buf_Q10,
psCNG->CNG_smth_Gain_Q16, length, &psCNG->rand_seed );
/* Convert CNG NLSF to filter representation */
@@ -162,14 +143,7 @@ void SKP_Silk_CNG(
tmp_32 = signal[ i ] + CNG_sig[ i ];
signal[ i ] = SKP_SAT16( tmp_32 );
}
} else {
SKP_memset( psCNG->CNG_synth_state, 0, psDec->LPC_order * sizeof( SKP_int32 ) );
}
}

View File

@@ -1,10 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -29,7 +23,6 @@ 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_FIX.h"
@@ -52,10 +45,6 @@ void SKP_Silk_HP_variable_cutoff_FIX(
SKP_int32 Fc_Q19, r_Q28, r_Q22;
SKP_int32 pitch_freq_Hz_Q16, pitch_freq_log_Q7, delta_freq_Q7;
/*********************************************/
/* Estimate Low End of Pitch Frequency Range */
/*********************************************/
@@ -105,10 +94,6 @@ void SKP_Silk_HP_variable_cutoff_FIX(
SKP_assert( Fc_Q19 >= 3704 );
SKP_assert( Fc_Q19 <= 27787 );
r_Q28 = ( 1 << 28 ) - SKP_MUL( 471, Fc_Q19 ); // 471_Q9 = 0.92_Q0, range: 255347779 to 266690872, 27-28 bits
SKP_assert( r_Q28 >= 255347779 );
SKP_assert( r_Q28 <= 266690872 );
@@ -131,5 +116,3 @@ void SKP_Silk_HP_variable_cutoff_FIX(
}
#endif // HIGH_PASS_INPUT

View File

@@ -1,10 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -29,7 +23,6 @@ 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.
***********************************************************************/
/*! \file SKP_Silk_Inlines.h
@@ -51,11 +44,6 @@ SKP_INLINE SKP_int32 SKP_Silk_CLZ64(SKP_int64 in)
in_upper = (SKP_int32)SKP_RSHIFT64(in, 32);
if (in_upper == 0) {
/* Search in the lower 32 bits */
return 32 + SKP_Silk_CLZ32( (SKP_int32) in );
} else {
@@ -105,10 +93,6 @@ SKP_INLINE SKP_int32 SKP_Silk_SQRT_APPROX(SKP_int32 x)
/* increment using fractional part of input */
y = SKP_SMLAWB(y, y, SKP_SMULBB(213, frac_Q7));
return y;
}
@@ -158,10 +142,6 @@ SKP_INLINE SKP_int32 SKP_DIV32_varQ( /* O returns a good approximation of
b_headrm = SKP_Silk_CLZ32( SKP_abs(b32) ) - 1;
b32_nrm = SKP_LSHIFT(b32, b_headrm); /* Q: b_headrm */
/* Inverse of b32, with 14 bits of precision */
b32_inv = SKP_DIV32_16( SKP_int32_MAX >> 2, SKP_RSHIFT(b32_nrm, 16) ); /* Q: 29 + 16 - b_headrm */
@@ -210,11 +190,6 @@ SKP_INLINE SKP_int32 SKP_INVERSE32_varQ( /* O returns a good approximation
/* First approximation */
result = SKP_LSHIFT(b32_inv, 16); /* Q: 61 - b_headrm */
/* Compute residual by subtracting product of denominator and first approximation from one */
err_Q32 = SKP_LSHIFT_ovflw( -SKP_SMULWB(b32_nrm, b32_inv), 3 ); /* Q32 */
@@ -263,11 +238,6 @@ SKP_INLINE SKP_int32 SKP_Silk_SIN_APPROX_Q24( /* O returns approximate
}
if( x < 1100 ) {
/* Special case: high accuracy */
return SKP_SMLAWB( 1 << 24, SKP_MUL( x, x ), -5053 );
}
x = SKP_SMULWB( SKP_LSHIFT( x, 8 ), x ); /* contains x^2 in Q20 */
@@ -308,5 +278,3 @@ SKP_INLINE SKP_int32 SKP_Silk_COS_APPROX_Q24( /* O returns approximate
#endif
#endif //_SKP_SILK_FIX_INLINES_H_

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -26,7 +23,6 @@ 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"
@@ -42,5 +38,3 @@ void SKP_Silk_LBRR_reset(
psEncC->LBRR_buffer[ i ].usage = SKP_SILK_NO_LBRR;
}
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -26,11 +23,6 @@ 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.
***********************************************************************/
/* *
@@ -42,7 +34,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* Copyright 2008 (c), Skype Limited *
* */
#include "SKP_Silk_SigProc_FIX.h"
#define QA 16
#define A_LIMIT 65520
@@ -80,10 +71,6 @@ SKP_int SKP_Silk_LPC_inverse_pred_gain( /* O: Returns 1 if unstable, oth
SKP_assert( rc_mult1_Q30 > ( 1 << 15 ) ); /* reduce A_LIMIT if fails */
SKP_assert( rc_mult1_Q30 < ( 1 << 30 ) );
/* rc_mult2_Q16 range: [ 2^16 : SKP_int32_MAX ] */
rc_mult2_Q16 = SKP_INVERSE32_varQ( rc_mult1_Q30, 46 ); /* 16 = 46 - 30 */
@@ -132,11 +119,6 @@ SKP_int SKP_Silk_LPC_inverse_pred_gain_Q13( /* O: Returns 1 if unstable, oth
const SKP_int16 *A_Q13, /* I: Prediction coefficients, Q13 [order] */
const SKP_int order /* I: Prediction order */
)
{
SKP_int k, n, headrm;
SKP_int32 rc_Q31, rc_mult1_Q30, rc_mult2_Q16;
@@ -186,10 +168,6 @@ SKP_int SKP_Silk_LPC_inverse_pred_gain_Q13( /* O: Returns 1 if unstable, oth
}
}
/* Check for stability */
if( ( Anew_QA[ 0 ] > A_LIMIT ) || ( Anew_QA[ 0 ] < -A_LIMIT ) ) {
return 1;
@@ -209,5 +187,3 @@ SKP_int SKP_Silk_LPC_inverse_pred_gain_Q13( /* O: Returns 1 if unstable, oth
return 0;
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -24,14 +21,8 @@ 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"
@@ -77,11 +68,6 @@ void SKP_Silk_LPC_stabilize(
sc_Q16 = SKP_LSHIFT( SKP_SMULWB( sc_Q16, 32604 ), 1 ); // 0.995 in Q16
SKP_Silk_bwexpander_32( a_Q16, L, sc_Q16 );
} else {
break;
}
}
@@ -130,11 +116,6 @@ void SKP_Silk_LPC_fit(
if( maxabs >= SKP_int16_MAX ) {
/* Reduce magnitude of prediction coefficients */
sc_Q16 = 65470 - SKP_DIV32( SKP_MUL( 65470 >> 2, maxabs - SKP_int16_MAX ),
SKP_RSHIFT32( SKP_MUL( maxabs, idx + 1), 2 ) );
SKP_Silk_bwexpander_32( a_Q24, L, sc_Q16 );
} else {
@@ -149,5 +130,3 @@ void SKP_Silk_LPC_fit(
a_QQ[ i ] = (SKP_int16)SKP_RSHIFT_ROUND( a_Q24[ i ], rshift );
}
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -26,14 +23,8 @@ 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_synthesis_filter.c *
* Coefficients are in Q12 *
@@ -82,11 +73,6 @@ void SKP_Silk_LPC_synthesis_filter(
out32_Q10 = SKP_SMLAWB( out32_Q10, SA, Atmp );
out32_Q10 = SKP_SMLAWT( out32_Q10, SB, Atmp );
SA = S[Order - 2 - idx];
S[Order - 2 - idx] = SB;
}
@@ -110,5 +96,3 @@ void SKP_Silk_LPC_synthesis_filter(
S[Order - 1] = SKP_LSHIFT_SAT32( out32_Q10, 4 );
}
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -20,18 +17,12 @@ 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.
***********************************************************************/
/* *
@@ -73,11 +64,6 @@ void SKP_Silk_LPC_synthesis_order16(const SKP_int16 *in, /* I: excita
S[14] = SA;
out32_Q10 = SKP_SMULWB( SA, Atmp );
out32_Q10 = SKP_SMLAWT_ovflw( out32_Q10, SB, Atmp );
SA = S[13];
S[13] = SB;
@@ -126,11 +112,6 @@ void SKP_Silk_LPC_synthesis_order16(const SKP_int16 *in, /* I: excita
SB = S[2];
S[2] = SA;
out32_Q10 = SKP_SMLAWB_ovflw( out32_Q10, SA, Atmp );
out32_Q10 = SKP_SMLAWT_ovflw( out32_Q10, SB, Atmp );
SA = S[1];
S[1] = SB;
@@ -158,5 +139,3 @@ void SKP_Silk_LPC_synthesis_order16(const SKP_int16 *in, /* I: excita
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -26,17 +23,11 @@ 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.
***********************************************************************/
/*
Elliptic/Cauer filters designed with 0.1 dB passband ripple,
80 dB minimum stopband attenuation, and
[0.95 : 0.15 : 0.35] normalized cut off frequencies.
@@ -85,11 +76,6 @@ SKP_INLINE void SKP_Silk_LP_interpolate_filter_taps(
for( na = 0; na < TRANSITION_NA; na++ ) {
A_Q28[ na ] = SKP_RSHIFT(
SKP_Silk_Transition_LP_A_Q28[ ind ][ na ] +
SKP_Silk_Transition_LP_A_Q28[ ind + 1 ][ na ],
1 );
}
@@ -138,11 +124,6 @@ void SKP_Silk_LP_variable_cutoff(
SKP_assert( psLP->transition_frame_no >= 0 );
SKP_assert( ( ( ( psLP->transition_frame_no <= TRANSITION_FRAMES_DOWN ) && ( psLP->mode == 0 ) ) ||
( ( psLP->transition_frame_no <= TRANSITION_FRAMES_UP ) && ( psLP->mode == 1 ) ) ) );
/* Interpolate filter coefficients if needed */
@@ -191,11 +172,6 @@ void SKP_Silk_LP_variable_cutoff(
/* Increment transition frame number for next frame */
psLP->transition_frame_no++;
} else if( psLP->transition_frame_no == TRANSITION_FRAMES_UP ) {
/* End of transition phase */
SKP_Silk_LP_interpolate_filter_taps( B_Q28, A_Q28, 0, 0 );
@@ -213,5 +189,3 @@ void SKP_Silk_LP_variable_cutoff(
}
}
#endif

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -16,11 +13,6 @@ 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
@@ -31,7 +23,6 @@ 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_FIX.h"
@@ -69,13 +60,6 @@ const SKP_int SKP_Silk_LSFCosTab_FIX_Q12[LSF_COS_TAB_SZ_FIX + 1] = {
-7568, -7644, -7714, -7778,
-7840, -7896, -7946, -7994,
-8034, -8072, -8104, -8130,
-8152, -8170, -8182, -8190,
-8192
};

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -26,7 +23,6 @@ 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_FIX.h"
@@ -40,11 +36,6 @@ void SKP_Silk_LTP_analysis_filter_FIX(
const SKP_int Qxx, /* I: Inverse quantization gains Q domain */
const SKP_int subfr_length, /* I: Length of each subframe */
const SKP_int pre_length /* I: Length of the preceeding samples starting at &x[0] for each subframe */
)
{
const SKP_int16 *x_ptr, *x_lag_ptr;
@@ -92,9 +83,3 @@ void SKP_Silk_LTP_analysis_filter_FIX(
}
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -26,7 +23,6 @@ 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_FIX.h"
@@ -45,11 +41,6 @@ void SKP_Silk_LTP_scale_ctrl_FIX(
SKP_Silk_encoder_control_FIX *psEncCtrl /* I/O encoder control FIX */
)
{
SKP_int round_loss, frames_per_packet;
SKP_int g_out_Q5, g_limit_Q15, thrld1_Q15, thrld2_Q15;
@@ -88,5 +79,3 @@ void SKP_Silk_LTP_scale_ctrl_FIX(
}
psEncCtrl->LTP_scale_Q14 = SKP_Silk_LTPScales_table_Q14[ psEncCtrl->sCmn.LTP_scaleIndex ];
}

View File

@@ -1,15 +1,7 @@
/***********************************************************************
Copyright (c) 2006-2010, 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.
@@ -31,7 +23,6 @@ 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.
***********************************************************************/
/* *
@@ -58,11 +49,6 @@ void SKP_Silk_MA(
SKP_int32 out32;
for( k = 0; k < len; k++ ) {
in16 = in[ k ];
out32 = SKP_SMLABB( S[ 0 ], in16, B[ 0 ] );
out32 = SKP_RSHIFT_ROUND( out32, 13 );
@@ -111,11 +97,6 @@ void SKP_Silk_MA_Prediction(
S[ order - 2 ] = SKP_SMLABB_ovflw( S[ order - 1 ], in16, B32 );
S[ order - 1 ] = SKP_SMULBT( in16, B32 );
/* Limit */
out[ k ] = (SKP_int16)SKP_SAT16( out32 );
}
@@ -164,11 +145,6 @@ void SKP_Silk_MA_Prediction_Q13(
for( d = 0; d < order - 2; d += 2 ) {
B32 = *( (SKP_int32*)&B[ d ] ); /* read two coefficients at once */
S[ d ] = SKP_SMLABB( S[ d + 1 ], in16, B32 );
S[ d + 1 ] = SKP_SMLABT( S[ d + 2 ], in16, B32 );
}
B32 = *( (SKP_int32*)&B[ d ] ); /* read two coefficients at once */
@@ -218,10 +194,6 @@ void SKP_Silk_LPC_analysis_filter(
B_align_Q12[ k ] = ( ( (SKP_int32)B[ idx ] ) & 0x0000ffff ) | SKP_LSHIFT( (SKP_int32)B[ idx + 1 ], 16 );
}
/* S[] values are in Q0 */
for( k = 0; k < len; k++ ) {
SA = S[ 0 ];
@@ -258,5 +230,3 @@ void SKP_Silk_LPC_analysis_filter(
S[ 0 ] = in[ k ];
}
}

View File

@@ -1,10 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -29,7 +23,6 @@ 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.
***********************************************************************/
/* conversion between prediction filter coefficients and LSFs */
@@ -51,11 +44,6 @@ SKP_INLINE void SKP_Silk_NLSF2A_find_poly(
SKP_int32 ftmp;
out[0] = SKP_LSHIFT( 1, 20 );
out[1] = -cLSF[0];
for( k = 1; k < dd; k++ ) {
ftmp = cLSF[2*k]; // Q20
@@ -104,11 +92,6 @@ void SKP_Silk_NLSF2A(
cos_val = SKP_Silk_LSFCosTab_FIX_Q12[ f_int ]; /* Q12 */
delta = SKP_Silk_LSFCosTab_FIX_Q12[ f_int + 1 ] - cos_val; /* Q12, with a range of 0..200 */
/* Linear interpolation */
cos_LSF_Q20[k] = SKP_LSHIFT( cos_val, 8 ) + SKP_MUL( delta, f_frac ); /* Q20 */
}
@@ -157,11 +140,6 @@ void SKP_Silk_NLSF2A(
SKP_assert(0);
for( k = 0; k < d; k++ ) {
a_int32[k] = SKP_SAT16( a_int32[k] );
}
}
@@ -170,5 +148,3 @@ void SKP_Silk_NLSF2A(
a[k] = (SKP_int16)a_int32[k];
}
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -26,7 +23,6 @@ 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"
@@ -35,11 +31,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
void SKP_Silk_NLSF2A_stable(
SKP_int16 pAR_Q12[ MAX_LPC_ORDER ], /* O Stabilized AR coefs [LPC_order] */
const SKP_int pNLSF[ MAX_LPC_ORDER ], /* I NLSF vector [LPC_order] */
const SKP_int LPC_order /* I LPC/LSF order */
)
{
@@ -64,5 +55,3 @@ void SKP_Silk_NLSF2A_stable(
}
}
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -19,11 +16,6 @@ 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
@@ -31,7 +23,6 @@ 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"
@@ -72,11 +63,6 @@ void SKP_Silk_NLSF_MSVQ_decode(
pNLSF_Q15[ 1 ] += pCB_element[ 1 ];
pNLSF_Q15[ 2 ] += pCB_element[ 2 ];
pNLSF_Q15[ 3 ] += pCB_element[ 3 ];
pNLSF_Q15[ 4 ] += pCB_element[ 4 ];
pNLSF_Q15[ 5 ] += pCB_element[ 5 ];
pNLSF_Q15[ 6 ] += pCB_element[ 6 ];
@@ -103,5 +89,3 @@ void SKP_Silk_NLSF_MSVQ_decode(
/* NLSF stabilization */
SKP_Silk_NLSF_stabilize( pNLSF_Q15, psNLSF_CB->NDeltaMin_Q15, LPC_order );
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -17,11 +14,6 @@ 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,
@@ -31,7 +23,6 @@ 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_FIX.h"
@@ -40,16 +31,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/* NLSF vector encoder */
/***********************/
void SKP_Silk_NLSF_MSVQ_encode_FIX(
SKP_int *NLSFIndices, /* O Pointer to codebook path vector [CB_STAGES x1] */
SKP_int *pNLSF_Q15, /* I/O Pointer to quantized NLSF vector [LPC_order x1] */
const SKP_Silk_NLSF_CB_struct *psNLSF_CB, /* I Pointer to codebook object */
const SKP_int *pNLSF_q_Q15_prev, /* I Pointer to previously quantized NLSF vector [LPC_order x1] */
const SKP_int *pW_Q6, /* I Pointer to NLSF weight vector [LPC_order x1] */
SKP_int *NLSFIndices, /* O Codebook path vector [ CB_STAGES ] */
SKP_int *pNLSF_Q15, /* I/O Quantized NLSF vector [ LPC_ORDER ] */
const SKP_Silk_NLSF_CB_struct *psNLSF_CB, /* I Codebook object */
const SKP_int *pNLSF_q_Q15_prev, /* I Prev. quantized NLSF vector [LPC_ORDER] */
const SKP_int *pW_Q6, /* I NLSF weight vector [ LPC_ORDER ] */
const SKP_int NLSF_mu_Q15, /* I Rate weight for the RD optimization */
const SKP_int NLSF_mu_fluc_red_Q16, /* I Fluctuation error weight for fluctuation reduction */
const SKP_int NLSF_MSVQ_Max_Survivors,/* I Maximum number of survivors from each stage */
const SKP_int NLSF_mu_fluc_red_Q16, /* I Fluctuation reduction error weight */
const SKP_int NLSF_MSVQ_Survivors, /* I Max survivors from each stage */
const SKP_int LPC_order, /* I LPC order */
const SKP_int deactivate_fluc_red /* I Deactivate fluctuation reduction, e.g. right after a reset */
const SKP_int deactivate_fluc_red /* I Deactivate fluctuation reduction */
)
{
SKP_int i, s, k, cur_survivors = 0, prev_survivors, input_index, cb_index, bestIndex;
@@ -60,24 +51,19 @@ void SKP_Silk_NLSF_MSVQ_encode_FIX(
#endif
#if( LOW_COMPLEXITY_ONLY == 1 )
SKP_int pTempIndices[ NLSF_MSVQ_TREE_SEARCH_MAX_VECTORS_EVALUATED_LC_MODE ];
SKP_int32 pRateDist_Q18[ NLSF_MSVQ_TREE_SEARCH_MAX_VECTORS_EVALUATED_LC_MODE ];
SKP_int32 pRate_Q5[ MAX_NLSF_MSVQ_SURVIVORS_LC_MODE ];
SKP_int32 pRate_new_Q5[ MAX_NLSF_MSVQ_SURVIVORS_LC_MODE ];
SKP_int pTempIndices[ MAX_NLSF_MSVQ_SURVIVORS_LC_MODE ];
SKP_int pPath[ MAX_NLSF_MSVQ_SURVIVORS_LC_MODE * NLSF_MSVQ_MAX_CB_STAGES ];
SKP_int pPath_new[ MAX_NLSF_MSVQ_SURVIVORS_LC_MODE * NLSF_MSVQ_MAX_CB_STAGES ];
SKP_int pRes_Q15[ MAX_NLSF_MSVQ_SURVIVORS_LC_MODE * MAX_LPC_ORDER ];
SKP_int pRes_new_Q15[ MAX_NLSF_MSVQ_SURVIVORS_LC_MODE * MAX_LPC_ORDER ];
#else
SKP_int pTempIndices[ NLSF_MSVQ_TREE_SEARCH_MAX_VECTORS_EVALUATED ];
SKP_int32 pRateDist_Q18[ NLSF_MSVQ_TREE_SEARCH_MAX_VECTORS_EVALUATED ];
SKP_int32 pRate_Q5[ MAX_NLSF_MSVQ_SURVIVORS ];
SKP_int32 pRate_new_Q5[ MAX_NLSF_MSVQ_SURVIVORS ];
SKP_int pTempIndices[ MAX_NLSF_MSVQ_SURVIVORS ];
SKP_int pPath[ MAX_NLSF_MSVQ_SURVIVORS * NLSF_MSVQ_MAX_CB_STAGES ];
SKP_int pPath_new[ MAX_NLSF_MSVQ_SURVIVORS * NLSF_MSVQ_MAX_CB_STAGES ];
SKP_int pRes_Q15[ MAX_NLSF_MSVQ_SURVIVORS * MAX_LPC_ORDER ];
@@ -87,10 +73,10 @@ void SKP_Silk_NLSF_MSVQ_encode_FIX(
const SKP_int *pConstInt;
SKP_int *pInt;
const SKP_int16 *pCB_element;
const SKP_Silk_NLSF_CB_Stage_struct *pCurrentCBStage;
const SKP_Silk_NLSF_CBS *pCurrentCBStage;
SKP_assert( NLSF_MSVQ_Max_Survivors <= MAX_NLSF_MSVQ_SURVIVORS );
SKP_assert( ( LOW_COMPLEXITY_ONLY == 0 ) || ( NLSF_MSVQ_Max_Survivors <= MAX_NLSF_MSVQ_SURVIVORS_LC_MODE ) );
SKP_assert( NLSF_MSVQ_Survivors <= MAX_NLSF_MSVQ_SURVIVORS );
SKP_assert( ( LOW_COMPLEXITY_ONLY == 0 ) || ( NLSF_MSVQ_Survivors <= MAX_NLSF_MSVQ_SURVIVORS_LC_MODE ) );
@@ -102,9 +88,9 @@ void SKP_Silk_NLSF_MSVQ_encode_FIX(
/****************************************************/
/* Clear accumulated rates */
SKP_memset( pRate_Q5, 0, NLSF_MSVQ_Max_Survivors * sizeof( SKP_int32 ) );
SKP_memset( pRate_Q5, 0, NLSF_MSVQ_Survivors * sizeof( SKP_int32 ) );
/* Copy LSFs into residual signal vector */
/* Copy NLSFs into residual signal vector */
for( i = 0; i < LPC_order; i++ ) {
pRes_Q15[ i ] = pNLSF_Q15[ i ];
}
@@ -119,15 +105,18 @@ void SKP_Silk_NLSF_MSVQ_encode_FIX(
pCurrentCBStage = &psNLSF_CB->CBStages[ s ];
/* Calculate the number of survivors in the current stage */
cur_survivors = SKP_min_32( NLSF_MSVQ_Max_Survivors, SKP_SMULBB( prev_survivors, pCurrentCBStage->nVectors ) );
cur_survivors = SKP_min_32( NLSF_MSVQ_Survivors, SKP_SMULBB( prev_survivors, pCurrentCBStage->nVectors ) );
#if( NLSF_MSVQ_FLUCTUATION_REDUCTION == 0 )
/* Find a single best survivor in the last stage, if we */
/* do not need candidates for fluctuation reduction */
if( s == psNLSF_CB->nStages - 1 ) {
cur_survivors = 1;
}
#endif
/* Nearest neighbor clustering for multiple input data vectors */
SKP_Silk_NLSF_VQ_nearest_neighbor_FIX( pRateDist_Q18, pCurrentCBStage, pRes_Q15, pW_Q6,
SKP_Silk_NLSF_VQ_rate_distortion_FIX( pRateDist_Q18, pCurrentCBStage, pRes_Q15, pW_Q6,
pRate_Q5, NLSF_mu_Q15, prev_survivors, LPC_order );
/* Sort the rate-distortion errors */
@@ -176,16 +165,11 @@ void SKP_Silk_NLSF_MSVQ_encode_FIX(
pInt[ i ] = pConstInt[ i ];
}
/* Write the current stage indices for the 'cur_survivors' to the best path matrix */
pInt[ s ] = cb_index;
}
if( s < psNLSF_CB->nStages - 1 ) {
/* Copy LSF residual matrix for next stage */
/* Copy NLSF residual matrix for next stage */
SKP_memcpy( pRes_Q15, pRes_new_Q15, SKP_SMULBB( cur_survivors, LPC_order ) * sizeof( SKP_int ) );
/* Copy rate vector for next stage */
@@ -200,6 +184,7 @@ void SKP_Silk_NLSF_MSVQ_encode_FIX(
/* (Preliminary) index of the best survivor, later to be decoded */
bestIndex = 0;
#if( NLSF_MSVQ_FLUCTUATION_REDUCTION == 1 )
/******************************/
/* NLSF fluctuation reduction */
@@ -229,11 +214,6 @@ void SKP_Silk_NLSF_MSVQ_encode_FIX(
wsse_Q20 = SKP_ADD_POS_SAT32( pRateDist_Q18[ s ], SKP_SMULWB( wsse_Q20, NLSF_mu_fluc_red_Q16 ) );
/* Keep index of best survivor */
if( wsse_Q20 < bestRateDist_Q20 ) {
bestRateDist_Q20 = wsse_Q20;
bestIndex = s;
@@ -241,6 +221,7 @@ void SKP_Silk_NLSF_MSVQ_encode_FIX(
}
}
#endif
/* Copy best path to output argument */
SKP_memcpy( NLSFIndices, &pPath_new[ SKP_SMULBB( bestIndex, psNLSF_CB->nStages ) ], psNLSF_CB->nStages * sizeof( SKP_int ) );
@@ -248,5 +229,3 @@ void SKP_Silk_NLSF_MSVQ_encode_FIX(
SKP_Silk_NLSF_MSVQ_decode( pNLSF_Q15, psNLSF_CB, NLSFIndices, LPC_order );
}

View File

@@ -1,77 +0,0 @@
/***********************************************************************
Copyright (c) 2006-2010, 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_FIX.h"
/* Weighted VQ with entropy constraints, for multiple input data vectors */
void SKP_Silk_NLSF_VQ_nearest_neighbor_FIX(
SKP_int32 *pRD_Q20, /* O rate-distortion of psNLSF_CB_stage->nVectors best codebook vectors, for each input vector */
const SKP_Silk_NLSF_CB_Stage_struct *psNLSF_CB_stage,/* I pointer to NLSF codebook stage struct */
const SKP_int *in_Q15, /* I input vectors to be quantized */
const SKP_int *w_Q6, /* I weighting vector */
const SKP_int32 *rate_acc_Q5, /* I Accumulated rate from first to previous stage for each input vector */
const SKP_int mu_Q15, /* I tradeoffs between weighted error and rate */
const SKP_int N, /* I number of input vectors to be quantized */
const SKP_int LPC_order /* I LPC order */
)
{
SKP_int i, n;
SKP_int32 *pRD_vec_Q20;
/* Compute weighted quantization errors for all input vectors over one codebook stage */
SKP_Silk_NLSF_VQ_sum_error_FIX( pRD_Q20, in_Q15, w_Q6, psNLSF_CB_stage->CB_NLSF_Q15,
N, psNLSF_CB_stage->nVectors, LPC_order );
/* Loop over input vectors */
pRD_vec_Q20 = pRD_Q20;
for( n = 0; n < N; n++ ) {
/* Add rate cost to error for each codebook vector */
for( i = 0; i < psNLSF_CB_stage->nVectors; i++ ) {
SKP_assert( rate_acc_Q5[ n ] + psNLSF_CB_stage->Rates_Q5[ i ] >= 0 );
SKP_assert( rate_acc_Q5[ n ] + psNLSF_CB_stage->Rates_Q5[ i ] <= SKP_int16_MAX );
pRD_vec_Q20[ i ] = SKP_SMLABB( pRD_vec_Q20[ i ], rate_acc_Q5[ n ] + psNLSF_CB_stage->Rates_Q5[ i ], mu_Q15 );
SKP_assert( pRD_vec_Q20[ i ] >= 0 );
}
pRD_vec_Q20 += psNLSF_CB_stage->nVectors;
}
}

View File

@@ -0,0 +1,61 @@
/***********************************************************************
Copyright (c) 2006-2010, 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_FIX.h"
/* Rate-Distortion calculations for multiple input data vectors */
void SKP_Silk_NLSF_VQ_rate_distortion_FIX(
SKP_int32 *pRD_Q20, /* O Rate-distortion values [psNLSF_CBS->nVectors*N] */
const SKP_Silk_NLSF_CBS *psNLSF_CBS, /* I NLSF codebook stage struct */
const SKP_int *in_Q15, /* I Input vectors to be quantized */
const SKP_int *w_Q6, /* I Weight vector */
const SKP_int32 *rate_acc_Q5, /* I Accumulated rates from previous stage */
const SKP_int mu_Q15, /* I Weight between weighted error and rate */
const SKP_int N, /* I Number of input vectors to be quantized */
const SKP_int LPC_order /* I LPC order */
)
{
SKP_int i, n;
SKP_int32 *pRD_vec_Q20;
/* Compute weighted quantization errors for all input vectors over one codebook stage */
SKP_Silk_NLSF_VQ_sum_error_FIX( pRD_Q20, in_Q15, w_Q6, psNLSF_CBS->CB_NLSF_Q15,
N, psNLSF_CBS->nVectors, LPC_order );
/* Loop over input vectors */
pRD_vec_Q20 = pRD_Q20;
for( n = 0; n < N; n++ ) {
/* Add rate cost to error for each codebook vector */
for( i = 0; i < psNLSF_CBS->nVectors; i++ ) {
SKP_assert( rate_acc_Q5[ n ] + psNLSF_CBS->Rates_Q5[ i ] >= 0 );
SKP_assert( rate_acc_Q5[ n ] + psNLSF_CBS->Rates_Q5[ i ] <= SKP_int16_MAX );
pRD_vec_Q20[ i ] = SKP_SMLABB( pRD_vec_Q20[ i ], rate_acc_Q5[ n ] + psNLSF_CBS->Rates_Q5[ i ], mu_Q15 );
SKP_assert( pRD_vec_Q20[ i ] >= 0 );
}
pRD_vec_Q20 += psNLSF_CBS->nVectors;
}
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -26,7 +23,6 @@ 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_FIX.h"
@@ -40,11 +36,6 @@ void SKP_Silk_NLSF_VQ_sum_error_FIX(
const SKP_int N, /* I Number of input vectors */
const SKP_int K, /* I Number of codebook vectors */
const SKP_int LPC_order /* I Number of LPCs */
)
{
SKP_int i, n, m;
@@ -86,5 +77,3 @@ void SKP_Silk_NLSF_VQ_sum_error_FIX(
}
}

View File

@@ -1,12 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -31,7 +23,6 @@ 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_FIX.h"
@@ -55,11 +46,6 @@ void SKP_Silk_NLSF_VQ_weights_laroia(
SKP_int32 tmp1_int, tmp2_int;
/* Check that we are guaranteed to end up within the required range */
SKP_assert( D > 0 );
SKP_assert( ( D & 1 ) == 0 );
@@ -90,5 +76,3 @@ void SKP_Silk_NLSF_VQ_weights_laroia(
pNLSFW_Q6[ D - 1 ] = (SKP_int)SKP_min_int( tmp1_int + tmp2_int, SKP_int16_MAX );
SKP_assert( pNLSFW_Q6[ D - 1 ] > 0 );
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -26,14 +23,8 @@ 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.
***********************************************************************/
/* NLSF stabilizer: */
/* */
/* - Moves NLSFs futher apart if they are too close */
@@ -82,11 +73,6 @@ void SKP_Silk_NLSF_stabilize(
if( diff_Q15 < min_diff_Q15 ) {
min_diff_Q15 = diff_Q15;
I = L;
}
/***************************************************/
@@ -135,11 +121,6 @@ void SKP_Silk_NLSF_stabilize(
/* Worst case: O(n^2) for an inversely sorted array */
SKP_Silk_insertion_sort_increasing_all_values(&NLSF_Q15[0], L);
/* First NLSF should be no less than NDeltaMin[0] */
NLSF_Q15[0] = SKP_max_int( NLSF_Q15[0], NDeltaMin_Q15[0] );
@@ -171,5 +152,3 @@ void SKP_Silk_NLSF_stabilize_multi(
SKP_Silk_NLSF_stabilize( &NLSF_Q15[n * L], NDeltaMin_Q15, L );
}
}

View File

@@ -1,14 +1,6 @@
/***********************************************************************
Copyright (c) 2006-2010, 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,
@@ -31,7 +23,6 @@ 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"
@@ -57,11 +48,6 @@ SKP_INLINE void SKP_Silk_noise_shape_quantizer(
SKP_int16 xq[], /* O */
SKP_int32 sLTP_Q16[], /* I/O LTP state */
const SKP_int16 a_Q12[], /* I Short term prediction coefs */
const SKP_int16 b_Q14[], /* I Long term prediction coefs */
const SKP_int16 AR_shp_Q13[], /* I Noise shaping AR coefs */
SKP_int lag, /* I Pitch lag */
@@ -110,11 +96,6 @@ void SKP_Silk_NSQ(
/* Set unvoiced lag to the previous one, overwrite later for voiced */
lag = NSQ->lagPrev;
SKP_assert( NSQ->prev_inv_gain_Q16 != 0 );
offset_Q10 = SKP_Silk_Quantization_Offsets_Q10[ psEncCtrlC->sigtype ][ psEncCtrlC->QuantOffsetType ];
@@ -163,11 +144,6 @@ void SKP_Silk_NSQ(
SKP_Silk_nsq_scale_states( NSQ, x, x_sc_Q10, psEncC->subfr_length, sLTP,
sLTP_Q16, k, LTP_scale_Q14, Gains_Q16, psEncCtrlC->pitchL );
SKP_Silk_noise_shape_quantizer( NSQ, psEncCtrlC->sigtype, x_sc_Q10, q, pxq, sLTP_Q16, A_Q12, B_Q14,
AR_shp_Q13, lag, HarmShapeFIRPacked_Q14, Tilt_Q14[ k ], LF_shp_Q14[ k ], Gains_Q16[ k ], Lambda_Q10,
offset_Q10, psEncC->subfr_length, psEncC->shapingLPCOrder, psEncC->predictLPCOrder
@@ -216,11 +192,6 @@ SKP_INLINE void SKP_Silk_noise_shape_quantizer(
SKP_int i, j;
SKP_int32 LTP_pred_Q14, LPC_pred_Q10, n_AR_Q10, n_LTP_Q14;
SKP_int32 n_LF_Q10, r_Q10, q_Q0, q_Q10;
SKP_int32 thr1_Q10, thr2_Q10, thr3_Q10;
SKP_int32 Atmp, dither;
SKP_int32 exc_Q10, LPC_exc_Q10, xq_Q10;
@@ -269,11 +240,6 @@ SKP_INLINE void SKP_Silk_noise_shape_quantizer(
LPC_pred_Q10 = SKP_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -2 ], Atmp );
LPC_pred_Q10 = SKP_SMLAWT( LPC_pred_Q10, psLPC_Q14[ -3 ], Atmp );
Atmp = a_Q12_tmp[ 2 ];
LPC_pred_Q10 = SKP_SMLAWB( LPC_pred_Q10, psLPC_Q14[ -4 ], Atmp );
LPC_pred_Q10 = SKP_SMLAWT( LPC_pred_Q10, psLPC_Q14[ -5 ], Atmp );
Atmp = a_Q12_tmp[ 3 ];
@@ -322,11 +288,6 @@ SKP_INLINE void SKP_Silk_noise_shape_quantizer(
Atmp = AR_shp_Q13_tmp[ 4 ];
n_AR_Q10 = SKP_SMLAWB( n_AR_Q10, psLPC_Q14[ -8 ], Atmp );
n_AR_Q10 = SKP_SMLAWT( n_AR_Q10, psLPC_Q14[ -9 ], Atmp );
Atmp = AR_shp_Q13_tmp[ 5 ];
n_AR_Q10 = SKP_SMLAWB( n_AR_Q10, psLPC_Q14[ -10 ], Atmp );
n_AR_Q10 = SKP_SMLAWT( n_AR_Q10, psLPC_Q14[ -11 ], Atmp );
@@ -375,11 +336,6 @@ SKP_INLINE void SKP_Silk_noise_shape_quantizer(
q_Q10 = SKP_LSHIFT( q_Q0, 10 );
} else if( r_Q10 < thr2_Q10 ) {
q_Q0 = -1;
q_Q10 = -1024;
} else if( r_Q10 > thr3_Q10 ) {
q_Q0 = SKP_RSHIFT_ROUND( SKP_SUB_RSHIFT32( r_Q10, Lambda_Q10, 1 ), 10 );
@@ -428,11 +384,6 @@ SKP_INLINE void SKP_Silk_nsq_scale_states(
SKP_int16 sLTP[], /* I re-whitened LTP state in Q0 */
SKP_int32 sLTP_Q16[], /* O LTP state matching scaled input */
SKP_int subfr, /* I subframe number */
const SKP_int LTP_scale_Q14, /* I */
const SKP_int32 Gains_Q16[ NB_SUBFR ], /* I */
const SKP_int pitchL[ NB_SUBFR ] /* I */
@@ -481,11 +432,6 @@ SKP_INLINE void SKP_Silk_nsq_scale_states(
/* scale short term state */
for( i = 0; i < MAX_LPC_ORDER; i++ ) {
NSQ->sLPC_Q14[ i ] = SKP_SMULWW( gain_adj_Q16, NSQ->sLPC_Q14[ i ] );
}
}
@@ -498,5 +444,3 @@ SKP_INLINE void SKP_Silk_nsq_scale_states(
SKP_assert( inv_gain_Q16 != 0 );
NSQ->prev_inv_gain_Q16 = inv_gain_Q16;
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -26,16 +23,10 @@ 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"
typedef struct {
SKP_int RandState[ DECISION_DELAY ];
SKP_int32 Q_Q10[ DECISION_DELAY ];
@@ -84,11 +75,6 @@ SKP_INLINE void SKP_Silk_nsq_del_dec_scale_states(
/******************************************/
/* Noise shape quantizer for one subframe */
/******************************************/
SKP_INLINE void SKP_Silk_noise_shape_quantizer_del_dec(
SKP_Silk_nsq_state *NSQ, /* I/O NSQ state */
NSQ_del_dec_struct psDelDec[], /* I/O Delayed decision states */
@@ -137,11 +123,6 @@ void SKP_Silk_NSQ_del_dec(
SKP_int i, k, lag, start_idx, LSF_interpolation_flag, Winner_ind, subfr;
SKP_int last_smple_idx, smpl_buf_idx, decisionDelay, subfr_length;
const SKP_int16 *A_Q12, *B_Q14, *AR_shp_Q13;
SKP_int16 *pxq;
SKP_int32 sLTP_Q16[ 2 * MAX_FRAME_LENGTH ];
SKP_int16 sLTP[ 2 * MAX_FRAME_LENGTH ];
@@ -190,11 +171,6 @@ void SKP_Silk_NSQ_del_dec(
/* Setup pointers to start of sub frame */
pxq = &NSQ->xq[ psEncC->frame_length ];
NSQ->sLTP_shp_buf_idx = psEncC->frame_length;
NSQ->sLTP_buf_idx = psEncC->frame_length;
subfr = 0;
@@ -243,11 +219,6 @@ void SKP_Silk_NSQ_del_dec(
subfr = 0;
}
/* Rewhiten with new A coefs */
start_idx = psEncC->frame_length - lag - psEncC->predictLPCOrder - LTP_ORDER / 2;
start_idx = SKP_LIMIT( start_idx, 0, psEncC->frame_length - psEncC->predictLPCOrder );
@@ -296,11 +267,6 @@ void SKP_Silk_NSQ_del_dec(
psEncCtrlC->Seed = psDD->SeedInit;
last_smple_idx = smpl_buf_idx + decisionDelay;
for( i = 0; i < decisionDelay; i++ ) {
last_smple_idx = ( last_smple_idx - 1 ) & DECISION_DELAY_MASK;
q[ i - decisionDelay ] = ( SKP_int )SKP_RSHIFT( psDD->Q_Q10[ last_smple_idx ], 10 );
pxq[ i - decisionDelay ] = ( SKP_int16 )SKP_SAT16( SKP_RSHIFT_ROUND(
@@ -349,11 +315,6 @@ SKP_INLINE void SKP_Silk_noise_shape_quantizer_del_dec(
SKP_int predictLPCOrder, /* I Prediction LPC filter order */
SKP_int nStatesDelayedDecision, /* I Number of states in decision tree */
SKP_int *smpl_buf_idx, /* I Index to newest samples in buffers */
SKP_int decisionDelay /* I */
)
{
@@ -402,11 +363,6 @@ SKP_INLINE void SKP_Silk_noise_shape_quantizer_del_dec(
n_LTP_Q14 = SKP_SMULWB( SKP_ADD32( shp_lag_ptr[ 0 ], shp_lag_ptr[ -2 ] ), HarmShapeFIRPacked_Q14 );
n_LTP_Q14 = SKP_SMLAWT( n_LTP_Q14, shp_lag_ptr[ -1 ], HarmShapeFIRPacked_Q14 );
n_LTP_Q14 = SKP_LSHIFT( n_LTP_Q14, 6 );
shp_lag_ptr++;
} else {
n_LTP_Q14 = 0;
@@ -455,11 +411,6 @@ SKP_INLINE void SKP_Silk_noise_shape_quantizer_del_dec(
}
/* Noise shape feedback */
SKP_assert( ( shapingLPCOrder & 1 ) == 0 ); /* check that order is even */
SKP_assert( ( (SKP_int64)AR_shp_Q13 & 3 ) == 0 ); /* check that array starts at 4-byte aligned address */
SKP_assert( shapingLPCOrder >= 12 ); /* check that unrolling works */
@@ -508,11 +459,6 @@ SKP_INLINE void SKP_Silk_noise_shape_quantizer_del_dec(
r_Q10 = SKP_SUB32( x_Q10[ i ], tmp ); /* residual error Q10 */
/* Flip sign depending on dither */
r_Q10 = ( r_Q10 ^ dither ) - dither;
r_Q10 = SKP_SUB32( r_Q10, offset_Q10 );
@@ -561,11 +507,6 @@ SKP_INLINE void SKP_Silk_noise_shape_quantizer_del_dec(
exc_Q10 = ( exc_Q10 ^ dither ) - dither;
/* Add predictions */
LPC_exc_Q10 = exc_Q10 + SKP_RSHIFT_ROUND( LTP_pred_Q14, 4 );
xq_Q10 = SKP_ADD32( LPC_exc_Q10, LPC_pred_Q10 );
@@ -614,11 +555,6 @@ SKP_INLINE void SKP_Silk_noise_shape_quantizer_del_dec(
psSampleState[ k ][ 0 ].RD_Q10 = SKP_ADD32( psSampleState[ k ][ 0 ].RD_Q10, ( SKP_int32_MAX >> 4 ) );
psSampleState[ k ][ 1 ].RD_Q10 = SKP_ADD32( psSampleState[ k ][ 1 ].RD_Q10, ( SKP_int32_MAX >> 4 ) );
SKP_assert( psSampleState[ k ][ 0 ].RD_Q10 >= 0 );
}
}
@@ -667,11 +603,6 @@ SKP_INLINE void SKP_Silk_noise_shape_quantizer_del_dec(
psDD->Xq_Q10[ *smpl_buf_idx ] = SKP_RSHIFT( psSS->xq_Q14, 4 );
psDD->Q_Q10[ *smpl_buf_idx ] = psSS->Q_Q10;
psDD->Pred_Q16[ *smpl_buf_idx ] = psSS->LPC_exc_Q16;
psDD->Shape_Q10[ *smpl_buf_idx ] = psSS->sLTP_shp_Q10;
psDD->Seed = SKP_ADD_RSHIFT32( psDD->Seed, psSS->Q_Q10, 10 );
psDD->RandState[ *smpl_buf_idx ] = psDD->Seed;
@@ -720,11 +651,6 @@ SKP_INLINE void SKP_Silk_nsq_del_dec_scale_states(
SKP_assert( i < MAX_FRAME_LENGTH );
sLTP_Q16[ i ] = SKP_SMULWB( inv_gain_Q32, sLTP[ i ] );
}
}
/* Adjust for changing gain */
@@ -773,11 +699,6 @@ SKP_INLINE void SKP_Silk_nsq_del_dec_scale_states(
/* save inv_gain */
SKP_assert( inv_gain_Q16 != 0 );
NSQ->prev_inv_gain_Q16 = inv_gain_Q16;
}
@@ -799,5 +720,3 @@ SKP_INLINE void SKP_Silk_copy_del_dec_state(
DD_dst->SeedInit = DD_src->SeedInit;
DD_dst->RD_Q10 = DD_src->RD_Q10;
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -26,7 +23,6 @@ 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"
@@ -45,11 +41,6 @@ void SKP_Silk_PLC_Reset(
}
void SKP_Silk_PLC(
SKP_Silk_decoder_state *psDec, /* I Decoder state */
SKP_Silk_decoder_control *psDecCtrl, /* I Decoder control */
SKP_int16 signal[], /* O Concealed signal */
@@ -98,11 +89,6 @@ void SKP_Silk_PLC_update(
if( psDecCtrl->sigtype == SIG_TYPE_VOICED ) {
/* Find the parameters for the last subframe which contains a pitch pulse */
for( j = 0; j * psDec->subfr_length < psDecCtrl->pitchL[ NB_SUBFR - 1 ]; j++ ) {
temp_LTP_Gain_Q14 = 0;
for( i = 0; i < LTP_ORDER; i++ ) {
temp_LTP_Gain_Q14 += psDecCtrl->LTPCoef_Q14[ ( NB_SUBFR - 1 - j ) * LTP_ORDER + i ];
@@ -151,11 +137,6 @@ void SKP_Silk_PLC_update(
SKP_memcpy( psPLC->prevLPC_Q12, psDecCtrl->PredCoef_Q12[ 1 ], psDec->LPC_order * sizeof( SKP_int16 ) );
psPLC->prevLTP_scale_Q14 = psDecCtrl->LTP_scale_Q14;
/* Save Gains */
SKP_memcpy( psPLC->prevGain_Q16, psDecCtrl->Gains_Q16, NB_SUBFR * sizeof( SKP_int32 ) );
}
@@ -204,11 +185,6 @@ void SKP_Silk_PLC_conceal(
} else {
/* Second sub-frame has lowest energy */
rand_ptr = &psDec->exc_Q10[ SKP_max_int( 0, psDec->frame_length - RAND_BUF_SIZE ) ];
}
/* Setup Gain to random noise component */
@@ -257,11 +233,6 @@ void SKP_Silk_PLC_conceal(
/***************************/
/* LTP synthesis filtering */
/***************************/
sig_Q10_ptr = sig_Q10;
for( k = 0; k < NB_SUBFR; k++ ) {
/* Setup pointer */
@@ -310,11 +281,6 @@ void SKP_Silk_PLC_conceal(
/* Preload LPC coeficients to array on stack. Gives small performance gain */
SKP_memcpy( A_Q12_tmp, psPLC->prevLPC_Q12, psDec->LPC_order * sizeof( SKP_int16 ) );
SKP_assert( psDec->LPC_order >= 10 ); /* check that unrolling works */
for( k = 0; k < NB_SUBFR; k++ ) {
for( i = 0; i < psDec->subfr_length; i++ ){
/* unrolled */
@@ -363,11 +329,6 @@ void SKP_Silk_PLC_conceal(
for( i = 0; i < NB_SUBFR; i++ ) {
psDecCtrl->pitchL[ i ] = lag;
}
}
/* Glues concealed frames with new good recieved frames */
@@ -416,11 +377,6 @@ void SKP_Silk_PLC_glue_frames(
slope_Q12 = SKP_DIV32_16( ( 1 << 12 ) - gain_Q12, length );
for( i = 0; i < length; i++ ) {
signal[ i ] = SKP_RSHIFT( SKP_MUL( gain_Q12, signal[ i ] ), 12 );
gain_Q12 += slope_Q12;
gain_Q12 = SKP_min( gain_Q12, ( 1 << 12 ) );
@@ -431,5 +387,3 @@ void SKP_Silk_PLC_glue_frames(
}
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -26,7 +23,6 @@ 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_PLC_FIX_H
@@ -34,10 +30,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "SKP_Silk_main_FIX.h"
#define BWE_COEF_Q16 64880 /* 0.99 in Q16 */
#define V_PITCH_GAIN_START_MIN_Q14 11469 /* 0.7 in Q14 */
#define V_PITCH_GAIN_START_MAX_Q14 15565 /* 0.95 in Q14 */
@@ -85,9 +77,3 @@ void SKP_Silk_PLC_glue_frames(
#endif

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -14,11 +11,6 @@ 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,
@@ -31,14 +23,10 @@ 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.
***********************************************************************/
/*! \file SKP_Silk_SigProc.h
*/
#ifndef _SKP_SILK_SIGPROC_H_
#define _SKP_SILK_SIGPROC_H_
#ifndef _SKP_SILK_SIGPROC_FIX_H_
#define _SKP_SILK_SIGPROC_FIX_H_
#ifdef __cplusplus
extern "C"
@@ -68,10 +56,6 @@ void SKP_Silk_resample_1_2(
const SKP_int32 len /* I: Number of OUTPUT samples */
);
/*!
* downsample by a factor 2, coarser (good for resampling audio)
*/
@@ -120,11 +104,6 @@ void SKP_Silk_resample_1_3(
*/
void SKP_Silk_resample_3_1(
SKP_int16 *out, /* O: Fs_high signal [inLen*3] */
SKP_int32 *S, /* I/O: State vector [7] */
const SKP_int16 *in, /* I: Fs_low signal [inLen] */
const SKP_int32 inLen /* I: Input length */
@@ -173,11 +152,6 @@ void SKP_Silk_resample_4_3(
/*!
* resample with a factor 2/3 coarse
*/
void SKP_Silk_resample_2_3_coarse(
SKP_int16 *out, /* O: Output signal */
SKP_int16 *S, /* I/O: Resampler state [ SigProc_Resample_2_3_coarse_NUM_FIR_COEFS - 1 ] */
@@ -226,11 +200,6 @@ void SKP_Silk_allpass_int(
SKP_int A, /* I: Q15 coefficient (0 <= A < 32768) */
SKP_int32 *out, /* O: Q25 output signal [len] */
const SKP_int32 len /* I: Number of samples */
);
/*!
@@ -280,10 +249,6 @@ void SKP_Silk_MA_Prediction_Q13(
SKP_int32 order /* I: filter order */
);
/*!
* 16th order AR filter for LPC synthesis, coefficients are in Q12
*/
@@ -332,11 +297,6 @@ void SKP_Silk_bwexpander_32(
SKP_int32 chirp_Q16 /* I Chirp factor in Q16 */
);
/* Compute inverse of LPC prediction gain, and */
/* test if LPC coefficients are stable (all poles within unit circle) */
SKP_int SKP_Silk_LPC_inverse_pred_gain( /* O: Returns 1 if unstable, otherwise 0 */
@@ -385,11 +345,6 @@ SKP_int16 SKP_Silk_int16_array_maxabs( /* O Maximum absolute value, max: 2^15
/* Compute number of bits to right shift the sum of squares of a vector */
/* of int16s to make it fit in an int32 */
void SKP_Silk_sum_sqr_shift(
SKP_int32 *energy, /* O Energy of x, after shifting to the right */
SKP_int *shift, /* O Number of bits right shift applied to energy */
const SKP_int16 *x, /* I Input vector */
@@ -438,11 +393,6 @@ void SKP_Silk_apply_sine_window(
SKP_int16 px_win[], /* O Pointer to windowed signal */
const SKP_int16 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 */
);
@@ -491,11 +441,6 @@ void SKP_Silk_LPC_fit(
SKP_int16 *a_QQ, /* O stabilized LPC vector, Q(24-rshift) [L] */
SKP_int32 *a_Q24, /* I LPC vector [L] */
const SKP_int QQ, /* I Q domain of output LPC vector */
const SKP_int L /* I Number of LPC parameters in the input vector */
);
@@ -544,11 +489,6 @@ void SKP_Silk_insertion_sort_increasing_all_values(
void SKP_Silk_NLSF_stabilize(
SKP_int *NLSF_Q15, /* I/O: Unstable/stabilized normalized LSF vector in Q15 [L] */
const SKP_int *NDeltaMin_Q15, /* I: Normalized delta min vector in Q15, NDeltaMin_Q15[L] must be >= 1 [L+1] */
const SKP_int L /* I: Number of NLSF parameters in the input vector */
);
@@ -597,11 +537,6 @@ void SKP_Silk_scale_copy_vector16(
void SKP_Silk_scale_vector32_16_Q14(
SKP_int32 *data1, /* I/O: Q0/Q0 */
SKP_int gain_Q14, /* I: Q14 */
SKP_int dataSize /* I: length */
);
@@ -650,11 +585,6 @@ SKP_int64 SKP_Silk_inner_prod16_aligned_64(
);
/********************************************************************/
/* MACROS */
/********************************************************************/
/* Define 4-byte aligned array of SKP_int16 */
@@ -703,11 +633,6 @@ SKP_int64 SKP_Silk_inner_prod16_aligned_64(
#define SKP_DIV64_32(a64, b32) ((a64)/(b32)) /* TODO: rewrite it as a set of SKP_DIV32.*/
#define SKP_DIV32_16(a32, b16) ((SKP_int32)((a32) / (b16)))
#define SKP_DIV32(a32, b32) ((SKP_int32)((a32) / (b32)))
@@ -756,11 +681,6 @@ SKP_int64 SKP_Silk_inner_prod16_aligned_64(
#define SKP_LSHIFT64(a, shift) ((a)<<(shift)) // shift >= 0, shift < 64
#define SKP_LSHIFT(a, shift) SKP_LSHIFT32(a, shift) // shift >= 0, shift < 32
#define SKP_RSHIFT8(a, shift) ((a)>>(shift)) // shift >= 0, shift < 8
#define SKP_RSHIFT16(a, shift) ((a)>>(shift)) // shift >= 0, shift < 16
#define SKP_RSHIFT32(a, shift) ((a)>>(shift)) // shift >= 0, shift < 32
@@ -809,11 +729,6 @@ SKP_INLINE SKP_int SKP_min_int(SKP_int a, SKP_int b)
SKP_INLINE SKP_int16 SKP_min_16(SKP_int16 a, SKP_int16 b)
{
return (((a) < (b)) ? (a) : (b));
}
SKP_INLINE SKP_int32 SKP_min_32(SKP_int32 a, SKP_int32 b)
{
@@ -863,10 +778,6 @@ SKP_INLINE SKP_int64 SKP_max_64(SKP_int64 a, SKP_int64 b)
/* the lowest bits. */
#define SKP_RAND(seed) (SKP_MLA_ovflw(907633515, (seed), 196314165))
// Add some multiplication functions that can be easily mapped to ARM.
// SKP_SMMUL: Signed top word multiply.
@@ -882,6 +793,4 @@ SKP_INLINE SKP_int64 SKP_max_64(SKP_int64 a, SKP_int64 b)
}
#endif
#endif //_SKP_SILK_H_
#endif

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -26,12 +23,6 @@ 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.
***********************************************************************/
/*
@@ -80,11 +71,6 @@ const static SKP_int32 tiltWeights[ VAD_N_BANDS ] = { 30000, 6000, -12000, -1200
/***************************************/
/* Get the speech activity level in Q8 */
/***************************************/
SKP_int SKP_Silk_VAD_GetSA_Q8( /* O Return value, 0 if success */
SKP_Silk_VAD_state *psSilk_VAD, /* I/O Silk VAD state */
@@ -133,11 +119,6 @@ SKP_int SKP_Silk_VAD_GetSA_Q8( /* O Retu
HPstateTmp = X[ 0 ][ decimated_framelength - 1 ];
for( i = decimated_framelength - 1; i > 0; i-- ) {
X[ 0 ][ i - 1 ] = SKP_RSHIFT( X[ 0 ][ i - 1 ], 1 );
X[ 0 ][ i ] -= X[ 0 ][ i - 1 ];
}
X[ 0 ][ 0 ] -= psSilk_VAD->HPstate;
@@ -187,10 +168,6 @@ SKP_int SKP_Silk_VAD_GetSA_Q8( /* O Retu
/********************/
SKP_Silk_VAD_GetNoiseLevels( &Xnrg[ 0 ], psSilk_VAD );
/***********************************************/
/* Signal-plus-noise to noise ratio estimation */
/***********************************************/
@@ -239,11 +216,6 @@ SKP_int SKP_Silk_VAD_GetSA_Q8( /* O Retu
/**************************/
*pTilt_Q15 = SKP_LSHIFT( SKP_Silk_sigm_Q15( input_tilt ) - 16384, 1 );
/**************************************************/
/* Scale the sigmoid output based on power levels */
/**************************************************/
@@ -292,11 +264,6 @@ void SKP_Silk_VAD_GetNoiseLevels(
SKP_Silk_VAD_state *psSilk_VAD /* I/O Pointer to Silk VAD state */
)
{
SKP_int k;
SKP_int32 nl, nrg, inv_nrg;
SKP_int coef, min_coef;
@@ -345,16 +312,9 @@ void SKP_Silk_VAD_GetNoiseLevels(
nl = SKP_min( nl, 0x00FFFFFF );
/* Store as part of state */
psSilk_VAD->NL[ k ] = nl;
}
/* Increment frame counter */
psSilk_VAD->counter++;
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -26,7 +23,6 @@ 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_FIX.h"
@@ -37,11 +33,6 @@ void SKP_Silk_VQ_WMat_EC_FIX(
SKP_int32 *rate_dist_Q14, /* O best weighted quantization error + mu * rate*/
const SKP_int16 *in_Q14, /* I input vector to be quantized */
const SKP_int32 *W_Q18, /* I weighting matrix */
const SKP_int16 *cb_Q14, /* I codebook */
const SKP_int16 *cl_Q6, /* I code length for each codebook vector */
const SKP_int mu_Q8, /* I tradeoff between weighted error and rate */
@@ -90,11 +81,6 @@ void SKP_Silk_VQ_WMat_EC_FIX(
/* third row of W_Q18 */
sum2_Q16 = SKP_SMULWT( W_Q18[ 13 ], diff_Q14_23 );
sum2_Q16 = SKP_SMLAWB( sum2_Q16, W_Q18[ 14 ], diff_Q14_4 );
sum2_Q16 = SKP_LSHIFT( sum2_Q16, 1 );
sum2_Q16 = SKP_SMLAWB( sum2_Q16, W_Q18[ 12 ], diff_Q14_23 );
@@ -122,5 +108,3 @@ void SKP_Silk_VQ_WMat_EC_FIX(
cb_row_Q14 += LTP_ORDER;
}
}

View File

@@ -1,11 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -30,7 +23,6 @@ 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.
***********************************************************************/
/* *
@@ -54,11 +46,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "SKP_Silk_SigProc_FIX.h"
/* First-order allpass filter */
void SKP_Silk_allpass_int(
const SKP_int32 *in, /* I: Q25 input signal [len] */
@@ -80,5 +67,3 @@ void SKP_Silk_allpass_int(
}
S[ 0 ] = S0;
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -22,16 +19,10 @@ 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.
***********************************************************************/
/* *
@@ -76,13 +67,7 @@ void SKP_Silk_ana_filt_bank_1(
out_tmp = scratch[ k ] + scratch[ k + N2 ];
outL[ k ] = (SKP_int16)SKP_SAT16( SKP_RSHIFT_ROUND( out_tmp, 11 ) );
out_tmp = scratch[ k ] - scratch[ k + N2 ];
outH[ k ] = (SKP_int16)SKP_SAT16( SKP_RSHIFT_ROUND( out_tmp, 11 ) );
}
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -26,7 +23,6 @@ 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_FIX.h"
@@ -39,11 +35,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/* every other sample of window is linearly interpolated, for speed */
void SKP_Silk_apply_sine_window(
SKP_int16 px_win[], /* O Pointer to windowed signal */
const SKP_int16 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 */
@@ -92,11 +83,6 @@ void SKP_Silk_apply_sine_window(
S0_Q16 = SKP_RSHIFT( SKP_MUL( c_Q20, S1_Q16 ), 20 ) + SKP_LSHIFT( S1_Q16, 1 ) - S0_Q16 + 1;
S0_Q16 = SKP_min( S0_Q16, ( 1 << 16 ) );
px32 = *( (SKP_int32 *)&px[k + 2] ); /* load two values at once */
px_win[ k + 2 ] = (SKP_int16)SKP_SMULWB( SKP_RSHIFT( S0_Q16 + S1_Q16, 1 ), px32 );
px_win[ k + 3 ] = (SKP_int16)SKP_SMULWT( S0_Q16, px32 );
@@ -104,5 +90,3 @@ void SKP_Silk_apply_sine_window(
S1_Q16 = SKP_min( S1_Q16, ( 1 << 16 ) );
}
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -26,7 +23,6 @@ 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.
***********************************************************************/
/* *
@@ -36,11 +32,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* the input vector *
* *
* Copyright 2006 (c), Skype Limited *
* Date: 060221 *
* */
#include "SKP_Silk_SigProc_FIX.h"
@@ -71,5 +62,3 @@ SKP_int16 SKP_Silk_int16_array_maxabs( /* O Maximum absolute value, max: 2
return( (SKP_int16)lvl );
}
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -13,11 +10,6 @@ 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
@@ -31,7 +23,6 @@ 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.
***********************************************************************/
/* *
@@ -66,11 +57,6 @@ void SKP_Silk_autocorr(
corr64 += 1;
/* number of leading zeros */
lz = SKP_Silk_CLZ64( corr64 );
/* scaling: number of right shifts applied to correlations */
@@ -93,5 +79,3 @@ void SKP_Silk_autocorr(
}
}
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -21,17 +18,11 @@ 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.
***********************************************************************/
/* *
@@ -74,15 +65,8 @@ void SKP_Silk_biquad(
S1 = SKP_LSHIFT( SKP_SMULWB( out32, A1_neg ), 3 );
S1 = SKP_SMLABB( S1, in16, B[ 2 ] );
tmp32 = SKP_RSHIFT_ROUND( out32, 13 ) + 1;
out[ k ] = (SKP_int16)SKP_SAT16( tmp32 );
}
S[ 0 ] = S0;
S[ 1 ] = S1;
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -26,7 +23,6 @@ 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.
***********************************************************************/
/* *
@@ -38,11 +34,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "SKP_Silk_SigProc_FIX.h"
/* Second order ARMA filter, alternative implementation */
void SKP_Silk_biquad_alt(
const SKP_int16 *in, /* I: Input signal */
@@ -80,5 +71,3 @@ void SKP_Silk_biquad_alt(
out[ k ] = (SKP_int16)SKP_SAT16( SKP_RSHIFT( out32_Q14, 14 ) + 2 );
}
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -26,7 +23,6 @@ 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.
***********************************************************************/
/* *
@@ -45,11 +41,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define MAX_NB_SUBFR 4
#define QA 24
#define N_BITS_HEAD_ROOM 2
#define MIN_RSHIFTS -16
#define MAX_RSHIFTS (32 - QA)
@@ -98,11 +89,6 @@ void SKP_Silk_burg_modified(
C0 = SKP_LSHIFT32( C0, -rshifts_extra );
}
rshifts += rshifts_extra;
}
SKP_memset( C_first_row, 0, SigProc_MAX_ORDER_LPC * sizeof( SKP_int32 ) );
if( rshifts > 0 ) {
@@ -151,11 +137,6 @@ void SKP_Silk_burg_modified(
for( k = 0; k <= n; k++ ) {
CAf[ k ] = SKP_SMLAWB( CAf[ k ], tmp1, x_ptr[ n - k ] ); // Q( -rshift )
CAb[ k ] = SKP_SMLAWB( CAb[ k ], tmp2, x_ptr[ subfr_length - n + k - 1 ] ); // Q( -rshift )
}
}
} else {
@@ -205,10 +186,6 @@ void SKP_Silk_burg_modified(
num = SKP_ADD32( num, tmp2 ); // Q( -rshifts )
num = SKP_LSHIFT32( -num, 1 ); // Q( 1-rshifts )
/* Calculate the next order reflection (parcor) coefficient */
if( SKP_abs( num ) < nrg ) {
rc_Q31 = SKP_DIV32_varQ( num, nrg, 31 );
@@ -249,5 +226,3 @@ void SKP_Silk_burg_modified(
*res_nrg = SKP_SMLAWW( nrg, SKP_SMMUL( WhiteNoiseFrac_Q32, C0 ), -tmp1 ); // Q( -rshifts )
*res_nrg_Q = -rshifts;
}

View File

@@ -1,16 +1,8 @@
/***********************************************************************
Copyright (c) 2006-2010, 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
@@ -31,7 +23,6 @@ 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_FIX.h"
@@ -56,5 +47,3 @@ void SKP_Silk_bwexpander(
}
ar[ d - 1 ] = (SKP_int16)SKP_RSHIFT_ROUND( SKP_MUL( chirp_Q16, ar[ d - 1 ] ), 16 );
}

View File

@@ -1,10 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -29,7 +23,6 @@ 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_FIX.h"
@@ -51,8 +44,3 @@ void SKP_Silk_bwexpander_32(
}
ar[ d - 1 ] = SKP_SMULWW( ar[ d - 1 ], tmp_chirp_Q16 );
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -26,7 +23,6 @@ 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"
@@ -39,11 +35,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/* Encodes signs of excitation */
void SKP_Silk_encode_signs(
SKP_Silk_range_coder_state *sRC, /* I/O Range coder state */
const SKP_int q[], /* I Pulse signal */
const SKP_int length, /* I Length of input */
@@ -92,12 +83,5 @@ void SKP_Silk_decode_signs(
q[ i ] *= SKP_dec_map( data );
}
}
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -26,7 +23,6 @@ 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 SIGPROC_COMMON_PITCH_EST_DEFINES_H
@@ -42,10 +38,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define PITCH_EST_FRAME_LENGTH_MS 40 /* 40 ms */
#define PITCH_EST_MAX_FRAME_LENGTH (PITCH_EST_FRAME_LENGTH_MS * PITCH_EST_MAX_FS_KHZ)
#define PITCH_EST_MAX_FRAME_LENGTH_ST_1 (PITCH_EST_MAX_FRAME_LENGTH >> 2)
#define PITCH_EST_MAX_FRAME_LENGTH_ST_2 (PITCH_EST_MAX_FRAME_LENGTH >> 1)
@@ -82,5 +74,3 @@ extern const SKP_int16 SKP_Silk_cbk_offsets_stage3[ SigProc_PITCH_EST_MAX_COMPLE
#endif

View File

@@ -1,17 +1,9 @@
/***********************************************************************
Copyright (c) 2006-2010, 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
@@ -31,7 +23,6 @@ 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_FIX.h"
@@ -60,11 +51,6 @@ SKP_int SKP_Silk_control_encoder_FIX(
/* Only switch during low speech activity, when no frames are sitting in the payload buffer */
if( API_fs_kHz == 8 || fs_kHz == 0 || API_fs_kHz < fs_kHz ) {
// Switching is not possible, encoder just initialized, or internal mode higher than external
fs_kHz = API_fs_kHz;
} else {
@@ -113,11 +99,6 @@ SKP_int SKP_Silk_control_encoder_FIX(
}
#else
SKP_Silk_resample_2_3( &x_bufout[ 0 ], psEnc->sCmn.resample24To16state, &x_buf[ 0 ], SKP_LSHIFT( psEnc->sCmn.frame_length, 1 ) + psEnc->sCmn.la_shape );
#endif
/* set the first frame to zero, no performance difference was noticed though */
@@ -166,11 +147,6 @@ SKP_int SKP_Silk_control_encoder_FIX(
/* Check if we should switch from 16 to 12 kHz */
#if SWITCH_TRANSITION_FILTERING
if( ( psEnc->sCmn.sLP.transition_frame_no == 0 ) && /* Transition phase not active */
( psEnc->sCmn.bitrateDiff <= -ACCUM_BITS_DIFF_THRESHOLD ) &&
( psEnc->speech_activity_Q8 < 128 && psEnc->sCmn.nFramesInPayloadBuf == 0 ) ) {
psEnc->sCmn.sLP.transition_frame_no = 1; /* Begin transition phase */
@@ -219,11 +195,6 @@ SKP_int SKP_Silk_control_encoder_FIX(
SKP_memcpy( psEnc->x_buf, x_bufout, ( 2 * MAX_FRAME_LENGTH + LA_SHAPE_MAX ) * sizeof( SKP_int16 ) );
}
#if SWITCH_TRANSITION_FILTERING
psEnc->sCmn.sLP.transition_frame_no = 0; /* Transition phase complete */
#endif
}
@@ -272,11 +243,6 @@ SKP_int SKP_Silk_control_encoder_FIX(
SKP_memset( x_bufout, 0, 320 * sizeof( SKP_int16 ) );
SKP_memcpy( psEnc->x_buf, x_bufout, ( 2 * MAX_FRAME_LENGTH + LA_SHAPE_MAX ) * sizeof( SKP_int16 ) );
}
#if SWITCH_TRANSITION_FILTERING
psEnc->sCmn.sLP.mode = 1; /* Switch up */
#endif
@@ -325,11 +291,6 @@ SKP_int SKP_Silk_control_encoder_FIX(
SKP_memset( x_buf, 0, 160 * sizeof( SKP_int16 ) );
SKP_memcpy( psEnc->x_buf, x_buf, ( 2 * MAX_FRAME_LENGTH + LA_SHAPE_MAX ) * sizeof( SKP_int16 ) );
} else if( API_fs_kHz == 16 ) {
/* Intermediate upsampling of x_bufFIX from 12 to 16 kHz */
SKP_int16 x_buf16[ 3 * ( 2 * MAX_FRAME_LENGTH + LA_SHAPE_MAX ) / 2 ];
@@ -378,11 +339,6 @@ SKP_int SKP_Silk_control_encoder_FIX(
SKP_memcpy( x_buf, psEnc->x_buf, ( 2 * MAX_FRAME_LENGTH + LA_SHAPE_MAX ) * sizeof( SKP_int16 ) );
psEnc->sCmn.bitrateDiff = 0;
fs_kHz = 12;
@@ -431,11 +387,6 @@ SKP_int SKP_Silk_control_encoder_FIX(
}
}
#if SWITCH_TRANSITION_FILTERING
/* After switching up, stop transition filter during speech inactivity */
if( ( psEnc->sCmn.sLP.mode == 1 ) &&
@@ -484,11 +435,6 @@ SKP_int SKP_Silk_control_encoder_FIX(
psEnc->sCmn.prevLag = 100;
psEnc->sCmn.prev_sigtype = SIG_TYPE_UNVOICED;
psEnc->sCmn.first_frame_after_reset = 1;
psEnc->sPrefilt.lagPrev = 100;
psEnc->sShape.LastGainIndex = 1;
psEnc->sNSQ.lagPrev = 100;
@@ -537,11 +483,6 @@ SKP_int SKP_Silk_control_encoder_FIX(
psEnc->sCmn.nStatesDelayedDecision = 1;
psEnc->NoiseShapingQuantizer = SKP_Silk_NSQ;
psEnc->sCmn.useInterpolatedNLSFs = 0;
psEnc->sCmn.LTPQuantLowComplexity = 1;
psEnc->sCmn.NLSF_MSVQ_Survivors = MAX_NLSF_MSVQ_SURVIVORS_LC_MODE;
} else if( Complexity == 1 ) {
@@ -590,11 +531,6 @@ SKP_int SKP_Silk_control_encoder_FIX(
} else {
TargetRate_bps = SKP_max( TargetRate_bps, MIN_TARGET_RATE_SWB_BPS );
}
if( TargetRate_bps != psEnc->sCmn.TargetRate_bps ) {
psEnc->sCmn.TargetRate_bps = TargetRate_bps;
@@ -643,11 +579,6 @@ SKP_int SKP_Silk_control_encoder_FIX(
#if USE_LBRR
if( INBandFec_enabled < 0 || INBandFec_enabled > 1 ) {
ret = SKP_SILK_ENC_WRONG_INBAND_FEC_SETTING;
}
/* Only change settings if first frame in packet */
@@ -697,10 +628,6 @@ SKP_int SKP_Silk_control_encoder_FIX(
return ret;
}
/* Control low bitrate redundancy usage */
void SKP_Silk_LBRR_ctrl_FIX(
SKP_Silk_encoder_state_FIX *psEnc, /* I/O encoder state */
@@ -727,5 +654,3 @@ void SKP_Silk_LBRR_ctrl_FIX(
psEncCtrl->sCmn.LBRR_usage = SKP_SILK_NO_LBRR;
}
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -17,11 +14,6 @@ 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,
@@ -31,7 +23,6 @@ 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.
***********************************************************************/
/**********************************************************************
@@ -70,11 +61,6 @@ void SKP_Silk_corrVector_FIX(
} else {
SKP_assert( rshifts == 0 );
for( lag = 0; lag < order; lag++ ) {
Xt[ lag ] = SKP_Silk_inner_prod_aligned( ptr1, ptr2, L ); /* X[:,lag]'*t */
ptr1--; /* Go to next column of X */
}
@@ -124,10 +110,6 @@ void SKP_Silk_corrMatrix_FIX(
matrix_ptr( XX, j, j, order ) = energy;
}
ptr2 = &x[ order - 2 ]; /* First sample of column 1 of X */
/* Calculate the remaining elements of the correlation matrix */
if( rshifts_local > 0 ) {
@@ -168,5 +150,3 @@ void SKP_Silk_corrMatrix_FIX(
*rshifts = rshifts_local;
}

View File

@@ -1,13 +1,5 @@
/***********************************************************************
Copyright (c) 2006-2010, 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:
@@ -31,7 +23,6 @@ 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"
@@ -57,14 +48,8 @@ SKP_int SKP_Silk_init_decoder(
SKP_Silk_PLC_Reset( psDec );
psDec->bitstream_v = USE_BIT_STREAM_V;
return(0);
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -26,23 +23,16 @@ 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_SDK_API.h"
#include "SKP_Silk_main_FIX.h"
/****************************************/
/*********************/
/* Decoder functions */
/****************************************/
/*********************/
SKP_int SKP_Silk_SDK_Get_Decoder_Size( SKP_int32 *decSizeBytes )
{
SKP_int ret = 0;
@@ -51,7 +41,7 @@ SKP_int SKP_Silk_SDK_Get_Decoder_Size( SKP_int32 *decSizeBytes )
return ret;
}
/* Reset Decoder State */
/* Reset decoder state */
SKP_int SKP_Silk_SDK_InitDecoder(
void* decState /* I/O: State */
)
@@ -69,7 +59,7 @@ SKP_int SKP_Silk_SDK_InitDecoder(
/* Decode a frame */
SKP_int SKP_Silk_SDK_Decode(
void* decState, /* I/O: State */
SKP_SILK_SDK_DecControlStruct* decControl, /* I/O: Control Structure */
SKP_SILK_SDK_DecControlStruct* decControl, /* I/O: Control structure */
SKP_int lostFlag, /* I: 0: no loss, 1 loss */
const SKP_uint8 *inData, /* I: Encoded input vector */
const SKP_int nBytesIn, /* I: Number of input Bytes */
@@ -82,20 +72,15 @@ SKP_int SKP_Silk_SDK_Decode(
psDec = (SKP_Silk_decoder_state *)decState;
/*********************************************/
/**********************************/
/* Test if first frame in payload */
/*********************************************/
if( psDec->InternalDecoderFrames == 0 ) {
/**********************************/
if( psDec->moreInternalDecoderFrames == 0 ) {
/* First Frame in Payload */
psDec->nFramesDecoded = 0; /* Used to count frames in packet */
}
if( psDec->InternalDecoderFrames == 0 && /* First frame in packet */
if( psDec->moreInternalDecoderFrames == 0 && /* First frame in packet */
lostFlag == 0 && /* Not packet loss */
nBytesIn > MAX_ARITHM_BYTES ) { /* Too long payload */
/* Avoid trying to decode a too large packet */
@@ -113,25 +98,25 @@ SKP_int SKP_Silk_SDK_Decode(
if( used_bytes ) { /* Only Call if not a packet loss */
if( psDec->nBytesLeft > 0 && psDec->FrameTermination == SKP_SILK_MORE_FRAMES && psDec->nFramesDecoded < 5 ) {
/* We have more frames in the Payload */
psDec->InternalDecoderFrames = 1;
psDec->moreInternalDecoderFrames = 1;
} else {
/* Last frame in Payload */
psDec->InternalDecoderFrames = 0;
psDec->moreInternalDecoderFrames = 0;
psDec->nFramesInPacket = psDec->nFramesDecoded;
/* Track inband FEC usage */
if( psDec->vadFlag == VOICE_ACTIVITY ) {
if( psDec->FrameTermination == SKP_SILK_LAST_FRAME ) {
psDec->no_fec_counter++;
if( psDec->no_fec_counter > NO_LBRR_THRES ) {
psDec->inband_fec_offset = 0;
psDec->no_FEC_counter++;
if( psDec->no_FEC_counter > NO_LBRR_THRES ) {
psDec->inband_FEC_offset = 0;
}
} else if( psDec->FrameTermination == SKP_SILK_LBRR_VER1 ) {
psDec->inband_fec_offset = 1; /* FEC info with 1 packet delay */
psDec->no_fec_counter = 0;
psDec->inband_FEC_offset = 1; /* FEC info with 1 packet delay */
psDec->no_FEC_counter = 0;
} else if( psDec->FrameTermination == SKP_SILK_LBRR_VER2 ) {
psDec->inband_fec_offset = 2; /* FEC info with 2 packets delay */
psDec->no_fec_counter = 0;
psDec->inband_FEC_offset = 2; /* FEC info with 2 packets delay */
psDec->no_FEC_counter = 0;
}
}
}
@@ -144,11 +129,6 @@ SKP_int SKP_Silk_SDK_Decode(
/* Do any resampling if needed */
if( psDec->fs_kHz * 1000 != decControl->sampleRate ) {
SKP_int16 samplesOut_tmp[ 2 * MAX_FRAME_LENGTH ];
SKP_int32 scratch[ 3 * MAX_FRAME_LENGTH ];
/* Copy to a tmpbuffer as the resampling writes to samplesOut */
@@ -185,29 +165,24 @@ SKP_int SKP_Silk_SDK_Decode(
/* Copy all parameters that are needed out of internal structure to the control stucture */
decControl->frameSize = ( SKP_int )psDec->frame_length;
decControl->framesPerPacket = ( SKP_int )psDec->nFramesInPacket;
decControl->inBandFecOffset = (SKP_int)psDec->inband_fec_offset;
decControl->internalDecoderFrames = (SKP_int)psDec->InternalDecoderFrames;
decControl->inBandFECOffset = ( SKP_int )psDec->inband_FEC_offset;
decControl->moreInternalDecoderFrames = ( SKP_int )psDec->moreInternalDecoderFrames;
return ret;
}
/* Function to find LBRR information in a packet */
void SKP_Silk_SDK_search_for_LBRR(
void *decState, /* I/O: State Only used to update statistics */
const SKP_uint8 *indata, /* I: Encoded input vector */
void *decState, /* I: Decoder state, to select bitstream version only */
const SKP_uint8 *inData, /* I: Encoded input vector */
const SKP_int16 nBytesIn, /* I: Number of input Bytes */
SKP_int lost_offset, /* I: Offset from lost packet */
SKP_uint8 *LBRRdata, /* O: FEC payload */
SKP_int16 *nLBRRBytes /* O: Number of FEC Bytes */
SKP_uint8 *LBRRData, /* O: LBRR payload */
SKP_int16 *nLBRRBytes /* O: Number of LBRR Bytes */
)
{
SKP_Silk_decoder_state *psDec;
SKP_Silk_decoder_state sDec; // Local Decoder state to avoid interfering with running decoder */
SKP_Silk_decoder_state sDec; // Local decoder state to avoid interfering with running decoder */
SKP_Silk_decoder_control sDecCtrl;
SKP_int i, TempQ[ MAX_FRAME_LENGTH ];
@@ -222,22 +197,22 @@ void SKP_Silk_SDK_search_for_LBRR(
sDec.nFramesDecoded = 0;
sDec.fs_kHz = 0; /* Force update parameters LPC_order etc */
SKP_memset( sDec.prevNLSF_Q15, 0, MAX_LPC_ORDER * sizeof( SKP_int ) );
SKP_Silk_range_dec_init( &sDec.sRC, indata, (SKP_int32)nBytesIn );
SKP_Silk_range_dec_init( &sDec.sRC, inData, ( SKP_int32 )nBytesIn );
if( psDec->bitstream_v == BIT_STREAM_V4 ) { /* Silk_v3 payload */
if( psDec->bitstream_v == BIT_STREAM_V4 ) { /* Silk_v4 payload */
/* Decode all parameter indices for the whole packet*/
SKP_Silk_decode_indices_v4( &sDec );
/* Is there usable LBRR in this packet */
*nLBRRBytes = 0;
if( ( sDec.FrameTermination - 1 ) & lost_offset && sDec.FrameTermination > 0 && sDec.nBytesLeft >= 0 ) {
/* The Wanted FEC is present in the packet */
/* The wanted FEC is present in the packet */
for( i = 0; i < sDec.nFramesInPacket; i++ ) {
SKP_Silk_decode_parameters_v4( &sDec, &sDecCtrl, TempQ, 0 );
if( sDec.nBytesLeft <= 0 || sDec.sRC.error ) {
/* Corrupt stream */
LBRRdata = NULL;
LBRRData = NULL;
*nLBRRBytes = 0;
break;
} else {
@@ -245,16 +220,11 @@ void SKP_Silk_SDK_search_for_LBRR(
}
}
if( LBRRdata != NULL ){
/* The Wanted FEC is present in the packet */
if( LBRRData != NULL ) {
/* The wanted FEC is present in the packet */
*nLBRRBytes = sDec.nBytesLeft;
SKP_memcpy( LBRRdata, &indata[nBytesIn - sDec.nBytesLeft], sDec.nBytesLeft * sizeof(SKP_uint8));
SKP_memcpy( LBRRData, &inData[ nBytesIn - sDec.nBytesLeft ], sDec.nBytesLeft * sizeof( SKP_uint8 ) );
}
}
} else { /* Silk_v3 payload */
while(1) {
@@ -267,15 +237,15 @@ void SKP_Silk_SDK_search_for_LBRR(
};
if( ( sDec.FrameTermination - 1 ) & lost_offset && sDec.FrameTermination > 0 && sDec.nBytesLeft >= 0 ) {
/* The Wanted FEC is present in the packet */
/* The wanted FEC is present in the packet */
*nLBRRBytes = sDec.nBytesLeft;
SKP_memcpy( LBRRdata, &indata[nBytesIn - sDec.nBytesLeft], sDec.nBytesLeft * sizeof(SKP_uint8));
SKP_memcpy( LBRRData, &inData[ nBytesIn - sDec.nBytesLeft ], sDec.nBytesLeft * sizeof( SKP_uint8 ) );
break;
}
if( sDec.nBytesLeft > 0 && sDec.FrameTermination == SKP_SILK_MORE_FRAMES ) {
sDec.nFramesDecoded++;
} else {
LBRRdata = NULL;
LBRRData = NULL;
*nLBRRBytes = 0;
break;
}
@@ -285,9 +255,9 @@ void SKP_Silk_SDK_search_for_LBRR(
/* Getting type of content for a packet */
void SKP_Silk_SDK_get_TOC(
void *decState, /* I/O: State Only used to select bitstream version */
const SKP_uint8 *indata, /* I: Encoded input vector */
const SKP_int16 nBytesIn, /* I: Number of input Bytes */
void *decState, /* I/O: Decoder state, to select bitstream version only */
const SKP_uint8 *inData, /* I: Encoded input vector */
const SKP_int16 nBytesIn, /* I: Number of input bytes */
SKP_Silk_TOC_struct *Silk_TOC /* O: Type of content */
)
{
@@ -300,14 +270,9 @@ void SKP_Silk_SDK_get_TOC(
sDec.nFramesDecoded = 0;
sDec.fs_kHz = 0; /* Force update parameters LPC_order etc */
SKP_Silk_range_dec_init( &sDec.sRC, indata, (SKP_int32)nBytesIn );
SKP_Silk_range_dec_init( &sDec.sRC, inData, ( SKP_int32 )nBytesIn );
if( psDec->bitstream_v == BIT_STREAM_V4 ) { /* Silk_v4 payload */
/* Decode all parameter indices for the whole packet*/
SKP_Silk_decode_indices_v4( &sDec );
@@ -324,7 +289,7 @@ void SKP_Silk_SDK_get_TOC(
} else {
Silk_TOC->inbandLBRR = sDec.FrameTermination - 1;
}
/* use memcpy */
/* Copy data */
for( i = 0; i < sDec.nFramesInPacket; i++ ) {
Silk_TOC->vadFlags[ i ] = sDec.vadFlagBuf[ i ];
Silk_TOC->sigtypeFlags[ i ] = sDec.sigtype[ i ];
@@ -352,15 +317,10 @@ void SKP_Silk_SDK_get_TOC(
}
if( Silk_TOC->corrupt || sDec.FrameTermination == SKP_SILK_MORE_FRAMES ||
sDec.nFramesInPacket > SILK_MAX_FRAMES_PER_PACKET ) {
/* corrupt packet */
/* Corrupt packet */
SKP_memset( Silk_TOC, 0, sizeof( SKP_Silk_TOC_struct ) );
Silk_TOC->corrupt = 1;
} else {
Silk_TOC->framesInPacket = sDec.nFramesDecoded;
Silk_TOC->fs_kHz = sDec.fs_kHz;
if( sDec.FrameTermination == SKP_SILK_LAST_FRAME ) {
@@ -372,13 +332,12 @@ void SKP_Silk_SDK_get_TOC(
}
}
/*********************************/
/**************************/
/* Get the version number */
/*********************************/
/**************************/
/* Return a pointer to string specifying the version */
const char *SKP_Silk_SDK_get_version()
{
static const char version[] = "1.0.2";
return version;
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -24,25 +21,19 @@ 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"
/**********************************************************/
/* Core Decoder. Performs inverse NSQ operation LTP + LPC */
/* Core decoder. Performs inverse NSQ operation LTP + LPC */
/**********************************************************/
void SKP_Silk_decode_core(
SKP_Silk_decoder_state *psDec, /* I/O Decoder state */
SKP_Silk_decoder_control *psDecCtrl, /* I Decoder control */
SKP_int16 xq[], /* O Decoded Speech */
SKP_int16 xq[], /* O Decoded speech */
const SKP_int q[ MAX_FRAME_LENGTH ] /* I Pulse signal */
)
{
@@ -78,10 +69,6 @@ void SKP_Silk_decode_core(
}
pexc_Q10 = psDec->exc_Q10;
pres_Q10 = psDec->res_Q10;
pxq = &psDec->outBuf[ psDec->frame_length ];
@@ -89,6 +76,7 @@ void SKP_Silk_decode_core(
/* Loop over subframes */
for( k = 0; k < NB_SUBFR; k++ ) {
A_Q12 = psDecCtrl->PredCoef_Q12[ k >> 1 ];
/* Preload LPC coeficients to array on stack. Gives small performance gain */
SKP_memcpy( A_Q12_tmp, A_Q12, psDec->LPC_order * sizeof( SKP_int16 ) );
B_Q14 = &psDecCtrl->LTPCoef_Q14[ k * LTP_ORDER ];
@@ -105,7 +93,7 @@ void SKP_Silk_decode_core(
gain_adj_Q16 = SKP_DIV32_varQ( inv_gain_Q16, psDec->prev_inv_gain_Q16, 16 );
}
/* Avoid abroupt transition from voiced PLC to unvoiced normal decoding */
/* Avoid abrupt transition from voiced PLC to unvoiced normal decoding */
if( psDec->lossCnt && psDec->prev_sigtype == SIG_TYPE_VOICED &&
psDecCtrl->sigtype == SIG_TYPE_UNVOICED && k < ( NB_SUBFR >> 1 ) ) {
@@ -124,17 +112,12 @@ void SKP_Silk_decode_core(
if( ( k & ( 3 - SKP_LSHIFT( NLSF_interpolation_flag, 1 ) ) ) == 0 ) {
/* Rewhiten with new A coefs */
start_idx = psDec->frame_length - lag - psDec->LPC_order - LTP_ORDER / 2;
start_idx = SKP_LIMIT( start_idx, 0, psDec->frame_length - psDec->LPC_order ); // Limit
start_idx = SKP_LIMIT( start_idx, 0, psDec->frame_length - psDec->LPC_order );
SKP_Silk_MA_Prediction( &psDec->outBuf[ start_idx + k * ( psDec->frame_length >> 2 ) ],
A_Q12, FiltState, sLTP + start_idx, psDec->frame_length - start_idx, psDec->LPC_order );
/* After rewhitening the LTP state is un-scaled */
/* After rewhitening the LTP state is unscaled */
inv_gain_Q32 = SKP_LSHIFT( inv_gain_Q16, 16 );
if( k == 0 ) {
/* Do LTP downscaling */
@@ -153,12 +136,12 @@ void SKP_Silk_decode_core(
}
}
/* scale short term state */
/* Scale short term state */
for( i = 0; i < MAX_LPC_ORDER; i++ ) {
psDec->sLPC_Q14[ i ] = SKP_SMULWW( gain_adj_Q16, psDec->sLPC_Q14[ i ] );
}
/* save inv_gain */
/* Save inv_gain */
SKP_assert( inv_gain_Q16 != 0 );
psDec->prev_inv_gain_Q16 = inv_gain_Q16;
@@ -183,11 +166,6 @@ void SKP_Silk_decode_core(
psDec->sLTP_Q16[ psDec->sLTP_buf_idx ] = SKP_LSHIFT( pres_Q10[ i ], 6 );
psDec->sLTP_buf_idx++;
}
} else {
SKP_memcpy( pres_Q10, pexc_Q10, psDec->subfr_length * sizeof( SKP_int32 ) );
}
@@ -236,11 +214,6 @@ void SKP_Silk_decode_core(
SKP_assert( psDec->LPC_order == 10 );
for( i = 0; i < psDec->subfr_length; i++ ) {
/* unrolled */
Atmp = *( ( SKP_int32* )&A_Q12_tmp[ 0 ] ); /* read two coefficients at once */
LPC_pred_Q10 = SKP_SMULWB( psDec->sLPC_Q14[ MAX_LPC_ORDER + i - 1 ], Atmp );
LPC_pred_Q10 = SKP_SMLAWT( LPC_pred_Q10, psDec->sLPC_Q14[ MAX_LPC_ORDER + i - 2 ], Atmp );
@@ -281,5 +254,3 @@ void SKP_Silk_decode_core(
SKP_memcpy( xq, &psDec->outBuf[ psDec->frame_length ], psDec->frame_length * sizeof( SKP_int16 ) );
}

View File

@@ -1,13 +1,5 @@
/***********************************************************************
Copyright (c) 2006-2010, 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:
@@ -31,7 +23,6 @@ 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.
***********************************************************************/
@@ -56,11 +47,6 @@ SKP_int SKP_Silk_decode_frame(
SKP_int Pulses[ MAX_FRAME_LENGTH ];
L = psDec->frame_length;
sDecCtrl.LTP_scale_Q14 = 0;
@@ -109,11 +95,6 @@ SKP_int SKP_Silk_decode_frame(
*decBytes = psDec->sRC.bufferLength;
if( psDec->sRC.error == RANGE_CODER_DEC_PAYLOAD_TOO_LONG ) {
ret = SKP_SILK_DEC_PAYLOAD_TOO_LARGE;
} else {
ret = SKP_SILK_DEC_PAYLOAD_ERROR;
@@ -162,11 +143,6 @@ SKP_int SKP_Silk_decode_frame(
/****************************************************************/
SKP_Silk_PLC_glue_frames( psDec, &sDecCtrl, pOut, L );
/************************************************/
/* Comfort noise generation / estimation */
/************************************************/
@@ -189,5 +165,3 @@ SKP_int SKP_Silk_decode_frame(
return ret;
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -21,27 +18,21 @@ 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 indices from payload */
void SKP_Silk_decode_indices_v4(
SKP_Silk_decoder_state *psDec /* I/O....State */
SKP_Silk_decoder_state *psDec /* I/O State */
)
{
SKP_int i, k, Ix, fs_kHz_dec, FramesInPacket = 0, FrameTermination;
SKP_int i, k, Ix, fs_kHz_dec, FrameIndex = 0, FrameTermination;
SKP_int sigtype, QuantOffsetType, seed_int, nBytesUsed;
SKP_int decode_absolute_lagIndex, delta_lagIndex, prev_lagIndex = 0;
const SKP_Silk_NLSF_CB_struct *psNLSF_CB = NULL;
@@ -61,25 +52,20 @@ void SKP_Silk_decode_indices_v4(
fs_kHz_dec = SKP_Silk_SamplingRates_table[ Ix ];
SKP_Silk_decoder_set_fs( psDec, fs_kHz_dec );
FramesInPacket = 0;
FrameIndex = 0;
FrameTermination = SKP_SILK_MORE_FRAMES;
}
while( FrameTermination == SKP_SILK_MORE_FRAMES ) {
/*********************************************/
/*******************/
/* Decode VAD flag */
/*********************************************/
SKP_Silk_range_decoder( &psDec->vadFlagBuf[ FramesInPacket ], psRC, SKP_Silk_vadflag_CDF, SKP_Silk_vadflag_offset );
/*******************/
SKP_Silk_range_decoder( &psDec->vadFlagBuf[ FrameIndex ], psRC, SKP_Silk_vadflag_CDF, SKP_Silk_vadflag_offset );
/*******************************************/
/* Decode signal type and quantizer offset */
/*******************************************/
if( FramesInPacket == 0 ) {
if( FrameIndex == 0 ) {
/* first frame in packet: independent coding */
SKP_Silk_range_decoder( &Ix, psRC, SKP_Silk_type_offset_CDF, SKP_Silk_type_offset_CDF_offset );
} else {
@@ -95,17 +81,17 @@ void SKP_Silk_decode_indices_v4(
/* Decode gains */
/****************/
/* first subframe */
if( FramesInPacket == 0 ) {
if( FrameIndex == 0 ) {
/* first frame in packet: independent coding */
SKP_Silk_range_decoder( &psDec->GainsIndices[ FramesInPacket ][ 0 ], psRC, SKP_Silk_gain_CDF[ sigtype ], SKP_Silk_gain_CDF_offset );
SKP_Silk_range_decoder( &psDec->GainsIndices[ FrameIndex ][ 0 ], psRC, SKP_Silk_gain_CDF[ sigtype ], SKP_Silk_gain_CDF_offset );
} else {
/* condidtional coding */
SKP_Silk_range_decoder( &psDec->GainsIndices[ FramesInPacket ][ 0 ], psRC, SKP_Silk_delta_gain_CDF, SKP_Silk_delta_gain_CDF_offset );
SKP_Silk_range_decoder( &psDec->GainsIndices[ FrameIndex ][ 0 ], psRC, SKP_Silk_delta_gain_CDF, SKP_Silk_delta_gain_CDF_offset );
}
/* remaining subframes */
for( i = 1; i < NB_SUBFR; i++ ) {
SKP_Silk_range_decoder( &psDec->GainsIndices[ FramesInPacket ][ i ], psRC, SKP_Silk_delta_gain_CDF, SKP_Silk_delta_gain_CDF_offset );
SKP_Silk_range_decoder( &psDec->GainsIndices[ FrameIndex ][ i ], psRC, SKP_Silk_delta_gain_CDF, SKP_Silk_delta_gain_CDF_offset );
}
/**********************/
@@ -116,93 +102,83 @@ void SKP_Silk_decode_indices_v4(
psNLSF_CB = psDec->psNLSF_CB[ sigtype ];
/* Arithmetically decode NLSF path */
SKP_Silk_range_decoder_multi( psDec->NLSFIndices[ FramesInPacket ], psRC, psNLSF_CB->StartPtr, psNLSF_CB->MiddleIx, psNLSF_CB->nStages );
SKP_Silk_range_decoder_multi( psDec->NLSFIndices[ FrameIndex ], psRC, psNLSF_CB->StartPtr, psNLSF_CB->MiddleIx, psNLSF_CB->nStages );
/***********************************/
/* Decode LSF interpolation factor */
/***********************************/
SKP_Silk_range_decoder( &psDec->NLSFInterpCoef_Q2[ FramesInPacket ], psRC, SKP_Silk_NLSF_interpolation_factor_CDF,
SKP_Silk_range_decoder( &psDec->NLSFInterpCoef_Q2[ FrameIndex ], psRC, SKP_Silk_NLSF_interpolation_factor_CDF,
SKP_Silk_NLSF_interpolation_factor_offset );
if( sigtype == SIG_TYPE_VOICED ) {
/*********************/
/* Decode pitch lags */
/*********************/
/* Get lag index */
decode_absolute_lagIndex = 1;
if( FramesInPacket > 0 && psDec->sigtype[ FramesInPacket - 1 ] == SIG_TYPE_VOICED ) {
if( FrameIndex > 0 && psDec->sigtype[ FrameIndex - 1 ] == SIG_TYPE_VOICED ) {
/* Decode Delta index */
SKP_Silk_range_decoder( &delta_lagIndex,psRC, SKP_Silk_pitch_delta_CDF, SKP_Silk_pitch_delta_CDF_offset );
if( delta_lagIndex < ( MAX_DELTA_LAG << 1 ) + 1 ) {
delta_lagIndex = delta_lagIndex - MAX_DELTA_LAG;
psDec->lagIndex[ FramesInPacket ] = prev_lagIndex + delta_lagIndex;
psDec->lagIndex[ FrameIndex ] = prev_lagIndex + delta_lagIndex;
decode_absolute_lagIndex = 0;
}
}
if( decode_absolute_lagIndex ) {
/* Absolute decoding */
if( psDec->fs_kHz == 8 ) {
SKP_Silk_range_decoder( &psDec->lagIndex[ FramesInPacket ], psRC, SKP_Silk_pitch_lag_NB_CDF, SKP_Silk_pitch_lag_NB_CDF_offset );
SKP_Silk_range_decoder( &psDec->lagIndex[ FrameIndex ], psRC, SKP_Silk_pitch_lag_NB_CDF, SKP_Silk_pitch_lag_NB_CDF_offset );
} else if( psDec->fs_kHz == 12 ) {
SKP_Silk_range_decoder( &psDec->lagIndex[ FramesInPacket ], psRC, SKP_Silk_pitch_lag_MB_CDF, SKP_Silk_pitch_lag_MB_CDF_offset );
SKP_Silk_range_decoder( &psDec->lagIndex[ FrameIndex ], psRC, SKP_Silk_pitch_lag_MB_CDF, SKP_Silk_pitch_lag_MB_CDF_offset );
} else if( psDec->fs_kHz == 16 ) {
SKP_Silk_range_decoder( &psDec->lagIndex[ FramesInPacket ], psRC, SKP_Silk_pitch_lag_WB_CDF, SKP_Silk_pitch_lag_WB_CDF_offset );
SKP_Silk_range_decoder( &psDec->lagIndex[ FrameIndex ], psRC, SKP_Silk_pitch_lag_WB_CDF, SKP_Silk_pitch_lag_WB_CDF_offset );
} else {
SKP_Silk_range_decoder( &psDec->lagIndex[ FramesInPacket ], psRC, SKP_Silk_pitch_lag_SWB_CDF, SKP_Silk_pitch_lag_SWB_CDF_offset );
SKP_Silk_range_decoder( &psDec->lagIndex[ FrameIndex ], psRC, SKP_Silk_pitch_lag_SWB_CDF, SKP_Silk_pitch_lag_SWB_CDF_offset );
}
}
prev_lagIndex = psDec->lagIndex[ FramesInPacket ];
prev_lagIndex = psDec->lagIndex[ FrameIndex ];
/* Get countour index */
if( psDec->fs_kHz == 8 ) {
/* Less codevectors used in 8 khz mode */
SKP_Silk_range_decoder( &psDec->contourIndex[ FramesInPacket ], psRC, SKP_Silk_pitch_contour_NB_CDF, SKP_Silk_pitch_contour_NB_CDF_offset );
SKP_Silk_range_decoder( &psDec->contourIndex[ FrameIndex ], psRC, SKP_Silk_pitch_contour_NB_CDF, SKP_Silk_pitch_contour_NB_CDF_offset );
} else {
/* Joint for 12, 16, and 24 khz */
SKP_Silk_range_decoder( &psDec->contourIndex[ FramesInPacket ], psRC, SKP_Silk_pitch_contour_CDF, SKP_Silk_pitch_contour_CDF_offset );
SKP_Silk_range_decoder( &psDec->contourIndex[ FrameIndex ], psRC, SKP_Silk_pitch_contour_CDF, SKP_Silk_pitch_contour_CDF_offset );
}
/********************/
/* Decode LTP gains */
/********************/
/* Decode PERIndex value */
SKP_Silk_range_decoder( &psDec->PERIndex[ FramesInPacket ], psRC, SKP_Silk_LTP_per_index_CDF, SKP_Silk_LTP_per_index_CDF_offset );
SKP_Silk_range_decoder( &psDec->PERIndex[ FrameIndex ], psRC, SKP_Silk_LTP_per_index_CDF, SKP_Silk_LTP_per_index_CDF_offset );
for( k = 0; k < NB_SUBFR; k++ ) {
SKP_Silk_range_decoder( &psDec->LTPIndex[ FramesInPacket ][ k ], psRC, SKP_Silk_LTP_gain_CDF_ptrs[ psDec->PERIndex[ FramesInPacket ] ],
SKP_Silk_LTP_gain_CDF_offsets[ psDec->PERIndex[ FramesInPacket ] ] );
SKP_Silk_range_decoder( &psDec->LTPIndex[ FrameIndex ][ k ], psRC, SKP_Silk_LTP_gain_CDF_ptrs[ psDec->PERIndex[ FrameIndex ] ],
SKP_Silk_LTP_gain_CDF_offsets[ psDec->PERIndex[ FrameIndex ] ] );
}
/**********************/
/* Decode LTP scaling */
/**********************/
SKP_Silk_range_decoder( &psDec->LTP_scaleIndex[ FramesInPacket ], psRC, SKP_Silk_LTPscale_CDF, SKP_Silk_LTPscale_offset );
SKP_Silk_range_decoder( &psDec->LTP_scaleIndex[ FrameIndex ], psRC, SKP_Silk_LTPscale_CDF, SKP_Silk_LTPscale_offset );
}
/***************/
/* Decode seed */
/***************/
SKP_Silk_range_decoder( &seed_int, psRC, SKP_Silk_Seed_CDF, SKP_Silk_Seed_offset );
psDec->Seed[ FramesInPacket ] = (SKP_int32)seed_int;
psDec->Seed[ FrameIndex ] = ( SKP_int32 )seed_int;
/**************************************/
/* Decode Frame termination indicator */
/**************************************/
SKP_Silk_range_decoder( &FrameTermination, psRC, SKP_Silk_FrameTermination_v4_CDF, SKP_Silk_FrameTermination_v4_offset );
psDec->sigtype[ FramesInPacket ] = sigtype;
psDec->QuantOffsetType[ FramesInPacket ] = QuantOffsetType;
psDec->sigtype[ FrameIndex ] = sigtype;
psDec->QuantOffsetType[ FrameIndex ] = QuantOffsetType;
FramesInPacket++;
FrameIndex++;
}
/****************************************/
@@ -214,8 +190,6 @@ void SKP_Silk_decode_indices_v4(
psRC->error = RANGE_CODER_READ_BEYOND_BUFFER;
}
psDec->nFramesInPacket = FramesInPacket;
psDec->nFramesInPacket = FrameIndex;
psDec->FrameTermination = FrameTermination;
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -11,11 +8,6 @@ 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.
@@ -31,7 +23,6 @@ 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"
@@ -64,11 +55,6 @@ void SKP_Silk_decode_parameters(
if( Ix < 0 || Ix > 3 ) {
psRC->error = RANGE_CODER_ILLEGAL_SAMPLING_RATE;
return;
}
fs_kHz_dec = SKP_Silk_SamplingRates_table[ Ix ];
SKP_Silk_decoder_set_fs( psDec, fs_kHz_dec );
@@ -108,20 +94,15 @@ void SKP_Silk_decode_parameters(
/* Dequant Gains */
SKP_Silk_gains_dequant( psDecCtrl->Gains_Q16, GainsIndices, &psDec->LastGainIndex, psDec->nFramesDecoded );
/***************/
/* Decode LSFs */
/***************/
/* Set pointer to LSF VQ CB for the current signal type */
/****************/
/* Decode NLSFs */
/****************/
/* Set pointer to NLSF VQ CB for the current signal type */
psNLSF_CB = psDec->psNLSF_CB[ psDecCtrl->sigtype ];
/* Arithmetically decode NLSF path */
SKP_Silk_range_decoder_multi( NLSFIndices, psRC, psNLSF_CB->StartPtr, psNLSF_CB->MiddleIx, psNLSF_CB->nStages );
/* From the NLSF path, decode an NLSF vector */
SKP_Silk_NLSF_MSVQ_decode( pNLSF_Q15, psNLSF_CB, NLSFIndices, psDec->LPC_order );
@@ -170,11 +151,6 @@ void SKP_Silk_decode_parameters(
/*********************/
/* Decode pitch lags */
/*********************/
/* Get lag index */
if( psDec->fs_kHz == 8 ) {
SKP_Silk_range_decoder( &Ixs[ 0 ], psRC, SKP_Silk_pitch_lag_NB_CDF, SKP_Silk_pitch_lag_NB_CDF_offset );
@@ -223,11 +199,6 @@ void SKP_Silk_decode_parameters(
SKP_Silk_range_decoder( &Ix, psRC, SKP_Silk_LTPscale_CDF, SKP_Silk_LTPscale_offset );
psDecCtrl->LTP_scale_Q14 = SKP_Silk_LTPScales_table_Q14[ Ix ];
} else {
SKP_memset( psDecCtrl->pitchL, 0, NB_SUBFR * sizeof( SKP_int ) );
SKP_memset( psDecCtrl->LTPCoef_Q14, 0, NB_SUBFR * LTP_ORDER * sizeof( SKP_int16 ) );
psDecCtrl->PERIndex = 0;
@@ -270,5 +241,3 @@ void SKP_Silk_decode_parameters(
SKP_Silk_range_coder_check_after_decoding( psRC );
}
}

View File

@@ -1,11 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -30,7 +23,6 @@ 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"
@@ -54,26 +46,21 @@ void SKP_Silk_decode_parameters_v4(
psDecCtrl->QuantOffsetType = psDec->QuantOffsetType[ psDec->nFramesDecoded ];
psDec->vadFlag = psDec->vadFlagBuf[ psDec->nFramesDecoded ];
psDecCtrl->NLSFInterpCoef_Q2 = psDec->NLSFInterpCoef_Q2[ psDec->nFramesDecoded ];
psDecCtrl->Seed = psDec->Seed[ psDec->nFramesDecoded ];
/* Dequant Gains */
SKP_Silk_gains_dequant( psDecCtrl->Gains_Q16, psDec->GainsIndices[ psDec->nFramesDecoded ], &psDec->LastGainIndex, psDec->nFramesDecoded );
/***************/
/* Decode LSFs */
/***************/
/****************/
/* Decode NLSFs */
/****************/
/* Set pointer to LSF VQ CB for the current signal type */
/* Set pointer to NLSF VQ CB for the current signal type */
psNLSF_CB = psDec->psNLSF_CB[ psDecCtrl->sigtype ];
/* From the LSF path, decode an LSF vector */
/* From the NLSF path, decode an NLSF vector */
SKP_Silk_NLSF_MSVQ_decode( pNLSF_Q15, psNLSF_CB, psDec->NLSFIndices[ psDec->nFramesDecoded ], psDec->LPC_order );
/* Convert LSF parameters to AR prediction filter coefficients */
/* Convert NLSF parameters to AR prediction filter coefficients */
SKP_Silk_NLSF2A_stable( psDecCtrl->PredCoef_Q12[ 1 ], pNLSF_Q15, psDec->LPC_order );
/* If just reset, e.g., because internal Fs changed, do not allow interpolation */
@@ -83,14 +70,14 @@ void SKP_Silk_decode_parameters_v4(
}
if( psDecCtrl->NLSFInterpCoef_Q2 < 4 ) {
/* Calculation of the interpolated LSF0 vector from the interpolation factor, */
/* the previous LSF1, and the current LSF1 */
/* Calculation of the interpolated NLSF0 vector from the interpolation factor, */
/* the previous NLSF1, and the current NLSF1 */
for( i = 0; i < psDec->LPC_order; i++ ) {
pNLSF0_Q15[ i ] = psDec->prevNLSF_Q15[ i ] + SKP_RSHIFT( SKP_MUL( psDecCtrl->NLSFInterpCoef_Q2,
( pNLSF_Q15[ i ] - psDec->prevNLSF_Q15[ i ] ) ), 2 );
}
/* Convert LSF parameters to AR prediction filter coefficients */
/* Convert NLSF parameters to AR prediction filter coefficients */
SKP_Silk_NLSF2A_stable( psDecCtrl->PredCoef_Q12[ 0 ], pNLSF0_Q15, psDec->LPC_order );
} else {
/* Copy LPC coefficients for first half from second half */
@@ -107,11 +94,6 @@ void SKP_Silk_decode_parameters_v4(
}
if( psDecCtrl->sigtype == SIG_TYPE_VOICED ) {
/*********************/
/* Decode pitch lags */
/*********************/
@@ -161,10 +143,6 @@ void SKP_Silk_decode_parameters_v4(
psRC->error = RANGE_CODER_READ_BEYOND_BUFFER;
}
/****************************************/
/* check remaining bits in last byte */
/****************************************/
@@ -177,5 +155,3 @@ void SKP_Silk_decode_parameters_v4(
psDec->FrameTermination = SKP_SILK_LAST_FRAME;
}
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -26,16 +23,10 @@ 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 quantization indices of excitation */
/*********************************************/
@@ -84,11 +75,6 @@ void SKP_Silk_decode_pulses(
SKP_Silk_shell_decoder( &q[ SKP_SMULBB( i, SHELL_CODEC_FRAME_LENGTH ) ], psRC, sum_pulses[ i ] );
} else {
SKP_memset( &q[ SKP_SMULBB( i, SHELL_CODEC_FRAME_LENGTH ) ], 0, SHELL_CODEC_FRAME_LENGTH * sizeof( SKP_int ) );
}
}
@@ -117,5 +103,3 @@ void SKP_Silk_decode_pulses(
SKP_Silk_decode_signs( psRC, q, frame_length, psDecCtrl->sigtype,
psDecCtrl->QuantOffsetType, psDecCtrl->RateLevelIndex);
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -15,11 +12,6 @@ documentation and/or other materials provided with the distribution.
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
@@ -31,7 +23,6 @@ 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"
@@ -68,11 +59,6 @@ void SKP_Silk_decoder_set_fs(
if( fs_kHz == 24 ) {
psDec->HP_A = SKP_Silk_Dec_A_HP_24;
psDec->HP_B = SKP_Silk_Dec_B_HP_24;
} else if( fs_kHz == 16 ) {
psDec->HP_A = SKP_Silk_Dec_A_HP_16;
@@ -93,5 +79,3 @@ void SKP_Silk_decoder_set_fs(
SKP_assert( psDec->frame_length > 0 && psDec->frame_length <= MAX_FRAME_LENGTH );
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -23,15 +20,9 @@ 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_DEFINE_H
@@ -76,11 +67,6 @@ extern "C"
#define TARGET_RATE_TAB_SZ 8
/* DTX settings */
#define NO_SPEECH_FRAMES_BEFORE_DTX 5 /* eq 100 ms */
#define MAX_CONSECUTIVE_DTX 20 /* eq 400 ms */
@@ -129,11 +115,6 @@ extern "C"
# define SWITCH_TRANSITION_FILTERING 1
#else
# define SWITCH_TRANSITION_FILTERING 0
#endif
#endif
@@ -182,11 +163,6 @@ extern "C"
#define RANGE_CODER_CDF_OUT_OF_RANGE -2
#define RANGE_CODER_NORMALIZATION_FAILED -3
#define RANGE_CODER_ZERO_INTERVAL_WIDTH -4
#define RANGE_CODER_DECODER_CHECK_FAILED -5
#define RANGE_CODER_READ_BEYOND_BUFFER -6
#define RANGE_CODER_ILLEGAL_SAMPLING_RATE -7
@@ -235,11 +211,6 @@ extern "C"
/* Length of LPC window used in noise shape analysis */
#define SHAPE_LPC_WIN_MS 15
#define SHAPE_LPC_WIN_16_KHZ (SHAPE_LPC_WIN_MS * 16)
#define SHAPE_LPC_WIN_24_KHZ (SHAPE_LPC_WIN_MS * 24)
#define SHAPE_LPC_WIN_MAX (SHAPE_LPC_WIN_MS * MAX_FS_KHZ)
@@ -288,11 +259,6 @@ extern "C"
/* Sigmoid settings */
#define VAD_NEGATIVE_OFFSET_Q5 128 /* sigmoid is 0 at -128 */
#define VAD_SNR_FACTOR_Q16 45000
/* smoothing for SNR measurement */
@@ -341,11 +307,6 @@ extern "C"
# define TRANSITION_FRAMES_UP ( TRANSITION_TIME_UP_MS / FRAME_LENGTH_MS )
# define TRANSITION_FRAMES_DOWN ( TRANSITION_TIME_DOWN_MS / FRAME_LENGTH_MS )
# define TRANSITION_INT_STEPS_UP ( TRANSITION_FRAMES_UP / ( TRANSITION_INT_NUM - 1 ) )
# define TRANSITION_INT_STEPS_DOWN ( TRANSITION_FRAMES_DOWN / ( TRANSITION_INT_NUM - 1 ) )
#endif
@@ -367,5 +328,3 @@ extern "C"
#endif
#endif

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -22,16 +19,10 @@ 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_DEFINE_FIX_H
@@ -75,11 +66,6 @@ extern "C"
#define LTP_SMOOTHING_Q26 6710886
/* LTP quantization settings */
#define MU_LTP_QUANT_NB_Q8 8
#define MU_LTP_QUANT_MB_Q8 6
#define MU_LTP_QUANT_WB_Q8 5
@@ -109,5 +95,3 @@ extern "C"
#endif
#endif

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -14,11 +11,6 @@ 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,
@@ -31,7 +23,6 @@ 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.
***********************************************************************/
/*
@@ -67,11 +58,6 @@ void SKP_Silk_detect_SWB_input(
/* Calculate energy in HP signal */
SKP_Silk_sum_sqr_shift( &energy_32, &shift, in_HP_8_kHz, HP_8_kHz_len );
/* Count concecutive samples above threshold, after adjusting threshold for number of input samples and shift */
if( energy_32 > SKP_RSHIFT( SKP_SMULBB( HP_8_KHZ_THRES, HP_8_kHz_len ), shift ) ) {
psSWBdetect->ConsecSmplsAboveThres += nSamplesIn;
@@ -88,5 +74,3 @@ void SKP_Silk_detect_SWB_input(
psSWBdetect->WB_detected = 1;
}
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -26,12 +23,6 @@ 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.
***********************************************************************/
@@ -80,11 +71,6 @@ SKP_int SKP_Silk_SDK_QueryEncoder(
}
/*************************/
/* Init or Reset encoder */
/*************************/
SKP_int SKP_Silk_SDK_InitEncoder(
@@ -133,11 +119,6 @@ SKP_int SKP_Silk_SDK_Encode(
SKP_assert( encControl != NULL );
/* Check sampling frequency first, to avoid divide by zero later */
if( ( encControl->sampleRate != 8000 ) && ( encControl->sampleRate != 12000 ) &&
( encControl->sampleRate != 16000 ) && ( encControl->sampleRate != 24000 ) ) {
@@ -151,9 +132,9 @@ SKP_int SKP_Silk_SDK_Encode(
PacketSize_ms = SKP_DIV32_16( ( SKP_int )encControl->packetSize, API_fs_kHz ); /* convert samples -> ms */
TargetRate_bps = ( SKP_int32 )encControl->bitRate;
PacketLoss_perc = ( SKP_int )encControl->packetLossPercentage;
UseInBandFec = ( SKP_int )encControl->useInBandFec;
UseInBandFec = ( SKP_int )encControl->useInBandFEC;
Complexity = ( SKP_int )encControl->complexity;
UseDTX = ( SKP_int )encControl->useDtx;
UseDTX = ( SKP_int )encControl->useDTX;
/* Only accept input lengths that are multiplum of 10 ms */
input_ms = SKP_DIV32_16( nSamplesIn, API_fs_kHz );
@@ -186,11 +167,6 @@ SKP_int SKP_Silk_SDK_Encode(
while( 1 ) {
/* Resample/buffer */
nSamplesToBuffer = psEnc->sCmn.frame_length - psEnc->sCmn.inputBufIx;
if( encControl->sampleRate == SKP_SMULBB( psEnc->sCmn.fs_kHz, 1000 ) ) {
/* Same sample frequency - copy the data */
nSamplesToBuffer = SKP_min_int( nSamplesToBuffer, nSamplesIn );
@@ -239,11 +215,6 @@ SKP_int SKP_Silk_SDK_Encode(
&psEnc->sCmn.inputBuf[ psEnc->sCmn.inputBufIx ], scratch, nSamplesToBuffer );
} else if( encControl->sampleRate == 12000 && psEnc->sCmn.fs_kHz == 8 ) {
/* Resample the data from 12 kHz to 8 kHz */
nSamplesToBuffer = SKP_min_int( nSamplesToBuffer, SKP_SMULWB( SKP_LSHIFT( nSamplesIn, 1 ), 21846 ) );
nSamplesFromInput = SKP_RSHIFT( SKP_SMULBB( nSamplesToBuffer, 3 ), 1 );
#if LOW_COMPLEXITY_ONLY
@@ -292,12 +263,6 @@ SKP_int SKP_Silk_SDK_Encode(
}
return ret;
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -26,7 +23,6 @@ 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_FIX.h"
@@ -41,11 +37,6 @@ SKP_int SKP_Silk_encode_frame_FIX(
const SKP_int16 *pIn /* I Pointer to input speech frame */
)
{
SKP_Silk_encoder_control_FIX sEncCtrl;
SKP_int i, nBytes, ret = 0;
SKP_int16 *x_frame, *res_pitch_frame;
@@ -94,11 +85,6 @@ SKP_int SKP_Silk_encode_frame_FIX(
#endif
/*****************************************/
/* Find pitch lags, initial LPC analysis */
/*****************************************/
SKP_Silk_find_pitch_lags_FIX( psEnc, &sEncCtrl, res_pitch, x_frame );
@@ -147,11 +133,6 @@ SKP_int SKP_Silk_encode_frame_FIX(
/**************************************************/
if( psEnc->speech_activity_Q8 < SPEECH_ACTIVITY_DTX_THRES_Q8 ) {
psEnc->sCmn.vadFlag = NO_VOICE_ACTIVITY;
psEnc->sCmn.noSpeechCounter++;
if( psEnc->sCmn.noSpeechCounter > NO_SPEECH_FRAMES_BEFORE_DTX ) {
psEnc->sCmn.inDTX = 1;
@@ -200,11 +181,6 @@ SKP_int SKP_Silk_encode_frame_FIX(
if( psEnc->sCmn.sRC.error ) {
/* encoder returned error: clear payload buffer */
psEnc->sCmn.nFramesInPayloadBuf = 0;
} else {
psEnc->sCmn.nFramesInPayloadBuf++;
}
@@ -254,10 +230,6 @@ SKP_int SKP_Silk_encode_frame_FIX(
*pnBytesOut = nBytes;
/* Update FEC buffer */
SKP_memcpy( psEnc->sCmn.LBRR_buffer[ psEnc->sCmn.oldest_LBRR_idx ].payload, LBRRpayload,
nBytesLBRR * sizeof( SKP_uint8 ) );
@@ -307,10 +279,6 @@ SKP_int SKP_Silk_encode_frame_FIX(
psEnc->BufferedInChannel_ms = SKP_LIMIT( psEnc->BufferedInChannel_ms, 0, 100 );
psEnc->sCmn.nBytesInPayloadBuf = nBytes;
if( psEnc->speech_activity_Q8 > WB_DETECT_ACTIVE_SPEECH_LEVEL_THRES_Q8 ) {
psEnc->sCmn.sSWBdetect.ActiveSpeech_ms = SKP_ADD_POS_SAT32( psEnc->sCmn.sSWBdetect.ActiveSpeech_ms, FRAME_LENGTH_MS );
}
@@ -359,11 +327,6 @@ void SKP_Silk_LBRR_encode_FIX(
}
if( psEnc->sCmn.Complexity > 0 && psEnc->sCmn.TargetRate_bps > Rate_only_parameters ) {
if( psEnc->sCmn.nFramesInPayloadBuf == 0 ) {
/* First frame in packet copy Everything */
SKP_memcpy( &psEnc->sNSQ_LBRR, &psEnc->sNSQ, sizeof( SKP_Silk_nsq_state ) );
@@ -412,11 +375,6 @@ void SKP_Silk_LBRR_encode_FIX(
/* encoder returned error: clear payload buffer */
nFramesInPayloadBuf = 0;
} else {
nFramesInPayloadBuf = psEnc->sCmn.nFramesInPayloadBuf + 1;
}
@@ -465,11 +423,6 @@ void SKP_Silk_LBRR_encode_FIX(
/* Restore original Gains */
SKP_memcpy( psEncCtrl->sCmn.GainsIndices, TempGainsIndices, NB_SUBFR * sizeof( SKP_int ) );
SKP_memcpy( psEncCtrl->Gains_Q16, TempGains_Q16, NB_SUBFR * sizeof( SKP_int32 ) );
/* Restore LTP scale index and typeoffset */
@@ -477,5 +430,3 @@ void SKP_Silk_LBRR_encode_FIX(
psEnc->sCmn.typeOffsetPrev = typeOffset;
}
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -26,7 +23,6 @@ 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"
@@ -36,11 +32,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/*******************************************/
void SKP_Silk_encode_parameters(
SKP_Silk_encoder_state *psEncC, /* I/O Encoder state */
SKP_Silk_encoder_control *psEncCtrlC, /* I/O Encoder control */
SKP_Silk_range_coder_state *psRC, /* I/O Range encoder state */
const SKP_int *q /* I Quantization indices */
@@ -89,11 +80,6 @@ void SKP_Silk_encode_parameters(
if( psEncC->nFramesInPayloadBuf == 0 ) {
/* first frame in packet: independent coding */
SKP_Silk_range_encoder( psRC, psEncCtrlC->GainsIndices[ 0 ], SKP_Silk_gain_CDF[ psEncCtrlC->sigtype ] );
} else {
/* condidtional coding */
SKP_Silk_range_encoder( psRC, psEncCtrlC->GainsIndices[ 0 ], SKP_Silk_delta_gain_CDF );
@@ -104,6 +90,7 @@ void SKP_Silk_encode_parameters(
SKP_Silk_range_encoder( psRC, psEncCtrlC->GainsIndices[ i ], SKP_Silk_delta_gain_CDF );
}
/****************/
/* Encode NLSFs */
/****************/
@@ -143,10 +130,6 @@ void SKP_Silk_encode_parameters(
SKP_Silk_range_encoder( psRC, psEncCtrlC->contourIndex, SKP_Silk_pitch_contour_CDF );
}
/********************/
/* Encode LTP gains */
/********************/
@@ -182,5 +165,3 @@ void SKP_Silk_encode_parameters(
/*********************************************/
SKP_Silk_range_encoder( psRC, psEncC->vadFlag, SKP_Silk_vadflag_CDF );
}

View File

@@ -1,18 +1,10 @@
/***********************************************************************
Copyright (c) 2006-2010, 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.
@@ -31,7 +23,6 @@ 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"
@@ -40,7 +31,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/* Encode parameters to create the payload */
/*******************************************/
void SKP_Silk_encode_parameters_v4(
SKP_Silk_encoder_state *psEncC, /* I/O state */
SKP_Silk_encoder_state *psEncC, /* I/O Encoder state */
SKP_Silk_encoder_control *psEncCtrlC, /* I/O Encoder control */
SKP_Silk_range_coder_state *psRC /* I/O Range encoder state */
)
@@ -61,11 +52,6 @@ void SKP_Silk_encode_parameters_v4(
psEncC->nBytesInPayloadBuf = 0;
/* get sampling rate index */
for( i = 0; i < 3; i++ ) {
if( SKP_Silk_SamplingRates_table[ i ] == psEncC->fs_kHz ) {
break;
@@ -82,7 +68,7 @@ void SKP_Silk_encode_parameters_v4(
/*******************************************/
/* Encode signal type and quantizer offset */
/*******************************************/
typeOffset = SKP_LSHIFT( psEncCtrlC->sigtype, 1 ) + psEncCtrlC->QuantOffsetType;
typeOffset = 2 * psEncCtrlC->sigtype + psEncCtrlC->QuantOffsetType;
if( psEncC->nFramesInPayloadBuf == 0 ) {
/* first frame in packet: independent coding */
SKP_Silk_range_encoder( psRC, typeOffset, SKP_Silk_type_offset_CDF );
@@ -114,11 +100,6 @@ void SKP_Silk_encode_parameters_v4(
/* Encode NLSFs */
/****************/
/* Range encoding of the NLSF path */
psNLSF_CB = psEncC->psNLSF_CB[ psEncCtrlC->sigtype ];
SKP_Silk_range_encoder_multi( psRC, psEncCtrlC->NLSFIndices, psNLSF_CB->StartPtr, psNLSF_CB->nStages );
@@ -167,11 +148,6 @@ void SKP_Silk_encode_parameters_v4(
if( psEncC->fs_kHz == 8 ) {
/* Less codevectors used in 8 khz mode */
SKP_Silk_range_encoder( psRC, psEncCtrlC->contourIndex, SKP_Silk_pitch_contour_NB_CDF );
} else {
/* Joint for 12, 16, 24 khz */
SKP_Silk_range_encoder( psRC, psEncCtrlC->contourIndex, SKP_Silk_pitch_contour_CDF );
@@ -195,10 +171,9 @@ void SKP_Silk_encode_parameters_v4(
SKP_Silk_range_encoder( psRC, psEncCtrlC->LTP_scaleIndex, SKP_Silk_LTPscale_CDF );
}
/***************/
/* Encode seed */
/***************/
SKP_Silk_range_encoder( psRC, psEncCtrlC->Seed, SKP_Silk_Seed_CDF );
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -15,11 +12,6 @@ documentation and/or other materials provided with the distribution.
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
@@ -31,7 +23,6 @@ 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"
@@ -68,17 +59,13 @@ void SKP_Silk_encode_pulses(
const SKP_int q[], /* I quantization indices */
const SKP_int frame_length /* I Frame length */
)
{
SKP_int i, k, j, iter, bit, nLS, scale_down, RateLevelIndex = 0;
SKP_int32 abs_q, minSumBits_Q6, sumBits_Q6;
SKP_int abs_pulses[ MAX_FRAME_LENGTH ];
SKP_int sum_pulses[ MAX_NB_SHELL_BLOCKS ];
SKP_int nRshifts[ MAX_NB_SHELL_BLOCKS ];
SKP_int pulses_comb[ 8 ];
SKP_int sum_pulses[MAX_NB_SHELL_BLOCKS], nRshifts[MAX_NB_SHELL_BLOCKS];
SKP_int *abs_pulses_ptr;
const SKP_int *pulses_ptr;
const SKP_uint16 *cdf_ptr;
@@ -86,9 +73,9 @@ void SKP_Silk_encode_pulses(
SKP_memset( pulses_comb, 0, 8 * sizeof( SKP_int ) ); // Fixing Valgrind reported problem
/********************************/
/****************************/
/* Prepare for shell coding */
/********************************/
/****************************/
/* Calculate number of shell blocks */
iter = frame_length / SHELL_CODEC_FRAME_LENGTH;
@@ -121,13 +108,8 @@ void SKP_Silk_encode_pulses(
scale_down++;
}
if( scale_down ) {
/* We need to down scale the Quantization Signal */
/* We need to down scale the quantization signal */
nRshifts[ i ]++;
for( k = 0; k < SHELL_CODEC_FRAME_LENGTH; k++ ) {
abs_pulses_ptr[ k ] = SKP_RSHIFT( abs_pulses_ptr[ k ], 1 );
@@ -140,9 +122,9 @@ void SKP_Silk_encode_pulses(
abs_pulses_ptr += SHELL_CODEC_FRAME_LENGTH;
}
/********************/
/**************/
/* Rate level */
/********************/
/**************/
/* find rate level that leads to fewest bits for coding of pulses per block info */
minSumBits_Q6 = SKP_int32_MAX;
for( k = 0; k < N_RATE_LEVELS - 1; k++ ) {
@@ -174,27 +156,22 @@ void SKP_Silk_encode_pulses(
for( k = 0; k < nRshifts[ i ] - 1; k++ ) {
SKP_Silk_range_encoder( psRC, MAX_PULSES + 1, SKP_Silk_pulses_per_block_CDF[ N_RATE_LEVELS - 1 ] );
}
SKP_Silk_range_encoder( psRC, sum_pulses[ i ], SKP_Silk_pulses_per_block_CDF[ N_RATE_LEVELS - 1 ] );
}
}
/***************************************************/
/******************/
/* Shell Encoding */
/***************************************************/
/******************/
for( i = 0; i < iter; i++ ) {
if( sum_pulses[ i ] > 0 ) {
SKP_Silk_shell_encoder( psRC, &abs_pulses[ i * SHELL_CODEC_FRAME_LENGTH ] );
}
}
/***************************************************/
/****************/
/* LSB Encoding */
/***************************************************/
/****************/
for( i = 0; i < iter; i++ ) {
if( nRshifts[ i ] > 0 ) {
pulses_ptr = &q[ i * SHELL_CODEC_FRAME_LENGTH ];
@@ -211,10 +188,8 @@ void SKP_Silk_encode_pulses(
}
}
/****************************************/
/****************/
/* Encode signs */
/****************************************/
/****************/
SKP_Silk_encode_signs( psRC, q, frame_length, sigtype, QuantOffsetType, RateLevelIndex );
}

View File

@@ -1,16 +1,8 @@
/***********************************************************************
Copyright (c) 2006-2010, 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
@@ -31,7 +23,6 @@ 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_FIX.h"
@@ -59,11 +50,6 @@ void SKP_Silk_find_LPC_FIX(
SKP_int32 a_tmp_Q16[ MAX_LPC_ORDER ], res_nrg_interp, res_nrg, res_tmp_nrg, res_nrg_2nd;
SKP_int res_nrg_interp_Q, res_nrg_Q, res_tmp_nrg_Q, res_nrg_2nd_Q;
SKP_int16 a_tmp_Q12[ MAX_LPC_ORDER ];
SKP_int NLSF0_Q15[ MAX_LPC_ORDER ];
SKP_int16 LPC_res[ ( MAX_FRAME_LENGTH + NB_SUBFR * MAX_LPC_ORDER ) / 2 ];
@@ -112,11 +98,6 @@ void SKP_Silk_find_LPC_FIX(
SKP_Silk_sum_sqr_shift( &res_nrg1, &rshift1, LPC_res + LPC_order + subfr_length, subfr_length - LPC_order );
/* Add subframe energies from first half frame */
shift = rshift0 - rshift1;
if( shift >= 0 ) {
res_nrg1 = SKP_RSHIFT( res_nrg1, shift );
@@ -164,9 +145,3 @@ void SKP_Silk_find_LPC_FIX(
SKP_Silk_A2NLSF( NLSF_Q15, a_Q16, LPC_order );
}
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -26,7 +23,6 @@ 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_FIX.h"
@@ -45,11 +41,6 @@ void SKP_Silk_find_LTP_FIX(
const SKP_int lag[ NB_SUBFR ], /* I LTP lags */
const SKP_int32 Wght_Q15[ NB_SUBFR ], /* I weights */
const SKP_int subfr_length, /* I subframe length */
const SKP_int mem_offset, /* I number of samples in LTP memory */
SKP_int corr_rshifts[ NB_SUBFR ] /* O right shifts applied to correlations */
)
@@ -98,11 +89,6 @@ void SKP_Silk_find_LTP_FIX(
regu = SKP_SMULWB( rr[ k ] + 1, LTP_DAMPING_Q16 );
SKP_Silk_regularize_correlations_FIX( WLTP_ptr, &rr[k], regu, LTP_ORDER );
SKP_Silk_solve_LDL_FIX( WLTP_ptr, LTP_ORDER, Rr, b_Q16 ); /* WLTP_fix_ptr and Rr_fix_ptr both in Q(-corr_rshifts[k]) */
/* Limit and store in Q14 */
@@ -151,11 +137,6 @@ void SKP_Silk_find_LTP_FIX(
LPC_LTP_res_nrg = 0;
LPC_res_nrg = 0;
SKP_assert( LTP_CORRS_HEAD_ROOM >= 2 ); /* Check that no overflow will happen when adding */
for( k = 0; k < NB_SUBFR; k++ ) {
LPC_res_nrg = SKP_ADD32( LPC_res_nrg, SKP_RSHIFT( SKP_ADD32( SKP_SMULWB( rr[ k ], Wght_Q15[ k ] ), 1 ), 1 + ( maxRshifts - corr_rshifts[ k ] ) ) ); /* Q( -maxRshifts ) */
LPC_LTP_res_nrg = SKP_ADD32( LPC_LTP_res_nrg, SKP_RSHIFT( SKP_ADD32( SKP_SMULWB( nrg[ k ], Wght_Q15[ k ] ), 1 ), 1 + ( maxRshifts - corr_rshifts[ k ] ) ) ); /* Q( -maxRshifts ) */
@@ -204,11 +185,6 @@ void SKP_Silk_find_LTP_FIX(
maxRshifts_wxtra = maxRshifts + extra_shifts;
temp32 = SKP_RSHIFT( 262, maxRshifts + extra_shifts ) + 1; /* 1e-3f in Q( 18 - (maxRshifts + extra_shifts) ) */
wd = 0;
for( k = 0; k < NB_SUBFR; k++ ) {
/* w has at least 2 bits of headroom so no overflow should happen */
@@ -256,9 +232,3 @@ void SKP_Silk_fit_LTP(
LTP_coefs_Q14[ i ] = ( SKP_int16 )SKP_SAT16( SKP_RSHIFT_ROUND( LTP_coefs_Q16[ i ], 2 ) );
}
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -26,7 +23,6 @@ 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_FIX.h"
@@ -45,11 +41,6 @@ void SKP_Silk_find_pitch_lags_FIX(
SKP_int32 thrhld_Q15;
const SKP_int16 *x_buf, *x_buf_ptr;
SKP_int16 Wsig[ FIND_PITCH_LPC_WIN_MAX ], *Wsig_ptr;
SKP_int32 auto_corr[ FIND_PITCH_LPC_ORDER_MAX + 1 ];
SKP_int16 rc_Q15[ FIND_PITCH_LPC_ORDER_MAX ];
SKP_int32 A_Q24[ FIND_PITCH_LPC_ORDER_MAX ];
@@ -99,10 +90,6 @@ void SKP_Silk_find_pitch_lags_FIX(
/* convert reflection coefficients to prediction coefficients */
SKP_Silk_k2a( A_Q24, rc_Q15, psEnc->sCmn.pitchEstimationLPCOrder );
/* Convert From 32 bit Q24 to 16 bit Q12 coefs */
for( i = 0; i < psEnc->sCmn.pitchEstimationLPCOrder; i++ ) {
A_Q12[ i ] = ( SKP_int16 )SKP_SAT16( SKP_RSHIFT( A_Q24[ i ], 12 ) );
@@ -133,5 +120,3 @@ void SKP_Silk_find_pitch_lags_FIX(
&psEncCtrl->sCmn.contourIndex, &psEnc->LTPCorr_Q15, psEnc->sCmn.prevLag, psEnc->pitchEstimationThreshold_Q16,
( SKP_int16 )thrhld_Q15, psEnc->sCmn.fs_kHz, psEnc->sCmn.pitchEstimationComplexity );
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -13,11 +10,6 @@ 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
@@ -31,7 +23,6 @@ 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_FIX.h"
@@ -66,11 +57,6 @@ void SKP_Silk_find_pred_coefs_FIX(
min_gain_Q16 = SKP_min( min_gain_Q16, psEncCtrl->Gains_Q16[ i ] );
}
#if !VARQ
LZ = SKP_Silk_CLZ32( min_gain_Q16 ) - 1;
LZ = SKP_LIMIT( LZ, 0, 16 );
min_gain_Q16 = SKP_RSHIFT( min_gain_Q16, 2 ); /* Ensure that maximum invGains_Q16 is within range of a 16 bit int */
@@ -120,10 +106,6 @@ void SKP_Silk_find_pred_coefs_FIX(
SKP_Silk_LTP_analysis_filter_FIX( LPC_in_pre, psEnc->x_buf + psEnc->sCmn.frame_length - psEnc->sCmn.predictLPCOrder,
psEncCtrl->LTPCoef_Q14, psEncCtrl->sCmn.pitchL, invGains_Q16, 16, psEnc->sCmn.subfr_length, psEnc->sCmn.predictLPCOrder );
} else {
/************/
/* UNVOICED */
@@ -164,5 +146,3 @@ void SKP_Silk_find_pred_coefs_FIX(
}

View File

@@ -1,13 +1,5 @@
/***********************************************************************
Copyright (c) 2006-2010, 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:
@@ -31,7 +23,6 @@ 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"
@@ -56,11 +47,6 @@ void SKP_Silk_gains_quant(
/* Round towards previous quantized gain (hysteresis) */
if( ind[ k ] < *prev_ind ) {
ind[ k ]++;
}
@@ -106,5 +92,3 @@ void SKP_Silk_gains_dequant(
gain_Q16[ k ] = SKP_Silk_log2lin( SKP_min_32( SKP_SMULWB( INV_SCALE_Q16, *prev_ind ) + OFFSET, 3967 ) ); /* 3967 = 31 in Q7 */
}
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -21,17 +18,11 @@ 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_FIX.h"
@@ -71,5 +62,3 @@ SKP_int SKP_Silk_init_encoder_FIX(
return( ret );
}

View File

@@ -1,13 +1,5 @@
/***********************************************************************
Copyright (c) 2006-2010, 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:
@@ -31,7 +23,6 @@ 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.
***********************************************************************/
/* *
@@ -56,11 +47,6 @@ SKP_int32 SKP_Silk_inner_prod_aligned(
)
{
SKP_int i;
SKP_int32 sum = 0;
for( i = 0; i < len; i++ ) {
sum = SKP_SMLABB( sum, inVec1[ i ], inVec2[ i ] );
@@ -108,9 +94,3 @@ SKP_int32 SKP_Silk_inner_prod16_aligned_sat(
}
return sum;
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -26,7 +23,6 @@ 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"
@@ -45,14 +41,7 @@ void SKP_Silk_interpolate(
SKP_assert( ifact_Q2 >= 0 );
SKP_assert( ifact_Q2 <= ( 1 << 2 ) );
for( i = 0; i < d; i++ ) {
xi[ i ] = ( SKP_int )( ( SKP_int32 )x0[ i ] + SKP_RSHIFT( SKP_MUL( ( SKP_int32 )x1[ i ] - ( SKP_int32 )x0[ i ], ifact_Q2 ), 2 ) );
}
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -26,7 +23,6 @@ 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.
***********************************************************************/
/* *
@@ -40,10 +36,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* */
#include "SKP_Silk_SigProc_FIX.h"
/* Step up function, converts reflection coefficients to prediction coefficients */
void SKP_Silk_k2a(
SKP_int32 *A_Q24, /* O: Prediction coefficients [order] Q24 */
@@ -64,5 +56,3 @@ void SKP_Silk_k2a(
A_Q24[ k ] = -SKP_LSHIFT( (SKP_int32)rc_Q15[ k ], 9 );
}
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -23,15 +20,9 @@ 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.
***********************************************************************/
/* *
@@ -65,19 +56,3 @@ void SKP_Silk_k2a_Q16(
A_Q24[ k ] = -SKP_LSHIFT( rc_Q16[ k ], 8 );
}
}

View File

@@ -1,10 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -29,7 +23,6 @@ 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.
***********************************************************************/
/* *
@@ -51,13 +44,6 @@ SKP_int32 SKP_Silk_lin2log( const SKP_int32 inLin ) /* I: Input in linear
SKP_Silk_CLZ_FRAC( inLin, &lz, &frac_Q7 );
/* Piece-wise parabolic approximation */
return( SKP_LSHIFT( 31 - lz, 7 ) + SKP_SMLAWB( frac_Q7, SKP_MUL( frac_Q7, 128 - frac_Q7 ), 179 ) );
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -26,7 +23,6 @@ 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.
***********************************************************************/
/* *
@@ -40,11 +36,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "SKP_Silk_SigProc_FIX.h"
/* Approximation of 2^() (very close inverse of SKP_Silk_lin2log()) */
/* Convert input to a linear scale */
SKP_int32 SKP_Silk_log2lin( const SKP_int32 inLog_Q7 ) /* I: Input on log scale */
{
@@ -65,5 +56,3 @@ SKP_int32 SKP_Silk_log2lin( const SKP_int32 inLog_Q7 ) /* I: Input on log
}
return out;
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -23,15 +20,9 @@ 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.
***********************************************************************/
/* *
@@ -68,5 +59,3 @@ void SKP_Silk_lowpass_int(
}

View File

@@ -1,13 +1,5 @@
/***********************************************************************
Copyright (c) 2006-2010, 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:
@@ -31,7 +23,6 @@ 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.
***********************************************************************/
/* *
@@ -57,10 +48,6 @@ void SKP_Silk_lowpass_short(
SKP_int k;
SKP_int32 in_tmp, out_tmp, state;
state = S[ 0 ];
for( k = 0; k < len; k++ ) {
in_tmp = SKP_MUL( 768, (SKP_int32)in[k] ); /* multiply by 0.75, going from Q15 to Q25 */
@@ -72,5 +59,3 @@ void SKP_Silk_lowpass_short(
}

View File

@@ -1,17 +1,9 @@
/***********************************************************************
Copyright (c) 2006-2010, 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
@@ -31,7 +23,6 @@ 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_API_C_H_
@@ -60,11 +51,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// (SKP_int32)((SKP_int16)(a32)) * (b32 >> 16)
#define SKP_SMULBT(a32, b32) ((SKP_int32)((SKP_int16)(a32)) * ((b32) >> 16))
// a32 + (SKP_int32)((SKP_int16)(b32)) * (c32 >> 16)
#define SKP_SMLABT(a32, b32, c32) ((a32) + ((SKP_int32)((SKP_int16)(b32))) * ((c32) >> 16))
@@ -113,11 +99,6 @@ SKP_INLINE SKP_int32 SKP_Silk_CLZ16(SKP_int16 in16)
if( in16 & 0x8 )
return out32 + 0;
else
return out32 + 1;
} else {
if( in16 & 0xE )
@@ -139,5 +120,3 @@ SKP_INLINE SKP_int32 SKP_Silk_CLZ32(SKP_int32 in32)
#endif //_SKP_SILK_API_C_H_

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -22,16 +19,10 @@ 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_H
@@ -75,11 +66,6 @@ void SKP_Silk_decode_signs(
/* Encode quantization indices of excitation */
void SKP_Silk_encode_pulses(
SKP_Silk_range_coder_state *psRC, /* I/O Range coder state */
const SKP_int sigtype, /* I Sigtype */
const SKP_int QuantOffsetType, /* I QuantOffsetType */
const SKP_int q[], /* I quantization indices */
@@ -128,11 +114,6 @@ void SKP_Silk_range_decoder(
/* Range decoder for multiple symbols */
void SKP_Silk_range_decoder_multi(
SKP_int data[], /* O uncompressed data [nSymbols] */
SKP_Silk_range_coder_state *psRC, /* I/O compressor data structure */
const SKP_uint16 * const prob[], /* I cumulative density functions */
const SKP_int probStartIx[], /* I initial (middle) entries of cdfs [nSymbols] */
@@ -181,11 +162,6 @@ void SKP_Silk_gains_dequant(
const SKP_int ind[ NB_SUBFR ], /* I gain indices */
SKP_int *prev_ind, /* I/O last index in previous frame */
const SKP_int conditional /* I first gain is delta coded if 1 */
);
/* Convert NLSF parameters to stable AR prediction filter coefficients */
@@ -234,11 +210,6 @@ void SKP_Silk_NSQ_del_dec(
SKP_int q[], /* O Quantized pulse signal */
const SKP_int LSFInterpFactor_Q2, /* I LSF interpolation factor in Q2 */
const SKP_int16 PredCoef_Q12[ 2 * MAX_LPC_ORDER ], /* I Prediction coefs */
const SKP_int16 LTPCoef_Q14[ LTP_ORDER * NB_SUBFR ], /* I LT prediction coefs */
const SKP_int16 AR2_Q13[ NB_SUBFR * SHAPE_LPC_ORDER_MAX ], /* I */
const SKP_int HarmShapeGain_Q14[ NB_SUBFR ], /* I */
@@ -287,11 +258,6 @@ void SKP_Silk_detect_SWB_input(
/* Start by setting transition_frame_no = 1; */
void SKP_Silk_LP_variable_cutoff(
SKP_Silk_LP_state *psLP, /* I/O LP filter state */
SKP_int16 *out, /* O Low-pass filtered output signal */
const SKP_int16 *in, /* I Input signal */
const SKP_int frame_length /* I Frame length */
@@ -340,11 +306,6 @@ void SKP_Silk_decode_parameters(
const SKP_int fullDecoding /* I Flag to tell if only arithmetic decoding */
);
/* Decode indices from payload v4 Bitstream */
void SKP_Silk_decode_indices_v4(
SKP_Silk_decoder_state *psDec /* I/O State */
@@ -393,11 +354,6 @@ void SKP_Silk_decode_pulses(
/* Reset CNG */
void SKP_Silk_CNG_Reset(
SKP_Silk_decoder_state *psDec /* I/O Decoder state */
);
/* Updates CNG estimate, and applies the CNG when packet was lost */
@@ -446,11 +402,4 @@ SKP_int SKP_Silk_pulses_to_bytes( /* O Return value, predicted number of bytes
}
#endif
#endif

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -26,7 +23,6 @@ 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
@@ -35,18 +31,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <stdlib.h>
#include "SKP_Silk_SigProc_FIX.h"
#include "SKP_Silk_structs_FIX.h"
#include "SKP_Silk_tables_FIX.h"
#include "SKP_Silk_main.h"
#include "SKP_Silk_define_FIX.h"
#include "SKP_Silk_PLC.h"
#define TIC(TAG_NAME)
#define TOC(TAG_NAME)
#ifndef FORCE_CPP_BUILD
#ifdef __cplusplus
extern "C"
@@ -95,11 +85,6 @@ void SKP_Silk_LBRR_encode_FIX(
);
/* High-pass filter with cutoff frequency adaptation based on pitch lag statistics */
void SKP_Silk_HP_variable_cutoff_FIX(
SKP_Silk_encoder_state_FIX *psEnc, /* I/O Encoder state */
SKP_Silk_encoder_control_FIX *psEncCtrl, /* I/O Encoder control */
@@ -148,11 +133,6 @@ void SKP_Silk_LTP_scale_ctrl_FIX(
/**********************************************/
/* Prediction Analysis */
/**********************************************/
/* Find pitch lags */
@@ -201,11 +181,6 @@ void SKP_Silk_find_LTP_FIX(
const SKP_int32 Wght_Q15[ NB_SUBFR ], /* I weights */
const SKP_int subfr_length, /* I subframe length */
const SKP_int mem_offset, /* I number of samples in LTP memory */
SKP_int corr_rshifts[ NB_SUBFR ] /* O right shifts applied to correlations */
);
@@ -232,33 +207,28 @@ void SKP_Silk_process_NLSFs_FIX(
/* LSF vector encoder */
void SKP_Silk_NLSF_MSVQ_encode_FIX(
SKP_int *NLSFIndices, /* O Pointer to codebook path vector [CB_STAGES x1] */
SKP_int *pNLSF_Q15, /* I/O Pointer to quantized NLSF vector [LPC_order x1] */
const SKP_Silk_NLSF_CB_struct *psNLSF_CB, /* I Pointer to codebook object */
const SKP_int *pNLSF_q_Q15_prev, /* I Pointer to previously quantized NLSF vector [LPC_order x1] */
const SKP_int *pW_Qx, /* I Pointer to NLSF weight vector [LPC_order x1] */
SKP_int *NLSFIndices, /* O Codebook path vector [ CB_STAGES ] */
SKP_int *pNLSF_Q15, /* I/O Quantized NLSF vector [ LPC_ORDER ] */
const SKP_Silk_NLSF_CB_struct *psNLSF_CB, /* I Codebook object */
const SKP_int *pNLSF_q_Q15_prev, /* I Prev. quantized NLSF vector [LPC_ORDER] */
const SKP_int *pW_Q6, /* I NLSF weight vector [ LPC_ORDER ] */
const SKP_int NLSF_mu_Q15, /* I Rate weight for the RD optimization */
const SKP_int NLSF_mu_fluc_red_Q16, /* I Fluctuation error weight for fluctuation reduction */
const SKP_int NLSF_MSVQ_Max_Survivors,/* I Maximum number of survivors from each stage */
const SKP_int NLSF_mu_fluc_red_Q16, /* I Fluctuation reduction error weight */
const SKP_int NLSF_MSVQ_Survivors, /* I Max survivors from each stage */
const SKP_int LPC_order, /* I LPC order */
const SKP_int deactivate_fluc_red /* I Deactivate fluctuation reduction, e.g. right after a reset */
const SKP_int deactivate_fluc_red /* I Deactivate fluctuation reduction */
);
/* Weighted VQ with entropy constraints, for multiple input data vectors */
void SKP_Silk_NLSF_VQ_nearest_neighbor_FIX(
SKP_int32 *pRD_Q20, /* O rate-distortion of psNLSF_CB_stage->nVectors best codebook vectors, for each input vector*/
const SKP_Silk_NLSF_CB_Stage_struct *psNLSF_CB_stage,/* I pointer to NLSF codebook stage struct */
const SKP_int *in_Q15, /* I input vectors to be quantized */
const SKP_int *w_Q6, /* I weighting vector */
const SKP_int32 *rate_acc_Q5, /* I Accumulated rate from first to previous stage for each input vector */
const SKP_int mu_Q15, /* I tradeoffs between weighted error and rate */
const SKP_int N, /* I number of input vectors to be quantized */
/* Rate-Distortion calculations for multiple input data vectors */
void SKP_Silk_NLSF_VQ_rate_distortion_FIX(
SKP_int32 *pRD_Q20, /* O Rate-distortion values [psNLSF_CBS->nVectors*N] */
const SKP_Silk_NLSF_CBS *psNLSF_CBS, /* I NLSF codebook stage struct */
const SKP_int *in_Q15, /* I Input vectors to be quantized */
const SKP_int *w_Q6, /* I Weight vector */
const SKP_int32 *rate_acc_Q5, /* I Accumulated rates from previous stage */
const SKP_int mu_Q15, /* I Weight between weighted error and rate */
const SKP_int N, /* I Number of input vectors to be quantized */
const SKP_int LPC_order /* I LPC order */
);
/* Compute weighted quantization errors for an LPC_order element input vector, over one codebook stage */
@@ -307,11 +277,6 @@ void SKP_Silk_corrVector_FIX(
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 */
@@ -357,5 +322,3 @@ void SKP_Silk_residual_energy_FIX(
#endif /* __cplusplus */
#endif /* FORCE_CPP_BUILD */
#endif /* SKP_SILK_MAIN_FIX_H */

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -13,11 +10,6 @@ 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
@@ -31,7 +23,6 @@ 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_FIX.h"
@@ -66,11 +57,6 @@ void SKP_Silk_noise_shape_analysis_FIX(
/****************/
/* CONTROL SNR */
/****************/
/* Reduce SNR_dB values if recent bitstream has exceeded TargetRate */
psEncCtrl->current_SNR_dB_Q7 = psEnc->SNR_dB_Q7 - SKP_SMULWB( SKP_LSHIFT( ( SKP_int32 )psEnc->BufferedInChannel_ms, 7 ), 3277 );
@@ -119,11 +105,6 @@ void SKP_Silk_noise_shape_analysis_FIX(
nSamples = SKP_LSHIFT( psEnc->sCmn.fs_kHz, 1 );
energy_variation_Q7 = 0;
log_energy_prev_Q7 = 0;
pitch_res_ptr = pitch_res;
for( k = 0; k < FRAME_LENGTH_MS / 2; k++ ) {
SKP_Silk_sum_sqr_shift( &nrg, &scale, pitch_res_ptr, nSamples );
@@ -172,11 +153,6 @@ void SKP_Silk_noise_shape_analysis_FIX(
/* Apply window */
SKP_Silk_apply_sine_window( x_windowed, x_ptr, 0, SHAPE_LPC_WIN_MS * psEnc->sCmn.fs_kHz );
/* Update pointer: next LPC analysis block */
x_ptr += psEnc->sCmn.frame_length / NB_SUBFR;
@@ -225,11 +201,6 @@ void SKP_Silk_noise_shape_analysis_FIX(
Qnrg >>= 1; // range: -6...15
sqrt_nrg[ k ] = tmp32;
Qnrg_vec[ k ] = Qnrg;
psEncCtrl->Gains_Q16[ k ] = SKP_LSHIFT_SAT32( tmp32, 16 - Qnrg );
@@ -278,11 +249,6 @@ void SKP_Silk_noise_shape_analysis_FIX(
if( psEnc->sCmn.fs_kHz == 24 ) {
SKP_int32 essStrength_Q15 = SKP_SMULWW( -psEncCtrl->input_tilt_Q15,
SKP_SMULBB( psEnc->speech_activity_Q8, ( 1 << 8 ) - psEncCtrl->sparseness_Q8 ) );
tmp32 = SKP_Silk_log2lin( ( 16 << 7 ) - SKP_SMULWB( essStrength_Q15,
SKP_SMULWB( DE_ESSER_COEF_SWB_dB_Q7, 20972 ) ) ); // 20972_Q17 = 0.16_Q0
gain_mult_Q16 = SKP_SMULWW( gain_mult_Q16, tmp32 );
@@ -331,11 +297,6 @@ void SKP_Silk_noise_shape_analysis_FIX(
}
/****************************/
/* HARMONIC SHAPING CONTROL */
/****************************/
/* Control boosting of harmonic frequencies */
@@ -375,5 +336,3 @@ void SKP_Silk_noise_shape_analysis_FIX(
psEncCtrl->Tilt_Q14[ k ] = ( SKP_int )SKP_RSHIFT_ROUND( psShapeSt->Tilt_smth_Q16, 2 );
}
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -22,16 +19,10 @@ 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_PERCEPTUAL_PARAMETERS_FIX_H
@@ -75,11 +66,6 @@ extern "C"
/* extra harmonic boosting (signal shaping) for noisy input signals */
#define LOW_INPUT_QUALITY_HARMONIC_BOOST_Q16 6554 // 0.1
/* harmonic noise shaping */
#define HARMONIC_SHAPING_Q16 19661 // 0.3
@@ -128,15 +114,8 @@ extern "C"
#define NOISE_GAIN_UVL_Q16 6554
#define NOISE_GAIN_UVH_Q16 9830
#ifdef __cplusplus
}
#endif
#endif //SKP_SILK_PERCEPTUAL_PARAMETERS_FIX_H

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -26,7 +23,6 @@ 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.
***********************************************************************/
/***********************************************************
@@ -38,11 +34,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define SCRATCH_SIZE 22
/************************************************************/
/* Internally used functions */
/************************************************************/
@@ -91,11 +82,6 @@ void SKP_Silk_decode_pitch(
pitch_lags[ i ] = lag + SKP_Silk_CB_lags_stage3[ i ][ contourIndex ];
}
}
}
/*************************************************************/
@@ -144,11 +130,6 @@ SKP_int SKP_Silk_pitch_analysis_core( /* O Voicing estimate: 0 voiced, 1 unv
/* Check for valid sampling frequency */
SKP_assert( Fs_kHz == 8 || Fs_kHz == 12 || Fs_kHz == 16 || Fs_kHz == 24 );
/* Check for valid complexity setting */
SKP_assert( complexity >= SigProc_PITCH_EST_MIN_COMPLEX );
SKP_assert( complexity <= SigProc_PITCH_EST_MAX_COMPLEX );
@@ -198,10 +179,6 @@ SKP_int SKP_Silk_pitch_analysis_core( /* O Voicing estimate: 0 voiced, 1 unv
SKP_assert( 7 <= PITCH_EST_MAX_DECIMATE_STATE_LENGTH );
SKP_memset( filt_state, 0, 7 * sizeof( SKP_int32 ) );
SKP_Silk_resample_1_3( signal_8kHz, filt_state, signal, 24 * PITCH_EST_FRAME_LENGTH_MS );
} else {
@@ -250,11 +227,6 @@ SKP_int SKP_Silk_pitch_analysis_core( /* O Voicing estimate: 0 voiced, 1 unv
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 */
@@ -304,10 +276,6 @@ SKP_int SKP_Silk_pitch_analysis_core( /* O Voicing estimate: 0 voiced, 1 unv
C[ 0 ][ i ] = (SKP_int16)sum; /* Q-1 */
}
/* Sort */
length_d_srch = 5 + complexity;
SKP_assert( length_d_srch <= PITCH_EST_D_SRCH_LENGTH );
@@ -356,11 +324,6 @@ SKP_int SKP_Silk_pitch_analysis_core( /* O Voicing estimate: 0 voiced, 1 unv
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++;
}
}
@@ -409,11 +372,6 @@ SKP_int SKP_Silk_pitch_analysis_core( /* O Voicing estimate: 0 voiced, 1 unv
// ToDo: Calculate 1 / energy_target here and save one division inside next for loop
for( j = 0; j < length_d_comp; j++ ) {
d = d_comp[ j ];
basis_ptr = target_ptr - d;
/* Check that we are within range of the array */
@@ -462,11 +420,6 @@ SKP_int SKP_Silk_pitch_analysis_core( /* O Voicing estimate: 0 voiced, 1 unv
} else {
prevLag_log2_Q7 = 0;
}
SKP_assert( search_thres2_Q15 == SKP_SAT16( search_thres2_Q15 ) );
corr_thres_Q15 = SKP_RSHIFT( SKP_SMULBB( search_thres2_Q15, search_thres2_Q15 ), 13 );
@@ -515,11 +468,6 @@ SKP_int SKP_Silk_pitch_analysis_core( /* O Voicing estimate: 0 voiced, 1 unv
if( CCmax_new_b > CCmax_b && CCmax_new > corr_thres_Q15 ) {
CCmax_b = CCmax_new_b;
CCmax = CCmax_new;
lag = d;
CBimax = CBimax_new;
@@ -568,11 +516,6 @@ SKP_int SKP_Silk_pitch_analysis_core( /* O Voicing estimate: 0 voiced, 1 unv
}
lag = SKP_LIMIT( 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 */
@@ -621,11 +564,6 @@ SKP_int SKP_Silk_pitch_analysis_core( /* O Voicing estimate: 0 voiced, 1 unv
} else {
CCmax_new = SKP_LSHIFT( CCmax_new, 3 );
}
/* Reduce depending on flatness of contour */
diff = j - SKP_RSHIFT( PITCH_EST_NB_CBKS_STAGE3_MAX, 1 );
diff = SKP_MUL( diff, diff );
@@ -674,11 +612,6 @@ void SKP_FIX_P_Ana_calc_corr_st3(
const SKP_int16 signal[], /* I vector to correlate */
SKP_int start_lag, /* I lag offset to search around */
SKP_int sf_length, /* I length of a 5 ms subframe */
SKP_int complexity /* I Complexity setting */
)
{
@@ -727,11 +660,6 @@ void SKP_FIX_P_Ana_calc_corr_st3(
/* calculated recursively. */
/********************************************************************/
void SKP_FIX_P_Ana_calc_energy_st3(
SKP_int32 energies_st3[ PITCH_EST_NB_SUBFR ][ PITCH_EST_NB_CBKS_STAGE3_MAX ][ PITCH_EST_NB_STAGE3_LAGS ],/* (O) 3 DIM energy array */
const SKP_int16 signal[], /* I vector to calc energy in */
SKP_int start_lag, /* I lag offset to search around */
@@ -780,11 +708,6 @@ void SKP_FIX_P_Ana_calc_energy_st3(
/* Fill out the 3 dim array that stores the correlations for */
/* each code_book vector for each start lag */
idx = SKP_Silk_CB_lags_stage3[ k ][ i ] - delta;
for( j = 0; j < PITCH_EST_NB_STAGE3_LAGS; j++ ) {
SKP_assert( idx + j < SCRATCH_SIZE );
SKP_assert( idx + j < lag_counter );
@@ -822,19 +745,3 @@ SKP_int32 SKP_FIX_P_Ana_find_scaling(
return( nbits - 30 );
}
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -26,7 +23,6 @@ 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 SIGPROCFIX_PITCH_EST_DEFINES_H
@@ -45,8 +41,3 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -26,7 +23,6 @@ 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"
@@ -45,11 +41,6 @@ const SKP_int16 SKP_Silk_CB_lags_stage2[PITCH_EST_NB_SUBFR][PITCH_EST_NB_CBKS_ST
};
const SKP_int16 SKP_Silk_CB_lags_stage3[PITCH_EST_NB_SUBFR][PITCH_EST_NB_CBKS_STAGE3_MAX] =
{
{-9,-7,-6,-5,-5,-4,-4,-3,-3,-2,-2,-2,-1,-1,-1, 0, 0, 0, 1, 1, 0, 1, 2, 2, 2, 3, 3, 4, 4, 5, 6, 5, 6, 8},
{-3,-2,-2,-2,-1,-1,-1,-1,-1, 0, 0,-1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 2, 1, 2, 2, 2, 2, 3},
@@ -96,10 +87,3 @@ const SKP_int16 SKP_Silk_cbk_offsets_stage3[SigProc_PITCH_EST_MAX_COMPLEX + 1] =
0
};

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -26,7 +23,6 @@ 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_FIX.h"
@@ -45,11 +41,6 @@ SKP_INLINE void SKP_Silk_prefilt_FIX(
);
void SKP_Silk_prefilter_FIX(
SKP_Silk_encoder_state_FIX *psEnc, /* I/O Encoder state FIX */
const SKP_Silk_encoder_control_FIX *psEncCtrl, /* I Encoder control FIX */
SKP_int16 xw[], /* O Weighted signal */
@@ -98,11 +89,6 @@ void SKP_Silk_prefilter_FIX(
tmp_32 = SKP_SMLABB( INPUT_TILT_Q26, psEncCtrl->HarmBoost_Q14[ k ], HarmShapeGain_Q12 ); /* Q26 */
tmp_32 = SKP_SMLABB( tmp_32, psEncCtrl->coding_quality_Q14, HIGH_RATE_INPUT_TILT_Q12 ); /* Q26 */
tmp_32 = SKP_SMULWB( tmp_32, -psEncCtrl->GainsPre_Q14[ k ] ); /* Q24 */
tmp_32 = SKP_RSHIFT_ROUND( tmp_32, 12 ); /* Q12 */
B_Q12 |= SKP_LSHIFT( SKP_SAT16( tmp_32 ), 16 );
@@ -151,11 +137,6 @@ SKP_INLINE void SKP_Silk_prefilt_FIX(
for( i = 0; i < length; i++ ) {
if( lag > 0 ) {
/* unrolled loop */
SKP_assert( HARM_SHAPE_FIR_TAPS == 3 );
idx = lag + LTP_shp_buf_idx;
@@ -183,5 +164,3 @@ SKP_INLINE void SKP_Silk_prefilt_FIX(
P->sLF_MA_shp1_Q12 = sLF_MA_shp_Q12;
P->sLTP_shp_buf_idx1 = LTP_shp_buf_idx;
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -26,7 +23,6 @@ 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_FIX.h"
@@ -39,11 +35,6 @@ void SKP_Silk_process_NLSFs_FIX(
)
{
SKP_int doInterpolate;
SKP_int pNLSFW_Q6[ MAX_LPC_ORDER ];
SKP_int NLSF_mu_Q15, NLSF_mu_fluc_red_Q16;
SKP_int32 i_sqr_Q15;
@@ -92,11 +83,6 @@ void SKP_Silk_process_NLSFs_FIX(
/* Calculate the interpolated NLSF vector for the first half */
SKP_Silk_interpolate( pNLSF0_temp_Q15, psEnc->sPred.prev_NLSFq_Q15, pNLSF_Q15,
psEncCtrl->sCmn.NLSFInterpCoef_Q2, psEnc->sCmn.predictLPCOrder );
/* Calculate first half NLSF weights for the interpolated NLSFs */
@@ -139,5 +125,3 @@ void SKP_Silk_process_NLSFs_FIX(
SKP_memcpy( psEncCtrl->PredCoef_Q12[ 0 ], psEncCtrl->PredCoef_Q12[ 1 ], psEnc->sCmn.predictLPCOrder * sizeof( SKP_int16 ) );
}
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -16,11 +13,6 @@ 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
@@ -31,7 +23,6 @@ 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_FIX.h"
@@ -69,11 +60,6 @@ void SKP_Silk_process_gains_FIX(
ResNrgPart = SKP_RSHIFT_ROUND( ResNrgPart, psEncCtrl->ResNrgQ[ k ] );
} else {
ResNrgPart = 0;
}
} else if( psEncCtrl->ResNrgQ[k] != 0 ) {
if( ResNrgPart > SKP_RSHIFT( SKP_int32_MAX, -psEncCtrl->ResNrgQ[ k ] ) ) {
@@ -122,14 +108,7 @@ void SKP_Silk_process_gains_FIX(
+ SKP_SMULBB( SKP_FIX_CONST( 0.4, 10 ), psEncCtrl->sCmn.QuantOffsetType )
- SKP_SMULWB( SKP_FIX_CONST( 0.1, 12 ), psEncCtrl->coding_quality_Q14 );
}
SKP_assert( psEncCtrl->Lambda_Q10 >= 0 );
SKP_assert( psEncCtrl->Lambda_Q10 < SKP_FIX_CONST( 2, 10 ) );
}

View File

@@ -1,11 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -30,7 +23,6 @@ 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.
***********************************************************************/
/*
@@ -54,11 +46,6 @@ SKP_int SKP_Silk_pulses_to_bytes( /* O Return value, predicted number of bytes
SKP_int i, j, iter, *q_ptr;
SKP_int32 sum_abs_val, nBytes, acc_nBytes;
/* Take the absolute value of the pulses */
iter = psEncC->frame_length / SHELL_CODEC_FRAME_LENGTH;
/* Calculate rate as a nonlinaer mapping of sum abs value of each Shell block */
@@ -88,5 +75,3 @@ SKP_int SKP_Silk_pulses_to_bytes( /* O Return value, predicted number of bytes
return(( SKP_int )acc_nBytes);
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -14,11 +11,6 @@ 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,
@@ -31,7 +23,6 @@ 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_FIX.h"
@@ -67,11 +58,6 @@ void SKP_Silk_quant_LTP_gains_FIX(
cbk_size = SKP_Silk_LTP_vq_sizes[ k ];
/* Setup pointer to first subframe */
W_Q18_ptr = W_Q18;
b_Q14_ptr = B_Q14;
@@ -118,10 +104,3 @@ void SKP_Silk_quant_LTP_gains_FIX(
}
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -26,7 +23,6 @@ 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"
@@ -45,11 +41,6 @@ void SKP_Silk_range_encoder(
SKP_uint32 base_Q32 = psRC->base_Q32;
SKP_uint32 range_Q16 = psRC->range_Q16;
SKP_int32 bufferIx = psRC->bufferIx;
SKP_uint8 *buffer = psRC->buffer;
if( psRC->error ) {
@@ -98,11 +89,6 @@ void SKP_Silk_range_encoder(
/* Write one byte to buffer */
buffer[ bufferIx++ ] = (SKP_uint8)( SKP_RSHIFT_uint( base_Q32, 24 ) );
base_Q32 = SKP_LSHIFT_ovflw( base_Q32, 8 );
}
/* Copy structure data back */
@@ -151,11 +137,6 @@ void SKP_Silk_range_decoder(
high_Q16 = prob[ probIx ];
base_tmp = SKP_MUL_uint( range_Q16, high_Q16 );
if( base_tmp > base_Q32 ) {
while( 1 ) {
low_Q16 = prob[ --probIx ];
base_tmp = SKP_MUL_uint( range_Q16, low_Q16 );
@@ -204,11 +185,6 @@ void SKP_Silk_range_decoder(
/* Check for errors */
if( SKP_RSHIFT_uint( base_Q32, 24 ) ) {
psRC->error = RANGE_CODER_NORMALIZATION_FAILED;
/* Set output to zero */
*data = 0;
return;
@@ -257,11 +233,6 @@ void SKP_Silk_range_decoder(
/* Range decoder for multiple symbols */
void SKP_Silk_range_decoder_multi(
SKP_int data[], /* O uncompressed data [nSymbols] */
SKP_Silk_range_coder_state *psRC, /* I/O compressor data structure */
const SKP_uint16 * const prob[], /* I cumulative density functions */
const SKP_int probStartIx[], /* I initial (middle) entries of cdfs [nSymbols] */
@@ -310,11 +281,6 @@ void SKP_Silk_range_dec_init(
SKP_LSHIFT_uint( (SKP_uint32)buffer[ 2 ], 8 ) |
(SKP_uint32)buffer[ 3 ];
psRC->range_Q16 = 0x0000FFFF;
psRC->error = 0;
}
@@ -363,11 +329,6 @@ void SKP_Silk_range_enc_wrap_up(
/* Store to stream, making sure not to write beyond buffer */
if( psRC->bufferIx < psRC->bufferLength ) {
psRC->buffer[ psRC->bufferIx++ ] = (SKP_uint8)SKP_RSHIFT_uint( base_Q24, 16 );
if( bits_to_store > 8 ) {
if( psRC->bufferIx < psRC->bufferLength ) {
@@ -409,15 +370,3 @@ void SKP_Silk_range_coder_check_after_decoding(
}
}
}

View File

@@ -1,7 +1,4 @@
/***********************************************************************
Copyright (c) 2006-2010, 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)
@@ -26,7 +23,6 @@ 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_FIX.h"
@@ -45,8 +41,3 @@ void SKP_Silk_regularize_correlations_FIX(
}
xx[ 0 ] += noise;
}

Some files were not shown because too many files have changed in this diff Show More