diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index d6ac3843e45313d174d6e075ae7321b4095c700b..79e3d0c6381c5434b5063bcb6a83b43c3d2ce730 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1222,7 +1222,9 @@ enum #define MASA_TRANSP_BITS 1 #define NO_BITS_MASA_ISM_NO_OBJ 2 #ifdef NON_BE_FIX_BASOP_819_THRESHOLD_MASA2TOTAL -#define MASA2TOTAL_THR 0.9799999f +#define MASA2TOTAL_PREC_THRESHOLD 1e-5f //3.051757812500e-05 +#define MASA2TOTAL_PREC_INV_THRESHOLD 1e5f //32768.0f +#define MASA2TOTAL_THR 0.979999f #else #define MASA2TOTAL_THR 0.98f #endif diff --git a/lib_dec/ivas_qmetadata_dec.c b/lib_dec/ivas_qmetadata_dec.c index 4de07342ce7927fee84e2436230b9cf1fccdfa48..fb03044d9e78ef45573a79a378445fc519217620 100644 --- a/lib_dec/ivas_qmetadata_dec.c +++ b/lib_dec/ivas_qmetadata_dec.c @@ -8719,6 +8719,10 @@ void ivas_omasa_decode_masa_to_total_fx( move32(); masa_to_total_energy_ratio_fx[i][j] = L_min( ONE_IN_Q30, masa_to_total_energy_ratio_fx[i][j] ); move32(); +#ifdef NON_BE_FIX_BASOP_819_THRESHOLD_MASA2TOTAL + masa_to_total_energy_ratio_fx[i][j] = masa_to_total_energy_ratio_fx[i][j] >> 13; /* Q30 to reach the Q17 used before comparing with threshold*/ + masa_to_total_energy_ratio_fx[i][j] = masa_to_total_energy_ratio_fx[i][j] << 13; +#endif k = add( k, 1 ); } } @@ -8730,6 +8734,10 @@ void ivas_omasa_decode_masa_to_total_fx( FOR( j = 0; j < nbands; j++ ) { masa_to_total_energy_ratio_fx[i][j] = masa_to_total_energy_ratio_fx[0][j]; +#ifdef NON_BE_FIX_BASOP_819_THRESHOLD_MASA2TOTAL + masa_to_total_energy_ratio_fx[i][j] = masa_to_total_energy_ratio_fx[i][j] >> 13; /* Q30 to reach the Q17 used before comparing with threshold*/ + masa_to_total_energy_ratio_fx[i][j] = masa_to_total_energy_ratio_fx[i][j] << 13; +#endif move32(); } } @@ -8742,6 +8750,10 @@ void ivas_omasa_decode_masa_to_total_fx( FOR( i = 0; i < nblocks; i++ ) { masa_to_total_energy_ratio_fx[i][j] = masa_to_total_energy_ratio_fx[i][0]; +#ifdef NON_BE_FIX_BASOP_819_THRESHOLD_MASA2TOTAL + masa_to_total_energy_ratio_fx[i][j] = masa_to_total_energy_ratio_fx[i][j] >> 13; /* Q30 to reach the Q17 used before comparing with threshold*/ + masa_to_total_energy_ratio_fx[i][j] = masa_to_total_energy_ratio_fx[i][j] << 13; +#endif move32(); } } diff --git a/lib_enc/ivas_qmetadata_enc.c b/lib_enc/ivas_qmetadata_enc.c index e0a8fdeb14d48430f55b74c8bd6619beb2ad4aab..edf85f34558a58eb585031005b828c511636db4e 100644 --- a/lib_enc/ivas_qmetadata_enc.c +++ b/lib_enc/ivas_qmetadata_enc.c @@ -7808,8 +7808,8 @@ void ivas_omasa_encode_masa_to_total( masa_to_total_energy_ratio[i][j] = max( 0.0f, q_dct_data[k] ); masa_to_total_energy_ratio[i][j] = min( 1.0f, masa_to_total_energy_ratio[i][j] ); #ifdef NON_BE_FIX_BASOP_819_THRESHOLD_MASA2TOTAL - int_tmp = (int32_t) ( MASA_SUR_COH_PRECISION * masa_to_total_energy_ratio[i][j] ); - masa_to_total_energy_ratio[i][j] = (float) ( int_tmp * MASA_SUR_COH_THRESHOLD ); + int_tmp = (int32_t) ( ( MASA2TOTAL_PREC_INV_THRESHOLD * masa_to_total_energy_ratio[i][j] ) ); + masa_to_total_energy_ratio[i][j] = (float) ( int_tmp * MASA2TOTAL_PREC_THRESHOLD ); #endif k++; }