Skip to content
Commits on Source (9)
...@@ -6123,12 +6123,14 @@ void non_linearity_ivas_fx( ...@@ -6123,12 +6123,14 @@ void non_linearity_ivas_fx(
scale = 1438814044; scale = 1438814044;
move32(); /* Q31; 0.67 in Q31 */ move32(); /* Q31; 0.67 in Q31 */
} }
#ifdef NONBE_1328_FIX_NON_LINEARITY #ifdef NONBE_1328_FIX_NON_LINEARITY
/* sc_factor = 32; */ /* Here we divise prev_scale, so 32 == 2 << (15-10) 1024.0 corresponds to 10 bits and 32 to 5 bits */ /* sc_factor = 32; */ /* Here we divide prev_scale, so 32 == 2 << (15-10) 1024.0 corresponds to 10 bits and 32 to 5 bits */
/* if ( element_mode > EVS_MONO ) */ /* element mode is not needed because the function is duplicated for IVAS */ /* if ( element_mode > EVS_MONO ) */ /* element mode is not needed because the function is duplicated for IVAS */
sc_factor = shl_sat( 1, sub( 15, max( 13 - norm_s( add( j, 1 ) ), 0 ) ) ); /* Adapt the scaling factor allowed depending of max position */ sc_factor = shl_sat( 1, sub( 16, max( 13 - norm_s( add( j, 1 ) ), 0 ) ) ); /* Adapt the scaling factor allowed depending of max position */
sc_factor = s_min( sc_factor, 16384 ); sc_factor = s_max( s_min( sc_factor, 16384 ), 2 * 32 ); /* note: The thresholding is purposely different between float and BASOP implementations. */
test();
IF( prev_scale <= 0 || GT_32( Mult_32_16( prev_scale, sc_factor ) /*Q30 -> Q31*/, scale /*Q31*/ ) ) IF( prev_scale <= 0 || GT_32( Mult_32_16( prev_scale, sc_factor ) /*Q30 -> Q31*/, scale /*Q31*/ ) )
#else #else
test(); test();
...@@ -6218,13 +6220,13 @@ void non_linearity_ivas_fx( ...@@ -6218,13 +6220,13 @@ void non_linearity_ivas_fx(
move32(); /* Q31; 0.67 in Q31 */ move32(); /* Q31; 0.67 in Q31 */
} }
test();
#ifdef NONBE_1328_FIX_NON_LINEARITY #ifdef NONBE_1328_FIX_NON_LINEARITY
/* sc_factor = 32; */ /* Here we divise prev_scale, so 32 == 2 << (15-10) 1024.0 corresponds to 10 bits and 32 to 5 bits */ /* sc_factor = 32; */ /* Here we divide prev_scale, so 32 == 2 << (15-10) 1024.0 corresponds to 10 bits and 32 to 5 bits */
/* if ( element_mode > EVS_MONO ) */ /* element mode is not needed because the function is duplicated for IVAS */ /* if ( element_mode > EVS_MONO ) */ /* element mode is not needed because the function is duplicated for IVAS */
sc_factor = shl_sat( 1, sub( 15, max( 12 - norm_s( add( j, 1 ) ), 0 ) ) ); /* Adapt the scaling factor allowed depending of max position */ sc_factor = shl_sat( 1, sub( 16, max( 12 - norm_s( add( j, 1 ) ), 0 ) ) ); /* Adapt the scaling factor allowed depending of max position */
sc_factor = s_min( sc_factor, 16384 ); sc_factor = s_max( s_min( sc_factor, 16384 ), 2 * 32 ); /* note: The thresholding is purposely different between float and BASOP implementations. */
test();
IF( prev_scale <= 0 || GT_32( Mult_32_16( prev_scale, sc_factor ) /*Q30 -> Q31*/, scale /*Q31*/ ) ) IF( prev_scale <= 0 || GT_32( Mult_32_16( prev_scale, sc_factor ) /*Q30 -> Q31*/, scale /*Q31*/ ) )
#else #else
IF( prev_scale <= 0 || GT_32( Mult_32_16( prev_scale, 64 ), scale ) ) IF( prev_scale <= 0 || GT_32( Mult_32_16( prev_scale, 64 ), scale ) )
......
...@@ -1264,7 +1264,7 @@ Word16 maximum_exp_fx( /* o : index of the maximum value ...@@ -1264,7 +1264,7 @@ Word16 maximum_exp_fx( /* o : index of the maximum value
FOR( j = 1; j < lvec_fx; j++ ) FOR( j = 1; j < lvec_fx; j++ )
{ {
#if 1 #if 0
if ( ( vec_fx[j] == 0 && vec_fx[j - 1] != 0 && vec_fx[j + 1] != 0 && lvec_fx > j ) ) if ( ( vec_fx[j] == 0 && vec_fx[j - 1] != 0 && vec_fx[j + 1] != 0 && lvec_fx > j ) )
{ {
assert( 0 ); assert( 0 );
......