diff --git a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c index 922a4ef124df6d6bee92edd7fc9670cad46bfba5..412b8c22633d1bdf6574fa29d9b8d04d0f635c0a 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c @@ -2096,6 +2096,21 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices_fx( exp = sub( get_min_scalefactor( resultMtxRe_fx[0][0], resultMtxRe_fx[1][1] ), 2 ); tmp2 = L_add( L_shl( resultMtxRe_fx[0][0], exp ), L_shl( resultMtxRe_fx[1][1], exp ) ); q_tmp2 = add( q_res, exp ); + + /*Limiting value to Q63*/ + IF( GT_16( q_tmp2, 63 ) ) + { + tmp2 = L_shl( tmp2, sub( 63, q_tmp2 ) ); + q_tmp2 = 63; + move16(); + IF( EQ_32( tmp2, -1 ) ) + { + tmp2 = 0; + move32(); + q_tmp2 = 31; + move16(); + } + } IF( LT_16( q_CrEne, q_tmp2 ) ) { realizedOutputEne_fx = L_add( tmp1, L_shr( tmp2, sub( q_tmp2, q_CrEne ) ) );