Loading lib_com/bits_alloc.c +10 −4 Original line number Diff line number Diff line Loading @@ -552,7 +552,9 @@ ivas_error config_acelp1( const int16_t tdm_lp_reuse_flag, /* i : LPC reuse flag (can be 1 only with secondary channel */ const int16_t tdm_low_rate_mode, /* i : secondary channel low rate mode flag */ const int16_t idchan, /* i : stereo channel ID */ #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC const int16_t active_cnt, /* i : Active frame counter */ #endif const int16_t tdm_Pitch_reuse_flag, /* i : primary channel pitch reuse flag*/ const int16_t tdm_LRTD_flag, /* i : LRTD stereo mode flag */ const int16_t GSC_IVAS_mode /* i : GSC IVAS mode */ Loading Loading @@ -770,7 +772,11 @@ ivas_error config_acelp1( bits -= acelp_cfg->mid_lsf_bits; } #ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC else if ( tdm_lp_reuse_flag == 1 && idchan == 1 ) #else else if ( tdm_lp_reuse_flag == 1 && idchan == 1 && active_cnt != 1 ) #endif { bits -= TDM_IC_LSF_PRED_BITS; } Loading lib_com/ivas_dirac_com.c +0 −4 Original line number Diff line number Diff line Loading @@ -346,11 +346,7 @@ void ivas_get_dirac_sba_max_md_bits( /* OSBA needs an additional 2-bits safety margin to avoid acelp crashes */ if ( ivas_format == SBA_ISM_FORMAT ) { #ifdef NONBE_FIX_SBA_SIGNALING_BITS_B ( *metadata_max_bits ) -= 7; #else ( *metadata_max_bits ) -= 3; #endif } } else if ( sba_total_brate <= IVAS_32k ) Loading lib_com/ivas_prot.h +19 −1 Original line number Diff line number Diff line Loading @@ -2111,7 +2111,9 @@ void td_stereo_param_updt( const float lsp_old_PCh[], /* i : primary channel old LSPs */ const float lsf_old_PCh[], /* i : primary channel old LSFs */ const float pitch_buf_PCh[], /* i : primary channel pitch buffer */ #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC float tdm_lspQ_PCh[], /* o : Q LSPs for primary channel */ #endif float tdm_lsfQ_PCh[], /* o : Q LSFs for primary channel */ float tdm_Pri_pitch_buf[], /* o : pitch values for primary channel */ const int16_t flag_ACELP16k, /* i : ACELP@16kHz flag */ Loading Loading @@ -3220,6 +3222,9 @@ void ivas_qmetadata_enc_sid_encode( BSTR_ENC_HANDLE hMetaData, /* i/o: metadata bitstream handle */ IVAS_QMETADATA *q_metadata, /* i/o: metadata handle */ const int16_t masa_sid_descriptor, /* i : description of MASA SID coding structure*/ #ifdef NONBE_FIX_1052_SBA_EXT const int16_t nchan_transport, /* i : number of transport channels */ #endif const int16_t ivas_format /* i : ivas format */ ); Loading Loading @@ -3523,6 +3528,13 @@ int16_t ivas_sba_get_nchan_metadata( const int32_t ivas_total_brate /* i : IVAS total bitrate */ ); #ifdef NONBE_FIX_1052_SBA_EXT /*! r: number of bits in SPAR SID frame */ int16_t ivas_sba_spar_sid_bitlen( const int16_t nchan_transport /* i : number of transport channels */ ); #endif void ivas_sba_get_spar_hoa_ch_ind( const int16_t num_md_chs, /* i : number of MD channels */ const int32_t ivas_total_brate, /* i : IVAS total bitrate */ Loading Loading @@ -3624,6 +3636,9 @@ ivas_error ivas_dirac_enc( const int16_t input_frame, /* i : input frame length */ const int16_t dtx_vad, /* i : DTX vad flag */ const IVAS_FORMAT ivas_format, /* i : ivas format */ #ifdef NONBE_FIX_1052_SBA_EXT const int16_t nchan_transport, /* i : number of transport channels */ #endif const int16_t hodirac_flag /* i : hodirac flag */ ); Loading Loading @@ -3681,6 +3696,9 @@ void ivas_dirac_dec_read_BS( int16_t *nb_bits, /* o : number of bits read */ const int16_t last_bit_pos, /* i : last read bitstream position */ const int16_t hodirac_flag, /* i : flag to indicate HO-DirAC mode */ #ifdef NONBE_FIX_1052_SBA_EXT const int16_t nchan_transport, /* i : number of transport channels */ #endif int16_t *dirac_to_spar_md_bands /* o : DirAC->SPAR MD bands */ ); Loading lib_com/ivas_sba_config.c +24 −0 Original line number Diff line number Diff line Loading @@ -159,6 +159,30 @@ int16_t ivas_sba_get_nchan( } #ifdef NONBE_FIX_1052_SBA_EXT /*-------------------------------------------------------------------* * ivas_sba_spar_sid_bitlen() * * Get number of bits in SPAR SID frame *-------------------------------------------------------------------*/ /*! r: number of bits in SPAR SID frame */ int16_t ivas_sba_spar_sid_bitlen( const int16_t nchan_transport /* i : number of transport channels */ ) { int16_t num_bits; num_bits = SPAR_DTX_BANDS * SPAR_SID_BITS_TAR_PER_BAND; if ( nchan_transport > 1 ) { num_bits -= 2; } return num_bits; } #endif /*-------------------------------------------------------------------* * ivas_sba_get_nchan_metadata() * Loading lib_com/ivas_stereo_td_bit_alloc.c +44 −4 Original line number Diff line number Diff line Loading @@ -443,7 +443,9 @@ void td_stereo_param_updt( const float lsp_old_PCh[], /* i : primary channel old LSPs */ const float lsf_old_PCh[], /* i : primary channel old LSFs */ const float pitch_buf_PCh[], /* i : primary channel pitch buffer */ #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC float tdm_lspQ_PCh[], /* o : Q LSPs for primary channel */ #endif float tdm_lsfQ_PCh[], /* o : Q LSFs for primary channel */ float tdm_Pri_pitch_buf[], /* o : pitch values for primary channel */ const int16_t flag_ACELP16k, /* i : ACELP@16kHz flag */ Loading @@ -456,17 +458,55 @@ void td_stereo_param_updt( if ( tdm_use_IAWB_Ave_lpc == 1 ) { mvr2r( IAWB_Ave, tdm_lsfQ_PCh, M ); #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC #ifdef FIX_1111_TDM_LSP_BUFFER if ( tdm_lspQ_PCh != NULL ) { lsf2lsp( tdm_lsfQ_PCh, tdm_lspQ_PCh, M, INT_FS_12k8 ); } #else lsf2lsp( tdm_lsfQ_PCh, tdm_lspQ_PCh, M, INT_FS_12k8 ); #endif #endif } else if ( flag_ACELP16k == 1 ) { #ifdef FIX_1111_TDM_LSP_BUFFER #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC if ( tdm_lspQ_PCh != NULL ) { mvr2r( lsp_old_PCh, tdm_lspQ_PCh, M ); lsp_convert_poly( tdm_lspQ_PCh, L_FRAME, 0 ); lsp2lsf( tdm_lspQ_PCh, tdm_lsfQ_PCh, M, INT_FS_12k8 ); } else { #endif float lsp_temp[M]; mvr2r( lsp_old_PCh, lsp_temp, M ); lsp_convert_poly( lsp_temp, L_FRAME, 0 ); lsp2lsf( lsp_temp, tdm_lsfQ_PCh, M, INT_FS_12k8 ); #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC } #endif #else mvr2r( lsp_old_PCh, tdm_lspQ_PCh, M ); lsp_convert_poly( tdm_lspQ_PCh, L_FRAME, 0 ); lsp2lsf( tdm_lspQ_PCh, tdm_lsfQ_PCh, M, INT_FS_12k8 ); #endif } else { #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC #ifdef FIX_1111_TDM_LSP_BUFFER if ( tdm_lspQ_PCh != NULL ) { mvr2r( lsp_old_PCh, tdm_lspQ_PCh, M ); } #else mvr2r( lsp_old_PCh, tdm_lspQ_PCh, M ); #endif #endif mvr2r( lsf_old_PCh, tdm_lsfQ_PCh, M ); } Loading Loading
lib_com/bits_alloc.c +10 −4 Original line number Diff line number Diff line Loading @@ -552,7 +552,9 @@ ivas_error config_acelp1( const int16_t tdm_lp_reuse_flag, /* i : LPC reuse flag (can be 1 only with secondary channel */ const int16_t tdm_low_rate_mode, /* i : secondary channel low rate mode flag */ const int16_t idchan, /* i : stereo channel ID */ #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC const int16_t active_cnt, /* i : Active frame counter */ #endif const int16_t tdm_Pitch_reuse_flag, /* i : primary channel pitch reuse flag*/ const int16_t tdm_LRTD_flag, /* i : LRTD stereo mode flag */ const int16_t GSC_IVAS_mode /* i : GSC IVAS mode */ Loading Loading @@ -770,7 +772,11 @@ ivas_error config_acelp1( bits -= acelp_cfg->mid_lsf_bits; } #ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC else if ( tdm_lp_reuse_flag == 1 && idchan == 1 ) #else else if ( tdm_lp_reuse_flag == 1 && idchan == 1 && active_cnt != 1 ) #endif { bits -= TDM_IC_LSF_PRED_BITS; } Loading
lib_com/ivas_dirac_com.c +0 −4 Original line number Diff line number Diff line Loading @@ -346,11 +346,7 @@ void ivas_get_dirac_sba_max_md_bits( /* OSBA needs an additional 2-bits safety margin to avoid acelp crashes */ if ( ivas_format == SBA_ISM_FORMAT ) { #ifdef NONBE_FIX_SBA_SIGNALING_BITS_B ( *metadata_max_bits ) -= 7; #else ( *metadata_max_bits ) -= 3; #endif } } else if ( sba_total_brate <= IVAS_32k ) Loading
lib_com/ivas_prot.h +19 −1 Original line number Diff line number Diff line Loading @@ -2111,7 +2111,9 @@ void td_stereo_param_updt( const float lsp_old_PCh[], /* i : primary channel old LSPs */ const float lsf_old_PCh[], /* i : primary channel old LSFs */ const float pitch_buf_PCh[], /* i : primary channel pitch buffer */ #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC float tdm_lspQ_PCh[], /* o : Q LSPs for primary channel */ #endif float tdm_lsfQ_PCh[], /* o : Q LSFs for primary channel */ float tdm_Pri_pitch_buf[], /* o : pitch values for primary channel */ const int16_t flag_ACELP16k, /* i : ACELP@16kHz flag */ Loading Loading @@ -3220,6 +3222,9 @@ void ivas_qmetadata_enc_sid_encode( BSTR_ENC_HANDLE hMetaData, /* i/o: metadata bitstream handle */ IVAS_QMETADATA *q_metadata, /* i/o: metadata handle */ const int16_t masa_sid_descriptor, /* i : description of MASA SID coding structure*/ #ifdef NONBE_FIX_1052_SBA_EXT const int16_t nchan_transport, /* i : number of transport channels */ #endif const int16_t ivas_format /* i : ivas format */ ); Loading Loading @@ -3523,6 +3528,13 @@ int16_t ivas_sba_get_nchan_metadata( const int32_t ivas_total_brate /* i : IVAS total bitrate */ ); #ifdef NONBE_FIX_1052_SBA_EXT /*! r: number of bits in SPAR SID frame */ int16_t ivas_sba_spar_sid_bitlen( const int16_t nchan_transport /* i : number of transport channels */ ); #endif void ivas_sba_get_spar_hoa_ch_ind( const int16_t num_md_chs, /* i : number of MD channels */ const int32_t ivas_total_brate, /* i : IVAS total bitrate */ Loading Loading @@ -3624,6 +3636,9 @@ ivas_error ivas_dirac_enc( const int16_t input_frame, /* i : input frame length */ const int16_t dtx_vad, /* i : DTX vad flag */ const IVAS_FORMAT ivas_format, /* i : ivas format */ #ifdef NONBE_FIX_1052_SBA_EXT const int16_t nchan_transport, /* i : number of transport channels */ #endif const int16_t hodirac_flag /* i : hodirac flag */ ); Loading Loading @@ -3681,6 +3696,9 @@ void ivas_dirac_dec_read_BS( int16_t *nb_bits, /* o : number of bits read */ const int16_t last_bit_pos, /* i : last read bitstream position */ const int16_t hodirac_flag, /* i : flag to indicate HO-DirAC mode */ #ifdef NONBE_FIX_1052_SBA_EXT const int16_t nchan_transport, /* i : number of transport channels */ #endif int16_t *dirac_to_spar_md_bands /* o : DirAC->SPAR MD bands */ ); Loading
lib_com/ivas_sba_config.c +24 −0 Original line number Diff line number Diff line Loading @@ -159,6 +159,30 @@ int16_t ivas_sba_get_nchan( } #ifdef NONBE_FIX_1052_SBA_EXT /*-------------------------------------------------------------------* * ivas_sba_spar_sid_bitlen() * * Get number of bits in SPAR SID frame *-------------------------------------------------------------------*/ /*! r: number of bits in SPAR SID frame */ int16_t ivas_sba_spar_sid_bitlen( const int16_t nchan_transport /* i : number of transport channels */ ) { int16_t num_bits; num_bits = SPAR_DTX_BANDS * SPAR_SID_BITS_TAR_PER_BAND; if ( nchan_transport > 1 ) { num_bits -= 2; } return num_bits; } #endif /*-------------------------------------------------------------------* * ivas_sba_get_nchan_metadata() * Loading
lib_com/ivas_stereo_td_bit_alloc.c +44 −4 Original line number Diff line number Diff line Loading @@ -443,7 +443,9 @@ void td_stereo_param_updt( const float lsp_old_PCh[], /* i : primary channel old LSPs */ const float lsf_old_PCh[], /* i : primary channel old LSFs */ const float pitch_buf_PCh[], /* i : primary channel pitch buffer */ #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC float tdm_lspQ_PCh[], /* o : Q LSPs for primary channel */ #endif float tdm_lsfQ_PCh[], /* o : Q LSFs for primary channel */ float tdm_Pri_pitch_buf[], /* o : pitch values for primary channel */ const int16_t flag_ACELP16k, /* i : ACELP@16kHz flag */ Loading @@ -456,17 +458,55 @@ void td_stereo_param_updt( if ( tdm_use_IAWB_Ave_lpc == 1 ) { mvr2r( IAWB_Ave, tdm_lsfQ_PCh, M ); #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC #ifdef FIX_1111_TDM_LSP_BUFFER if ( tdm_lspQ_PCh != NULL ) { lsf2lsp( tdm_lsfQ_PCh, tdm_lspQ_PCh, M, INT_FS_12k8 ); } #else lsf2lsp( tdm_lsfQ_PCh, tdm_lspQ_PCh, M, INT_FS_12k8 ); #endif #endif } else if ( flag_ACELP16k == 1 ) { #ifdef FIX_1111_TDM_LSP_BUFFER #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC if ( tdm_lspQ_PCh != NULL ) { mvr2r( lsp_old_PCh, tdm_lspQ_PCh, M ); lsp_convert_poly( tdm_lspQ_PCh, L_FRAME, 0 ); lsp2lsf( tdm_lspQ_PCh, tdm_lsfQ_PCh, M, INT_FS_12k8 ); } else { #endif float lsp_temp[M]; mvr2r( lsp_old_PCh, lsp_temp, M ); lsp_convert_poly( lsp_temp, L_FRAME, 0 ); lsp2lsf( lsp_temp, tdm_lsfQ_PCh, M, INT_FS_12k8 ); #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC } #endif #else mvr2r( lsp_old_PCh, tdm_lspQ_PCh, M ); lsp_convert_poly( tdm_lspQ_PCh, L_FRAME, 0 ); lsp2lsf( tdm_lspQ_PCh, tdm_lsfQ_PCh, M, INT_FS_12k8 ); #endif } else { #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC #ifdef FIX_1111_TDM_LSP_BUFFER if ( tdm_lspQ_PCh != NULL ) { mvr2r( lsp_old_PCh, tdm_lspQ_PCh, M ); } #else mvr2r( lsp_old_PCh, tdm_lspQ_PCh, M ); #endif #endif mvr2r( lsf_old_PCh, tdm_lsfQ_PCh, M ); } Loading