Commit 075e6ea0 authored by Devansh Kandpal's avatar Devansh Kandpal
Browse files

comments + cleanup

parent 235156bb
Loading
Loading
Loading
Loading
+14 −20
Original line number Diff line number Diff line
@@ -663,16 +663,17 @@ static ivas_error compute_t60_coeffs_fx(

        FOR( bin_idx = 0; bin_idx < tf_T60_len; bin_idx++ )
        {
            IF( EQ_16( pParams->pRt60_fx[bin_idx], 0 ) )
            IF( EQ_32( pParams->pRt60_fx[bin_idx], 0 ) )
            {
                target_gains_db_fx[bin_idx] == min120q8;
                //If RT60 is 0, target gain is -120dB
                target_gains_db_fx[bin_idx] = min120q8;
            }
            ELSE
            {
                tmp = BASOP_Util_Divide3232_Scale( L_deposit_h( loop_delay_sec_fx ), pParams->pRt60_fx[bin_idx], &e );
                IF( LT_16( e, -1 ) )
                {
                    target_gains_db_fx[bin_idx] == min120q8;
                    target_gains_db_fx[bin_idx] = min120q8;
                }
                ELSE
                {
@@ -680,18 +681,10 @@ static ivas_error compute_t60_coeffs_fx(
                    target_gains_db_fx[bin_idx] = mult( shr( min120q8, 1 ), tmp );  // Q8
                }
            }
            // TODO: check for RT60 not 0, in case of 0, target gain is simply -120 dB
            //tmp = BASOP_Util_Divide3232_Scale( L_deposit_h( loop_delay_sec_fx ), pParams->pRt60_fx[bin_idx], &e );
            // TODO: check for positive e, otherwise make it -120 dB
            //tmp = shr( tmp, add( e, 1 ) );
            //target_gains_db_fx[bin_idx] = mult( -30720, tmp ); // -60 in Q9 -> -30720 //targetgains is in Q9

            // tmp = BASOP_Util_Cmp_Mant32Exp( L_deposit_h( target_gains_db_fx[bin_idx] ), target_gains_db_exp[bin_idx], -2013265920, 7 );
            IF( tmp < 0 )
            // gain < - 120 ? -120: gain
            IF(LT_16(target_gains_db_fx[bin_idx], -30720))
                {
                target_gains_db_fx[bin_idx] = -30720; // -60 in Q9 -> -30720
                move16();
                // target_gains_db_exp[bin_idx] = 7;
                    target_gains_db_fx[bin_idx] = -30720;
                    move16();
                }
        }
@@ -699,16 +692,17 @@ static ivas_error compute_t60_coeffs_fx(
        pCoeffs_a_fx = &pParams->pT60_filter_coeff_fx[add( shl( i_mult( len, loop_idx ), 1 ), len )]; // Q14
        pCoeffs_b_fx = &pParams->pT60_filter_coeff_fx[shl( i_mult( len, loop_idx ), 1 )];             // Q14

        // Word16 val = target_gains_db_exp[0];
        move16();

        FOR( Word16 i = 1; i < nr_fc_fft_filter; i++ )
        {
            //Should not be required after condensation
            //val = s_max( val, target_gains_db_exp[i] );
        }

        FOR( Word16 i = 0; i < nr_fc_fft_filter; i++ )
        {
            //Should not be required after condensation 
            // target_gains_db_fx[i] = shr( target_gains_db_fx[i], sub( val, target_gains_db_exp[i] ) );
            move16();
        }