Commit 99dc937f authored by multrus's avatar multrus
Browse files

Merge branch 'basop-2640-basop-assert-in-omasa-decoder-with-frame-error' into 'main'

Resolve "BASOP assert in OMASA decoder with frame error"

Closes #2640

See merge request !3087
parents 46237146 743c882d
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -97,6 +97,7 @@
#define FIX_BASOP_2627_PARAM_MC_ILD_REMAP_EXP           /* FhG: BASOP #2627: accumulate 10^(ILD/10) using a dynamic exponent */
#define FIX_BASOP_2635_EFAP_ADD_VERTEX_ELE_ROUND        /* FhG: BASOP #2635: round |elevation| with anint_fx before the 90deg subtraction in add_vertex_fx */
#define FIX_BASOP_2639_INCORRECT_ARRAY_INDEX            /* Dolby: BASOP #2639: incorrect array index in ivas_spar_unquant_dtx_indicies */
#define FIX_BASOP_2640_MASA_STEREO_TYPE_ASSERT          /* Nokia: BASOP issue 2640: Fix assert by saturating shift when exponent difference is very large. */

/* ##################### End NON-BE switches ########################### */

+8 −0
Original line number Diff line number Diff line
@@ -2063,13 +2063,21 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls_fx(
            subtract_target_ratio = L_sub( BASOP_Util_Log2( masa_stereo_type_detect->subtract_power_y_smooth_fx ),
                                           BASOP_Util_Log2( masa_stereo_type_detect->target_power_y_smooth_fx ) ); // Q25
            exp = sub( masa_stereo_type_detect->q_subtract_power_y_smooth, masa_stereo_type_detect->q_target_power_y_smooth );
#ifdef FIX_BASOP_2640_MASA_STEREO_TYPE_ASSERT
            L_tmp = Mpy_32_32( L_sub( subtract_target_ratio, L_shl_sat( exp, 25 ) ), LOG10_2_Q31 ); // Q25
#else
            L_tmp = Mpy_32_32( L_sub( subtract_target_ratio, L_shl( exp, 25 ) ), LOG10_2_Q31 ); // Q25
#endif
        }
        ELSE
        {
            subtract_target_ratio = BASOP_Util_Log2( masa_stereo_type_detect->subtract_power_y_smooth_fx ); // Q25
            exp = sub( 31, masa_stereo_type_detect->q_subtract_power_y_smooth );
#ifdef FIX_BASOP_2640_MASA_STEREO_TYPE_ASSERT
            L_tmp = L_sub( Mpy_32_32( L_add( subtract_target_ratio, L_shl_sat( exp, 25 ) ), LOG10_2_Q31 ), -503316480 /* L_shl( -15, 25 ) */ /*log(EPSILON)*/ ); // Q25
#else
            L_tmp = L_sub( Mpy_32_32( L_add( subtract_target_ratio, L_shl( exp, 25 ) ), LOG10_2_Q31 ), -503316480 /* L_shl( -15, 25 ) */ /*log(EPSILON)*/ ); // Q25
#endif
        }
        subtract_target_ratio_db = Mpy_32_32( 1342177280 /* 10.0f * in Q27*/, L_tmp ); // (Q27, (Q25, Q31)) -> (Q27, Q25) -> Q21