diff --git a/lib_enc/ivas_mcmasa_enc.c b/lib_enc/ivas_mcmasa_enc.c index ad46c3e4a7d96059ad59e4c8a61d3151708490ac..419094cc06a2bd6aff66ff1dbae77421d087be9d 100644 --- a/lib_enc/ivas_mcmasa_enc.c +++ b/lib_enc/ivas_mcmasa_enc.c @@ -746,7 +746,7 @@ void ivas_mcmasa_enc_fx( IF( hQMeta->surcoh_band_data != NULL ) { - hQMeta->q_direction[0].coherence_band_data[i].spread_coherence[j] = (UWord8) round_fx( Mpy_32_32( spreadCoherence_fx[j][i], L_shl( UINT8_MAX, Q16 ) ) ); // Q0 + hQMeta->q_direction[0].coherence_band_data[i].spread_coherence[j] = (UWord8) round_fx( Mpy_32_32( spreadCoherence_fx[j][i], L_shl( UINT8_MAX, Q17 ) ) ); // Q0 hQMeta->surcoh_band_data[i].surround_coherence[j] = (UWord8) round_fx( Mpy_32_32( surroundingCoherence_fx[k][i], L_shl( UINT8_MAX, Q16 ) ) ); // Q0 move16(); move16(); @@ -814,7 +814,7 @@ void ivas_mcmasa_enc_fx( WHILE( LT_16( j, nBands ) && hQMeta->all_coherence_zero ) { test(); - IF( GT_32( spreadCoherence_fx[i][j], MASA_COHERENCE_THRESHOLD_FX ) ) + IF( GT_32( spreadCoherence_fx[i][j], MASA_COHERENCE_THRESHOLD_FX >> 1 ) ) { hQMeta->all_coherence_zero = 0; move16(); @@ -877,7 +877,7 @@ void ivas_mcmasa_param_est_enc_fx( Word32 elevation_m_values_fx[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* o : Estimated elevation Q22 */ Word32 azimuth_m_values_fx[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* o : Estimated azimuth Q22 */ Word32 energyRatio_fx[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* o : Estimated direct-to-total ratio Q31 */ - Word32 spreadCoherence_fx[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* o : Estimated spread coherence Q31 */ + Word32 spreadCoherence_fx[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* o : Estimated spread coherence Q30 */ Word32 surroundingCoherence_fx[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS], /* o : Estimated surround coherence Q31 */ const Word16 input_frame, /* i : Input frame size */ const Word16 nchan_inp, /* i : Number of input channels */ @@ -1559,7 +1559,7 @@ void ivas_mcmasa_param_est_enc_fx( spreadCoh_fx = 0; move32(); } - spreadCoh_fx = L_shl( spreadCoh_fx, spreadCoh_e ); /*Q31*/ + spreadCoh_fx = L_shl( spreadCoh_fx, sub( spreadCoh_e, 1 ) ); /*Q30*/ /* Compute energy ratio tuning parameter */ lsEnergySum_fx = 0; @@ -1619,7 +1619,7 @@ void ivas_mcmasa_param_est_enc_fx( } /* Store values */ - spreadCoherence_fx[block_m_idx][band_m_idx] = spreadCoh_fx; /*Q31*/ + spreadCoherence_fx[block_m_idx][band_m_idx] = spreadCoh_fx; /*Q30*/ move32(); IF( hMcMasa->combineRatios )