Commit e6d5fc32 authored by Mohammadreza Naghibzadeh's avatar Mohammadreza Naghibzadeh
Browse files

Fix lower bound of hRenderConfig->distAtt_fx[0] calculation.

parent 7bdaf07b
Loading
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1306,7 +1306,7 @@ ivas_error RenderConfigReader_checkValues(
        /* Verify if the frequencies are in the ascending order (required for interpolation) */
        IF( band_idx != 0 )
        {
            if ( pRoom_acoustics->pFc_input_fx[band_idx] <= pRoom_acoustics->pFc_input_fx[band_idx - 1] )
            if ( LE_32( pRoom_acoustics->pFc_input_fx[band_idx], pRoom_acoustics->pFc_input_fx[band_idx - 1] ) )
            {
                tab_value_err_count = add( tab_value_err_count, 1 );
            }
@@ -1329,7 +1329,7 @@ ivas_error RenderConfigReader_checkValues(
        }

        /* Replace zero DSR values with very small positive values, to avoid issues with coloration filter design */
        if ( pRoom_acoustics->pAcoustic_dsr_fx[band_idx] <= 0 )
        if ( LE_32( pRoom_acoustics->pAcoustic_dsr_fx[band_idx], 0 ) )
        {
            pRoom_acoustics->pAcoustic_dsr_fx[band_idx] = ACOUSTIC_DSR_EPSILON_FX;
            move32();
@@ -1437,7 +1437,7 @@ ivas_error RenderConfigReader_checkValues(
#ifdef FIX_2500_ISM4_BIN_REVERB_DISTORTION
        /* Verify range of distance attenuation parameters: 0.1 <= distAtt[0] <= distAtt[1] */
        /*                                                  0.0 <= distAtt[2] <= 10.0       */
        hRenderConfig->distAtt_fx[0] = L_max( ONE_IN_Q27, hRenderConfig->distAtt_fx[0] );
        hRenderConfig->distAtt_fx[0] = L_max( 13421773 /* 0.1 in Q27 */, hRenderConfig->distAtt_fx[0] );
        hRenderConfig->distAtt_fx[1] = L_max( hRenderConfig->distAtt_fx[0], hRenderConfig->distAtt_fx[1] );
        hRenderConfig->distAtt_fx[2] = L_max( 0, hRenderConfig->distAtt_fx[2] ); // min( 10.0f, hRenderConfig->distAtt[2] ) is removed, because distAtt_fx[2] is always < 10.0f in Q30 format.