Loading lib_com/ivas_spar_com.c +4 −117 Original line number Diff line number Diff line Loading @@ -1640,11 +1640,6 @@ void ivas_get_spar_md_from_dirac( float azi_dirac[IVAS_MAX_NUM_BANDS][MAX_PARAM_SPATIAL_SUBFRAMES], float ele_dirac[IVAS_MAX_NUM_BANDS][MAX_PARAM_SPATIAL_SUBFRAMES], float diffuseness[IVAS_MAX_NUM_BANDS], #ifdef HODIRAC_PRED float azi_dirac2[IVAS_MAX_NUM_BANDS][MAX_PARAM_SPATIAL_SUBFRAMES], float ele_dirac2[IVAS_MAX_NUM_BANDS][MAX_PARAM_SPATIAL_SUBFRAMES], float ratio[IVAS_MAX_NUM_BANDS], #endif const int16_t n_ts, float ***mixer_mat, ivas_spar_md_t *hSpar_md, Loading @@ -1654,20 +1649,12 @@ void ivas_get_spar_md_from_dirac( const int16_t order, const int16_t dtx_vad, float Wscale_d[IVAS_MAX_NUM_BANDS] #ifdef HODIRAC_PRED , int16_t hodirac #endif ) { int16_t num_ch, band, i, j; int16_t block, ch; float response_avg[MAX_OUTPUT_CHANNELS]; float response[MAX_PARAM_SPATIAL_SUBFRAMES][MAX_OUTPUT_CHANNELS]; #ifdef HODIRAC_PRED float response_avg2[MAX_OUTPUT_CHANNELS]; float response2[MAX_PARAM_SPATIAL_SUBFRAMES][MAX_OUTPUT_CHANNELS]; #endif float cov_real_dirac[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH][IVAS_MAX_NUM_BANDS]; float *pCov_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH]; float dm_fv_re[IVAS_SPAR_MAX_CH - 1][IVAS_MAX_NUM_BANDS]; Loading @@ -1676,10 +1663,7 @@ void ivas_get_spar_md_from_dirac( float **ppMixer_mat[IVAS_MAX_FB_MIXER_OUT_CH]; float *pMixer_mat[IVAS_MAX_FB_MIXER_OUT_CH][IVAS_MAX_SPAR_FB_MIXER_IN_CH]; float en_ratio_fac, diff_norm_order1, diff_norm_order2, diff_norm_order3; #ifdef HODIRAC_PRED float w1 = 0; float w2 = 0; #endif int16_t ndm, foa_ch, hoa2_ch; float P_dir_fact[IVAS_SPAR_MAX_CH - 1]; const int16_t *remix_order; Loading @@ -1692,16 +1676,14 @@ void ivas_get_spar_md_from_dirac( IVAS_256k /*dummy value as order is always 1 in this function*/ #endif ); #ifdef HODIRAC_PRED hoa2_ch = 6; #else hoa2_ch = ivas_sba_get_nchan_metadata( SBA_HOA2_ORDER #ifdef SPAR_HOA2_PLANAR_HOA3_DECOR_OPT , IVAS_256k /*dummy value as order is always 1 in this function*/ #endif ); #endif foa_ch = FOA_CHANNELS; diff_norm_order1 = 3.0f; diff_norm_order2 = 5.0f; Loading Loading @@ -1771,34 +1753,16 @@ void ivas_get_spar_md_from_dirac( /*SPAR from DirAC*/ set_f( response_avg, 0.0f, MAX_OUTPUT_CHANNELS ); #ifdef HODIRAC_PRED if ( hodirac ) { set_f( response_avg2, 0.0f, MAX_OUTPUT_CHANNELS ); } #endif if ( n_ts > 1 ) { ivas_dirac_dec_get_response( (int16_t) azi_dirac[band][i_ts], (int16_t) ele_dirac[band][i_ts], response_avg, order ); #ifdef HODIRAC_PRED if ( hodirac ) { ivas_dirac_dec_get_response( (int16_t) azi_dirac2[band][i_ts], (int16_t) ele_dirac2[band][i_ts], response_avg2, order ); } #endif } else { for ( block = 0; block < MAX_PARAM_SPATIAL_SUBFRAMES; block++ ) { ivas_dirac_dec_get_response( (int16_t) azi_dirac[band][block], (int16_t) ele_dirac[band][block], &( response[block][0] ), order ); #ifdef HODIRAC_PRED if ( hodirac ) { ivas_dirac_dec_get_response( (int16_t) azi_dirac2[band][block], (int16_t) ele_dirac2[band][block], &( response2[block][0] ), order ); } #endif } /* average responses in all subframes*/ Loading Loading @@ -1853,56 +1817,6 @@ void ivas_get_spar_md_from_dirac( { response_avg[ch] /= norm; } #ifdef HODIRAC_PRED if ( hodirac ) { for ( ch = 0; ch < num_ch_order; ch++ ) { for ( block = 0; block < MAX_PARAM_SPATIAL_SUBFRAMES; block++ ) { response_avg2[ch] += response2[block][ch]; } response_avg2[ch] /= MAX_PARAM_SPATIAL_SUBFRAMES; } norm = 0.0f; for ( ch = 1; ch < foa_ch; ch++ ) { norm += response_avg2[ch] * response_avg2[ch]; } norm = max( EPSILON, sqrtf( norm ) ); for ( ch = 1; ch < foa_ch; ch++ ) { response_avg2[ch] /= norm; } /*normalize 2nd order*/ norm = 0.0f; for ( ch = foa_ch; ch < min( hoa2_ch_order, num_ch_order ); ch++ ) { norm += response_avg2[ch] * response_avg2[ch]; } norm = max( EPSILON, sqrtf( norm ) ); for ( ch = foa_ch; ch < min( hoa2_ch_order, num_ch_order ); ch++ ) { response_avg2[ch] /= norm; } /*normalize 3rd order*/ norm = 0.0f; for ( ch = hoa2_ch_order; ch < num_ch_order; ch++ ) { norm += response_avg2[ch] * response_avg2[ch]; } norm = max( EPSILON, sqrtf( norm ) ); for ( ch = hoa2_ch_order; ch < num_ch_order; ch++ ) { response_avg2[ch] /= norm; } } #endif } } Loading @@ -1910,36 +1824,9 @@ void ivas_get_spar_md_from_dirac( { response_avg[i] = response_avg[HOA_keep_ind[i]]; } #ifdef HODIRAC_PRED if ( hodirac ) { for ( i = FOA_CHANNELS + 1; i < num_ch; i++ ) { response_avg2[i] = response_avg2[HOA_keep_ind[i]]; } } #endif en_ratio_fac = ( 1.0f - diffuseness[band] ); #ifdef HODIRAC_PRED if ( hodirac ) { w1 = ratio[band] * ratio[band]; w2 = ( 1.0f - ratio[band] ) * ( 1.0f - ratio[band] ); for ( i = 0; i < num_ch; i++ ) { for ( j = 0; j < num_ch; j++ ) { cov_real_dirac[i][j][band] = en_ratio_fac * ( w1 * response_avg[i] * response_avg[j] + w2 * response_avg2[i] * response_avg2[j] ); if ( i == j ) { cov_real_dirac[i][j][band] += diffuseness[band]; } } } } else #endif { for ( i = 0; i < num_ch; i++ ) { Loading lib_com/options.h +0 −2 Original line number Diff line number Diff line Loading @@ -166,9 +166,7 @@ #define HODIRAC /* FhG: Sector-based HO-DirAC method for SBA at high bitrates */ #define HODIRAC_CRASH_FIX /*#define HODIRAC_PRED*/ #define SPAR_HOA2_PLANAR_HOA3_DECOR_OPT //#define DIRAC_DRCT_GAIN_DISABLE #define HODIRAC_FIX_BR_SWITCHING_CRASH Loading Loading
lib_com/ivas_spar_com.c +4 −117 Original line number Diff line number Diff line Loading @@ -1640,11 +1640,6 @@ void ivas_get_spar_md_from_dirac( float azi_dirac[IVAS_MAX_NUM_BANDS][MAX_PARAM_SPATIAL_SUBFRAMES], float ele_dirac[IVAS_MAX_NUM_BANDS][MAX_PARAM_SPATIAL_SUBFRAMES], float diffuseness[IVAS_MAX_NUM_BANDS], #ifdef HODIRAC_PRED float azi_dirac2[IVAS_MAX_NUM_BANDS][MAX_PARAM_SPATIAL_SUBFRAMES], float ele_dirac2[IVAS_MAX_NUM_BANDS][MAX_PARAM_SPATIAL_SUBFRAMES], float ratio[IVAS_MAX_NUM_BANDS], #endif const int16_t n_ts, float ***mixer_mat, ivas_spar_md_t *hSpar_md, Loading @@ -1654,20 +1649,12 @@ void ivas_get_spar_md_from_dirac( const int16_t order, const int16_t dtx_vad, float Wscale_d[IVAS_MAX_NUM_BANDS] #ifdef HODIRAC_PRED , int16_t hodirac #endif ) { int16_t num_ch, band, i, j; int16_t block, ch; float response_avg[MAX_OUTPUT_CHANNELS]; float response[MAX_PARAM_SPATIAL_SUBFRAMES][MAX_OUTPUT_CHANNELS]; #ifdef HODIRAC_PRED float response_avg2[MAX_OUTPUT_CHANNELS]; float response2[MAX_PARAM_SPATIAL_SUBFRAMES][MAX_OUTPUT_CHANNELS]; #endif float cov_real_dirac[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH][IVAS_MAX_NUM_BANDS]; float *pCov_real[IVAS_SPAR_MAX_CH][IVAS_SPAR_MAX_CH]; float dm_fv_re[IVAS_SPAR_MAX_CH - 1][IVAS_MAX_NUM_BANDS]; Loading @@ -1676,10 +1663,7 @@ void ivas_get_spar_md_from_dirac( float **ppMixer_mat[IVAS_MAX_FB_MIXER_OUT_CH]; float *pMixer_mat[IVAS_MAX_FB_MIXER_OUT_CH][IVAS_MAX_SPAR_FB_MIXER_IN_CH]; float en_ratio_fac, diff_norm_order1, diff_norm_order2, diff_norm_order3; #ifdef HODIRAC_PRED float w1 = 0; float w2 = 0; #endif int16_t ndm, foa_ch, hoa2_ch; float P_dir_fact[IVAS_SPAR_MAX_CH - 1]; const int16_t *remix_order; Loading @@ -1692,16 +1676,14 @@ void ivas_get_spar_md_from_dirac( IVAS_256k /*dummy value as order is always 1 in this function*/ #endif ); #ifdef HODIRAC_PRED hoa2_ch = 6; #else hoa2_ch = ivas_sba_get_nchan_metadata( SBA_HOA2_ORDER #ifdef SPAR_HOA2_PLANAR_HOA3_DECOR_OPT , IVAS_256k /*dummy value as order is always 1 in this function*/ #endif ); #endif foa_ch = FOA_CHANNELS; diff_norm_order1 = 3.0f; diff_norm_order2 = 5.0f; Loading Loading @@ -1771,34 +1753,16 @@ void ivas_get_spar_md_from_dirac( /*SPAR from DirAC*/ set_f( response_avg, 0.0f, MAX_OUTPUT_CHANNELS ); #ifdef HODIRAC_PRED if ( hodirac ) { set_f( response_avg2, 0.0f, MAX_OUTPUT_CHANNELS ); } #endif if ( n_ts > 1 ) { ivas_dirac_dec_get_response( (int16_t) azi_dirac[band][i_ts], (int16_t) ele_dirac[band][i_ts], response_avg, order ); #ifdef HODIRAC_PRED if ( hodirac ) { ivas_dirac_dec_get_response( (int16_t) azi_dirac2[band][i_ts], (int16_t) ele_dirac2[band][i_ts], response_avg2, order ); } #endif } else { for ( block = 0; block < MAX_PARAM_SPATIAL_SUBFRAMES; block++ ) { ivas_dirac_dec_get_response( (int16_t) azi_dirac[band][block], (int16_t) ele_dirac[band][block], &( response[block][0] ), order ); #ifdef HODIRAC_PRED if ( hodirac ) { ivas_dirac_dec_get_response( (int16_t) azi_dirac2[band][block], (int16_t) ele_dirac2[band][block], &( response2[block][0] ), order ); } #endif } /* average responses in all subframes*/ Loading Loading @@ -1853,56 +1817,6 @@ void ivas_get_spar_md_from_dirac( { response_avg[ch] /= norm; } #ifdef HODIRAC_PRED if ( hodirac ) { for ( ch = 0; ch < num_ch_order; ch++ ) { for ( block = 0; block < MAX_PARAM_SPATIAL_SUBFRAMES; block++ ) { response_avg2[ch] += response2[block][ch]; } response_avg2[ch] /= MAX_PARAM_SPATIAL_SUBFRAMES; } norm = 0.0f; for ( ch = 1; ch < foa_ch; ch++ ) { norm += response_avg2[ch] * response_avg2[ch]; } norm = max( EPSILON, sqrtf( norm ) ); for ( ch = 1; ch < foa_ch; ch++ ) { response_avg2[ch] /= norm; } /*normalize 2nd order*/ norm = 0.0f; for ( ch = foa_ch; ch < min( hoa2_ch_order, num_ch_order ); ch++ ) { norm += response_avg2[ch] * response_avg2[ch]; } norm = max( EPSILON, sqrtf( norm ) ); for ( ch = foa_ch; ch < min( hoa2_ch_order, num_ch_order ); ch++ ) { response_avg2[ch] /= norm; } /*normalize 3rd order*/ norm = 0.0f; for ( ch = hoa2_ch_order; ch < num_ch_order; ch++ ) { norm += response_avg2[ch] * response_avg2[ch]; } norm = max( EPSILON, sqrtf( norm ) ); for ( ch = hoa2_ch_order; ch < num_ch_order; ch++ ) { response_avg2[ch] /= norm; } } #endif } } Loading @@ -1910,36 +1824,9 @@ void ivas_get_spar_md_from_dirac( { response_avg[i] = response_avg[HOA_keep_ind[i]]; } #ifdef HODIRAC_PRED if ( hodirac ) { for ( i = FOA_CHANNELS + 1; i < num_ch; i++ ) { response_avg2[i] = response_avg2[HOA_keep_ind[i]]; } } #endif en_ratio_fac = ( 1.0f - diffuseness[band] ); #ifdef HODIRAC_PRED if ( hodirac ) { w1 = ratio[band] * ratio[band]; w2 = ( 1.0f - ratio[band] ) * ( 1.0f - ratio[band] ); for ( i = 0; i < num_ch; i++ ) { for ( j = 0; j < num_ch; j++ ) { cov_real_dirac[i][j][band] = en_ratio_fac * ( w1 * response_avg[i] * response_avg[j] + w2 * response_avg2[i] * response_avg2[j] ); if ( i == j ) { cov_real_dirac[i][j][band] += diffuseness[band]; } } } } else #endif { for ( i = 0; i < num_ch; i++ ) { Loading
lib_com/options.h +0 −2 Original line number Diff line number Diff line Loading @@ -166,9 +166,7 @@ #define HODIRAC /* FhG: Sector-based HO-DirAC method for SBA at high bitrates */ #define HODIRAC_CRASH_FIX /*#define HODIRAC_PRED*/ #define SPAR_HOA2_PLANAR_HOA3_DECOR_OPT //#define DIRAC_DRCT_GAIN_DISABLE #define HODIRAC_FIX_BR_SWITCHING_CRASH Loading