Commit 69d1b540 authored by TYAGIRIS's avatar TYAGIRIS
Browse files

reduce precision of normalized response to avoid magnitude overshoot

parent 0d6141c3
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -4265,6 +4265,7 @@ void ivas_get_spar_md_from_dirac_enc_fx(

#ifdef NONBE_FIX_1748_SPAR_DIV_OPT
                    Word16 num_ch_order, norm_t, tmp_e;
                    Word32 tmp_norm_out;
#else
                    Word16 num_ch_order, hoa2_ch_order;
#endif
@@ -4341,9 +4342,9 @@ void ivas_get_spar_md_from_dirac_enc_fx(
                    {
                        FOR( ch = 1; ch < foa_ch; ch++ )
                        {
                            response_avg_fx[ch] = BASOP_Util_Divide3232_Scale_newton( response_avg_fx[ch], L_max( norm_fx, response_avg_fx[ch] ), &tmp_e ); // Q31 - tmp_e
                            move32();
                            response_avg_fx[ch] = L_shl( response_avg_fx[ch], sub( tmp_e, Q1 ) ); // q30
                            tmp_norm_out = BASOP_Util_Divide3232_Scale_newton( response_avg_fx[ch], L_max( norm_fx, L_abs( response_avg_fx[ch] ) ), &tmp_e ); // Q31 - tmp_e
                            tmp_norm_out = L_shl( tmp_norm_out, sub( tmp_e, Q1 ) );                                                                           // q30
                            response_avg_fx[ch] = L_and( tmp_norm_out, 0xffff8000 );                                                                          // q30
                            move32();
                        }
                    }
@@ -4868,6 +4869,7 @@ void ivas_get_spar_md_from_dirac_fx(
                    Word16 norm_q;
#ifdef NONBE_FIX_1748_SPAR_DIV_OPT
                    Word16 num_ch_order, norm_t, tmp_e;
                    Word32 tmp_norm_out;
#else
                    Word16 num_ch_order, hoa2_ch_order;
#endif
@@ -4946,9 +4948,9 @@ void ivas_get_spar_md_from_dirac_fx(
                    {
                        FOR( ch = 1; ch < foa_ch; ch++ )
                        {
                            response_avg_fx[ch] = BASOP_Util_Divide3232_Scale_newton( response_avg_fx[ch], L_max( norm_fx, response_avg_fx[ch] ), &tmp_e ); // Q31 - tmp_e
                            move32();
                            response_avg_fx[ch] = L_shl( response_avg_fx[ch], sub( tmp_e, Q1 ) ); // q30
                            tmp_norm_out = BASOP_Util_Divide3232_Scale_newton( response_avg_fx[ch], L_max( norm_fx, L_abs( response_avg_fx[ch] ) ), &tmp_e ); // Q31 - tmp_e
                            tmp_norm_out = L_shl( tmp_norm_out, sub( tmp_e, Q1 ) );                                                                           // q30
                            response_avg_fx[ch] = L_and( tmp_norm_out, 0xffff8000 );                                                                          // q30
                            move32();
                        }
                    }