Commit 5ecf0b22 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch 'reverb_crash_fix' into 'main'

Reverb crash fix [allow regression]

See merge request !615
parents 29b454bb 93a1c79e
Loading
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -3089,9 +3089,9 @@ static void reverb_block_fx(
            ivas_reverb_iir_filt_2taps_feed_blk_fx( &( hReverb->t60[i] ), inner_bsize, pTemp_fx, ppOutput_fx[i] );
            FOR( ns = 0; ns < inner_bsize; ns++ )
            {
                pO0[ns] = L_add( imult3216( pOutput_i_fx[ns], mixer_0_i ), pO0[ns] ); /* mixer ch 0 */
                pO0[ns] = L_add_sat( imult3216( pOutput_i_fx[ns], mixer_0_i ), pO0[ns] ); /* mixer ch 0 */
                move32();
                pO1[ns] = L_add( imult3216( pOutput_i_fx[ns], mixer_1_i ), pO1[ns] ); /* mixer ch 1 */
                pO1[ns] = L_add_sat( imult3216( pOutput_i_fx[ns], mixer_1_i ), pO1[ns] ); /* mixer ch 1 */
                move32();
            }
        }
@@ -3123,7 +3123,7 @@ static void reverb_block_fx(
    }

    Word16 r_shift;
    r_shift = find_guarded_bits_fx( hReverb->fft_filter_ols.fft_size );
    r_shift = add( find_guarded_bits_fx( hReverb->fft_filter_ols.fft_size ), 1 );
    // Applying guard bits for the DoRTFT inside the post_fft_filter function
    FOR( k = 0; k < hReverb->fft_filter_ols.block_size; k++ )
    {
@@ -3139,6 +3139,14 @@ static void reverb_block_fx(
        post_fft_filter_fx( hReverb, pOut0_fx + start_sample_idx, pOut1_fx + start_sample_idx, pFFT_buf[0], pFFT_buf[1] );
    }

    FOR( k = 0; k < hReverb->fft_filter_ols.block_size; k++ )
    {
        pOut0_fx[k] = (Word32) L_shl( pOut0_fx[k], 1 );
        move32();
        pOut1_fx[k] = (Word32) L_shl( pOut1_fx[k], 1 );
        move32();
    }

    return;
}
#else
+2 −2
Original line number Diff line number Diff line
@@ -221,8 +221,8 @@ void ivas_reverb_iir_filt_2taps_feed_blk_fx(
    move32();
    FOR( i = 0; i < blk_size; i++ )
    {
        flt_output_fx = L_add( Mpy_32_32( L_shl( input[i], 1 ), flt_CoefB_0_fx ), flt_pBuffer_0_fx );
        flt_pBuffer_0_fx = L_sub( L_add( flt_pBuffer_1_fx, Mpy_32_32( L_shl( input[i], 1 ), flt_CoefB_1_fx ) ), Mpy_32_32( L_shl( flt_output_fx, 1 ), flt_CoefA_1_fx ) );
        flt_output_fx = L_add( L_shl( Mpy_32_32( input[i], flt_CoefB_0_fx ), 1 ), flt_pBuffer_0_fx );
        flt_pBuffer_0_fx = L_sub( L_add( flt_pBuffer_1_fx, L_shl( Mpy_32_32( input[i], flt_CoefB_1_fx ), 1 ) ), L_shl( Mpy_32_32( flt_output_fx, flt_CoefA_1_fx ), 1 ) );
        output[i] = flt_output_fx;
        move32();
    }