Loading lib_com/ivas_prot.h +20 −0 Original line number Diff line number Diff line Loading @@ -5447,6 +5447,26 @@ void ivas_lfe_synth_with_filters( const int16_t lfeChannelIndex /* i : LFE channel index */ ); #ifdef FIX_572_LFE_LPF_ENC /*----------------------------------------------------------------------------------* * LFE encoder low pass filter prototypes *----------------------------------------------------------------------------------*/ ivas_error ivas_create_lfe_lpf_enc( ivas_filters_process_state_t **ph_lfe_lpf_filter_state, /* o : IVAS LFE encoder structure */ const int32_t input_Fs /* i : input sampling rate */ ); void ivas_lfe_lpf_enc_close( ivas_filters_process_state_t **ph_lfe_lpf_filter_state /* i/o: LFE encoder handle */ ); void ivas_lfe_lpf_enc_apply( ivas_filters_process_state_t *h_lfe_lpf_filter_state, /* i/o: LFE encoder handle */ float data_lfe_ch[], /* i : input LFE signal */ const int16_t input_frame /* i : input frame length per channel */ ); #endif /*----------------------------------------------------------------------------------* * LFE Coding prototypes Loading lib_com/options.h +1 −1 Original line number Diff line number Diff line Loading @@ -151,7 +151,7 @@ #define FIX_565_SBA_BURST_IN_FEC /* VA: Issue 565: Fix noise burst during FEC, due to wrong total_brate initialization */ #define FIX_562_ISM2_64KBPS /* VA: issue 562: fix ISM2 at 64kbps issue */ #define FIX_559_EXTL_IGF_MISMATCH /* VA: issue 559: fix mismatch between st->extl and st->igf observed as crash in PlanarSBA bitrate switching */ #define FIX_572_LFE_LPF_ENC /* FhG: issue 572: always apply the low pass filter to the LFE channel */ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ Loading lib_enc/ivas_enc.c +5 −0 Original line number Diff line number Diff line Loading @@ -276,6 +276,11 @@ ivas_error ivas_enc( hMetaData = ( st_ivas->nSCE > 0 ) ? st_ivas->hSCE[st_ivas->nSCE - 1]->hMetaData : st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData; #ifdef FIX_572_LFE_LPF_ENC /* LFE low pass filter */ ivas_lfe_lpf_enc_apply( st_ivas->lfe_lpf_state, data_f[LFE_CHANNEL], input_frame ); #endif /* LFE channel encoder */ if ( st_ivas->mc_mode == MC_MODE_MCT ) { Loading lib_enc/ivas_init_enc.c +9 −0 Original line number Diff line number Diff line Loading @@ -543,6 +543,10 @@ ivas_error ivas_init_encoder( hEncoderConfig->nchan_inp = ivas_mc_ls_setup_get_num_channels( hEncoderConfig->mc_input_setup ); #ifdef FIX_572_LFE_LPF_ENC ivas_create_lfe_lpf_enc( &st_ivas->lfe_lpf_state, hEncoderConfig->input_Fs ); #endif if ( st_ivas->mc_mode == MC_MODE_MCT ) { st_ivas->nSCE = 0; Loading Loading @@ -944,6 +948,11 @@ void ivas_destroy_enc( /* LFE handle */ ivas_lfe_enc_close( &( st_ivas->hLFE ) ); #ifdef FIX_572_LFE_LPF_ENC /* LFE low pass filter state */ ivas_lfe_lpf_enc_close( &( st_ivas->lfe_lpf_state ) ); #endif /* Param-Upmix MC handle */ ivas_mc_paramupmix_enc_close( &( st_ivas->hMCParamUpmix ), st_ivas->hEncoderConfig->input_Fs ); Loading lib_enc/ivas_lfe_enc.c +79 −1 Original line number Diff line number Diff line Loading @@ -344,9 +344,10 @@ void ivas_lfe_enc( zero_pad_len = hLFE->pWindow_state->zero_pad_len; pWindow_coeffs = hLFE->pWindow_state->pWindow_coeffs; #ifndef FIX_572_LFE_LPF_ENC /*Low Pass Filter */ ivas_filter_process( &hLFE->filter_state, data_lfe_ch, input_frame ); #endif /* Windowing */ ivas_dct_windowing( fade_len, full_len, dct_len, zero_pad_len, pWindow_coeffs, input_frame, wtda_audio, hLFE->old_wtda_audio, data_lfe_ch ); Loading Loading @@ -381,7 +382,9 @@ ivas_error ivas_create_lfe_enc( { int16_t input_frame; LFE_ENC_HANDLE hLFE; #ifndef FIX_572_LFE_LPF_ENC const float *filt_coeff; #endif int16_t i, j; input_frame = (int16_t) ( input_Fs / FRAMES_PER_SEC ); Loading Loading @@ -423,8 +426,10 @@ ivas_error ivas_create_lfe_enc( lfe_window_init( hLFE->pWindow_state, input_Fs, input_frame ); #ifndef FIX_572_LFE_LPF_ENC ivas_lfe_lpf_select_filt_coeff( input_Fs, IVAS_FILTER_ORDER_4, &filt_coeff ); ivas_filters_init( &hLFE->filter_state, filt_coeff, IVAS_FILTER_ORDER_4 ); #endif /* Initialization for entropy coding */ hLFE->cum_freq_models[0][0] = ivas_str_lfe_freq_models.entropy_coder_model_fine_sg1; Loading Loading @@ -483,3 +488,76 @@ void ivas_lfe_enc_close( return; } #ifdef FIX_572_LFE_LPF_ENC /*------------------------------------------------------------------------- * ivas_create_lfe_lpf_enc() * * Create, allocate and initialize IVAS encoder LFE low pass filter state handle *-------------------------------------------------------------------------*/ ivas_error ivas_create_lfe_lpf_enc( ivas_filters_process_state_t **ph_lfe_lpf_filter_state, /* o : IVAS LFE encoder structure */ const int32_t input_Fs /* i : input sampling rate */ ) { const float *filt_coeff; if ( ph_lfe_lpf_filter_state == NULL ) { return ( IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Can not allocate memory for LFE LPF\n" ) ); } /*-----------------------------------------------------------------* * Allocate LFE LPF handle *-----------------------------------------------------------------*/ if ( ( *ph_lfe_lpf_filter_state = (ivas_filters_process_state_t *) malloc( sizeof( ivas_filters_process_state_t ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LFE LPF\n" ) ); } ivas_lfe_lpf_select_filt_coeff( input_Fs, IVAS_FILTER_ORDER_4, &filt_coeff ); ivas_filters_init( *ph_lfe_lpf_filter_state, filt_coeff, IVAS_FILTER_ORDER_4 ); return IVAS_ERR_OK; } /*------------------------------------------------------------------------- * ivas_lfe_lpf_enc_close() * * Destroy IVAS cncoder LFE low pass filter state *-------------------------------------------------------------------------*/ void ivas_lfe_lpf_enc_close( ivas_filters_process_state_t **ph_lfe_lpf_filter_state /* i/o: LFE encoder handle */ ) { if ( ph_lfe_lpf_filter_state == NULL || *ph_lfe_lpf_filter_state == NULL ) { return; } free( ( *ph_lfe_lpf_filter_state ) ); ( *ph_lfe_lpf_filter_state ) = NULL; return; } /*------------------------------------------------------------------------- * ivas_lfe_lpf_enc_apply() * * Apply IVAS cncoder LFE low pass filter *-------------------------------------------------------------------------*/ void ivas_lfe_lpf_enc_apply( ivas_filters_process_state_t *h_lfe_lpf_filter_state, /* i/o: LFE encoder handle */ float data_lfe_ch[], /* i : input LFE signal */ const int16_t input_frame /* i : input frame length per channel */ ) { ivas_filter_process( h_lfe_lpf_filter_state, data_lfe_ch, input_frame ); } #endif Loading
lib_com/ivas_prot.h +20 −0 Original line number Diff line number Diff line Loading @@ -5447,6 +5447,26 @@ void ivas_lfe_synth_with_filters( const int16_t lfeChannelIndex /* i : LFE channel index */ ); #ifdef FIX_572_LFE_LPF_ENC /*----------------------------------------------------------------------------------* * LFE encoder low pass filter prototypes *----------------------------------------------------------------------------------*/ ivas_error ivas_create_lfe_lpf_enc( ivas_filters_process_state_t **ph_lfe_lpf_filter_state, /* o : IVAS LFE encoder structure */ const int32_t input_Fs /* i : input sampling rate */ ); void ivas_lfe_lpf_enc_close( ivas_filters_process_state_t **ph_lfe_lpf_filter_state /* i/o: LFE encoder handle */ ); void ivas_lfe_lpf_enc_apply( ivas_filters_process_state_t *h_lfe_lpf_filter_state, /* i/o: LFE encoder handle */ float data_lfe_ch[], /* i : input LFE signal */ const int16_t input_frame /* i : input frame length per channel */ ); #endif /*----------------------------------------------------------------------------------* * LFE Coding prototypes Loading
lib_com/options.h +1 −1 Original line number Diff line number Diff line Loading @@ -151,7 +151,7 @@ #define FIX_565_SBA_BURST_IN_FEC /* VA: Issue 565: Fix noise burst during FEC, due to wrong total_brate initialization */ #define FIX_562_ISM2_64KBPS /* VA: issue 562: fix ISM2 at 64kbps issue */ #define FIX_559_EXTL_IGF_MISMATCH /* VA: issue 559: fix mismatch between st->extl and st->igf observed as crash in PlanarSBA bitrate switching */ #define FIX_572_LFE_LPF_ENC /* FhG: issue 572: always apply the low pass filter to the LFE channel */ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ Loading
lib_enc/ivas_enc.c +5 −0 Original line number Diff line number Diff line Loading @@ -276,6 +276,11 @@ ivas_error ivas_enc( hMetaData = ( st_ivas->nSCE > 0 ) ? st_ivas->hSCE[st_ivas->nSCE - 1]->hMetaData : st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData; #ifdef FIX_572_LFE_LPF_ENC /* LFE low pass filter */ ivas_lfe_lpf_enc_apply( st_ivas->lfe_lpf_state, data_f[LFE_CHANNEL], input_frame ); #endif /* LFE channel encoder */ if ( st_ivas->mc_mode == MC_MODE_MCT ) { Loading
lib_enc/ivas_init_enc.c +9 −0 Original line number Diff line number Diff line Loading @@ -543,6 +543,10 @@ ivas_error ivas_init_encoder( hEncoderConfig->nchan_inp = ivas_mc_ls_setup_get_num_channels( hEncoderConfig->mc_input_setup ); #ifdef FIX_572_LFE_LPF_ENC ivas_create_lfe_lpf_enc( &st_ivas->lfe_lpf_state, hEncoderConfig->input_Fs ); #endif if ( st_ivas->mc_mode == MC_MODE_MCT ) { st_ivas->nSCE = 0; Loading Loading @@ -944,6 +948,11 @@ void ivas_destroy_enc( /* LFE handle */ ivas_lfe_enc_close( &( st_ivas->hLFE ) ); #ifdef FIX_572_LFE_LPF_ENC /* LFE low pass filter state */ ivas_lfe_lpf_enc_close( &( st_ivas->lfe_lpf_state ) ); #endif /* Param-Upmix MC handle */ ivas_mc_paramupmix_enc_close( &( st_ivas->hMCParamUpmix ), st_ivas->hEncoderConfig->input_Fs ); Loading
lib_enc/ivas_lfe_enc.c +79 −1 Original line number Diff line number Diff line Loading @@ -344,9 +344,10 @@ void ivas_lfe_enc( zero_pad_len = hLFE->pWindow_state->zero_pad_len; pWindow_coeffs = hLFE->pWindow_state->pWindow_coeffs; #ifndef FIX_572_LFE_LPF_ENC /*Low Pass Filter */ ivas_filter_process( &hLFE->filter_state, data_lfe_ch, input_frame ); #endif /* Windowing */ ivas_dct_windowing( fade_len, full_len, dct_len, zero_pad_len, pWindow_coeffs, input_frame, wtda_audio, hLFE->old_wtda_audio, data_lfe_ch ); Loading Loading @@ -381,7 +382,9 @@ ivas_error ivas_create_lfe_enc( { int16_t input_frame; LFE_ENC_HANDLE hLFE; #ifndef FIX_572_LFE_LPF_ENC const float *filt_coeff; #endif int16_t i, j; input_frame = (int16_t) ( input_Fs / FRAMES_PER_SEC ); Loading Loading @@ -423,8 +426,10 @@ ivas_error ivas_create_lfe_enc( lfe_window_init( hLFE->pWindow_state, input_Fs, input_frame ); #ifndef FIX_572_LFE_LPF_ENC ivas_lfe_lpf_select_filt_coeff( input_Fs, IVAS_FILTER_ORDER_4, &filt_coeff ); ivas_filters_init( &hLFE->filter_state, filt_coeff, IVAS_FILTER_ORDER_4 ); #endif /* Initialization for entropy coding */ hLFE->cum_freq_models[0][0] = ivas_str_lfe_freq_models.entropy_coder_model_fine_sg1; Loading Loading @@ -483,3 +488,76 @@ void ivas_lfe_enc_close( return; } #ifdef FIX_572_LFE_LPF_ENC /*------------------------------------------------------------------------- * ivas_create_lfe_lpf_enc() * * Create, allocate and initialize IVAS encoder LFE low pass filter state handle *-------------------------------------------------------------------------*/ ivas_error ivas_create_lfe_lpf_enc( ivas_filters_process_state_t **ph_lfe_lpf_filter_state, /* o : IVAS LFE encoder structure */ const int32_t input_Fs /* i : input sampling rate */ ) { const float *filt_coeff; if ( ph_lfe_lpf_filter_state == NULL ) { return ( IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Can not allocate memory for LFE LPF\n" ) ); } /*-----------------------------------------------------------------* * Allocate LFE LPF handle *-----------------------------------------------------------------*/ if ( ( *ph_lfe_lpf_filter_state = (ivas_filters_process_state_t *) malloc( sizeof( ivas_filters_process_state_t ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LFE LPF\n" ) ); } ivas_lfe_lpf_select_filt_coeff( input_Fs, IVAS_FILTER_ORDER_4, &filt_coeff ); ivas_filters_init( *ph_lfe_lpf_filter_state, filt_coeff, IVAS_FILTER_ORDER_4 ); return IVAS_ERR_OK; } /*------------------------------------------------------------------------- * ivas_lfe_lpf_enc_close() * * Destroy IVAS cncoder LFE low pass filter state *-------------------------------------------------------------------------*/ void ivas_lfe_lpf_enc_close( ivas_filters_process_state_t **ph_lfe_lpf_filter_state /* i/o: LFE encoder handle */ ) { if ( ph_lfe_lpf_filter_state == NULL || *ph_lfe_lpf_filter_state == NULL ) { return; } free( ( *ph_lfe_lpf_filter_state ) ); ( *ph_lfe_lpf_filter_state ) = NULL; return; } /*------------------------------------------------------------------------- * ivas_lfe_lpf_enc_apply() * * Apply IVAS cncoder LFE low pass filter *-------------------------------------------------------------------------*/ void ivas_lfe_lpf_enc_apply( ivas_filters_process_state_t *h_lfe_lpf_filter_state, /* i/o: LFE encoder handle */ float data_lfe_ch[], /* i : input LFE signal */ const int16_t input_frame /* i : input frame length per channel */ ) { ivas_filter_process( h_lfe_lpf_filter_state, data_lfe_ch, input_frame ); } #endif