mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-16 16:58:35 +00:00
fix line endings
This commit is contained in:
parent
3466a2e468
commit
cd98ec85e2
@ -1,11 +1,11 @@
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 2.0.1
|
||||
*
|
||||
* This file is not intended to be easily readable and contains a number of
|
||||
*
|
||||
* This file is not intended to be easily readable and contains a number of
|
||||
* coding conventions designed to improve portability and efficiency. Do not make
|
||||
* changes to this file unless you know what you are doing--modify the SWIG
|
||||
* interface file instead.
|
||||
* changes to this file unless you know what you are doing--modify the SWIG
|
||||
* interface file instead.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
#define SWIGCSHARP
|
||||
@ -65,28 +65,28 @@ template <typename T> T SwigValueInit() {
|
||||
#ifndef SWIGUNUSED
|
||||
# if defined(__GNUC__)
|
||||
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
|
||||
# define SWIGUNUSED __attribute__ ((__unused__))
|
||||
# define SWIGUNUSED __attribute__ ((__unused__))
|
||||
# else
|
||||
# define SWIGUNUSED
|
||||
# endif
|
||||
# elif defined(__ICC)
|
||||
# define SWIGUNUSED __attribute__ ((__unused__))
|
||||
# define SWIGUNUSED __attribute__ ((__unused__))
|
||||
# else
|
||||
# define SWIGUNUSED
|
||||
# define SWIGUNUSED
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef SWIG_MSC_UNSUPPRESS_4505
|
||||
# if defined(_MSC_VER)
|
||||
# pragma warning(disable : 4505) /* unreferenced local function has been removed */
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef SWIGUNUSEDPARM
|
||||
# ifdef __cplusplus
|
||||
# define SWIGUNUSEDPARM(p)
|
||||
# else
|
||||
# define SWIGUNUSEDPARM(p) p SWIGUNUSED
|
||||
# define SWIGUNUSEDPARM(p) p SWIGUNUSED
|
||||
# endif
|
||||
#endif
|
||||
|
||||
@ -129,7 +129,7 @@ template <typename T> T SwigValueInit() {
|
||||
# define SWIGSTDCALL __stdcall
|
||||
# else
|
||||
# define SWIGSTDCALL
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
|
||||
@ -149,7 +149,7 @@ template <typename T> T SwigValueInit() {
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
/* Support for throwing C# exceptions from C/C++. There are two types:
|
||||
/* Support for throwing C# exceptions from C/C++. There are two types:
|
||||
* Exceptions that take a message and ArgumentExceptions that take a message and a parameter name. */
|
||||
typedef enum {
|
||||
SWIG_CSharpApplicationException,
|
||||
@ -222,19 +222,19 @@ static void SWIGUNUSED SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpExcepti
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
extern "C"
|
||||
#endif
|
||||
SWIGEXPORT void SWIGSTDCALL SWIGRegisterExceptionCallbacks_ESL(
|
||||
SWIG_CSharpExceptionCallback_t applicationCallback,
|
||||
SWIG_CSharpExceptionCallback_t arithmeticCallback,
|
||||
SWIG_CSharpExceptionCallback_t divideByZeroCallback,
|
||||
SWIG_CSharpExceptionCallback_t indexOutOfRangeCallback,
|
||||
SWIG_CSharpExceptionCallback_t divideByZeroCallback,
|
||||
SWIG_CSharpExceptionCallback_t indexOutOfRangeCallback,
|
||||
SWIG_CSharpExceptionCallback_t invalidCastCallback,
|
||||
SWIG_CSharpExceptionCallback_t invalidOperationCallback,
|
||||
SWIG_CSharpExceptionCallback_t ioCallback,
|
||||
SWIG_CSharpExceptionCallback_t nullReferenceCallback,
|
||||
SWIG_CSharpExceptionCallback_t outOfMemoryCallback,
|
||||
SWIG_CSharpExceptionCallback_t overflowCallback,
|
||||
SWIG_CSharpExceptionCallback_t outOfMemoryCallback,
|
||||
SWIG_CSharpExceptionCallback_t overflowCallback,
|
||||
SWIG_CSharpExceptionCallback_t systemCallback) {
|
||||
SWIG_csharp_exceptions[SWIG_CSharpApplicationException].callback = applicationCallback;
|
||||
SWIG_csharp_exceptions[SWIG_CSharpArithmeticException].callback = arithmeticCallback;
|
||||
@ -250,7 +250,7 @@ SWIGEXPORT void SWIGSTDCALL SWIGRegisterExceptionCallbacks_ESL(
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
extern "C"
|
||||
#endif
|
||||
SWIGEXPORT void SWIGSTDCALL SWIGRegisterExceptionArgumentCallbacks_ESL(
|
||||
SWIG_CSharpExceptionArgumentCallback_t argumentCallback,
|
||||
@ -268,7 +268,7 @@ static SWIG_CSharpStringHelperCallback SWIG_csharp_string_callback = NULL;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
extern "C"
|
||||
#endif
|
||||
SWIGEXPORT void SWIGSTDCALL SWIGRegisterStringCallback_ESL(SWIG_CSharpStringHelperCallback callback) {
|
||||
SWIG_csharp_string_callback = callback;
|
||||
@ -291,9 +291,9 @@ extern "C" {
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_ESLevent_Event_set(void * jarg1, void * jarg2) {
|
||||
ESLevent *arg1 = (ESLevent *) 0 ;
|
||||
esl_event_t *arg2 = (esl_event_t *) 0 ;
|
||||
|
||||
arg1 = (ESLevent *)jarg1;
|
||||
arg2 = (esl_event_t *)jarg2;
|
||||
|
||||
arg1 = (ESLevent *)jarg1;
|
||||
arg2 = (esl_event_t *)jarg2;
|
||||
if (arg1) (arg1)->event = arg2;
|
||||
}
|
||||
|
||||
@ -302,10 +302,10 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_ESLevent_Event_get(void * jarg1) {
|
||||
void * jresult ;
|
||||
ESLevent *arg1 = (ESLevent *) 0 ;
|
||||
esl_event_t *result = 0 ;
|
||||
|
||||
arg1 = (ESLevent *)jarg1;
|
||||
|
||||
arg1 = (ESLevent *)jarg1;
|
||||
result = (esl_event_t *) ((arg1)->event);
|
||||
jresult = (void *)result;
|
||||
jresult = (void *)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
@ -313,9 +313,9 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_ESLevent_Event_get(void * jarg1) {
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_ESLevent_SerializedString_set(void * jarg1, char * jarg2) {
|
||||
ESLevent *arg1 = (ESLevent *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
|
||||
arg1 = (ESLevent *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
|
||||
arg1 = (ESLevent *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
{
|
||||
if (arg1->serialized_string) delete [] arg1->serialized_string;
|
||||
if (arg2) {
|
||||
@ -332,10 +332,10 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_ESLevent_SerializedString_get(void * jarg1)
|
||||
char * jresult ;
|
||||
ESLevent *arg1 = (ESLevent *) 0 ;
|
||||
char *result = 0 ;
|
||||
|
||||
arg1 = (ESLevent *)jarg1;
|
||||
|
||||
arg1 = (ESLevent *)jarg1;
|
||||
result = (char *) ((arg1)->serialized_string);
|
||||
jresult = SWIG_csharp_string_callback((const char *)result);
|
||||
jresult = SWIG_csharp_string_callback((const char *)result);
|
||||
return jresult;
|
||||
}
|
||||
|
||||
@ -343,9 +343,9 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_ESLevent_SerializedString_get(void * jarg1)
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_ESLevent_Mine_set(void * jarg1, int jarg2) {
|
||||
ESLevent *arg1 = (ESLevent *) 0 ;
|
||||
int arg2 ;
|
||||
|
||||
arg1 = (ESLevent *)jarg1;
|
||||
arg2 = (int)jarg2;
|
||||
|
||||
arg1 = (ESLevent *)jarg1;
|
||||
arg2 = (int)jarg2;
|
||||
if (arg1) (arg1)->mine = arg2;
|
||||
}
|
||||
|
||||
@ -354,10 +354,10 @@ SWIGEXPORT int SWIGSTDCALL CSharp_ESLevent_Mine_get(void * jarg1) {
|
||||
int jresult ;
|
||||
ESLevent *arg1 = (ESLevent *) 0 ;
|
||||
int result;
|
||||
|
||||
arg1 = (ESLevent *)jarg1;
|
||||
|
||||
arg1 = (ESLevent *)jarg1;
|
||||
result = (int) ((arg1)->mine);
|
||||
jresult = result;
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
@ -367,11 +367,11 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_new_ESLevent__SWIG_0(char * jarg1, char * j
|
||||
char *arg1 = (char *) 0 ;
|
||||
char *arg2 = (char *) NULL ;
|
||||
ESLevent *result = 0 ;
|
||||
|
||||
arg1 = (char *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
|
||||
arg1 = (char *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
result = (ESLevent *)new ESLevent((char const *)arg1,(char const *)arg2);
|
||||
jresult = (void *)result;
|
||||
jresult = (void *)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
@ -381,11 +381,11 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_new_ESLevent__SWIG_1(void * jarg1, int jarg
|
||||
esl_event_t *arg1 = (esl_event_t *) 0 ;
|
||||
int arg2 = (int) 0 ;
|
||||
ESLevent *result = 0 ;
|
||||
|
||||
arg1 = (esl_event_t *)jarg1;
|
||||
arg2 = (int)jarg2;
|
||||
|
||||
arg1 = (esl_event_t *)jarg1;
|
||||
arg2 = (int)jarg2;
|
||||
result = (ESLevent *)new ESLevent(arg1,arg2);
|
||||
jresult = (void *)result;
|
||||
jresult = (void *)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
@ -394,18 +394,18 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_new_ESLevent__SWIG_2(void * jarg1) {
|
||||
void * jresult ;
|
||||
ESLevent *arg1 = (ESLevent *) 0 ;
|
||||
ESLevent *result = 0 ;
|
||||
|
||||
arg1 = (ESLevent *)jarg1;
|
||||
|
||||
arg1 = (ESLevent *)jarg1;
|
||||
result = (ESLevent *)new ESLevent(arg1);
|
||||
jresult = (void *)result;
|
||||
jresult = (void *)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_delete_ESLevent(void * jarg1) {
|
||||
ESLevent *arg1 = (ESLevent *) 0 ;
|
||||
|
||||
arg1 = (ESLevent *)jarg1;
|
||||
|
||||
arg1 = (ESLevent *)jarg1;
|
||||
delete arg1;
|
||||
}
|
||||
|
||||
@ -415,11 +415,11 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_ESLevent_Serialize(void * jarg1, char * jar
|
||||
ESLevent *arg1 = (ESLevent *) 0 ;
|
||||
char *arg2 = (char *) NULL ;
|
||||
char *result = 0 ;
|
||||
|
||||
arg1 = (ESLevent *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
|
||||
arg1 = (ESLevent *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
result = (char *)(arg1)->serialize((char const *)arg2);
|
||||
jresult = SWIG_csharp_string_callback((const char *)result);
|
||||
jresult = SWIG_csharp_string_callback((const char *)result);
|
||||
return jresult;
|
||||
}
|
||||
|
||||
@ -430,16 +430,16 @@ SWIGEXPORT unsigned int SWIGSTDCALL CSharp_ESLevent_SetPriority(void * jarg1, vo
|
||||
esl_priority_t arg2 = (esl_priority_t) ESL_PRIORITY_NORMAL ;
|
||||
esl_priority_t *argp2 ;
|
||||
bool result;
|
||||
|
||||
arg1 = (ESLevent *)jarg1;
|
||||
argp2 = (esl_priority_t *)jarg2;
|
||||
|
||||
arg1 = (ESLevent *)jarg1;
|
||||
argp2 = (esl_priority_t *)jarg2;
|
||||
if (!argp2) {
|
||||
SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null esl_priority_t", 0);
|
||||
return 0;
|
||||
}
|
||||
arg2 = *argp2;
|
||||
arg2 = *argp2;
|
||||
result = (bool)(arg1)->setPriority(arg2);
|
||||
jresult = result;
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
@ -450,12 +450,12 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_ESLevent_GetHeader(void * jarg1, char * jar
|
||||
char *arg2 = (char *) 0 ;
|
||||
int arg3 = (int) -1 ;
|
||||
char *result = 0 ;
|
||||
|
||||
arg1 = (ESLevent *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
arg3 = (int)jarg3;
|
||||
|
||||
arg1 = (ESLevent *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
arg3 = (int)jarg3;
|
||||
result = (char *)(arg1)->getHeader((char const *)arg2,arg3);
|
||||
jresult = SWIG_csharp_string_callback((const char *)result);
|
||||
jresult = SWIG_csharp_string_callback((const char *)result);
|
||||
return jresult;
|
||||
}
|
||||
|
||||
@ -464,10 +464,10 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_ESLevent_GetBody(void * jarg1) {
|
||||
char * jresult ;
|
||||
ESLevent *arg1 = (ESLevent *) 0 ;
|
||||
char *result = 0 ;
|
||||
|
||||
arg1 = (ESLevent *)jarg1;
|
||||
|
||||
arg1 = (ESLevent *)jarg1;
|
||||
result = (char *)(arg1)->getBody();
|
||||
jresult = SWIG_csharp_string_callback((const char *)result);
|
||||
jresult = SWIG_csharp_string_callback((const char *)result);
|
||||
return jresult;
|
||||
}
|
||||
|
||||
@ -476,10 +476,10 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_ESLevent_getType(void * jarg1) {
|
||||
char * jresult ;
|
||||
ESLevent *arg1 = (ESLevent *) 0 ;
|
||||
char *result = 0 ;
|
||||
|
||||
arg1 = (ESLevent *)jarg1;
|
||||
|
||||
arg1 = (ESLevent *)jarg1;
|
||||
result = (char *)(arg1)->getType();
|
||||
jresult = SWIG_csharp_string_callback((const char *)result);
|
||||
jresult = SWIG_csharp_string_callback((const char *)result);
|
||||
return jresult;
|
||||
}
|
||||
|
||||
@ -489,11 +489,11 @@ SWIGEXPORT unsigned int SWIGSTDCALL CSharp_ESLevent_AddBody(void * jarg1, char *
|
||||
ESLevent *arg1 = (ESLevent *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
bool result;
|
||||
|
||||
arg1 = (ESLevent *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
|
||||
arg1 = (ESLevent *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
result = (bool)(arg1)->addBody((char const *)arg2);
|
||||
jresult = result;
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
@ -504,12 +504,12 @@ SWIGEXPORT unsigned int SWIGSTDCALL CSharp_ESLevent_AddHeader(void * jarg1, char
|
||||
char *arg2 = (char *) 0 ;
|
||||
char *arg3 = (char *) 0 ;
|
||||
bool result;
|
||||
|
||||
arg1 = (ESLevent *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
arg3 = (char *)jarg3;
|
||||
|
||||
arg1 = (ESLevent *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
arg3 = (char *)jarg3;
|
||||
result = (bool)(arg1)->addHeader((char const *)arg2,(char const *)arg3);
|
||||
jresult = result;
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
@ -520,12 +520,12 @@ SWIGEXPORT unsigned int SWIGSTDCALL CSharp_ESLevent_pushHeader(void * jarg1, cha
|
||||
char *arg2 = (char *) 0 ;
|
||||
char *arg3 = (char *) 0 ;
|
||||
bool result;
|
||||
|
||||
arg1 = (ESLevent *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
arg3 = (char *)jarg3;
|
||||
|
||||
arg1 = (ESLevent *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
arg3 = (char *)jarg3;
|
||||
result = (bool)(arg1)->pushHeader((char const *)arg2,(char const *)arg3);
|
||||
jresult = result;
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
@ -536,12 +536,12 @@ SWIGEXPORT unsigned int SWIGSTDCALL CSharp_ESLevent_unshiftHeader(void * jarg1,
|
||||
char *arg2 = (char *) 0 ;
|
||||
char *arg3 = (char *) 0 ;
|
||||
bool result;
|
||||
|
||||
arg1 = (ESLevent *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
arg3 = (char *)jarg3;
|
||||
|
||||
arg1 = (ESLevent *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
arg3 = (char *)jarg3;
|
||||
result = (bool)(arg1)->unshiftHeader((char const *)arg2,(char const *)arg3);
|
||||
jresult = result;
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
@ -551,11 +551,11 @@ SWIGEXPORT unsigned int SWIGSTDCALL CSharp_ESLevent_DelHeader(void * jarg1, char
|
||||
ESLevent *arg1 = (ESLevent *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
bool result;
|
||||
|
||||
arg1 = (ESLevent *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
|
||||
arg1 = (ESLevent *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
result = (bool)(arg1)->delHeader((char const *)arg2);
|
||||
jresult = result;
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
@ -564,10 +564,10 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_ESLevent_FirstHeader(void * jarg1) {
|
||||
char * jresult ;
|
||||
ESLevent *arg1 = (ESLevent *) 0 ;
|
||||
char *result = 0 ;
|
||||
|
||||
arg1 = (ESLevent *)jarg1;
|
||||
|
||||
arg1 = (ESLevent *)jarg1;
|
||||
result = (char *)(arg1)->firstHeader();
|
||||
jresult = SWIG_csharp_string_callback((const char *)result);
|
||||
jresult = SWIG_csharp_string_callback((const char *)result);
|
||||
return jresult;
|
||||
}
|
||||
|
||||
@ -576,10 +576,10 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_ESLevent_NextHeader(void * jarg1) {
|
||||
char * jresult ;
|
||||
ESLevent *arg1 = (ESLevent *) 0 ;
|
||||
char *result = 0 ;
|
||||
|
||||
arg1 = (ESLevent *)jarg1;
|
||||
|
||||
arg1 = (ESLevent *)jarg1;
|
||||
result = (char *)(arg1)->nextHeader();
|
||||
jresult = SWIG_csharp_string_callback((const char *)result);
|
||||
jresult = SWIG_csharp_string_callback((const char *)result);
|
||||
return jresult;
|
||||
}
|
||||
|
||||
@ -591,13 +591,13 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_new_ESLconnection__SWIG_0(char * jarg1, int
|
||||
char *arg3 = (char *) 0 ;
|
||||
char *arg4 = (char *) 0 ;
|
||||
ESLconnection *result = 0 ;
|
||||
|
||||
arg1 = (char *)jarg1;
|
||||
arg2 = (int)jarg2;
|
||||
arg3 = (char *)jarg3;
|
||||
arg4 = (char *)jarg4;
|
||||
|
||||
arg1 = (char *)jarg1;
|
||||
arg2 = (int)jarg2;
|
||||
arg3 = (char *)jarg3;
|
||||
arg4 = (char *)jarg4;
|
||||
result = (ESLconnection *)new ESLconnection((char const *)arg1,arg2,(char const *)arg3,(char const *)arg4);
|
||||
jresult = (void *)result;
|
||||
jresult = (void *)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
@ -608,12 +608,12 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_new_ESLconnection__SWIG_1(char * jarg1, int
|
||||
int arg2 ;
|
||||
char *arg3 = (char *) 0 ;
|
||||
ESLconnection *result = 0 ;
|
||||
|
||||
arg1 = (char *)jarg1;
|
||||
arg2 = (int)jarg2;
|
||||
arg3 = (char *)jarg3;
|
||||
|
||||
arg1 = (char *)jarg1;
|
||||
arg2 = (int)jarg2;
|
||||
arg3 = (char *)jarg3;
|
||||
result = (ESLconnection *)new ESLconnection((char const *)arg1,arg2,(char const *)arg3);
|
||||
jresult = (void *)result;
|
||||
jresult = (void *)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
@ -625,13 +625,13 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_new_ESLconnection__SWIG_2(char * jarg1, cha
|
||||
char *arg3 = (char *) 0 ;
|
||||
char *arg4 = (char *) 0 ;
|
||||
ESLconnection *result = 0 ;
|
||||
|
||||
arg1 = (char *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
arg3 = (char *)jarg3;
|
||||
arg4 = (char *)jarg4;
|
||||
|
||||
arg1 = (char *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
arg3 = (char *)jarg3;
|
||||
arg4 = (char *)jarg4;
|
||||
result = (ESLconnection *)new ESLconnection((char const *)arg1,(char const *)arg2,(char const *)arg3,(char const *)arg4);
|
||||
jresult = (void *)result;
|
||||
jresult = (void *)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
@ -642,12 +642,12 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_new_ESLconnection__SWIG_3(char * jarg1, cha
|
||||
char *arg2 = (char *) 0 ;
|
||||
char *arg3 = (char *) 0 ;
|
||||
ESLconnection *result = 0 ;
|
||||
|
||||
arg1 = (char *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
arg3 = (char *)jarg3;
|
||||
|
||||
arg1 = (char *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
arg3 = (char *)jarg3;
|
||||
result = (ESLconnection *)new ESLconnection((char const *)arg1,(char const *)arg2,(char const *)arg3);
|
||||
jresult = (void *)result;
|
||||
jresult = (void *)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
@ -656,18 +656,18 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_new_ESLconnection__SWIG_4(int jarg1) {
|
||||
void * jresult ;
|
||||
int arg1 ;
|
||||
ESLconnection *result = 0 ;
|
||||
|
||||
arg1 = (int)jarg1;
|
||||
|
||||
arg1 = (int)jarg1;
|
||||
result = (ESLconnection *)new ESLconnection(arg1);
|
||||
jresult = (void *)result;
|
||||
jresult = (void *)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_delete_ESLconnection(void * jarg1) {
|
||||
ESLconnection *arg1 = (ESLconnection *) 0 ;
|
||||
|
||||
arg1 = (ESLconnection *)jarg1;
|
||||
|
||||
arg1 = (ESLconnection *)jarg1;
|
||||
delete arg1;
|
||||
}
|
||||
|
||||
@ -676,10 +676,10 @@ SWIGEXPORT int SWIGSTDCALL CSharp_ESLconnection_SocketDescriptor(void * jarg1) {
|
||||
int jresult ;
|
||||
ESLconnection *arg1 = (ESLconnection *) 0 ;
|
||||
int result;
|
||||
|
||||
arg1 = (ESLconnection *)jarg1;
|
||||
|
||||
arg1 = (ESLconnection *)jarg1;
|
||||
result = (int)(arg1)->socketDescriptor();
|
||||
jresult = result;
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
@ -688,10 +688,10 @@ SWIGEXPORT int SWIGSTDCALL CSharp_ESLconnection_Connected(void * jarg1) {
|
||||
int jresult ;
|
||||
ESLconnection *arg1 = (ESLconnection *) 0 ;
|
||||
int result;
|
||||
|
||||
arg1 = (ESLconnection *)jarg1;
|
||||
|
||||
arg1 = (ESLconnection *)jarg1;
|
||||
result = (int)(arg1)->connected();
|
||||
jresult = result;
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
@ -700,10 +700,10 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_ESLconnection_GetInfo(void * jarg1) {
|
||||
void * jresult ;
|
||||
ESLconnection *arg1 = (ESLconnection *) 0 ;
|
||||
ESLevent *result = 0 ;
|
||||
|
||||
arg1 = (ESLconnection *)jarg1;
|
||||
|
||||
arg1 = (ESLconnection *)jarg1;
|
||||
result = (ESLevent *)(arg1)->getInfo();
|
||||
jresult = (void *)result;
|
||||
jresult = (void *)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
@ -713,11 +713,11 @@ SWIGEXPORT int SWIGSTDCALL CSharp_ESLconnection_Send(void * jarg1, char * jarg2)
|
||||
ESLconnection *arg1 = (ESLconnection *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
int result;
|
||||
|
||||
arg1 = (ESLconnection *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
|
||||
arg1 = (ESLconnection *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
result = (int)(arg1)->send((char const *)arg2);
|
||||
jresult = result;
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
@ -727,11 +727,11 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_ESLconnection_SendRecv(void * jarg1, char *
|
||||
ESLconnection *arg1 = (ESLconnection *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
ESLevent *result = 0 ;
|
||||
|
||||
arg1 = (ESLconnection *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
|
||||
arg1 = (ESLconnection *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
result = (ESLevent *)(arg1)->sendRecv((char const *)arg2);
|
||||
jresult = (void *)result;
|
||||
jresult = (void *)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
@ -742,12 +742,12 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_ESLconnection_Api(void * jarg1, char * jarg
|
||||
char *arg2 = (char *) 0 ;
|
||||
char *arg3 = (char *) NULL ;
|
||||
ESLevent *result = 0 ;
|
||||
|
||||
arg1 = (ESLconnection *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
arg3 = (char *)jarg3;
|
||||
|
||||
arg1 = (ESLconnection *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
arg3 = (char *)jarg3;
|
||||
result = (ESLevent *)(arg1)->api((char const *)arg2,(char const *)arg3);
|
||||
jresult = (void *)result;
|
||||
jresult = (void *)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
@ -759,13 +759,13 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_ESLconnection_Bgapi(void * jarg1, char * ja
|
||||
char *arg3 = (char *) NULL ;
|
||||
char *arg4 = (char *) NULL ;
|
||||
ESLevent *result = 0 ;
|
||||
|
||||
arg1 = (ESLconnection *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
arg3 = (char *)jarg3;
|
||||
arg4 = (char *)jarg4;
|
||||
|
||||
arg1 = (ESLconnection *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
arg3 = (char *)jarg3;
|
||||
arg4 = (char *)jarg4;
|
||||
result = (ESLevent *)(arg1)->bgapi((char const *)arg2,(char const *)arg3,(char const *)arg4);
|
||||
jresult = (void *)result;
|
||||
jresult = (void *)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
@ -775,11 +775,11 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_ESLconnection_SendEvent(void * jarg1, void
|
||||
ESLconnection *arg1 = (ESLconnection *) 0 ;
|
||||
ESLevent *arg2 = (ESLevent *) 0 ;
|
||||
ESLevent *result = 0 ;
|
||||
|
||||
arg1 = (ESLconnection *)jarg1;
|
||||
arg2 = (ESLevent *)jarg2;
|
||||
|
||||
arg1 = (ESLconnection *)jarg1;
|
||||
arg2 = (ESLevent *)jarg2;
|
||||
result = (ESLevent *)(arg1)->sendEvent(arg2);
|
||||
jresult = (void *)result;
|
||||
jresult = (void *)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
@ -790,12 +790,12 @@ SWIGEXPORT int SWIGSTDCALL CSharp_ESLconnection_sendMSG(void * jarg1, void * jar
|
||||
ESLevent *arg2 = (ESLevent *) 0 ;
|
||||
char *arg3 = (char *) NULL ;
|
||||
int result;
|
||||
|
||||
arg1 = (ESLconnection *)jarg1;
|
||||
arg2 = (ESLevent *)jarg2;
|
||||
arg3 = (char *)jarg3;
|
||||
|
||||
arg1 = (ESLconnection *)jarg1;
|
||||
arg2 = (ESLevent *)jarg2;
|
||||
arg3 = (char *)jarg3;
|
||||
result = (int)(arg1)->sendMSG(arg2,(char const *)arg3);
|
||||
jresult = result;
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
@ -804,10 +804,10 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_ESLconnection_RecvEvent(void * jarg1) {
|
||||
void * jresult ;
|
||||
ESLconnection *arg1 = (ESLconnection *) 0 ;
|
||||
ESLevent *result = 0 ;
|
||||
|
||||
arg1 = (ESLconnection *)jarg1;
|
||||
|
||||
arg1 = (ESLconnection *)jarg1;
|
||||
result = (ESLevent *)(arg1)->recvEvent();
|
||||
jresult = (void *)result;
|
||||
jresult = (void *)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
@ -817,11 +817,11 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_ESLconnection_RecvEventTimed(void * jarg1,
|
||||
ESLconnection *arg1 = (ESLconnection *) 0 ;
|
||||
int arg2 ;
|
||||
ESLevent *result = 0 ;
|
||||
|
||||
arg1 = (ESLconnection *)jarg1;
|
||||
arg2 = (int)jarg2;
|
||||
|
||||
arg1 = (ESLconnection *)jarg1;
|
||||
arg2 = (int)jarg2;
|
||||
result = (ESLevent *)(arg1)->recvEventTimed(arg2);
|
||||
jresult = (void *)result;
|
||||
jresult = (void *)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
@ -832,12 +832,12 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_ESLconnection_Filter(void * jarg1, char * j
|
||||
char *arg2 = (char *) 0 ;
|
||||
char *arg3 = (char *) 0 ;
|
||||
ESLevent *result = 0 ;
|
||||
|
||||
arg1 = (ESLconnection *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
arg3 = (char *)jarg3;
|
||||
|
||||
arg1 = (ESLconnection *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
arg3 = (char *)jarg3;
|
||||
result = (ESLevent *)(arg1)->filter((char const *)arg2,(char const *)arg3);
|
||||
jresult = (void *)result;
|
||||
jresult = (void *)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
@ -848,12 +848,12 @@ SWIGEXPORT int SWIGSTDCALL CSharp_ESLconnection_Events(void * jarg1, char * jarg
|
||||
char *arg2 = (char *) 0 ;
|
||||
char *arg3 = (char *) 0 ;
|
||||
int result;
|
||||
|
||||
arg1 = (ESLconnection *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
arg3 = (char *)jarg3;
|
||||
|
||||
arg1 = (ESLconnection *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
arg3 = (char *)jarg3;
|
||||
result = (int)(arg1)->events((char const *)arg2,(char const *)arg3);
|
||||
jresult = result;
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
@ -865,13 +865,13 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_ESLconnection_Execute(void * jarg1, char *
|
||||
char *arg3 = (char *) NULL ;
|
||||
char *arg4 = (char *) NULL ;
|
||||
ESLevent *result = 0 ;
|
||||
|
||||
arg1 = (ESLconnection *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
arg3 = (char *)jarg3;
|
||||
arg4 = (char *)jarg4;
|
||||
|
||||
arg1 = (ESLconnection *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
arg3 = (char *)jarg3;
|
||||
arg4 = (char *)jarg4;
|
||||
result = (ESLevent *)(arg1)->execute((char const *)arg2,(char const *)arg3,(char const *)arg4);
|
||||
jresult = (void *)result;
|
||||
jresult = (void *)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
@ -883,13 +883,13 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_ESLconnection_ExecuteAsync(void * jarg1, ch
|
||||
char *arg3 = (char *) NULL ;
|
||||
char *arg4 = (char *) NULL ;
|
||||
ESLevent *result = 0 ;
|
||||
|
||||
arg1 = (ESLconnection *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
arg3 = (char *)jarg3;
|
||||
arg4 = (char *)jarg4;
|
||||
|
||||
arg1 = (ESLconnection *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
arg3 = (char *)jarg3;
|
||||
arg4 = (char *)jarg4;
|
||||
result = (ESLevent *)(arg1)->executeAsync((char const *)arg2,(char const *)arg3,(char const *)arg4);
|
||||
jresult = (void *)result;
|
||||
jresult = (void *)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
@ -899,11 +899,11 @@ SWIGEXPORT int SWIGSTDCALL CSharp_ESLconnection_SetAsyncExecute(void * jarg1, ch
|
||||
ESLconnection *arg1 = (ESLconnection *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
int result;
|
||||
|
||||
arg1 = (ESLconnection *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
|
||||
arg1 = (ESLconnection *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
result = (int)(arg1)->setAsyncExecute((char const *)arg2);
|
||||
jresult = result;
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
@ -913,11 +913,11 @@ SWIGEXPORT int SWIGSTDCALL CSharp_ESLconnection_SetEventLock(void * jarg1, char
|
||||
ESLconnection *arg1 = (ESLconnection *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
int result;
|
||||
|
||||
arg1 = (ESLconnection *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
|
||||
arg1 = (ESLconnection *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
result = (int)(arg1)->setEventLock((char const *)arg2);
|
||||
jresult = result;
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
@ -926,18 +926,18 @@ SWIGEXPORT int SWIGSTDCALL CSharp_ESLconnection_Disconnect(void * jarg1) {
|
||||
int jresult ;
|
||||
ESLconnection *arg1 = (ESLconnection *) 0 ;
|
||||
int result;
|
||||
|
||||
arg1 = (ESLconnection *)jarg1;
|
||||
|
||||
arg1 = (ESLconnection *)jarg1;
|
||||
result = (int)(arg1)->disconnect();
|
||||
jresult = result;
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_eslSetLogLevel(int jarg1) {
|
||||
int arg1 ;
|
||||
|
||||
arg1 = (int)jarg1;
|
||||
|
||||
arg1 = (int)jarg1;
|
||||
eslSetLogLevel(arg1);
|
||||
}
|
||||
|
||||
@ -945,4 +945,3 @@ SWIGEXPORT void SWIGSTDCALL CSharp_eslSetLogLevel(int jarg1) {
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -5,45 +5,45 @@
|
||||
Contents: AT&T 5ESS ISDN State Engine for NT (Network Mode).
|
||||
|
||||
The controlling state engine for Q.931 is the state engine
|
||||
on the NT side. The state engine on the TE side is a slave
|
||||
on the NT side. The state engine on the TE side is a slave
|
||||
of this. The TE side maintain it's own states as described in
|
||||
ITU-T Q931, but will in raise conditions be overridden by
|
||||
ITU-T Q931, but will in raise conditions be overridden by
|
||||
the NT side.
|
||||
|
||||
License/Copyright:
|
||||
|
||||
Copyright (c) 2007, Jan Vidar Berger, Case Labs, Ltd. All rights reserved.
|
||||
email:janvb@caselaboratories.com
|
||||
email:janvb@caselaboratories.com
|
||||
|
||||
Copyright (c) 2007, Michael Jerris. All rights reserved.
|
||||
email:mike@jerris.com
|
||||
|
||||
email:mike@jerris.com
|
||||
|
||||
Copyright (c) 2007, Michael S. Collins, All rights reserved.
|
||||
email:mcollins@fcnetwork.com
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* 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
|
||||
* 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 the Case Labs, Ltd nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
* Neither the name of the Case Labs, Ltd nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
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
|
||||
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.
|
||||
*****************************************************************************/
|
||||
|
||||
@ -95,7 +95,7 @@ void ATT5ESSCreateNT(L3UCHAR i)
|
||||
Q931SetMesProc(Q932mes_RETRIEVE_ACKNOWLEDGE, i, Q932ProcRetrieveAckNT, Q932Umes_RetrieveAck, Q932Pmes_RetrieveAck);
|
||||
Q931SetMesProc(Q932mes_RETRIEVE_REJECT, i, Q932ProcRetrieveRejectNT, Q932Umes_RetrieveReject, Q932Pmes_RetrieveReject);
|
||||
|
||||
/* Set up the IE encoder/decoder handle table.*/
|
||||
/* Set up the IE encoder/decoder handle table.*/
|
||||
Q931SetIEProc(Q931ie_SEGMENTED_MESSAGE, i, Q931Pie_Segment, Q931Uie_Segment);
|
||||
Q931SetIEProc(Q931ie_BEARER_CAPABILITY, i, Q931Pie_BearerCap, Q931Uie_BearerCap);
|
||||
Q931SetIEProc(Q931ie_CAUSE, i, Q931Pie_Cause, Q931Uie_Cause);
|
||||
|
@ -5,12 +5,12 @@
|
||||
Contents: AT&T 5ESS ISDN State Engine for TE (User Mode).
|
||||
|
||||
The controlling state engine for Q.931 is the state engine
|
||||
on the NT side. The state engine on the TE side is a slave
|
||||
on the NT side. The state engine on the TE side is a slave
|
||||
of this. The TE side maintain it's own states as described in
|
||||
ITU-T Q931, but will in raise conditions be overridden by
|
||||
ITU-T Q931, but will in raise conditions be overridden by
|
||||
the NT side.
|
||||
|
||||
This reference implementation uses a process per message,
|
||||
This reference implementation uses a process per message,
|
||||
meaning that each message must check call states. This
|
||||
is easier for dialect maintenance as each message proc
|
||||
can be replaced individually. A new TE variant only
|
||||
@ -20,37 +20,37 @@
|
||||
License/Copyright:
|
||||
|
||||
Copyright (c) 2007, Jan Vidar Berger, Case Labs, Ltd. All rights reserved.
|
||||
email:janvb@caselaboratories.com
|
||||
email:janvb@caselaboratories.com
|
||||
|
||||
Copyright (c) 2007, Michael Jerris. All rights reserved.
|
||||
email:mike@jerris.com
|
||||
|
||||
email:mike@jerris.com
|
||||
|
||||
Copyright (c) 2007, Michael S. Collins, All rights reserved.
|
||||
email:mcollins@fcnetwork.com
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* 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
|
||||
* 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 the Case Labs, Ltd nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
* Neither the name of the Case Labs, Ltd nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
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
|
||||
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.
|
||||
*****************************************************************************/
|
||||
|
||||
@ -103,7 +103,7 @@ void ATT5ESSCreateTE(L3UCHAR i)
|
||||
Q931SetMesProc(Q932mes_RETRIEVE_ACKNOWLEDGE, i, Q932ProcRetrieveAckTE, Q932Umes_RetrieveAck, Q932Pmes_RetrieveAck);
|
||||
Q931SetMesProc(Q932mes_RETRIEVE_REJECT, i, Q932ProcRetrieveRejectTE, Q932Umes_RetrieveReject, Q932Pmes_RetrieveReject);
|
||||
|
||||
/* Set up the IE encoder/decoder handle table.*/
|
||||
/* Set up the IE encoder/decoder handle table.*/
|
||||
Q931SetIEProc(Q931ie_SEGMENTED_MESSAGE, i, Q931Pie_Segment, Q931Uie_Segment);
|
||||
Q931SetIEProc(Q931ie_BEARER_CAPABILITY, i, Q931Pie_BearerCap, Q931Uie_BearerCap);
|
||||
Q931SetIEProc(Q931ie_CAUSE, i, Q931Pie_Cause, Q931Uie_Cause);
|
||||
@ -211,9 +211,9 @@ void ATT5ESSCreateTE(L3UCHAR i)
|
||||
Q931AddStateEntry(i, Q931_U15, Q931mes_RELEASE, 4);
|
||||
|
||||
/* TODO
|
||||
Q931AddStateEntry(i, Q931_U17,
|
||||
Q931AddStateEntry(i, Q931_U19,
|
||||
Q931AddStateEntry(i, Q931_U25,
|
||||
Q931AddStateEntry(i, Q931_U17,
|
||||
Q931AddStateEntry(i, Q931_U19,
|
||||
Q931AddStateEntry(i, Q931_U25,
|
||||
*/
|
||||
}
|
||||
|
||||
|
@ -7,42 +7,42 @@
|
||||
that contains variables sized by the user. It will also pack
|
||||
the struct back into a Q.931 message as required.
|
||||
|
||||
See 5ESS.h for description.
|
||||
See 5ESS.h for description.
|
||||
|
||||
License/Copyright:
|
||||
|
||||
Copyright (c) 2007, Jan Vidar Berger, Case Labs, Ltd. All rights reserved.
|
||||
email:janvb@caselaboratories.com
|
||||
email:janvb@caselaboratories.com
|
||||
|
||||
Copyright (c) 2007, Michael Jerris. All rights reserved.
|
||||
email:mike@jerris.com
|
||||
|
||||
|
||||
Copyright (c) 2007, Michael S. Collins, All rights reserved.
|
||||
email:mcollins@fcnetwork.com
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* 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
|
||||
* 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 the Case Labs, Ltd nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
* Neither the name of the Case Labs, Ltd nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
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
|
||||
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.
|
||||
|
||||
*****************************************************************************/
|
||||
@ -98,7 +98,7 @@ L3INT ATT5ESSUmes_Setup(Q931_TrunkInfo_t *pTrunk, L3UCHAR *IBuf, Q931mes_Generic
|
||||
case Q931ie_HIGH_LAYER_COMPATIBILITY:
|
||||
case Q931ie_FACILITY:
|
||||
rc = Q931Uie[pTrunk->Dialect][IBuf[IOff]](pTrunk, mes, &IBuf[IOff], &mes->buf[OOff], &IOff, &OOff);
|
||||
if (rc != Q931E_NO_ERROR)
|
||||
if (rc != Q931E_NO_ERROR)
|
||||
return rc;
|
||||
break;
|
||||
case Q931ie_REPEAT_INDICATOR:
|
||||
@ -118,7 +118,7 @@ L3INT ATT5ESSUmes_Setup(Q931_TrunkInfo_t *pTrunk, L3UCHAR *IBuf, Q931mes_Generic
|
||||
{
|
||||
case Q931ie_GENERIC_DIGITS:
|
||||
rc = Q931Uie[pTrunk->Dialect][IBuf[IOff]](pTrunk, mes, &IBuf[IOff], &mes->buf[OOff], &IOff, &OOff);
|
||||
if (rc != Q931E_NO_ERROR)
|
||||
if (rc != Q931E_NO_ERROR)
|
||||
return rc;
|
||||
break;
|
||||
default:
|
||||
@ -130,7 +130,7 @@ L3INT ATT5ESSUmes_Setup(Q931_TrunkInfo_t *pTrunk, L3UCHAR *IBuf, Q931mes_Generic
|
||||
{
|
||||
case Q931ie_DISPLAY:
|
||||
rc = Q931Uie[pTrunk->Dialect][IBuf[IOff]](pTrunk, mes, &IBuf[IOff], &mes->buf[OOff], &IOff, &OOff);
|
||||
if (rc != Q931E_NO_ERROR)
|
||||
if (rc != Q931E_NO_ERROR)
|
||||
return rc;
|
||||
break;
|
||||
default:
|
||||
@ -171,7 +171,7 @@ L3INT ATT5ESSPmes_Setup(Q931_TrunkInfo_t *pTrunk, Q931mes_Generic *IBuf, L3INT I
|
||||
|
||||
/* Q931 Message Header */
|
||||
Q931MesgHeader(pTrunk, pMes, OBuf, *OSize, &Octet);
|
||||
|
||||
|
||||
/* Sending Complete */
|
||||
if (Q931IsIEPresent(pMes->SendComplete)) {
|
||||
OBuf[Octet++] = (L3UCHAR)(pMes->SendComplete & 0x00ff);
|
||||
|
@ -8,4 +8,3 @@
|
||||
|
||||
./iLBC_test 20 iLBC.INP tmp.BIT iLBC_20ms_tlm05.OUT tlm05.chn
|
||||
./iLBC_test 30 iLBC.INP tmp.BIT iLBC_30ms_tlm05.OUT tlm05.chn
|
||||
|
||||
|
@ -3,8 +3,8 @@
|
||||
* Copyright (c) 2006-2009 Philip R. Zimmermann. All rights reserved.
|
||||
* Contact: http://philzimmermann.com
|
||||
* For licensing and other legal details, see the file zrtp_legal.c.
|
||||
*
|
||||
* Viktor Krykun <v.krikun at zfoneproject.com>
|
||||
*
|
||||
* Viktor Krykun <v.krikun at zfoneproject.com>
|
||||
*/
|
||||
|
||||
#ifndef ZRTP_WIN_CONFIG_H__
|
||||
|
@ -63,7 +63,7 @@ private:
|
||||
private:
|
||||
TInt iState; // State of the active object
|
||||
RTimer iTimer; // Provides async timing service
|
||||
|
||||
|
||||
zrtp_stream_t *iCtx;
|
||||
zrtp_retry_task_t * iZTask;
|
||||
|
||||
|
@ -26,7 +26,7 @@ extern "C"
|
||||
uint32_t zrtp_symbian_kernel_random();
|
||||
|
||||
/**
|
||||
* @brief Pseudo random number: sum of pid's shifted and xored by number of precceses
|
||||
* @brief Pseudo random number: sum of pid's shifted and xored by number of precceses
|
||||
* @return
|
||||
*/
|
||||
uint32_t zrtp_sum_of_pid_and_number_of_poccesses();
|
||||
@ -59,19 +59,19 @@ zrtp_status_t zrtp_mutex_init(zrtp_mutex_t **mutex) {
|
||||
//rmutex->CreateLocal(); was before
|
||||
rmutex->CreateGlobal(KNullDesC);
|
||||
*mutex = (zrtp_mutex_t*) rmutex;
|
||||
return zrtp_status_ok;
|
||||
return zrtp_status_ok;
|
||||
}
|
||||
|
||||
zrtp_status_t zrtp_mutex_lock(zrtp_mutex_t* mutex) {
|
||||
RMutex *rmutex = (RMutex *) mutex;
|
||||
rmutex->Wait();
|
||||
return zrtp_status_ok;
|
||||
return zrtp_status_ok;
|
||||
}
|
||||
|
||||
zrtp_status_t zrtp_mutex_unlock(zrtp_mutex_t* mutex) {
|
||||
RMutex *rmutex = (RMutex *) mutex;
|
||||
rmutex->Signal();
|
||||
return zrtp_status_ok;
|
||||
return zrtp_status_ok;
|
||||
}
|
||||
|
||||
zrtp_status_t zrtp_mutex_destroy(zrtp_mutex_t* mutex) {
|
||||
@ -80,7 +80,7 @@ zrtp_status_t zrtp_mutex_destroy(zrtp_mutex_t* mutex) {
|
||||
rmutex->Close();
|
||||
delete rmutex;
|
||||
}
|
||||
return zrtp_status_ok;
|
||||
return zrtp_status_ok;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -89,7 +89,7 @@ zrtp_status_t zrtp_sem_init(zrtp_sem_t** sem, uint32_t value, uint32_t limit) {
|
||||
//rsem->CreateLocal(value);
|
||||
rsem->CreateGlobal(KNullDesC,value);
|
||||
*sem = (zrtp_sem_t*) rsem;
|
||||
return zrtp_status_ok;
|
||||
return zrtp_status_ok;
|
||||
}
|
||||
|
||||
zrtp_status_t zrtp_sem_destroy(zrtp_sem_t* sem) {
|
||||
@ -98,25 +98,25 @@ zrtp_status_t zrtp_sem_destroy(zrtp_sem_t* sem) {
|
||||
rsem->Close();
|
||||
delete rsem;
|
||||
}
|
||||
return zrtp_status_ok;
|
||||
return zrtp_status_ok;
|
||||
}
|
||||
|
||||
zrtp_status_t zrtp_sem_wait(zrtp_sem_t* sem) {
|
||||
RSemaphore *rsem = (RSemaphore *) sem;
|
||||
rsem->Wait();
|
||||
return zrtp_status_ok;
|
||||
return zrtp_status_ok;
|
||||
}
|
||||
|
||||
zrtp_status_t zrtp_sem_trtwait(zrtp_sem_t* sem) {
|
||||
RSemaphore *rsem = (RSemaphore *) sem;
|
||||
rsem->Wait(1000);
|
||||
return zrtp_status_ok;
|
||||
return zrtp_status_ok;
|
||||
}
|
||||
|
||||
zrtp_status_t zrtp_sem_post(zrtp_sem_t* sem) {
|
||||
RSemaphore *rsem = (RSemaphore *) sem;
|
||||
rsem->Signal();
|
||||
return zrtp_status_ok;
|
||||
return zrtp_status_ok;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -126,14 +126,14 @@ int zrtp_sleep(unsigned int msec) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int zrtp_thread_create(zrtp_thread_routine_t start_routine, void *arg) {
|
||||
int zrtp_thread_create(zrtp_thread_routine_t start_routine, void *arg) {
|
||||
RThread h;
|
||||
TBuf<64> thName=_L("zrtp_thread");
|
||||
|
||||
h.Create(thName, start_routine, KDefaultStackSize*2, NULL, arg) ;
|
||||
h.Create(thName, start_routine, KDefaultStackSize*2, NULL, arg) ;
|
||||
h.Resume();
|
||||
h.Close();
|
||||
|
||||
|
||||
return NULL;
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -146,7 +146,7 @@ mlist_t tasks_head_s;
|
||||
static uint8_t inited = 0 ;
|
||||
static uint8_t is_running = 0;
|
||||
|
||||
typedef struct {
|
||||
typedef struct {
|
||||
zrtp_stream_t *ctx; /** ZRTP stream context associated with the task */
|
||||
zrtp_retry_task_t *ztask; /** ZRTP stream associated with the task */
|
||||
mlist_t _mlist;
|
||||
@ -154,9 +154,9 @@ typedef struct {
|
||||
} zrtp_sched_task_s_t;
|
||||
|
||||
zrtp_status_t zrtp_def_scheduler_init(zrtp_global_t* zrtp)
|
||||
{
|
||||
{
|
||||
zrtp_status_t status = zrtp_status_ok;
|
||||
ZRTP_LOG(3,("symbian","Init start"));
|
||||
ZRTP_LOG(3,("symbian","Init start"));
|
||||
if (inited) {
|
||||
return zrtp_status_ok;
|
||||
}
|
||||
@ -172,18 +172,18 @@ zrtp_status_t zrtp_def_scheduler_init(zrtp_global_t* zrtp)
|
||||
}
|
||||
|
||||
void zrtp_def_scheduler_down()
|
||||
{
|
||||
{
|
||||
ZRTP_LOG(3,("symbian","Down start"));
|
||||
mlist_t *node = 0, *tmp = 0;
|
||||
|
||||
|
||||
if (!inited) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Stop main thread */
|
||||
is_running = 0;
|
||||
/* Stop main thread */
|
||||
is_running = 0;
|
||||
// zrtp_sem_post(count);
|
||||
|
||||
|
||||
/* Then destroy tasks queue and realease all other resources */
|
||||
//zrtp_mutex_lock(protector);
|
||||
|
||||
@ -198,7 +198,7 @@ void zrtp_def_scheduler_down()
|
||||
init_mlist(&tasks_head_s);
|
||||
|
||||
// zrtp_mutex_unlock(protector);
|
||||
|
||||
|
||||
// zrtp_mutex_destroy(protector);
|
||||
// zrtp_sem_destroy(count);
|
||||
|
||||
@ -208,9 +208,9 @@ void zrtp_def_scheduler_down()
|
||||
|
||||
|
||||
void zrtp_def_scheduler_call_later(zrtp_stream_t *ctx, zrtp_retry_task_t* ztask)
|
||||
{
|
||||
{
|
||||
// ZRTP_LOG(3,("symbian","CallLater start"));
|
||||
//mlist_t *node=0, *tmp=0;
|
||||
//mlist_t *node=0, *tmp=0;
|
||||
mlist_t* last = &tasks_head_s;
|
||||
|
||||
//zrtp_mutex_lock(protector);
|
||||
@ -227,17 +227,17 @@ void zrtp_def_scheduler_call_later(zrtp_stream_t *ctx, zrtp_retry_task_t* ztask)
|
||||
}
|
||||
|
||||
new_task->ctx = ctx;
|
||||
new_task->ztask = ztask;
|
||||
new_task->ztask = ztask;
|
||||
new_task->ao = CDelayRuner::NewL();
|
||||
|
||||
mlist_insert(last, &new_task->_mlist);
|
||||
|
||||
|
||||
mlist_insert(last, &new_task->_mlist);
|
||||
|
||||
new_task->ao->StartL(ctx,ztask);
|
||||
//zrtp_sem_post(count);
|
||||
} while (0);
|
||||
|
||||
//ZRTP_LOG(3,("symbian","CallLater end"));
|
||||
//zrtp_mutex_unlock(protector);
|
||||
//zrtp_mutex_unlock(protector);
|
||||
}
|
||||
|
||||
void zrtp_def_scheduler_cancel_call_later(zrtp_stream_t* ctx, zrtp_retry_task_t* ztask)
|
||||
@ -260,24 +260,24 @@ void zrtp_def_scheduler_cancel_call_later(zrtp_stream_t* ctx, zrtp_retry_task_t*
|
||||
}
|
||||
}
|
||||
ZRTP_LOG(3,("symbian","CancelCallLater done"));
|
||||
// zrtp_mutex_unlock(protector);
|
||||
// zrtp_mutex_unlock(protector);
|
||||
}
|
||||
|
||||
void zrtp_internal_delete_task_from_list(zrtp_stream_t* ctx, zrtp_retry_task_t* ztask)
|
||||
{
|
||||
mlist_t *node=0, *tmp=0;
|
||||
ZRTP_LOG(3,("symbian","DelTask begin"));
|
||||
mlist_for_each_safe(node, tmp, &tasks_head_s)
|
||||
mlist_for_each_safe(node, tmp, &tasks_head_s)
|
||||
{
|
||||
zrtp_sched_task_s_t* task = mlist_get_struct(zrtp_sched_task_s_t, _mlist, node);
|
||||
if ((task->ctx == ctx) && ((task->ztask == ztask) || !ztask))
|
||||
if ((task->ctx == ctx) && ((task->ztask == ztask) || !ztask))
|
||||
{
|
||||
delete task->ao; // Cancel and delete task
|
||||
mlist_del(&task->_mlist);
|
||||
zrtp_sys_free(task);
|
||||
ZRTP_LOG(3,("symbian","DelTask Del"));
|
||||
//zrtp_sem_trtwait(count);
|
||||
if (ztask)
|
||||
if (ztask)
|
||||
{
|
||||
break;
|
||||
}
|
||||
@ -300,7 +300,7 @@ unsigned int zrtp_get_pid()
|
||||
uint64_t zrtp_get_system_time_crazy()
|
||||
{
|
||||
TTime time;
|
||||
|
||||
|
||||
return time.MicroSecondsFrom(TTime(TDateTime (491,EAugust,7,3,37,17,347))).Int64();
|
||||
}
|
||||
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -56,7 +56,7 @@ typedef struct {
|
||||
/***********************************************/
|
||||
/* Get size in bytes of the Silk encoder state */
|
||||
/***********************************************/
|
||||
SKP_int SKP_Silk_SDK_Get_Encoder_Size(
|
||||
SKP_int SKP_Silk_SDK_Get_Encoder_Size(
|
||||
SKP_int32 *encSizeBytes /* O: Number of bytes in SILK encoder state */
|
||||
);
|
||||
|
||||
@ -79,7 +79,7 @@ SKP_int SKP_Silk_SDK_QueryEncoder(
|
||||
/**************************/
|
||||
/* Encode frame with Silk */
|
||||
/**************************/
|
||||
SKP_int SKP_Silk_SDK_Encode(
|
||||
SKP_int SKP_Silk_SDK_Encode(
|
||||
void *encState, /* I/O: State */
|
||||
const SKP_SILK_SDK_EncControlStruct *encControl, /* I: Control status */
|
||||
const SKP_int16 *samplesIn, /* I: Speech sample input vector */
|
||||
@ -95,14 +95,14 @@ SKP_int SKP_Silk_SDK_Encode(
|
||||
/***********************************************/
|
||||
/* Get size in bytes of the Silk decoder state */
|
||||
/***********************************************/
|
||||
SKP_int SKP_Silk_SDK_Get_Decoder_Size(
|
||||
SKP_int SKP_Silk_SDK_Get_Decoder_Size(
|
||||
SKP_int32 *decSizeBytes /* O: Number of bytes in SILK decoder state */
|
||||
);
|
||||
|
||||
/*************************/
|
||||
/* Init or Reset decoder */
|
||||
/*************************/
|
||||
SKP_int SKP_Silk_SDK_InitDecoder(
|
||||
SKP_int SKP_Silk_SDK_InitDecoder(
|
||||
void *decState /* I/O: State */
|
||||
);
|
||||
|
||||
@ -142,7 +142,7 @@ void SKP_Silk_SDK_get_TOC(
|
||||
/**************************/
|
||||
/* Get the version number */
|
||||
/**************************/
|
||||
/* Return a pointer to string specifying the version */
|
||||
/* Return a pointer to string specifying the version */
|
||||
const char *SKP_Silk_SDK_get_version();
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -49,11 +49,11 @@ typedef struct {
|
||||
SKP_int packetSize;
|
||||
|
||||
/* I: Bitrate during active speech in bits/second; internally limited */
|
||||
SKP_int32 bitRate;
|
||||
SKP_int32 bitRate;
|
||||
|
||||
/* I: Uplink packet loss in percent (0-100) */
|
||||
SKP_int packetLossPercentage;
|
||||
|
||||
|
||||
/* I: Complexity mode; 0 is lowest; 1 is medium and 2 is highest complexity */
|
||||
SKP_int complexity;
|
||||
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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,10 +65,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# define SKP_STR_CASEINSENSITIVE_COMPARE(x, y) _stricmp(x, y)
|
||||
#else
|
||||
# define SKP_STR_CASEINSENSITIVE_COMPARE(x, y) strcasecmp(x, y)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define SKP_int64_MAX ((SKP_int64)0x7FFFFFFFFFFFFFFFLL) // 2^63 - 1
|
||||
#define SKP_int64_MIN ((SKP_int64)0x8000000000000000LL) // -2^63
|
||||
#define SKP_int64_MAX ((SKP_int64)0x7FFFFFFFFFFFFFFFLL) // 2^63 - 1
|
||||
#define SKP_int64_MIN ((SKP_int64)0x8000000000000000LL) // -2^63
|
||||
#define SKP_int32_MAX 0x7FFFFFFF // 2^31 - 1 = 2147483647
|
||||
#define SKP_int32_MIN ((SKP_int32)0x80000000) // -2^31 = -2147483648
|
||||
#define SKP_int16_MAX 0x7FFF // 2^15 - 1 = 32767
|
||||
|
@ -17,14 +17,14 @@ point SILK SDK library. The following is included in this package:
|
||||
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 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
|
||||
@ -32,9 +32,9 @@ II. Files and Folders
|
||||
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
|
||||
@ -55,12 +55,12 @@ III. How to use the Makefile
|
||||
|
||||
Make clean all ADDED_DEFINES+=_SYSTEM_IS_BIG_ENDIAN
|
||||
To be able to use the test vectors with big endian CPU's the test programs
|
||||
need to be compiled in a different way. Note that the 16 bit input and output
|
||||
from the test programs will have the upper and lower bytes swapped with this setting.
|
||||
need to be compiled in a different way. Note that the 16 bit input and output
|
||||
from the test programs will have the upper and lower bytes swapped with this setting.
|
||||
|
||||
7. How to use the comparison tool:
|
||||
|
||||
See 'How to use the test vectors.txt' in the test_vectors folder.
|
||||
See 'How to use the test vectors.txt' in the test_vectors folder.
|
||||
|
||||
IV. History
|
||||
|
||||
@ -74,7 +74,7 @@ IV. History
|
||||
Version 1.0.3 - Updated with various bugfixes and improvements
|
||||
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 on the following platforms:
|
||||
@ -83,7 +83,7 @@ V. Compatibility
|
||||
Windows Vista, 32-bit version
|
||||
Mac OSX intel
|
||||
Mac OSX ppc
|
||||
Ubuntu Linux 9.10, 64-bit version
|
||||
Ubuntu Linux 9.10, 64-bit version
|
||||
|
||||
VI. Known Issues
|
||||
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -49,14 +49,14 @@ SKP_INLINE void SKP_Silk_A2NLSF_trans_poly(
|
||||
)
|
||||
{
|
||||
SKP_int k, n;
|
||||
|
||||
|
||||
for( k = 2; k <= dd; k++ ) {
|
||||
for( n = dd; n > k; n-- ) {
|
||||
p[ n - 2 ] -= p[ n ];
|
||||
}
|
||||
p[ k - 2 ] -= SKP_LSHIFT( p[ k ], 1 );
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Helper function for A2NLSF(..) */
|
||||
/* Polynomial evaluation */
|
||||
SKP_INLINE SKP_int32 SKP_Silk_A2NLSF_eval_poly( /* return the polynomial evaluation, in QPoly */
|
||||
@ -78,10 +78,10 @@ SKP_INLINE SKP_int32 SKP_Silk_A2NLSF_eval_poly( /* return the polynomial eval
|
||||
|
||||
SKP_INLINE void SKP_Silk_A2NLSF_init(
|
||||
const SKP_int32 *a_Q16,
|
||||
SKP_int32 *P,
|
||||
SKP_int32 *Q,
|
||||
SKP_int32 *P,
|
||||
SKP_int32 *Q,
|
||||
const SKP_int dd
|
||||
)
|
||||
)
|
||||
{
|
||||
SKP_int k;
|
||||
|
||||
@ -105,8 +105,8 @@ SKP_INLINE void SKP_Silk_A2NLSF_init(
|
||||
/* z = 1 is always a root in Q, and */
|
||||
/* z = -1 is always a root in P */
|
||||
for( k = dd; k > 0; k-- ) {
|
||||
P[ k - 1 ] -= P[ k ];
|
||||
Q[ k - 1 ] += Q[ k ];
|
||||
P[ k - 1 ] -= P[ k ];
|
||||
Q[ k - 1 ] += Q[ k ];
|
||||
}
|
||||
|
||||
/* Transform polynomials from cos(n*f) to cos(f)^n */
|
||||
@ -141,7 +141,7 @@ void SKP_Silk_A2NLSF(
|
||||
|
||||
/* Find roots, alternating between P and Q */
|
||||
p = P; /* Pointer to polynomial */
|
||||
|
||||
|
||||
xlo = SKP_Silk_LSFCosTab_FIX_Q12[ 0 ]; // Q12
|
||||
ylo = SKP_Silk_A2NLSF_eval_poly( p, xlo, dd );
|
||||
|
||||
@ -160,13 +160,13 @@ void SKP_Silk_A2NLSF(
|
||||
/* Evaluate polynomial */
|
||||
#if OVERSAMPLE_COSINE_TABLE
|
||||
xhi = SKP_Silk_LSFCosTab_FIX_Q12[ k >> 1 ] +
|
||||
( ( SKP_Silk_LSFCosTab_FIX_Q12[ ( k + 1 ) >> 1 ] -
|
||||
( ( SKP_Silk_LSFCosTab_FIX_Q12[ ( k + 1 ) >> 1 ] -
|
||||
SKP_Silk_LSFCosTab_FIX_Q12[ k >> 1 ] ) >> 1 ); /* Q12 */
|
||||
#else
|
||||
xhi = SKP_Silk_LSFCosTab_FIX_Q12[ k ]; /* Q12 */
|
||||
#endif
|
||||
yhi = SKP_Silk_A2NLSF_eval_poly( p, xhi, dd );
|
||||
|
||||
|
||||
/* Detect zero crossing */
|
||||
if( ( ylo <= 0 && yhi >= 0 ) || ( ylo >= 0 && yhi <= 0 ) ) {
|
||||
/* Binary division */
|
||||
@ -196,7 +196,7 @@ void SKP_Silk_A2NLSF(
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Interpolate */
|
||||
if( SKP_abs( ylo ) < 65536 ) {
|
||||
/* Avoid dividing by zero */
|
||||
@ -210,9 +210,9 @@ void SKP_Silk_A2NLSF(
|
||||
ffrac += SKP_DIV32( ylo, SKP_RSHIFT( ylo - yhi, 8 - BIN_DIV_STEPS_A2NLSF_FIX ) );
|
||||
}
|
||||
#if OVERSAMPLE_COSINE_TABLE
|
||||
NLSF[ root_ix ] = (SKP_int)SKP_min_32( SKP_LSHIFT( (SKP_int32)k, 7 ) + ffrac, SKP_int16_MAX );
|
||||
NLSF[ root_ix ] = (SKP_int)SKP_min_32( SKP_LSHIFT( (SKP_int32)k, 7 ) + ffrac, SKP_int16_MAX );
|
||||
#else
|
||||
NLSF[ root_ix ] = (SKP_int)SKP_min_32( SKP_LSHIFT( (SKP_int32)k, 8 ) + ffrac, SKP_int16_MAX );
|
||||
NLSF[ root_ix ] = (SKP_int)SKP_min_32( SKP_LSHIFT( (SKP_int32)k, 8 ) + ffrac, SKP_int16_MAX );
|
||||
#endif
|
||||
|
||||
SKP_assert( NLSF[ root_ix ] >= 0 );
|
||||
@ -225,11 +225,11 @@ void SKP_Silk_A2NLSF(
|
||||
}
|
||||
/* Alternate pointer to polynomial */
|
||||
p = PQ[ root_ix & 1 ];
|
||||
|
||||
|
||||
/* Evaluate polynomial */
|
||||
#if OVERSAMPLE_COSINE_TABLE
|
||||
xlo = SKP_Silk_LSFCosTab_FIX_Q12[ ( k - 1 ) >> 1 ] +
|
||||
( ( SKP_Silk_LSFCosTab_FIX_Q12[ k >> 1 ] -
|
||||
( ( SKP_Silk_LSFCosTab_FIX_Q12[ k >> 1 ] -
|
||||
SKP_Silk_LSFCosTab_FIX_Q12[ ( k - 1 ) >> 1 ] ) >> 1 ); // Q12
|
||||
#else
|
||||
xlo = SKP_Silk_LSFCosTab_FIX_Q12[ k - 1 ]; // Q12
|
||||
@ -240,7 +240,7 @@ void SKP_Silk_A2NLSF(
|
||||
k++;
|
||||
xlo = xhi;
|
||||
ylo = yhi;
|
||||
|
||||
|
||||
#if OVERSAMPLE_COSINE_TABLE
|
||||
if( k > 2 * LSF_COS_TAB_SZ_FIX ) {
|
||||
#else
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -122,20 +122,20 @@ void SKP_Silk_CNG(
|
||||
if( psDec->lossCnt ) {//|| psDec->vadFlag == NO_VOICE_ACTIVITY ) {
|
||||
|
||||
/* Generate CNG excitation */
|
||||
SKP_Silk_CNG_exc( 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 */
|
||||
SKP_Silk_NLSF2A_stable( LPC_buf, psCNG->CNG_smth_NLSF_Q15, psDec->LPC_order );
|
||||
|
||||
Gain_Q26 = ( SKP_int32 )1 << 26; /* 1.0 */
|
||||
|
||||
|
||||
/* Generate CNG signal, by synthesis filtering */
|
||||
if( psDec->LPC_order == 16 ) {
|
||||
SKP_Silk_LPC_synthesis_order16( CNG_sig, LPC_buf,
|
||||
SKP_Silk_LPC_synthesis_order16( CNG_sig, LPC_buf,
|
||||
Gain_Q26, psCNG->CNG_synth_state, CNG_sig, length );
|
||||
} else {
|
||||
SKP_Silk_LPC_synthesis_filter( CNG_sig, LPC_buf,
|
||||
SKP_Silk_LPC_synthesis_filter( CNG_sig, LPC_buf,
|
||||
Gain_Q26, psCNG->CNG_synth_state, CNG_sig, length, psDec->LPC_order );
|
||||
}
|
||||
/* Mix with signal */
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -56,7 +56,7 @@ void SKP_Silk_HP_variable_cutoff_FIX(
|
||||
|
||||
/* adjustment based on quality */
|
||||
quality_Q15 = psEncCtrl->input_quality_bands_Q15[ 0 ];
|
||||
pitch_freq_log_Q7 = SKP_SUB32( pitch_freq_log_Q7, SKP_SMULWB( SKP_SMULWB( SKP_LSHIFT( quality_Q15, 2 ), quality_Q15 ),
|
||||
pitch_freq_log_Q7 = SKP_SUB32( pitch_freq_log_Q7, SKP_SMULWB( SKP_SMULWB( SKP_LSHIFT( quality_Q15, 2 ), quality_Q15 ),
|
||||
pitch_freq_log_Q7 - SKP_LOG2_VARIABLE_HP_MIN_FREQ_Q7 ) );
|
||||
pitch_freq_log_Q7 = SKP_ADD32( pitch_freq_log_Q7, SKP_RSHIFT( SKP_FIX_CONST( 0.6, 15 ) - quality_Q15, 9 ) );
|
||||
|
||||
@ -71,18 +71,18 @@ void SKP_Silk_HP_variable_cutoff_FIX(
|
||||
delta_freq_Q7 = SKP_LIMIT_32( delta_freq_Q7, -SKP_FIX_CONST( VARIABLE_HP_MAX_DELTA_FREQ, 7 ), SKP_FIX_CONST( VARIABLE_HP_MAX_DELTA_FREQ, 7 ) );
|
||||
|
||||
/* update smoother */
|
||||
psEnc->variable_HP_smth1_Q15 = SKP_SMLAWB( psEnc->variable_HP_smth1_Q15,
|
||||
psEnc->variable_HP_smth1_Q15 = SKP_SMLAWB( psEnc->variable_HP_smth1_Q15,
|
||||
SKP_MUL( SKP_LSHIFT( psEnc->speech_activity_Q8, 1 ), delta_freq_Q7 ), SKP_FIX_CONST( VARIABLE_HP_SMTH_COEF1, 16 ) );
|
||||
}
|
||||
/* second smoother */
|
||||
psEnc->variable_HP_smth2_Q15 = SKP_SMLAWB( psEnc->variable_HP_smth2_Q15,
|
||||
psEnc->variable_HP_smth2_Q15 = SKP_SMLAWB( psEnc->variable_HP_smth2_Q15,
|
||||
psEnc->variable_HP_smth1_Q15 - psEnc->variable_HP_smth2_Q15, SKP_FIX_CONST( VARIABLE_HP_SMTH_COEF2, 16 ) );
|
||||
|
||||
/* convert from log scale to Hertz */
|
||||
psEncCtrl->pitch_freq_low_Hz = SKP_Silk_log2lin( SKP_RSHIFT( psEnc->variable_HP_smth2_Q15, 8 ) );
|
||||
|
||||
/* limit frequency range */
|
||||
psEncCtrl->pitch_freq_low_Hz = SKP_LIMIT_32( psEncCtrl->pitch_freq_low_Hz,
|
||||
psEncCtrl->pitch_freq_low_Hz = SKP_LIMIT_32( psEncCtrl->pitch_freq_low_Hz,
|
||||
SKP_FIX_CONST( VARIABLE_HP_MIN_FREQ, 0 ), SKP_FIX_CONST( VARIABLE_HP_MAX_FREQ, 0 ) );
|
||||
|
||||
/********************************/
|
||||
@ -105,7 +105,7 @@ void SKP_Silk_HP_variable_cutoff_FIX(
|
||||
B_Q28[ 0 ] = r_Q28;
|
||||
B_Q28[ 1 ] = SKP_LSHIFT( -r_Q28, 1 );
|
||||
B_Q28[ 2 ] = r_Q28;
|
||||
|
||||
|
||||
// -r * ( 2 - Fc * Fc );
|
||||
r_Q22 = SKP_RSHIFT( r_Q28, 6 );
|
||||
A_Q28[ 0 ] = SKP_SMULWW( r_Q22, SKP_SMULWW( Fc_Q19, Fc_Q19 ) - SKP_FIX_CONST( 2.0, 22 ) );
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -108,7 +108,7 @@ SKP_INLINE SKP_int32 SKP_Silk_norm16(SKP_int16 a) {
|
||||
|
||||
/* returns the number of left shifts before overflow for a 32 bit number (ITU definition with norm(0)=0) */
|
||||
SKP_INLINE SKP_int32 SKP_Silk_norm32(SKP_int32 a) {
|
||||
|
||||
|
||||
/* if ((a == 0) || (a == SKP_int32_MIN)) return(0); */
|
||||
if ((a << 1) == 0) return(0);
|
||||
|
||||
|
@ -1,34 +1,34 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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"
|
||||
|
||||
/* Resets LBRR buffer, used if packet size changes */
|
||||
void SKP_Silk_LBRR_reset(
|
||||
void SKP_Silk_LBRR_reset(
|
||||
SKP_Silk_encoder_state *psEncC /* I/O state */
|
||||
)
|
||||
{
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -42,7 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
/* test if LPC coefficients are stable (all poles within unit circle) */
|
||||
static SKP_int LPC_inverse_pred_gain_QA( /* O: Returns 1 if unstable, otherwise 0 */
|
||||
SKP_int32 *invGain_Q30, /* O: Inverse prediction gain, Q30 energy domain */
|
||||
SKP_int32 A_QA[ 2 ][ SKP_Silk_MAX_ORDER_LPC ],
|
||||
SKP_int32 A_QA[ 2 ][ SKP_Silk_MAX_ORDER_LPC ],
|
||||
/* I: Prediction coefficients */
|
||||
const SKP_int order /* I: Prediction order */
|
||||
)
|
||||
@ -62,7 +62,7 @@ static SKP_int LPC_inverse_pred_gain_QA( /* O: Returns 1 if unstable, o
|
||||
|
||||
/* Set RC equal to negated AR coef */
|
||||
rc_Q31 = -SKP_LSHIFT( Anew_QA[ k ], 31 - QA );
|
||||
|
||||
|
||||
/* rc_mult1_Q30 range: [ 1 : 2^30-1 ] */
|
||||
rc_mult1_Q30 = ( SKP_int32_MAX >> 1 ) - SKP_SMMUL( rc_Q31, rc_Q31 );
|
||||
SKP_assert( rc_mult1_Q30 > ( 1 << 15 ) ); /* reduce A_LIMIT if fails */
|
||||
@ -80,7 +80,7 @@ static SKP_int LPC_inverse_pred_gain_QA( /* O: Returns 1 if unstable, o
|
||||
/* Swap pointers */
|
||||
Aold_QA = Anew_QA;
|
||||
Anew_QA = A_QA[ k & 1 ];
|
||||
|
||||
|
||||
/* Update AR coefficient */
|
||||
headrm = SKP_Silk_CLZ32( rc_mult2_Q16 ) - 1;
|
||||
rc_mult2_Q16 = SKP_LSHIFT( rc_mult2_Q16, headrm ); /* Q: 16 + headrm */
|
||||
@ -150,4 +150,3 @@ SKP_int SKP_Silk_LPC_inverse_pred_gain_Q24( /* O: Returns 1 if unstable, oth
|
||||
|
||||
return LPC_inverse_pred_gain_QA( invGain_Q30, Atmp_QA, order );
|
||||
}
|
||||
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -118,5 +118,3 @@ void SKP_Silk_LPC_synthesis_order16(const SKP_int16 *in, /* I: excita
|
||||
S[ 15 ] = SKP_LSHIFT_SAT32( out32_Q10, 4 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,33 +1,33 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
|
||||
Elliptic/Cauer filters designed with 0.1 dB passband ripple,
|
||||
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.
|
||||
|
||||
@ -37,8 +37,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#if SWITCH_TRANSITION_FILTERING
|
||||
|
||||
/* Helper function, that interpolates the filter taps */
|
||||
SKP_INLINE void SKP_Silk_LP_interpolate_filter_taps(
|
||||
SKP_int32 B_Q28[ TRANSITION_NB ],
|
||||
SKP_INLINE void SKP_Silk_LP_interpolate_filter_taps(
|
||||
SKP_int32 B_Q28[ TRANSITION_NB ],
|
||||
SKP_int32 A_Q28[ TRANSITION_NA ],
|
||||
const SKP_int ind,
|
||||
const SKP_int32 fac_Q16
|
||||
@ -68,19 +68,19 @@ SKP_INLINE void SKP_Silk_LP_interpolate_filter_taps(
|
||||
|
||||
/* Piece-wise linear interpolation of B and A */
|
||||
for( nb = 0; nb < TRANSITION_NB; nb++ ) {
|
||||
B_Q28[ nb ] = SKP_RSHIFT(
|
||||
B_Q28[ nb ] = SKP_RSHIFT(
|
||||
SKP_Silk_Transition_LP_B_Q28[ ind ][ nb ] +
|
||||
SKP_Silk_Transition_LP_B_Q28[ ind + 1 ][ nb ],
|
||||
1 );
|
||||
}
|
||||
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 ],
|
||||
A_Q28[ na ] = SKP_RSHIFT(
|
||||
SKP_Silk_Transition_LP_A_Q28[ ind ][ na ] +
|
||||
SKP_Silk_Transition_LP_A_Q28[ ind + 1 ][ na ],
|
||||
1 );
|
||||
}
|
||||
} else { /* ( ( 1 << 16 ) - fac_Q16 ) is in range of a 16-bit int */
|
||||
|
||||
|
||||
SKP_assert( ( ( 1 << 16 ) - fac_Q16 ) == SKP_SAT16( ( ( 1 << 16 ) - fac_Q16) ) );
|
||||
/* Piece-wise linear interpolation of B and A */
|
||||
for( nb = 0; nb < TRANSITION_NB; nb++ ) {
|
||||
@ -123,7 +123,7 @@ void SKP_Silk_LP_variable_cutoff(
|
||||
SKP_int ind = 0;
|
||||
|
||||
SKP_assert( psLP->transition_frame_no >= 0 );
|
||||
SKP_assert( ( ( ( psLP->transition_frame_no <= TRANSITION_FRAMES_DOWN ) && ( psLP->mode == 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 */
|
||||
@ -173,15 +173,15 @@ void SKP_Silk_LP_variable_cutoff(
|
||||
|
||||
/* Increment transition frame number for next frame */
|
||||
psLP->transition_frame_no++;
|
||||
|
||||
|
||||
} else {
|
||||
SKP_assert( psLP->transition_frame_no == TRANSITION_FRAMES_UP );
|
||||
/* End of transition phase */
|
||||
SKP_Silk_LP_interpolate_filter_taps( B_Q28, A_Q28, 0, 0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if( psLP->transition_frame_no > 0 ) {
|
||||
/* ARMA low-pass filtering */
|
||||
SKP_assert( TRANSITION_NB == 3 && TRANSITION_NA == 2 );
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -29,37 +29,37 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
// Q12 values (even)
|
||||
const SKP_int SKP_Silk_LSFCosTab_FIX_Q12[LSF_COS_TAB_SZ_FIX + 1] = {
|
||||
8192, 8190, 8182, 8170,
|
||||
8152, 8130, 8104, 8072,
|
||||
8034, 7994, 7946, 7896,
|
||||
7840, 7778, 7714, 7644,
|
||||
7568, 7490, 7406, 7318,
|
||||
7226, 7128, 7026, 6922,
|
||||
6812, 6698, 6580, 6458,
|
||||
6332, 6204, 6070, 5934,
|
||||
5792, 5648, 5502, 5352,
|
||||
5198, 5040, 4880, 4718,
|
||||
4552, 4382, 4212, 4038,
|
||||
3862, 3684, 3502, 3320,
|
||||
3136, 2948, 2760, 2570,
|
||||
2378, 2186, 1990, 1794,
|
||||
1598, 1400, 1202, 1002,
|
||||
802, 602, 402, 202,
|
||||
0, -202, -402, -602,
|
||||
-802, -1002, -1202, -1400,
|
||||
-1598, -1794, -1990, -2186,
|
||||
-2378, -2570, -2760, -2948,
|
||||
-3136, -3320, -3502, -3684,
|
||||
-3862, -4038, -4212, -4382,
|
||||
-4552, -4718, -4880, -5040,
|
||||
-5198, -5352, -5502, -5648,
|
||||
-5792, -5934, -6070, -6204,
|
||||
-6332, -6458, -6580, -6698,
|
||||
-6812, -6922, -7026, -7128,
|
||||
-7226, -7318, -7406, -7490,
|
||||
-7568, -7644, -7714, -7778,
|
||||
-7840, -7896, -7946, -7994,
|
||||
-8034, -8072, -8104, -8130,
|
||||
-8152, -8170, -8182, -8190,
|
||||
8192, 8190, 8182, 8170,
|
||||
8152, 8130, 8104, 8072,
|
||||
8034, 7994, 7946, 7896,
|
||||
7840, 7778, 7714, 7644,
|
||||
7568, 7490, 7406, 7318,
|
||||
7226, 7128, 7026, 6922,
|
||||
6812, 6698, 6580, 6458,
|
||||
6332, 6204, 6070, 5934,
|
||||
5792, 5648, 5502, 5352,
|
||||
5198, 5040, 4880, 4718,
|
||||
4552, 4382, 4212, 4038,
|
||||
3862, 3684, 3502, 3320,
|
||||
3136, 2948, 2760, 2570,
|
||||
2378, 2186, 1990, 1794,
|
||||
1598, 1400, 1202, 1002,
|
||||
802, 602, 402, 202,
|
||||
0, -202, -402, -602,
|
||||
-802, -1002, -1202, -1400,
|
||||
-1598, -1794, -1990, -2186,
|
||||
-2378, -2570, -2760, -2948,
|
||||
-3136, -3320, -3502, -3684,
|
||||
-3862, -4038, -4212, -4382,
|
||||
-4552, -4718, -4880, -5040,
|
||||
-5198, -5352, -5502, -5648,
|
||||
-5792, -5934, -6070, -6204,
|
||||
-6332, -6458, -6580, -6698,
|
||||
-6812, -6922, -7026, -7128,
|
||||
-7226, -7318, -7406, -7490,
|
||||
-7568, -7644, -7714, -7778,
|
||||
-7840, -7896, -7946, -7994,
|
||||
-8034, -8072, -8104, -8130,
|
||||
-8152, -8170, -8182, -8190,
|
||||
-8192
|
||||
};
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -55,7 +55,7 @@ void SKP_Silk_LTP_analysis_filter_FIX(
|
||||
/* LTP analysis FIR filter */
|
||||
for( i = 0; i < subfr_length + pre_length; i++ ) {
|
||||
LTP_res_ptr[ i ] = x_ptr[ i ];
|
||||
|
||||
|
||||
/* Long-term prediction */
|
||||
LTP_est = SKP_SMULBB( x_lag_ptr[ LTP_ORDER / 2 ], Btmp_Q14[ 0 ] );
|
||||
for( j = 1; j < LTP_ORDER; j++ ) {
|
||||
@ -73,8 +73,7 @@ void SKP_Silk_LTP_analysis_filter_FIX(
|
||||
}
|
||||
|
||||
/* Update pointers */
|
||||
LTP_res_ptr += subfr_length + pre_length;
|
||||
LTP_res_ptr += subfr_length + pre_length;
|
||||
x_ptr += subfr_length;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -30,7 +30,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#define NB_THRESHOLDS 11
|
||||
|
||||
/* Table containing trained thresholds for LTP scaling */
|
||||
static const SKP_int16 LTPScaleThresholds_Q15[ NB_THRESHOLDS ] =
|
||||
static const SKP_int16 LTPScaleThresholds_Q15[ NB_THRESHOLDS ] =
|
||||
{
|
||||
31129, 26214, 16384, 13107, 9830, 6554,
|
||||
4915, 3276, 2621, 2458, 0
|
||||
@ -45,15 +45,15 @@ void SKP_Silk_LTP_scale_ctrl_FIX(
|
||||
SKP_int g_out_Q5, g_limit_Q15, thrld1_Q15, thrld2_Q15;
|
||||
|
||||
/* 1st order high-pass filter */
|
||||
psEnc->HPLTPredCodGain_Q7 = SKP_max_int( psEncCtrl->LTPredCodGain_Q7 - psEnc->prevLTPredCodGain_Q7, 0 )
|
||||
psEnc->HPLTPredCodGain_Q7 = SKP_max_int( psEncCtrl->LTPredCodGain_Q7 - psEnc->prevLTPredCodGain_Q7, 0 )
|
||||
+ SKP_RSHIFT_ROUND( psEnc->HPLTPredCodGain_Q7, 1 );
|
||||
|
||||
|
||||
psEnc->prevLTPredCodGain_Q7 = psEncCtrl->LTPredCodGain_Q7;
|
||||
|
||||
/* combine input and filtered input */
|
||||
g_out_Q5 = SKP_RSHIFT_ROUND( SKP_RSHIFT( psEncCtrl->LTPredCodGain_Q7, 1 ) + SKP_RSHIFT( psEnc->HPLTPredCodGain_Q7, 1 ), 3 );
|
||||
g_limit_Q15 = SKP_Silk_sigm_Q15( g_out_Q5 - ( 3 << 5 ) );
|
||||
|
||||
|
||||
/* Default is minimum scaling */
|
||||
psEncCtrl->sCmn.LTP_scaleIndex = 0;
|
||||
|
||||
@ -62,13 +62,13 @@ void SKP_Silk_LTP_scale_ctrl_FIX(
|
||||
|
||||
/* Only scale if first frame in packet 0% */
|
||||
if( psEnc->sCmn.nFramesInPayloadBuf == 0 ) {
|
||||
|
||||
|
||||
frames_per_packet = SKP_DIV32_16( psEnc->sCmn.PacketSize_ms, FRAME_LENGTH_MS );
|
||||
|
||||
round_loss += frames_per_packet - 1;
|
||||
thrld1_Q15 = LTPScaleThresholds_Q15[ SKP_min_int( round_loss, NB_THRESHOLDS - 1 ) ];
|
||||
thrld2_Q15 = LTPScaleThresholds_Q15[ SKP_min_int( round_loss + 1, NB_THRESHOLDS - 1 ) ];
|
||||
|
||||
|
||||
if( g_limit_Q15 > thrld1_Q15 ) {
|
||||
/* Maximum scaling */
|
||||
psEncCtrl->sCmn.LTP_scaleIndex = 2;
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -52,7 +52,7 @@ void SKP_Silk_MA_Prediction(
|
||||
in16 = in[ k ];
|
||||
out32 = SKP_LSHIFT( in16, 12 ) - S[ 0 ];
|
||||
out32 = SKP_RSHIFT_ROUND( out32, 12 );
|
||||
|
||||
|
||||
for( d = 0; d < order - 1; d++ ) {
|
||||
S[ d ] = SKP_SMLABB_ovflw( S[ d + 1 ], in16, B[ d ] );
|
||||
}
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -70,7 +70,7 @@ void SKP_Silk_NLSF2A(
|
||||
SKP_int32 f_frac;
|
||||
SKP_int32 cos_val, delta;
|
||||
SKP_int32 a_int32[SKP_Silk_MAX_ORDER_LPC];
|
||||
SKP_int32 maxabs, absval, idx=0, sc_Q16;
|
||||
SKP_int32 maxabs, absval, idx=0, sc_Q16;
|
||||
|
||||
SKP_assert(LSF_COS_TAB_SZ_FIX == 128);
|
||||
|
||||
@ -80,10 +80,10 @@ void SKP_Silk_NLSF2A(
|
||||
SKP_assert(NLSF[k] <= 32767 );
|
||||
|
||||
/* f_int on a scale 0-127 (rounded down) */
|
||||
f_int = SKP_RSHIFT( NLSF[k], 15 - 7 );
|
||||
|
||||
f_int = SKP_RSHIFT( NLSF[k], 15 - 7 );
|
||||
|
||||
/* f_frac, range: 0..255 */
|
||||
f_frac = NLSF[k] - SKP_LSHIFT( f_int, 15 - 7 );
|
||||
f_frac = NLSF[k] - SKP_LSHIFT( f_int, 15 - 7 );
|
||||
|
||||
SKP_assert(f_int >= 0);
|
||||
SKP_assert(f_int < LSF_COS_TAB_SZ_FIX );
|
||||
@ -95,7 +95,7 @@ void SKP_Silk_NLSF2A(
|
||||
/* Linear interpolation */
|
||||
cos_LSF_Q20[k] = SKP_LSHIFT( cos_val, 8 ) + SKP_MUL( delta, f_frac ); /* Q20 */
|
||||
}
|
||||
|
||||
|
||||
dd = SKP_RSHIFT( d, 1 );
|
||||
|
||||
/* generate even and odd polynomials using convolution */
|
||||
@ -122,25 +122,25 @@ void SKP_Silk_NLSF2A(
|
||||
if( absval > maxabs ) {
|
||||
maxabs = absval;
|
||||
idx = k;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( maxabs > SKP_int16_MAX ) {
|
||||
|
||||
if( maxabs > SKP_int16_MAX ) {
|
||||
/* Reduce magnitude of prediction coefficients */
|
||||
maxabs = SKP_min( maxabs, 98369 ); // ( SKP_int32_MAX / ( 65470 >> 2 ) ) + SKP_int16_MAX = 98369
|
||||
sc_Q16 = 65470 - SKP_DIV32( SKP_MUL( 65470 >> 2, maxabs - SKP_int16_MAX ),
|
||||
maxabs = SKP_min( maxabs, 98369 ); // ( SKP_int32_MAX / ( 65470 >> 2 ) ) + SKP_int16_MAX = 98369
|
||||
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_int32, d, sc_Q16 );
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Reached the last iteration */
|
||||
if( i == 10 ) {
|
||||
SKP_assert(0);
|
||||
for( k = 0; k < d; k++ ) {
|
||||
a_int32[k] = SKP_SAT16( a_int32[k] );
|
||||
a_int32[k] = SKP_SAT16( a_int32[k] );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -29,7 +29,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
/* Convert NLSF parameters to stable AR prediction filter coefficients */
|
||||
void SKP_Silk_NLSF2A_stable(
|
||||
SKP_int16 pAR_Q12[ MAX_LPC_ORDER ], /* O Stabilized AR coefs [LPC_order] */
|
||||
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 */
|
||||
)
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -33,7 +33,7 @@ void SKP_Silk_NLSF_MSVQ_decode(
|
||||
const SKP_Silk_NLSF_CB_struct *psNLSF_CB, /* I Pointer to NLSF codebook struct */
|
||||
const SKP_int *NLSFIndices, /* I Pointer to NLSF indices [nStages x 1] */
|
||||
const SKP_int LPC_order /* I LPC order used */
|
||||
)
|
||||
)
|
||||
{
|
||||
const SKP_int16 *pCB_element;
|
||||
SKP_int s;
|
||||
@ -49,7 +49,7 @@ void SKP_Silk_NLSF_MSVQ_decode(
|
||||
for( i = 0; i < LPC_order; i++ ) {
|
||||
pNLSF_Q15[ i ] = ( SKP_int )pCB_element[ i ];
|
||||
}
|
||||
|
||||
|
||||
for( s = 1; s < psNLSF_CB->nStages; s++ ) {
|
||||
/* Check that each index is within valid range */
|
||||
SKP_assert( 0 <= NLSFIndices[ s ] && NLSFIndices[ s ] < psNLSF_CB->CBStages[ s ].nVectors );
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -89,7 +89,7 @@ void SKP_Silk_NLSF_MSVQ_encode_FIX(
|
||||
|
||||
/* Clear accumulated rates */
|
||||
SKP_memset( pRate_Q5, 0, NLSF_MSVQ_Survivors * sizeof( SKP_int32 ) );
|
||||
|
||||
|
||||
/* Copy NLSFs into residual signal vector */
|
||||
for( i = 0; i < LPC_order; i++ ) {
|
||||
pRes_Q15[ i ] = pNLSF_Q15[ i ];
|
||||
@ -119,30 +119,30 @@ void SKP_Silk_NLSF_MSVQ_encode_FIX(
|
||||
#endif
|
||||
|
||||
/* Nearest neighbor clustering for multiple input data vectors */
|
||||
SKP_Silk_NLSF_VQ_rate_distortion_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 */
|
||||
SKP_Silk_insertion_sort_increasing( pRateDist_Q18, pTempIndices,
|
||||
SKP_Silk_insertion_sort_increasing( pRateDist_Q18, pTempIndices,
|
||||
prev_survivors * pCurrentCBStage->nVectors, cur_survivors );
|
||||
|
||||
/* Discard survivors with rate-distortion values too far above the best one */
|
||||
if( pRateDist_Q18[ 0 ] < SKP_int32_MAX / MAX_NLSF_MSVQ_SURVIVORS ) {
|
||||
rateDistThreshold_Q18 = SKP_SMLAWB( pRateDist_Q18[ 0 ],
|
||||
rateDistThreshold_Q18 = SKP_SMLAWB( pRateDist_Q18[ 0 ],
|
||||
SKP_MUL( NLSF_MSVQ_Survivors, pRateDist_Q18[ 0 ] ), SKP_FIX_CONST( NLSF_MSVQ_SURV_MAX_REL_RD, 16 ) );
|
||||
while( pRateDist_Q18[ cur_survivors - 1 ] > rateDistThreshold_Q18 && cur_survivors > min_survivors ) {
|
||||
cur_survivors--;
|
||||
}
|
||||
}
|
||||
/* Update accumulated codebook contributions for the 'cur_survivors' best codebook indices */
|
||||
for( k = 0; k < cur_survivors; k++ ) {
|
||||
for( k = 0; k < cur_survivors; k++ ) {
|
||||
if( s > 0 ) {
|
||||
/* Find the indices of the input and the codebook vector */
|
||||
if( pCurrentCBStage->nVectors == 8 ) {
|
||||
input_index = SKP_RSHIFT( pTempIndices[ k ], 3 );
|
||||
cb_index = pTempIndices[ k ] & 7;
|
||||
} else {
|
||||
input_index = SKP_DIV32_16( pTempIndices[ k ], pCurrentCBStage->nVectors );
|
||||
input_index = SKP_DIV32_16( pTempIndices[ k ], pCurrentCBStage->nVectors );
|
||||
cb_index = pTempIndices[ k ] - SKP_SMULBB( input_index, pCurrentCBStage->nVectors );
|
||||
}
|
||||
} else {
|
||||
@ -194,14 +194,14 @@ void SKP_Silk_NLSF_MSVQ_encode_FIX(
|
||||
/* NLSF fluctuation reduction */
|
||||
/******************************/
|
||||
if( deactivate_fluc_red != 1 ) {
|
||||
|
||||
|
||||
/* Search among all survivors, now taking also weighted fluctuation errors into account */
|
||||
bestRateDist_Q20 = SKP_int32_MAX;
|
||||
for( s = 0; s < cur_survivors; s++ ) {
|
||||
/* Decode survivor to compare with previous quantized NLSF vector */
|
||||
SKP_Silk_NLSF_MSVQ_decode( pNLSF_Q15, psNLSF_CB, &pPath_new[ SKP_SMULBB( s, psNLSF_CB->nStages ) ], LPC_order );
|
||||
|
||||
/* Compare decoded NLSF vector with the previously quantized vector */
|
||||
/* Compare decoded NLSF vector with the previously quantized vector */
|
||||
wsse_Q20 = 0;
|
||||
for( i = 0; i < LPC_order; i += 2 ) {
|
||||
/* Compute weighted squared quantization error for index i */
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -43,7 +43,7 @@ void SKP_Silk_NLSF_VQ_rate_distortion_FIX(
|
||||
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,
|
||||
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 */
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -77,5 +77,3 @@ void SKP_Silk_NLSF_VQ_sum_error_FIX(
|
||||
in_Q15 += LPC_order;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,33 +1,33 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
||||
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
***********************************************************************/
|
||||
|
||||
#include "SKP_Silk_SigProc_FIX.h"
|
||||
|
||||
/*
|
||||
/*
|
||||
R. Laroia, N. Phamdo and N. Farvardin, "Robust and Efficient Quantization of Speech LSP
|
||||
Parameters Using Structured Vector Quantization", Proc. IEEE Int. Conf. Acoust., Speech,
|
||||
Signal Processing, pp. 641-644, 1991.
|
||||
@ -39,17 +39,17 @@ Signal Processing, pp. 641-644, 1991.
|
||||
/* Laroia low complexity NLSF weights */
|
||||
void SKP_Silk_NLSF_VQ_weights_laroia(
|
||||
SKP_int *pNLSFW_Q6, /* O: Pointer to input vector weights [D x 1] */
|
||||
const SKP_int *pNLSF_Q15, /* I: Pointer to input vector [D x 1] */
|
||||
const SKP_int *pNLSF_Q15, /* I: Pointer to input vector [D x 1] */
|
||||
const SKP_int D /* I: Input vector dimension (even) */
|
||||
)
|
||||
{
|
||||
SKP_int k;
|
||||
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 );
|
||||
|
||||
|
||||
/* First value */
|
||||
tmp1_int = SKP_max_int( pNLSF_Q15[ 0 ], MIN_NDELTA );
|
||||
tmp1_int = SKP_DIV32_16( 1 << ( 15 + Q_OUT ), tmp1_int );
|
||||
@ -57,7 +57,7 @@ void SKP_Silk_NLSF_VQ_weights_laroia(
|
||||
tmp2_int = SKP_DIV32_16( 1 << ( 15 + Q_OUT ), tmp2_int );
|
||||
pNLSFW_Q6[ 0 ] = (SKP_int)SKP_min_int( tmp1_int + tmp2_int, SKP_int16_MAX );
|
||||
SKP_assert( pNLSFW_Q6[ 0 ] > 0 );
|
||||
|
||||
|
||||
/* Main loop */
|
||||
for( k = 1; k < D - 1; k += 2 ) {
|
||||
tmp1_int = SKP_max_int( pNLSF_Q15[ k + 1 ] - pNLSF_Q15[ k ], MIN_NDELTA );
|
||||
@ -70,7 +70,7 @@ void SKP_Silk_NLSF_VQ_weights_laroia(
|
||||
pNLSFW_Q6[ k + 1 ] = (SKP_int)SKP_min_int( tmp1_int + tmp2_int, SKP_int16_MAX );
|
||||
SKP_assert( pNLSFW_Q6[ k + 1 ] > 0 );
|
||||
}
|
||||
|
||||
|
||||
/* Last value */
|
||||
tmp1_int = SKP_max_int( ( 1 << 15 ) - pNLSF_Q15[ D - 1 ], MIN_NDELTA );
|
||||
tmp1_int = SKP_DIV32_16( 1 << ( 15 + Q_OUT ), tmp1_int );
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -85,13 +85,13 @@ void SKP_Silk_NLSF_stabilize(
|
||||
if( I == 0 ) {
|
||||
/* Move away from lower limit */
|
||||
NLSF_Q15[0] = NDeltaMin_Q15[0];
|
||||
|
||||
|
||||
} else if( I == L) {
|
||||
/* Move away from higher limit */
|
||||
NLSF_Q15[L-1] = (1<<15) - NDeltaMin_Q15[L];
|
||||
|
||||
|
||||
} else {
|
||||
/* Find the lower extreme for the location of the current center frequency */
|
||||
/* Find the lower extreme for the location of the current center frequency */
|
||||
min_center_Q15 = 0;
|
||||
for( k = 0; k < I; k++ ) {
|
||||
min_center_Q15 += NDeltaMin_Q15[k];
|
||||
@ -120,10 +120,10 @@ void SKP_Silk_NLSF_stabilize(
|
||||
/* Best case: O(n) for an already sorted array */
|
||||
/* 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] );
|
||||
|
||||
|
||||
/* Keep delta_min distance between the NLSFs */
|
||||
for( i = 1; i < L; i++ )
|
||||
NLSF_Q15[i] = SKP_max_int( NLSF_Q15[i], NLSF_Q15[i-1] + NDeltaMin_Q15[i] );
|
||||
@ -132,8 +132,7 @@ void SKP_Silk_NLSF_stabilize(
|
||||
NLSF_Q15[L-1] = SKP_min_int( NLSF_Q15[L-1], (1<<15) - NDeltaMin_Q15[L] );
|
||||
|
||||
/* Keep NDeltaMin distance between the NLSFs */
|
||||
for( i = L-2; i >= 0; i-- )
|
||||
for( i = L-2; i >= 0; i-- )
|
||||
NLSF_Q15[i] = SKP_min_int( NLSF_Q15[i], NLSF_Q15[i+1] - NDeltaMin_Q15[i+1] );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -134,19 +134,19 @@ void SKP_Silk_NSQ(
|
||||
SKP_assert( start_idx <= psEncC->frame_length - psEncC->predictLPCOrder );
|
||||
|
||||
SKP_memset( FiltState, 0, psEncC->predictLPCOrder * sizeof( SKP_int32 ) );
|
||||
SKP_Silk_MA_Prediction( &NSQ->xq[ start_idx + k * ( psEncC->frame_length >> 2 ) ],
|
||||
SKP_Silk_MA_Prediction( &NSQ->xq[ start_idx + k * ( psEncC->frame_length >> 2 ) ],
|
||||
A_Q12, FiltState, sLTP + start_idx, psEncC->frame_length - start_idx, psEncC->predictLPCOrder );
|
||||
|
||||
NSQ->rewhite_flag = 1;
|
||||
NSQ->sLTP_buf_idx = psEncC->frame_length;
|
||||
}
|
||||
}
|
||||
|
||||
SKP_Silk_nsq_scale_states( NSQ, x, x_sc_Q10, psEncC->subfr_length, sLTP,
|
||||
|
||||
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,
|
||||
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
|
||||
);
|
||||
|
||||
@ -203,7 +203,7 @@ SKP_INLINE void SKP_Silk_noise_shape_quantizer(
|
||||
|
||||
shp_lag_ptr = &NSQ->sLTP_shp_Q10[ NSQ->sLTP_shp_buf_idx - lag + HARM_SHAPE_FIR_TAPS / 2 ];
|
||||
pred_lag_ptr = &sLTP_Q16[ NSQ->sLTP_buf_idx - lag + LTP_ORDER / 2 ];
|
||||
|
||||
|
||||
/* Setup short term AR state */
|
||||
psLPC_Q14 = &NSQ->sLPC_Q14[ NSQ_LPC_BUF_LENGTH - 1 ];
|
||||
|
||||
@ -219,7 +219,7 @@ SKP_INLINE void SKP_Silk_noise_shape_quantizer(
|
||||
|
||||
/* dither = rand_seed < 0 ? 0xFFFFFFFF : 0; */
|
||||
dither = SKP_RSHIFT( NSQ->rand_seed, 31 );
|
||||
|
||||
|
||||
/* Short-term prediction */
|
||||
SKP_assert( ( predictLPCOrder & 1 ) == 0 ); /* check that order is even */
|
||||
/* check that array starts at 4-byte aligned address */
|
||||
@ -272,7 +272,7 @@ SKP_INLINE void SKP_Silk_noise_shape_quantizer(
|
||||
n_AR_Q10 = SKP_RSHIFT( n_AR_Q10, 1 ); /* Q11 -> Q10 */
|
||||
n_AR_Q10 = SKP_SMLAWB( n_AR_Q10, NSQ->sLF_AR_shp_Q12, Tilt_Q14 );
|
||||
|
||||
n_LF_Q10 = SKP_LSHIFT( SKP_SMULWB( NSQ->sLTP_shp_Q10[ NSQ->sLTP_shp_buf_idx - 1 ], LF_shp_Q14 ), 2 );
|
||||
n_LF_Q10 = SKP_LSHIFT( SKP_SMULWB( NSQ->sLTP_shp_Q10[ NSQ->sLTP_shp_buf_idx - 1 ], LF_shp_Q14 ), 2 );
|
||||
n_LF_Q10 = SKP_SMLAWT( n_LF_Q10, NSQ->sLF_AR_shp_Q12, LF_shp_Q14 );
|
||||
|
||||
SKP_assert( lag > 0 || sigtype == SIG_TYPE_UNVOICED );
|
||||
@ -292,9 +292,9 @@ SKP_INLINE void SKP_Silk_noise_shape_quantizer(
|
||||
//r = x[ i ] - LTP_pred - LPC_pred + n_AR + n_Tilt + n_LF + n_LTP;
|
||||
tmp1 = SKP_SUB32( LTP_pred_Q14, n_LTP_Q14 ); /* Add Q14 stuff */
|
||||
tmp1 = SKP_RSHIFT( tmp1, 4 ); /* convert to Q10 */
|
||||
tmp1 = SKP_ADD32( tmp1, LPC_pred_Q10 ); /* add Q10 stuff */
|
||||
tmp1 = SKP_SUB32( tmp1, n_AR_Q10 ); /* subtract Q10 stuff */
|
||||
tmp1 = SKP_SUB32( tmp1, n_LF_Q10 ); /* subtract Q10 stuff */
|
||||
tmp1 = SKP_ADD32( tmp1, LPC_pred_Q10 ); /* add Q10 stuff */
|
||||
tmp1 = SKP_SUB32( tmp1, n_AR_Q10 ); /* subtract Q10 stuff */
|
||||
tmp1 = SKP_SUB32( tmp1, n_LF_Q10 ); /* subtract Q10 stuff */
|
||||
r_Q10 = SKP_SUB32( x_sc_Q10[ i ], tmp1 );
|
||||
|
||||
/* Flip sign depending on dither */
|
||||
@ -328,11 +328,11 @@ SKP_INLINE void SKP_Silk_noise_shape_quantizer(
|
||||
/* Add predictions */
|
||||
LPC_exc_Q10 = SKP_ADD32( exc_Q10, SKP_RSHIFT_ROUND( LTP_pred_Q14, 4 ) );
|
||||
xq_Q10 = SKP_ADD32( LPC_exc_Q10, LPC_pred_Q10 );
|
||||
|
||||
|
||||
/* Scale XQ back to normal level before saving */
|
||||
xq[ i ] = ( SKP_int16 )SKP_SAT16( SKP_RSHIFT_ROUND( SKP_SMULWW( xq_Q10, Gain_Q16 ), 10 ) );
|
||||
|
||||
|
||||
|
||||
|
||||
/* Update states */
|
||||
psLPC_Q14++;
|
||||
*psLPC_Q14 = SKP_LSHIFT( xq_Q10, 4 );
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -216,15 +216,15 @@ void SKP_Silk_NSQ_del_dec(
|
||||
SKP_assert( psDelDec[ i ].RD_Q10 >= 0 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Copy final part of signals from winner state to output and long-term filter states */
|
||||
psDD = &psDelDec[ Winner_ind ];
|
||||
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_int8 )SKP_RSHIFT( psDD->Q_Q10[ last_smple_idx ], 10 );
|
||||
pxq[ i - decisionDelay ] = ( SKP_int16 )SKP_SAT16( SKP_RSHIFT_ROUND(
|
||||
SKP_SMULWW( psDD->Xq_Q10[ last_smple_idx ],
|
||||
pxq[ i - decisionDelay ] = ( SKP_int16 )SKP_SAT16( SKP_RSHIFT_ROUND(
|
||||
SKP_SMULWW( psDD->Xq_Q10[ last_smple_idx ],
|
||||
psDD->Gain_Q16[ last_smple_idx ] ), 10 ) );
|
||||
NSQ->sLTP_shp_Q10[ NSQ->sLTP_shp_buf_idx - decisionDelay + i ] = psDD->Shape_Q10[ last_smple_idx ];
|
||||
}
|
||||
@ -238,7 +238,7 @@ void SKP_Silk_NSQ_del_dec(
|
||||
SKP_assert( start_idx <= psEncC->frame_length - psEncC->predictLPCOrder );
|
||||
|
||||
SKP_memset( FiltState, 0, psEncC->predictLPCOrder * sizeof( SKP_int32 ) );
|
||||
SKP_Silk_MA_Prediction( &NSQ->xq[ start_idx + k * psEncC->subfr_length ],
|
||||
SKP_Silk_MA_Prediction( &NSQ->xq[ start_idx + k * psEncC->subfr_length ],
|
||||
A_Q12, FiltState, sLTP + start_idx, psEncC->frame_length - start_idx, psEncC->predictLPCOrder );
|
||||
|
||||
NSQ->sLTP_buf_idx = psEncC->frame_length;
|
||||
@ -246,15 +246,15 @@ void SKP_Silk_NSQ_del_dec(
|
||||
}
|
||||
}
|
||||
|
||||
SKP_Silk_nsq_del_dec_scale_states( NSQ, psDelDec, x, x_sc_Q10,
|
||||
SKP_Silk_nsq_del_dec_scale_states( NSQ, psDelDec, x, x_sc_Q10,
|
||||
subfr_length, sLTP, sLTP_Q16, k, psEncC->nStatesDelayedDecision, smpl_buf_idx,
|
||||
LTP_scale_Q14, Gains_Q16, psEncCtrlC->pitchL );
|
||||
|
||||
SKP_Silk_noise_shape_quantizer_del_dec( NSQ, psDelDec, 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, subfr++, psEncC->shapingLPCOrder, psEncC->predictLPCOrder,
|
||||
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, subfr++, psEncC->shapingLPCOrder, psEncC->predictLPCOrder,
|
||||
psEncC->warping_Q16, psEncC->nStatesDelayedDecision, &smpl_buf_idx, decisionDelay );
|
||||
|
||||
|
||||
x += psEncC->subfr_length;
|
||||
q += psEncC->subfr_length;
|
||||
pxq += psEncC->subfr_length;
|
||||
@ -269,7 +269,7 @@ void SKP_Silk_NSQ_del_dec(
|
||||
Winner_ind = k;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Copy final part of signals from winner state to output and long-term filter states */
|
||||
psDD = &psDelDec[ Winner_ind ];
|
||||
psEncCtrlC->Seed = psDD->SeedInit;
|
||||
@ -277,7 +277,7 @@ void SKP_Silk_NSQ_del_dec(
|
||||
for( i = 0; i < decisionDelay; i++ ) {
|
||||
last_smple_idx = ( last_smple_idx - 1 ) & DECISION_DELAY_MASK;
|
||||
q[ i - decisionDelay ] = ( SKP_int8 )SKP_RSHIFT( psDD->Q_Q10[ last_smple_idx ], 10 );
|
||||
pxq[ i - decisionDelay ] = ( SKP_int16 )SKP_SAT16( SKP_RSHIFT_ROUND(
|
||||
pxq[ i - decisionDelay ] = ( SKP_int16 )SKP_SAT16( SKP_RSHIFT_ROUND(
|
||||
SKP_SMULWW( psDD->Xq_Q10[ last_smple_idx ], psDD->Gain_Q16[ last_smple_idx ] ), 10 ) );
|
||||
NSQ->sLTP_shp_Q10[ NSQ->sLTP_shp_buf_idx - decisionDelay + i ] = psDD->Shape_Q10[ last_smple_idx ];
|
||||
sLTP_Q16[ NSQ->sLTP_buf_idx - decisionDelay + i ] = psDD->Pred_Q16[ last_smple_idx ];
|
||||
@ -383,7 +383,7 @@ SKP_INLINE void SKP_Silk_noise_shape_quantizer_del_dec(
|
||||
|
||||
/* dither = rand_seed < 0 ? 0xFFFFFFFF : 0; */
|
||||
dither = SKP_RSHIFT( psDD->Seed, 31 );
|
||||
|
||||
|
||||
/* Pointer used in short term prediction and shaping */
|
||||
psLPC_Q14 = &psDD->sLPC_Q14[ NSQ_LPC_BUF_LENGTH - 1 + i ];
|
||||
/* Short-term prediction */
|
||||
@ -430,18 +430,18 @@ SKP_INLINE void SKP_Silk_noise_shape_quantizer_del_dec(
|
||||
n_AR_Q10 = SKP_RSHIFT( n_AR_Q10, 1 ); /* Q11 -> Q10 */
|
||||
n_AR_Q10 = SKP_SMLAWB( n_AR_Q10, psDD->LF_AR_Q12, Tilt_Q14 );
|
||||
|
||||
n_LF_Q10 = SKP_LSHIFT( SKP_SMULWB( psDD->Shape_Q10[ *smpl_buf_idx ], LF_shp_Q14 ), 2 );
|
||||
n_LF_Q10 = SKP_SMLAWT( n_LF_Q10, psDD->LF_AR_Q12, LF_shp_Q14 );
|
||||
n_LF_Q10 = SKP_LSHIFT( SKP_SMULWB( psDD->Shape_Q10[ *smpl_buf_idx ], LF_shp_Q14 ), 2 );
|
||||
n_LF_Q10 = SKP_SMLAWT( n_LF_Q10, psDD->LF_AR_Q12, LF_shp_Q14 );
|
||||
|
||||
/* Input minus prediction plus noise feedback */
|
||||
/* r = x[ i ] - LTP_pred - LPC_pred + n_AR + n_Tilt + n_LF + n_LTP */
|
||||
tmp1 = SKP_SUB32( LTP_pred_Q14, n_LTP_Q14 ); /* Add Q14 stuff */
|
||||
tmp1 = SKP_RSHIFT( tmp1, 4 ); /* convert to Q10 */
|
||||
tmp1 = SKP_ADD32( tmp1, LPC_pred_Q10 ); /* add Q10 stuff */
|
||||
tmp1 = SKP_SUB32( tmp1, n_AR_Q10 ); /* subtract Q10 stuff */
|
||||
tmp1 = SKP_SUB32( tmp1, n_LF_Q10 ); /* subtract Q10 stuff */
|
||||
tmp1 = SKP_ADD32( tmp1, LPC_pred_Q10 ); /* add Q10 stuff */
|
||||
tmp1 = SKP_SUB32( tmp1, n_AR_Q10 ); /* subtract Q10 stuff */
|
||||
tmp1 = SKP_SUB32( tmp1, n_LF_Q10 ); /* subtract Q10 stuff */
|
||||
r_Q10 = SKP_SUB32( x_Q10[ i ], tmp1 ); /* residual error Q10 */
|
||||
|
||||
|
||||
/* Flip sign depending on dither */
|
||||
r_Q10 = ( r_Q10 ^ dither ) - dither;
|
||||
r_Q10 = SKP_SUB32( r_Q10, offset_Q10 );
|
||||
@ -472,7 +472,7 @@ SKP_INLINE void SKP_Silk_noise_shape_quantizer_del_dec(
|
||||
}
|
||||
|
||||
if( rd1_Q10 < rd2_Q10 ) {
|
||||
psSS[ 0 ].RD_Q10 = SKP_ADD32( psDD->RD_Q10, rd1_Q10 );
|
||||
psSS[ 0 ].RD_Q10 = SKP_ADD32( psDD->RD_Q10, rd1_Q10 );
|
||||
psSS[ 1 ].RD_Q10 = SKP_ADD32( psDD->RD_Q10, rd2_Q10 );
|
||||
psSS[ 0 ].Q_Q10 = q1_Q10;
|
||||
psSS[ 1 ].Q_Q10 = q2_Q10;
|
||||
@ -561,7 +561,7 @@ SKP_INLINE void SKP_Silk_noise_shape_quantizer_del_dec(
|
||||
|
||||
/* Replace a state if best from second set outperforms worst in first set */
|
||||
if( RDmin_Q10 < RDmax_Q10 ) {
|
||||
SKP_Silk_copy_del_dec_state( &psDelDec[ RDmax_ind ], &psDelDec[ RDmin_ind ], i );
|
||||
SKP_Silk_copy_del_dec_state( &psDelDec[ RDmax_ind ], &psDelDec[ RDmin_ind ], i );
|
||||
SKP_memcpy( &psSampleState[ RDmax_ind ][ 0 ], &psSampleState[ RDmin_ind ][ 1 ], sizeof( NSQ_sample_struct ) );
|
||||
}
|
||||
|
||||
@ -569,7 +569,7 @@ SKP_INLINE void SKP_Silk_noise_shape_quantizer_del_dec(
|
||||
psDD = &psDelDec[ Winner_ind ];
|
||||
if( subfr > 0 || i >= decisionDelay ) {
|
||||
q[ i - decisionDelay ] = ( SKP_int8 )SKP_RSHIFT( psDD->Q_Q10[ last_smple_idx ], 10 );
|
||||
xq[ i - decisionDelay ] = ( SKP_int16 )SKP_SAT16( SKP_RSHIFT_ROUND(
|
||||
xq[ i - decisionDelay ] = ( SKP_int16 )SKP_SAT16( SKP_RSHIFT_ROUND(
|
||||
SKP_SMULWW( psDD->Xq_Q10[ last_smple_idx ], psDD->Gain_Q16[ last_smple_idx ] ), 10 ) );
|
||||
NSQ->sLTP_shp_Q10[ NSQ->sLTP_shp_buf_idx - decisionDelay ] = psDD->Shape_Q10[ last_smple_idx ];
|
||||
sLTP_Q16[ NSQ->sLTP_buf_idx - decisionDelay ] = psDD->Pred_Q16[ last_smple_idx ];
|
||||
@ -655,10 +655,10 @@ SKP_INLINE void SKP_Silk_nsq_del_dec_scale_states(
|
||||
|
||||
for( k = 0; k < nStatesDelayedDecision; k++ ) {
|
||||
psDD = &psDelDec[ k ];
|
||||
|
||||
|
||||
/* Scale scalar states */
|
||||
psDD->LF_AR_Q12 = SKP_SMULWW( gain_adj_Q16, psDD->LF_AR_Q12 );
|
||||
|
||||
|
||||
/* Scale short-term prediction and shaping states */
|
||||
for( i = 0; i < NSQ_LPC_BUF_LENGTH; i++ ) {
|
||||
psDD->sLPC_Q14[ i ] = SKP_SMULWW( gain_adj_Q16, psDD->sLPC_Q14[ i ] );
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -175,15 +175,15 @@ void SKP_Silk_PLC_conceal(
|
||||
exc_buf_ptr = exc_buf;
|
||||
for( k = ( NB_SUBFR >> 1 ); k < NB_SUBFR; k++ ) {
|
||||
for( i = 0; i < psDec->subfr_length; i++ ) {
|
||||
exc_buf_ptr[ i ] = ( SKP_int16 )SKP_RSHIFT(
|
||||
exc_buf_ptr[ i ] = ( SKP_int16 )SKP_RSHIFT(
|
||||
SKP_SMULWW( psDec->exc_Q10[ i + k * psDec->subfr_length ], psPLC->prevGain_Q16[ k ] ), 10 );
|
||||
}
|
||||
exc_buf_ptr += psDec->subfr_length;
|
||||
}
|
||||
/* Find the subframe with lowest energy of the last two and use that as random noise generator */
|
||||
/* Find the subframe with lowest energy of the last two and use that as random noise generator */
|
||||
SKP_Silk_sum_sqr_shift( &energy1, &shift1, exc_buf, psDec->subfr_length );
|
||||
SKP_Silk_sum_sqr_shift( &energy2, &shift2, &exc_buf[ psDec->subfr_length ], psDec->subfr_length );
|
||||
|
||||
|
||||
if( SKP_RSHIFT( energy1, shift2 ) < SKP_RSHIFT( energy2, shift1 ) ) {
|
||||
/* First sub-frame has lowest energy */
|
||||
rand_ptr = &psDec->exc_Q10[ SKP_max_int( 0, 3 * psDec->subfr_length - RAND_BUF_SIZE ) ];
|
||||
@ -192,7 +192,7 @@ void SKP_Silk_PLC_conceal(
|
||||
rand_ptr = &psDec->exc_Q10[ SKP_max_int( 0, psDec->frame_length - RAND_BUF_SIZE ) ];
|
||||
}
|
||||
|
||||
/* Setup Gain to random noise component */
|
||||
/* Setup Gain to random noise component */
|
||||
B_Q14 = psPLC->LTPCoef_Q14;
|
||||
rand_scale_Q14 = psPLC->randScale_Q14;
|
||||
|
||||
@ -207,7 +207,7 @@ void SKP_Silk_PLC_conceal(
|
||||
/* First Lost frame */
|
||||
if( psDec->lossCnt == 0 ) {
|
||||
rand_scale_Q14 = (1 << 14 );
|
||||
|
||||
|
||||
/* Reduce random noise Gain for voiced frames */
|
||||
if( psDec->prev_sigtype == SIG_TYPE_VOICED ) {
|
||||
for( i = 0; i < LTP_ORDER; i++ ) {
|
||||
@ -220,13 +220,13 @@ void SKP_Silk_PLC_conceal(
|
||||
/* Reduce random noise for unvoiced frames with high LPC gain */
|
||||
if( psDec->prev_sigtype == SIG_TYPE_UNVOICED ) {
|
||||
SKP_int32 invGain_Q30, down_scale_Q30;
|
||||
|
||||
|
||||
SKP_Silk_LPC_inverse_pred_gain( &invGain_Q30, psPLC->prevLPC_Q12, psDec->LPC_order );
|
||||
|
||||
|
||||
down_scale_Q30 = SKP_min_32( SKP_RSHIFT( ( 1 << 30 ), LOG2_INV_LPC_GAIN_HIGH_THRES ), invGain_Q30 );
|
||||
down_scale_Q30 = SKP_max_32( SKP_RSHIFT( ( 1 << 30 ), LOG2_INV_LPC_GAIN_LOW_THRES ), down_scale_Q30 );
|
||||
down_scale_Q30 = SKP_LSHIFT( down_scale_Q30, LOG2_INV_LPC_GAIN_HIGH_THRES );
|
||||
|
||||
|
||||
rand_Gain_Q15 = SKP_RSHIFT( SKP_SMULWB( down_scale_Q30, rand_Gain_Q15 ), 14 );
|
||||
}
|
||||
}
|
||||
@ -253,15 +253,15 @@ void SKP_Silk_PLC_conceal(
|
||||
LTP_pred_Q14 = SKP_SMLAWB( LTP_pred_Q14, pred_lag_ptr[ -3 ], B_Q14[ 3 ] );
|
||||
LTP_pred_Q14 = SKP_SMLAWB( LTP_pred_Q14, pred_lag_ptr[ -4 ], B_Q14[ 4 ] );
|
||||
pred_lag_ptr++;
|
||||
|
||||
|
||||
/* Generate LPC residual */
|
||||
LPC_exc_Q10 = SKP_LSHIFT( SKP_SMULWB( rand_ptr[ idx ], rand_scale_Q14 ), 2 ); /* Random noise part */
|
||||
LPC_exc_Q10 = SKP_ADD32( LPC_exc_Q10, SKP_RSHIFT_ROUND( LTP_pred_Q14, 4 ) ); /* Harmonic part */
|
||||
|
||||
|
||||
/* Update states */
|
||||
psDec->sLTP_Q16[ sLTP_buf_idx ] = SKP_LSHIFT( LPC_exc_Q10, 6 );
|
||||
sLTP_buf_idx++;
|
||||
|
||||
|
||||
/* Save LPC residual */
|
||||
sig_Q10_ptr[ i ] = LPC_exc_Q10;
|
||||
}
|
||||
@ -305,7 +305,7 @@ void SKP_Silk_PLC_conceal(
|
||||
}
|
||||
/* Add prediction to LPC residual */
|
||||
sig_Q10_ptr[ i ] = SKP_ADD32( sig_Q10_ptr[ i ], LPC_pred_Q10 );
|
||||
|
||||
|
||||
/* Update states */
|
||||
psDec->sLPC_Q14[ MAX_LPC_ORDER + i ] = SKP_LSHIFT( sig_Q10_ptr[ i ], 4 );
|
||||
}
|
||||
@ -345,7 +345,7 @@ void SKP_Silk_PLC_glue_frames(
|
||||
if( psDec->lossCnt ) {
|
||||
/* Calculate energy in concealed residual */
|
||||
SKP_Silk_sum_sqr_shift( &psPLC->conc_energy, &psPLC->conc_energy_shift, signal, length );
|
||||
|
||||
|
||||
psPLC->last_frame_lost = 1;
|
||||
} else {
|
||||
if( psDec->sPLC.last_frame_lost ) {
|
||||
@ -368,9 +368,9 @@ void SKP_Silk_PLC_glue_frames(
|
||||
LZ = LZ - 1;
|
||||
psPLC->conc_energy = SKP_LSHIFT( psPLC->conc_energy, LZ );
|
||||
energy = SKP_RSHIFT( energy, SKP_max_32( 24 - LZ, 0 ) );
|
||||
|
||||
|
||||
frac_Q24 = SKP_DIV32( psPLC->conc_energy, SKP_max( energy, 1 ) );
|
||||
|
||||
|
||||
gain_Q12 = SKP_Silk_SQRT_APPROX( frac_Q24 );
|
||||
slope_Q12 = SKP_DIV32_16( ( 1 << 12 ) - gain_Q12, length );
|
||||
|
||||
@ -385,4 +385,3 @@ void SKP_Silk_PLC_glue_frames(
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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,4 +76,3 @@ void SKP_Silk_PLC_glue_frames(
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -49,9 +49,9 @@ extern "C"
|
||||
/********************************************************************/
|
||||
|
||||
/*!
|
||||
* Initialize/reset the resampler state for a given pair of input/output sampling rates
|
||||
* Initialize/reset the resampler state for a given pair of input/output sampling rates
|
||||
*/
|
||||
SKP_int SKP_Silk_resampler_init(
|
||||
SKP_int SKP_Silk_resampler_init(
|
||||
SKP_Silk_resampler_state_struct *S, /* I/O: Resampler state */
|
||||
SKP_int32 Fs_Hz_in, /* I: Input sampling rate (Hz) */
|
||||
SKP_int32 Fs_Hz_out /* I: Output sampling rate (Hz) */
|
||||
@ -59,16 +59,16 @@ SKP_int SKP_Silk_resampler_init(
|
||||
|
||||
|
||||
/*!
|
||||
* Clear the states of all resampling filters, without resetting sampling rate ratio
|
||||
* Clear the states of all resampling filters, without resetting sampling rate ratio
|
||||
*/
|
||||
SKP_int SKP_Silk_resampler_clear(
|
||||
SKP_int SKP_Silk_resampler_clear(
|
||||
SKP_Silk_resampler_state_struct *S /* I/O: Resampler state */
|
||||
);
|
||||
|
||||
/*!
|
||||
* Resampler: convert from one sampling rate to another
|
||||
*/
|
||||
SKP_int SKP_Silk_resampler(
|
||||
SKP_int SKP_Silk_resampler(
|
||||
SKP_Silk_resampler_state_struct *S, /* I/O: Resampler state */
|
||||
SKP_int16 out[], /* O: Output signal */
|
||||
const SKP_int16 in[], /* I: Input signal */
|
||||
@ -76,7 +76,7 @@ SKP_int SKP_Silk_resampler(
|
||||
);
|
||||
|
||||
/*!
|
||||
Upsample 2x, low quality
|
||||
Upsample 2x, low quality
|
||||
*/
|
||||
void SKP_Silk_resampler_up2(
|
||||
SKP_int32 *S, /* I/O: State vector [ 2 ] */
|
||||
@ -86,7 +86,7 @@ void SKP_Silk_resampler_up2(
|
||||
);
|
||||
|
||||
/*!
|
||||
* Downsample 2x, mediocre quality
|
||||
* Downsample 2x, mediocre quality
|
||||
*/
|
||||
void SKP_Silk_resampler_down2(
|
||||
SKP_int32 *S, /* I/O: State vector [ 2 ] */
|
||||
@ -116,9 +116,9 @@ void SKP_Silk_resampler_down3(
|
||||
SKP_int32 inLen /* I: Number of input samples */
|
||||
);
|
||||
|
||||
/*!
|
||||
/*!
|
||||
* second order ARMA filter
|
||||
* can handle (slowly) varying coefficients
|
||||
* can handle (slowly) varying coefficients
|
||||
*/
|
||||
void SKP_Silk_biquad(
|
||||
const SKP_int16 *in, /* I: input signal */
|
||||
@ -129,9 +129,9 @@ void SKP_Silk_biquad(
|
||||
const SKP_int32 len /* I: signal length */
|
||||
);
|
||||
/*!
|
||||
* second order ARMA filter;
|
||||
* second order ARMA filter;
|
||||
* slower than biquad() but uses more precise coefficients
|
||||
* can handle (slowly) varying coefficients
|
||||
* can handle (slowly) varying coefficients
|
||||
*/
|
||||
void SKP_Silk_biquad_alt(
|
||||
const SKP_int16 *in, /* I: input signal */
|
||||
@ -142,7 +142,7 @@ void SKP_Silk_biquad_alt(
|
||||
const SKP_int32 len /* I: signal length (must be even) */
|
||||
);
|
||||
|
||||
/*!
|
||||
/*!
|
||||
* variable order MA filter. Prediction error filter implementation. Coeficients negated and starting with coef to x[n - 1]
|
||||
*/
|
||||
void SKP_Silk_MA_Prediction(
|
||||
@ -189,14 +189,14 @@ void SKP_Silk_LPC_synthesis_filter(
|
||||
);
|
||||
|
||||
/* Chirp (bandwidth expand) LP AR filter */
|
||||
void SKP_Silk_bwexpander(
|
||||
void SKP_Silk_bwexpander(
|
||||
SKP_int16 *ar, /* I/O AR filter to be expanded (without leading 1) */
|
||||
const SKP_int d, /* I Length of ar */
|
||||
SKP_int32 chirp_Q16 /* I Chirp factor (typically in the range 0 to 1) */
|
||||
);
|
||||
|
||||
/* Chirp (bandwidth expand) LP AR filter */
|
||||
void SKP_Silk_bwexpander_32(
|
||||
void SKP_Silk_bwexpander_32(
|
||||
SKP_int32 *ar, /* I/O AR filter to be expanded (without leading 1) */
|
||||
const SKP_int d, /* I Length of ar */
|
||||
SKP_int32 chirp_Q16 /* I Chirp factor in Q16 */
|
||||
@ -238,12 +238,12 @@ SKP_int32 SKP_Silk_lin2log(const SKP_int32 inLin); /* I: input in linear
|
||||
SKP_int SKP_Silk_sigm_Q15(SKP_int in_Q5);
|
||||
|
||||
/* approximation of 2^() (exact inverse of approx log2() above) */
|
||||
/* convert input to a linear scale */
|
||||
SKP_int32 SKP_Silk_log2lin(const SKP_int32 inLog_Q7); /* I: input on log scale */
|
||||
/* convert input to a linear scale */
|
||||
SKP_int32 SKP_Silk_log2lin(const SKP_int32 inLog_Q7); /* I: input on log scale */
|
||||
|
||||
/* Function that returns the maximum absolut value of the input vector */
|
||||
SKP_int16 SKP_Silk_int16_array_maxabs( /* O Maximum absolute value, max: 2^15-1 */
|
||||
const SKP_int16 *vec, /* I Input vector [len] */
|
||||
const SKP_int16 *vec, /* I Input vector [len] */
|
||||
const SKP_int32 len /* I Length of input vector */
|
||||
);
|
||||
|
||||
@ -258,7 +258,7 @@ void SKP_Silk_sum_sqr_shift(
|
||||
|
||||
/* Calculates the reflection coefficients from the correlation sequence */
|
||||
/* Faster than schur64(), but much less accurate. */
|
||||
/* uses SMLAWB(), requiring armv5E and higher. */
|
||||
/* uses SMLAWB(), requiring armv5E and higher. */
|
||||
SKP_int32 SKP_Silk_schur( /* O: Returns residual energy */
|
||||
SKP_int16 *rc_Q15, /* O: reflection coefficients [order] Q15 */
|
||||
const SKP_int32 *c, /* I: correlations [order+1] */
|
||||
@ -302,7 +302,7 @@ void SKP_Silk_apply_sine_window_new(
|
||||
);
|
||||
|
||||
/* Compute autocorrelation */
|
||||
void SKP_Silk_autocorr(
|
||||
void SKP_Silk_autocorr(
|
||||
SKP_int32 *results, /* O Result (length correlationCount) */
|
||||
SKP_int *scale, /* O Scaling of the correlation vector */
|
||||
const SKP_int16 *inputData, /* I Input data to correlate */
|
||||
@ -392,7 +392,7 @@ void SKP_Silk_NLSF_VQ_weights_laroia(
|
||||
);
|
||||
|
||||
/* Compute reflection coefficients from input signal */
|
||||
void SKP_Silk_burg_modified(
|
||||
void SKP_Silk_burg_modified(
|
||||
SKP_int32 *res_nrg, /* O residual energy */
|
||||
SKP_int *res_nrgQ, /* O residual energy Q value */
|
||||
SKP_int32 A_Q16[], /* O prediction coefficients (length order) */
|
||||
@ -404,15 +404,15 @@ void SKP_Silk_burg_modified(
|
||||
);
|
||||
|
||||
/* Copy and multiply a vector by a constant */
|
||||
void SKP_Silk_scale_copy_vector16(
|
||||
SKP_int16 *data_out,
|
||||
const SKP_int16 *data_in,
|
||||
void SKP_Silk_scale_copy_vector16(
|
||||
SKP_int16 *data_out,
|
||||
const SKP_int16 *data_in,
|
||||
SKP_int32 gain_Q16, /* I: gain in Q16 */
|
||||
const SKP_int dataSize /* I: length */
|
||||
);
|
||||
|
||||
/* Some for the LTP related function requires Q26 to work.*/
|
||||
void SKP_Silk_scale_vector32_Q26_lshift_18(
|
||||
void SKP_Silk_scale_vector32_Q26_lshift_18(
|
||||
SKP_int32 *data1, /* I/O: Q0/Q18 */
|
||||
SKP_int32 gain_Q26, /* I: Q26 */
|
||||
SKP_int dataSize /* I: length */
|
||||
@ -425,7 +425,7 @@ void SKP_Silk_scale_vector32_Q26_lshift_18(
|
||||
/* return sum(inVec1[i]*inVec2[i]) */
|
||||
/* inVec1 and inVec2 should be increasing ordered, and starting address should be 4 byte aligned. (a factor of 4)*/
|
||||
SKP_int32 SKP_Silk_inner_prod_aligned(
|
||||
const SKP_int16* const inVec1, /* I input vector 1 */
|
||||
const SKP_int16* const inVec1, /* I input vector 1 */
|
||||
const SKP_int16* const inVec2, /* I input vector 2 */
|
||||
const SKP_int len /* I vector lengths */
|
||||
);
|
||||
@ -507,7 +507,7 @@ SKP_INLINE SKP_int32 SKP_ROR32( SKP_int32 a32, SKP_int rot )
|
||||
|
||||
#define SKP_ADD_SAT16(a, b) (SKP_int16)SKP_SAT16( SKP_ADD32( (SKP_int32)(a), (b) ) )
|
||||
|
||||
/* Add with saturation for positive input values */
|
||||
/* Add with saturation for positive input values */
|
||||
#define SKP_ADD_POS_SAT32(a, b) ((((a)+(b)) & 0x80000000) ? SKP_int32_MAX : ((a)+(b)))
|
||||
|
||||
#define SKP_LSHIFT32(a, shift) ((a)<<(shift)) // shift >= 0, shift < 32
|
||||
@ -541,7 +541,7 @@ SKP_INLINE SKP_int32 SKP_ROR32( SKP_int32 a32, SKP_int rot )
|
||||
/* Number of rightshift required to fit the multiplication */
|
||||
#define SKP_NSHIFT_MUL_32_32(a, b) ( -(31- (32-SKP_Silk_CLZ32(SKP_abs(a)) + (32-SKP_Silk_CLZ32(SKP_abs(b))))) )
|
||||
|
||||
#define SKP_min(a, b) (((a) < (b)) ? (a) : (b))
|
||||
#define SKP_min(a, b) (((a) < (b)) ? (a) : (b))
|
||||
#define SKP_max(a, b) (((a) > (b)) ? (a) : (b))
|
||||
|
||||
/* Macro to convert floating-point constants to fixed-point */
|
||||
@ -592,9 +592,9 @@ SKP_INLINE SKP_int32 SKP_max_32(SKP_int32 a, SKP_int32 b)
|
||||
|
||||
// Add some multiplication functions that can be easily mapped to ARM.
|
||||
|
||||
// SKP_SMMUL: Signed top word multiply.
|
||||
// ARMv6 2 instruction cycles.
|
||||
// ARMv3M+ 3 instruction cycles. use SMULL and ignore LSB registers.(except xM)
|
||||
// SKP_SMMUL: Signed top word multiply.
|
||||
// ARMv6 2 instruction cycles.
|
||||
// ARMv3M+ 3 instruction cycles. use SMULL and ignore LSB registers.(except xM)
|
||||
//#define SKP_SMMUL(a32, b32) (SKP_int32)SKP_RSHIFT(SKP_SMLAL(SKP_SMULWB((a32), (b32)), (a32), SKP_RSHIFT_ROUND((b32), 16)), 16)
|
||||
// the following seems faster on x86
|
||||
#define SKP_SMMUL(a32, b32) (SKP_int32)SKP_RSHIFT64(SKP_SMULL((a32), (b32)), 32)
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -36,8 +36,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
/**********************************/
|
||||
/* Initialization of the Silk VAD */
|
||||
/**********************************/
|
||||
SKP_int SKP_Silk_VAD_Init( /* O Return value, 0 if success */
|
||||
SKP_Silk_VAD_state *psSilk_VAD /* I/O Pointer to Silk VAD state */
|
||||
SKP_int SKP_Silk_VAD_Init( /* O Return value, 0 if success */
|
||||
SKP_Silk_VAD_state *psSilk_VAD /* I/O Pointer to Silk VAD state */
|
||||
)
|
||||
{
|
||||
SKP_int b, ret = 0;
|
||||
@ -103,11 +103,11 @@ SKP_int SKP_Silk_VAD_GetSA_Q8( /* O Retu
|
||||
/* Filter and Decimate */
|
||||
/***********************/
|
||||
/* 0-8 kHz to 0-4 kHz and 4-8 kHz */
|
||||
SKP_Silk_ana_filt_bank_1( pIn, &psSilk_VAD->AnaState[ 0 ], &X[ 0 ][ 0 ], &X[ 3 ][ 0 ], &scratch[ 0 ], framelength );
|
||||
|
||||
SKP_Silk_ana_filt_bank_1( pIn, &psSilk_VAD->AnaState[ 0 ], &X[ 0 ][ 0 ], &X[ 3 ][ 0 ], &scratch[ 0 ], framelength );
|
||||
|
||||
/* 0-4 kHz to 0-2 kHz and 2-4 kHz */
|
||||
SKP_Silk_ana_filt_bank_1( &X[ 0 ][ 0 ], &psSilk_VAD->AnaState1[ 0 ], &X[ 0 ][ 0 ], &X[ 2 ][ 0 ], &scratch[ 0 ], SKP_RSHIFT( framelength, 1 ) );
|
||||
|
||||
|
||||
/* 0-2 kHz to 0-1 kHz and 1-2 kHz */
|
||||
SKP_Silk_ana_filt_bank_1( &X[ 0 ][ 0 ], &psSilk_VAD->AnaState2[ 0 ], &X[ 0 ][ 0 ], &X[ 1 ][ 0 ], &scratch[ 0 ], SKP_RSHIFT( framelength, 2 ) );
|
||||
|
||||
@ -127,7 +127,7 @@ SKP_int SKP_Silk_VAD_GetSA_Q8( /* O Retu
|
||||
/*************************************/
|
||||
/* Calculate the energy in each band */
|
||||
/*************************************/
|
||||
for( b = 0; b < VAD_N_BANDS; b++ ) {
|
||||
for( b = 0; b < VAD_N_BANDS; b++ ) {
|
||||
/* Find the decimated framelength in the non-uniformly divided bands */
|
||||
decimated_framelength = SKP_RSHIFT( framelength, SKP_min_int( VAD_N_BANDS - b, VAD_N_BANDS - 1 ) );
|
||||
|
||||
@ -160,7 +160,7 @@ SKP_int SKP_Silk_VAD_GetSA_Q8( /* O Retu
|
||||
|
||||
dec_subframe_offset += dec_subframe_length;
|
||||
}
|
||||
psSilk_VAD->XnrgSubfr[ b ] = sumSquared;
|
||||
psSilk_VAD->XnrgSubfr[ b ] = sumSquared;
|
||||
}
|
||||
|
||||
/********************/
|
||||
@ -227,11 +227,11 @@ SKP_int SKP_Silk_VAD_GetSA_Q8( /* O Retu
|
||||
|
||||
/* Power scaling */
|
||||
if( speech_nrg <= 0 ) {
|
||||
SA_Q15 = SKP_RSHIFT( SA_Q15, 1 );
|
||||
SA_Q15 = SKP_RSHIFT( SA_Q15, 1 );
|
||||
} else if( speech_nrg < 32768 ) {
|
||||
/* square-root */
|
||||
speech_nrg = SKP_Silk_SQRT_APPROX( SKP_LSHIFT( speech_nrg, 15 ) );
|
||||
SA_Q15 = SKP_SMULWB( 32768 + speech_nrg, SA_Q15 );
|
||||
SA_Q15 = SKP_SMULWB( 32768 + speech_nrg, SA_Q15 );
|
||||
}
|
||||
|
||||
/* Copy the resulting speech activity in Q8 to *pSA_Q8 */
|
||||
@ -244,7 +244,7 @@ SKP_int SKP_Silk_VAD_GetSA_Q8( /* O Retu
|
||||
smooth_coef_Q16 = SKP_SMULWB( VAD_SNR_SMOOTH_COEF_Q18, SKP_SMULWB( SA_Q15, SA_Q15 ) );
|
||||
for( b = 0; b < VAD_N_BANDS; b++ ) {
|
||||
/* compute smoothed energy-to-noise ratio per band */
|
||||
psSilk_VAD->NrgRatioSmth_Q8[ b ] = SKP_SMLAWB( psSilk_VAD->NrgRatioSmth_Q8[ b ],
|
||||
psSilk_VAD->NrgRatioSmth_Q8[ b ] = SKP_SMLAWB( psSilk_VAD->NrgRatioSmth_Q8[ b ],
|
||||
NrgToNoiseRatio_Q8[ b ] - psSilk_VAD->NrgRatioSmth_Q8[ b ], smooth_coef_Q16 );
|
||||
|
||||
/* signal to noise ratio in dB per band */
|
||||
@ -261,7 +261,7 @@ SKP_int SKP_Silk_VAD_GetSA_Q8( /* O Retu
|
||||
/**************************/
|
||||
void SKP_Silk_VAD_GetNoiseLevels(
|
||||
const SKP_int32 pX[ VAD_N_BANDS ], /* I subband energies */
|
||||
SKP_Silk_VAD_state *psSilk_VAD /* I/O Pointer to Silk VAD state */
|
||||
SKP_Silk_VAD_state *psSilk_VAD /* I/O Pointer to Silk VAD state */
|
||||
)
|
||||
{
|
||||
SKP_int k;
|
||||
@ -270,7 +270,7 @@ void SKP_Silk_VAD_GetNoiseLevels(
|
||||
|
||||
/* Initially faster smoothing */
|
||||
if( psSilk_VAD->counter < 1000 ) { /* 1000 = 20 sec */
|
||||
min_coef = SKP_DIV32_16( SKP_int16_MAX, SKP_RSHIFT( psSilk_VAD->counter, 4 ) + 1 );
|
||||
min_coef = SKP_DIV32_16( SKP_int16_MAX, SKP_RSHIFT( psSilk_VAD->counter, 4 ) + 1 );
|
||||
} else {
|
||||
min_coef = 0;
|
||||
}
|
||||
@ -279,15 +279,15 @@ void SKP_Silk_VAD_GetNoiseLevels(
|
||||
/* Get old noise level estimate for current band */
|
||||
nl = psSilk_VAD->NL[ k ];
|
||||
SKP_assert( nl >= 0 );
|
||||
|
||||
|
||||
/* Add bias */
|
||||
nrg = SKP_ADD_POS_SAT32( pX[ k ], psSilk_VAD->NoiseLevelBias[ k ] );
|
||||
nrg = SKP_ADD_POS_SAT32( pX[ k ], psSilk_VAD->NoiseLevelBias[ k ] );
|
||||
SKP_assert( nrg > 0 );
|
||||
|
||||
|
||||
/* Invert energies */
|
||||
inv_nrg = SKP_DIV32( SKP_int32_MAX, nrg );
|
||||
SKP_assert( inv_nrg >= 0 );
|
||||
|
||||
|
||||
/* Less update when subband energy is high */
|
||||
if( nrg > SKP_LSHIFT( nl, 3 ) ) {
|
||||
coef = VAD_NOISE_LEVEL_SMOOTH_COEF_Q16 >> 3;
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -69,7 +69,7 @@ void SKP_Silk_VQ_WMat_EC_FIX(
|
||||
sum1_Q14 = SKP_SMLAWB( sum1_Q14, sum2_Q16, diff_Q14[ 0 ] );
|
||||
|
||||
/* second row of W_Q18 */
|
||||
sum2_Q16 = SKP_SMULWB( W_Q18[ 7 ], diff_Q14[ 2 ] );
|
||||
sum2_Q16 = SKP_SMULWB( W_Q18[ 7 ], diff_Q14[ 2 ] );
|
||||
sum2_Q16 = SKP_SMLAWB( sum2_Q16, W_Q18[ 8 ], diff_Q14[ 3 ] );
|
||||
sum2_Q16 = SKP_SMLAWB( sum2_Q16, W_Q18[ 9 ], diff_Q14[ 4 ] );
|
||||
sum2_Q16 = SKP_LSHIFT( sum2_Q16, 1 );
|
||||
@ -77,20 +77,20 @@ void SKP_Silk_VQ_WMat_EC_FIX(
|
||||
sum1_Q14 = SKP_SMLAWB( sum1_Q14, sum2_Q16, diff_Q14[ 1 ] );
|
||||
|
||||
/* third row of W_Q18 */
|
||||
sum2_Q16 = SKP_SMULWB( W_Q18[ 13 ], diff_Q14[ 3 ] );
|
||||
sum2_Q16 = SKP_SMULWB( W_Q18[ 13 ], diff_Q14[ 3 ] );
|
||||
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[ 2 ] );
|
||||
sum1_Q14 = SKP_SMLAWB( sum1_Q14, sum2_Q16, diff_Q14[ 2 ] );
|
||||
|
||||
/* fourth row of W_Q18 */
|
||||
sum2_Q16 = SKP_SMULWB( W_Q18[ 19 ], diff_Q14[ 4 ] );
|
||||
sum2_Q16 = SKP_SMULWB( W_Q18[ 19 ], diff_Q14[ 4 ] );
|
||||
sum2_Q16 = SKP_LSHIFT( sum2_Q16, 1 );
|
||||
sum2_Q16 = SKP_SMLAWB( sum2_Q16, W_Q18[ 18 ], diff_Q14[ 3 ] );
|
||||
sum1_Q14 = SKP_SMLAWB( sum1_Q14, sum2_Q16, diff_Q14[ 3 ] );
|
||||
|
||||
/* last row of W_Q18 */
|
||||
sum2_Q16 = SKP_SMULWB( W_Q18[ 24 ], diff_Q14[ 4 ] );
|
||||
sum2_Q16 = SKP_SMULWB( W_Q18[ 24 ], diff_Q14[ 4 ] );
|
||||
sum1_Q14 = SKP_SMLAWB( sum1_Q14, sum2_Q16, diff_Q14[ 4 ] );
|
||||
|
||||
SKP_assert( sum1_Q14 >= 0 );
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -34,7 +34,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
/* Every other sample is linearly interpolated, for speed. */
|
||||
/* Window length must be between 16 and 120 (incl) and a multiple of 4. */
|
||||
|
||||
/* Matlab code for table:
|
||||
/* Matlab code for table:
|
||||
for k=16:9*4:16+2*9*4, fprintf(' %7.d,', -round(65536*pi ./ (k:4:k+8*4))); fprintf('\n'); end
|
||||
*/
|
||||
static SKP_int16 freq_table_Q16[ 27 ] = {
|
||||
@ -98,4 +98,3 @@ void SKP_Silk_apply_sine_window_new(
|
||||
S1_Q16 = SKP_min( S1_Q16, ( 1 << 16 ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -40,7 +40,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
SKP_int16 SKP_Silk_int16_array_maxabs( /* O Maximum absolute value, max: 2^15-1 */
|
||||
const SKP_int16 *vec, /* I Input vector [len] */
|
||||
const SKP_int32 len /* I Length of input vector */
|
||||
)
|
||||
)
|
||||
{
|
||||
SKP_int32 max = 0, i, lvl = 0, ind;
|
||||
if( len == 0 ) return 0;
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -37,7 +37,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "SKP_Silk_SigProc_FIX.h"
|
||||
|
||||
/* Compute autocorrelation */
|
||||
void SKP_Silk_autocorr(
|
||||
void SKP_Silk_autocorr(
|
||||
SKP_int32 *results, /* O Result (length correlationCount) */
|
||||
SKP_int *scale, /* O Scaling of the correlation vector */
|
||||
const SKP_int16 *inputData, /* I Input data to correlate */
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -53,7 +53,7 @@ void SKP_Silk_biquad_alt(
|
||||
A0_U_Q28 = SKP_RSHIFT( -A_Q28[ 0 ], 14 ); /* upper part */
|
||||
A1_L_Q28 = ( -A_Q28[ 1 ] ) & 0x00003FFF; /* lower part */
|
||||
A1_U_Q28 = SKP_RSHIFT( -A_Q28[ 1 ], 14 ); /* upper part */
|
||||
|
||||
|
||||
for( k = 0; k < len; k++ ) {
|
||||
/* S[ 0 ], S[ 1 ]: Q12 */
|
||||
inval = in[ k ];
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -95,7 +95,7 @@ void SKP_Silk_burg_modified(
|
||||
for( s = 0; s < nb_subfr; s++ ) {
|
||||
x_ptr = x + s * subfr_length;
|
||||
for( n = 1; n < D + 1; n++ ) {
|
||||
C_first_row[ n - 1 ] += (SKP_int32)SKP_RSHIFT64(
|
||||
C_first_row[ n - 1 ] += (SKP_int32)SKP_RSHIFT64(
|
||||
SKP_Silk_inner_prod16_aligned_64( x_ptr, x_ptr + n, subfr_length - n ), rshifts );
|
||||
}
|
||||
}
|
||||
@ -103,13 +103,13 @@ void SKP_Silk_burg_modified(
|
||||
for( s = 0; s < nb_subfr; s++ ) {
|
||||
x_ptr = x + s * subfr_length;
|
||||
for( n = 1; n < D + 1; n++ ) {
|
||||
C_first_row[ n - 1 ] += SKP_LSHIFT32(
|
||||
C_first_row[ n - 1 ] += SKP_LSHIFT32(
|
||||
SKP_Silk_inner_prod_aligned( x_ptr, x_ptr + n, subfr_length - n ), -rshifts );
|
||||
}
|
||||
}
|
||||
}
|
||||
SKP_memcpy( C_last_row, C_first_row, SKP_Silk_MAX_ORDER_LPC * sizeof( SKP_int32 ) );
|
||||
|
||||
|
||||
/* Initialize */
|
||||
CAb[ 0 ] = CAf[ 0 ] = C0 + SKP_SMMUL( WhiteNoiseFrac_Q32, C0 ) + 1; // Q(-rshifts)
|
||||
|
||||
@ -156,9 +156,9 @@ void SKP_Silk_burg_modified(
|
||||
tmp1 = -tmp1; // Q17
|
||||
tmp2 = -tmp2; // Q17
|
||||
for( k = 0; k <= n; k++ ) {
|
||||
CAf[ k ] = SKP_SMLAWW( CAf[ k ], tmp1,
|
||||
CAf[ k ] = SKP_SMLAWW( CAf[ k ], tmp1,
|
||||
SKP_LSHIFT32( (SKP_int32)x_ptr[ n - k ], -rshifts - 1 ) ); // Q( -rshift )
|
||||
CAb[ k ] = SKP_SMLAWW( CAb[ k ], tmp2,
|
||||
CAb[ k ] = SKP_SMLAWW( CAb[ k ], tmp2,
|
||||
SKP_LSHIFT32( (SKP_int32)x_ptr[ subfr_length - n + k - 1 ], -rshifts - 1 ) );// Q( -rshift )
|
||||
}
|
||||
}
|
||||
@ -178,7 +178,7 @@ void SKP_Silk_burg_modified(
|
||||
tmp1 = SKP_ADD_LSHIFT32( tmp1, SKP_SMMUL( C_last_row[ n - k - 1 ], Atmp1 ), 32 - QA - lz ); // Q( -rshifts )
|
||||
tmp2 = SKP_ADD_LSHIFT32( tmp2, SKP_SMMUL( C_first_row[ n - k - 1 ], Atmp1 ), 32 - QA - lz ); // Q( -rshifts )
|
||||
num = SKP_ADD_LSHIFT32( num, SKP_SMMUL( CAb[ n - k ], Atmp1 ), 32 - QA - lz ); // Q( -rshifts )
|
||||
nrg = SKP_ADD_LSHIFT32( nrg, SKP_SMMUL( SKP_ADD32( CAb[ k + 1 ], CAf[ k + 1 ] ),
|
||||
nrg = SKP_ADD_LSHIFT32( nrg, SKP_SMMUL( SKP_ADD32( CAb[ k + 1 ], CAf[ k + 1 ] ),
|
||||
Atmp1 ), 32 - QA - lz ); // Q( 1-rshifts )
|
||||
}
|
||||
CAf[ n + 1 ] = tmp1; // Q( -rshifts )
|
||||
|
@ -1,34 +1,34 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
||||
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
***********************************************************************/
|
||||
|
||||
#include "SKP_Silk_SigProc_FIX.h"
|
||||
|
||||
/* Chirp (bandwidth expand) LP AR filter */
|
||||
void SKP_Silk_bwexpander(
|
||||
void SKP_Silk_bwexpander(
|
||||
SKP_int16 *ar, /* I/O AR filter to be expanded (without leading 1) */
|
||||
const SKP_int d, /* I Length of ar */
|
||||
SKP_int32 chirp_Q16 /* I Chirp factor (typically in the range 0 to 1) */
|
||||
|
@ -1,34 +1,34 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
||||
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
***********************************************************************/
|
||||
|
||||
#include "SKP_Silk_SigProc_FIX.h"
|
||||
|
||||
/* Chirp (bandwidth expand) LP AR filter */
|
||||
void SKP_Silk_bwexpander_32(
|
||||
void SKP_Silk_bwexpander_32(
|
||||
SKP_int32 *ar, /* I/O AR filter to be expanded (without leading 1) */
|
||||
const SKP_int d, /* I Length of ar */
|
||||
SKP_int32 chirp_Q16 /* I Chirp factor in Q16 */
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -51,7 +51,7 @@ void SKP_Silk_encode_signs(
|
||||
cdf[ 0 ] = 0;
|
||||
cdf[ 1 ] = SKP_Silk_sign_CDF[ i ];
|
||||
cdf[ 2 ] = 65535;
|
||||
|
||||
|
||||
for( i = 0; i < length; i++ ) {
|
||||
if( q[ i ] != 0 ) {
|
||||
inData = SKP_enc_map( q[ i ] ); /* - = 0, + = 1 */
|
||||
@ -78,7 +78,7 @@ void SKP_Silk_decode_signs(
|
||||
cdf[ 0 ] = 0;
|
||||
cdf[ 1 ] = SKP_Silk_sign_CDF[ i ];
|
||||
cdf[ 2 ] = 65535;
|
||||
|
||||
|
||||
for( i = 0; i < length; i++ ) {
|
||||
if( q[ i ] > 0 ) {
|
||||
SKP_Silk_range_decoder( &data, sRC, cdf, 1 );
|
||||
@ -88,4 +88,3 @@ void SKP_Silk_decode_signs(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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,4 +73,3 @@ extern const SKP_int16 SKP_Silk_cbk_sizes_stage3[ SKP_Silk_PITCH_EST_MAX_COMPLEX
|
||||
extern const SKP_int16 SKP_Silk_cbk_offsets_stage3[ SKP_Silk_PITCH_EST_MAX_COMPLEX + 1 ];
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -63,19 +63,19 @@ SKP_int SKP_Silk_control_audio_bandwidth(
|
||||
|
||||
if( psEncC->vadFlag == NO_VOICE_ACTIVITY ) { /* Low speech activity */
|
||||
/* Check if we should switch down */
|
||||
#if SWITCH_TRANSITION_FILTERING
|
||||
#if SWITCH_TRANSITION_FILTERING
|
||||
if( ( psEncC->sLP.transition_frame_no == 0 ) && /* Transition phase not active */
|
||||
( psEncC->bitrateDiff <= -ACCUM_BITS_DIFF_THRESHOLD || /* Bitrate threshold is met */
|
||||
( psEncC->sSWBdetect.WB_detected * psEncC->fs_kHz == 24 ) ) ) { /* Forced down-switching due to WB input */
|
||||
psEncC->sLP.transition_frame_no = 1; /* Begin transition phase */
|
||||
psEncC->sLP.mode = 0; /* Switch down */
|
||||
} else if(
|
||||
} else if(
|
||||
( psEncC->sLP.transition_frame_no >= TRANSITION_FRAMES_DOWN ) && /* Transition phase complete */
|
||||
( psEncC->sLP.mode == 0 ) ) { /* Ready to switch down */
|
||||
psEncC->sLP.transition_frame_no = 0; /* Ready for new transition phase */
|
||||
#else
|
||||
if( psEncC->bitrateDiff <= -ACCUM_BITS_DIFF_THRESHOLD ) { /* Bitrate threshold is met */
|
||||
#endif
|
||||
if( psEncC->bitrateDiff <= -ACCUM_BITS_DIFF_THRESHOLD ) { /* Bitrate threshold is met */
|
||||
#endif
|
||||
psEncC->bitrateDiff = 0;
|
||||
|
||||
/* Switch to a lower sample frequency */
|
||||
@ -91,11 +91,11 @@ SKP_int SKP_Silk_control_audio_bandwidth(
|
||||
|
||||
/* Check if we should switch up */
|
||||
if( ( ( psEncC->fs_kHz * 1000 < psEncC->API_fs_Hz ) &&
|
||||
( psEncC->TargetRate_bps >= psEncC->bitrate_threshold_up ) &&
|
||||
( psEncC->sSWBdetect.WB_detected * psEncC->fs_kHz < 16 ) ) &&
|
||||
( ( ( psEncC->fs_kHz == 16 ) && ( psEncC->maxInternal_fs_kHz >= 24 ) ) ||
|
||||
( psEncC->TargetRate_bps >= psEncC->bitrate_threshold_up ) &&
|
||||
( psEncC->sSWBdetect.WB_detected * psEncC->fs_kHz < 16 ) ) &&
|
||||
( ( ( psEncC->fs_kHz == 16 ) && ( psEncC->maxInternal_fs_kHz >= 24 ) ) ||
|
||||
( ( psEncC->fs_kHz == 12 ) && ( psEncC->maxInternal_fs_kHz >= 16 ) ) ||
|
||||
( ( psEncC->fs_kHz == 8 ) && ( psEncC->maxInternal_fs_kHz >= 12 ) ) )
|
||||
( ( psEncC->fs_kHz == 8 ) && ( psEncC->maxInternal_fs_kHz >= 12 ) ) )
|
||||
#if SWITCH_TRANSITION_FILTERING
|
||||
&& ( psEncC->sLP.transition_frame_no == 0 ) ) { /* No transition phase running, ready to switch */
|
||||
psEncC->sLP.mode = 1; /* Switch up */
|
||||
@ -120,7 +120,7 @@ SKP_int SKP_Silk_control_audio_bandwidth(
|
||||
#if SWITCH_TRANSITION_FILTERING
|
||||
/* After switching up, stop transition filter during speech inactivity */
|
||||
if( ( psEncC->sLP.mode == 1 ) &&
|
||||
( psEncC->sLP.transition_frame_no >= TRANSITION_FRAMES_UP ) &&
|
||||
( psEncC->sLP.transition_frame_no >= TRANSITION_FRAMES_UP ) &&
|
||||
( psEncC->vadFlag == NO_VOICE_ACTIVITY ) ) {
|
||||
|
||||
psEncC->sLP.transition_frame_no = 0;
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -53,7 +53,7 @@ SKP_INLINE SKP_int SKP_Silk_setup_LBRR_FIX(
|
||||
);
|
||||
|
||||
/* Control encoder */
|
||||
SKP_int SKP_Silk_control_encoder_FIX(
|
||||
SKP_int SKP_Silk_control_encoder_FIX(
|
||||
SKP_Silk_encoder_state_FIX *psEnc, /* I/O Pointer to Silk encoder state */
|
||||
const SKP_int PacketSize_ms, /* I Packet length (ms) */
|
||||
const SKP_int32 TargetRate_bps, /* I Target max bitrate (bps) */
|
||||
@ -143,7 +143,7 @@ void SKP_Silk_LBRR_ctrl_FIX(
|
||||
/* Usage Control based on sensitivity and packet loss caracteristics */
|
||||
/* For now only enable adding to next for active frames. Make more complex later */
|
||||
LBRR_usage = SKP_SILK_NO_LBRR;
|
||||
if( psEnc->speech_activity_Q8 > SKP_FIX_CONST( LBRR_SPEECH_ACTIVITY_THRES, 8 ) && psEnc->sCmn.PacketLoss_perc > LBRR_LOSS_THRES ) { // nb! maybe multiply loss prob and speech activity
|
||||
if( psEnc->speech_activity_Q8 > SKP_FIX_CONST( LBRR_SPEECH_ACTIVITY_THRES, 8 ) && psEnc->sCmn.PacketLoss_perc > LBRR_LOSS_THRES ) { // nb! maybe multiply loss prob and speech activity
|
||||
LBRR_usage = SKP_SILK_ADD_LBRR_TO_PLUS1;
|
||||
}
|
||||
psEncCtrlC->LBRR_usage = LBRR_usage;
|
||||
@ -158,7 +158,7 @@ SKP_INLINE SKP_int SKP_Silk_setup_resamplers_FIX(
|
||||
)
|
||||
{
|
||||
SKP_int ret = SKP_SILK_NO_ERROR;
|
||||
|
||||
|
||||
if( psEnc->sCmn.fs_kHz != fs_kHz || psEnc->sCmn.prev_API_fs_Hz != psEnc->sCmn.API_fs_Hz ) {
|
||||
|
||||
if( psEnc->sCmn.fs_kHz == 0 ) {
|
||||
@ -212,10 +212,10 @@ SKP_INLINE SKP_int SKP_Silk_setup_packetsize_FIX(
|
||||
SKP_int ret = SKP_SILK_NO_ERROR;
|
||||
|
||||
/* Set packet size */
|
||||
if( ( PacketSize_ms != 20 ) &&
|
||||
( PacketSize_ms != 40 ) &&
|
||||
( PacketSize_ms != 60 ) &&
|
||||
( PacketSize_ms != 80 ) &&
|
||||
if( ( PacketSize_ms != 20 ) &&
|
||||
( PacketSize_ms != 40 ) &&
|
||||
( PacketSize_ms != 60 ) &&
|
||||
( PacketSize_ms != 80 ) &&
|
||||
( PacketSize_ms != 100 ) ) {
|
||||
ret = SKP_SILK_ENC_PACKET_SIZE_NOT_SUPPORTED;
|
||||
} else {
|
||||
@ -293,11 +293,11 @@ SKP_INLINE SKP_int SKP_Silk_setup_fs_FIX(
|
||||
if( psEnc->sCmn.fs_kHz == 24 ) {
|
||||
psEnc->mu_LTP_Q8 = SKP_FIX_CONST( MU_LTP_QUANT_SWB, 8 );
|
||||
psEnc->sCmn.bitrate_threshold_up = SKP_int32_MAX;
|
||||
psEnc->sCmn.bitrate_threshold_down = SWB2WB_BITRATE_BPS;
|
||||
psEnc->sCmn.bitrate_threshold_down = SWB2WB_BITRATE_BPS;
|
||||
} else if( psEnc->sCmn.fs_kHz == 16 ) {
|
||||
psEnc->mu_LTP_Q8 = SKP_FIX_CONST( MU_LTP_QUANT_WB, 8 );
|
||||
psEnc->sCmn.bitrate_threshold_up = WB2SWB_BITRATE_BPS;
|
||||
psEnc->sCmn.bitrate_threshold_down = WB2MB_BITRATE_BPS;
|
||||
psEnc->sCmn.bitrate_threshold_down = WB2MB_BITRATE_BPS;
|
||||
} else if( psEnc->sCmn.fs_kHz == 12 ) {
|
||||
psEnc->mu_LTP_Q8 = SKP_FIX_CONST( MU_LTP_QUANT_MB, 8 );
|
||||
psEnc->sCmn.bitrate_threshold_up = MB2WB_BITRATE_BPS;
|
||||
@ -341,7 +341,7 @@ SKP_INLINE SKP_int SKP_Silk_setup_rate_FIX(
|
||||
for( k = 1; k < TARGET_RATE_TAB_SZ; k++ ) {
|
||||
/* Find bitrate interval in table and interpolate */
|
||||
if( TargetRate_bps < rateTable[ k ] ) {
|
||||
frac_Q6 = SKP_DIV32( SKP_LSHIFT( TargetRate_bps - rateTable[ k - 1 ], 6 ),
|
||||
frac_Q6 = SKP_DIV32( SKP_LSHIFT( TargetRate_bps - rateTable[ k - 1 ], 6 ),
|
||||
rateTable[ k ] - rateTable[ k - 1 ] );
|
||||
psEnc->SNR_dB_Q7 = SKP_LSHIFT( SNR_table_Q1[ k - 1 ], 6 ) + SKP_MUL( frac_Q6, SNR_table_Q1[ k ] - SNR_table_Q1[ k - 1 ] );
|
||||
break;
|
||||
@ -362,7 +362,7 @@ SKP_INLINE SKP_int SKP_Silk_setup_LBRR_FIX(
|
||||
if( psEnc->sCmn.useInBandFEC < 0 || psEnc->sCmn.useInBandFEC > 1 ) {
|
||||
ret = SKP_SILK_ENC_INVALID_INBAND_FEC_SETTING;
|
||||
}
|
||||
|
||||
|
||||
psEnc->sCmn.LBRR_enabled = psEnc->sCmn.useInBandFEC;
|
||||
if( psEnc->sCmn.fs_kHz == 8 ) {
|
||||
LBRRRate_thres_bps = INBAND_FEC_MIN_RATE_BPS - 9000;
|
||||
|
@ -1,32 +1,32 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
/**********************************************************************
|
||||
* Correlation Matrix Computations for LS estimate.
|
||||
* Correlation Matrix Computations for LS estimate.
|
||||
**********************************************************************/
|
||||
|
||||
#include "SKP_Silk_main_FIX.h"
|
||||
@ -86,7 +86,7 @@ void SKP_Silk_corrMatrix_FIX(
|
||||
|
||||
/* Add shifts to get the desired head room */
|
||||
head_room_rshifts = SKP_max( head_room - SKP_Silk_CLZ32( energy ), 0 );
|
||||
|
||||
|
||||
energy = SKP_RSHIFT32( energy, head_room_rshifts );
|
||||
rshifts_local += head_room_rshifts;
|
||||
|
||||
@ -150,4 +150,3 @@ void SKP_Silk_corrMatrix_FIX(
|
||||
}
|
||||
*rshifts = rshifts_local;
|
||||
}
|
||||
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -47,7 +47,6 @@ SKP_int SKP_Silk_init_decoder(
|
||||
SKP_Silk_CNG_Reset( psDec );
|
||||
|
||||
SKP_Silk_PLC_Reset( psDec );
|
||||
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -32,7 +32,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
/* Decoder functions */
|
||||
/*********************/
|
||||
|
||||
SKP_int SKP_Silk_SDK_Get_Decoder_Size( SKP_int32 *decSizeBytes )
|
||||
SKP_int SKP_Silk_SDK_Get_Decoder_Size( SKP_int32 *decSizeBytes )
|
||||
{
|
||||
SKP_int ret = 0;
|
||||
|
||||
@ -95,14 +95,14 @@ SKP_int SKP_Silk_SDK_Decode(
|
||||
lostFlag = 1;
|
||||
ret = SKP_SILK_DEC_PAYLOAD_TOO_LARGE;
|
||||
}
|
||||
|
||||
|
||||
/* Save previous sample frequency */
|
||||
prev_fs_kHz = psDec->fs_kHz;
|
||||
|
||||
|
||||
/* Call decoder for one frame */
|
||||
ret += SKP_Silk_decode_frame( psDec, pSamplesOutInternal, nSamplesOut, inData, nBytesIn,
|
||||
ret += SKP_Silk_decode_frame( psDec, pSamplesOutInternal, nSamplesOut, inData, nBytesIn,
|
||||
lostFlag, &used_bytes );
|
||||
|
||||
|
||||
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 */
|
||||
@ -111,7 +111,7 @@ SKP_int SKP_Silk_SDK_Decode(
|
||||
/* Last frame in Payload */
|
||||
psDec->moreInternalDecoderFrames = 0;
|
||||
psDec->nFramesInPacket = psDec->nFramesDecoded;
|
||||
|
||||
|
||||
/* Track inband FEC usage */
|
||||
if( psDec->vadFlag == VOICE_ACTIVITY ) {
|
||||
if( psDec->FrameTermination == SKP_SILK_LAST_FRAME ) {
|
||||
@ -137,7 +137,7 @@ SKP_int SKP_Silk_SDK_Decode(
|
||||
}
|
||||
|
||||
/* Resample if needed */
|
||||
if( psDec->fs_kHz * 1000 != decControl->API_sampleRate ) {
|
||||
if( psDec->fs_kHz * 1000 != decControl->API_sampleRate ) {
|
||||
SKP_int16 samplesOut_tmp[ MAX_API_FS_KHZ * FRAME_LENGTH_MS ];
|
||||
SKP_assert( psDec->fs_kHz <= MAX_API_FS_KHZ );
|
||||
|
||||
@ -154,7 +154,7 @@ SKP_int SKP_Silk_SDK_Decode(
|
||||
|
||||
/* Update the number of output samples */
|
||||
*nSamplesOut = SKP_DIV32( ( SKP_int32 )*nSamplesOut * decControl->API_sampleRate, psDec->fs_kHz * 1000 );
|
||||
} else if( prev_fs_kHz * 1000 > decControl->API_sampleRate ) {
|
||||
} else if( prev_fs_kHz * 1000 > decControl->API_sampleRate ) {
|
||||
SKP_memcpy( samplesOut, pSamplesOutInternal, *nSamplesOut * sizeof( SKP_int16 ) );
|
||||
}
|
||||
|
||||
@ -193,10 +193,10 @@ void SKP_Silk_SDK_search_for_LBRR(
|
||||
sDec.lossCnt = 0; /* Avoid running bw expansion of the LPC parameters when searching for LBRR data */
|
||||
SKP_memset( sDec.prevNLSF_Q15, 0, MAX_LPC_ORDER * sizeof( SKP_int ) );
|
||||
SKP_Silk_range_dec_init( &sDec.sRC, inData, ( SKP_int32 )nBytesIn );
|
||||
|
||||
|
||||
while(1) {
|
||||
SKP_Silk_decode_parameters( &sDec, &sDecCtrl, TempQ, 0 );
|
||||
|
||||
|
||||
if( sDec.sRC.error ) {
|
||||
/* Corrupt stream */
|
||||
*nLBRRBytes = 0;
|
||||
@ -236,23 +236,23 @@ void SKP_Silk_SDK_get_TOC(
|
||||
Silk_TOC->corrupt = 0;
|
||||
while( 1 ) {
|
||||
SKP_Silk_decode_parameters( &sDec, &sDecCtrl, TempQ, 0 );
|
||||
|
||||
|
||||
Silk_TOC->vadFlags[ sDec.nFramesDecoded ] = sDec.vadFlag;
|
||||
Silk_TOC->sigtypeFlags[ sDec.nFramesDecoded ] = sDecCtrl.sigtype;
|
||||
|
||||
|
||||
if( sDec.sRC.error ) {
|
||||
/* Corrupt stream */
|
||||
Silk_TOC->corrupt = 1;
|
||||
break;
|
||||
};
|
||||
|
||||
|
||||
if( sDec.nBytesLeft > 0 && sDec.FrameTermination == SKP_SILK_MORE_FRAMES ) {
|
||||
sDec.nFramesDecoded++;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( Silk_TOC->corrupt || sDec.FrameTermination == SKP_SILK_MORE_FRAMES ||
|
||||
if( Silk_TOC->corrupt || sDec.FrameTermination == SKP_SILK_MORE_FRAMES ||
|
||||
sDec.nFramesInPacket > SILK_MAX_FRAMES_PER_PACKET ) {
|
||||
/* Corrupt packet */
|
||||
SKP_memset( Silk_TOC, 0, sizeof( SKP_Silk_TOC_struct ) );
|
||||
@ -271,7 +271,7 @@ void SKP_Silk_SDK_get_TOC(
|
||||
/**************************/
|
||||
/* Get the version number */
|
||||
/**************************/
|
||||
/* Return a pointer to string specifying the version */
|
||||
/* Return a pointer to string specifying the version */
|
||||
const char *SKP_Silk_SDK_get_version()
|
||||
{
|
||||
static const char version[] = "1.0.8";
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -32,7 +32,7 @@ void SKP_Silk_decode_short_term_prediction(
|
||||
SKP_int32 *vec_Q10,
|
||||
SKP_int32 *pres_Q10,
|
||||
SKP_int32 *sLPC_Q14,
|
||||
SKP_int16 *A_Q12_tmp,
|
||||
SKP_int16 *A_Q12_tmp,
|
||||
SKP_int LPC_order,
|
||||
SKP_int subfr_length
|
||||
);
|
||||
@ -57,7 +57,7 @@ void SKP_Silk_decode_core(
|
||||
SKP_int32 FiltState[ MAX_LPC_ORDER ];
|
||||
|
||||
SKP_assert( psDec->prev_inv_gain_Q16 != 0 );
|
||||
|
||||
|
||||
offset_Q10 = SKP_Silk_Quantization_Offsets_Q10[ psDecCtrl->sigtype ][ psDecCtrl->QuantOffsetType ];
|
||||
|
||||
if( psDecCtrl->NLSFInterpCoef_Q2 < ( 1 << 2 ) ) {
|
||||
@ -89,8 +89,8 @@ void SKP_Silk_decode_core(
|
||||
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 ) );
|
||||
/* 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 ];
|
||||
Gain_Q16 = psDecCtrl->Gains_Q16[ k ];
|
||||
LTP_scale_Q14 = psDecCtrl->LTP_scale_Q14;
|
||||
@ -108,10 +108,10 @@ void SKP_Silk_decode_core(
|
||||
/* 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 ) ) {
|
||||
|
||||
|
||||
SKP_memset( B_Q14, 0, LTP_ORDER * sizeof( SKP_int16 ) );
|
||||
B_Q14[ LTP_ORDER/2 ] = ( SKP_int16 )1 << 12; /* 0.25 */
|
||||
|
||||
|
||||
sigtype = SIG_TYPE_VOICED;
|
||||
psDecCtrl->pitchL[ k ] = psDec->lagPrev;
|
||||
LTP_scale_Q14 = ( SKP_int )1 << 14;
|
||||
@ -119,7 +119,7 @@ void SKP_Silk_decode_core(
|
||||
|
||||
if( sigtype == SIG_TYPE_VOICED ) {
|
||||
/* Voiced */
|
||||
|
||||
|
||||
lag = psDecCtrl->pitchL[ k ];
|
||||
/* Re-whitening */
|
||||
if( ( k & ( 3 - SKP_LSHIFT( NLSF_interpolation_flag, 1 ) ) ) == 0 ) {
|
||||
@ -129,7 +129,7 @@ void SKP_Silk_decode_core(
|
||||
SKP_assert( start_idx <= psDec->frame_length - psDec->LPC_order );
|
||||
|
||||
SKP_memset( FiltState, 0, psDec->LPC_order * sizeof( SKP_int32 ) ); /* Not really necessary, but Valgrind and Coverity will complain otherwise */
|
||||
SKP_Silk_MA_Prediction( &psDec->outBuf[ start_idx + k * ( psDec->frame_length >> 2 ) ],
|
||||
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 unscaled */
|
||||
@ -150,7 +150,7 @@ void SKP_Silk_decode_core(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* 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 ] );
|
||||
@ -172,10 +172,10 @@ void SKP_Silk_decode_core(
|
||||
LTP_pred_Q14 = SKP_SMLAWB( LTP_pred_Q14, pred_lag_ptr[ -3 ], B_Q14[ 3 ] );
|
||||
LTP_pred_Q14 = SKP_SMLAWB( LTP_pred_Q14, pred_lag_ptr[ -4 ], B_Q14[ 4 ] );
|
||||
pred_lag_ptr++;
|
||||
|
||||
/* Generate LPC residual */
|
||||
|
||||
/* Generate LPC residual */
|
||||
pres_Q10[ i ] = SKP_ADD32( pexc_Q10[ i ], SKP_RSHIFT_ROUND( LTP_pred_Q14, 4 ) );
|
||||
|
||||
|
||||
/* Update states */
|
||||
psDec->sLTP_Q16[ sLTP_buf_idx ] = SKP_LSHIFT( pres_Q10[ i ], 6 );
|
||||
sLTP_buf_idx++;
|
||||
@ -197,7 +197,7 @@ void SKP_Silk_decode_core(
|
||||
pres_Q10 += psDec->subfr_length;
|
||||
pxq += psDec->subfr_length;
|
||||
}
|
||||
|
||||
|
||||
/* Copy to output */
|
||||
SKP_memcpy( xq, &psDec->outBuf[ psDec->frame_length ], psDec->frame_length * sizeof( SKP_int16 ) );
|
||||
|
||||
@ -207,7 +207,7 @@ void SKP_Silk_decode_short_term_prediction(
|
||||
SKP_int32 *vec_Q10,
|
||||
SKP_int32 *pres_Q10,
|
||||
SKP_int32 *sLPC_Q14,
|
||||
SKP_int16 *A_Q12_tmp,
|
||||
SKP_int16 *A_Q12_tmp,
|
||||
SKP_int LPC_order,
|
||||
SKP_int subfr_length
|
||||
)
|
||||
@ -234,11 +234,8 @@ SKP_int subfr_length
|
||||
|
||||
/* Add prediction to LPC residual */
|
||||
vec_Q10[ i ] = SKP_ADD32( pres_Q10[ i ], LPC_pred_Q10 );
|
||||
|
||||
|
||||
/* Update states */
|
||||
sLPC_Q14[ MAX_LPC_ORDER + i ] = SKP_LSHIFT( vec_Q10[ i ], 4 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -49,7 +49,7 @@ SKP_int SKP_Silk_decode_frame(
|
||||
|
||||
L = psDec->frame_length;
|
||||
sDecCtrl.LTP_scale_Q14 = 0;
|
||||
|
||||
|
||||
/* Safety checks */
|
||||
SKP_assert( L > 0 && L <= MAX_FRAME_LENGTH );
|
||||
|
||||
@ -92,7 +92,7 @@ SKP_int SKP_Silk_decode_frame(
|
||||
} else {
|
||||
*decBytes = psDec->sRC.bufferLength - psDec->nBytesLeft;
|
||||
psDec->nFramesDecoded++;
|
||||
|
||||
|
||||
/* Update lengths. Sampling frequency could have changed */
|
||||
L = psDec->frame_length;
|
||||
|
||||
@ -139,7 +139,7 @@ SKP_int SKP_Silk_decode_frame(
|
||||
/********************************************/
|
||||
/* HP filter output */
|
||||
/********************************************/
|
||||
SKP_assert( ( ( psDec->fs_kHz == 12 ) && ( L % 3 ) == 0 ) ||
|
||||
SKP_assert( ( ( psDec->fs_kHz == 12 ) && ( L % 3 ) == 0 ) ||
|
||||
( ( psDec->fs_kHz != 12 ) && ( L % 2 ) == 0 ) );
|
||||
SKP_Silk_biquad( pOut, psDec->HP_B, psDec->HP_A, psDec->HPState, pOut, L );
|
||||
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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,7 +68,7 @@ void SKP_Silk_decode_parameters(
|
||||
SKP_Silk_range_decoder( &Ix, psRC, SKP_Silk_type_offset_CDF, SKP_Silk_type_offset_CDF_offset );
|
||||
} else {
|
||||
/* condidtional coding */
|
||||
SKP_Silk_range_decoder( &Ix, psRC, SKP_Silk_type_offset_joint_CDF[ psDec->typeOffsetPrev ],
|
||||
SKP_Silk_range_decoder( &Ix, psRC, SKP_Silk_type_offset_joint_CDF[ psDec->typeOffsetPrev ],
|
||||
SKP_Silk_type_offset_CDF_offset );
|
||||
}
|
||||
psDecCtrl->sigtype = SKP_RSHIFT( Ix, 1 );
|
||||
@ -78,7 +78,7 @@ void SKP_Silk_decode_parameters(
|
||||
/****************/
|
||||
/* Decode gains */
|
||||
/****************/
|
||||
/* first subframe */
|
||||
/* first subframe */
|
||||
if( psDec->nFramesDecoded == 0 ) {
|
||||
/* first frame in packet: independent coding */
|
||||
SKP_Silk_range_decoder( &GainsIndices[ 0 ], psRC, SKP_Silk_gain_CDF[ psDecCtrl->sigtype ], SKP_Silk_gain_CDF_offset );
|
||||
@ -91,7 +91,7 @@ void SKP_Silk_decode_parameters(
|
||||
for( i = 1; i < NB_SUBFR; i++ ) {
|
||||
SKP_Silk_range_decoder( &GainsIndices[ i ], psRC, SKP_Silk_delta_gain_CDF, SKP_Silk_delta_gain_CDF_offset );
|
||||
}
|
||||
|
||||
|
||||
/* Dequant Gains */
|
||||
SKP_Silk_gains_dequant( psDecCtrl->Gains_Q16, GainsIndices, &psDec->LastGainIndex, psDec->nFramesDecoded );
|
||||
/****************/
|
||||
@ -109,9 +109,9 @@ void SKP_Silk_decode_parameters(
|
||||
/************************************/
|
||||
/* Decode NLSF interpolation factor */
|
||||
/************************************/
|
||||
SKP_Silk_range_decoder( &psDecCtrl->NLSFInterpCoef_Q2, psRC, SKP_Silk_NLSF_interpolation_factor_CDF,
|
||||
SKP_Silk_range_decoder( &psDecCtrl->NLSFInterpCoef_Q2, psRC, SKP_Silk_NLSF_interpolation_factor_CDF,
|
||||
SKP_Silk_NLSF_interpolation_factor_offset );
|
||||
|
||||
|
||||
/* If just reset, e.g., because internal Fs changed, do not allow interpolation */
|
||||
/* improves the case of packet loss in the first frame after a switch */
|
||||
if( psDec->first_frame_after_reset == 1 ) {
|
||||
@ -123,10 +123,10 @@ void SKP_Silk_decode_parameters(
|
||||
SKP_Silk_NLSF2A_stable( psDecCtrl->PredCoef_Q12[ 1 ], pNLSF_Q15, psDec->LPC_order );
|
||||
|
||||
if( psDecCtrl->NLSFInterpCoef_Q2 < 4 ) {
|
||||
/* Calculation of the interpolated NLSF0 vector from the interpolation factor, */
|
||||
/* 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,
|
||||
pNLSF0_Q15[ i ] = psDec->prevNLSF_Q15[ i ] + SKP_RSHIFT( SKP_MUL( psDecCtrl->NLSFInterpCoef_Q2,
|
||||
( pNLSF_Q15[ i ] - psDec->prevNLSF_Q15[ i ] ) ), 2 );
|
||||
}
|
||||
|
||||
@ -134,7 +134,7 @@ void SKP_Silk_decode_parameters(
|
||||
SKP_Silk_NLSF2A_stable( psDecCtrl->PredCoef_Q12[ 0 ], pNLSF0_Q15, psDec->LPC_order );
|
||||
} else {
|
||||
/* Copy LPC coefficients for first half from second half */
|
||||
SKP_memcpy( psDecCtrl->PredCoef_Q12[ 0 ], psDecCtrl->PredCoef_Q12[ 1 ],
|
||||
SKP_memcpy( psDecCtrl->PredCoef_Q12[ 0 ], psDecCtrl->PredCoef_Q12[ 1 ],
|
||||
psDec->LPC_order * sizeof( SKP_int16 ) );
|
||||
}
|
||||
}
|
||||
@ -161,7 +161,7 @@ void SKP_Silk_decode_parameters(
|
||||
} else {
|
||||
SKP_Silk_range_decoder( &Ixs[ 0 ], psRC, SKP_Silk_pitch_lag_SWB_CDF, SKP_Silk_pitch_lag_SWB_CDF_offset );
|
||||
}
|
||||
|
||||
|
||||
/* Get countour index */
|
||||
if( psDec->fs_kHz == 8 ) {
|
||||
/* Less codevectors used in 8 khz mode */
|
||||
@ -170,7 +170,7 @@ void SKP_Silk_decode_parameters(
|
||||
/* Joint for 12, 16, and 24 khz */
|
||||
SKP_Silk_range_decoder( &Ixs[ 1 ], psRC, SKP_Silk_pitch_contour_CDF, SKP_Silk_pitch_contour_CDF_offset );
|
||||
}
|
||||
|
||||
|
||||
/* Decode pitch values */
|
||||
SKP_Silk_decode_pitch( Ixs[ 0 ], Ixs[ 1 ], psDecCtrl->pitchL, psDec->fs_kHz );
|
||||
|
||||
@ -178,14 +178,14 @@ void SKP_Silk_decode_parameters(
|
||||
/* Decode LTP gains */
|
||||
/********************/
|
||||
/* Decode PERIndex value */
|
||||
SKP_Silk_range_decoder( &psDecCtrl->PERIndex, psRC, SKP_Silk_LTP_per_index_CDF,
|
||||
SKP_Silk_range_decoder( &psDecCtrl->PERIndex, psRC, SKP_Silk_LTP_per_index_CDF,
|
||||
SKP_Silk_LTP_per_index_CDF_offset );
|
||||
|
||||
/* Decode Codebook Index */
|
||||
cbk_ptr_Q14 = SKP_Silk_LTP_vq_ptrs_Q14[ psDecCtrl->PERIndex ]; /* set pointer to start of codebook */
|
||||
|
||||
for( k = 0; k < NB_SUBFR; k++ ) {
|
||||
SKP_Silk_range_decoder( &Ix, psRC, SKP_Silk_LTP_gain_CDF_ptrs[ psDecCtrl->PERIndex ],
|
||||
SKP_Silk_range_decoder( &Ix, psRC, SKP_Silk_LTP_gain_CDF_ptrs[ psDecCtrl->PERIndex ],
|
||||
SKP_Silk_LTP_gain_CDF_offsets[ psDecCtrl->PERIndex ] );
|
||||
|
||||
for( i = 0; i < LTP_ORDER; i++ ) {
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -41,16 +41,16 @@ void SKP_Silk_decode_pulses(
|
||||
SKP_int sum_pulses[ MAX_NB_SHELL_BLOCKS ], nLshifts[ MAX_NB_SHELL_BLOCKS ];
|
||||
SKP_int *pulses_ptr;
|
||||
const SKP_uint16 *cdf_ptr;
|
||||
|
||||
|
||||
/*********************/
|
||||
/* Decode rate level */
|
||||
/*********************/
|
||||
SKP_Silk_range_decoder( &psDecCtrl->RateLevelIndex, psRC,
|
||||
SKP_Silk_range_decoder( &psDecCtrl->RateLevelIndex, psRC,
|
||||
SKP_Silk_rate_levels_CDF[ psDecCtrl->sigtype ], SKP_Silk_rate_levels_CDF_offset );
|
||||
|
||||
/* Calculate number of shell blocks */
|
||||
iter = frame_length / SHELL_CODEC_FRAME_LENGTH;
|
||||
|
||||
|
||||
/***************************************************/
|
||||
/* Sum-Weighted-Pulses Decoding */
|
||||
/***************************************************/
|
||||
@ -62,11 +62,11 @@ void SKP_Silk_decode_pulses(
|
||||
/* LSB indication */
|
||||
while( sum_pulses[ i ] == ( MAX_PULSES + 1 ) ) {
|
||||
nLshifts[ i ]++;
|
||||
SKP_Silk_range_decoder( &sum_pulses[ i ], psRC,
|
||||
SKP_Silk_range_decoder( &sum_pulses[ i ], psRC,
|
||||
SKP_Silk_pulses_per_block_CDF[ N_RATE_LEVELS - 1 ], SKP_Silk_pulses_per_block_CDF_offset );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/***************************************************/
|
||||
/* Shell decoding */
|
||||
/***************************************************/
|
||||
@ -88,7 +88,7 @@ void SKP_Silk_decode_pulses(
|
||||
for( k = 0; k < SHELL_CODEC_FRAME_LENGTH; k++ ) {
|
||||
abs_q = pulses_ptr[ k ];
|
||||
for( j = 0; j < nLS; j++ ) {
|
||||
abs_q = SKP_LSHIFT( abs_q, 1 );
|
||||
abs_q = SKP_LSHIFT( abs_q, 1 );
|
||||
SKP_Silk_range_decoder( &bit, psRC, SKP_Silk_lsb_CDF, 1 );
|
||||
abs_q += bit;
|
||||
}
|
||||
@ -100,6 +100,6 @@ void SKP_Silk_decode_pulses(
|
||||
/****************************************/
|
||||
/* Decode and add signs to pulse signal */
|
||||
/****************************************/
|
||||
SKP_Silk_decode_signs( psRC, q, frame_length, psDecCtrl->sigtype,
|
||||
SKP_Silk_decode_signs( psRC, q, frame_length, psDecCtrl->sigtype,
|
||||
psDecCtrl->QuantOffsetType, psDecCtrl->RateLevelIndex);
|
||||
}
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -72,9 +72,8 @@ void SKP_Silk_decoder_set_fs(
|
||||
/* unsupported sampling rate */
|
||||
SKP_assert( 0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Check that settings are valid */
|
||||
SKP_assert( psDec->frame_length > 0 && psDec->frame_length <= MAX_FRAME_LENGTH );
|
||||
}
|
||||
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -55,7 +55,7 @@ extern "C"
|
||||
|
||||
/* Integration/hysteresis threshold for lowering internal sample frequency */
|
||||
/* 30000000 -> 6 sec if bitrate is 5000 bps below limit; 3 sec if bitrate is 10000 bps below limit */
|
||||
#define ACCUM_BITS_DIFF_THRESHOLD 30000000
|
||||
#define ACCUM_BITS_DIFF_THRESHOLD 30000000
|
||||
#define TARGET_RATE_TAB_SZ 8
|
||||
|
||||
/* DTX settings */
|
||||
@ -102,7 +102,7 @@ extern "C"
|
||||
#define DEC_HP_ORDER 2
|
||||
|
||||
/* Maximum sampling frequency, should be 16 for some embedded platforms */
|
||||
#define MAX_FS_KHZ 24
|
||||
#define MAX_FS_KHZ 24
|
||||
#define MAX_API_FS_KHZ 48
|
||||
|
||||
/* Signal Types used by silk */
|
||||
@ -113,7 +113,7 @@ extern "C"
|
||||
#define NO_VOICE_ACTIVITY 0
|
||||
#define VOICE_ACTIVITY 1
|
||||
|
||||
/* Number of samples per frame */
|
||||
/* Number of samples per frame */
|
||||
#define FRAME_LENGTH_MS 20
|
||||
#define MAX_FRAME_LENGTH ( FRAME_LENGTH_MS * MAX_FS_KHZ )
|
||||
|
||||
@ -230,13 +230,13 @@ extern "C"
|
||||
|
||||
#define VAD_INTERNAL_SUBFRAMES_LOG2 2
|
||||
#define VAD_INTERNAL_SUBFRAMES (1 << VAD_INTERNAL_SUBFRAMES_LOG2)
|
||||
|
||||
|
||||
#define VAD_NOISE_LEVEL_SMOOTH_COEF_Q16 1024 /* Must be < 4096 */
|
||||
#define VAD_NOISE_LEVELS_BIAS 50
|
||||
#define VAD_NOISE_LEVELS_BIAS 50
|
||||
|
||||
/* Sigmoid settings */
|
||||
#define VAD_NEGATIVE_OFFSET_Q5 128 /* sigmoid is 0 at -128 */
|
||||
#define VAD_SNR_FACTOR_Q16 45000
|
||||
#define VAD_SNR_FACTOR_Q16 45000
|
||||
|
||||
/* smoothing for SNR measurement */
|
||||
#define VAD_SNR_SMOOTH_COEF_Q18 4096
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -40,7 +40,7 @@ void SKP_Silk_detect_SWB_input(
|
||||
SKP_int HP_8_kHz_len, i, shift;
|
||||
SKP_int16 in_HP_8_kHz[ MAX_FRAME_LENGTH ];
|
||||
SKP_int32 energy_32;
|
||||
|
||||
|
||||
/* High pass filter with cutoff at 8 khz */
|
||||
HP_8_kHz_len = SKP_min_int( nSamplesIn, MAX_FRAME_LENGTH );
|
||||
HP_8_kHz_len = SKP_max_int( HP_8_kHz_len, 0 );
|
||||
@ -48,10 +48,10 @@ void SKP_Silk_detect_SWB_input(
|
||||
/* Cutoff around 9 khz */
|
||||
/* A = conv(conv([8192,14613, 6868], [8192,12883, 7337]), [8192,11586, 7911]); */
|
||||
/* B = conv(conv([575, -948, 575], [575, -221, 575]), [575, 104, 575]); */
|
||||
SKP_Silk_biquad( samplesIn, SKP_Silk_SWB_detect_B_HP_Q13[ 0 ], SKP_Silk_SWB_detect_A_HP_Q13[ 0 ],
|
||||
SKP_Silk_biquad( samplesIn, SKP_Silk_SWB_detect_B_HP_Q13[ 0 ], SKP_Silk_SWB_detect_A_HP_Q13[ 0 ],
|
||||
psSWBdetect->S_HP_8_kHz[ 0 ], in_HP_8_kHz, HP_8_kHz_len );
|
||||
for( i = 1; i < NB_SOS; i++ ) {
|
||||
SKP_Silk_biquad( in_HP_8_kHz, SKP_Silk_SWB_detect_B_HP_Q13[ i ], SKP_Silk_SWB_detect_A_HP_Q13[ i ],
|
||||
SKP_Silk_biquad( in_HP_8_kHz, SKP_Silk_SWB_detect_B_HP_Q13[ i ], SKP_Silk_SWB_detect_A_HP_Q13[ i ],
|
||||
psSWBdetect->S_HP_8_kHz[ i ], in_HP_8_kHz, HP_8_kHz_len );
|
||||
}
|
||||
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -41,9 +41,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
SKP_int SKP_Silk_SDK_Get_Encoder_Size( SKP_int32 *encSizeBytes )
|
||||
{
|
||||
SKP_int ret = 0;
|
||||
|
||||
|
||||
*encSizeBytes = sizeof( SKP_Silk_encoder_state_FIX );
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -83,7 +83,7 @@ SKP_int SKP_Silk_SDK_InitEncoder(
|
||||
SKP_Silk_encoder_state_FIX *psEnc;
|
||||
SKP_int ret = 0;
|
||||
|
||||
|
||||
|
||||
psEnc = ( SKP_Silk_encoder_state_FIX* )encState;
|
||||
|
||||
/* Reset Encoder */
|
||||
@ -103,7 +103,7 @@ SKP_int SKP_Silk_SDK_InitEncoder(
|
||||
/**************************/
|
||||
/* Encode frame with Silk */
|
||||
/**************************/
|
||||
SKP_int SKP_Silk_SDK_Encode(
|
||||
SKP_int SKP_Silk_SDK_Encode(
|
||||
void *encState, /* I/O: State */
|
||||
const SKP_Silk_EncodeControlStruct *encControl, /* I: Control structure */
|
||||
const SKP_int16 *samplesIn, /* I: Speech sample input vector */
|
||||
@ -124,7 +124,7 @@ SKP_int SKP_Silk_SDK_Encode(
|
||||
if( ( ( encControl->API_sampleRate != 8000 ) &&
|
||||
( encControl->API_sampleRate != 12000 ) &&
|
||||
( encControl->API_sampleRate != 16000 ) &&
|
||||
( encControl->API_sampleRate != 24000 ) &&
|
||||
( encControl->API_sampleRate != 24000 ) &&
|
||||
( encControl->API_sampleRate != 32000 ) &&
|
||||
( encControl->API_sampleRate != 44100 ) &&
|
||||
( encControl->API_sampleRate != 48000 ) ) ||
|
||||
@ -161,7 +161,7 @@ SKP_int SKP_Silk_SDK_Encode(
|
||||
}
|
||||
|
||||
TargetRate_bps = SKP_LIMIT( TargetRate_bps, MIN_TARGET_RATE_BPS, MAX_TARGET_RATE_BPS );
|
||||
if( ( ret = SKP_Silk_control_encoder_FIX( psEnc, PacketSize_ms, TargetRate_bps,
|
||||
if( ( ret = SKP_Silk_control_encoder_FIX( psEnc, PacketSize_ms, TargetRate_bps,
|
||||
PacketLoss_perc, UseDTX, Complexity) ) != 0 ) {
|
||||
SKP_assert( 0 );
|
||||
return( ret );
|
||||
@ -176,8 +176,8 @@ SKP_int SKP_Silk_SDK_Encode(
|
||||
|
||||
#if MAX_FS_KHZ > 16
|
||||
/* Detect energy above 8 kHz */
|
||||
if( SKP_min( API_fs_Hz, 1000 * max_internal_fs_kHz ) == 24000 &&
|
||||
psEnc->sCmn.sSWBdetect.SWB_detected == 0 &&
|
||||
if( SKP_min( API_fs_Hz, 1000 * max_internal_fs_kHz ) == 24000 &&
|
||||
psEnc->sCmn.sSWBdetect.SWB_detected == 0 &&
|
||||
psEnc->sCmn.sSWBdetect.WB_detected == 0 ) {
|
||||
SKP_Silk_detect_SWB_input( &psEnc->sCmn.sSWBdetect, samplesIn, ( SKP_int )nSamplesIn );
|
||||
}
|
||||
@ -187,18 +187,18 @@ SKP_int SKP_Silk_SDK_Encode(
|
||||
MaxBytesOut = 0; /* return 0 output bytes if no encoder called */
|
||||
while( 1 ) {
|
||||
nSamplesToBuffer = psEnc->sCmn.frame_length - psEnc->sCmn.inputBufIx;
|
||||
if( API_fs_Hz == SKP_SMULBB( 1000, psEnc->sCmn.fs_kHz ) ) {
|
||||
if( API_fs_Hz == SKP_SMULBB( 1000, psEnc->sCmn.fs_kHz ) ) {
|
||||
nSamplesToBuffer = SKP_min_int( nSamplesToBuffer, nSamplesIn );
|
||||
nSamplesFromInput = nSamplesToBuffer;
|
||||
/* Copy to buffer */
|
||||
SKP_memcpy( &psEnc->sCmn.inputBuf[ psEnc->sCmn.inputBufIx ], samplesIn, nSamplesFromInput * sizeof( SKP_int16 ) );
|
||||
} else {
|
||||
} else {
|
||||
nSamplesToBuffer = SKP_min( nSamplesToBuffer, 10 * input_10ms * psEnc->sCmn.fs_kHz );
|
||||
nSamplesFromInput = SKP_DIV32_16( nSamplesToBuffer * API_fs_Hz, psEnc->sCmn.fs_kHz * 1000 );
|
||||
/* Resample and write to buffer */
|
||||
ret += SKP_Silk_resampler( &psEnc->sCmn.resampler_state,
|
||||
ret += SKP_Silk_resampler( &psEnc->sCmn.resampler_state,
|
||||
&psEnc->sCmn.inputBuf[ psEnc->sCmn.inputBufIx ], samplesIn, nSamplesFromInput );
|
||||
}
|
||||
}
|
||||
samplesIn += nSamplesFromInput;
|
||||
nSamplesIn -= nSamplesFromInput;
|
||||
psEnc->sCmn.inputBufIx += nSamplesToBuffer;
|
||||
@ -242,5 +242,3 @@ SKP_int SKP_Silk_SDK_Encode(
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -31,7 +31,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
/****************/
|
||||
/* Encode frame */
|
||||
/****************/
|
||||
SKP_int SKP_Silk_encode_frame_FIX(
|
||||
SKP_int SKP_Silk_encode_frame_FIX(
|
||||
SKP_Silk_encoder_state_FIX *psEnc, /* I/O Pointer to Silk FIX encoder state */
|
||||
SKP_uint8 *pCode, /* O Pointer to payload */
|
||||
SKP_int16 *pnBytesOut, /* I/O Pointer to number of payload bytes */
|
||||
@ -62,7 +62,7 @@ SKP_int SKP_Silk_encode_frame_FIX(
|
||||
/****************************/
|
||||
/* Voice Activity Detection */
|
||||
/****************************/
|
||||
ret = SKP_Silk_VAD_GetSA_Q8( &psEnc->sCmn.sVAD, &psEnc->speech_activity_Q8, &SNR_dB_Q7,
|
||||
ret = SKP_Silk_VAD_GetSA_Q8( &psEnc->sCmn.sVAD, &psEnc->speech_activity_Q8, &SNR_dB_Q7,
|
||||
sEncCtrl.input_quality_bands_Q15, &sEncCtrl.input_tilt_Q15,
|
||||
pIn,psEnc->sCmn.frame_length );
|
||||
|
||||
@ -82,7 +82,7 @@ SKP_int SKP_Silk_encode_frame_FIX(
|
||||
#else
|
||||
SKP_memcpy( x_frame + LA_SHAPE_MS * psEnc->sCmn.fs_kHz, pIn_HP,psEnc->sCmn.frame_length * sizeof( SKP_int16 ) );
|
||||
#endif
|
||||
|
||||
|
||||
/*****************************************/
|
||||
/* Find pitch lags, initial LPC analysis */
|
||||
/*****************************************/
|
||||
@ -107,8 +107,8 @@ SKP_int SKP_Silk_encode_frame_FIX(
|
||||
/* Process gains */
|
||||
/****************************************/
|
||||
SKP_Silk_process_gains_FIX( psEnc, &sEncCtrl );
|
||||
|
||||
|
||||
|
||||
|
||||
/****************************************/
|
||||
/* Low Bitrate Redundant Encoding */
|
||||
/****************************************/
|
||||
@ -120,15 +120,15 @@ SKP_int SKP_Silk_encode_frame_FIX(
|
||||
/*****************************************/
|
||||
if( psEnc->sCmn.nStatesDelayedDecision > 1 || psEnc->sCmn.warping_Q16 > 0 ) {
|
||||
SKP_Silk_NSQ_del_dec( &psEnc->sCmn, &sEncCtrl.sCmn, &psEnc->sNSQ, xfw,
|
||||
psEnc->sCmn.q, sEncCtrl.sCmn.NLSFInterpCoef_Q2,
|
||||
sEncCtrl.PredCoef_Q12[ 0 ], sEncCtrl.LTPCoef_Q14, sEncCtrl.AR2_Q13, sEncCtrl.HarmShapeGain_Q14,
|
||||
sEncCtrl.Tilt_Q14, sEncCtrl.LF_shp_Q14, sEncCtrl.Gains_Q16, sEncCtrl.Lambda_Q10,
|
||||
psEnc->sCmn.q, sEncCtrl.sCmn.NLSFInterpCoef_Q2,
|
||||
sEncCtrl.PredCoef_Q12[ 0 ], sEncCtrl.LTPCoef_Q14, sEncCtrl.AR2_Q13, sEncCtrl.HarmShapeGain_Q14,
|
||||
sEncCtrl.Tilt_Q14, sEncCtrl.LF_shp_Q14, sEncCtrl.Gains_Q16, sEncCtrl.Lambda_Q10,
|
||||
sEncCtrl.LTP_scale_Q14 );
|
||||
} else {
|
||||
SKP_Silk_NSQ( &psEnc->sCmn, &sEncCtrl.sCmn, &psEnc->sNSQ, xfw,
|
||||
psEnc->sCmn.q, sEncCtrl.sCmn.NLSFInterpCoef_Q2,
|
||||
sEncCtrl.PredCoef_Q12[ 0 ], sEncCtrl.LTPCoef_Q14, sEncCtrl.AR2_Q13, sEncCtrl.HarmShapeGain_Q14,
|
||||
sEncCtrl.Tilt_Q14, sEncCtrl.LF_shp_Q14, sEncCtrl.Gains_Q16, sEncCtrl.Lambda_Q10,
|
||||
SKP_Silk_NSQ( &psEnc->sCmn, &sEncCtrl.sCmn, &psEnc->sNSQ, xfw,
|
||||
psEnc->sCmn.q, sEncCtrl.sCmn.NLSFInterpCoef_Q2,
|
||||
sEncCtrl.PredCoef_Q12[ 0 ], sEncCtrl.LTPCoef_Q14, sEncCtrl.AR2_Q13, sEncCtrl.HarmShapeGain_Q14,
|
||||
sEncCtrl.Tilt_Q14, sEncCtrl.LF_shp_Q14, sEncCtrl.Gains_Q16, sEncCtrl.Lambda_Q10,
|
||||
sEncCtrl.LTP_scale_Q14 );
|
||||
}
|
||||
|
||||
@ -169,9 +169,9 @@ SKP_int SKP_Silk_encode_frame_FIX(
|
||||
/* Update Buffers and State */
|
||||
/****************************************/
|
||||
/* Update input buffer */
|
||||
SKP_memmove( psEnc->x_buf, &psEnc->x_buf[ psEnc->sCmn.frame_length ],
|
||||
SKP_memmove( psEnc->x_buf, &psEnc->x_buf[ psEnc->sCmn.frame_length ],
|
||||
( psEnc->sCmn.frame_length + LA_SHAPE_MS * psEnc->sCmn.fs_kHz ) * sizeof( SKP_int16 ) );
|
||||
|
||||
|
||||
/* Parameters needed for next frame */
|
||||
psEnc->sCmn.prev_sigtype = sEncCtrl.sCmn.sigtype;
|
||||
psEnc->sCmn.prevLag = sEncCtrl.sCmn.pitchL[ NB_SUBFR - 1];
|
||||
@ -211,8 +211,8 @@ SKP_int SKP_Silk_encode_frame_FIX(
|
||||
if( *pnBytesOut >= nBytes ) {
|
||||
SKP_Silk_range_enc_wrap_up( &psEnc->sCmn.sRC );
|
||||
SKP_memcpy( pCode, psEnc->sCmn.sRC.buffer, nBytes * sizeof( SKP_uint8 ) );
|
||||
|
||||
if( frame_terminator > SKP_SILK_MORE_FRAMES &&
|
||||
|
||||
if( frame_terminator > SKP_SILK_MORE_FRAMES &&
|
||||
*pnBytesOut >= nBytes + psEnc->sCmn.LBRR_buffer[ LBRR_idx ].nBytes ) {
|
||||
/* Get old packet and add to payload. */
|
||||
SKP_memcpy( &pCode[ nBytes ],
|
||||
@ -224,7 +224,7 @@ 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,
|
||||
SKP_memcpy( psEnc->sCmn.LBRR_buffer[ psEnc->sCmn.oldest_LBRR_idx ].payload, LBRRpayload,
|
||||
nBytesLBRR * sizeof( SKP_uint8 ) );
|
||||
psEnc->sCmn.LBRR_buffer[ psEnc->sCmn.oldest_LBRR_idx ].nBytes = nBytesLBRR;
|
||||
/* The line below describes how FEC should be used */
|
||||
@ -250,7 +250,7 @@ SKP_int SKP_Silk_encode_frame_FIX(
|
||||
|
||||
/* Payload length so far */
|
||||
SKP_Silk_range_coder_get_length( &psEnc->sCmn.sRC, &nBytes );
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* Check for arithmetic coder errors */
|
||||
@ -259,7 +259,7 @@ SKP_int SKP_Silk_encode_frame_FIX(
|
||||
}
|
||||
|
||||
/* Simulate number of ms buffered in channel because of exceeding TargetRate */
|
||||
SKP_assert( ( 8 * 1000 * ( (SKP_int64)nBytes - (SKP_int64)psEnc->sCmn.nBytesInPayloadBuf ) ) ==
|
||||
SKP_assert( ( 8 * 1000 * ( (SKP_int64)nBytes - (SKP_int64)psEnc->sCmn.nBytesInPayloadBuf ) ) ==
|
||||
SKP_SAT32( 8 * 1000 * ( (SKP_int64)nBytes - (SKP_int64)psEnc->sCmn.nBytesInPayloadBuf ) ) );
|
||||
SKP_assert( psEnc->sCmn.TargetRate_bps > 0 );
|
||||
psEnc->BufferedInChannel_ms += SKP_DIV32( 8 * 1000 * ( nBytes - psEnc->sCmn.nBytesInPayloadBuf ), psEnc->sCmn.TargetRate_bps );
|
||||
@ -268,7 +268,7 @@ SKP_int SKP_Silk_encode_frame_FIX(
|
||||
psEnc->sCmn.nBytesInPayloadBuf = nBytes;
|
||||
|
||||
if( psEnc->speech_activity_Q8 > SKP_FIX_CONST( WB_DETECT_ACTIVE_SPEECH_LEVEL_THRES, 8 ) ) {
|
||||
psEnc->sCmn.sSWBdetect.ActiveSpeech_ms = SKP_ADD_POS_SAT32( psEnc->sCmn.sSWBdetect.ActiveSpeech_ms, FRAME_LENGTH_MS );
|
||||
psEnc->sCmn.sSWBdetect.ActiveSpeech_ms = SKP_ADD_POS_SAT32( psEnc->sCmn.sSWBdetect.ActiveSpeech_ms, FRAME_LENGTH_MS );
|
||||
}
|
||||
|
||||
|
||||
@ -326,21 +326,21 @@ void SKP_Silk_LBRR_encode_FIX(
|
||||
}
|
||||
/* Decode to get gains in sync with decoder */
|
||||
/* Overwrite unquantized gains with quantized gains */
|
||||
SKP_Silk_gains_dequant( psEncCtrl->Gains_Q16, psEncCtrl->sCmn.GainsIndices,
|
||||
SKP_Silk_gains_dequant( psEncCtrl->Gains_Q16, psEncCtrl->sCmn.GainsIndices,
|
||||
&psEnc->sCmn.LBRRprevLastGainIndex, psEnc->sCmn.nFramesInPayloadBuf );
|
||||
|
||||
/*****************************************/
|
||||
/* Noise shaping quantization */
|
||||
/*****************************************/
|
||||
if( psEnc->sCmn.nStatesDelayedDecision > 1 || psEnc->sCmn.warping_Q16 > 0 ) {
|
||||
SKP_Silk_NSQ_del_dec( &psEnc->sCmn, &psEncCtrl->sCmn, &psEnc->sNSQ_LBRR, xfw, psEnc->sCmn.q_LBRR,
|
||||
psEncCtrl->sCmn.NLSFInterpCoef_Q2, psEncCtrl->PredCoef_Q12[ 0 ], psEncCtrl->LTPCoef_Q14,
|
||||
psEncCtrl->AR2_Q13, psEncCtrl->HarmShapeGain_Q14, psEncCtrl->Tilt_Q14, psEncCtrl->LF_shp_Q14,
|
||||
SKP_Silk_NSQ_del_dec( &psEnc->sCmn, &psEncCtrl->sCmn, &psEnc->sNSQ_LBRR, xfw, psEnc->sCmn.q_LBRR,
|
||||
psEncCtrl->sCmn.NLSFInterpCoef_Q2, psEncCtrl->PredCoef_Q12[ 0 ], psEncCtrl->LTPCoef_Q14,
|
||||
psEncCtrl->AR2_Q13, psEncCtrl->HarmShapeGain_Q14, psEncCtrl->Tilt_Q14, psEncCtrl->LF_shp_Q14,
|
||||
psEncCtrl->Gains_Q16, psEncCtrl->Lambda_Q10, psEncCtrl->LTP_scale_Q14 );
|
||||
} else {
|
||||
SKP_Silk_NSQ( &psEnc->sCmn, &psEncCtrl->sCmn, &psEnc->sNSQ_LBRR, xfw, psEnc->sCmn.q_LBRR,
|
||||
psEncCtrl->sCmn.NLSFInterpCoef_Q2, psEncCtrl->PredCoef_Q12[ 0 ], psEncCtrl->LTPCoef_Q14,
|
||||
psEncCtrl->AR2_Q13, psEncCtrl->HarmShapeGain_Q14, psEncCtrl->Tilt_Q14, psEncCtrl->LF_shp_Q14,
|
||||
SKP_Silk_NSQ( &psEnc->sCmn, &psEncCtrl->sCmn, &psEnc->sNSQ_LBRR, xfw, psEnc->sCmn.q_LBRR,
|
||||
psEncCtrl->sCmn.NLSFInterpCoef_Q2, psEncCtrl->PredCoef_Q12[ 0 ], psEncCtrl->LTPCoef_Q14,
|
||||
psEncCtrl->AR2_Q13, psEncCtrl->HarmShapeGain_Q14, psEncCtrl->Tilt_Q14, psEncCtrl->LF_shp_Q14,
|
||||
psEncCtrl->Gains_Q16, psEncCtrl->Lambda_Q10, psEncCtrl->LTP_scale_Q14 );
|
||||
}
|
||||
} else {
|
||||
@ -358,7 +358,7 @@ void SKP_Silk_LBRR_encode_FIX(
|
||||
/****************************************/
|
||||
/* Encode Parameters */
|
||||
/****************************************/
|
||||
SKP_Silk_encode_parameters( &psEnc->sCmn, &psEncCtrl->sCmn,
|
||||
SKP_Silk_encode_parameters( &psEnc->sCmn, &psEncCtrl->sCmn,
|
||||
&psEnc->sCmn.sRC_LBRR, psEnc->sCmn.q_LBRR );
|
||||
|
||||
if( psEnc->sCmn.sRC_LBRR.error ) {
|
||||
@ -405,7 +405,7 @@ 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 */
|
||||
psEncCtrl->sCmn.LTP_scaleIndex = LTP_scaleIndex;
|
||||
psEnc->sCmn.typeOffsetPrev = typeOffset;
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -36,7 +36,7 @@ SKP_INLINE SKP_int combine_and_check( /* return ok */
|
||||
const SKP_int *pulses_in, /* I */
|
||||
SKP_int max_pulses, /* I max value for sum of pulses */
|
||||
SKP_int len /* I number of output values */
|
||||
)
|
||||
)
|
||||
{
|
||||
SKP_int k, sum;
|
||||
|
||||
@ -78,7 +78,7 @@ void SKP_Silk_encode_pulses(
|
||||
/****************************/
|
||||
/* Calculate number of shell blocks */
|
||||
iter = frame_length / SHELL_CODEC_FRAME_LENGTH;
|
||||
|
||||
|
||||
/* Take the absolute value of the pulses */
|
||||
for( i = 0; i < frame_length; i+=4 ) {
|
||||
abs_pulses[i+0] = ( SKP_int )SKP_abs( q[ i + 0 ] );
|
||||
@ -110,7 +110,7 @@ void SKP_Silk_encode_pulses(
|
||||
|
||||
if( scale_down ) {
|
||||
/* We need to down scale the quantization signal */
|
||||
nRshifts[ i ]++;
|
||||
nRshifts[ i ]++;
|
||||
for( k = 0; k < SHELL_CODEC_FRAME_LENGTH; k++ ) {
|
||||
abs_pulses_ptr[ k ] = SKP_RSHIFT( abs_pulses_ptr[ k ], 1 );
|
||||
}
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -44,7 +44,7 @@ void SKP_Silk_find_LPC_FIX(
|
||||
SKP_int isInterpLower, shift;
|
||||
SKP_int16 S[ MAX_LPC_ORDER ];
|
||||
SKP_int32 res_nrg0, res_nrg1;
|
||||
SKP_int rshift0, rshift1;
|
||||
SKP_int rshift0, rshift1;
|
||||
|
||||
/* Used only for LSF interpolation */
|
||||
SKP_int32 a_tmp_Q16[ MAX_LPC_ORDER ], res_nrg_interp, res_nrg, res_tmp_nrg, res_nrg_2nd;
|
||||
@ -64,7 +64,7 @@ void SKP_Silk_find_LPC_FIX(
|
||||
if( useInterpolatedNLSFs == 1 ) {
|
||||
|
||||
/* Optimal solution for last 10 ms */
|
||||
SKP_Silk_burg_modified( &res_tmp_nrg, &res_tmp_nrg_Q, a_tmp_Q16, x + ( NB_SUBFR >> 1 ) * subfr_length,
|
||||
SKP_Silk_burg_modified( &res_tmp_nrg, &res_tmp_nrg_Q, a_tmp_Q16, x + ( NB_SUBFR >> 1 ) * subfr_length,
|
||||
subfr_length, ( NB_SUBFR >> 1 ), SKP_FIX_CONST( FIND_LPC_COND_FAC, 32 ), LPC_order );
|
||||
|
||||
SKP_Silk_bwexpander_32( a_tmp_Q16, LPC_order, SKP_FIX_CONST( FIND_LPC_CHIRP, 16 ) );
|
||||
@ -73,15 +73,15 @@ void SKP_Silk_find_LPC_FIX(
|
||||
/* residual energy of the first 10 ms in each iteration of the search below */
|
||||
shift = res_tmp_nrg_Q - res_nrg_Q;
|
||||
if( shift >= 0 ) {
|
||||
if( shift < 32 ) {
|
||||
if( shift < 32 ) {
|
||||
res_nrg = res_nrg - SKP_RSHIFT( res_tmp_nrg, shift );
|
||||
}
|
||||
} else {
|
||||
SKP_assert( shift > -32 );
|
||||
SKP_assert( shift > -32 );
|
||||
res_nrg = SKP_RSHIFT( res_nrg, -shift ) - res_tmp_nrg;
|
||||
res_nrg_Q = res_tmp_nrg_Q;
|
||||
res_nrg_Q = res_tmp_nrg_Q;
|
||||
}
|
||||
|
||||
|
||||
/* Convert to NLSFs */
|
||||
SKP_Silk_A2NLSF( NLSF_Q15, a_tmp_Q16, LPC_order );
|
||||
|
||||
@ -121,7 +121,7 @@ void SKP_Silk_find_LPC_FIX(
|
||||
isInterpLower = SKP_FALSE;
|
||||
}
|
||||
} else {
|
||||
if( -shift < 32 ) {
|
||||
if( -shift < 32 ) {
|
||||
if( res_nrg_interp < SKP_RSHIFT( res_nrg, -shift ) ) {
|
||||
isInterpLower = SKP_TRUE;
|
||||
} else {
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -64,7 +64,7 @@ void SKP_Silk_find_LTP_FIX(
|
||||
SKP_int32 LPC_res_nrg, LPC_LTP_res_nrg, div_Q16;
|
||||
SKP_int32 Rr[ LTP_ORDER ], rr[ NB_SUBFR ];
|
||||
SKP_int32 wd, m_Q12;
|
||||
|
||||
|
||||
b_Q14_ptr = b_Q14;
|
||||
WLTP_ptr = WLTP;
|
||||
r_ptr = &r_first[ mem_offset ];
|
||||
@ -114,7 +114,7 @@ void SKP_Silk_find_LTP_FIX(
|
||||
SKP_assert( ((SKP_int64)Wght_Q15[ k ] << 16 ) < SKP_int32_MAX ); /* Wght always < 0.5 in Q0 */
|
||||
temp32 = SKP_DIV32( SKP_LSHIFT( ( SKP_int32 )Wght_Q15[ k ], 16 ), denom32 ); /* Q( 15 + 16 + corr_rshifts[k] - extra_shifts ) */
|
||||
temp32 = SKP_RSHIFT( temp32, 31 + corr_rshifts[ k ] - extra_shifts - 26 ); /* Q26 */
|
||||
|
||||
|
||||
/* Limit temp such that the below scaling never wraps around */
|
||||
WLTP_max = 0;
|
||||
for( i = 0; i < LTP_ORDER * LTP_ORDER; i++ ) {
|
||||
@ -127,7 +127,7 @@ void SKP_Silk_find_LTP_FIX(
|
||||
}
|
||||
|
||||
SKP_Silk_scale_vector32_Q26_lshift_18( WLTP_ptr, temp32, LTP_ORDER * LTP_ORDER ); /* WLTP_ptr in Q( 18 - corr_rshifts[ k ] ) */
|
||||
|
||||
|
||||
w[ k ] = matrix_ptr( WLTP_ptr, ( LTP_ORDER >> 1 ), ( LTP_ORDER >> 1 ), LTP_ORDER ); /* w in Q( 18 - corr_rshifts[ k ] ) */
|
||||
SKP_assert( w[k] >= 0 );
|
||||
|
||||
@ -170,7 +170,7 @@ void SKP_Silk_find_LTP_FIX(
|
||||
}
|
||||
|
||||
/* m = ( w * d' ) / ( sum( w ) + 1e-3 ); */
|
||||
|
||||
|
||||
/* Find maximum absolute value of d_Q14 and the bits used by w in Q0 */
|
||||
max_abs_d_Q14 = 0;
|
||||
max_w_bits = 0;
|
||||
@ -178,7 +178,7 @@ void SKP_Silk_find_LTP_FIX(
|
||||
max_abs_d_Q14 = SKP_max_32( max_abs_d_Q14, SKP_abs( d_Q14[ k ] ) );
|
||||
/* w[ k ] is in Q( 18 - corr_rshifts[ k ] ) */
|
||||
/* Find bits needed in Q( 18 - maxRshifts ) */
|
||||
max_w_bits = SKP_max_32( max_w_bits, 32 - SKP_Silk_CLZ32( w[ k ] ) + corr_rshifts[ k ] - maxRshifts );
|
||||
max_w_bits = SKP_max_32( max_w_bits, 32 - SKP_Silk_CLZ32( w[ k ] ) + corr_rshifts[ k ] - maxRshifts );
|
||||
}
|
||||
|
||||
/* max_abs_d_Q14 = (5 << 15); worst case, i.e. LTP_ORDER * -SKP_int16_MIN */
|
||||
@ -186,13 +186,13 @@ void SKP_Silk_find_LTP_FIX(
|
||||
|
||||
/* How many bits is needed for w*d' in Q( 18 - maxRshifts ) in the worst case, of all d_Q14's being equal to max_abs_d_Q14 */
|
||||
extra_shifts = max_w_bits + 32 - SKP_Silk_CLZ32( max_abs_d_Q14 ) - 14;
|
||||
|
||||
|
||||
/* Subtract what we got available; bits in output var plus maxRshifts */
|
||||
extra_shifts -= ( 32 - 1 - 2 + maxRshifts ); /* Keep sign bit free as well as 2 bits for accumulation */
|
||||
extra_shifts = SKP_max_int( extra_shifts, 0 );
|
||||
|
||||
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++ ) {
|
||||
@ -211,10 +211,10 @@ void SKP_Silk_find_LTP_FIX(
|
||||
temp32 = SKP_LSHIFT_SAT32( w[ k ], corr_rshifts[ k ] - 2 );
|
||||
}
|
||||
|
||||
g_Q26 = SKP_MUL(
|
||||
SKP_DIV32(
|
||||
SKP_FIX_CONST( LTP_SMOOTHING, 26 ),
|
||||
SKP_RSHIFT( SKP_FIX_CONST( LTP_SMOOTHING, 26 ), 10 ) + temp32 ), /* Q10 */
|
||||
g_Q26 = SKP_MUL(
|
||||
SKP_DIV32(
|
||||
SKP_FIX_CONST( LTP_SMOOTHING, 26 ),
|
||||
SKP_RSHIFT( SKP_FIX_CONST( LTP_SMOOTHING, 26 ), 10 ) + temp32 ), /* Q10 */
|
||||
SKP_LSHIFT_SAT32( SKP_SUB_SAT32( ( SKP_int32 )m_Q12, SKP_RSHIFT( d_Q14[ k ], 2 ) ), 4 ) ); /* Q16 */
|
||||
|
||||
temp32 = 0;
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -60,9 +60,9 @@ void SKP_Silk_find_pitch_lags_FIX(
|
||||
/*************************************/
|
||||
/* Estimate LPC AR coefficients */
|
||||
/*************************************/
|
||||
|
||||
|
||||
/* Calculate windowed signal */
|
||||
|
||||
|
||||
/* First LA_LTP samples */
|
||||
x_buf_ptr = x_buf + buf_len - psPredSt->pitch_LPC_win_length;
|
||||
Wsig_ptr = Wsig;
|
||||
@ -79,8 +79,8 @@ void SKP_Silk_find_pitch_lags_FIX(
|
||||
SKP_Silk_apply_sine_window_new( Wsig_ptr, x_buf_ptr, 2, psEnc->sCmn.la_pitch );
|
||||
|
||||
/* Calculate autocorrelation sequence */
|
||||
SKP_Silk_autocorr( auto_corr, &scale, Wsig, psPredSt->pitch_LPC_win_length, psEnc->sCmn.pitchEstimationLPCOrder + 1 );
|
||||
|
||||
SKP_Silk_autocorr( auto_corr, &scale, Wsig, psPredSt->pitch_LPC_win_length, psEnc->sCmn.pitchEstimationLPCOrder + 1 );
|
||||
|
||||
/* Add white noise, as fraction of energy */
|
||||
auto_corr[ 0 ] = SKP_SMLAWB( auto_corr[ 0 ], auto_corr[ 0 ], SKP_FIX_CONST( FIND_PITCH_WHITE_NOISE_FRACTION, 16 ) );
|
||||
|
||||
@ -92,7 +92,7 @@ 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 ) );
|
||||
@ -100,7 +100,7 @@ void SKP_Silk_find_pitch_lags_FIX(
|
||||
|
||||
/* Do BWE */
|
||||
SKP_Silk_bwexpander( A_Q12, psEnc->sCmn.pitchEstimationLPCOrder, SKP_FIX_CONST( FIND_PITCH_BANDWITH_EXPANSION, 16 ) );
|
||||
|
||||
|
||||
/*****************************************/
|
||||
/* LPC analysis filtering */
|
||||
/*****************************************/
|
||||
@ -119,7 +119,7 @@ void SKP_Silk_find_pitch_lags_FIX(
|
||||
/*****************************************/
|
||||
/* Call pitch estimator */
|
||||
/*****************************************/
|
||||
psEncCtrl->sCmn.sigtype = SKP_Silk_pitch_analysis_core( res, psEncCtrl->sCmn.pitchL, &psEncCtrl->sCmn.lagIndex,
|
||||
&psEncCtrl->sCmn.contourIndex, &psEnc->LTPCorr_Q15, psEnc->sCmn.prevLag, psEnc->sCmn.pitchEstimationThreshold_Q16,
|
||||
psEncCtrl->sCmn.sigtype = SKP_Silk_pitch_analysis_core( res, psEncCtrl->sCmn.pitchL, &psEncCtrl->sCmn.lagIndex,
|
||||
&psEncCtrl->sCmn.contourIndex, &psEnc->LTPCorr_Q15, psEnc->sCmn.prevLag, psEnc->sCmn.pitchEstimationThreshold_Q16,
|
||||
( SKP_int16 )thrhld_Q15, psEnc->sCmn.fs_kHz, psEnc->sCmn.pitchEstimationComplexity, SKP_FALSE );
|
||||
}
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -56,8 +56,8 @@ void SKP_Silk_find_pred_coefs_FIX(
|
||||
invGains_Q16[ i ] = SKP_DIV32_varQ( min_gain_Q16, psEncCtrl->Gains_Q16[ i ], 16 - 2 );
|
||||
|
||||
/* Ensure Wght_Q15 a minimum value 1 */
|
||||
invGains_Q16[ i ] = SKP_max( invGains_Q16[ i ], 363 );
|
||||
|
||||
invGains_Q16[ i ] = SKP_max( invGains_Q16[ i ], 363 );
|
||||
|
||||
/* Square the inverted gains */
|
||||
SKP_assert( invGains_Q16[ i ] == SKP_SAT16( invGains_Q16[ i ] ) );
|
||||
tmp = SKP_SMULWB( invGains_Q16[ i ], invGains_Q16[ i ] );
|
||||
@ -74,20 +74,20 @@ void SKP_Silk_find_pred_coefs_FIX(
|
||||
SKP_assert( psEnc->sCmn.frame_length - psEnc->sCmn.predictLPCOrder >= psEncCtrl->sCmn.pitchL[ 0 ] + LTP_ORDER / 2 );
|
||||
|
||||
/* LTP analysis */
|
||||
SKP_Silk_find_LTP_FIX( psEncCtrl->LTPCoef_Q14, WLTP, &psEncCtrl->LTPredCodGain_Q7, res_pitch,
|
||||
res_pitch + SKP_RSHIFT( psEnc->sCmn.frame_length, 1 ), psEncCtrl->sCmn.pitchL, Wght_Q15,
|
||||
SKP_Silk_find_LTP_FIX( psEncCtrl->LTPCoef_Q14, WLTP, &psEncCtrl->LTPredCodGain_Q7, res_pitch,
|
||||
res_pitch + SKP_RSHIFT( psEnc->sCmn.frame_length, 1 ), psEncCtrl->sCmn.pitchL, Wght_Q15,
|
||||
psEnc->sCmn.subfr_length, psEnc->sCmn.frame_length, LTP_corrs_rshift );
|
||||
|
||||
|
||||
/* Quantize LTP gain parameters */
|
||||
SKP_Silk_quant_LTP_gains_FIX( psEncCtrl->LTPCoef_Q14, psEncCtrl->sCmn.LTPIndex, &psEncCtrl->sCmn.PERIndex,
|
||||
SKP_Silk_quant_LTP_gains_FIX( psEncCtrl->LTPCoef_Q14, psEncCtrl->sCmn.LTPIndex, &psEncCtrl->sCmn.PERIndex,
|
||||
WLTP, psEnc->mu_LTP_Q8, psEnc->sCmn.LTPQuantLowComplexity );
|
||||
|
||||
/* Control LTP scaling */
|
||||
SKP_Silk_LTP_scale_ctrl_FIX( psEnc, psEncCtrl );
|
||||
|
||||
/* Create LTP residual */
|
||||
SKP_Silk_LTP_analysis_filter_FIX( LPC_in_pre, psEnc->x_buf + psEnc->sCmn.frame_length - psEnc->sCmn.predictLPCOrder,
|
||||
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, psEnc->sCmn.subfr_length, psEnc->sCmn.predictLPCOrder );
|
||||
|
||||
} else {
|
||||
@ -98,7 +98,7 @@ void SKP_Silk_find_pred_coefs_FIX(
|
||||
x_ptr = psEnc->x_buf + psEnc->sCmn.frame_length - psEnc->sCmn.predictLPCOrder;
|
||||
x_pre_ptr = LPC_in_pre;
|
||||
for( i = 0; i < NB_SUBFR; i++ ) {
|
||||
SKP_Silk_scale_copy_vector16( x_pre_ptr, x_ptr, invGains_Q16[ i ],
|
||||
SKP_Silk_scale_copy_vector16( x_pre_ptr, x_ptr, invGains_Q16[ i ],
|
||||
psEnc->sCmn.subfr_length + psEnc->sCmn.predictLPCOrder );
|
||||
x_pre_ptr += psEnc->sCmn.subfr_length + psEnc->sCmn.predictLPCOrder;
|
||||
x_ptr += psEnc->sCmn.subfr_length;
|
||||
@ -110,8 +110,8 @@ void SKP_Silk_find_pred_coefs_FIX(
|
||||
|
||||
/* LPC_in_pre contains the LTP-filtered input for voiced, and the unfiltered input for unvoiced */
|
||||
TIC(FIND_LPC)
|
||||
SKP_Silk_find_LPC_FIX( NLSF_Q15, &psEncCtrl->sCmn.NLSFInterpCoef_Q2, psEnc->sPred.prev_NLSFq_Q15,
|
||||
psEnc->sCmn.useInterpolatedNLSFs * ( 1 - psEnc->sCmn.first_frame_after_reset ), psEnc->sCmn.predictLPCOrder,
|
||||
SKP_Silk_find_LPC_FIX( NLSF_Q15, &psEncCtrl->sCmn.NLSFInterpCoef_Q2, psEnc->sPred.prev_NLSFq_Q15,
|
||||
psEnc->sCmn.useInterpolatedNLSFs * ( 1 - psEnc->sCmn.first_frame_after_reset ), psEnc->sCmn.predictLPCOrder,
|
||||
LPC_in_pre, psEnc->sCmn.subfr_length + psEnc->sCmn.predictLPCOrder );
|
||||
TOC(FIND_LPC)
|
||||
|
||||
@ -129,4 +129,3 @@ void SKP_Silk_find_pred_coefs_FIX(
|
||||
SKP_memcpy( psEnc->sPred.prev_NLSFq_Q15, NLSF_Q15, psEnc->sCmn.predictLPCOrder * sizeof( SKP_int ) );
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -46,7 +46,7 @@ SKP_int32 SKP_Silk_inner_prod_aligned(
|
||||
const SKP_int len /* I vector lengths */
|
||||
)
|
||||
{
|
||||
SKP_int i;
|
||||
SKP_int i;
|
||||
SKP_int32 sum = 0;
|
||||
for( i = 0; i < len; i++ ) {
|
||||
sum = SKP_SMLABB( sum, inVec1[ i ], inVec2[ i ] );
|
||||
@ -55,12 +55,12 @@ SKP_int32 SKP_Silk_inner_prod_aligned(
|
||||
}
|
||||
|
||||
SKP_int64 SKP_Silk_inner_prod16_aligned_64(
|
||||
const SKP_int16 *inVec1, /* I input vector 1 */
|
||||
const SKP_int16 *inVec1, /* I input vector 1 */
|
||||
const SKP_int16 *inVec2, /* I input vector 2 */
|
||||
const SKP_int len /* I vector lengths */
|
||||
)
|
||||
{
|
||||
SKP_int i;
|
||||
SKP_int i;
|
||||
SKP_int64 sum = 0;
|
||||
for( i = 0; i < len; i++ ) {
|
||||
sum = SKP_SMLALBB( sum, inVec1[ i ], inVec2[ i ] );
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -36,7 +36,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* */
|
||||
#include "SKP_Silk_SigProc_FIX.h"
|
||||
/* Approximation of 128 * log2() (very close inverse of approx 2^() below) */
|
||||
/* Convert input to a log scale */
|
||||
/* Convert input to a log scale */
|
||||
SKP_int32 SKP_Silk_lin2log( const SKP_int32 inLin ) /* I: Input in linear scale */
|
||||
{
|
||||
SKP_int32 lz, frac_Q7;
|
||||
@ -46,4 +46,3 @@ SKP_int32 SKP_Silk_lin2log( const SKP_int32 inLin ) /* I: Input in linear
|
||||
/* Piece-wise parabolic approximation */
|
||||
return( SKP_LSHIFT( 31 - lz, 7 ) + SKP_SMLAWB( frac_Q7, SKP_MUL( frac_Q7, 128 - frac_Q7 ), 179 ) );
|
||||
}
|
||||
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -36,8 +36,8 @@ 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 */
|
||||
/* Convert input to a linear scale */
|
||||
SKP_int32 SKP_Silk_log2lin( const SKP_int32 inLog_Q7 ) /* I: Input on log scale */
|
||||
{
|
||||
SKP_int32 out, frac_Q7;
|
||||
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -71,7 +71,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#define SKP_SUB_SAT32(a, b) ((((a)-(b)) & 0x80000000) == 0 ? \
|
||||
(( (a) & ((b)^0x80000000) & 0x80000000) ? SKP_int32_MIN : (a)-(b)) : \
|
||||
((((a)^0x80000000) & (b) & 0x80000000) ? SKP_int32_MAX : (a)-(b)) )
|
||||
|
||||
|
||||
SKP_INLINE SKP_int32 SKP_Silk_CLZ16(SKP_int16 in16)
|
||||
{
|
||||
SKP_int32 out32 = 0;
|
||||
@ -119,4 +119,3 @@ SKP_INLINE SKP_int32 SKP_Silk_CLZ32(SKP_int32 in32)
|
||||
}
|
||||
|
||||
#endif //_SKP_SILK_API_C_H_
|
||||
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -101,7 +101,7 @@ void SKP_Silk_range_encoder(
|
||||
const SKP_int data, /* I uncompressed data */
|
||||
const SKP_uint16 prob[] /* I cumulative density functions */
|
||||
);
|
||||
|
||||
|
||||
/* Range encoder for multiple symbols */
|
||||
void SKP_Silk_range_encoder_multi(
|
||||
SKP_Silk_range_coder_state *psRC, /* I/O compressor data structure */
|
||||
@ -173,7 +173,7 @@ void SKP_Silk_gains_dequant(
|
||||
|
||||
/* Convert NLSF parameters to stable AR prediction filter coefficients */
|
||||
void SKP_Silk_NLSF2A_stable(
|
||||
SKP_int16 pAR_Q12[ MAX_LPC_ORDER ], /* O Stabilized AR coefs [LPC_order] */
|
||||
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 */
|
||||
);
|
||||
@ -231,14 +231,14 @@ void SKP_Silk_NSQ_del_dec(
|
||||
/* Silk VAD */
|
||||
/************/
|
||||
/* Initialize the Silk VAD */
|
||||
SKP_int SKP_Silk_VAD_Init( /* O Return value, 0 if success */
|
||||
SKP_Silk_VAD_state *psSilk_VAD /* I/O Pointer to Silk VAD state */
|
||||
);
|
||||
SKP_int SKP_Silk_VAD_Init( /* O Return value, 0 if success */
|
||||
SKP_Silk_VAD_state *psSilk_VAD /* I/O Pointer to Silk VAD state */
|
||||
);
|
||||
|
||||
/* Silk VAD noise level estimation */
|
||||
void SKP_Silk_VAD_GetNoiseLevels(
|
||||
const SKP_int32 pX[ VAD_N_BANDS ], /* I subband energies */
|
||||
SKP_Silk_VAD_state *psSilk_VAD /* I/O Pointer to Silk VAD state */
|
||||
SKP_Silk_VAD_state *psSilk_VAD /* I/O Pointer to Silk VAD state */
|
||||
);
|
||||
|
||||
/* Get speech activity level in Q8 */
|
||||
@ -375,7 +375,7 @@ void SKP_Silk_get_low_layer_internal(
|
||||
);
|
||||
|
||||
/* Resets LBRR buffer, used if packet size changes */
|
||||
void SKP_Silk_LBRR_reset(
|
||||
void SKP_Silk_LBRR_reset(
|
||||
SKP_Silk_encoder_state *psEncC /* I/O Pointer to Silk encoder state */
|
||||
);
|
||||
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -53,7 +53,7 @@ SKP_int SKP_Silk_init_encoder_FIX(
|
||||
);
|
||||
|
||||
/* Control the Silk encoder */
|
||||
SKP_int SKP_Silk_control_encoder_FIX(
|
||||
SKP_int SKP_Silk_control_encoder_FIX(
|
||||
SKP_Silk_encoder_state_FIX *psEnc, /* I/O Pointer to Silk encoder state */
|
||||
const SKP_int PacketSize_ms, /* I Packet length (ms) */
|
||||
const SKP_int32 TargetRate_bps, /* I Target max bitrate (bps) */
|
||||
@ -63,7 +63,7 @@ SKP_int SKP_Silk_control_encoder_FIX(
|
||||
);
|
||||
|
||||
/* Encoder main function */
|
||||
SKP_int SKP_Silk_encode_frame_FIX(
|
||||
SKP_int SKP_Silk_encode_frame_FIX(
|
||||
SKP_Silk_encoder_state_FIX *psEnc, /* I/O Pointer to Silk FIX encoder state */
|
||||
SKP_uint8 *pCode, /* O Pointer to payload */
|
||||
SKP_int16 *pnBytesOut, /* I/O Pointer to number of payload bytes; */
|
||||
@ -202,7 +202,7 @@ void SKP_Silk_quant_LTP_gains_FIX(
|
||||
/* NLSF Quantizer */
|
||||
/******************/
|
||||
|
||||
/* Limit, stabilize, convert and quantize NLSFs. */
|
||||
/* Limit, stabilize, convert and quantize NLSFs. */
|
||||
void SKP_Silk_process_NLSFs_FIX(
|
||||
SKP_Silk_encoder_state_FIX *psEnc, /* I/O encoder state */
|
||||
SKP_Silk_encoder_control_FIX *psEncCtrl, /* I/O encoder control */
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -31,9 +31,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
/* Compute gain to make warped filter coefficients have a zero mean log frequency response on a */
|
||||
/* non-warped frequency scale. (So that it can be implemented with a minimum-phase monic filter.) */
|
||||
SKP_INLINE SKP_int32 warped_gain( // gain in Q16
|
||||
const SKP_int32 *coefs_Q24,
|
||||
SKP_int lambda_Q16,
|
||||
SKP_int order
|
||||
const SKP_int32 *coefs_Q24,
|
||||
SKP_int lambda_Q16,
|
||||
SKP_int order
|
||||
) {
|
||||
SKP_int i;
|
||||
SKP_int32 gain_Q24;
|
||||
@ -49,7 +49,7 @@ SKP_INLINE SKP_int32 warped_gain( // gain in Q16
|
||||
|
||||
/* Convert warped filter coefficients to monic pseudo-warped coefficients and limit maximum */
|
||||
/* amplitude of monic warped coefficients by using bandwidth expansion on the true coefficients */
|
||||
SKP_INLINE void limit_warped_coefs(
|
||||
SKP_INLINE void limit_warped_coefs(
|
||||
SKP_int32 *coefs_syn_Q24,
|
||||
SKP_int32 *coefs_ana_Q24,
|
||||
SKP_int lambda_Q16,
|
||||
@ -106,7 +106,7 @@ SKP_INLINE void limit_warped_coefs(
|
||||
|
||||
/* Apply bandwidth expansion */
|
||||
chirp_Q16 = SKP_FIX_CONST( 0.99, 16 ) - SKP_DIV32_varQ(
|
||||
SKP_SMULWB( maxabs_Q24 - limit_Q24, SKP_SMLABB( SKP_FIX_CONST( 0.8, 10 ), SKP_FIX_CONST( 0.1, 10 ), iter ) ),
|
||||
SKP_SMULWB( maxabs_Q24 - limit_Q24, SKP_SMLABB( SKP_FIX_CONST( 0.8, 10 ), SKP_FIX_CONST( 0.1, 10 ), iter ) ),
|
||||
SKP_MUL( maxabs_Q24, ind + 1 ), 22 );
|
||||
SKP_Silk_bwexpander_32( coefs_syn_Q24, order, chirp_Q16 );
|
||||
SKP_Silk_bwexpander_32( coefs_ana_Q24, order, chirp_Q16 );
|
||||
@ -162,7 +162,7 @@ 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 ),
|
||||
psEncCtrl->current_SNR_dB_Q7 = psEnc->SNR_dB_Q7 - SKP_SMULWB( SKP_LSHIFT( ( SKP_int32 )psEnc->BufferedInChannel_ms, 7 ),
|
||||
SKP_FIX_CONST( 0.05, 16 ) );
|
||||
|
||||
/* Reduce SNR_dB if inband FEC used */
|
||||
@ -174,11 +174,11 @@ void SKP_Silk_noise_shape_analysis_FIX(
|
||||
/* GAIN CONTROL */
|
||||
/****************/
|
||||
/* Input quality is the average of the quality in the lowest two VAD bands */
|
||||
psEncCtrl->input_quality_Q14 = ( SKP_int )SKP_RSHIFT( ( SKP_int32 )psEncCtrl->input_quality_bands_Q15[ 0 ]
|
||||
psEncCtrl->input_quality_Q14 = ( SKP_int )SKP_RSHIFT( ( SKP_int32 )psEncCtrl->input_quality_bands_Q15[ 0 ]
|
||||
+ psEncCtrl->input_quality_bands_Q15[ 1 ], 2 );
|
||||
|
||||
/* Coding quality level, between 0.0_Q0 and 1.0_Q0, but in Q14 */
|
||||
psEncCtrl->coding_quality_Q14 = SKP_RSHIFT( SKP_Silk_sigm_Q15( SKP_RSHIFT_ROUND( psEncCtrl->current_SNR_dB_Q7 -
|
||||
psEncCtrl->coding_quality_Q14 = SKP_RSHIFT( SKP_Silk_sigm_Q15( SKP_RSHIFT_ROUND( psEncCtrl->current_SNR_dB_Q7 -
|
||||
SKP_FIX_CONST( 18.0, 7 ), 4 ) ), 1 );
|
||||
|
||||
/* Reduce coding SNR during low speech activity */
|
||||
@ -191,9 +191,9 @@ void SKP_Silk_noise_shape_analysis_FIX(
|
||||
if( psEncCtrl->sCmn.sigtype == SIG_TYPE_VOICED ) {
|
||||
/* Reduce gains for periodic signals */
|
||||
SNR_adj_dB_Q7 = SKP_SMLAWB( SNR_adj_dB_Q7, SKP_FIX_CONST( HARM_SNR_INCR_dB, 8 ), psEnc->LTPCorr_Q15 );
|
||||
} else {
|
||||
} else {
|
||||
/* For unvoiced signals and low-quality input, adjust the quality slower than SNR_dB setting */
|
||||
SNR_adj_dB_Q7 = SKP_SMLAWB( SNR_adj_dB_Q7,
|
||||
SNR_adj_dB_Q7 = SKP_SMLAWB( SNR_adj_dB_Q7,
|
||||
SKP_SMLAWB( SKP_FIX_CONST( 6.0, 9 ), -SKP_FIX_CONST( 0.4, 18 ), psEncCtrl->current_SNR_dB_Q7 ),
|
||||
SKP_FIX_CONST( 1.0, 14 ) - psEncCtrl->input_quality_Q14 );
|
||||
}
|
||||
@ -212,10 +212,10 @@ void SKP_Silk_noise_shape_analysis_FIX(
|
||||
energy_variation_Q7 = 0;
|
||||
log_energy_prev_Q7 = 0;
|
||||
pitch_res_ptr = pitch_res;
|
||||
for( k = 0; k < FRAME_LENGTH_MS / 2; k++ ) {
|
||||
for( k = 0; k < FRAME_LENGTH_MS / 2; k++ ) {
|
||||
SKP_Silk_sum_sqr_shift( &nrg, &scale, pitch_res_ptr, nSamples );
|
||||
nrg += SKP_RSHIFT( nSamples, scale ); // Q(-scale)
|
||||
|
||||
|
||||
log_energy_Q7 = SKP_Silk_lin2log( nrg );
|
||||
if( k > 0 ) {
|
||||
energy_variation_Q7 += SKP_abs( log_energy_Q7 - log_energy_prev_Q7 );
|
||||
@ -224,7 +224,7 @@ void SKP_Silk_noise_shape_analysis_FIX(
|
||||
pitch_res_ptr += nSamples;
|
||||
}
|
||||
|
||||
psEncCtrl->sparseness_Q8 = SKP_RSHIFT( SKP_Silk_sigm_Q15( SKP_SMULWB( energy_variation_Q7 -
|
||||
psEncCtrl->sparseness_Q8 = SKP_RSHIFT( SKP_Silk_sigm_Q15( SKP_SMULWB( energy_variation_Q7 -
|
||||
SKP_FIX_CONST( 5.0, 7 ), SKP_FIX_CONST( 0.1, 16 ) ) ), 7 );
|
||||
|
||||
/* Set quantization offset depending on sparseness measure */
|
||||
@ -233,7 +233,7 @@ void SKP_Silk_noise_shape_analysis_FIX(
|
||||
} else {
|
||||
psEncCtrl->sCmn.QuantOffsetType = 1;
|
||||
}
|
||||
|
||||
|
||||
/* Increase coding SNR for sparse signals */
|
||||
SNR_adj_dB_Q7 = SKP_SMLAWB( SNR_adj_dB_Q7, SKP_FIX_CONST( SPARSE_SNR_INCR_dB, 15 ), psEncCtrl->sparseness_Q8 - SKP_FIX_CONST( 0.5, 8 ) );
|
||||
}
|
||||
@ -243,9 +243,9 @@ void SKP_Silk_noise_shape_analysis_FIX(
|
||||
/*******************************/
|
||||
/* More BWE for signals with high prediction gain */
|
||||
strength_Q16 = SKP_SMULWB( psEncCtrl->predGain_Q16, SKP_FIX_CONST( FIND_PITCH_WHITE_NOISE_FRACTION, 16 ) );
|
||||
BWExp1_Q16 = BWExp2_Q16 = SKP_DIV32_varQ( SKP_FIX_CONST( BANDWIDTH_EXPANSION, 16 ),
|
||||
BWExp1_Q16 = BWExp2_Q16 = SKP_DIV32_varQ( SKP_FIX_CONST( BANDWIDTH_EXPANSION, 16 ),
|
||||
SKP_SMLAWW( SKP_FIX_CONST( 1.0, 16 ), strength_Q16, strength_Q16 ), 16 );
|
||||
delta_Q16 = SKP_SMULWB( SKP_FIX_CONST( 1.0, 16 ) - SKP_SMULBB( 3, psEncCtrl->coding_quality_Q14 ),
|
||||
delta_Q16 = SKP_SMULWB( SKP_FIX_CONST( 1.0, 16 ) - SKP_SMULBB( 3, psEncCtrl->coding_quality_Q14 ),
|
||||
SKP_FIX_CONST( LOW_RATE_BANDWIDTH_EXPANSION_DELTA, 16 ) );
|
||||
BWExp1_Q16 = SKP_SUB32( BWExp1_Q16, delta_Q16 );
|
||||
BWExp2_Q16 = SKP_ADD32( BWExp2_Q16, delta_Q16 );
|
||||
@ -273,21 +273,21 @@ void SKP_Silk_noise_shape_analysis_FIX(
|
||||
SKP_memcpy( x_windowed + shift, x_ptr + shift, flat_part * sizeof(SKP_int16) );
|
||||
shift += flat_part;
|
||||
SKP_Silk_apply_sine_window_new( x_windowed + shift, x_ptr + shift, 2, slope_part );
|
||||
|
||||
|
||||
/* Update pointer: next LPC analysis block */
|
||||
x_ptr += psEnc->sCmn.subfr_length;
|
||||
|
||||
if( psEnc->sCmn.warping_Q16 > 0 ) {
|
||||
/* Calculate warped auto correlation */
|
||||
SKP_Silk_warped_autocorrelation_FIX( auto_corr, &scale, x_windowed, warping_Q16, psEnc->sCmn.shapeWinLength, psEnc->sCmn.shapingLPCOrder );
|
||||
SKP_Silk_warped_autocorrelation_FIX( auto_corr, &scale, x_windowed, warping_Q16, psEnc->sCmn.shapeWinLength, psEnc->sCmn.shapingLPCOrder );
|
||||
} else {
|
||||
/* Calculate regular auto correlation */
|
||||
SKP_Silk_autocorr( auto_corr, &scale, x_windowed, psEnc->sCmn.shapeWinLength, psEnc->sCmn.shapingLPCOrder + 1 );
|
||||
}
|
||||
|
||||
/* Add white noise, as a fraction of energy */
|
||||
auto_corr[0] = SKP_ADD32( auto_corr[0], SKP_max_32( SKP_SMULWB( SKP_RSHIFT( auto_corr[ 0 ], 4 ),
|
||||
SKP_FIX_CONST( SHAPE_WHITE_NOISE_FRACTION, 20 ) ), 1 ) );
|
||||
auto_corr[0] = SKP_ADD32( auto_corr[0], SKP_max_32( SKP_SMULWB( SKP_RSHIFT( auto_corr[ 0 ], 4 ),
|
||||
SKP_FIX_CONST( SHAPE_WHITE_NOISE_FRACTION, 20 ) ), 1 ) );
|
||||
|
||||
/* Calculate the reflection coefficients using schur */
|
||||
nrg = SKP_Silk_schur64( refl_coef_Q16, auto_corr, psEnc->sCmn.shapingLPCOrder );
|
||||
@ -372,31 +372,31 @@ void SKP_Silk_noise_shape_analysis_FIX(
|
||||
|
||||
for( k = 0; k < NB_SUBFR; k++ ) {
|
||||
psEncCtrl->Gains_Q16[ k ] = SKP_ADD_POS_SAT32( psEncCtrl->Gains_Q16[ k ], gain_add_Q16 );
|
||||
psEnc->avgGain_Q16 = SKP_ADD_SAT32(
|
||||
psEnc->avgGain_Q16,
|
||||
psEnc->avgGain_Q16 = SKP_ADD_SAT32(
|
||||
psEnc->avgGain_Q16,
|
||||
SKP_SMULWB(
|
||||
psEncCtrl->Gains_Q16[ k ] - psEnc->avgGain_Q16,
|
||||
SKP_RSHIFT_ROUND( SKP_SMULBB( psEnc->speech_activity_Q8, SKP_FIX_CONST( GAIN_SMOOTHING_COEF, 10 ) ), 2 )
|
||||
psEncCtrl->Gains_Q16[ k ] - psEnc->avgGain_Q16,
|
||||
SKP_RSHIFT_ROUND( SKP_SMULBB( psEnc->speech_activity_Q8, SKP_FIX_CONST( GAIN_SMOOTHING_COEF, 10 ) ), 2 )
|
||||
) );
|
||||
}
|
||||
|
||||
/************************************************/
|
||||
/* Decrease level during fricatives (de-essing) */
|
||||
/************************************************/
|
||||
gain_mult_Q16 = SKP_FIX_CONST( 1.0, 16 ) + SKP_RSHIFT_ROUND( SKP_MLA( SKP_FIX_CONST( INPUT_TILT, 26 ),
|
||||
gain_mult_Q16 = SKP_FIX_CONST( 1.0, 16 ) + SKP_RSHIFT_ROUND( SKP_MLA( SKP_FIX_CONST( INPUT_TILT, 26 ),
|
||||
psEncCtrl->coding_quality_Q14, SKP_FIX_CONST( HIGH_RATE_INPUT_TILT, 12 ) ), 10 );
|
||||
|
||||
if( psEncCtrl->input_tilt_Q15 <= 0 && psEncCtrl->sCmn.sigtype == SIG_TYPE_UNVOICED ) {
|
||||
if( psEnc->sCmn.fs_kHz == 24 ) {
|
||||
SKP_int32 essStrength_Q15 = SKP_SMULWW( -psEncCtrl->input_tilt_Q15,
|
||||
SKP_int32 essStrength_Q15 = SKP_SMULWW( -psEncCtrl->input_tilt_Q15,
|
||||
SKP_SMULBB( psEnc->speech_activity_Q8, SKP_FIX_CONST( 1.0, 8 ) - psEncCtrl->sparseness_Q8 ) );
|
||||
tmp32 = SKP_Silk_log2lin( SKP_FIX_CONST( 16.0, 7 ) - SKP_SMULWB( essStrength_Q15,
|
||||
tmp32 = SKP_Silk_log2lin( SKP_FIX_CONST( 16.0, 7 ) - SKP_SMULWB( essStrength_Q15,
|
||||
SKP_SMULWB( SKP_FIX_CONST( DE_ESSER_COEF_SWB_dB, 7 ), SKP_FIX_CONST( 0.16, 17 ) ) ) );
|
||||
gain_mult_Q16 = SKP_SMULWW( gain_mult_Q16, tmp32 );
|
||||
} else if( psEnc->sCmn.fs_kHz == 16 ) {
|
||||
SKP_int32 essStrength_Q15 = SKP_SMULWW(-psEncCtrl->input_tilt_Q15,
|
||||
SKP_int32 essStrength_Q15 = SKP_SMULWW(-psEncCtrl->input_tilt_Q15,
|
||||
SKP_SMULBB( psEnc->speech_activity_Q8, SKP_FIX_CONST( 1.0, 8 ) - psEncCtrl->sparseness_Q8 ));
|
||||
tmp32 = SKP_Silk_log2lin( SKP_FIX_CONST( 16.0, 7 ) - SKP_SMULWB( essStrength_Q15,
|
||||
tmp32 = SKP_Silk_log2lin( SKP_FIX_CONST( 16.0, 7 ) - SKP_SMULWB( essStrength_Q15,
|
||||
SKP_SMULWB( SKP_FIX_CONST( DE_ESSER_COEF_WB_dB, 7 ), SKP_FIX_CONST( 0.16, 17 ) ) ) );
|
||||
gain_mult_Q16 = SKP_SMULWW( gain_mult_Q16, tmp32 );
|
||||
} else {
|
||||
@ -412,26 +412,26 @@ void SKP_Silk_noise_shape_analysis_FIX(
|
||||
/* Control low-frequency shaping and noise tilt */
|
||||
/************************************************/
|
||||
/* Less low frequency shaping for noisy inputs */
|
||||
strength_Q16 = SKP_MUL( SKP_FIX_CONST( LOW_FREQ_SHAPING, 0 ), SKP_FIX_CONST( 1.0, 16 ) +
|
||||
strength_Q16 = SKP_MUL( SKP_FIX_CONST( LOW_FREQ_SHAPING, 0 ), SKP_FIX_CONST( 1.0, 16 ) +
|
||||
SKP_SMULBB( SKP_FIX_CONST( LOW_QUALITY_LOW_FREQ_SHAPING_DECR, 1 ), psEncCtrl->input_quality_bands_Q15[ 0 ] - SKP_FIX_CONST( 1.0, 15 ) ) );
|
||||
if( psEncCtrl->sCmn.sigtype == SIG_TYPE_VOICED ) {
|
||||
/* Reduce low frequencies quantization noise for periodic signals, depending on pitch lag */
|
||||
/*f = 400; freqz([1, -0.98 + 2e-4 * f], [1, -0.97 + 7e-4 * f], 2^12, Fs); axis([0, 1000, -10, 1])*/
|
||||
SKP_int fs_kHz_inv = SKP_DIV32_16( SKP_FIX_CONST( 0.2, 14 ), psEnc->sCmn.fs_kHz );
|
||||
for( k = 0; k < NB_SUBFR; k++ ) {
|
||||
b_Q14 = fs_kHz_inv + SKP_DIV32_16( SKP_FIX_CONST( 3.0, 14 ), psEncCtrl->sCmn.pitchL[ k ] );
|
||||
b_Q14 = fs_kHz_inv + SKP_DIV32_16( SKP_FIX_CONST( 3.0, 14 ), psEncCtrl->sCmn.pitchL[ k ] );
|
||||
/* Pack two coefficients in one int32 */
|
||||
psEncCtrl->LF_shp_Q14[ k ] = SKP_LSHIFT( SKP_FIX_CONST( 1.0, 14 ) - b_Q14 - SKP_SMULWB( strength_Q16, b_Q14 ), 16 );
|
||||
psEncCtrl->LF_shp_Q14[ k ] |= (SKP_uint16)( b_Q14 - SKP_FIX_CONST( 1.0, 14 ) );
|
||||
}
|
||||
SKP_assert( SKP_FIX_CONST( HARM_HP_NOISE_COEF, 24 ) < SKP_FIX_CONST( 0.5, 24 ) ); // Guarantees that second argument to SMULWB() is within range of an SKP_int16
|
||||
Tilt_Q16 = - SKP_FIX_CONST( HP_NOISE_COEF, 16 ) -
|
||||
SKP_SMULWB( SKP_FIX_CONST( 1.0, 16 ) - SKP_FIX_CONST( HP_NOISE_COEF, 16 ),
|
||||
Tilt_Q16 = - SKP_FIX_CONST( HP_NOISE_COEF, 16 ) -
|
||||
SKP_SMULWB( SKP_FIX_CONST( 1.0, 16 ) - SKP_FIX_CONST( HP_NOISE_COEF, 16 ),
|
||||
SKP_SMULWB( SKP_FIX_CONST( HARM_HP_NOISE_COEF, 24 ), psEnc->speech_activity_Q8 ) );
|
||||
} else {
|
||||
b_Q14 = SKP_DIV32_16( 21299, psEnc->sCmn.fs_kHz ); // 1.3_Q0 = 21299_Q14
|
||||
/* Pack two coefficients in one int32 */
|
||||
psEncCtrl->LF_shp_Q14[ 0 ] = SKP_LSHIFT( SKP_FIX_CONST( 1.0, 14 ) - b_Q14 -
|
||||
psEncCtrl->LF_shp_Q14[ 0 ] = SKP_LSHIFT( SKP_FIX_CONST( 1.0, 14 ) - b_Q14 -
|
||||
SKP_SMULWB( strength_Q16, SKP_SMULWB( SKP_FIX_CONST( 0.6, 16 ), b_Q14 ) ), 16 );
|
||||
psEncCtrl->LF_shp_Q14[ 0 ] |= (SKP_uint16)( b_Q14 - SKP_FIX_CONST( 1.0, 14 ) );
|
||||
for( k = 1; k < NB_SUBFR; k++ ) {
|
||||
@ -444,21 +444,21 @@ void SKP_Silk_noise_shape_analysis_FIX(
|
||||
/* HARMONIC SHAPING CONTROL */
|
||||
/****************************/
|
||||
/* Control boosting of harmonic frequencies */
|
||||
HarmBoost_Q16 = SKP_SMULWB( SKP_SMULWB( SKP_FIX_CONST( 1.0, 17 ) - SKP_LSHIFT( psEncCtrl->coding_quality_Q14, 3 ),
|
||||
HarmBoost_Q16 = SKP_SMULWB( SKP_SMULWB( SKP_FIX_CONST( 1.0, 17 ) - SKP_LSHIFT( psEncCtrl->coding_quality_Q14, 3 ),
|
||||
psEnc->LTPCorr_Q15 ), SKP_FIX_CONST( LOW_RATE_HARMONIC_BOOST, 16 ) );
|
||||
|
||||
/* More harmonic boost for noisy input signals */
|
||||
HarmBoost_Q16 = SKP_SMLAWB( HarmBoost_Q16,
|
||||
HarmBoost_Q16 = SKP_SMLAWB( HarmBoost_Q16,
|
||||
SKP_FIX_CONST( 1.0, 16 ) - SKP_LSHIFT( psEncCtrl->input_quality_Q14, 2 ), SKP_FIX_CONST( LOW_INPUT_QUALITY_HARMONIC_BOOST, 16 ) );
|
||||
|
||||
if( USE_HARM_SHAPING && psEncCtrl->sCmn.sigtype == SIG_TYPE_VOICED ) {
|
||||
/* More harmonic noise shaping for high bitrates or noisy input */
|
||||
HarmShapeGain_Q16 = SKP_SMLAWB( SKP_FIX_CONST( HARMONIC_SHAPING, 16 ),
|
||||
HarmShapeGain_Q16 = SKP_SMLAWB( SKP_FIX_CONST( HARMONIC_SHAPING, 16 ),
|
||||
SKP_FIX_CONST( 1.0, 16 ) - SKP_SMULWB( SKP_FIX_CONST( 1.0, 18 ) - SKP_LSHIFT( psEncCtrl->coding_quality_Q14, 4 ),
|
||||
psEncCtrl->input_quality_Q14 ), SKP_FIX_CONST( HIGH_RATE_OR_LOW_QUALITY_HARMONIC_SHAPING, 16 ) );
|
||||
|
||||
/* Less harmonic noise shaping for less periodic signals */
|
||||
HarmShapeGain_Q16 = SKP_SMULWB( SKP_LSHIFT( HarmShapeGain_Q16, 1 ),
|
||||
HarmShapeGain_Q16 = SKP_SMULWB( SKP_LSHIFT( HarmShapeGain_Q16, 1 ),
|
||||
SKP_Silk_SQRT_APPROX( SKP_LSHIFT( psEnc->LTPCorr_Q15, 15 ) ) );
|
||||
} else {
|
||||
HarmShapeGain_Q16 = 0;
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -55,7 +55,7 @@ void SKP_FIX_P_Ana_calc_energy_st3(
|
||||
|
||||
SKP_int32 SKP_FIX_P_Ana_find_scaling(
|
||||
const SKP_int16 *signal,
|
||||
const SKP_int signal_length,
|
||||
const SKP_int signal_length,
|
||||
const SKP_int sum_sqr_len
|
||||
);
|
||||
|
||||
@ -128,7 +128,7 @@ SKP_int SKP_Silk_pitch_analysis_core( /* O Voicing estimate: 0 voiced, 1 unv
|
||||
max_lag_8kHz = PITCH_EST_MAX_LAG_MS * 8;
|
||||
|
||||
SKP_memset( C, 0, sizeof( SKP_int16 ) * PITCH_EST_NB_SUBFR * ( ( PITCH_EST_MAX_LAG >> 1 ) + 5) );
|
||||
|
||||
|
||||
/* Resample from input sampled at Fs_kHz to 8 kHz */
|
||||
if( Fs_kHz == 16 ) {
|
||||
SKP_memset( filt_state, 0, 2 * sizeof( SKP_int32 ) );
|
||||
@ -158,7 +158,7 @@ SKP_int SKP_Silk_pitch_analysis_core( /* O Voicing estimate: 0 voiced, 1 unv
|
||||
** Scale 4 kHz signal down to prevent correlations measures from overflowing
|
||||
** find scaling as max scaling for each 8kHz(?) subframe
|
||||
*******************************************************************************/
|
||||
|
||||
|
||||
/* Inner product is calculated with different lengths, so scale for the worst case */
|
||||
max_sum_sq_length = SKP_max_32( sf_length_8kHz, SKP_RSHIFT( frame_length_4kHz, 1 ) );
|
||||
shift = SKP_FIX_P_Ana_find_scaling( signal_4kHz, frame_length_4kHz, max_sum_sq_length );
|
||||
@ -205,9 +205,9 @@ SKP_int SKP_Silk_pitch_analysis_core( /* O Voicing estimate: 0 voiced, 1 unv
|
||||
|
||||
/* Add contribution of new sample and remove contribution from oldest sample */
|
||||
normalizer +=
|
||||
SKP_SMULBB( basis_ptr[ 0 ], basis_ptr[ 0 ] ) -
|
||||
SKP_SMULBB( basis_ptr[ sf_length_8kHz ], basis_ptr[ sf_length_8kHz ] );
|
||||
|
||||
SKP_SMULBB( basis_ptr[ 0 ], basis_ptr[ 0 ] ) -
|
||||
SKP_SMULBB( basis_ptr[ sf_length_8kHz ], basis_ptr[ sf_length_8kHz ] );
|
||||
|
||||
temp32 = SKP_DIV32( cross_corr, SKP_Silk_SQRT_APPROX( normalizer ) + 1 );
|
||||
C[ k ][ d ] = (SKP_int16)SKP_SAT16( temp32 ); /* Q0 */
|
||||
}
|
||||
@ -238,7 +238,7 @@ SKP_int SKP_Silk_pitch_analysis_core( /* O Voicing estimate: 0 voiced, 1 unv
|
||||
Cmax = (SKP_int)C[ 0 ][ min_lag_4kHz ]; /* Q-1 */
|
||||
threshold = SKP_SMULBB( Cmax, Cmax ); /* Q-2 */
|
||||
/* Compare in Q-2 domain */
|
||||
if( SKP_RSHIFT( energy, 4 + 2 ) > threshold ) {
|
||||
if( SKP_RSHIFT( energy, 4 + 2 ) > threshold ) {
|
||||
SKP_memset( pitch_out, 0, PITCH_EST_NB_SUBFR * sizeof( SKP_int ) );
|
||||
*LTPCorr_Q15 = 0;
|
||||
*lagIndex = 0;
|
||||
@ -271,7 +271,7 @@ SKP_int SKP_Silk_pitch_analysis_core( /* O Voicing estimate: 0 voiced, 1 unv
|
||||
}
|
||||
|
||||
length_d_srch = 0;
|
||||
for( i = min_lag_8kHz; i < max_lag_8kHz + 1; i++ ) {
|
||||
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++;
|
||||
@ -284,7 +284,7 @@ SKP_int SKP_Silk_pitch_analysis_core( /* O Voicing estimate: 0 voiced, 1 unv
|
||||
}
|
||||
|
||||
length_d_comp = 0;
|
||||
for( i = min_lag_8kHz; i < max_lag_8kHz + 4; i++ ) {
|
||||
for( i = min_lag_8kHz; i < max_lag_8kHz + 4; i++ ) {
|
||||
if( d_comp[ i ] > 0 ) {
|
||||
d_comp[ length_d_comp ] = i - 2;
|
||||
length_d_comp++;
|
||||
@ -306,11 +306,11 @@ SKP_int SKP_Silk_pitch_analysis_core( /* O Voicing estimate: 0 voiced, 1 unv
|
||||
}
|
||||
}
|
||||
|
||||
/*********************************************************************************
|
||||
/*********************************************************************************
|
||||
* Find energy of each subframe projected onto its history, for a range of delays
|
||||
*********************************************************************************/
|
||||
SKP_memset( C, 0, PITCH_EST_NB_SUBFR * ( ( PITCH_EST_MAX_LAG >> 1 ) + 5 ) * sizeof( SKP_int16 ) );
|
||||
|
||||
|
||||
target_ptr = &signal_8kHz[ frame_length_4kHz ]; /* point to middle of frame */
|
||||
for( k = 0; k < PITCH_EST_NB_SUBFR; k++ ) {
|
||||
|
||||
@ -327,7 +327,7 @@ SKP_int SKP_Silk_pitch_analysis_core( /* O Voicing estimate: 0 voiced, 1 unv
|
||||
/* Check that we are within range of the array */
|
||||
SKP_assert( basis_ptr >= signal_8kHz );
|
||||
SKP_assert( basis_ptr + sf_length_8kHz <= signal_8kHz + frame_length_8kHz );
|
||||
|
||||
|
||||
cross_corr = SKP_Silk_inner_prod_aligned( target_ptr, basis_ptr, sf_length_8kHz );
|
||||
energy_basis = SKP_Silk_inner_prod_aligned( basis_ptr, basis_ptr, sf_length_8kHz );
|
||||
if( cross_corr > 0 ) {
|
||||
@ -375,7 +375,7 @@ SKP_int SKP_Silk_pitch_analysis_core( /* O Voicing estimate: 0 voiced, 1 unv
|
||||
|
||||
/* If input is 8 khz use a larger codebook here because it is last stage */
|
||||
if( Fs_kHz == 8 && complexity > SKP_Silk_PITCH_EST_MIN_COMPLEX ) {
|
||||
nb_cbks_stage2 = PITCH_EST_NB_CBKS_STAGE2_EXT;
|
||||
nb_cbks_stage2 = PITCH_EST_NB_CBKS_STAGE2_EXT;
|
||||
} else {
|
||||
nb_cbks_stage2 = PITCH_EST_NB_CBKS_STAGE2;
|
||||
}
|
||||
@ -409,7 +409,7 @@ SKP_int SKP_Silk_pitch_analysis_core( /* O Voicing estimate: 0 voiced, 1 unv
|
||||
} else {
|
||||
CCmax_new_b = CCmax_new - SKP_RSHIFT( SKP_SMULBB( PITCH_EST_NB_SUBFR * PITCH_EST_SHORTLAG_BIAS_Q15, lag_log2_Q7 ), 7 ); /* Q15 */
|
||||
}
|
||||
|
||||
|
||||
/* Bias towards previous lag */
|
||||
SKP_assert( PITCH_EST_NB_SUBFR * PITCH_EST_PREVLAG_BIAS_Q15 == SKP_SAT16( PITCH_EST_NB_SUBFR * PITCH_EST_PREVLAG_BIAS_Q15 ) );
|
||||
if( prevLag > 0 ) {
|
||||
@ -461,7 +461,7 @@ SKP_int SKP_Silk_pitch_analysis_core( /* O Voicing estimate: 0 voiced, 1 unv
|
||||
/*********************************************************************************/
|
||||
|
||||
/* Search in original signal */
|
||||
|
||||
|
||||
CBimax_old = CBimax;
|
||||
/* Compensate for decimation */
|
||||
SKP_assert( lag == SKP_SAT16( lag ) );
|
||||
@ -478,7 +478,7 @@ SKP_int SKP_Silk_pitch_analysis_core( /* O Voicing estimate: 0 voiced, 1 unv
|
||||
end_lag = SKP_min_int( lag + 2, max_lag );
|
||||
lag_new = lag; /* to avoid undefined lag */
|
||||
CBimax = 0; /* to avoid undefined lag */
|
||||
SKP_assert( SKP_LSHIFT( CCmax, 13 ) >= 0 );
|
||||
SKP_assert( SKP_LSHIFT( CCmax, 13 ) >= 0 );
|
||||
*LTPCorr_Q15 = (SKP_int)SKP_Silk_SQRT_APPROX( SKP_LSHIFT( CCmax, 13 ) ); /* Output normalized correlation */
|
||||
|
||||
CCmax = SKP_int32_MIN;
|
||||
@ -532,8 +532,8 @@ SKP_int SKP_Silk_pitch_analysis_core( /* O Voicing estimate: 0 voiced, 1 unv
|
||||
CCmax_new = 0;
|
||||
}
|
||||
|
||||
if( CCmax_new > CCmax &&
|
||||
( d + (SKP_int)SKP_Silk_CB_lags_stage3[ 0 ][ j ] ) <= max_lag
|
||||
if( CCmax_new > CCmax &&
|
||||
( d + (SKP_int)SKP_Silk_CB_lags_stage3[ 0 ][ j ] ) <= max_lag
|
||||
) {
|
||||
CCmax = CCmax_new;
|
||||
lag_new = d;
|
||||
@ -601,7 +601,7 @@ void SKP_FIX_P_Ana_calc_corr_st3(
|
||||
}
|
||||
|
||||
delta = SKP_Silk_Lag_range_stage3[ complexity ][ k ][ 0 ];
|
||||
for( i = cbk_offset; i < ( cbk_offset + cbk_size ); i++ ) {
|
||||
for( i = cbk_offset; i < ( cbk_offset + cbk_size ); i++ ) {
|
||||
/* 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;
|
||||
@ -664,7 +664,7 @@ void SKP_FIX_P_Ana_calc_energy_st3(
|
||||
}
|
||||
|
||||
delta = SKP_Silk_Lag_range_stage3[ complexity ][ k ][ 0 ];
|
||||
for( i = cbk_offset; i < ( cbk_offset + cbk_size ); i++ ) {
|
||||
for( i = cbk_offset; i < ( cbk_offset + cbk_size ); i++ ) {
|
||||
/* 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;
|
||||
@ -681,17 +681,17 @@ void SKP_FIX_P_Ana_calc_energy_st3(
|
||||
|
||||
SKP_int32 SKP_FIX_P_Ana_find_scaling(
|
||||
const SKP_int16 *signal,
|
||||
const SKP_int signal_length,
|
||||
const SKP_int signal_length,
|
||||
const SKP_int sum_sqr_len
|
||||
)
|
||||
{
|
||||
SKP_int32 nbits, x_max;
|
||||
|
||||
|
||||
x_max = SKP_Silk_int16_array_maxabs( signal, signal_length );
|
||||
|
||||
if( x_max < SKP_int16_MAX ) {
|
||||
/* Number of bits needed for the sum of the squares */
|
||||
nbits = 32 - SKP_Silk_CLZ32( SKP_SMULBB( x_max, x_max ) );
|
||||
nbits = 32 - SKP_Silk_CLZ32( SKP_SMULBB( x_max, x_max ) );
|
||||
} else {
|
||||
/* Here we don't know if x_max should have been SKP_int16_MAX + 1, so we expect the worst case */
|
||||
nbits = 30;
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -37,4 +37,3 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#define PITCH_EST_FLATCONTOUR_BIAS_Q20 52429 /* 0.05f */
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -37,7 +37,7 @@ const SKP_int16 SKP_Silk_CB_lags_stage2[PITCH_EST_NB_SUBFR][PITCH_EST_NB_CBKS_ST
|
||||
{0, 2,-1,-1,-1, 0, 0, 1, 1, 0, 1},
|
||||
{0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0},
|
||||
{0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0},
|
||||
{0,-1, 2, 1, 0, 1, 1, 0, 0,-1,-1}
|
||||
{0,-1, 2, 1, 0, 1, 1, 0, 0,-1,-1}
|
||||
};
|
||||
|
||||
const SKP_int16 SKP_Silk_CB_lags_stage3[PITCH_EST_NB_SUBFR][PITCH_EST_NB_CBKS_STAGE3_MAX] =
|
||||
@ -73,17 +73,16 @@ const SKP_int16 SKP_Silk_Lag_range_stage3[ SKP_Silk_PITCH_EST_MAX_COMPLEX + 1 ]
|
||||
}
|
||||
};
|
||||
|
||||
const SKP_int16 SKP_Silk_cbk_sizes_stage3[SKP_Silk_PITCH_EST_MAX_COMPLEX + 1] =
|
||||
const SKP_int16 SKP_Silk_cbk_sizes_stage3[SKP_Silk_PITCH_EST_MAX_COMPLEX + 1] =
|
||||
{
|
||||
PITCH_EST_NB_CBKS_STAGE3_MIN,
|
||||
PITCH_EST_NB_CBKS_STAGE3_MID,
|
||||
PITCH_EST_NB_CBKS_STAGE3_MAX
|
||||
};
|
||||
|
||||
const SKP_int16 SKP_Silk_cbk_offsets_stage3[SKP_Silk_PITCH_EST_MAX_COMPLEX + 1] =
|
||||
const SKP_int16 SKP_Silk_cbk_offsets_stage3[SKP_Silk_PITCH_EST_MAX_COMPLEX + 1] =
|
||||
{
|
||||
((PITCH_EST_NB_CBKS_STAGE3_MAX - PITCH_EST_NB_CBKS_STAGE3_MIN) >> 1),
|
||||
((PITCH_EST_NB_CBKS_STAGE3_MAX - PITCH_EST_NB_CBKS_STAGE3_MID) >> 1),
|
||||
0
|
||||
};
|
||||
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -56,7 +56,7 @@ void SKP_Silk_warped_LPC_analysis_filter_FIX(
|
||||
SKP_assert( ( order & 1 ) == 0 );
|
||||
|
||||
for( n = 0; n < length; n++ ) {
|
||||
/* Output of lowpass section */
|
||||
/* Output of lowpass section */
|
||||
tmp2 = SKP_SMLAWB( state[ 0 ], state[ 1 ], lambda_Q16 );
|
||||
state[ 0 ] = SKP_LSHIFT( input[ n ], 14 );
|
||||
/* Output of allpass section */
|
||||
@ -119,7 +119,7 @@ void SKP_Silk_prefilter_FIX(
|
||||
AR1_shp_Q13 = &psEncCtrl->AR1_Q13[ k * MAX_SHAPE_LPC_ORDER ];
|
||||
|
||||
/* Short term FIR filtering*/
|
||||
SKP_Silk_warped_LPC_analysis_filter_FIX( P->sAR_shp, st_res, AR1_shp_Q13, px,
|
||||
SKP_Silk_warped_LPC_analysis_filter_FIX( P->sAR_shp, st_res, AR1_shp_Q13, px,
|
||||
psEnc->sCmn.warping_Q16, psEnc->sCmn.subfr_length, psEnc->sCmn.shapingLPCOrder );
|
||||
|
||||
/* reduce (mainly) low frequencies during harmonic emphasis */
|
||||
@ -136,7 +136,7 @@ void SKP_Silk_prefilter_FIX(
|
||||
}
|
||||
P->sHarmHP = st_res[ psEnc->sCmn.subfr_length - 1 ];
|
||||
|
||||
SKP_Silk_prefilt_FIX( P, x_filt_Q12, pxw, HarmShapeFIRPacked_Q12, Tilt_Q14,
|
||||
SKP_Silk_prefilt_FIX( P, x_filt_Q12, pxw, HarmShapeFIRPacked_Q12, Tilt_Q14,
|
||||
LF_shp_Q14, lag, psEnc->sCmn.subfr_length );
|
||||
|
||||
px += psEnc->sCmn.subfr_length;
|
||||
|
@ -1,33 +1,33 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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"
|
||||
|
||||
/* Limit, stabilize, convert and quantize NLSFs. */
|
||||
/* Limit, stabilize, convert and quantize NLSFs. */
|
||||
void SKP_Silk_process_NLSFs_FIX(
|
||||
SKP_Silk_encoder_state_FIX *psEnc, /* I/O Encoder state FIX */
|
||||
SKP_Silk_encoder_control_FIX *psEncCtrl, /* I/O Encoder control FIX */
|
||||
@ -59,11 +59,11 @@ void SKP_Silk_process_NLSFs_FIX(
|
||||
/* NLSF_mu_fluc_red = 0.1f - 0.05f * psEnc->speech_activity; */
|
||||
NLSF_mu_Q15 = SKP_SMLAWB( 66, -8388, psEnc->speech_activity_Q8 );
|
||||
NLSF_mu_fluc_red_Q16 = SKP_SMLAWB( 6554, -838848, psEnc->speech_activity_Q8 );
|
||||
} else {
|
||||
} else {
|
||||
/* NLSF_mu = 0.005f - 0.004f * psEnc->speech_activity; */
|
||||
/* NLSF_mu_fluc_red = 0.2f - 0.1f * psEnc->speech_activity - 0.1f * psEncCtrl->sparseness; */
|
||||
NLSF_mu_Q15 = SKP_SMLAWB( 164, -33554, psEnc->speech_activity_Q8 );
|
||||
NLSF_mu_fluc_red_Q16 = SKP_SMLAWB( 13107, -1677696, psEnc->speech_activity_Q8 + psEncCtrl->sparseness_Q8 );
|
||||
NLSF_mu_fluc_red_Q16 = SKP_SMLAWB( 13107, -1677696, psEnc->speech_activity_Q8 + psEncCtrl->sparseness_Q8 );
|
||||
}
|
||||
SKP_assert( NLSF_mu_Q15 >= 0 );
|
||||
SKP_assert( NLSF_mu_Q15 <= 164 );
|
||||
@ -82,7 +82,7 @@ void SKP_Silk_process_NLSFs_FIX(
|
||||
if( doInterpolate ) {
|
||||
|
||||
/* Calculate the interpolated NLSF vector for the first half */
|
||||
SKP_Silk_interpolate( pNLSF0_temp_Q15, psEnc->sPred.prev_NLSFq_Q15, pNLSF_Q15,
|
||||
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 */
|
||||
@ -104,8 +104,8 @@ void SKP_Silk_process_NLSFs_FIX(
|
||||
|
||||
/* Quantize NLSF parameters given the trained NLSF codebooks */
|
||||
TIC(MSVQ_encode_FIX)
|
||||
SKP_Silk_NLSF_MSVQ_encode_FIX( psEncCtrl->sCmn.NLSFIndices, pNLSF_Q15, psNLSF_CB,
|
||||
psEnc->sPred.prev_NLSFq_Q15, pNLSFW_Q6, NLSF_mu_Q15, NLSF_mu_fluc_red_Q16,
|
||||
SKP_Silk_NLSF_MSVQ_encode_FIX( psEncCtrl->sCmn.NLSFIndices, pNLSF_Q15, psNLSF_CB,
|
||||
psEnc->sPred.prev_NLSFq_Q15, pNLSFW_Q6, NLSF_mu_Q15, NLSF_mu_fluc_red_Q16,
|
||||
psEnc->sCmn.NLSF_MSVQ_Survivors, psEnc->sCmn.predictLPCOrder, psEnc->sCmn.first_frame_after_reset );
|
||||
TOC(MSVQ_encode_FIX)
|
||||
|
||||
@ -114,7 +114,7 @@ void SKP_Silk_process_NLSFs_FIX(
|
||||
|
||||
if( doInterpolate ) {
|
||||
/* Calculate the interpolated, quantized LSF vector for the first half */
|
||||
SKP_Silk_interpolate( pNLSF0_temp_Q15, psEnc->sPred.prev_NLSFq_Q15, pNLSF_Q15,
|
||||
SKP_Silk_interpolate( pNLSF0_temp_Q15, psEnc->sPred.prev_NLSFq_Q15, pNLSF_Q15,
|
||||
psEncCtrl->sCmn.NLSFInterpCoef_Q2, psEnc->sCmn.predictLPCOrder );
|
||||
|
||||
/* Convert back to LPC coefficients */
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -48,7 +48,7 @@ void SKP_Silk_process_gains_FIX(
|
||||
}
|
||||
|
||||
/* Limit the quantized signal */
|
||||
InvMaxSqrVal_Q16 = SKP_DIV32_16( SKP_Silk_log2lin(
|
||||
InvMaxSqrVal_Q16 = SKP_DIV32_16( SKP_Silk_log2lin(
|
||||
SKP_SMULWB( SKP_FIX_CONST( 70.0, 7 ) - psEncCtrl->current_SNR_dB_Q7, SKP_FIX_CONST( 0.33, 16 ) ) ), psEnc->sCmn.subfr_length );
|
||||
|
||||
for( k = 0; k < NB_SUBFR; k++ ) {
|
||||
@ -83,7 +83,7 @@ void SKP_Silk_process_gains_FIX(
|
||||
}
|
||||
|
||||
/* Noise shaping quantization */
|
||||
SKP_Silk_gains_quant( psEncCtrl->sCmn.GainsIndices, psEncCtrl->Gains_Q16,
|
||||
SKP_Silk_gains_quant( psEncCtrl->sCmn.GainsIndices, psEncCtrl->Gains_Q16,
|
||||
&psShapeSt->LastGainIndex, psEnc->sCmn.nFramesInPayloadBuf );
|
||||
/* Set quantizer offset for voiced signals. Larger offset when LTP coding gain is low or tilt is high (ie low-pass) */
|
||||
if( psEncCtrl->sCmn.sigtype == SIG_TYPE_VOICED ) {
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -98,9 +98,8 @@ void SKP_Silk_quant_LTP_gains_FIX(
|
||||
|
||||
cbk_ptr_Q14 = SKP_Silk_LTP_vq_ptrs_Q14[ *periodicity_index ];
|
||||
for( j = 0; j < NB_SUBFR; j++ ) {
|
||||
for( k = 0; k < LTP_ORDER; k++ ) {
|
||||
for( k = 0; k < LTP_ORDER; k++ ) {
|
||||
B_Q14[ j * LTP_ORDER + k ] = cbk_ptr_Q14[ SKP_MLA( k, cbk_index[ j ], LTP_ORDER ) ];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -272,13 +272,13 @@ void SKP_Silk_range_dec_init(
|
||||
}
|
||||
/* Initialize structure */
|
||||
/* Copy to internal buffer */
|
||||
SKP_memcpy( psRC->buffer, buffer, bufferLength * sizeof( SKP_uint8 ) );
|
||||
SKP_memcpy( psRC->buffer, buffer, bufferLength * sizeof( SKP_uint8 ) );
|
||||
psRC->bufferLength = bufferLength;
|
||||
psRC->bufferIx = 0;
|
||||
psRC->base_Q32 =
|
||||
SKP_LSHIFT_uint( (SKP_uint32)buffer[ 0 ], 24 ) |
|
||||
SKP_LSHIFT_uint( (SKP_uint32)buffer[ 1 ], 16 ) |
|
||||
SKP_LSHIFT_uint( (SKP_uint32)buffer[ 2 ], 8 ) |
|
||||
psRC->base_Q32 =
|
||||
SKP_LSHIFT_uint( (SKP_uint32)buffer[ 0 ], 24 ) |
|
||||
SKP_LSHIFT_uint( (SKP_uint32)buffer[ 1 ], 16 ) |
|
||||
SKP_LSHIFT_uint( (SKP_uint32)buffer[ 2 ], 8 ) |
|
||||
(SKP_uint32)buffer[ 3 ];
|
||||
psRC->range_Q16 = 0x0000FFFF;
|
||||
psRC->error = 0;
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -78,7 +78,7 @@ static SKP_int32 gcd(
|
||||
}
|
||||
|
||||
/* Initialize/reset the resampler state for a given pair of input/output sampling rates */
|
||||
SKP_int SKP_Silk_resampler_init(
|
||||
SKP_int SKP_Silk_resampler_init(
|
||||
SKP_Silk_resampler_state_struct *S, /* I/O: Resampler state */
|
||||
SKP_int32 Fs_Hz_in, /* I: Input sampling rate (Hz) */
|
||||
SKP_int32 Fs_Hz_out /* I: Output sampling rate (Hz) */
|
||||
@ -160,7 +160,7 @@ SKP_int SKP_Silk_resampler_init(
|
||||
/* Upsample */
|
||||
if( Fs_Hz_out == SKP_MUL( Fs_Hz_in, 2 ) ) { /* Fs_out : Fs_in = 2 : 1 */
|
||||
/* Special case: directly use 2x upsampler */
|
||||
S->resampler_function = SKP_Silk_resampler_private_up2_HQ_wrapper;
|
||||
S->resampler_function = SKP_Silk_resampler_private_up2_HQ_wrapper;
|
||||
} else {
|
||||
/* Default resampler */
|
||||
S->resampler_function = SKP_Silk_resampler_private_IIR_FIR;
|
||||
@ -176,50 +176,50 @@ SKP_int SKP_Silk_resampler_init(
|
||||
} else if ( Fs_Hz_out < Fs_Hz_in ) {
|
||||
/* Downsample */
|
||||
if( SKP_MUL( Fs_Hz_out, 4 ) == SKP_MUL( Fs_Hz_in, 3 ) ) { /* Fs_out : Fs_in = 3 : 4 */
|
||||
S->FIR_Fracs = 3;
|
||||
S->Coefs = SKP_Silk_Resampler_3_4_COEFS;
|
||||
S->resampler_function = SKP_Silk_resampler_private_down_FIR;
|
||||
S->FIR_Fracs = 3;
|
||||
S->Coefs = SKP_Silk_Resampler_3_4_COEFS;
|
||||
S->resampler_function = SKP_Silk_resampler_private_down_FIR;
|
||||
} else if( SKP_MUL( Fs_Hz_out, 3 ) == SKP_MUL( Fs_Hz_in, 2 ) ) { /* Fs_out : Fs_in = 2 : 3 */
|
||||
S->FIR_Fracs = 2;
|
||||
S->Coefs = SKP_Silk_Resampler_2_3_COEFS;
|
||||
S->resampler_function = SKP_Silk_resampler_private_down_FIR;
|
||||
S->FIR_Fracs = 2;
|
||||
S->Coefs = SKP_Silk_Resampler_2_3_COEFS;
|
||||
S->resampler_function = SKP_Silk_resampler_private_down_FIR;
|
||||
} else if( SKP_MUL( Fs_Hz_out, 2 ) == Fs_Hz_in ) { /* Fs_out : Fs_in = 1 : 2 */
|
||||
S->FIR_Fracs = 1;
|
||||
S->Coefs = SKP_Silk_Resampler_1_2_COEFS;
|
||||
S->resampler_function = SKP_Silk_resampler_private_down_FIR;
|
||||
S->FIR_Fracs = 1;
|
||||
S->Coefs = SKP_Silk_Resampler_1_2_COEFS;
|
||||
S->resampler_function = SKP_Silk_resampler_private_down_FIR;
|
||||
} else if( SKP_MUL( Fs_Hz_out, 8 ) == SKP_MUL( Fs_Hz_in, 3 ) ) { /* Fs_out : Fs_in = 3 : 8 */
|
||||
S->FIR_Fracs = 3;
|
||||
S->Coefs = SKP_Silk_Resampler_3_8_COEFS;
|
||||
S->resampler_function = SKP_Silk_resampler_private_down_FIR;
|
||||
S->FIR_Fracs = 3;
|
||||
S->Coefs = SKP_Silk_Resampler_3_8_COEFS;
|
||||
S->resampler_function = SKP_Silk_resampler_private_down_FIR;
|
||||
} else if( SKP_MUL( Fs_Hz_out, 3 ) == Fs_Hz_in ) { /* Fs_out : Fs_in = 1 : 3 */
|
||||
S->FIR_Fracs = 1;
|
||||
S->Coefs = SKP_Silk_Resampler_1_3_COEFS;
|
||||
S->resampler_function = SKP_Silk_resampler_private_down_FIR;
|
||||
S->FIR_Fracs = 1;
|
||||
S->Coefs = SKP_Silk_Resampler_1_3_COEFS;
|
||||
S->resampler_function = SKP_Silk_resampler_private_down_FIR;
|
||||
} else if( SKP_MUL( Fs_Hz_out, 4 ) == Fs_Hz_in ) { /* Fs_out : Fs_in = 1 : 4 */
|
||||
S->FIR_Fracs = 1;
|
||||
S->FIR_Fracs = 1;
|
||||
down2 = 1;
|
||||
S->Coefs = SKP_Silk_Resampler_1_2_COEFS;
|
||||
S->Coefs = SKP_Silk_Resampler_1_2_COEFS;
|
||||
S->resampler_function = SKP_Silk_resampler_private_down_FIR;
|
||||
} else if( SKP_MUL( Fs_Hz_out, 6 ) == Fs_Hz_in ) { /* Fs_out : Fs_in = 1 : 6 */
|
||||
S->FIR_Fracs = 1;
|
||||
S->FIR_Fracs = 1;
|
||||
down2 = 1;
|
||||
S->Coefs = SKP_Silk_Resampler_1_3_COEFS;
|
||||
S->Coefs = SKP_Silk_Resampler_1_3_COEFS;
|
||||
S->resampler_function = SKP_Silk_resampler_private_down_FIR;
|
||||
} else if( SKP_MUL( Fs_Hz_out, 441 ) == SKP_MUL( Fs_Hz_in, 80 ) ) { /* Fs_out : Fs_in = 80 : 441 */
|
||||
S->Coefs = SKP_Silk_Resampler_80_441_ARMA4_COEFS;
|
||||
S->resampler_function = SKP_Silk_resampler_private_IIR_FIR;
|
||||
S->Coefs = SKP_Silk_Resampler_80_441_ARMA4_COEFS;
|
||||
S->resampler_function = SKP_Silk_resampler_private_IIR_FIR;
|
||||
} else if( SKP_MUL( Fs_Hz_out, 441 ) == SKP_MUL( Fs_Hz_in, 120 ) ) { /* Fs_out : Fs_in = 120 : 441 */
|
||||
S->Coefs = SKP_Silk_Resampler_120_441_ARMA4_COEFS;
|
||||
S->resampler_function = SKP_Silk_resampler_private_IIR_FIR;
|
||||
S->Coefs = SKP_Silk_Resampler_120_441_ARMA4_COEFS;
|
||||
S->resampler_function = SKP_Silk_resampler_private_IIR_FIR;
|
||||
} else if( SKP_MUL( Fs_Hz_out, 441 ) == SKP_MUL( Fs_Hz_in, 160 ) ) { /* Fs_out : Fs_in = 160 : 441 */
|
||||
S->Coefs = SKP_Silk_Resampler_160_441_ARMA4_COEFS;
|
||||
S->resampler_function = SKP_Silk_resampler_private_IIR_FIR;
|
||||
S->Coefs = SKP_Silk_Resampler_160_441_ARMA4_COEFS;
|
||||
S->resampler_function = SKP_Silk_resampler_private_IIR_FIR;
|
||||
} else if( SKP_MUL( Fs_Hz_out, 441 ) == SKP_MUL( Fs_Hz_in, 240 ) ) { /* Fs_out : Fs_in = 240 : 441 */
|
||||
S->Coefs = SKP_Silk_Resampler_240_441_ARMA4_COEFS;
|
||||
S->resampler_function = SKP_Silk_resampler_private_IIR_FIR;
|
||||
S->Coefs = SKP_Silk_Resampler_240_441_ARMA4_COEFS;
|
||||
S->resampler_function = SKP_Silk_resampler_private_IIR_FIR;
|
||||
} else if( SKP_MUL( Fs_Hz_out, 441 ) == SKP_MUL( Fs_Hz_in, 320 ) ) { /* Fs_out : Fs_in = 320 : 441 */
|
||||
S->Coefs = SKP_Silk_Resampler_320_441_ARMA4_COEFS;
|
||||
S->resampler_function = SKP_Silk_resampler_private_IIR_FIR;
|
||||
S->Coefs = SKP_Silk_Resampler_320_441_ARMA4_COEFS;
|
||||
S->resampler_function = SKP_Silk_resampler_private_IIR_FIR;
|
||||
} else {
|
||||
/* Default resampler */
|
||||
S->resampler_function = SKP_Silk_resampler_private_IIR_FIR;
|
||||
@ -252,7 +252,7 @@ SKP_int SKP_Silk_resampler_init(
|
||||
}
|
||||
|
||||
/* Clear the states of all resampling filters, without resetting sampling rate ratio */
|
||||
SKP_int SKP_Silk_resampler_clear(
|
||||
SKP_int SKP_Silk_resampler_clear(
|
||||
SKP_Silk_resampler_state_struct *S /* I/O: Resampler state */
|
||||
)
|
||||
{
|
||||
@ -268,7 +268,7 @@ SKP_int SKP_Silk_resampler_clear(
|
||||
}
|
||||
|
||||
/* Resampler: convert from one sampling rate to another */
|
||||
SKP_int SKP_Silk_resampler(
|
||||
SKP_int SKP_Silk_resampler(
|
||||
SKP_Silk_resampler_state_struct *S, /* I/O: Resampler state */
|
||||
SKP_int16 out[], /* O: Output signal */
|
||||
const SKP_int16 in[], /* I: Input signal */
|
||||
@ -289,30 +289,30 @@ SKP_int SKP_Silk_resampler(
|
||||
|
||||
while( inLen > 0 ) {
|
||||
/* Number of input and output samples to process */
|
||||
nSamplesIn = SKP_min( inLen, S->batchSizePrePost );
|
||||
nSamplesIn = SKP_min( inLen, S->batchSizePrePost );
|
||||
nSamplesOut = SKP_SMULWB( S->ratio_Q16, nSamplesIn );
|
||||
|
||||
SKP_assert( SKP_RSHIFT32( nSamplesIn, S->nPreDownsamplers ) <= 480 );
|
||||
SKP_assert( SKP_RSHIFT32( nSamplesOut, S->nPostUpsamplers ) <= 480 );
|
||||
|
||||
if( S->nPreDownsamplers > 0 ) {
|
||||
if( S->nPreDownsamplers > 0 ) {
|
||||
S->down_pre_function( S->sDownPre, in_buf, in, nSamplesIn );
|
||||
if( S->nPostUpsamplers > 0 ) {
|
||||
S->resampler_function( S, out_buf, in_buf, SKP_RSHIFT32( nSamplesIn, S->nPreDownsamplers ) );
|
||||
if( S->nPostUpsamplers > 0 ) {
|
||||
S->resampler_function( S, out_buf, in_buf, SKP_RSHIFT32( nSamplesIn, S->nPreDownsamplers ) );
|
||||
S->up_post_function( S->sUpPost, out, out_buf, SKP_RSHIFT32( nSamplesOut, S->nPostUpsamplers ) );
|
||||
} else {
|
||||
S->resampler_function( S, out, in_buf, SKP_RSHIFT32( nSamplesIn, S->nPreDownsamplers ) );
|
||||
S->resampler_function( S, out, in_buf, SKP_RSHIFT32( nSamplesIn, S->nPreDownsamplers ) );
|
||||
}
|
||||
} else {
|
||||
S->resampler_function( S, out_buf, in, SKP_RSHIFT32( nSamplesIn, S->nPreDownsamplers ) );
|
||||
S->resampler_function( S, out_buf, in, SKP_RSHIFT32( nSamplesIn, S->nPreDownsamplers ) );
|
||||
S->up_post_function( S->sUpPost, out, out_buf, SKP_RSHIFT32( nSamplesOut, S->nPostUpsamplers ) );
|
||||
}
|
||||
|
||||
in += nSamplesIn;
|
||||
in += nSamplesIn;
|
||||
out += nSamplesOut;
|
||||
inLen -= nSamplesIn;
|
||||
inLen -= nSamplesIn;
|
||||
}
|
||||
} else
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
/* Input and output sampling rate are at most 48000 Hz */
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -50,7 +50,7 @@ void SKP_Silk_resampler_down2_3(
|
||||
SKP_int32 buf[ RESAMPLER_MAX_BATCH_SIZE_IN + ORDER_FIR ];
|
||||
SKP_int32 *buf_ptr;
|
||||
|
||||
/* Copy buffered samples to start of buffer */
|
||||
/* Copy buffered samples to start of buffer */
|
||||
SKP_memcpy( buf, S, ORDER_FIR * sizeof( SKP_int32 ) );
|
||||
|
||||
/* Iterate over blocks of frameSizeIn input samples */
|
||||
@ -58,7 +58,7 @@ void SKP_Silk_resampler_down2_3(
|
||||
nSamplesIn = SKP_min( inLen, RESAMPLER_MAX_BATCH_SIZE_IN );
|
||||
|
||||
/* Second-order AR filter (output in Q8) */
|
||||
SKP_Silk_resampler_private_AR2( &S[ ORDER_FIR ], &buf[ ORDER_FIR ], in,
|
||||
SKP_Silk_resampler_private_AR2( &S[ ORDER_FIR ], &buf[ ORDER_FIR ], in,
|
||||
SKP_Silk_Resampler_2_3_COEFS_LQ, nSamplesIn );
|
||||
|
||||
/* Interpolate filtered signal */
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -50,7 +50,7 @@ void SKP_Silk_resampler_down3(
|
||||
SKP_int32 buf[ RESAMPLER_MAX_BATCH_SIZE_IN + ORDER_FIR ];
|
||||
SKP_int32 *buf_ptr;
|
||||
|
||||
/* Copy buffered samples to start of buffer */
|
||||
/* Copy buffered samples to start of buffer */
|
||||
SKP_memcpy( buf, S, ORDER_FIR * sizeof( SKP_int32 ) );
|
||||
|
||||
/* Iterate over blocks of frameSizeIn input samples */
|
||||
@ -58,7 +58,7 @@ void SKP_Silk_resampler_down3(
|
||||
nSamplesIn = SKP_min( inLen, RESAMPLER_MAX_BATCH_SIZE_IN );
|
||||
|
||||
/* Second-order AR filter (output in Q8) */
|
||||
SKP_Silk_resampler_private_AR2( &S[ ORDER_FIR ], &buf[ ORDER_FIR ], in,
|
||||
SKP_Silk_resampler_private_AR2( &S[ ORDER_FIR ], &buf[ ORDER_FIR ], in,
|
||||
SKP_Silk_Resampler_1_3_COEFS_LQ, nSamplesIn );
|
||||
|
||||
/* Interpolate filtered signal */
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
@ -128,4 +128,3 @@ void SKP_Silk_resampler_private_ARMA4(
|
||||
}
|
||||
#endif
|
||||
#endif // SKP_Silk_RESAMPLER_H
|
||||
|
||||
|
@ -1,27 +1,27 @@
|
||||
/***********************************************************************
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
Copyright (c) 2006-2011, Skype Limited. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, (subject to the limitations in the disclaimer below)
|
||||
are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
- 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
|
||||
- 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
|
||||
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,
|
||||
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
|
||||
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.
|
||||
***********************************************************************/
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user