Loading lib_com/ivas_prot.h +12 −2 Original line number Diff line number Diff line Loading @@ -3995,12 +3995,22 @@ void ivas_dirac_dec_output_synthesis_cov_close( ); void ivas_dirac_dec_output_synthesis_cov_param_mc_collect_slot( #ifdef FIX_835_PARAMMC_BUFFER_VALUES float *RealBuffer, /* i : input channel filter bank samples (real part) */ float *ImagBuffer, /* i : input channel filter bank samples (imaginary part */ float cx[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS], /* o : accumulated input covariance (real part) */ float cx_imag[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS], /* o : accumulated input covariance (imaginary part) */ const int16_t param_band, /* i : parameter band */ PARAM_MC_DEC_HANDLE hParamMC, /* i : handle to Parametric MC state */ const int16_t nchan_in /* i : number of input channels */ #else float *RealBuffer, /* i : input channel filter bank samples (real part) */ float *ImagBuffer, /* i : input channel filter bank samples (imaginary part) */ float cx[PARAM_MC_MAX_PARAMETER_BANDS][PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS], /* o : accumulated input covariance (real part) */ float cx_imag[PARAM_MC_MAX_PARAMETER_BANDS][PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS], /* o : accumulated input covariance (imaginary part) */ PARAM_MC_DEC_HANDLE hParamMC, /* i : handle to Parametric MC state */ const int16_t nchan_in /* i : number of input channels */ #endif ); void ivas_dirac_dec_output_synthesis_cov_param_mc_synthesise_slot( Loading lib_com/options.h +2 −0 Original line number Diff line number Diff line Loading @@ -170,6 +170,8 @@ #define FIX_RETURN /* VA: fix location of function returns */ #endif #define FIX_1135_EXT_RENDERER_HANDLES /* VA: issue 1135: Memory usage reduction in external renderer: Allocate only handles that are really needed. */ #define FIX_1166_TDREND_DIV0 /* FhG,Eri: issue 1166: potential divide by zero in TD Renderer */ #define FIX_835_PARAMMC_BUFFER_VALUES /* FhG: BASOP issue 835: wide range of buffer values for cx in ParamMC */ /* #################### End BE switches ################################## */ Loading lib_dec/ivas_dirac_output_synthesis_cov.c +28 −3 Original line number Diff line number Diff line Loading @@ -312,15 +312,29 @@ void ivas_dirac_dec_output_synthesis_cov_close( *-------------------------------------------------------------------*/ void ivas_dirac_dec_output_synthesis_cov_param_mc_collect_slot( #ifdef FIX_835_PARAMMC_BUFFER_VALUES float *RealBuffer, /* i : input channel filter bank samples (real part) */ float *ImagBuffer, /* i : input channel filter bank samples (imaginary part */ float cx[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS], /* o : accumulated input covariance (real part) */ float cx_imag[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS], /* o : accumulated input covariance (imaginary part) */ const int16_t param_band, /* i : parameter band */ PARAM_MC_DEC_HANDLE hParamMC, /* i : handle to Parametric MC state */ const int16_t nchan_in /* i : number of input channels */ #else float *RealBuffer, /* i : input channel filter bank samples (real part) */ float *ImagBuffer, /* i : input channel filter bank samples (imaginary part */ float cx[PARAM_MC_MAX_PARAMETER_BANDS][PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS], /* o : accumulated input covariance (real part) */ float cx_imag[PARAM_MC_MAX_PARAMETER_BANDS][PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS], /* o : accumulated input covariance (imaginary part) */ PARAM_MC_DEC_HANDLE hParamMC, /* i : handle to Parametric MC state */ const int16_t nchan_in /* i : number of input channels */ #endif ) { #ifdef FIX_835_PARAMMC_BUFFER_VALUES int16_t band_idx, ch_idx; #else int16_t param_band, band_idx, ch_idx; #endif int16_t brange[2]; float real_in_buffer[PARAM_MC_MAX_BANDS_IN_PARAMETER_BAND * MAX_TRANSPORT_CHANNELS]; float imag_in_buffer[PARAM_MC_MAX_BANDS_IN_PARAMETER_BAND * MAX_TRANSPORT_CHANNELS]; Loading @@ -328,8 +342,10 @@ void ivas_dirac_dec_output_synthesis_cov_param_mc_collect_slot( float imag_buffer[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS]; /* estimate input covariance */ #ifndef FIX_835_PARAMMC_BUFFER_VALUES for ( param_band = 0; param_band < hParamMC->num_param_bands_synth; param_band++ ) { #endif /* Already stack here instead of in the process_subframe */ /* collect input frame */ Loading @@ -350,10 +366,19 @@ void ivas_dirac_dec_output_synthesis_cov_param_mc_collect_slot( cmplx_matrix_square( real_in_buffer, imag_in_buffer, num_bands, nchan_in, real_buffer, imag_buffer ); #ifdef FIX_835_PARAMMC_BUFFER_VALUES v_add( cx, real_buffer, cx, nchan_in * nchan_in ); v_add( cx_imag, imag_buffer, cx_imag, nchan_in * nchan_in ); #else v_add( cx[param_band], real_buffer, cx[param_band], nchan_in * nchan_in ); v_add( cx_imag[param_band], imag_buffer, cx_imag[param_band], nchan_in * nchan_in ); #endif #ifndef FIX_835_PARAMMC_BUFFER_VALUES } #endif return; } Loading lib_dec/ivas_mc_param_dec.c +172 −35 Original line number Diff line number Diff line Loading @@ -86,7 +86,11 @@ static int16_t ivas_param_mc_uniform_decoder( float *seq, const int16_t sz_seq, static void ivas_param_mc_dequantize_cov( PARAM_MC_DEC_HANDLE hDirAC, float *ild_q, float *icc_q, const int16_t param_band_index, const int16_t nY_int, const PARAM_MC_SYNTHESIS_CONF synth_conf, const int16_t nY, const int16_t nX, float *Cx_state, float *Cproto, float *Cy_state ); #ifdef FIX_835_PARAMMC_BUFFER_VALUES static void ivas_param_mc_get_mixing_matrices( PARAM_MC_DEC_HANDLE hParamMC, IVAS_OUTPUT_SETUP *hSynthesisOutputSetup, float Cx_in[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS], const int16_t param_band_idx, float *mixing_matrix[], float *mixing_matrix_res[], const int16_t nY_int, const PARAM_MC_SYNTHESIS_CONF synth_conf, const int16_t nX, const int16_t nY ); #else static void ivas_param_mc_get_mixing_matrices( PARAM_MC_DEC_HANDLE hParamMC, IVAS_OUTPUT_SETUP *hSynthesisOutputSetup, float Cx_in[PARAM_MC_MAX_PARAMETER_BANDS][PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS], float *mixing_matrix[], float *mixing_matrix_res[], const int16_t nY_int, const PARAM_MC_SYNTHESIS_CONF synth_conf, const int16_t nX, const int16_t nY ); #endif static void param_mc_update_mixing_matrices( PARAM_MC_DEC_HANDLE hParamMC, float *mixing_matrix[], float *mixing_matrix_res[], const uint16_t nX, const uint16_t nY ); Loading Loading @@ -1328,12 +1332,23 @@ void ivas_param_mc_dec_digest_tc( { PARAM_MC_DEC_HANDLE hParamMC; int16_t i, ch; #ifdef FIX_835_PARAMMC_BUFFER_VALUES int16_t is_next_band, skip_next_band; #endif int16_t slot_idx, param_band_idx; int16_t nchan_transport, nchan_out_transport, nchan_out_cldfb; int16_t nchan_out_cov; /*CLDFB*/ #ifdef FIX_835_PARAMMC_BUFFER_VALUES float *pCx, *pCx_imag; float cx[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS]; float cx_imag[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS]; float cx_next_band[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS]; float cx_imag_next_band[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS]; #else float cx[PARAM_MC_MAX_PARAMETER_BANDS][PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS]; float cx_imag[PARAM_MC_MAX_PARAMETER_BANDS][PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS]; #endif float real_part, imag_part; /* format converter */ int16_t channel_active[MAX_OUTPUT_CHANNELS]; Loading Loading @@ -1391,17 +1406,35 @@ void ivas_param_mc_dec_digest_tc( ivas_param_mc_dec_compute_interpolator( hParamMC->hMetadataPMC->bAttackPresent, hParamMC->hMetadataPMC->attackIndex, nCldfbSlots, hParamMC->h_output_synthesis_params.interpolator ); #ifdef FIX_835_PARAMMC_BUFFER_VALUES /* loop over two bands at a time */ for ( param_band_idx = 0; param_band_idx < hParamMC->num_param_bands_synth; param_band_idx += 2 ) { /* don't process next band if it exceeds the limit */ skip_next_band = ( ( param_band_idx + 1 ) == hParamMC->num_param_bands_synth ) ? 1 : 0; set_zero( cx, PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS ); set_zero( cx_imag, PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS ); set_zero( cx_next_band, PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS ); set_zero( cx_imag_next_band, PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS ); #else for ( param_band_idx = 0; param_band_idx < PARAM_MC_MAX_PARAMETER_BANDS; param_band_idx++ ) { set_zero( cx[param_band_idx], PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS ); set_zero( cx_imag[param_band_idx], PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS ); } #endif /* slot loop for gathering the input data */ for ( slot_idx = 0; slot_idx < nCldfbSlots; slot_idx++ ) { if ( st_ivas->hDecoderConfig->Opt_tsm ) { #ifdef FIX_835_PARAMMC_BUFFER_VALUES if ( param_band_idx == 0 ) /* only run cldfbAna once */ { #endif float RealBuffer[CLDFB_NO_CHANNELS_MAX]; float ImagBuffer[CLDFB_NO_CHANNELS_MAX]; Loading @@ -1413,30 +1446,81 @@ void ivas_param_mc_dec_digest_tc( mvr2r( RealBuffer, &hParamMC->Cldfb_RealBuffer_tc[slot_idx * hParamMC->num_freq_bands * nchan_transport + ch * hParamMC->num_freq_bands], hParamMC->num_freq_bands ); mvr2r( ImagBuffer, &hParamMC->Cldfb_ImagBuffer_tc[slot_idx * hParamMC->num_freq_bands * nchan_transport + ch * hParamMC->num_freq_bands], hParamMC->num_freq_bands ); } #ifdef FIX_835_PARAMMC_BUFFER_VALUES } #endif } if ( slot_idx >= 2 * hParamMC->hMetadataPMC->attackIndex ) { ivas_dirac_dec_output_synthesis_cov_param_mc_collect_slot( &hParamMC->Cldfb_RealBuffer_tc[slot_idx * hParamMC->num_freq_bands * nchan_transport], &hParamMC->Cldfb_ImagBuffer_tc[slot_idx * hParamMC->num_freq_bands * nchan_transport], cx, cx_imag, hParamMC, nchan_transport ); #ifdef FIX_835_PARAMMC_BUFFER_VALUES for ( is_next_band = 0; is_next_band < 2; is_next_band++ ) { if ( is_next_band && skip_next_band ) { continue; } #endif ivas_dirac_dec_output_synthesis_cov_param_mc_collect_slot( &hParamMC->Cldfb_RealBuffer_tc[slot_idx * hParamMC->num_freq_bands * nchan_transport], &hParamMC->Cldfb_ImagBuffer_tc[slot_idx * hParamMC->num_freq_bands * nchan_transport], #ifdef FIX_835_PARAMMC_BUFFER_VALUES is_next_band ? cx_next_band : cx, is_next_band ? cx_imag_next_band : cx_imag, param_band_idx + is_next_band, #else cx, cx_imag, #endif hParamMC, nchan_transport ); #ifdef FIX_835_PARAMMC_BUFFER_VALUES } #endif } } /* map from complex input covariance to real values */ #ifdef FIX_835_PARAMMC_BUFFER_VALUES for ( is_next_band = 0; is_next_band < 2; is_next_band++ ) { if ( is_next_band && skip_next_band ) { continue; } #else for ( param_band_idx = 0; param_band_idx < hParamMC->num_param_bands_synth; param_band_idx++ ) { #endif /* Cx for transport channels */ #ifdef FIX_835_PARAMMC_BUFFER_VALUES pCx = is_next_band ? &cx_next_band[0] : &cx[0]; pCx_imag = is_next_band ? &cx_imag_next_band[0] : &cx_imag[0]; #endif for ( i = 0; i < nchan_transport * nchan_transport; i++ ) { #ifdef FIX_835_PARAMMC_BUFFER_VALUES real_part = pCx[i]; imag_part = pCx_imag[i]; #else real_part = cx[param_band_idx][i]; imag_part = cx_imag[param_band_idx][i]; #endif /* (a-ib)(c+id) = ac + bd + i(ad-bc) */ if ( param_band_idx < hParamMC->max_param_band_abs_cov ) { #ifdef FIX_835_PARAMMC_BUFFER_VALUES pCx[i] = sqrtf( real_part * real_part + imag_part * imag_part ); #else cx[param_band_idx][i] = sqrtf( real_part * real_part + imag_part * imag_part ); #endif } else { #ifdef FIX_835_PARAMMC_BUFFER_VALUES pCx[i] = real_part; #else cx[param_band_idx][i] = real_part; #endif } } } Loading @@ -1444,16 +1528,46 @@ void ivas_param_mc_dec_digest_tc( /* we have to do it similar to the encoder in case of attacks (i.e. accumulate two bands) to ensure correct DMX of the target covariance*/ if ( hParamMC->hMetadataPMC->bAttackPresent && ( hParamMC->synthesis_conf == PARAM_MC_SYNTH_LS_CONV_COV || hParamMC->synthesis_conf == PARAM_MC_SYNTH_MONO_STEREO ) ) { #ifdef FIX_835_PARAMMC_BUFFER_VALUES v_add( cx, cx_next_band, cx, nchan_transport * nchan_transport ); mvr2r( cx, cx_next_band, nchan_transport * nchan_transport ); #else for ( param_band_idx = 0; param_band_idx < hParamMC->num_param_bands_synth; param_band_idx += 2 ) { v_add( cx[param_band_idx], cx[param_band_idx + 1], cx[param_band_idx], nchan_transport * nchan_transport ); mvr2r( cx[param_band_idx], cx[param_band_idx + 1], nchan_transport * nchan_transport ); } #endif } #ifdef FIX_835_PARAMMC_BUFFER_VALUES for ( is_next_band = 0; is_next_band < 2; is_next_band++ ) { if ( is_next_band && skip_next_band ) { continue; } #endif /* generate mixing matrices */ ivas_param_mc_get_mixing_matrices( hParamMC, hSynthesisOutputSetup, cx, hParamMC->h_output_synthesis_cov_state.mixing_matrix, hParamMC->h_output_synthesis_cov_state.mixing_matrix_res, nchan_out_transport, hParamMC->synthesis_conf, nchan_transport, nchan_out_cov ); ivas_param_mc_get_mixing_matrices( hParamMC, hSynthesisOutputSetup, #ifdef FIX_835_PARAMMC_BUFFER_VALUES is_next_band ? cx_next_band : cx, param_band_idx + is_next_band, #else cx, #endif hParamMC->h_output_synthesis_cov_state.mixing_matrix, hParamMC->h_output_synthesis_cov_state.mixing_matrix_res, nchan_out_transport, hParamMC->synthesis_conf, nchan_transport, nchan_out_cov ); #ifdef FIX_835_PARAMMC_BUFFER_VALUES } } #endif pop_wmops(); Loading Loading @@ -2135,6 +2249,18 @@ static void remove_lfe_from_cy( *------------------------------------------------------------------------*/ static void ivas_param_mc_get_mixing_matrices( #ifdef FIX_835_PARAMMC_BUFFER_VALUES PARAM_MC_DEC_HANDLE hParamMC, /* i : Parametric MC handle */ IVAS_OUTPUT_SETUP *hSynthesisOutputSetup, float Cx_in[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS], /* i : input covariance for all parameter bands */ const int16_t param_band_idx, /* i : parameter band index */ float *mixing_matrix[], /* o : direct mixing matrices for all parameter bands */ float *mixing_matrix_res[], /* o : residual mixing matrices for all parameter bands */ const int16_t nY_intern, /* i : number of channels in the transported format */ const PARAM_MC_SYNTHESIS_CONF synth_config, /* i : Parametric MC synthesis config */ const int16_t nX, /* i : number of transport channels */ const int16_t nY_cov /* i : number of covariance synthesis output channels */ #else PARAM_MC_DEC_HANDLE hParamMC, /* i : Parametric MC handle */ IVAS_OUTPUT_SETUP *hSynthesisOutputSetup, float Cx_in[PARAM_MC_MAX_PARAMETER_BANDS][PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS], /* i : input covariance for all parameter bands */ Loading @@ -2144,9 +2270,12 @@ static void ivas_param_mc_get_mixing_matrices( const PARAM_MC_SYNTHESIS_CONF synth_config, /* i : Parametric MC synthesis config */ const int16_t nX, /* i : number of transport channels */ const int16_t nY_cov /* i : number of covariance synthesis output channels */ #endif ) { #ifndef FIX_835_PARAMMC_BUFFER_VALUES int16_t param_band_idx; #endif float Cx[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS]; float Cy[MAX_CICP_CHANNELS * MAX_CICP_CHANNELS]; float Cy_diag[MAX_CICP_CHANNELS]; Loading Loading @@ -2216,8 +2345,10 @@ static void ivas_param_mc_get_mixing_matrices( num_lfe_bands = PARAM_MC_MAX_BAND_LFE; } #ifndef FIX_835_PARAMMC_BUFFER_VALUES for ( param_band_idx = 0; param_band_idx < hParamMC->num_param_bands_synth; param_band_idx++ ) { #endif if ( hSynthesisOutputSetup->num_lfe > 0 && param_band_idx >= num_lfe_bands ) { remove_lfe = 1; Loading @@ -2232,7 +2363,11 @@ static void ivas_param_mc_get_mixing_matrices( brange[0] = hParamMC->band_grouping[param_band_idx]; brange[1] = hParamMC->band_grouping[param_band_idx + 1]; #ifdef FIX_835_PARAMMC_BUFFER_VALUES Cx_state = Cx_in; #else Cx_state = Cx_in[param_band_idx]; #endif Cx_old_state = hParamMC->h_output_synthesis_cov_state.cx_old[param_band_idx]; Cy_old_state = hParamMC->h_output_synthesis_cov_state.cy_old[param_band_idx]; Loading Loading @@ -2376,7 +2511,9 @@ static void ivas_param_mc_get_mixing_matrices( { mvr2r( mixing_matrix_local, mixing_matrix[param_band_idx], nY_cov * nX ); } #ifndef FIX_835_PARAMMC_BUFFER_VALUES } #endif return; } Loading lib_rend/ivas_objectRenderer_hrFilt.c +5 −0 Original line number Diff line number Diff line Loading @@ -218,8 +218,13 @@ static void GenerateFilter( ESynL += modelEval->BMEnergiesL[modelEval->UseIndsL[i]].val; ESynR += modelEval->BMEnergiesR[modelEval->UseIndsR[i]].val; } #ifdef FIX_1166_TDREND_DIV0 ScaleL = sqrtf( ETotL / ( ESynL + EPSILON ) ); ScaleR = sqrtf( ETotR / ( ESynR + EPSILON ) ); #else ScaleL = sqrtf( ETotL / ESynL ); ScaleR = sqrtf( ETotR / ESynR ); #endif /* Build using only the most energetic components. */ for ( k = model->iSecFirst[iSec]; k <= model->iSecLast[iSec]; k++ ) Loading Loading
lib_com/ivas_prot.h +12 −2 Original line number Diff line number Diff line Loading @@ -3995,12 +3995,22 @@ void ivas_dirac_dec_output_synthesis_cov_close( ); void ivas_dirac_dec_output_synthesis_cov_param_mc_collect_slot( #ifdef FIX_835_PARAMMC_BUFFER_VALUES float *RealBuffer, /* i : input channel filter bank samples (real part) */ float *ImagBuffer, /* i : input channel filter bank samples (imaginary part */ float cx[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS], /* o : accumulated input covariance (real part) */ float cx_imag[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS], /* o : accumulated input covariance (imaginary part) */ const int16_t param_band, /* i : parameter band */ PARAM_MC_DEC_HANDLE hParamMC, /* i : handle to Parametric MC state */ const int16_t nchan_in /* i : number of input channels */ #else float *RealBuffer, /* i : input channel filter bank samples (real part) */ float *ImagBuffer, /* i : input channel filter bank samples (imaginary part) */ float cx[PARAM_MC_MAX_PARAMETER_BANDS][PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS], /* o : accumulated input covariance (real part) */ float cx_imag[PARAM_MC_MAX_PARAMETER_BANDS][PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS], /* o : accumulated input covariance (imaginary part) */ PARAM_MC_DEC_HANDLE hParamMC, /* i : handle to Parametric MC state */ const int16_t nchan_in /* i : number of input channels */ #endif ); void ivas_dirac_dec_output_synthesis_cov_param_mc_synthesise_slot( Loading
lib_com/options.h +2 −0 Original line number Diff line number Diff line Loading @@ -170,6 +170,8 @@ #define FIX_RETURN /* VA: fix location of function returns */ #endif #define FIX_1135_EXT_RENDERER_HANDLES /* VA: issue 1135: Memory usage reduction in external renderer: Allocate only handles that are really needed. */ #define FIX_1166_TDREND_DIV0 /* FhG,Eri: issue 1166: potential divide by zero in TD Renderer */ #define FIX_835_PARAMMC_BUFFER_VALUES /* FhG: BASOP issue 835: wide range of buffer values for cx in ParamMC */ /* #################### End BE switches ################################## */ Loading
lib_dec/ivas_dirac_output_synthesis_cov.c +28 −3 Original line number Diff line number Diff line Loading @@ -312,15 +312,29 @@ void ivas_dirac_dec_output_synthesis_cov_close( *-------------------------------------------------------------------*/ void ivas_dirac_dec_output_synthesis_cov_param_mc_collect_slot( #ifdef FIX_835_PARAMMC_BUFFER_VALUES float *RealBuffer, /* i : input channel filter bank samples (real part) */ float *ImagBuffer, /* i : input channel filter bank samples (imaginary part */ float cx[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS], /* o : accumulated input covariance (real part) */ float cx_imag[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS], /* o : accumulated input covariance (imaginary part) */ const int16_t param_band, /* i : parameter band */ PARAM_MC_DEC_HANDLE hParamMC, /* i : handle to Parametric MC state */ const int16_t nchan_in /* i : number of input channels */ #else float *RealBuffer, /* i : input channel filter bank samples (real part) */ float *ImagBuffer, /* i : input channel filter bank samples (imaginary part */ float cx[PARAM_MC_MAX_PARAMETER_BANDS][PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS], /* o : accumulated input covariance (real part) */ float cx_imag[PARAM_MC_MAX_PARAMETER_BANDS][PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS], /* o : accumulated input covariance (imaginary part) */ PARAM_MC_DEC_HANDLE hParamMC, /* i : handle to Parametric MC state */ const int16_t nchan_in /* i : number of input channels */ #endif ) { #ifdef FIX_835_PARAMMC_BUFFER_VALUES int16_t band_idx, ch_idx; #else int16_t param_band, band_idx, ch_idx; #endif int16_t brange[2]; float real_in_buffer[PARAM_MC_MAX_BANDS_IN_PARAMETER_BAND * MAX_TRANSPORT_CHANNELS]; float imag_in_buffer[PARAM_MC_MAX_BANDS_IN_PARAMETER_BAND * MAX_TRANSPORT_CHANNELS]; Loading @@ -328,8 +342,10 @@ void ivas_dirac_dec_output_synthesis_cov_param_mc_collect_slot( float imag_buffer[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS]; /* estimate input covariance */ #ifndef FIX_835_PARAMMC_BUFFER_VALUES for ( param_band = 0; param_band < hParamMC->num_param_bands_synth; param_band++ ) { #endif /* Already stack here instead of in the process_subframe */ /* collect input frame */ Loading @@ -350,10 +366,19 @@ void ivas_dirac_dec_output_synthesis_cov_param_mc_collect_slot( cmplx_matrix_square( real_in_buffer, imag_in_buffer, num_bands, nchan_in, real_buffer, imag_buffer ); #ifdef FIX_835_PARAMMC_BUFFER_VALUES v_add( cx, real_buffer, cx, nchan_in * nchan_in ); v_add( cx_imag, imag_buffer, cx_imag, nchan_in * nchan_in ); #else v_add( cx[param_band], real_buffer, cx[param_band], nchan_in * nchan_in ); v_add( cx_imag[param_band], imag_buffer, cx_imag[param_band], nchan_in * nchan_in ); #endif #ifndef FIX_835_PARAMMC_BUFFER_VALUES } #endif return; } Loading
lib_dec/ivas_mc_param_dec.c +172 −35 Original line number Diff line number Diff line Loading @@ -86,7 +86,11 @@ static int16_t ivas_param_mc_uniform_decoder( float *seq, const int16_t sz_seq, static void ivas_param_mc_dequantize_cov( PARAM_MC_DEC_HANDLE hDirAC, float *ild_q, float *icc_q, const int16_t param_band_index, const int16_t nY_int, const PARAM_MC_SYNTHESIS_CONF synth_conf, const int16_t nY, const int16_t nX, float *Cx_state, float *Cproto, float *Cy_state ); #ifdef FIX_835_PARAMMC_BUFFER_VALUES static void ivas_param_mc_get_mixing_matrices( PARAM_MC_DEC_HANDLE hParamMC, IVAS_OUTPUT_SETUP *hSynthesisOutputSetup, float Cx_in[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS], const int16_t param_band_idx, float *mixing_matrix[], float *mixing_matrix_res[], const int16_t nY_int, const PARAM_MC_SYNTHESIS_CONF synth_conf, const int16_t nX, const int16_t nY ); #else static void ivas_param_mc_get_mixing_matrices( PARAM_MC_DEC_HANDLE hParamMC, IVAS_OUTPUT_SETUP *hSynthesisOutputSetup, float Cx_in[PARAM_MC_MAX_PARAMETER_BANDS][PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS], float *mixing_matrix[], float *mixing_matrix_res[], const int16_t nY_int, const PARAM_MC_SYNTHESIS_CONF synth_conf, const int16_t nX, const int16_t nY ); #endif static void param_mc_update_mixing_matrices( PARAM_MC_DEC_HANDLE hParamMC, float *mixing_matrix[], float *mixing_matrix_res[], const uint16_t nX, const uint16_t nY ); Loading Loading @@ -1328,12 +1332,23 @@ void ivas_param_mc_dec_digest_tc( { PARAM_MC_DEC_HANDLE hParamMC; int16_t i, ch; #ifdef FIX_835_PARAMMC_BUFFER_VALUES int16_t is_next_band, skip_next_band; #endif int16_t slot_idx, param_band_idx; int16_t nchan_transport, nchan_out_transport, nchan_out_cldfb; int16_t nchan_out_cov; /*CLDFB*/ #ifdef FIX_835_PARAMMC_BUFFER_VALUES float *pCx, *pCx_imag; float cx[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS]; float cx_imag[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS]; float cx_next_band[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS]; float cx_imag_next_band[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS]; #else float cx[PARAM_MC_MAX_PARAMETER_BANDS][PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS]; float cx_imag[PARAM_MC_MAX_PARAMETER_BANDS][PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS]; #endif float real_part, imag_part; /* format converter */ int16_t channel_active[MAX_OUTPUT_CHANNELS]; Loading Loading @@ -1391,17 +1406,35 @@ void ivas_param_mc_dec_digest_tc( ivas_param_mc_dec_compute_interpolator( hParamMC->hMetadataPMC->bAttackPresent, hParamMC->hMetadataPMC->attackIndex, nCldfbSlots, hParamMC->h_output_synthesis_params.interpolator ); #ifdef FIX_835_PARAMMC_BUFFER_VALUES /* loop over two bands at a time */ for ( param_band_idx = 0; param_band_idx < hParamMC->num_param_bands_synth; param_band_idx += 2 ) { /* don't process next band if it exceeds the limit */ skip_next_band = ( ( param_band_idx + 1 ) == hParamMC->num_param_bands_synth ) ? 1 : 0; set_zero( cx, PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS ); set_zero( cx_imag, PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS ); set_zero( cx_next_band, PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS ); set_zero( cx_imag_next_band, PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS ); #else for ( param_band_idx = 0; param_band_idx < PARAM_MC_MAX_PARAMETER_BANDS; param_band_idx++ ) { set_zero( cx[param_band_idx], PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS ); set_zero( cx_imag[param_band_idx], PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS ); } #endif /* slot loop for gathering the input data */ for ( slot_idx = 0; slot_idx < nCldfbSlots; slot_idx++ ) { if ( st_ivas->hDecoderConfig->Opt_tsm ) { #ifdef FIX_835_PARAMMC_BUFFER_VALUES if ( param_band_idx == 0 ) /* only run cldfbAna once */ { #endif float RealBuffer[CLDFB_NO_CHANNELS_MAX]; float ImagBuffer[CLDFB_NO_CHANNELS_MAX]; Loading @@ -1413,30 +1446,81 @@ void ivas_param_mc_dec_digest_tc( mvr2r( RealBuffer, &hParamMC->Cldfb_RealBuffer_tc[slot_idx * hParamMC->num_freq_bands * nchan_transport + ch * hParamMC->num_freq_bands], hParamMC->num_freq_bands ); mvr2r( ImagBuffer, &hParamMC->Cldfb_ImagBuffer_tc[slot_idx * hParamMC->num_freq_bands * nchan_transport + ch * hParamMC->num_freq_bands], hParamMC->num_freq_bands ); } #ifdef FIX_835_PARAMMC_BUFFER_VALUES } #endif } if ( slot_idx >= 2 * hParamMC->hMetadataPMC->attackIndex ) { ivas_dirac_dec_output_synthesis_cov_param_mc_collect_slot( &hParamMC->Cldfb_RealBuffer_tc[slot_idx * hParamMC->num_freq_bands * nchan_transport], &hParamMC->Cldfb_ImagBuffer_tc[slot_idx * hParamMC->num_freq_bands * nchan_transport], cx, cx_imag, hParamMC, nchan_transport ); #ifdef FIX_835_PARAMMC_BUFFER_VALUES for ( is_next_band = 0; is_next_band < 2; is_next_band++ ) { if ( is_next_band && skip_next_band ) { continue; } #endif ivas_dirac_dec_output_synthesis_cov_param_mc_collect_slot( &hParamMC->Cldfb_RealBuffer_tc[slot_idx * hParamMC->num_freq_bands * nchan_transport], &hParamMC->Cldfb_ImagBuffer_tc[slot_idx * hParamMC->num_freq_bands * nchan_transport], #ifdef FIX_835_PARAMMC_BUFFER_VALUES is_next_band ? cx_next_band : cx, is_next_band ? cx_imag_next_band : cx_imag, param_band_idx + is_next_band, #else cx, cx_imag, #endif hParamMC, nchan_transport ); #ifdef FIX_835_PARAMMC_BUFFER_VALUES } #endif } } /* map from complex input covariance to real values */ #ifdef FIX_835_PARAMMC_BUFFER_VALUES for ( is_next_band = 0; is_next_band < 2; is_next_band++ ) { if ( is_next_band && skip_next_band ) { continue; } #else for ( param_band_idx = 0; param_band_idx < hParamMC->num_param_bands_synth; param_band_idx++ ) { #endif /* Cx for transport channels */ #ifdef FIX_835_PARAMMC_BUFFER_VALUES pCx = is_next_band ? &cx_next_band[0] : &cx[0]; pCx_imag = is_next_band ? &cx_imag_next_band[0] : &cx_imag[0]; #endif for ( i = 0; i < nchan_transport * nchan_transport; i++ ) { #ifdef FIX_835_PARAMMC_BUFFER_VALUES real_part = pCx[i]; imag_part = pCx_imag[i]; #else real_part = cx[param_band_idx][i]; imag_part = cx_imag[param_band_idx][i]; #endif /* (a-ib)(c+id) = ac + bd + i(ad-bc) */ if ( param_band_idx < hParamMC->max_param_band_abs_cov ) { #ifdef FIX_835_PARAMMC_BUFFER_VALUES pCx[i] = sqrtf( real_part * real_part + imag_part * imag_part ); #else cx[param_band_idx][i] = sqrtf( real_part * real_part + imag_part * imag_part ); #endif } else { #ifdef FIX_835_PARAMMC_BUFFER_VALUES pCx[i] = real_part; #else cx[param_band_idx][i] = real_part; #endif } } } Loading @@ -1444,16 +1528,46 @@ void ivas_param_mc_dec_digest_tc( /* we have to do it similar to the encoder in case of attacks (i.e. accumulate two bands) to ensure correct DMX of the target covariance*/ if ( hParamMC->hMetadataPMC->bAttackPresent && ( hParamMC->synthesis_conf == PARAM_MC_SYNTH_LS_CONV_COV || hParamMC->synthesis_conf == PARAM_MC_SYNTH_MONO_STEREO ) ) { #ifdef FIX_835_PARAMMC_BUFFER_VALUES v_add( cx, cx_next_band, cx, nchan_transport * nchan_transport ); mvr2r( cx, cx_next_band, nchan_transport * nchan_transport ); #else for ( param_band_idx = 0; param_band_idx < hParamMC->num_param_bands_synth; param_band_idx += 2 ) { v_add( cx[param_band_idx], cx[param_band_idx + 1], cx[param_band_idx], nchan_transport * nchan_transport ); mvr2r( cx[param_band_idx], cx[param_band_idx + 1], nchan_transport * nchan_transport ); } #endif } #ifdef FIX_835_PARAMMC_BUFFER_VALUES for ( is_next_band = 0; is_next_band < 2; is_next_band++ ) { if ( is_next_band && skip_next_band ) { continue; } #endif /* generate mixing matrices */ ivas_param_mc_get_mixing_matrices( hParamMC, hSynthesisOutputSetup, cx, hParamMC->h_output_synthesis_cov_state.mixing_matrix, hParamMC->h_output_synthesis_cov_state.mixing_matrix_res, nchan_out_transport, hParamMC->synthesis_conf, nchan_transport, nchan_out_cov ); ivas_param_mc_get_mixing_matrices( hParamMC, hSynthesisOutputSetup, #ifdef FIX_835_PARAMMC_BUFFER_VALUES is_next_band ? cx_next_band : cx, param_band_idx + is_next_band, #else cx, #endif hParamMC->h_output_synthesis_cov_state.mixing_matrix, hParamMC->h_output_synthesis_cov_state.mixing_matrix_res, nchan_out_transport, hParamMC->synthesis_conf, nchan_transport, nchan_out_cov ); #ifdef FIX_835_PARAMMC_BUFFER_VALUES } } #endif pop_wmops(); Loading Loading @@ -2135,6 +2249,18 @@ static void remove_lfe_from_cy( *------------------------------------------------------------------------*/ static void ivas_param_mc_get_mixing_matrices( #ifdef FIX_835_PARAMMC_BUFFER_VALUES PARAM_MC_DEC_HANDLE hParamMC, /* i : Parametric MC handle */ IVAS_OUTPUT_SETUP *hSynthesisOutputSetup, float Cx_in[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS], /* i : input covariance for all parameter bands */ const int16_t param_band_idx, /* i : parameter band index */ float *mixing_matrix[], /* o : direct mixing matrices for all parameter bands */ float *mixing_matrix_res[], /* o : residual mixing matrices for all parameter bands */ const int16_t nY_intern, /* i : number of channels in the transported format */ const PARAM_MC_SYNTHESIS_CONF synth_config, /* i : Parametric MC synthesis config */ const int16_t nX, /* i : number of transport channels */ const int16_t nY_cov /* i : number of covariance synthesis output channels */ #else PARAM_MC_DEC_HANDLE hParamMC, /* i : Parametric MC handle */ IVAS_OUTPUT_SETUP *hSynthesisOutputSetup, float Cx_in[PARAM_MC_MAX_PARAMETER_BANDS][PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS], /* i : input covariance for all parameter bands */ Loading @@ -2144,9 +2270,12 @@ static void ivas_param_mc_get_mixing_matrices( const PARAM_MC_SYNTHESIS_CONF synth_config, /* i : Parametric MC synthesis config */ const int16_t nX, /* i : number of transport channels */ const int16_t nY_cov /* i : number of covariance synthesis output channels */ #endif ) { #ifndef FIX_835_PARAMMC_BUFFER_VALUES int16_t param_band_idx; #endif float Cx[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_TRANSPORT_CHANS]; float Cy[MAX_CICP_CHANNELS * MAX_CICP_CHANNELS]; float Cy_diag[MAX_CICP_CHANNELS]; Loading Loading @@ -2216,8 +2345,10 @@ static void ivas_param_mc_get_mixing_matrices( num_lfe_bands = PARAM_MC_MAX_BAND_LFE; } #ifndef FIX_835_PARAMMC_BUFFER_VALUES for ( param_band_idx = 0; param_band_idx < hParamMC->num_param_bands_synth; param_band_idx++ ) { #endif if ( hSynthesisOutputSetup->num_lfe > 0 && param_band_idx >= num_lfe_bands ) { remove_lfe = 1; Loading @@ -2232,7 +2363,11 @@ static void ivas_param_mc_get_mixing_matrices( brange[0] = hParamMC->band_grouping[param_band_idx]; brange[1] = hParamMC->band_grouping[param_band_idx + 1]; #ifdef FIX_835_PARAMMC_BUFFER_VALUES Cx_state = Cx_in; #else Cx_state = Cx_in[param_band_idx]; #endif Cx_old_state = hParamMC->h_output_synthesis_cov_state.cx_old[param_band_idx]; Cy_old_state = hParamMC->h_output_synthesis_cov_state.cy_old[param_band_idx]; Loading Loading @@ -2376,7 +2511,9 @@ static void ivas_param_mc_get_mixing_matrices( { mvr2r( mixing_matrix_local, mixing_matrix[param_band_idx], nY_cov * nX ); } #ifndef FIX_835_PARAMMC_BUFFER_VALUES } #endif return; } Loading
lib_rend/ivas_objectRenderer_hrFilt.c +5 −0 Original line number Diff line number Diff line Loading @@ -218,8 +218,13 @@ static void GenerateFilter( ESynL += modelEval->BMEnergiesL[modelEval->UseIndsL[i]].val; ESynR += modelEval->BMEnergiesR[modelEval->UseIndsR[i]].val; } #ifdef FIX_1166_TDREND_DIV0 ScaleL = sqrtf( ETotL / ( ESynL + EPSILON ) ); ScaleR = sqrtf( ETotR / ( ESynR + EPSILON ) ); #else ScaleL = sqrtf( ETotL / ESynL ); ScaleR = sqrtf( ETotR / ESynR ); #endif /* Build using only the most energetic components. */ for ( k = model->iSecFirst[iSec]; k <= model->iSecLast[iSec]; k++ ) Loading