FS-3486 --resolve update silk

This commit is contained in:
Brian West committed 2011-08-25 17:25:07 -05:00
1 parent b426ec0bfa
commit fdf74f449f
148 files changed
+2723 -7653

No files matched your search

+8 -4
View File
@@ -1,5 +1,5 @@
/***********************************************************************
Copyright (c) 2006-2010, Skype Limited. All rights reserved.
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:
@@ -43,6 +43,7 @@ SKP_int16 SKP_Silk_int16_array_maxabs( /* O Maximum absolute value, max: 2
)
{
SKP_int32 max = 0, i, lvl = 0, ind;
if( len == 0 ) return 0;
ind = len - 1;
max = SKP_SMULBB( vec[ ind ], vec[ ind ] );
@@ -55,10 +56,13 @@ SKP_int16 SKP_Silk_int16_array_maxabs( /* O Maximum absolute value, max: 2
}
/* Do not return 32768, as it will not fit in an int16 so may lead to problems later on */
lvl = SKP_abs( vec[ ind ] );
if( lvl > SKP_int16_MAX ) {
if( max >= 1073676289 ) { // (2^15-1)^2 = 1073676289
return( SKP_int16_MAX );
} else {
return( (SKP_int16)lvl );
if( vec[ ind ] < 0 ) {
return( -vec[ ind ] );
} else {
return( vec[ ind ] );
}
}
}