Commit 7d2da3fe authored by emerit's avatar emerit
Browse files

fix missing word16 word32 mismatch for long BRIR

parent eeddea40
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -2575,7 +2575,11 @@ ivas_error ivas_rend_openCrend(
)
{
    Word16 i, subframe_length;
#ifdef FIX_POINT_CREND_HRTF_FILE_FORMAT
    Word32 max_total_ir_len;
#else
    Word16 max_total_ir_len;
#endif
    HRTFS_HANDLE hHrtf;
    CREND_HANDLE hCrend;
    ivas_error error;
@@ -2653,7 +2657,6 @@ ivas_error ivas_rend_openCrend(
        max_total_ir_len = L_mult0( (Word16) hHrtf->num_iterations_diffuse[0], subframe_length );
#else
        max_total_ir_len = imult1616( (Word16) hHrtf->num_iterations_diffuse[0], subframe_length );

#endif
        IF( GT_16( max_total_ir_len, 0 ) )
#ifdef FIX_POINT_CREND_HRTF_FILE_FORMAT
@@ -2720,7 +2723,7 @@ ivas_error ivas_rend_openCrend(
            {
                return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" );
            }
            set_zero_fx( hCrend->lfe_delay_line_fx, max_total_ir_len );
            set_zero2_fx( hCrend->lfe_delay_line_fx, max_total_ir_len );
        }
        ELSE
        {
@@ -3271,6 +3274,7 @@ static ivas_error ivas_rend_crendConvolver(
                        tmp_out_im[k] = L_add( tmp_out_im[k], W_sat_m( W_mac_32_16( W_mult_32_16( pFreq_buf_re[k], pFreq_filt_im[k] ), pFreq_buf_im[k], pFreq_filt_re[k] ) ) );
                    }
                    offset = L_add( offset, k );
                    move32();
                }
                i = add( i, 1 );
            }
@@ -3280,9 +3284,9 @@ static ivas_error ivas_rend_crendConvolver(
        move16();
        FOR( m = 0; m < pCrend->hHrtfCrend->num_iterations_diffuse[j]; m++ )
        {
            offset_diffuse = add( hCrend->diffuse_delay_line_rw_index, add( m, 1 ) );
            offset_diffuse = offset_diffuse % pCrend->hHrtfCrend->num_iterations_diffuse[0];
            offset_diffuse = offset_diffuse * subframe_length;
            index_in = add( hCrend->diffuse_delay_line_rw_index, add( m, 1 ) );
            index_in = index_in % pCrend->hHrtfCrend->num_iterations_diffuse[0];
            offset_diffuse = L_mult0( index_in, subframe_length );
            if ( pCrend->hHrtfCrend->same_inv_diffuse_weight )
            {
                pFreq_buf_re = &hCrend->freq_buffer_re_diffuse_fx[0][offset_diffuse];