Loading lib_com/ivas_spar_com.c +59 −1 Original line number Diff line number Diff line Loading @@ -47,7 +47,9 @@ #include "basop32.h" #include "ivas_prot_fx.h" #include "ivas_rom_com_fx.h" #ifdef DEBUGGING #include "debug.h" #endif /*------------------------------------------------------------------------------------------* * Local constants Loading Loading @@ -4415,6 +4417,42 @@ void ivas_get_spar_md_from_dirac_enc_fx( } } #ifdef DEBUG_SPAR_FX_CODE { char file_name[100] = { 0 }; sprintf( file_name, "./res/dirac2spar_cov_mat.pcm" ); float cov_ref[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH][IVAS_MAX_NUM_BANDS]; float cov_fx[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH][IVAS_MAX_NUM_BANDS]; float pred_ref[3], pred_fx[3]; int16_t k = 0; for ( i = 0; i < num_ch; i++ ) { for ( j = 0; j < num_ch; j++ ) { for ( k = start_band; k < end_band; k++ ) { dbgread( &cov_ref[i][j][k], sizeof( float ), 1, file_name ); cov_fx[i][j][k] = (float) cov_real_dirac_fx[i][j][k] / ( (float) ( 1 << q_cov_real_dirac_fx[i][j][k] ) ); } } } for ( k = start_band; k < end_band; k++ ) { for ( i = 1; i < num_ch; i++ ) { pred_ref[i - 1] = cov_ref[i][0][k] / max( EPSILON, cov_ref[0][0][k] ); pred_fx[i - 1] = cov_fx[i][0][k] / max( EPSILON, cov_fx[0][0][k] ); if ( fabsf( pred_ref[i - 1] - pred_fx[i - 1] ) > 0.1 ) { pred_ref[i - 1] = pred_ref[i - 1]; } } } } #endif test(); active_w = ( EQ_16( dyn_active_w_flag, 1 ) ) || ( EQ_16( hSpar_md_cfg->active_w, 1 ) ); ivas_compute_spar_params_enc_fx( pCov_real_fx, p_q_Cov_real_fx, dm_fv_re_fx, &q_dm_fv_re_fx, i_ts, ppMixer_mat_fx, &q_ppMixer_mat, start_band, end_band, dtx_vad, num_ch, 1, active_w, active_w_vlbr, hSpar_md_cfg, hSpar_md, Wscale_fx, q_Wscale, 1, dyn_active_w_flag ); Loading Loading @@ -4459,6 +4497,26 @@ void ivas_get_spar_md_from_dirac_enc_fx( } } } #if 0 // def DEBUG_SPAR_FX_CODE { char file_name[100] = { 0 }; float mixer_mat[16][16][12]; sprintf( file_name, "./res/dirac2spar_mat_mixer.pcm" ); int16_t k = 0; for ( i = 0; i < num_ch; i++ ) { for ( j = 0; j < num_ch; j++ ) { for ( k = start_band; k < end_band; k++ ) { dbgread( &mixer_mat[i][j][k + i_ts * IVAS_MAX_NUM_BANDS], sizeof( float ), 1, file_name ); mixer_mat_fx[i][j][k + ( i_ts * IVAS_MAX_NUM_BANDS )] = (Word32) roundf( mixer_mat[i][j][k + i_ts * IVAS_MAX_NUM_BANDS] * ( 1 << *q_mixer_mat_fx ) ); } } } } #endif } } Loading lib_com/options.h +1 −1 Original line number Diff line number Diff line Loading @@ -85,5 +85,5 @@ #define NONE_BE_FIX_BASOP_1044_OSBA_PRERENDER_MIX_GAINS /* DLB: adjust prerendering and mixing gain in OSBA encoder. This is fix to float codes*/ #define NONBE_1233_HQ_CLASSIFIER_DIV_BY_ZERO /* Eri: issue 1233: Address possible division by zero in hf_spectrum_sparseness() */ //#define NONBE_FIX_SBA_TRANS_DET_PRECISION /*Work in progress*/ #define NONBE_FIX_SBA_FFT_PRECISION /*Work in progress*/ //#define NONBE_FIX_SBA_FFT_PRECISION /*Work in progress*/ #endif lib_enc/ivas_dirac_enc.c +3 −3 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ #include "ivas_rom_com.h" #include "ivas_rom_com_fx.h" #include "wmc_auto.h" #ifdef DEBUG_BYPASS_CORE_CODER #ifdef DEBUG_SPAR_FX_CODE #include "debug.h" #endif Loading Loading @@ -1299,7 +1299,7 @@ void ivas_dirac_param_est_enc_fx( &q_direction->band_data[band_m_idx].azimuth_fx[block_m_idx], &q_direction->band_data[band_m_idx].elevation_fx[block_m_idx] ); #ifdef DEBUG_BYPASS_CORE_CODER #ifdef DEBUG_SPAR_FX_CODE { char file_name[100] = { 0 }; float azi, ele, azi_fx, ele_fx; Loading Loading @@ -1379,7 +1379,7 @@ void ivas_dirac_param_est_enc_fx( hDirAC->diffuseness_m_exp[band_m_idx] = 1; move16(); #ifdef DEBUG_BYPASS_CORE_CODER #ifdef DEBUG_SPAR_FX_CODE { char file_name[100] = { 0 }; float diff, diff_fx; Loading Loading
lib_com/ivas_spar_com.c +59 −1 Original line number Diff line number Diff line Loading @@ -47,7 +47,9 @@ #include "basop32.h" #include "ivas_prot_fx.h" #include "ivas_rom_com_fx.h" #ifdef DEBUGGING #include "debug.h" #endif /*------------------------------------------------------------------------------------------* * Local constants Loading Loading @@ -4415,6 +4417,42 @@ void ivas_get_spar_md_from_dirac_enc_fx( } } #ifdef DEBUG_SPAR_FX_CODE { char file_name[100] = { 0 }; sprintf( file_name, "./res/dirac2spar_cov_mat.pcm" ); float cov_ref[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH][IVAS_MAX_NUM_BANDS]; float cov_fx[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH][IVAS_MAX_NUM_BANDS]; float pred_ref[3], pred_fx[3]; int16_t k = 0; for ( i = 0; i < num_ch; i++ ) { for ( j = 0; j < num_ch; j++ ) { for ( k = start_band; k < end_band; k++ ) { dbgread( &cov_ref[i][j][k], sizeof( float ), 1, file_name ); cov_fx[i][j][k] = (float) cov_real_dirac_fx[i][j][k] / ( (float) ( 1 << q_cov_real_dirac_fx[i][j][k] ) ); } } } for ( k = start_band; k < end_band; k++ ) { for ( i = 1; i < num_ch; i++ ) { pred_ref[i - 1] = cov_ref[i][0][k] / max( EPSILON, cov_ref[0][0][k] ); pred_fx[i - 1] = cov_fx[i][0][k] / max( EPSILON, cov_fx[0][0][k] ); if ( fabsf( pred_ref[i - 1] - pred_fx[i - 1] ) > 0.1 ) { pred_ref[i - 1] = pred_ref[i - 1]; } } } } #endif test(); active_w = ( EQ_16( dyn_active_w_flag, 1 ) ) || ( EQ_16( hSpar_md_cfg->active_w, 1 ) ); ivas_compute_spar_params_enc_fx( pCov_real_fx, p_q_Cov_real_fx, dm_fv_re_fx, &q_dm_fv_re_fx, i_ts, ppMixer_mat_fx, &q_ppMixer_mat, start_band, end_band, dtx_vad, num_ch, 1, active_w, active_w_vlbr, hSpar_md_cfg, hSpar_md, Wscale_fx, q_Wscale, 1, dyn_active_w_flag ); Loading Loading @@ -4459,6 +4497,26 @@ void ivas_get_spar_md_from_dirac_enc_fx( } } } #if 0 // def DEBUG_SPAR_FX_CODE { char file_name[100] = { 0 }; float mixer_mat[16][16][12]; sprintf( file_name, "./res/dirac2spar_mat_mixer.pcm" ); int16_t k = 0; for ( i = 0; i < num_ch; i++ ) { for ( j = 0; j < num_ch; j++ ) { for ( k = start_band; k < end_band; k++ ) { dbgread( &mixer_mat[i][j][k + i_ts * IVAS_MAX_NUM_BANDS], sizeof( float ), 1, file_name ); mixer_mat_fx[i][j][k + ( i_ts * IVAS_MAX_NUM_BANDS )] = (Word32) roundf( mixer_mat[i][j][k + i_ts * IVAS_MAX_NUM_BANDS] * ( 1 << *q_mixer_mat_fx ) ); } } } } #endif } } Loading
lib_com/options.h +1 −1 Original line number Diff line number Diff line Loading @@ -85,5 +85,5 @@ #define NONE_BE_FIX_BASOP_1044_OSBA_PRERENDER_MIX_GAINS /* DLB: adjust prerendering and mixing gain in OSBA encoder. This is fix to float codes*/ #define NONBE_1233_HQ_CLASSIFIER_DIV_BY_ZERO /* Eri: issue 1233: Address possible division by zero in hf_spectrum_sparseness() */ //#define NONBE_FIX_SBA_TRANS_DET_PRECISION /*Work in progress*/ #define NONBE_FIX_SBA_FFT_PRECISION /*Work in progress*/ //#define NONBE_FIX_SBA_FFT_PRECISION /*Work in progress*/ #endif
lib_enc/ivas_dirac_enc.c +3 −3 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ #include "ivas_rom_com.h" #include "ivas_rom_com_fx.h" #include "wmc_auto.h" #ifdef DEBUG_BYPASS_CORE_CODER #ifdef DEBUG_SPAR_FX_CODE #include "debug.h" #endif Loading Loading @@ -1299,7 +1299,7 @@ void ivas_dirac_param_est_enc_fx( &q_direction->band_data[band_m_idx].azimuth_fx[block_m_idx], &q_direction->band_data[band_m_idx].elevation_fx[block_m_idx] ); #ifdef DEBUG_BYPASS_CORE_CODER #ifdef DEBUG_SPAR_FX_CODE { char file_name[100] = { 0 }; float azi, ele, azi_fx, ele_fx; Loading Loading @@ -1379,7 +1379,7 @@ void ivas_dirac_param_est_enc_fx( hDirAC->diffuseness_m_exp[band_m_idx] = 1; move16(); #ifdef DEBUG_BYPASS_CORE_CODER #ifdef DEBUG_SPAR_FX_CODE { char file_name[100] = { 0 }; float diff, diff_fx; Loading