Loading lib_com/bits_alloc_fx.c +12 −4 Original line number Diff line number Diff line Loading @@ -623,7 +623,9 @@ ivas_error config_acelp1_fx( const Word16 tdm_lp_reuse_flag, /* i : LPC reuse flag (can be 1 only with secondary channel */ const Word16 tdm_low_rate_mode, /* i : secondary channel low rate mode flag */ const Word16 idchan, /* i : stereo channel ID */ #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC const Word16 active_cnt, /* i : Active frame counter */ #endif const Word16 tdm_Pitch_reuse_flag, /* i : primary channel pitch reuse flag*/ const Word16 tdm_LRTD_flag, /* i : LRTD stereo mode flag */ const Word16 GSC_IVAS_mode /* i : GSC IVAS mode */ Loading Loading @@ -806,7 +808,9 @@ ivas_error config_acelp1_fx( test(); test(); #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC test(); #endif IF( !tdm_lp_reuse_flag || idchan == 0 ) { /* LSF Q bit-budget */ Loading Loading @@ -883,7 +887,11 @@ ivas_error config_acelp1_fx( bits = sub( bits, acelp_cfg->mid_lsf_bits ); } #ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC ELSE IF( EQ_16( tdm_lp_reuse_flag, 1 ) && EQ_16( idchan, 1 ) ) #else ELSE IF( EQ_16( tdm_lp_reuse_flag, 1 ) && EQ_16( idchan, 1 ) && NE_16( active_cnt, 1 ) ) #endif { bits = sub( bits, TDM_IC_LSF_PRED_BITS ); } Loading lib_com/ivas_prot_fx.h +2 −1 Original line number Diff line number Diff line Loading @@ -884,12 +884,13 @@ void ivas_lfe_dec_close_fx( LFE_DEC_HANDLE *hLFE /* i/o: LFE decoder handle */ ); void td_stereo_param_updt_fx( const Word16 lsp_old_PCh_fx[], /* i : primary channel old LSPs Q15 */ const Word16 lsf_old_PCh_fx[], /* i : primary channel old LSFs Qlog2(2.56) */ const Word16 pitch_buf_PCh_fx[], /* i : primary channel pitch buffer Q6 */ #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC Word16 tdm_lspQ_PCh_fx[], /* o : Q LSPs for primary channel Q15 */ #endif Word16 tdm_lsfQ_PCh_fx[], /* o : Q LSFs for primary channel Qlog2(2.56) */ Word16 tdm_Pri_pitch_buf_fx[], /* o : pitch values for primary channel Q6 */ const Word16 flag_ACELP16k, /* i : ACELP@16kHz flag */ Loading lib_com/ivas_stereo_td_bit_alloc_fx.c +53 −9 Original line number Diff line number Diff line Loading @@ -525,6 +525,7 @@ void tdm_bit_alloc( *total_brate_sec = L_add( *total_brate_sec, sub( fast_FCB_rates_2sfr[idx], tmp_rate ) ); /*Q0*/ move32(); } /* To prevent 13.2 kb/s for primary channel as some bitstream issues arrise with it */ IF( EQ_32( L_sub( element_brate_wo_meta, *total_brate_sec ), ACELP_13k20 ) ) { Loading @@ -532,6 +533,7 @@ IF( EQ_32( L_sub( element_brate_wo_meta, *total_brate_sec ), ACELP_13k20 ) ) move32(); } } /* prevent 2.4 kb/s and 2.8 kb/s as they are reserved bitrates for DTX and VBR */ test(); IF( EQ_32( *total_brate_sec, PPP_NELP_2k80 ) || EQ_32( *total_brate_sec, SID_2k40 ) ) Loading @@ -545,16 +547,20 @@ move32(); return; } /*-------------------------------------------------------------------* * td_stereo_param_updt() * * copy certain TD stereo parameters from primary channel to secondary channel *-------------------------------------------------------------------*/ void td_stereo_param_updt_fx( const Word16 lsp_old_PCh_fx[], /* i : primary channel old LSPs Q15 */ const Word16 lsf_old_PCh_fx[], /* i : primary channel old LSFs Qlog2(2.56) */ const Word16 pitch_buf_PCh_fx[], /* i : primary channel pitch buffer Q6 */ #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC Word16 tdm_lspQ_PCh_fx[], /* o : Q LSPs for primary channel Q15 */ #endif Word16 tdm_lsfQ_PCh_fx[], /* o : Q LSFs for primary channel Qlog2(2.56) */ Word16 tdm_Pri_pitch_buf_fx[], /* o : pitch values for primary channel Q6 */ const Word16 flag_ACELP16k, /* i : ACELP@16kHz flag Q0*/ Loading @@ -562,24 +568,65 @@ void td_stereo_param_updt_fx( ) { Word16 i; /* Copy some primary channel information into the secondary channel structure for later usage */ IF( EQ_16( tdm_use_IAWB_Ave_lpc, 1 ) ) { /*not being assert*/ Copy( IAWB_Ave_fx, tdm_lsfQ_PCh_fx, M ); /*Qlog2(2.56)*/ #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC #ifdef FIX_1111_TDM_LSP_BUFFER IF( tdm_lspQ_PCh_fx != NULL ) { lsf2lsp_fx( tdm_lsfQ_PCh_fx, tdm_lspQ_PCh_fx, M, INT_FS_12k8 ); } #else lsf2lsp_fx( tdm_lsfQ_PCh_fx, tdm_lspQ_PCh_fx, M, INT_FS_12k8 ); #endif #endif } ELSE IF( EQ_16( flag_ACELP16k, 1 ) ) { #ifdef FIX_1111_TDM_LSP_BUFFER #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC IF( tdm_lspQ_PCh_fx != NULL ) { Copy( lsp_old_PCh_fx, tdm_lspQ_PCh_fx, M ); /*Q15*/ lsp_convert_poly_fx( tdm_lspQ_PCh_fx, L_FRAME, 0 ); lsp2lsf_fx( tdm_lspQ_PCh_fx, tdm_lsfQ_PCh_fx, M, INT_FS_12k8 ); } ELSE { #endif Word16 lsp_temp[M]; Copy( lsp_old_PCh_fx, lsp_temp, M ); /*Q15*/ lsp_convert_poly_fx( lsp_temp, L_FRAME, 0 ); lsp2lsf_fx( lsp_temp, tdm_lsfQ_PCh_fx, M, INT_FS_12k8 ); #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC } #endif #else Copy( lsp_old_PCh_fx, tdm_lspQ_PCh_fx, M ); /*Q15*/ lsp_convert_poly_fx( tdm_lspQ_PCh_fx, L_FRAME, 0 ); lsp2lsf_fx( tdm_lspQ_PCh_fx, tdm_lsfQ_PCh_fx, M, INT_FS_12k8 ); #endif } ELSE { #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC #ifdef FIX_1111_TDM_LSP_BUFFER IF( tdm_lspQ_PCh_fx != NULL ) { Copy( lsp_old_PCh_fx, tdm_lspQ_PCh_fx, M ); /*Q15*/ } #else Copy( lsp_old_PCh_fx, tdm_lspQ_PCh_fx, M ); /*Q15*/ #endif #endif Copy( lsf_old_PCh_fx, tdm_lsfQ_PCh_fx, M ); /*Qlog2(2.56)*/ } IF( EQ_16( flag_ACELP16k, 1 ) ) { Word16 tmp16; Loading Loading @@ -649,10 +696,7 @@ static void tdm_SCh_LSF_intra_pred_tri_diag_mat_fx( v_sub_16( lsf_SCh_fx, lsf_mean_in_fx, lsf_tmp_fx, M ); lsf_tmp_ptr1_fx = lsf_tmp_fx; /*x2.56*/ lsf_SCh_ptr_fx = lsf_SCh_fx; /*x2.56*/ lsf_tmp_ptr2_fx = lsf_tmp_ptr1_fx; /*x2.56*/ *lsf_SCh_ptr_fx = mult_r( *lsf_tmp_ptr1_fx++, *prd_ptr_fx++ ); // Q2.56 + 15 -15 Loading lib_com/options.h +3 −1 Original line number Diff line number Diff line Loading @@ -118,13 +118,15 @@ #define NONBE_FIX_1028_1DB_TCX_LEVEL_DROP /* VA: Harmonize the logic setting LP weighting factor between TCX encoder and TCX decoder */ #define FIX_1053_REVERB_RECONFIGURATION /* Philips: issue 1053: fix for dynamic switching of acoustic environment */ #define CONF_DISTATT /* Eri: Make distance attenuation configurable */ #define FIX_1068_ASAN_IN_MC_2_BINAURAL_ROOM_IR /* issue 1068 : Memory leak in MC to BINAURAL_ROOM decoding with bitrate switching*/ #define NONBE_FIX_1052_SBA_EXT /* Dlb: SBA external output support */ #define NONBE_FIX_MC_LFE_LPF /* Dlb: Adding the LFE LPF filter back for MC content. */ #define NONBE_FIX_1074_NOBJ_SIGNAL_OMASA_LBR /* Nok: issue 1074 fixing number of objects signaling in OMASA low rate */ #define FIX_1222_OMASA_DEC_CHANNEL_BUFFERS /* VA: issue 1222: Reduction of the number of channel buffers in OMASA decoder */ #define FIX_1111_TDM_LSP_BUFFER /* VA: issue 1111: remove unused buffer `tdm_lspQ_PCh[]' */ #define NONBE_1325_TD_STEREO_QUANT_LSF_SEC /* Nokia: issue 1325: fix for usage of active_cnt variable in TD stereo LSFQ */ /* #################### End BASOP porting switches ############################ */ #define FIX_1766_TCX2ACELP_BWE_ISSUE /* VA : Fix rare BWE issue when switching from TCX to ACELP */ Loading lib_com/prot_fx.h +17 −13 Original line number Diff line number Diff line Loading @@ -10235,7 +10235,9 @@ ivas_error acelp_core_dec_fx( Word16 *unbits, /* o : number of unused bits */ Word16 *sid_bw, /* o : 0-NB/WB, 1-SWB SID */ STEREO_TD_DEC_DATA_HANDLE hStereoTD, /* i/o: TD stereo decoder handle */ #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC const Word16 tdm_lspQ_PCh_fx[M], /* i : Q LSPs for primary channel */ #endif const Word16 tdm_lsfQ_PCh_fx[M], /* i : Q LSFs for primary channel */ const Word16 use_cldfb_for_dft, /* i : flag to use of CLDFB for DFT Stereo */ const Word16 last_element_mode, /* i : last element mode */ Loading Loading @@ -10569,7 +10571,9 @@ ivas_error config_acelp1_fx( const Word16 tdm_lp_reuse_flag, /* i : LPC reuse flag (can be 1 only with secondary channel */ const Word16 tdm_low_rate_mode, /* i : secondary channel low rate mode flag */ const Word16 idchan, /* i : stereo channel ID */ #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC const Word16 active_cnt, /* i : Active frame counter */ #endif const Word16 tdm_Pitch_reuse_flag, /* i : primary channel pitch reuse flag*/ const Word16 tdm_LRTD_flag, /* i : LRTD stereo mode flag */ const Word16 GSC_IVAS_mode /* i : GSC IVAS mode */ Loading
lib_com/bits_alloc_fx.c +12 −4 Original line number Diff line number Diff line Loading @@ -623,7 +623,9 @@ ivas_error config_acelp1_fx( const Word16 tdm_lp_reuse_flag, /* i : LPC reuse flag (can be 1 only with secondary channel */ const Word16 tdm_low_rate_mode, /* i : secondary channel low rate mode flag */ const Word16 idchan, /* i : stereo channel ID */ #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC const Word16 active_cnt, /* i : Active frame counter */ #endif const Word16 tdm_Pitch_reuse_flag, /* i : primary channel pitch reuse flag*/ const Word16 tdm_LRTD_flag, /* i : LRTD stereo mode flag */ const Word16 GSC_IVAS_mode /* i : GSC IVAS mode */ Loading Loading @@ -806,7 +808,9 @@ ivas_error config_acelp1_fx( test(); test(); #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC test(); #endif IF( !tdm_lp_reuse_flag || idchan == 0 ) { /* LSF Q bit-budget */ Loading Loading @@ -883,7 +887,11 @@ ivas_error config_acelp1_fx( bits = sub( bits, acelp_cfg->mid_lsf_bits ); } #ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC ELSE IF( EQ_16( tdm_lp_reuse_flag, 1 ) && EQ_16( idchan, 1 ) ) #else ELSE IF( EQ_16( tdm_lp_reuse_flag, 1 ) && EQ_16( idchan, 1 ) && NE_16( active_cnt, 1 ) ) #endif { bits = sub( bits, TDM_IC_LSF_PRED_BITS ); } Loading
lib_com/ivas_prot_fx.h +2 −1 Original line number Diff line number Diff line Loading @@ -884,12 +884,13 @@ void ivas_lfe_dec_close_fx( LFE_DEC_HANDLE *hLFE /* i/o: LFE decoder handle */ ); void td_stereo_param_updt_fx( const Word16 lsp_old_PCh_fx[], /* i : primary channel old LSPs Q15 */ const Word16 lsf_old_PCh_fx[], /* i : primary channel old LSFs Qlog2(2.56) */ const Word16 pitch_buf_PCh_fx[], /* i : primary channel pitch buffer Q6 */ #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC Word16 tdm_lspQ_PCh_fx[], /* o : Q LSPs for primary channel Q15 */ #endif Word16 tdm_lsfQ_PCh_fx[], /* o : Q LSFs for primary channel Qlog2(2.56) */ Word16 tdm_Pri_pitch_buf_fx[], /* o : pitch values for primary channel Q6 */ const Word16 flag_ACELP16k, /* i : ACELP@16kHz flag */ Loading
lib_com/ivas_stereo_td_bit_alloc_fx.c +53 −9 Original line number Diff line number Diff line Loading @@ -525,6 +525,7 @@ void tdm_bit_alloc( *total_brate_sec = L_add( *total_brate_sec, sub( fast_FCB_rates_2sfr[idx], tmp_rate ) ); /*Q0*/ move32(); } /* To prevent 13.2 kb/s for primary channel as some bitstream issues arrise with it */ IF( EQ_32( L_sub( element_brate_wo_meta, *total_brate_sec ), ACELP_13k20 ) ) { Loading @@ -532,6 +533,7 @@ IF( EQ_32( L_sub( element_brate_wo_meta, *total_brate_sec ), ACELP_13k20 ) ) move32(); } } /* prevent 2.4 kb/s and 2.8 kb/s as they are reserved bitrates for DTX and VBR */ test(); IF( EQ_32( *total_brate_sec, PPP_NELP_2k80 ) || EQ_32( *total_brate_sec, SID_2k40 ) ) Loading @@ -545,16 +547,20 @@ move32(); return; } /*-------------------------------------------------------------------* * td_stereo_param_updt() * * copy certain TD stereo parameters from primary channel to secondary channel *-------------------------------------------------------------------*/ void td_stereo_param_updt_fx( const Word16 lsp_old_PCh_fx[], /* i : primary channel old LSPs Q15 */ const Word16 lsf_old_PCh_fx[], /* i : primary channel old LSFs Qlog2(2.56) */ const Word16 pitch_buf_PCh_fx[], /* i : primary channel pitch buffer Q6 */ #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC Word16 tdm_lspQ_PCh_fx[], /* o : Q LSPs for primary channel Q15 */ #endif Word16 tdm_lsfQ_PCh_fx[], /* o : Q LSFs for primary channel Qlog2(2.56) */ Word16 tdm_Pri_pitch_buf_fx[], /* o : pitch values for primary channel Q6 */ const Word16 flag_ACELP16k, /* i : ACELP@16kHz flag Q0*/ Loading @@ -562,24 +568,65 @@ void td_stereo_param_updt_fx( ) { Word16 i; /* Copy some primary channel information into the secondary channel structure for later usage */ IF( EQ_16( tdm_use_IAWB_Ave_lpc, 1 ) ) { /*not being assert*/ Copy( IAWB_Ave_fx, tdm_lsfQ_PCh_fx, M ); /*Qlog2(2.56)*/ #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC #ifdef FIX_1111_TDM_LSP_BUFFER IF( tdm_lspQ_PCh_fx != NULL ) { lsf2lsp_fx( tdm_lsfQ_PCh_fx, tdm_lspQ_PCh_fx, M, INT_FS_12k8 ); } #else lsf2lsp_fx( tdm_lsfQ_PCh_fx, tdm_lspQ_PCh_fx, M, INT_FS_12k8 ); #endif #endif } ELSE IF( EQ_16( flag_ACELP16k, 1 ) ) { #ifdef FIX_1111_TDM_LSP_BUFFER #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC IF( tdm_lspQ_PCh_fx != NULL ) { Copy( lsp_old_PCh_fx, tdm_lspQ_PCh_fx, M ); /*Q15*/ lsp_convert_poly_fx( tdm_lspQ_PCh_fx, L_FRAME, 0 ); lsp2lsf_fx( tdm_lspQ_PCh_fx, tdm_lsfQ_PCh_fx, M, INT_FS_12k8 ); } ELSE { #endif Word16 lsp_temp[M]; Copy( lsp_old_PCh_fx, lsp_temp, M ); /*Q15*/ lsp_convert_poly_fx( lsp_temp, L_FRAME, 0 ); lsp2lsf_fx( lsp_temp, tdm_lsfQ_PCh_fx, M, INT_FS_12k8 ); #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC } #endif #else Copy( lsp_old_PCh_fx, tdm_lspQ_PCh_fx, M ); /*Q15*/ lsp_convert_poly_fx( tdm_lspQ_PCh_fx, L_FRAME, 0 ); lsp2lsf_fx( tdm_lspQ_PCh_fx, tdm_lsfQ_PCh_fx, M, INT_FS_12k8 ); #endif } ELSE { #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC #ifdef FIX_1111_TDM_LSP_BUFFER IF( tdm_lspQ_PCh_fx != NULL ) { Copy( lsp_old_PCh_fx, tdm_lspQ_PCh_fx, M ); /*Q15*/ } #else Copy( lsp_old_PCh_fx, tdm_lspQ_PCh_fx, M ); /*Q15*/ #endif #endif Copy( lsf_old_PCh_fx, tdm_lsfQ_PCh_fx, M ); /*Qlog2(2.56)*/ } IF( EQ_16( flag_ACELP16k, 1 ) ) { Word16 tmp16; Loading Loading @@ -649,10 +696,7 @@ static void tdm_SCh_LSF_intra_pred_tri_diag_mat_fx( v_sub_16( lsf_SCh_fx, lsf_mean_in_fx, lsf_tmp_fx, M ); lsf_tmp_ptr1_fx = lsf_tmp_fx; /*x2.56*/ lsf_SCh_ptr_fx = lsf_SCh_fx; /*x2.56*/ lsf_tmp_ptr2_fx = lsf_tmp_ptr1_fx; /*x2.56*/ *lsf_SCh_ptr_fx = mult_r( *lsf_tmp_ptr1_fx++, *prd_ptr_fx++ ); // Q2.56 + 15 -15 Loading
lib_com/options.h +3 −1 Original line number Diff line number Diff line Loading @@ -118,13 +118,15 @@ #define NONBE_FIX_1028_1DB_TCX_LEVEL_DROP /* VA: Harmonize the logic setting LP weighting factor between TCX encoder and TCX decoder */ #define FIX_1053_REVERB_RECONFIGURATION /* Philips: issue 1053: fix for dynamic switching of acoustic environment */ #define CONF_DISTATT /* Eri: Make distance attenuation configurable */ #define FIX_1068_ASAN_IN_MC_2_BINAURAL_ROOM_IR /* issue 1068 : Memory leak in MC to BINAURAL_ROOM decoding with bitrate switching*/ #define NONBE_FIX_1052_SBA_EXT /* Dlb: SBA external output support */ #define NONBE_FIX_MC_LFE_LPF /* Dlb: Adding the LFE LPF filter back for MC content. */ #define NONBE_FIX_1074_NOBJ_SIGNAL_OMASA_LBR /* Nok: issue 1074 fixing number of objects signaling in OMASA low rate */ #define FIX_1222_OMASA_DEC_CHANNEL_BUFFERS /* VA: issue 1222: Reduction of the number of channel buffers in OMASA decoder */ #define FIX_1111_TDM_LSP_BUFFER /* VA: issue 1111: remove unused buffer `tdm_lspQ_PCh[]' */ #define NONBE_1325_TD_STEREO_QUANT_LSF_SEC /* Nokia: issue 1325: fix for usage of active_cnt variable in TD stereo LSFQ */ /* #################### End BASOP porting switches ############################ */ #define FIX_1766_TCX2ACELP_BWE_ISSUE /* VA : Fix rare BWE issue when switching from TCX to ACELP */ Loading
lib_com/prot_fx.h +17 −13 Original line number Diff line number Diff line Loading @@ -10235,7 +10235,9 @@ ivas_error acelp_core_dec_fx( Word16 *unbits, /* o : number of unused bits */ Word16 *sid_bw, /* o : 0-NB/WB, 1-SWB SID */ STEREO_TD_DEC_DATA_HANDLE hStereoTD, /* i/o: TD stereo decoder handle */ #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC const Word16 tdm_lspQ_PCh_fx[M], /* i : Q LSPs for primary channel */ #endif const Word16 tdm_lsfQ_PCh_fx[M], /* i : Q LSFs for primary channel */ const Word16 use_cldfb_for_dft, /* i : flag to use of CLDFB for DFT Stereo */ const Word16 last_element_mode, /* i : last element mode */ Loading Loading @@ -10569,7 +10571,9 @@ ivas_error config_acelp1_fx( const Word16 tdm_lp_reuse_flag, /* i : LPC reuse flag (can be 1 only with secondary channel */ const Word16 tdm_low_rate_mode, /* i : secondary channel low rate mode flag */ const Word16 idchan, /* i : stereo channel ID */ #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC const Word16 active_cnt, /* i : Active frame counter */ #endif const Word16 tdm_Pitch_reuse_flag, /* i : primary channel pitch reuse flag*/ const Word16 tdm_LRTD_flag, /* i : LRTD stereo mode flag */ const Word16 GSC_IVAS_mode /* i : GSC IVAS mode */