Skip to content
Commits on Source (16)
......@@ -799,13 +799,22 @@ cleanup:
destroy_SetOfHRTF( hSetOfHRTF );
}
IVAS_DEC_GetHrtfStatisticsHandle( hIvasDec, &hHrtfStatistics );
destroy_hrtf_statistics();
destroy_hrtf_statistics( hHrtfStatistics );
#endif
}
#ifdef FIX_1990_SANITIZER_IN_REVERB_LOAD
/* This free differs from float version and is done always. This should be safe to do even though we leave a return
* value as not handled. This is needed as HRTF statistics from ROM are currently converted from float values. */
#ifdef FIX_CREND_SIMPLIFY_CODE
IVAS_DEC_GetHrtfStatisticsHandle( hIvasDec, &hHrtfBinary.hHrtfStatistics );
destroy_hrtf_statistics( hHrtfBinary.hHrtfStatistics );
#else
IVAS_DEC_GetHrtfStatisticsHandle( hIvasDec, &hHrtfStatistics );
destroy_hrtf_statistics( hHrtfStatistics );
#endif
#endif
IVAS_DEC_Close( &hIvasDec );
CustomLsReader_close( &hLsCustomReader );
hrtfFileReader_close( &hrtfReader );
......
......@@ -87,6 +87,9 @@
#define FIX_1987_CRASH_OMASA_ENERGY /* FhG: Replace cldfbAnalysis_ts_fx_fix_q() with cldfbAnalysis_ts_fx_var_q() to avoid assertion error */
#define FIX_1985_SBA_714_HF_LOSS /* Dlb: Fix for issue 1985, improved dirac ref pow precision*/
#define FIX_1819_EIGENVALUE_ERROR /* FhG: Workaround for zero eigenvalue: replace with epsilon if det != 0*/
#define FIX_1990_SANITIZER_IN_REVERB_LOAD /* Nokia: Fix issue part of issue 1990 by introducing missing free of structure. */
#define FIX_1995_REVERB_INIT /* VA/Nokia: issue 1995: Fix use-of-uninitialized-value in ivas_binaural_reverb_init() */
/* #################### Start BASOP porting switches ############################ */
#define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */
......
......@@ -87,7 +87,7 @@ ivas_error ivas_hrtf_init(
move16();
move16();
move16();
#ifdef FIX_POINT_CREND_HRTF_FILE_FORMAT
#ifdef FIX_CREND_SIMPLIFY_CODE
hHrtf->factor_Q_latency_s_fx = 0;
move16();
hHrtf->factor_Q_inv_diffuse_weight = 0;
......@@ -348,17 +348,32 @@ static ivas_error ivas_rend_initCrend_fx(
hHrtf->latency_s_fx = CRendBin_Combined_BRIR_latency_s_fx; // Q31
hHrtf->max_num_iterations = CRendBin_Combined_BRIR_max_num_iterations_48kHz; // Q0
hHrtf->index_frequency_max_diffuse = CRendBin_Combined_BRIR_index_frequency_max_diffuse_48kHz; // Q0
#ifdef FIX_CREND_SIMPLIFY_CODE
hHrtf->factor_Q_latency_s_fx = CRendBin_Combined_BRIR_Q_latency_s_fx;
hHrtf->factor_Q_inv_diffuse_weight = CRendBin_Combined_BRIR_inv_diffuse_weight_Q_48kHz_fx;
hHrtf->factor_Q_pOut_to_bin = CRendBin_Combined_BRIR_coeff_Q_48kHz_fx;
move16();
move16();
move16();
#endif
}
ELSE
{
hHrtf->latency_s_fx = CRendBin_Combined_HRIR_latency_s_fx; // Q31
hHrtf->max_num_iterations = CRendBin_Combined_HRIR_max_num_iterations_48kHz; // Q0
hHrtf->index_frequency_max_diffuse = CRendBin_Combined_HRIR_index_frequency_max_diffuse_48kHz; // Q0
#ifdef FIX_CREND_SIMPLIFY_CODE
hHrtf->factor_Q_latency_s_fx = CRendBin_Combined_HRIR_Q_latency_s_fx;
hHrtf->factor_Q_inv_diffuse_weight = CRendBin_Combined_HRIR_inv_diffuse_weight_Q_48kHz_fx;
hHrtf->factor_Q_pOut_to_bin = CRendBin_Combined_HRIR_coeff_Q_48kHz_fx;
move16();
move16();
move16();
#endif
}
move32();
move16();
move16();
FOR( j = 0; j < BINAURAL_CHANNELS; j++ )
{
IF( EQ_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) )
......@@ -390,12 +405,28 @@ static ivas_error ivas_rend_initCrend_fx(
hHrtf->latency_s_fx = CRendBin_Combined_BRIR_latency_s_fx; // Q31
hHrtf->max_num_iterations = CRendBin_Combined_BRIR_max_num_iterations_32kHz; // Q0
hHrtf->index_frequency_max_diffuse = CRendBin_Combined_BRIR_index_frequency_max_diffuse_32kHz; // Q0
#ifdef FIX_CREND_SIMPLIFY_CODE
hHrtf->factor_Q_latency_s_fx = CRendBin_Combined_BRIR_Q_latency_s_fx;
hHrtf->factor_Q_inv_diffuse_weight = CRendBin_Combined_BRIR_inv_diffuse_weight_Q_32kHz_fx;
hHrtf->factor_Q_pOut_to_bin = CRendBin_Combined_BRIR_coeff_Q_32kHz_fx;
move16();
move16();
move16();
#endif
}
ELSE
{
hHrtf->latency_s_fx = CRendBin_Combined_HRIR_latency_s_fx; // Q31
hHrtf->max_num_iterations = CRendBin_Combined_HRIR_max_num_iterations_32kHz; // Q0
hHrtf->index_frequency_max_diffuse = CRendBin_Combined_HRIR_index_frequency_max_diffuse_32kHz; // Q0
#ifdef FIX_CREND_SIMPLIFY_CODE
hHrtf->factor_Q_latency_s_fx = CRendBin_Combined_HRIR_Q_latency_s_fx;
hHrtf->factor_Q_inv_diffuse_weight = CRendBin_Combined_HRIR_inv_diffuse_weight_Q_32kHz_fx;
hHrtf->factor_Q_pOut_to_bin = CRendBin_Combined_HRIR_coeff_Q_32kHz_fx;
move16();
move16();
move16();
#endif
}
move32();
move16();
......@@ -432,12 +463,28 @@ static ivas_error ivas_rend_initCrend_fx(
hHrtf->latency_s_fx = CRendBin_Combined_BRIR_latency_s_fx; // Q31
hHrtf->max_num_iterations = CRendBin_Combined_BRIR_max_num_iterations_16kHz;
hHrtf->index_frequency_max_diffuse = CRendBin_Combined_BRIR_index_frequency_max_diffuse_16kHz;
#ifdef FIX_CREND_SIMPLIFY_CODE
hHrtf->factor_Q_latency_s_fx = CRendBin_Combined_BRIR_Q_latency_s_fx;
hHrtf->factor_Q_inv_diffuse_weight = CRendBin_Combined_BRIR_inv_diffuse_weight_Q_32kHz_fx;
hHrtf->factor_Q_pOut_to_bin = CRendBin_Combined_BRIR_coeff_Q_32kHz_fx;
move16();
move16();
move16();
#endif
}
ELSE
{
hHrtf->latency_s_fx = CRendBin_Combined_HRIR_latency_s_fx; // Q31
hHrtf->max_num_iterations = CRendBin_Combined_HRIR_max_num_iterations_16kHz;
hHrtf->index_frequency_max_diffuse = CRendBin_Combined_HRIR_index_frequency_max_diffuse_16kHz;
#ifdef FIX_CREND_SIMPLIFY_CODE
hHrtf->factor_Q_latency_s_fx = CRendBin_Combined_HRIR_Q_latency_s_fx;
hHrtf->factor_Q_inv_diffuse_weight = CRendBin_Combined_HRIR_inv_diffuse_weight_Q_16kHz_fx;
hHrtf->factor_Q_pOut_to_bin = CRendBin_Combined_HRIR_coeff_Q_16kHz_fx;
move16();
move16();
move16();
#endif
}
move32();
move16();
......@@ -599,6 +646,14 @@ static ivas_error ivas_rend_initCrend_fx(
hHrtf->latency_s_fx = CRendBin_HOA3_HRIR_latency_s_fx; // Q31
hHrtf->max_num_iterations = CRendBin_HOA3_HRIR_max_num_iterations_48kHz;
hHrtf->index_frequency_max_diffuse = CRendBin_HOA3_HRIR_index_frequency_max_diffuse_48kHz;
#ifdef FIX_CREND_SIMPLIFY_CODE
hHrtf->factor_Q_latency_s_fx = CRendBin_HOA3_HRIR_Q_latency_s_fx;
hHrtf->factor_Q_inv_diffuse_weight = CRendBin_HOA3_HRIR_inv_diffuse_weight_Q_48kHz_fx;
hHrtf->factor_Q_pOut_to_bin = CRendBin_HOA3_HRIR_coeff_Q_48kHz_fx;
move16();
move16();
move16();
#endif
move32();
move16();
move16();
......@@ -638,6 +693,14 @@ static ivas_error ivas_rend_initCrend_fx(
hHrtf->latency_s_fx = CRendBin_HOA3_HRIR_latency_s_fx; // Q31
hHrtf->max_num_iterations = CRendBin_HOA3_HRIR_max_num_iterations_32kHz;
hHrtf->index_frequency_max_diffuse = CRendBin_HOA3_HRIR_index_frequency_max_diffuse_32kHz;
#ifdef FIX_CREND_SIMPLIFY_CODE
hHrtf->factor_Q_latency_s_fx = CRendBin_HOA3_HRIR_Q_latency_s_fx;
hHrtf->factor_Q_inv_diffuse_weight = CRendBin_HOA3_HRIR_inv_diffuse_weight_Q_32kHz_fx;
hHrtf->factor_Q_pOut_to_bin = CRendBin_HOA3_HRIR_coeff_Q_32kHz_fx;
move16();
move16();
move16();
#endif
move32();
move16();
move16();
......@@ -681,6 +744,14 @@ static ivas_error ivas_rend_initCrend_fx(
move32();
move16();
move16();
#ifdef FIX_CREND_SIMPLIFY_CODE
hHrtf->factor_Q_latency_s_fx = CRendBin_HOA3_HRIR_Q_latency_s_fx;
hHrtf->factor_Q_inv_diffuse_weight = CRendBin_HOA3_HRIR_inv_diffuse_weight_Q_16kHz_fx;
hHrtf->factor_Q_pOut_to_bin = CRendBin_HOA3_HRIR_coeff_Q_16kHz_fx;
move16();
move16();
move16();
#endif
FOR( i = 0; i < hHrtf->max_num_ir; i++ )
{
......@@ -729,6 +800,15 @@ static ivas_error ivas_rend_initCrend_fx(
move32();
move16();
move16();
#ifdef FIX_CREND_SIMPLIFY_CODE
hHrtf->factor_Q_latency_s_fx = CRendBin_HOA2_HRIR_Q_latency_s_fx;
hHrtf->factor_Q_inv_diffuse_weight = CRendBin_HOA2_HRIR_inv_diffuse_weight_Q_48kHz_fx;
hHrtf->factor_Q_pOut_to_bin = CRendBin_HOA2_HRIR_coeff_Q_48kHz_fx;
move16();
move16();
move16();
#endif
FOR( i = 0; i < hHrtf->max_num_ir; i++ )
{
......@@ -768,6 +848,14 @@ static ivas_error ivas_rend_initCrend_fx(
move32();
move16();
move16();
#ifdef FIX_CREND_SIMPLIFY_CODE
hHrtf->factor_Q_latency_s_fx = CRendBin_HOA2_HRIR_Q_latency_s_fx;
hHrtf->factor_Q_inv_diffuse_weight = CRendBin_HOA2_HRIR_inv_diffuse_weight_Q_32kHz_fx;
hHrtf->factor_Q_pOut_to_bin = CRendBin_HOA2_HRIR_coeff_Q_32kHz_fx;
move16();
move16();
move16();
#endif
FOR( i = 0; i < hHrtf->max_num_ir; i++ )
{
......@@ -808,6 +896,15 @@ static ivas_error ivas_rend_initCrend_fx(
move32();
move16();
move16();
#ifdef FIX_CREND_SIMPLIFY_CODE
hHrtf->factor_Q_latency_s_fx = CRendBin_HOA2_HRIR_Q_latency_s_fx;
hHrtf->factor_Q_inv_diffuse_weight = CRendBin_HOA2_HRIR_inv_diffuse_weight_Q_16kHz_fx;
hHrtf->factor_Q_pOut_to_bin = CRendBin_HOA2_HRIR_coeff_Q_16kHz_fx;
move16();
move16();
move16();
#endif
FOR( i = 0; i < hHrtf->max_num_ir; i++ )
{
......@@ -855,6 +952,14 @@ static ivas_error ivas_rend_initCrend_fx(
move32();
move16();
move16();
#ifdef FIX_CREND_SIMPLIFY_CODE
hHrtf->factor_Q_latency_s_fx = CRendBin_FOA_HRIR_Q_latency_s_fx;
hHrtf->factor_Q_inv_diffuse_weight = CRendBin_FOA_HRIR_inv_diffuse_weight_Q_48kHz_fx;
hHrtf->factor_Q_pOut_to_bin = CRendBin_FOA_HRIR_coeff_Q_48kHz_fx;
move16();
move16();
move16();
#endif
FOR( i = 0; i < hHrtf->max_num_ir; i++ )
{
......@@ -894,7 +999,14 @@ static ivas_error ivas_rend_initCrend_fx(
move32();
move16();
move16();
#ifdef FIX_CREND_SIMPLIFY_CODE
hHrtf->factor_Q_latency_s_fx = CRendBin_FOA_HRIR_Q_latency_s_fx;
hHrtf->factor_Q_inv_diffuse_weight = CRendBin_FOA_HRIR_inv_diffuse_weight_Q_32kHz_fx;
hHrtf->factor_Q_pOut_to_bin = CRendBin_FOA_HRIR_coeff_Q_32kHz_fx;
move16();
move16();
move16();
#endif
FOR( i = 0; i < hHrtf->max_num_ir; i++ )
{
FOR( j = 0; j < BINAURAL_CHANNELS; j++ )
......@@ -934,6 +1046,14 @@ static ivas_error ivas_rend_initCrend_fx(
move32();
move16();
move16();
#ifdef FIX_CREND_SIMPLIFY_CODE
hHrtf->factor_Q_latency_s_fx = CRendBin_FOA_HRIR_Q_latency_s_fx;
hHrtf->factor_Q_inv_diffuse_weight = CRendBin_FOA_HRIR_inv_diffuse_weight_Q_16kHz_fx;
hHrtf->factor_Q_pOut_to_bin = CRendBin_FOA_HRIR_coeff_Q_16kHz_fx;
move16();
move16();
move16();
#endif
FOR( i = 0; i < hHrtf->max_num_ir; i++ )
{
......@@ -1008,6 +1128,13 @@ static ivas_error ivas_rend_initCrend_fx(
move16();
move16();
move16();
hHrtf->factor_Q_inv_diffuse_weight = hHrtfCrend->factor_Q_inv_diffuse_weight;
hHrtf->factor_Q_latency_s_fx = hHrtfCrend->factor_Q_latency_s_fx;
hHrtf->factor_Q_pOut_to_bin = hHrtfCrend->factor_Q_pOut_to_bin;
move16();
move16();
move16();
FOR( j = 0; j < BINAURAL_CHANNELS; j++ )
{
......@@ -2096,7 +2223,7 @@ void ivas_rend_closeCldfbRend(
*
* Convolver block
*-----------------------------------------------------------------------------------------*/
#ifdef FIX_CREND_SIMPLIFY_CODE
static ivas_error ivas_rend_crendConvolver(
const CREND_WRAPPER *pCrend,
AUDIO_CONFIG inConfig,
......@@ -2302,7 +2429,237 @@ static ivas_error ivas_rend_crendConvolver(
return IVAS_ERR_OK;
}
#else
static ivas_error ivas_rend_crendConvolver(
const CREND_WRAPPER *pCrend,
AUDIO_CONFIG inConfig,
AUDIO_CONFIG outConfig,
Word32 *pcm_in[], // Qx
Word32 *pcm_out[], // Qx
const Word32 output_Fs,
const Word16 i_ts,
const Word16 pos_idx )
{
Word16 i, j, k, m;
Word16 subframe_length, idx_in;
Word16 lfe_idx_in;
Word32 offset, offset_in, offset_diffuse;
Word16 index_in;
Word16 nchan_in, nchan_out;
const Word32 *pIn;
Word32 *pFreq_buf_re, *pFreq_buf_im;
Word32 *pFreq_buf2_re, *pFreq_buf2_im;
const Word32 *pFreq_filt_re, *pFreq_filt_im;
Word32 pOut[L_FRAME48k * 2];
Word32 tmp_out_re[L_FRAME48k];
Word32 tmp_out_im[L_FRAME48k];
CREND_HANDLE hCrend;
ivas_error error;
hCrend = pCrend->hCrend[pos_idx];
IF( NE_32( ( error = getAudioConfigNumChannels( inConfig, &nchan_in ) ), IVAS_ERR_OK ) )
{
return error;
}
IF( NE_32( ( error = getAudioConfigNumChannels( outConfig, &nchan_out ) ), IVAS_ERR_OK ) )
{
return error;
}
/* subframe_length = (int16_t) ( output_Fs / FRAMES_PER_SEC ) / MAX_PARAM_SPATIAL_SUBFRAMES; */
subframe_length = extract_l( Mpy_32_32_r( output_Fs, 10737418 /* 1 / ( FRAMES_PER_SEC * MAX_PARAM_SPATIAL_SUBFRAMES ) in Q31 */ ) );
lfe_idx_in = -1;
move16();
IF( EQ_32( getAudioConfigType( inConfig ), IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) )
{
IF( NE_32( inConfig, IVAS_AUDIO_CONFIG_LS_CUSTOM ) )
{
lfe_idx_in = LFE_CHANNEL;
move16();
}
ELSE
{
assert( 0 && "Custom LS not supported in CRend" );
}
}
offset = L_mult0( hCrend->delay_line_rw_index, subframe_length ); /* subframe_length * ( pCrend->hHrtfCrend->max_num_iterations - 1 ); */
offset_diffuse = L_mult0( hCrend->diffuse_delay_line_rw_index, subframe_length ); /* subframe_length *( pCrend->hHrtfCrend->num_iterations_diffuse[0] - 1 ); */
IF( pCrend->hHrtfCrend->num_iterations_diffuse[0] > 0 )
{
set32_fx( &hCrend->freq_buffer_re_diffuse_fx[0][offset_diffuse], 0, subframe_length );
set32_fx( &hCrend->freq_buffer_im_diffuse_fx[0][offset_diffuse], 0, subframe_length );
if ( pCrend->hHrtfCrend->same_inv_diffuse_weight == 0 )
{
set32_fx( &hCrend->freq_buffer_re_diffuse_fx[1][offset_diffuse], 0, subframe_length );
set32_fx( &hCrend->freq_buffer_im_diffuse_fx[1][offset_diffuse], 0, subframe_length );
}
}
i = 0;
move16();
FOR( idx_in = 0; idx_in < nchan_in; idx_in++ )
{
pIn = &pcm_in[idx_in][i_ts * subframe_length];
IF( NE_16( idx_in, lfe_idx_in ) )
{
IF( pCrend->hHrtfCrend->num_iterations_diffuse[0] > 0 )
{
IF( pCrend->hHrtfCrend->same_inv_diffuse_weight )
{
pFreq_buf_re = &hCrend->freq_buffer_re_diffuse_fx[0][offset_diffuse];
pFreq_buf_im = &hCrend->freq_buffer_im_diffuse_fx[0][offset_diffuse];
pFreq_filt_re = &hCrend->freq_buffer_re_fx[i][offset];
pFreq_filt_im = &hCrend->freq_buffer_im_fx[i][offset];
FOR( k = 0; k < pCrend->hHrtfCrend->index_frequency_max_diffuse; k++ )
{
pFreq_buf_re[k] = L_add( Mpy_32_16_r( pFreq_filt_re[k], pCrend->hHrtfCrend->inv_diffuse_weight_fx[0][i] ), pFreq_buf_re[k] ); // Qx
pFreq_buf_im[k] = L_add( Mpy_32_16_r( pFreq_filt_im[k], pCrend->hHrtfCrend->inv_diffuse_weight_fx[0][i] ), pFreq_buf_im[k] ); // Qx
move32();
move32();
}
}
ELSE
{
pFreq_buf_re = &hCrend->freq_buffer_re_diffuse_fx[0][offset_diffuse];
pFreq_buf_im = &hCrend->freq_buffer_im_diffuse_fx[0][offset_diffuse];
pFreq_buf2_re = &hCrend->freq_buffer_re_diffuse_fx[1][offset_diffuse];
pFreq_buf2_im = &hCrend->freq_buffer_im_diffuse_fx[1][offset_diffuse];
pFreq_filt_re = &hCrend->freq_buffer_re_fx[i][offset];
pFreq_filt_im = &hCrend->freq_buffer_im_fx[i][offset];
for ( k = 0; k < pCrend->hHrtfCrend->index_frequency_max_diffuse; k++ )
{
pFreq_buf_re[k] = L_add( Mpy_32_16_r( pFreq_filt_re[k], pCrend->hHrtfCrend->inv_diffuse_weight_fx[0][i] ), pFreq_buf_re[k] ); // Qx
pFreq_buf_im[k] = L_add( Mpy_32_16_r( pFreq_filt_im[k], pCrend->hHrtfCrend->inv_diffuse_weight_fx[0][i] ), pFreq_buf_im[k] ); // Qx
move32();
move32();
pFreq_buf2_re[k] = L_add( Mpy_32_16_r( pFreq_filt_re[k], pCrend->hHrtfCrend->inv_diffuse_weight_fx[1][i] ), pFreq_buf2_re[k] ); // Qx
pFreq_buf2_im[k] = L_add( Mpy_32_16_r( pFreq_filt_im[k], pCrend->hHrtfCrend->inv_diffuse_weight_fx[1][i] ), pFreq_buf2_im[k] ); // Qx
move32();
move32();
}
}
}
pFreq_buf_re = &hCrend->freq_buffer_re_fx[i][offset]; // Qx
pFreq_buf_im = &hCrend->freq_buffer_im_fx[i][offset]; // Qx
ivas_mdft_fx( pIn, pFreq_buf_re, pFreq_buf_im, subframe_length, subframe_length );
#ifdef DEBUGGING
dbgwrite_txt( (const float *) pFreq_buf_re, subframe_length, "Fixed_pFreq_buf_re_mdft.txt", NULL );
dbgwrite_txt( (const float *) pFreq_buf_im, subframe_length, "Fixed_pFreq_buf_im_mdft.txt", NULL );
#endif
i = add( i, 1 );
}
}
FOR( j = 0; j < nchan_out; j++ )
{
set32_fx( tmp_out_re, 0, subframe_length );
set32_fx( tmp_out_im, 0, subframe_length );
i = 0;
move16();
FOR( idx_in = 0; idx_in < nchan_in; idx_in++ )
{
IF( NE_16( idx_in, lfe_idx_in ) )
{
offset = 0;
move16();
FOR( m = 0; m < pCrend->hHrtfCrend->num_iterations[i][j]; m++ )
{
index_in = add( add( hCrend->delay_line_rw_index, sub( pCrend->hHrtfCrend->max_num_iterations, pCrend->hHrtfCrend->num_iterations[i][j] ) ), add( m, 1 ) );
index_in = index_in % ( pCrend->hHrtfCrend->max_num_iterations );
move16();
offset_in = L_mult0( index_in, subframe_length );
pFreq_buf_re = &hCrend->freq_buffer_re_fx[i][offset_in]; // Qx
pFreq_buf_im = &hCrend->freq_buffer_im_fx[i][offset_in]; // Qx
pFreq_filt_re = &pCrend->hHrtfCrend->pOut_to_bin_re_fx[i][j][offset]; // Q29
pFreq_filt_im = &pCrend->hHrtfCrend->pOut_to_bin_im_fx[i][j][offset]; // Q29
FOR( k = 0; k < pCrend->hHrtfCrend->pIndex_frequency_max[i][j][m]; k++ )
{
tmp_out_re[k] = L_add( Msub_32_32( Mpy_32_32( pFreq_buf_re[k], pFreq_filt_re[k] ), pFreq_buf_im[k], pFreq_filt_im[k] ), tmp_out_re[k] ); // Qx - 2
tmp_out_im[k] = L_add( Madd_32_32( Mpy_32_32( pFreq_buf_re[k], pFreq_filt_im[k] ), pFreq_buf_im[k], pFreq_filt_re[k] ), tmp_out_im[k] ); // Qx - 2
move32();
move32();
}
offset = L_add( offset, k );
}
i = add( i, 1 );
}
}
offset = 0;
move16();
FOR( m = 0; m < pCrend->hHrtfCrend->num_iterations_diffuse[j]; m++ )
{
index_in = add( hCrend->diffuse_delay_line_rw_index, add( m, 1 ) );
index_in = index_in % pCrend->hHrtfCrend->num_iterations_diffuse[0];
move16();
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];
pFreq_buf_im = &hCrend->freq_buffer_im_diffuse_fx[0][offset_diffuse];
}
else
{
pFreq_buf_re = &hCrend->freq_buffer_re_diffuse_fx[j][offset_diffuse];
pFreq_buf_im = &hCrend->freq_buffer_im_diffuse_fx[j][offset_diffuse];
}
pFreq_filt_re = &pCrend->hHrtfCrend->pOut_to_bin_diffuse_re_fx[j][offset]; // Q31
pFreq_filt_im = &pCrend->hHrtfCrend->pOut_to_bin_diffuse_im_fx[j][offset]; // Q31
FOR( k = 0; k < pCrend->hHrtfCrend->pIndex_frequency_max_diffuse[j][m]; k++ )
{
tmp_out_re[k] = L_add( L_shr( Msub_32_32( Mpy_32_32( pFreq_buf_re[k], pFreq_filt_re[k] ), pFreq_buf_im[k], pFreq_filt_im[k] ), 2 ), tmp_out_re[k] ); // Qx - 2
tmp_out_im[k] = L_add( L_shr( Madd_32_32( Mpy_32_32( pFreq_buf_re[k], pFreq_filt_im[k] ), pFreq_buf_im[k], pFreq_filt_re[k] ), 2 ), tmp_out_im[k] ); // Qx - 2
move32();
move32();
}
offset = L_add( offset, k );
move32();
}
ivas_imdft_fx( tmp_out_re, tmp_out_im, pOut, subframe_length );
scale_sig32( pOut, shl( subframe_length, 1 ), 2 );
#ifdef DEBUGGING
dbgwrite_txt( (const float *) pOut, subframe_length << 1, "Fixed_imdft_out.txt", NULL );
#endif
pFreq_buf_re = &pcm_out[j][i_ts * subframe_length];
FOR( k = 0; k < subframe_length; k++ )
{
pFreq_buf_re[k] = L_add( pOut[k], hCrend->prev_out_buffer_fx[j][k] ); // Qx
hCrend->prev_out_buffer_fx[j][k] = pOut[k + subframe_length]; // Qx
move32();
move32();
}
}
hCrend->delay_line_rw_index = add( hCrend->delay_line_rw_index, 1 );
hCrend->delay_line_rw_index = hCrend->delay_line_rw_index % ( pCrend->hHrtfCrend->max_num_iterations );
move16();
move16();
IF( pCrend->hHrtfCrend->num_iterations_diffuse[0] > 0 )
{
hCrend->diffuse_delay_line_rw_index = add( hCrend->diffuse_delay_line_rw_index, 1 );
hCrend->diffuse_delay_line_rw_index = hCrend->diffuse_delay_line_rw_index % ( pCrend->hHrtfCrend->num_iterations_diffuse[0] );
move16();
move16();
}
return IVAS_ERR_OK;
}
#endif
/*-----------------------------------------------------------------------------------------*
* Function ivas_rend_crendProcessSubframe()
*
......
......@@ -989,8 +989,7 @@ ivas_error ivas_binaural_reverb_init(
const IVAS_ROOM_ACOUSTICS_CONFIG_DATA *roomAcoustics, /* i/o: room acoustics parameters */
const Word32 sampling_rate, /* i : sampling rate */
const Word32 *defaultTimes, /* i : default reverberation times */
const Word32 *defaultEne /* i : default reverberation energies */
,
const Word32 *defaultEne, /* i : default reverberation energies */
Word32 *earlyEne /* i/o: Early part energies to be modified */
);
......@@ -1018,6 +1017,7 @@ ivas_error ivas_reverb_open_fx(
void ivas_reverb_close(
REVERB_HANDLE *hReverb /* i/o: Reverberator handle */
);
ivas_error ivas_reverb_process_fx(
const REVERB_HANDLE hReverb, /* i : Reverberator handle */
const AUDIO_CONFIG input_audio_config, /* i : reverb. input audio configuration */
......@@ -1033,8 +1033,9 @@ void ivas_rev_delay_line_init(
const UWord16 delay, /* i : the delay */
const UWord16 maxdelay /* i : maximum delay to be supported */
);
/*! r: sample gotten out of delay line, and amplified by set gain */
Word32 ivas_rev_delay_line_get_sample_fx( /* Q11 */
/*! r: sample gotten out of delay line, and amplified by set gain, Q11 */
Word32 ivas_rev_delay_line_get_sample_fx(
ivas_rev_delay_line_t *pDelay /* i/o: the delay line */
);
......@@ -1054,18 +1055,19 @@ void ivas_rev_delay_line_feed_sample_blk_fx(
const UWord16 blk_size, /* i : number of samples in the input data block */
Word32 *input /* i : the samples to feed Q11 */
);
void ivas_reverb_iir_filt_init(
ivas_rev_iir_filter_t *iirFilter, /* o : IIR filter */
const UWord16 maxTaps /* i : maximum number of filter taps */
);
void ivas_reverb_iir_filt_set(
ivas_rev_iir_filter_t *iirFilter, /* i/o: IIR filter */
UWord16 nr_taps, /* i : number of IIR filter taps */
const Word16 *coefA, /* i : A filter coefficients to set */
const Word16 *coefB /* i : the B filter coefficients to set */
);
void ivas_reverb_iir_filt_2taps_feed_blk_fx(
ivas_rev_iir_filter_t *iirFilter, /* i/o: IIR filter */
const UWord16 blk_size, /* i : size */
......@@ -1076,6 +1078,7 @@ void ivas_reverb_iir_filt_2taps_feed_blk_fx(
UWord16 int_log2(
UWord32 powerOf2
);
Word16 ivas_reverb_t2f_f2t_init(
ivas_reverb_t2f_f2t_t *t2f_f2t,
const Word16 fft_size,
......@@ -1085,6 +1088,7 @@ Word16 ivas_reverb_t2f_f2t_init(
void ivas_reverb_t2f_f2t_ClearHistory(
ivas_reverb_t2f_f2t_t *t2f_f2t
);
void ivas_reverb_t2f_f2t_in_fx(
ivas_reverb_t2f_f2t_t *t2f_f2t,
Word32 *input_L, // i: Qx
......@@ -1100,6 +1104,7 @@ void ivas_reverb_t2f_f2t_out_fx(
Word32 *output_L, // i/o: Qx
Word32 *output_R // i/o: Qx
);
Word16 ivas_reverb_fft_filter_init(
ivas_reverb_fft_filter_t *fft_filter,
const Word16 fft_size
......@@ -1109,6 +1114,7 @@ void ivas_reverb_fft_filter_ComplexMul_fx(
ivas_reverb_fft_filter_t *fft_filter, /* i */
Word32 *buffer /* i/o: Qx */
);
void ivas_reverb_fft_filter_CrossMix_fx(
Word32 *buffer0, // i/o: Qx
Word32 *buffer1, // i/o: Qx
......@@ -1118,7 +1124,9 @@ void ivas_reverb_fft_filter_CrossMix_fx(
void ivas_reverb_fft_filter_ConvertFFTWF_2_FFTR_fx(
rv_fftwf_type_complex_fx *spectrum, // i: Qx
Word32 *fft_real, // o: Qx
const Word16 fft_size);
const Word16 fft_size
);
void ivas_reverb_define_window_fft_fx(
Word32 *pWindow, //output in Q31
const Word16 transitionStart,
......@@ -1135,6 +1143,7 @@ Word16 ivas_reverb_calc_color_filters_fx(
Word16 *q_pBeqL,
Word16 *q_pBeqR
);
Word16 ivas_reverb_calc_correl_filters_fx(
Word32 *pTargetICC, //input in Q30
const Word32 *pWindow, //input in Q30
......@@ -1144,6 +1153,7 @@ Word16 ivas_reverb_calc_correl_filters_fx(
Word16 *q_pU, //Output q
Word16 *q_pV //output q
);
void ivas_reverb_calc_color_levels_fx(
const Word32 output_Fs,
const Word16 freq_count,
......@@ -1155,14 +1165,16 @@ void ivas_reverb_calc_color_levels_fx(
const Word16 *pLoop_delays,
const Word32 *pT60_filter_coeff, //input in Q31
Word32 *pTarget_color_L, //output in Q30
Word32 *pTarget_color_R); //output in Q30
Word32 *pTarget_color_R //output in Q30
);
ivas_error ivas_reverb_prepare_cldfb_params(
const IVAS_ROOM_ACOUSTICS_CONFIG_DATA *pInput_params,
const HRTFS_STATISTICS_HANDLE hHrtfStatistics,
const Word32 output_Fs,
Word32 *pOutput_t60,
Word32 *pOutput_ene );
Word32 *pOutput_ene
);
void ivas_reverb_interp_on_freq_grid_fx(
const Word16 input_table_size,
......@@ -1172,6 +1184,8 @@ void ivas_reverb_interp_on_freq_grid_fx(
const Word32 *pOutput_fc,
Word32 *pOutput_grid //output in the same Q-format as input
);
/*---------------------------------------------------------------------------------*
* Shoebox Prototypes
*-----------------------------------------------------------------------------------*/
......
......@@ -41,24 +41,6 @@
#include "wmc_auto.h"
#include "debug.h"
static Word16 wrap_rad_fixed(
Word32 angle /* Q13 */ )
{
Word32 L_tmp = angle;
move32();
/* Wrap azimuth value */
WHILE( GT_32( L_tmp, EVS_PI_FX ) )
{
L_tmp = L_sub( L_tmp, EVS_2PI_FX );
}
WHILE( LE_32( L_tmp, -EVS_PI_FX ) )
{
L_tmp = L_add( L_tmp, EVS_2PI_FX );
}
return extract_l( L_tmp );
}
/* The reverberator structure implemented here is described in detail in:
* Vilkamo, J., Neugebauer, B., & Plogsties, J. (2012). Sparse frequency-domain reverberator.
......@@ -78,22 +60,14 @@ static Word16 wrap_rad_fixed(
#define INNER_BLK_SIZE 80 /* size of data blocks used for more efficient delay line and IIR filter processing */
/* should be a divisor of the frame length at any sampling rate and an even number*/
#define FFT_FILTER_WND_FLAT_REGION ( 0.40f ) /* flat section (==1) length of FFT filter window, in proportion to overlap */
#define FFT_FILTER_WND_TRANS_REGION ( 0.15f ) /* transition (1->0) length of FFT filter window, in proportion to overlap */
#define FFT_FILTER_WND_FLAT_REGION_FX ( 26214 ) /*Q16 flat section (==1) length of FFT filter window, in proportion to overlap */
#define FFT_FILTER_WND_TRANS_REGION_FX ( 9830 ) /*Q16 transition (1->0) length of FFT filter window, in proportion to overlap */
#define REF_LF_MIN ( 100.0f )
#define REF_LF_MAX ( 250.0f )
#define REF_HF_MIN ( 5000.0f )
#define REF_HF_MAX ( 7950.0f )
#define REF_LF_MIN_FX ( 100 )
#define REF_LF_MAX_FX ( 250 )
#define REF_HF_MIN_FX ( 5000 )
#define REF_HF_MAX_FX ( 7950 )
#define LF_BIAS ( 0.5f )
#define DEFAULT_SRC_DIST ( 1.5f ) /* default source distance [m] for reverb dmx factor computing */
#define DMX_GAIN ( 1410542208 )
#define IVAS_REVERB_FFT_SIZE_48K ( 512 )
#define IVAS_REVERB_FFT_SIZE_32K ( 512 )
......@@ -109,27 +83,30 @@ static Word16 wrap_rad_fixed(
#define M120Q8 ( -30720 ) //-120 in Q8
#endif
const Word16 init_loop_delay[IVAS_REV_MAX_NR_BRANCHES] = { 37, 31, 29, 23, 19, 17, 13, 11 };
const Word16 default_loop_delay_48k[IVAS_REV_MAX_NR_BRANCHES] = { 2309, 1861, 1523, 1259, 1069, 919, 809, 719 };
const Word16 default_loop_delay_32k[IVAS_REV_MAX_NR_BRANCHES] = { 1531, 1237, 1013, 839, 709, 613, 541, 479 };
const Word16 default_loop_delay_16k[IVAS_REV_MAX_NR_BRANCHES] = { 769, 619, 509, 421, 353, 307, 269, 239 };
static const Word16 init_loop_delay[IVAS_REV_MAX_NR_BRANCHES] = { 37, 31, 29, 23, 19, 17, 13, 11 };
static const Word16 default_loop_delay_48k[IVAS_REV_MAX_NR_BRANCHES] = { 2309, 1861, 1523, 1259, 1069, 919, 809, 719 };
static const Word16 default_loop_delay_32k[IVAS_REV_MAX_NR_BRANCHES] = { 1531, 1237, 1013, 839, 709, 613, 541, 479 };
static const Word16 default_loop_delay_16k[IVAS_REV_MAX_NR_BRANCHES] = { 769, 619, 509, 421, 353, 307, 269, 239 };
/*------------------------------------------------------------------------------------------*
* Local Struct definition
*------------------------------------------------------------------------------------------*/
typedef struct ivas_reverb_params_t
{
Word16 pre_delay; /* Delay of the FDC reverb, first peak after pre_delay samples. Note that */
/* there may be non-zero samples earlier due to the filters being */
/* linear-phase. */
Word16 nr_loops; /* Number of feedback loops (= L) */
Word16 pLoop_delays[IVAS_REV_MAX_NR_BRANCHES]; /* Delay for each feedback loop in samples. */ /* Feedback [L][L] matrix that mixes the signals of the loops. */
Word16 pLoop_delays[IVAS_REV_MAX_NR_BRANCHES]; /* Delay for each feedback loop in samples. */
Word32 pLoop_feedback_matrix_fx[IVAS_REV_MAX_NR_BRANCHES * IVAS_REV_MAX_NR_BRANCHES]; /* Feedback [L][L] matrix that mixes the signals of the loops. */
Word16 nr_outputs; /* Nr of signals extracted from the loops (= S). */
/* Currently this is fixed to 2. */ /* Mix [S][L] matrix from feedback loops to outputs. */
Word16 pLoop_extract_matrix_fx[MAX_NR_OUTPUTS * IVAS_REV_MAX_NR_BRANCHES]; /* Mix [S][L] matrix from feedback loops to outputs. */ /* In Matlab: [S x L] - Currently S=2, later may be more than 2 for speaker playback. */
/* Currently this is fixed to 2. */
Word16 pLoop_extract_matrix_fx[MAX_NR_OUTPUTS * IVAS_REV_MAX_NR_BRANCHES]; /* Mix [S][L] matrix from feedback loops to outputs. */
/* In Matlab: [S x L] - Currently S=2, later may be more than 2 for speaker playback. */
Word16 t60_filter_order; /* Filter order (length of vector) */
Word16 pT60_filter_coeff_fx[MAX_NR_OUTPUTS * IVAS_REV_MAX_NR_BRANCHES * IVAS_REV_MAX_IIR_FILTER_LENGTH];
Word16 pT60_filter_coeff_fx[MAX_NR_OUTPUTS * IVAS_REV_MAX_NR_BRANCHES * IVAS_REV_MAX_IIR_FILTER_LENGTH]; /* Filters [][] in feedback loops, controlling T60. */
/* In Matlab: IIR: [(2 * L) x (<order> + 1)] (odd: b-vector, even: a-vector) */
/* In Matlab: FIR: [L x <order>] */
Word32 *pFc_fx; /* Center frequencies for FFT filter design */
......@@ -146,12 +123,40 @@ typedef struct ivas_reverb_params_t
/* when nr_outputs != 2 correlation filtering is never supported). */
} ivas_reverb_params_t;
/*------------------------------------------------------------------------------------------*
* Static functions declarations
*------------------------------------------------------------------------------------------*/
static ivas_error calc_jot_t60_coeffs_fx( Word16 *pH_dB_fx, Word16 pH_dB_exp, const UWord16 nrFrequencies, Word16 *pFrequencies_fx, Word16 *pCoeffA_fx, Word16 *pCoeffB_fx, const Word16 fNyquist_fx );
/*-------------------------------------------------------------------------
* wrap_rad_fixed()
*
*
*------------------------------------------------------------------------*/
static Word16 wrap_rad_fixed(
Word32 angle /* Q13 */ )
{
Word32 L_tmp = angle;
move32();
/* Wrap azimuth value */
WHILE( GT_32( L_tmp, EVS_PI_FX ) )
{
L_tmp = L_sub( L_tmp, EVS_2PI_FX );
}
WHILE( LE_32( L_tmp, -EVS_PI_FX ) )
{
L_tmp = L_add( L_tmp, EVS_2PI_FX );
}
return extract_l( L_tmp );
}
/*-------------------------------------------------------------------------
* binRend_rand()
*
......@@ -208,7 +213,6 @@ static void ivas_binaural_reverb_setPreDelay_fx(
*
*------------------------------------------------------------------------*/
static void ivas_binaural_reverb_setReverbTimes_fx(
REVERB_STRUCT_HANDLE hReverb, /* i/o: binaural reverb handle */
const Word32 output_Fs, /* i : sampling_rate */
......@@ -217,7 +221,6 @@ static void ivas_binaural_reverb_setReverbTimes_fx(
)
{
Word16 bin, ch, tap, sample;
Word32 binCenterFreq_fx, diffuseFieldICC_fx, tmpVal_fx, attenuationFactorPerSample_fx, L_tmp;
Word32 intendedEnergy_fx, actualizedEnergy_fx, energyBuildup_fx, currentEnergy_fx, attenuationFactorPerSampleSq_fx;
Word16 tmp, tmp_exp, scale, tmpVal_exp, attenuationFactorPerSample_exp, attenuationFactorPerSampleSq_exp, energyBuildup_exp, currentEnergy_exp, intendedEnergy_exp, actualizedEnergy_exp;
......@@ -338,7 +341,6 @@ static void ivas_binaural_reverb_setReverbTimes_fx(
/* Design sparse decorrelation filters. The decorrelation filters, due to random procedures involved,
* may affect the spectrum of the output. The spectral effect is therefore monitored and compensated for. */
intendedEnergy_fx = 0;
move32();
intendedEnergy_exp = 0;
......@@ -350,7 +352,6 @@ static void ivas_binaural_reverb_setReverbTimes_fx(
FOR( ch = 0; ch < BINAURAL_CHANNELS; ch++ )
{
energyBuildup_fx = 0;
move32();
energyBuildup_exp = 0;
......@@ -447,9 +448,11 @@ static void ivas_binaural_reverb_setReverbTimes_fx(
hReverb->reverbEqGains_fx[bin] = L_shl( hReverb->reverbEqGains_fx[bin], reverb_exp ); // making as Q31
move32();
}
return;
}
/*-----------------------------------------------------------------------------------------*
* Function compute_feedback_matrix()
*
......@@ -484,7 +487,6 @@ static ivas_error compute_feedback_matrix_fx(
}
}
return IVAS_ERR_OK;
}
......@@ -516,6 +518,8 @@ static void compute_2_out_extract_matrix_fx(
return;
}
/*-----------------------------------------------------------------------------------------*
* Function set_base_config()
*
......@@ -569,6 +573,7 @@ static ivas_error set_base_config_fx(
}
compute_2_out_extract_matrix_fx( pParams->pLoop_extract_matrix_fx, pParams->nr_loops );
/* pre-set the various filters; they will be set later based on reverb configuration */
pParams->t60_filter_order = 1; /* set to 1 in base config. */
move16();
......@@ -587,17 +592,22 @@ static ivas_error set_base_config_fx(
return IVAS_ERR_OK;
}
/*-----------------------------------------------------------------------------------------*
* Function calc_dmx_gain()
*
* Computes the downmix gain
*-----------------------------------------------------------------------------------------*/
static Word32 calc_dmx_gain_fx( void )
{
const Word32 gain = DMX_GAIN; // Q23
move32();
return gain;
}
/*-----------------------------------------------------------------------------------------*
* Function calc_predelay()
*
......@@ -610,6 +620,7 @@ static void calc_predelay_fx(
const Word32 output_Fs )
{
Word16 predelay, fbdelay, output_frame;
predelay = round_fx( L_shl( Mult_32_32( L_shl( output_Fs, 15 ), acoustic_predelay_sec ), 5 ) );
output_frame = extract_l( Mult_32_16( output_Fs, INV_FRAME_PER_SEC_Q15 ) );
fbdelay = pParams->pLoop_delays[sub( pParams->nr_loops, 1 )];
......@@ -630,16 +641,17 @@ static void calc_predelay_fx(
pParams->pre_delay = predelay; // Q0
move16();
move16();
move16();
return;
}
/*-----------------------------------------------------------------------------------------*
* Function compute_t60_coeffs()
*
* Calculate Jot reverb's T60 filter coefficients
*-----------------------------------------------------------------------------------------*/
static ivas_error compute_t60_coeffs_fx(
ivas_reverb_params_t *pParams,
const Word16 nr_fc_fft_filter, /*Q0*/
......@@ -764,6 +776,7 @@ static ivas_error compute_t60_coeffs_fx(
pParams->pLoop_delays[loop_idx] = sub( pParams->pLoop_delays[loop_idx], len ); // Q0
move16();
}
return error;
}
......@@ -774,7 +787,6 @@ static ivas_error compute_t60_coeffs_fx(
* Calculate 1st order low shelf filter
*-----------------------------------------------------------------------------------------*/
static void calc_low_shelf_first_order_filter_fx(
Word16 *pNum, /* Q14 */
Word16 *pDen, /* Q14 */
......@@ -897,6 +909,7 @@ static void calc_low_shelf_first_order_filter_fx(
move16();
pDen[0] = shl( 1, 14 ); // Q14
move16();
return;
}
......@@ -907,7 +920,6 @@ static void calc_low_shelf_first_order_filter_fx(
* Calculate Jot reverb's T60 filters
*-----------------------------------------------------------------------------------------*/
static ivas_error calc_jot_t60_coeffs_fx(
Word16 *pH_dB_fx,
Word16 pH_dB_exp,
......@@ -1033,23 +1045,25 @@ static ivas_error calc_jot_t60_coeffs_fx(
move16();
}
#endif
/* call low-pass iir shelf */
calc_low_shelf_first_order_filter_fx( pCoeffB_fx, pCoeffA_fx, f0_fx, lin_gain_lf_fx, lin_gain_hf_fx );
return IVAS_ERR_OK;
}
/*-----------------------------------------------------------------------------------------*
* Function initialize_reverb_filters()
*
* Set the number of branches (feedback loops) and Initializes the memory structure (pointers to data)
*-----------------------------------------------------------------------------------------*/
static ivas_error initialize_reverb_filters_fx(
REVERB_HANDLE hReverb )
{
ivas_error error;
error = IVAS_ERR_OK;
/* init correlation and coloration filters */
IF( NE_32( ( error = ivas_reverb_t2f_f2t_init( &hReverb->fft_filter_ols, hReverb->fft_size, hReverb->fft_subblock_size ) ), IVAS_ERR_OK ) )
{
......@@ -1076,9 +1090,10 @@ static ivas_error initialize_reverb_filters_fx(
return error;
}
return error;
return IVAS_ERR_OK;
}
/*-----------------------------------------------------------------------------------------*
* Function set_t60_filter()
*
......@@ -1107,6 +1122,7 @@ static ivas_error set_t60_filter(
return IVAS_ERR_OK;
}
/*-----------------------------------------------------------------------------------------*
* Function set_feedback_delay()
*
......@@ -1128,6 +1144,8 @@ static ivas_error set_feedback_delay_fx(
return IVAS_ERR_OK;
}
/*-----------------------------------------------------------------------------------------*
* Function set_feedback_gain()
*
......@@ -1153,6 +1171,8 @@ static ivas_error set_feedback_gain_fx(
return IVAS_ERR_OK;
}
/*-----------------------------------------------------------------------------------------*
* Function set_correl_fft_filter()
*
......@@ -1236,6 +1256,8 @@ static ivas_error set_mixer_level_fx(
return IVAS_ERR_OK;
}
/*-----------------------------------------------------------------------------------------*
* Function clear_buffers_fx()
*
......@@ -1265,6 +1287,7 @@ static void clear_buffers_fx(
return;
}
/*-----------------------------------------------------------------------------------------*
* Function set_fft_and_datablock_sizes_fx()
*
......@@ -1308,6 +1331,7 @@ static void set_fft_and_datablock_sizes_fx(
return;
}
/*-----------------------------------------------------------------------------------------*
* Function set_reverb_acoustic_data_fx()
*
......@@ -1338,8 +1362,7 @@ static void set_reverb_acoustic_data_fx(
ivas_reverb_interp_on_freq_grid_fx( nr_fc_input, pFc_input_fx, pAcoustic_rt60_fx, nr_fc_fft_filter, pFc_fx, pRt60_fx ); // Q26
ivas_reverb_interp_on_freq_grid_fx( nr_fc_input, pFc_input_fx, pAcoustic_dsr_fx, nr_fc_fft_filter, pFc_fx, pDsr_fx ); // Q30
///* adjust DSR for the delay difference */
/* adjust DSR for the delay difference */
delay_diff_fx = L_sub( pRoomAcoustics->inputPreDelay_fx, pRoomAcoustics->acousticPreDelay_fx ); // Q27
ln_1e6_inverted_fx = 155440049; // Q31 /* 1.0f / logf( 1e06f ) */
......@@ -1371,6 +1394,7 @@ static void set_reverb_acoustic_data_fx(
pDsr_fx[bin_idx] = L_tmp;
move32();
}
return;
}
......@@ -1432,16 +1456,19 @@ static ivas_error setup_FDN_branches_fx(
return error;
}
/*-------------------------------------------------------------------------
* ivas_reverb_open_fx()
*
* Allocate and initialize FDN reverberation handle
*------------------------------------------------------------------------*/
ivas_error ivas_reverb_open_fx(
REVERB_HANDLE *hReverb, /* i/o: Reverberator handle */
const HRTFS_STATISTICS_HANDLE hHrtfStatistics, /* i : HRTF statistics handle */
RENDER_CONFIG_HANDLE hRenderConfig, /* i : Renderer configuration handle */
const Word32 output_Fs )
const Word32 output_Fs /* i : output sampling rate */
)
{
ivas_error error;
REVERB_HANDLE pState = *hReverb;
......@@ -1458,7 +1485,6 @@ ivas_error ivas_reverb_open_fx(
rv_fftwf_type_complex_fx pFft_wf_filter_ch0_fx[RV_LENGTH_NR_FC];
rv_fftwf_type_complex_fx pFft_wf_filter_ch1_fx[RV_LENGTH_NR_FC];
error = IVAS_ERR_OK;
output_frame = extract_l( Mult_32_16( output_Fs, INV_FRAME_PER_SEC_Q15 ) );
subframe_len = shr( output_frame, 2 ); /*output_frame / MAX_PARAM_SPATIAL_SUBFRAMES*/
predelay_bf_len = output_frame;
......@@ -1472,10 +1498,12 @@ ivas_error ivas_reverb_open_fx(
return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for FDN Reverberator" );
}
}
IF( NE_32( ( error = set_base_config_fx( &params, output_Fs ) ), IVAS_ERR_OK ) )
{
return error;
}
IF( *hReverb == NULL )
{
/* Allocate memory for feedback delay lines */
......@@ -1493,6 +1521,7 @@ ivas_error ivas_reverb_open_fx(
return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for CREND Reverberator" );
}
}
pState->nr_of_branches = IVAS_REV_MAX_NR_BRANCHES;
move16();
set_fft_and_datablock_sizes_fx( pState, subframe_len );
......@@ -1527,7 +1556,6 @@ ivas_error ivas_reverb_open_fx(
params.pHrtf_avg_pwr_response_r_const_fx = hHrtfStatistics->average_energy_r;
params.pHrtf_inter_aural_coherence_const_fx = hHrtfStatistics->inter_aural_coherence;
/* set reverb acoustic configuration based on renderer config */
pState->pConfig.roomAcoustics.nBands = hRenderConfig->roomAcoustics.nBands;
move16();
......@@ -1549,11 +1577,11 @@ ivas_error ivas_reverb_open_fx(
calc_predelay_fx( &params, hRenderConfig->roomAcoustics.acousticPreDelay_fx, output_Fs );
/* set up jot reverb 60 filters - must be set up after set_reverb_acoustic_data() */
IF( NE_32( ( error = compute_t60_coeffs_fx( &params, nr_fc_fft_filter, output_Fs ) ), IVAS_ERR_OK ) )
{
return error;
}
/* Compute target levels (gains) for the coloration filters */
Word32 *pHrtf_avg_pwr_response_l_const = (Word32 *) malloc( nr_fc_fft_filter * sizeof( Word32 * ) );
Word32 *pHrtf_avg_pwr_response_r_const = (Word32 *) malloc( nr_fc_fft_filter * sizeof( Word32 * ) );
......@@ -1592,7 +1620,7 @@ ivas_error ivas_reverb_open_fx(
/* === Copy parameters from ivas_reverb_params_t into DSP blocks === */
/* === to be used for subsequent audio signal processing === */
if ( *hReverb == NULL )
IF( *hReverb == NULL )
{
pState->do_corr_filter = params.do_corr_filter;
move16();
......@@ -1608,7 +1636,6 @@ ivas_error ivas_reverb_open_fx(
move16();
move16();
IF( pState->do_corr_filter )
{
/* Computing correlation filters on the basis of target IA coherence */
......@@ -1619,11 +1646,17 @@ ivas_error ivas_reverb_open_fx(
}
Word32 *pHrtf_inter_aural_coherence_const = (Word32 *) malloc( nr_fc_fft_filter * sizeof( Word32 ) );
IF( pHrtf_inter_aural_coherence_const == NULL )
{
return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Binaural Reverberator\n" ) );
}
FOR( i = 0; i < nr_fc_fft_filter; i++ )
{
pHrtf_inter_aural_coherence_const[i] = L_shl( params.pHrtf_inter_aural_coherence_const_fx[i], 4 ); /*Scaling up to Q30*/
move32();
}
ivas_reverb_calc_correl_filters_fx( pHrtf_inter_aural_coherence_const, pTime_window_fx, pState->fft_size, pFft_wf_filter_ch0_fx, pFft_wf_filter_ch1_fx, &q_pFft_wf_filter_ch0_fx, &q_pFft_wf_filter_ch1_fx );
free( pHrtf_inter_aural_coherence_const );
......@@ -1642,6 +1675,7 @@ ivas_error ivas_reverb_open_fx(
pFft_wf_filter_ch1_fx[i][1] = L_shl( pFft_wf_filter_ch1_fx[i][1], sub( 31, q_pFft_wf_filter_ch1_fx ) ); // Scale to Q31
move32();
}
/* Copying the computed FFT correlation filters to the fft_filter components */
IF( NE_32( ( error = set_correl_fft_filter_fx( pState, 0, pFft_wf_filter_ch0_fx ) ), IVAS_ERR_OK ) )
{
......@@ -1683,38 +1717,42 @@ ivas_error ivas_reverb_open_fx(
return error;
}
if ( *hReverb == NULL )
IF( *hReverb == NULL )
{
/* init predelay */
ivas_rev_delay_line_init( &( pState->predelay_line ), pState->pPredelay_buffer_fx, params.pre_delay, predelay_bf_len );
/* set up feedback delay network */
if ( ( error = setup_FDN_branches_fx( pState, &params ) ) != IVAS_ERR_OK )
IF( NE_32( ( error = setup_FDN_branches_fx( pState, &params ) ), IVAS_ERR_OK ) )
{
return error;
}
}
else
ELSE
{
pState->predelay_line.Delay = params.pre_delay;
move16();
}
nr_coefs = params.t60_filter_order + 1;
for ( branch_idx = 0; branch_idx < params.nr_loops; branch_idx++ )
FOR( branch_idx = 0; branch_idx < params.nr_loops; branch_idx++ )
{
pCoef_a = &params.pT60_filter_coeff_fx[2 * nr_coefs * branch_idx + nr_coefs];
pCoef_b = &params.pT60_filter_coeff_fx[2 * nr_coefs * branch_idx];
if ( ( error = set_t60_filter( pState, branch_idx, nr_coefs, pCoef_a, pCoef_b ) ) != IVAS_ERR_OK )
IF( NE_32( ( error = set_t60_filter( pState, branch_idx, nr_coefs, pCoef_a, pCoef_b ) ), IVAS_ERR_OK ) )
{
return error;
}
}
*hReverb = pState;
return error;
return IVAS_ERR_OK;
}
/*-------------------------------------------------------------------------
* ivas_reverb_close()
*
......@@ -1753,6 +1791,8 @@ void ivas_reverb_close(
return;
}
/*-----------------------------------------------------------------------------------------*
* Function post_fft_filter()
*
......@@ -1778,12 +1818,15 @@ static void post_fft_filter_fx(
{
ivas_reverb_t2f_f2t_in_fx( &hReverb->fft_filter_ols, input_L_fx, input_R_fx, buffer_L_fx, buffer_R_fx );
}
ivas_reverb_fft_filter_ComplexMul_fx( &hReverb->fft_filter_color_0, buffer_L_fx );
ivas_reverb_fft_filter_ComplexMul_fx( &hReverb->fft_filter_color_1, buffer_R_fx );
ivas_reverb_t2f_f2t_out_fx( &hReverb->fft_filter_ols, buffer_L_fx, buffer_R_fx, input_L_fx, input_R_fx );
return;
}
/*-----------------------------------------------------------------------------------------*
* Function reverb_block()
*
......@@ -1925,6 +1968,8 @@ static void reverb_block_fx(
return;
}
/*-----------------------------------------------------------------------------------------*
* Function downmix_input_block()
*
......@@ -1941,6 +1986,7 @@ static ivas_error downmix_input_block_fx(
Word16 i, s, nchan_transport;
Word32 dmx_gain_fx = hReverb->dmx_gain_fx;
move32();
SWITCH( input_audio_config )
{
case IVAS_AUDIO_CONFIG_STEREO:
......@@ -1986,6 +2032,8 @@ static ivas_error downmix_input_block_fx(
return IVAS_ERR_OK;
}
/*-----------------------------------------------------------------------------------------*
* Function predelay_block()
*
......@@ -1999,6 +2047,7 @@ static void predelay_block_fx(
{
UWord16 i, idx, n_samples, blk_size;
UWord16 max_blk_size = (UWord16) hReverb->predelay_line.Delay;
IF( LT_32( max_blk_size, 2 ) )
{
IF( max_blk_size == 0 ) /* zero-length delay line: just copy the data from input to output */
......@@ -2044,6 +2093,8 @@ static void predelay_block_fx(
return;
}
/*-----------------------------------------------------------------------------------------*
* Function mix_output_block()
*
......@@ -2069,6 +2120,8 @@ static void mix_output_block_fx(
return;
}
/*-----------------------------------------------------------------------------------------*
* ivas_reverb_process()
*
......@@ -2079,8 +2132,8 @@ ivas_error ivas_reverb_process_fx(
const REVERB_HANDLE hReverb, /* i : Reverberator handle */
const AUDIO_CONFIG input_audio_config, /* i : reverb. input audio configuration */
const Word16 mix_signals, /* i : add reverb to output signal */
Word32 *pcm_in_fx[], /* i Q11 : the PCM audio to apply reverb on */
Word32 *pcm_out_fx[], /* o Q11 : the PCM audio with reverb applied */
Word32 *pcm_in_fx[], /* i : the PCM audio to apply reverb on, Q11 */
Word32 *pcm_out_fx[], /* o : the PCM audio with reverb applied, Q11 */
const Word16 i_ts /* i : subframe index */
)
{
......@@ -2102,22 +2155,16 @@ ivas_error ivas_reverb_process_fx(
}
ELSE
{
MVR2R_WORD32( tmp1_fx, &pcm_out_fx[0][i_mult( i_ts, hReverb->full_block_size )], hReverb->full_block_size );
MVR2R_WORD32( tmp2_fx, &pcm_out_fx[1][i_mult( i_ts, hReverb->full_block_size )], hReverb->full_block_size );
Copy32( tmp1_fx, &pcm_out_fx[0][i_mult( i_ts, hReverb->full_block_size )], hReverb->full_block_size );
Copy32( tmp2_fx, &pcm_out_fx[1][i_mult( i_ts, hReverb->full_block_size )], hReverb->full_block_size );
}
return IVAS_ERR_OK;
}
/*-------------------------------------------------------------------------
* ivas_binaural_reverb_processSubFrame()
*
* Compute the reverberation - room effect
*------------------------------------------------------------------------*/
/*-------------------------------------------------------------------------
* ivas_binaural_reverb_processSubFrame_fx()
* ivas_binaural_reverb_processSubFrame()
*
* Compute the reverberation - room effect
*------------------------------------------------------------------------*/
......@@ -2296,11 +2343,13 @@ void ivas_binaural_reverb_processSubframe_fx(
return;
}
/*-------------------------------------------------------------------------
* ivas_binaural_reverb_open()
*
* Allocate and initialize binaural room reverberator handle
*------------------------------------------------------------------------*/
static ivas_error ivas_binaural_reverb_open_fx(
REVERB_STRUCT_HANDLE *hReverbPr, /* i/o: binaural reverb handle */
const Word16 numBins, /* i : Q0 number of CLDFB bins */
......@@ -2412,20 +2461,18 @@ static ivas_error ivas_binaural_reverb_open_fx(
ivas_binaural_reverb_setReverbTimes_fx( hReverb, sampling_rate, revTimes_fx, revEnes_fx );
/*free(revTimes_fx);
free(revEnes_fx);*/
ivas_binaural_reverb_setPreDelay_fx( hReverb, preDelay );
return IVAS_ERR_OK;
}
/*-------------------------------------------------------------------------
* ivas_binaural_reverb_init()
*
* Allocate and initialize binaural room reverberator handle
* for CLDFB renderers
* Initialize binaural room reverberator handle for FastConv renderer
*------------------------------------------------------------------------*/
ivas_error ivas_binaural_reverb_init(
REVERB_STRUCT_HANDLE *hReverbPr, /* i/o: binaural reverb handle */
const HRTFS_STATISTICS_HANDLE hHrtfStatistics, /* i : HRTF statistics handle */
......@@ -2434,8 +2481,7 @@ ivas_error ivas_binaural_reverb_init(
const IVAS_ROOM_ACOUSTICS_CONFIG_DATA *roomAcoustics, /* i/o: room acoustics parameters */
const Word32 sampling_rate, /* i : sampling rate */
const Word32 *defaultTimes, /* i : default reverberation times */
const Word32 *defaultEne /* i : default reverberation energies */
,
const Word32 *defaultEne, /* i : default reverberation energies */
Word32 *earlyEne /* i/o: Early part energies to be modified */
)
{
......@@ -2445,22 +2491,24 @@ ivas_error ivas_binaural_reverb_init(
Word32 revEne[CLDFB_NO_CHANNELS_MAX];
Word32 temp32;
error = IVAS_ERR_OK;
IF( roomAcoustics != NULL )
{
IF( ( error = ivas_reverb_prepare_cldfb_params( roomAcoustics, hHrtfStatistics, sampling_rate, revTimes, revEne ) ) != IVAS_ERR_OK )
{
return error;
}
temp32 = Mult_32_16( roomAcoustics->acousticPreDelay_fx, ( ( IVAS_48k / CLDFB_NO_CHANNELS_MAX ) >> 1 ) ); // Q11
/* Convert preDelay from seconds to CLDFB slots as needed by binaural reverb */
temp32 = Mult_32_16( roomAcoustics->acousticPreDelay_fx, ( CLDFB_SLOTS_PER_SECOND >> 1 ) ); // Q11
preDelay = extract_l( L_shr( L_add( temp32, L_shl( 1, 10 ) ), 11 ) ); // Q0
}
ELSE
{
#ifdef FIX_1995_REVERB_INIT
FOR( bin = 0; bin < numBins; bin++ )
#else
FOR( bin = 0; bin < CLDFB_NO_CHANNELS_MAX; bin++ )
#endif
{
revTimes[bin] = defaultTimes[bin];
move32();
......@@ -2470,7 +2518,11 @@ ivas_error ivas_binaural_reverb_init(
preDelay = 10;
}
#ifdef FIX_1995_REVERB_INIT
FOR( bin = 0; bin < numBins; bin++ )
#else
FOR( bin = 0; bin < CLDFB_NO_CHANNELS_MAX; bin++ )
#endif
{
/* Adjust the room effect parameters when the reverberation time is less than a threshold value, to avoid
spectral artefacts with the synthetic reverberator. */
......@@ -2522,6 +2574,8 @@ ivas_error ivas_binaural_reverb_init(
return error;
}
/*-------------------------------------------------------------------------
* ivas_binaural_reverb_close_fx()
*
......
......@@ -47,50 +47,49 @@
#include "ivas_cnst.h"
/********************** CRendBin_Combined_HRIR **********************/
extern Word32 CRendBin_Combined_HRIR_latency_s_fx;
/* Sample Rate = 48000 */
extern int16_t CRendBin_Combined_HRIR_max_num_iterations_48kHz;
extern uint16_t CRendBin_Combined_HRIR_num_iterations_48kHz[15][BINAURAL_CHANNELS];
extern uint16_t CRendBin_Combined_HRIR_num_iterations_diffuse_48kHz[BINAURAL_CHANNELS];
extern uint16_t CRendBin_Combined_HRIR_pIndex_frequency_max_48kHz[15][BINAURAL_CHANNELS][1];
extern uint16_t CRendBin_Combined_HRIR_index_frequency_max_diffuse_48kHz;
extern Word16 CRendBin_Combined_HRIR_inv_diffuse_weight_48kHz_fx[15];
extern uint16_t *CRendBin_Combined_HRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS];
extern Word32 CRendBin_Combined_HRIR_coeff_re_48kHz_fx[15][BINAURAL_CHANNELS][240];
extern Word32 CRendBin_Combined_HRIR_coeff_im_48kHz_fx[15][BINAURAL_CHANNELS][240];
extern Word16 CRendBin_Combined_HRIR_max_num_iterations_48kHz;
extern UWord16 CRendBin_Combined_HRIR_num_iterations_48kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS];
extern UWord16 CRendBin_Combined_HRIR_num_iterations_diffuse_48kHz[BINAURAL_CHANNELS];
extern UWord16 CRendBin_Combined_HRIR_pIndex_frequency_max_48kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][1];
extern UWord16 CRendBin_Combined_HRIR_index_frequency_max_diffuse_48kHz;
extern Word16 CRendBin_Combined_HRIR_inv_diffuse_weight_48kHz_fx[BINAURAL_CHANNELS][HRTF_LS_CHANNELS];
extern UWord16 *CRendBin_Combined_HRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS];
extern Word32 CRendBin_Combined_HRIR_coeff_re_48kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][240];
extern Word32 CRendBin_Combined_HRIR_coeff_im_48kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][240];
extern Word32 *CRendBin_Combined_HRIR_coeff_diffuse_re_48kHz_fx[BINAURAL_CHANNELS];
extern Word32 *CRendBin_Combined_HRIR_coeff_diffuse_im_48kHz_fx[BINAURAL_CHANNELS];
/* Sample Rate = 32000 */
extern int16_t CRendBin_Combined_HRIR_max_num_iterations_32kHz;
extern uint16_t CRendBin_Combined_HRIR_num_iterations_32kHz[15][BINAURAL_CHANNELS];
extern uint16_t CRendBin_Combined_HRIR_num_iterations_diffuse_32kHz[BINAURAL_CHANNELS];
extern uint16_t CRendBin_Combined_HRIR_pIndex_frequency_max_32kHz[15][BINAURAL_CHANNELS][1];
extern uint16_t CRendBin_Combined_HRIR_index_frequency_max_diffuse_32kHz;
extern Word16 CRendBin_Combined_HRIR_inv_diffuse_weight_32kHz_fx[15];
extern uint16_t *CRendBin_Combined_HRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS];
extern Word32 CRendBin_Combined_HRIR_coeff_re_32kHz_fx[15][BINAURAL_CHANNELS][160];
extern Word32 CRendBin_Combined_HRIR_coeff_im_32kHz_fx[15][BINAURAL_CHANNELS][160];
extern Word16 CRendBin_Combined_HRIR_max_num_iterations_32kHz;
extern UWord16 CRendBin_Combined_HRIR_num_iterations_32kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS];
extern UWord16 CRendBin_Combined_HRIR_num_iterations_diffuse_32kHz[BINAURAL_CHANNELS];
extern UWord16 CRendBin_Combined_HRIR_pIndex_frequency_max_32kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][1];
extern UWord16 CRendBin_Combined_HRIR_index_frequency_max_diffuse_32kHz;
extern Word16 CRendBin_Combined_HRIR_inv_diffuse_weight_32kHz_fx[BINAURAL_CHANNELS][HRTF_LS_CHANNELS];
extern UWord16 *CRendBin_Combined_HRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS];
extern Word32 CRendBin_Combined_HRIR_coeff_re_32kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][160];
extern Word32 CRendBin_Combined_HRIR_coeff_im_32kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][160];
extern Word32 *CRendBin_Combined_HRIR_coeff_diffuse_re_32kHz_fx[BINAURAL_CHANNELS];
extern Word32 *CRendBin_Combined_HRIR_coeff_diffuse_im_32kHz_fx[BINAURAL_CHANNELS];
/* Sample Rate = 16000 */
extern int16_t CRendBin_Combined_HRIR_max_num_iterations_16kHz;
extern uint16_t CRendBin_Combined_HRIR_num_iterations_16kHz[15][BINAURAL_CHANNELS];
extern uint16_t CRendBin_Combined_HRIR_num_iterations_diffuse_16kHz[BINAURAL_CHANNELS];
extern uint16_t CRendBin_Combined_HRIR_pIndex_frequency_max_16kHz[15][BINAURAL_CHANNELS][1];
extern uint16_t CRendBin_Combined_HRIR_index_frequency_max_diffuse_16kHz;
extern Word16 CRendBin_Combined_HRIR_inv_diffuse_weight_16kHz_fx[15];
extern uint16_t *CRendBin_Combined_HRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS];
extern Word32 CRendBin_Combined_HRIR_coeff_re_16kHz_fx[15][BINAURAL_CHANNELS][80];
extern Word32 CRendBin_Combined_HRIR_coeff_im_16kHz_fx[15][BINAURAL_CHANNELS][80];
extern Word16 CRendBin_Combined_HRIR_max_num_iterations_16kHz;
extern UWord16 CRendBin_Combined_HRIR_num_iterations_16kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS];
extern UWord16 CRendBin_Combined_HRIR_num_iterations_diffuse_16kHz[BINAURAL_CHANNELS];
extern UWord16 CRendBin_Combined_HRIR_pIndex_frequency_max_16kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][1];
extern UWord16 CRendBin_Combined_HRIR_index_frequency_max_diffuse_16kHz;
extern Word16 CRendBin_Combined_HRIR_inv_diffuse_weight_16kHz_fx[BINAURAL_CHANNELS][HRTF_LS_CHANNELS];
extern UWord16 *CRendBin_Combined_HRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS];
extern Word32 CRendBin_Combined_HRIR_coeff_re_16kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][80];
extern Word32 CRendBin_Combined_HRIR_coeff_im_16kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][80];
extern Word32 *CRendBin_Combined_HRIR_coeff_diffuse_re_16kHz_fx[BINAURAL_CHANNELS];
extern Word32 *CRendBin_Combined_HRIR_coeff_diffuse_im_16kHz_fx[BINAURAL_CHANNELS];
......@@ -103,43 +102,43 @@ extern Word32 CRendBin_FOA_HRIR_latency_s_fx;
/* Sample Rate = 48000 */
extern int16_t CRendBin_FOA_HRIR_max_num_iterations_48kHz;
extern uint16_t CRendBin_FOA_HRIR_num_iterations_48kHz[4][BINAURAL_CHANNELS];
extern uint16_t CRendBin_FOA_HRIR_num_iterations_diffuse_48kHz[BINAURAL_CHANNELS];
extern uint16_t CRendBin_FOA_HRIR_pIndex_frequency_max_48kHz[4][BINAURAL_CHANNELS][1];
extern uint16_t CRendBin_FOA_HRIR_index_frequency_max_diffuse_48kHz;
extern Word16 CRendBin_FOA_HRIR_inv_diffuse_weight_48kHz_fx[4];
extern uint16_t *CRendBin_FOA_HRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS];
extern Word32 CRendBin_FOA_HRIR_coeff_re_48kHz_fx[4][BINAURAL_CHANNELS][240];
extern Word32 CRendBin_FOA_HRIR_coeff_im_48kHz_fx[4][BINAURAL_CHANNELS][240];
extern Word16 CRendBin_FOA_HRIR_max_num_iterations_48kHz;
extern UWord16 CRendBin_FOA_HRIR_num_iterations_48kHz[FOA_CHANNELS][BINAURAL_CHANNELS];
extern UWord16 CRendBin_FOA_HRIR_num_iterations_diffuse_48kHz[BINAURAL_CHANNELS];
extern UWord16 CRendBin_FOA_HRIR_pIndex_frequency_max_48kHz[FOA_CHANNELS][BINAURAL_CHANNELS][1];
extern UWord16 CRendBin_FOA_HRIR_index_frequency_max_diffuse_48kHz;
extern Word16 CRendBin_FOA_HRIR_inv_diffuse_weight_48kHz_fx[BINAURAL_CHANNELS][FOA_CHANNELS];
extern UWord16 *CRendBin_FOA_HRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS];
extern Word32 CRendBin_FOA_HRIR_coeff_re_48kHz_fx[FOA_CHANNELS][BINAURAL_CHANNELS][240];
extern Word32 CRendBin_FOA_HRIR_coeff_im_48kHz_fx[FOA_CHANNELS][BINAURAL_CHANNELS][240];
extern Word32 *CRendBin_FOA_HRIR_coeff_diffuse_re_48kHz_fx[BINAURAL_CHANNELS];
extern Word32 *CRendBin_FOA_HRIR_coeff_diffuse_im_48kHz_fx[BINAURAL_CHANNELS];
/* Sample Rate = 32000 */
extern int16_t CRendBin_FOA_HRIR_max_num_iterations_32kHz;
extern uint16_t CRendBin_FOA_HRIR_num_iterations_32kHz[4][BINAURAL_CHANNELS];
extern uint16_t CRendBin_FOA_HRIR_num_iterations_diffuse_32kHz[BINAURAL_CHANNELS];
extern uint16_t CRendBin_FOA_HRIR_pIndex_frequency_max_32kHz[4][BINAURAL_CHANNELS][1];
extern uint16_t CRendBin_FOA_HRIR_index_frequency_max_diffuse_32kHz;
extern Word16 CRendBin_FOA_HRIR_inv_diffuse_weight_32kHz_fx[4];
extern uint16_t *CRendBin_FOA_HRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS];
extern Word32 CRendBin_FOA_HRIR_coeff_re_32kHz_fx[4][BINAURAL_CHANNELS][160];
extern Word32 CRendBin_FOA_HRIR_coeff_im_32kHz_fx[4][BINAURAL_CHANNELS][160];
extern Word16 CRendBin_FOA_HRIR_max_num_iterations_32kHz;
extern UWord16 CRendBin_FOA_HRIR_num_iterations_32kHz[FOA_CHANNELS][BINAURAL_CHANNELS];
extern UWord16 CRendBin_FOA_HRIR_num_iterations_diffuse_32kHz[BINAURAL_CHANNELS];
extern UWord16 CRendBin_FOA_HRIR_pIndex_frequency_max_32kHz[FOA_CHANNELS][BINAURAL_CHANNELS][1];
extern UWord16 CRendBin_FOA_HRIR_index_frequency_max_diffuse_32kHz;
extern Word16 CRendBin_FOA_HRIR_inv_diffuse_weight_32kHz_fx[BINAURAL_CHANNELS][FOA_CHANNELS];
extern UWord16 *CRendBin_FOA_HRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS];
extern Word32 CRendBin_FOA_HRIR_coeff_re_32kHz_fx[FOA_CHANNELS][BINAURAL_CHANNELS][160];
extern Word32 CRendBin_FOA_HRIR_coeff_im_32kHz_fx[FOA_CHANNELS][BINAURAL_CHANNELS][160];
extern Word32 *CRendBin_FOA_HRIR_coeff_diffuse_re_32kHz_fx[BINAURAL_CHANNELS];
extern Word32 *CRendBin_FOA_HRIR_coeff_diffuse_im_32kHz_fx[BINAURAL_CHANNELS];
/* Sample Rate = 16000 */
extern int16_t CRendBin_FOA_HRIR_max_num_iterations_16kHz;
extern uint16_t CRendBin_FOA_HRIR_num_iterations_16kHz[4][BINAURAL_CHANNELS];
extern uint16_t CRendBin_FOA_HRIR_num_iterations_diffuse_16kHz[BINAURAL_CHANNELS];
extern uint16_t CRendBin_FOA_HRIR_pIndex_frequency_max_16kHz[4][BINAURAL_CHANNELS][1];
extern uint16_t CRendBin_FOA_HRIR_index_frequency_max_diffuse_16kHz;
extern Word16 CRendBin_FOA_HRIR_inv_diffuse_weight_16kHz_fx[4];
extern uint16_t *CRendBin_FOA_HRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS];
extern Word32 CRendBin_FOA_HRIR_coeff_re_16kHz_fx[4][BINAURAL_CHANNELS][80];
extern Word32 CRendBin_FOA_HRIR_coeff_im_16kHz_fx[4][BINAURAL_CHANNELS][80];
extern Word16 CRendBin_FOA_HRIR_max_num_iterations_16kHz;
extern UWord16 CRendBin_FOA_HRIR_num_iterations_16kHz[FOA_CHANNELS][BINAURAL_CHANNELS];
extern UWord16 CRendBin_FOA_HRIR_num_iterations_diffuse_16kHz[BINAURAL_CHANNELS];
extern UWord16 CRendBin_FOA_HRIR_pIndex_frequency_max_16kHz[FOA_CHANNELS][BINAURAL_CHANNELS][1];
extern UWord16 CRendBin_FOA_HRIR_index_frequency_max_diffuse_16kHz;
extern Word16 CRendBin_FOA_HRIR_inv_diffuse_weight_16kHz_fx[BINAURAL_CHANNELS][FOA_CHANNELS];
extern UWord16 *CRendBin_FOA_HRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS];
extern Word32 CRendBin_FOA_HRIR_coeff_re_16kHz_fx[FOA_CHANNELS][BINAURAL_CHANNELS][80];
extern Word32 CRendBin_FOA_HRIR_coeff_im_16kHz_fx[FOA_CHANNELS][BINAURAL_CHANNELS][80];
extern Word32 *CRendBin_FOA_HRIR_coeff_diffuse_re_16kHz_fx[BINAURAL_CHANNELS];
extern Word32 *CRendBin_FOA_HRIR_coeff_diffuse_im_16kHz_fx[BINAURAL_CHANNELS];
......@@ -151,43 +150,43 @@ extern Word32 CRendBin_HOA2_HRIR_latency_s_fx;
/* Sample Rate = 48000 */
extern int16_t CRendBin_HOA2_HRIR_max_num_iterations_48kHz;
extern uint16_t CRendBin_HOA2_HRIR_num_iterations_48kHz[9][BINAURAL_CHANNELS];
extern uint16_t CRendBin_HOA2_HRIR_num_iterations_diffuse_48kHz[BINAURAL_CHANNELS];
extern uint16_t CRendBin_HOA2_HRIR_pIndex_frequency_max_48kHz[9][BINAURAL_CHANNELS][1];
extern uint16_t CRendBin_HOA2_HRIR_index_frequency_max_diffuse_48kHz;
extern Word16 CRendBin_HOA2_HRIR_inv_diffuse_weight_48kHz_fx[9];
extern uint16_t *CRendBin_HOA2_HRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS];
extern Word32 CRendBin_HOA2_HRIR_coeff_re_48kHz_fx[9][BINAURAL_CHANNELS][240];
extern Word32 CRendBin_HOA2_HRIR_coeff_im_48kHz_fx[9][BINAURAL_CHANNELS][240];
extern Word16 CRendBin_HOA2_HRIR_max_num_iterations_48kHz;
extern UWord16 CRendBin_HOA2_HRIR_num_iterations_48kHz[HOA2_CHANNELS][BINAURAL_CHANNELS];
extern UWord16 CRendBin_HOA2_HRIR_num_iterations_diffuse_48kHz[BINAURAL_CHANNELS];
extern UWord16 CRendBin_HOA2_HRIR_pIndex_frequency_max_48kHz[HOA2_CHANNELS][BINAURAL_CHANNELS][1];
extern UWord16 CRendBin_HOA2_HRIR_index_frequency_max_diffuse_48kHz;
extern Word16 CRendBin_HOA2_HRIR_inv_diffuse_weight_48kHz_fx[BINAURAL_CHANNELS][HOA2_CHANNELS];
extern UWord16 *CRendBin_HOA2_HRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS];
extern Word32 CRendBin_HOA2_HRIR_coeff_re_48kHz_fx[HOA2_CHANNELS][BINAURAL_CHANNELS][240];
extern Word32 CRendBin_HOA2_HRIR_coeff_im_48kHz_fx[HOA2_CHANNELS][BINAURAL_CHANNELS][240];
extern Word32 *CRendBin_HOA2_HRIR_coeff_diffuse_re_48kHz_fx[BINAURAL_CHANNELS];
extern Word32 *CRendBin_HOA2_HRIR_coeff_diffuse_im_48kHz_fx[BINAURAL_CHANNELS];
/* Sample Rate = 32000 */
extern int16_t CRendBin_HOA2_HRIR_max_num_iterations_32kHz;
extern uint16_t CRendBin_HOA2_HRIR_num_iterations_32kHz[9][BINAURAL_CHANNELS];
extern uint16_t CRendBin_HOA2_HRIR_num_iterations_diffuse_32kHz[BINAURAL_CHANNELS];
extern uint16_t CRendBin_HOA2_HRIR_pIndex_frequency_max_32kHz[9][BINAURAL_CHANNELS][1];
extern uint16_t CRendBin_HOA2_HRIR_index_frequency_max_diffuse_32kHz;
extern Word16 CRendBin_HOA2_HRIR_inv_diffuse_weight_32kHz_fx[9];
extern uint16_t *CRendBin_HOA2_HRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS];
extern Word32 CRendBin_HOA2_HRIR_coeff_re_32kHz_fx[9][BINAURAL_CHANNELS][160];
extern Word32 CRendBin_HOA2_HRIR_coeff_im_32kHz_fx[9][BINAURAL_CHANNELS][160];
extern Word16 CRendBin_HOA2_HRIR_max_num_iterations_32kHz;
extern UWord16 CRendBin_HOA2_HRIR_num_iterations_32kHz[HOA2_CHANNELS][BINAURAL_CHANNELS];
extern UWord16 CRendBin_HOA2_HRIR_num_iterations_diffuse_32kHz[BINAURAL_CHANNELS];
extern UWord16 CRendBin_HOA2_HRIR_pIndex_frequency_max_32kHz[HOA2_CHANNELS][BINAURAL_CHANNELS][1];
extern UWord16 CRendBin_HOA2_HRIR_index_frequency_max_diffuse_32kHz;
extern Word16 CRendBin_HOA2_HRIR_inv_diffuse_weight_32kHz_fx[BINAURAL_CHANNELS][HOA2_CHANNELS];
extern UWord16 *CRendBin_HOA2_HRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS];
extern Word32 CRendBin_HOA2_HRIR_coeff_re_32kHz_fx[HOA2_CHANNELS][BINAURAL_CHANNELS][160];
extern Word32 CRendBin_HOA2_HRIR_coeff_im_32kHz_fx[HOA2_CHANNELS][BINAURAL_CHANNELS][160];
extern Word32 *CRendBin_HOA2_HRIR_coeff_diffuse_re_32kHz_fx[BINAURAL_CHANNELS];
extern Word32 *CRendBin_HOA2_HRIR_coeff_diffuse_im_32kHz_fx[BINAURAL_CHANNELS];
/* Sample Rate = 16000 */
extern int16_t CRendBin_HOA2_HRIR_max_num_iterations_16kHz;
extern uint16_t CRendBin_HOA2_HRIR_num_iterations_16kHz[9][BINAURAL_CHANNELS];
extern uint16_t CRendBin_HOA2_HRIR_num_iterations_diffuse_16kHz[BINAURAL_CHANNELS];
extern uint16_t CRendBin_HOA2_HRIR_pIndex_frequency_max_16kHz[9][BINAURAL_CHANNELS][1];
extern uint16_t CRendBin_HOA2_HRIR_index_frequency_max_diffuse_16kHz;
extern Word16 CRendBin_HOA2_HRIR_inv_diffuse_weight_16kHz_fx[9];
extern uint16_t *CRendBin_HOA2_HRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS];
extern Word32 CRendBin_HOA2_HRIR_coeff_re_16kHz_fx[9][BINAURAL_CHANNELS][80];
extern Word32 CRendBin_HOA2_HRIR_coeff_im_16kHz_fx[9][BINAURAL_CHANNELS][80];
extern Word16 CRendBin_HOA2_HRIR_max_num_iterations_16kHz;
extern UWord16 CRendBin_HOA2_HRIR_num_iterations_16kHz[HOA2_CHANNELS][BINAURAL_CHANNELS];
extern UWord16 CRendBin_HOA2_HRIR_num_iterations_diffuse_16kHz[BINAURAL_CHANNELS];
extern UWord16 CRendBin_HOA2_HRIR_pIndex_frequency_max_16kHz[HOA2_CHANNELS][BINAURAL_CHANNELS][1];
extern UWord16 CRendBin_HOA2_HRIR_index_frequency_max_diffuse_16kHz;
extern Word16 CRendBin_HOA2_HRIR_inv_diffuse_weight_16kHz_fx[BINAURAL_CHANNELS][HOA2_CHANNELS];
extern UWord16 *CRendBin_HOA2_HRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS];
extern Word32 CRendBin_HOA2_HRIR_coeff_re_16kHz_fx[HOA2_CHANNELS][BINAURAL_CHANNELS][80];
extern Word32 CRendBin_HOA2_HRIR_coeff_im_16kHz_fx[HOA2_CHANNELS][BINAURAL_CHANNELS][80];
extern Word32 *CRendBin_HOA2_HRIR_coeff_diffuse_re_16kHz_fx[BINAURAL_CHANNELS];
extern Word32 *CRendBin_HOA2_HRIR_coeff_diffuse_im_16kHz_fx[BINAURAL_CHANNELS];
......@@ -198,43 +197,43 @@ extern Word32 CRendBin_HOA3_HRIR_latency_s_fx;
/* Sample Rate = 48000 */
extern int16_t CRendBin_HOA3_HRIR_max_num_iterations_48kHz;
extern uint16_t CRendBin_HOA3_HRIR_num_iterations_48kHz[16][BINAURAL_CHANNELS];
extern uint16_t CRendBin_HOA3_HRIR_num_iterations_diffuse_48kHz[BINAURAL_CHANNELS];
extern uint16_t CRendBin_HOA3_HRIR_pIndex_frequency_max_48kHz[16][BINAURAL_CHANNELS][1];
extern uint16_t CRendBin_HOA3_HRIR_index_frequency_max_diffuse_48kHz;
extern Word16 CRendBin_HOA3_HRIR_inv_diffuse_weight_48kHz_fx[16];
extern uint16_t *CRendBin_HOA3_HRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS];
extern Word32 CRendBin_HOA3_HRIR_coeff_re_48kHz_fx[16][BINAURAL_CHANNELS][240];
extern Word32 CRendBin_HOA3_HRIR_coeff_im_48kHz_fx[16][BINAURAL_CHANNELS][240];
extern Word16 CRendBin_HOA3_HRIR_max_num_iterations_48kHz;
extern UWord16 CRendBin_HOA3_HRIR_num_iterations_48kHz[HOA3_CHANNELS][BINAURAL_CHANNELS];
extern UWord16 CRendBin_HOA3_HRIR_num_iterations_diffuse_48kHz[BINAURAL_CHANNELS];
extern UWord16 CRendBin_HOA3_HRIR_pIndex_frequency_max_48kHz[HOA3_CHANNELS][BINAURAL_CHANNELS][1];
extern UWord16 CRendBin_HOA3_HRIR_index_frequency_max_diffuse_48kHz;
extern Word16 CRendBin_HOA3_HRIR_inv_diffuse_weight_48kHz_fx[BINAURAL_CHANNELS][HOA3_CHANNELS];
extern UWord16 *CRendBin_HOA3_HRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS];
extern Word32 CRendBin_HOA3_HRIR_coeff_re_48kHz_fx[HOA3_CHANNELS][BINAURAL_CHANNELS][240];
extern Word32 CRendBin_HOA3_HRIR_coeff_im_48kHz_fx[HOA3_CHANNELS][BINAURAL_CHANNELS][240];
extern Word32 *CRendBin_HOA3_HRIR_coeff_diffuse_re_48kHz_fx[BINAURAL_CHANNELS];
extern Word32 *CRendBin_HOA3_HRIR_coeff_diffuse_im_48kHz_fx[BINAURAL_CHANNELS];
/* Sample Rate = 32000 */
extern int16_t CRendBin_HOA3_HRIR_max_num_iterations_32kHz;
extern uint16_t CRendBin_HOA3_HRIR_num_iterations_32kHz[16][BINAURAL_CHANNELS];
extern uint16_t CRendBin_HOA3_HRIR_num_iterations_diffuse_32kHz[BINAURAL_CHANNELS];
extern uint16_t CRendBin_HOA3_HRIR_pIndex_frequency_max_32kHz[16][BINAURAL_CHANNELS][1];
extern uint16_t CRendBin_HOA3_HRIR_index_frequency_max_diffuse_32kHz;
extern Word16 CRendBin_HOA3_HRIR_inv_diffuse_weight_32kHz_fx[16];
extern uint16_t *CRendBin_HOA3_HRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS];
extern Word32 CRendBin_HOA3_HRIR_coeff_re_32kHz_fx[16][BINAURAL_CHANNELS][160];
extern Word32 CRendBin_HOA3_HRIR_coeff_im_32kHz_fx[16][BINAURAL_CHANNELS][160];
extern Word16 CRendBin_HOA3_HRIR_max_num_iterations_32kHz;
extern UWord16 CRendBin_HOA3_HRIR_num_iterations_32kHz[HOA3_CHANNELS][BINAURAL_CHANNELS];
extern UWord16 CRendBin_HOA3_HRIR_num_iterations_diffuse_32kHz[BINAURAL_CHANNELS];
extern UWord16 CRendBin_HOA3_HRIR_pIndex_frequency_max_32kHz[HOA3_CHANNELS][BINAURAL_CHANNELS][1];
extern UWord16 CRendBin_HOA3_HRIR_index_frequency_max_diffuse_32kHz;
extern Word16 CRendBin_HOA3_HRIR_inv_diffuse_weight_32kHz_fx[BINAURAL_CHANNELS][HOA3_CHANNELS];
extern UWord16 *CRendBin_HOA3_HRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS];
extern Word32 CRendBin_HOA3_HRIR_coeff_re_32kHz_fx[HOA3_CHANNELS][BINAURAL_CHANNELS][160];
extern Word32 CRendBin_HOA3_HRIR_coeff_im_32kHz_fx[HOA3_CHANNELS][BINAURAL_CHANNELS][160];
extern Word32 *CRendBin_HOA3_HRIR_coeff_diffuse_re_32kHz_fx[BINAURAL_CHANNELS];
extern Word32 *CRendBin_HOA3_HRIR_coeff_diffuse_im_32kHz_fx[BINAURAL_CHANNELS];
/* Sample Rate = 16000 */
extern int16_t CRendBin_HOA3_HRIR_max_num_iterations_16kHz;
extern uint16_t CRendBin_HOA3_HRIR_num_iterations_16kHz[16][BINAURAL_CHANNELS];
extern uint16_t CRendBin_HOA3_HRIR_num_iterations_diffuse_16kHz[BINAURAL_CHANNELS];
extern uint16_t CRendBin_HOA3_HRIR_pIndex_frequency_max_16kHz[16][BINAURAL_CHANNELS][1];
extern uint16_t CRendBin_HOA3_HRIR_index_frequency_max_diffuse_16kHz;
extern Word16 CRendBin_HOA3_HRIR_inv_diffuse_weight_16kHz_fx[16];
extern uint16_t *CRendBin_HOA3_HRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS];
extern Word32 CRendBin_HOA3_HRIR_coeff_re_16kHz_fx[16][BINAURAL_CHANNELS][80];
extern Word32 CRendBin_HOA3_HRIR_coeff_im_16kHz_fx[16][BINAURAL_CHANNELS][80];
extern Word16 CRendBin_HOA3_HRIR_max_num_iterations_16kHz;
extern UWord16 CRendBin_HOA3_HRIR_num_iterations_16kHz[HOA3_CHANNELS][BINAURAL_CHANNELS];
extern UWord16 CRendBin_HOA3_HRIR_num_iterations_diffuse_16kHz[BINAURAL_CHANNELS];
extern UWord16 CRendBin_HOA3_HRIR_pIndex_frequency_max_16kHz[HOA3_CHANNELS][BINAURAL_CHANNELS][1];
extern UWord16 CRendBin_HOA3_HRIR_index_frequency_max_diffuse_16kHz;
extern Word16 CRendBin_HOA3_HRIR_inv_diffuse_weight_16kHz_fx[BINAURAL_CHANNELS][HOA3_CHANNELS];
extern UWord16 *CRendBin_HOA3_HRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS];
extern Word32 CRendBin_HOA3_HRIR_coeff_re_16kHz_fx[HOA3_CHANNELS][BINAURAL_CHANNELS][80];
extern Word32 CRendBin_HOA3_HRIR_coeff_im_16kHz_fx[HOA3_CHANNELS][BINAURAL_CHANNELS][80];
extern Word32 *CRendBin_HOA3_HRIR_coeff_diffuse_re_16kHz_fx[BINAURAL_CHANNELS];
extern Word32 *CRendBin_HOA3_HRIR_coeff_diffuse_im_16kHz_fx[BINAURAL_CHANNELS];
......@@ -246,43 +245,55 @@ extern Word32 CRendBin_Combined_BRIR_latency_s_fx;
/* Sample Rate = 48000 */
extern int16_t CRendBin_Combined_BRIR_max_num_iterations_48kHz;
extern uint16_t CRendBin_Combined_BRIR_num_iterations_48kHz[15][BINAURAL_CHANNELS];
extern uint16_t CRendBin_Combined_BRIR_num_iterations_diffuse_48kHz[BINAURAL_CHANNELS];
extern uint16_t CRendBin_Combined_BRIR_pIndex_frequency_max_48kHz[15][BINAURAL_CHANNELS][22];
extern uint16_t CRendBin_Combined_BRIR_index_frequency_max_diffuse_48kHz;
extern Word16 CRendBin_Combined_BRIR_inv_diffuse_weight_48kHz_fx[15];
extern uint16_t CRendBin_Combined_BRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS][40];
extern Word32 CRendBin_Combined_BRIR_coeff_re_48kHz_fx[15][BINAURAL_CHANNELS][2955];
extern Word32 CRendBin_Combined_BRIR_coeff_im_48kHz_fx[15][BINAURAL_CHANNELS][2955];
extern Word16 CRendBin_Combined_BRIR_max_num_iterations_48kHz;
extern UWord16 CRendBin_Combined_BRIR_num_iterations_48kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS];
extern UWord16 CRendBin_Combined_BRIR_num_iterations_diffuse_48kHz[BINAURAL_CHANNELS];
extern UWord16 CRendBin_Combined_BRIR_pIndex_frequency_max_48kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][22];
extern UWord16 CRendBin_Combined_BRIR_index_frequency_max_diffuse_48kHz;
extern Word16 CRendBin_Combined_BRIR_inv_diffuse_weight_48kHz_fx[BINAURAL_CHANNELS][HRTF_LS_CHANNELS];
extern UWord16 CRendBin_Combined_BRIR_pIndex_frequency_max_diffuse_48kHz[BINAURAL_CHANNELS][40];
extern Word32 CRendBin_Combined_BRIR_coeff_re_48kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][2955];
extern Word32 CRendBin_Combined_BRIR_coeff_im_48kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][2955];
extern Word32 CRendBin_Combined_BRIR_coeff_diffuse_re_48kHz_fx[BINAURAL_CHANNELS][2885];
extern Word32 CRendBin_Combined_BRIR_coeff_diffuse_im_48kHz_fx[BINAURAL_CHANNELS][2885];
/* Sample Rate = 32000 */
extern int16_t CRendBin_Combined_BRIR_max_num_iterations_32kHz;
extern uint16_t CRendBin_Combined_BRIR_num_iterations_32kHz[15][BINAURAL_CHANNELS];
extern uint16_t CRendBin_Combined_BRIR_num_iterations_diffuse_32kHz[BINAURAL_CHANNELS];
extern uint16_t CRendBin_Combined_BRIR_pIndex_frequency_max_32kHz[15][BINAURAL_CHANNELS][22];
extern uint16_t CRendBin_Combined_BRIR_index_frequency_max_diffuse_32kHz;
extern Word16 CRendBin_Combined_BRIR_inv_diffuse_weight_32kHz_fx[15];
extern uint16_t CRendBin_Combined_BRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS][40];
extern Word32 CRendBin_Combined_BRIR_coeff_re_32kHz_fx[15][BINAURAL_CHANNELS][2819];
extern Word32 CRendBin_Combined_BRIR_coeff_im_32kHz_fx[15][BINAURAL_CHANNELS][2819];
extern Word16 CRendBin_Combined_BRIR_max_num_iterations_32kHz;
extern UWord16 CRendBin_Combined_BRIR_num_iterations_32kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS];
extern UWord16 CRendBin_Combined_BRIR_num_iterations_diffuse_32kHz[BINAURAL_CHANNELS];
extern UWord16 CRendBin_Combined_BRIR_pIndex_frequency_max_32kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][22];
extern UWord16 CRendBin_Combined_BRIR_index_frequency_max_diffuse_32kHz;
extern Word16 CRendBin_Combined_BRIR_inv_diffuse_weight_32kHz_fx[BINAURAL_CHANNELS][HRTF_LS_CHANNELS];
extern UWord16 CRendBin_Combined_BRIR_pIndex_frequency_max_diffuse_32kHz[BINAURAL_CHANNELS][40];
extern Word32 CRendBin_Combined_BRIR_coeff_re_32kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][2819];
extern Word32 CRendBin_Combined_BRIR_coeff_im_32kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][2819];
extern Word32 CRendBin_Combined_BRIR_coeff_diffuse_re_32kHz_fx[BINAURAL_CHANNELS][2870];
extern Word32 CRendBin_Combined_BRIR_coeff_diffuse_im_32kHz_fx[BINAURAL_CHANNELS][2870];
/* Sample Rate = 16000 */
extern int16_t CRendBin_Combined_BRIR_max_num_iterations_16kHz;
extern uint16_t CRendBin_Combined_BRIR_num_iterations_16kHz[15][BINAURAL_CHANNELS];
extern uint16_t CRendBin_Combined_BRIR_num_iterations_diffuse_16kHz[BINAURAL_CHANNELS];
extern uint16_t CRendBin_Combined_BRIR_pIndex_frequency_max_16kHz[15][BINAURAL_CHANNELS][23];
extern uint16_t CRendBin_Combined_BRIR_index_frequency_max_diffuse_16kHz;
extern Word16 CRendBin_Combined_BRIR_inv_diffuse_weight_16kHz_fx[15];
extern uint16_t CRendBin_Combined_BRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS][40];
extern Word32 CRendBin_Combined_BRIR_coeff_re_16kHz_fx[15][BINAURAL_CHANNELS][1774];
extern Word32 CRendBin_Combined_BRIR_coeff_im_16kHz_fx[15][BINAURAL_CHANNELS][1774];
extern Word16 CRendBin_Combined_BRIR_max_num_iterations_16kHz;
extern UWord16 CRendBin_Combined_BRIR_num_iterations_16kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS];
extern UWord16 CRendBin_Combined_BRIR_num_iterations_diffuse_16kHz[BINAURAL_CHANNELS];
extern UWord16 CRendBin_Combined_BRIR_pIndex_frequency_max_16kHz[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][23];
extern UWord16 CRendBin_Combined_BRIR_index_frequency_max_diffuse_16kHz;
extern Word16 CRendBin_Combined_BRIR_inv_diffuse_weight_16kHz_fx[BINAURAL_CHANNELS][HRTF_LS_CHANNELS];
extern UWord16 CRendBin_Combined_BRIR_pIndex_frequency_max_diffuse_16kHz[BINAURAL_CHANNELS][40];
extern Word32 CRendBin_Combined_BRIR_coeff_re_16kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][1774];
extern Word32 CRendBin_Combined_BRIR_coeff_im_16kHz_fx[HRTF_LS_CHANNELS][BINAURAL_CHANNELS][1774];
extern Word32 CRendBin_Combined_BRIR_coeff_diffuse_re_16kHz_fx[BINAURAL_CHANNELS][2522];
extern Word32 CRendBin_Combined_BRIR_coeff_diffuse_im_16kHz_fx[BINAURAL_CHANNELS][2522];
extern float defaultHRIR_coherence_48kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-27*/
extern float defaultHRIR_left_avg_power_48kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-23*/
extern float defaultHRIR_right_avg_power_48kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-23*/
extern float defaultHRIR_coherence_32kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-27*/
extern float defaultHRIR_left_avg_power_32kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-23*/
extern float defaultHRIR_right_avg_power_32kHz_fx[LR_IAC_LENGTH_NR_FC]; /*Q-23*/
extern float defaultHRIR_coherence_16kHz_fx[LR_IAC_LENGTH_NR_FC_16KHZ]; /*Q-27*/
extern float defaultHRIR_left_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC_16KHZ]; /*Q-23*/
extern float defaultHRIR_right_avg_power_16kHz_fx[LR_IAC_LENGTH_NR_FC_16KHZ]; /*Q-23*/
#endif /* _IVAS_ROM_BINAURAL_CREND_HEAD_ */
......@@ -775,7 +775,7 @@ static ivas_error TDREND_LoadBSplineBinary(
fread( (Word32 *) model->EL_dyn_fx, sizeof( Word32 ), model->AlphaN * HRTF_MODEL_N_SECTIONS, f_hrtf );
for ( j = 0; j < model->AlphaN * HRTF_MODEL_N_SECTIONS; j++ )
{
model->EL_dyn_fx[j] = L_shl_r( model->EL_dyn_fx[j], sub( Q30, factor_Q ) );
model->EL_dyn_fx[j] = L_shl_r( model->EL_dyn_fx[j], sub( Q28, factor_Q ) );
}
model->ER_dyn_fx = (Word32 *) malloc( model->AlphaN * HRTF_MODEL_N_SECTIONS * sizeof( Word32 ) );
......@@ -786,7 +786,7 @@ static ivas_error TDREND_LoadBSplineBinary(
fread( (Word32 *) model->ER_dyn_fx, sizeof( Word32 ), model->AlphaN * HRTF_MODEL_N_SECTIONS, f_hrtf );
for ( j = 0; j < model->AlphaN * HRTF_MODEL_N_SECTIONS; j++ )
{
model->ER_dyn_fx[j] = L_shl_r( model->ER_dyn_fx[j], sub( Q30, factor_Q ) );
model->ER_dyn_fx[j] = L_shl_r( model->ER_dyn_fx[j], sub( Q28, factor_Q ) );
}
/* Set const pointers */
......