Loading lib_com/basop_util.c +38 −0 Original line number Diff line number Diff line Loading @@ -804,6 +804,44 @@ Word16 getScaleFactor32( /* o: measured headroom in range [ return i; } Word16 getScaleFactor32_copy( /* o: measured headroom in range [0..31], 0 if all x[i] == 0 */ const Word32 *x, /* i: array containing 32-bit data */ const Word32 len_x ) /* i: length of the array to scan */ { Word32 i; Word16 i_min, i_max; Word32 x_min, x_max; x_max = 0; move32(); x_min = 0; move32(); FOR( i = 0; i < len_x; i++ ) { if ( x[i] >= 0 ) x_max = L_max( x_max, x[i] ); if ( x[i] < 0 ) x_min = L_min( x_min, x[i] ); } i_max = 0x20; move16(); i_min = 0x20; move16(); if ( x_max != 0 ) i_max = norm_l( x_max ); if ( x_min != 0 ) i_min = norm_l( x_min ); i_max = s_and( s_min( i_max, i_min ), 0x1F ); return i_max; } Word16 normalize16( Word16 mantissa, Word16 *pexponent ) { Word16 tmp; Loading lib_com/basop_util.h +3 −0 Original line number Diff line number Diff line Loading @@ -235,6 +235,9 @@ Word16 getScaleFactor32( const Word32 *x, /* i : array containing 32-bit data */ const Word16 len_x ); /* i : length of the array to scan */ Word16 getScaleFactor32_copy( /* o: measured headroom in range [0..31], 0 if all x[i] == 0 */ const Word32 *x, /* i: array containing 32-bit data */ const Word32 len_x ); /* i: length of the array to scan */ /** * \brief normalize mantissa and update the exponent accordingly. Loading lib_dec/jbm_pcmdsp_apa.c +1 −1 Original line number Diff line number Diff line Loading @@ -892,7 +892,7 @@ UWord8 apa_exec_ivas_fx( UWord32 statsResetThreshold, statsResetShift; Word16 Q_a_out; Q_a_out = add( getScaleFactor32( a_in, i_mult( ps->num_channels, APA_BUF_PER_CHANNEL ) ), Q11 - Q16 ); Q_a_out = add( getScaleFactor32_copy( a_in, L_mult0( ps->num_channels, APA_BUF_PER_CHANNEL ) ), Q11 - Q16 ); statsResetThreshold = 1637; move32(); statsResetShift = 2; Loading Loading
lib_com/basop_util.c +38 −0 Original line number Diff line number Diff line Loading @@ -804,6 +804,44 @@ Word16 getScaleFactor32( /* o: measured headroom in range [ return i; } Word16 getScaleFactor32_copy( /* o: measured headroom in range [0..31], 0 if all x[i] == 0 */ const Word32 *x, /* i: array containing 32-bit data */ const Word32 len_x ) /* i: length of the array to scan */ { Word32 i; Word16 i_min, i_max; Word32 x_min, x_max; x_max = 0; move32(); x_min = 0; move32(); FOR( i = 0; i < len_x; i++ ) { if ( x[i] >= 0 ) x_max = L_max( x_max, x[i] ); if ( x[i] < 0 ) x_min = L_min( x_min, x[i] ); } i_max = 0x20; move16(); i_min = 0x20; move16(); if ( x_max != 0 ) i_max = norm_l( x_max ); if ( x_min != 0 ) i_min = norm_l( x_min ); i_max = s_and( s_min( i_max, i_min ), 0x1F ); return i_max; } Word16 normalize16( Word16 mantissa, Word16 *pexponent ) { Word16 tmp; Loading
lib_com/basop_util.h +3 −0 Original line number Diff line number Diff line Loading @@ -235,6 +235,9 @@ Word16 getScaleFactor32( const Word32 *x, /* i : array containing 32-bit data */ const Word16 len_x ); /* i : length of the array to scan */ Word16 getScaleFactor32_copy( /* o: measured headroom in range [0..31], 0 if all x[i] == 0 */ const Word32 *x, /* i: array containing 32-bit data */ const Word32 len_x ); /* i: length of the array to scan */ /** * \brief normalize mantissa and update the exponent accordingly. Loading
lib_dec/jbm_pcmdsp_apa.c +1 −1 Original line number Diff line number Diff line Loading @@ -892,7 +892,7 @@ UWord8 apa_exec_ivas_fx( UWord32 statsResetThreshold, statsResetShift; Word16 Q_a_out; Q_a_out = add( getScaleFactor32( a_in, i_mult( ps->num_channels, APA_BUF_PER_CHANNEL ) ), Q11 - Q16 ); Q_a_out = add( getScaleFactor32_copy( a_in, L_mult0( ps->num_channels, APA_BUF_PER_CHANNEL ) ), Q11 - Q16 ); statsResetThreshold = 1637; move32(); statsResetShift = 2; Loading