Loading lib_dec/ivas_stereo_td_dec.c +20 −7 Original line number Diff line number Diff line Loading @@ -133,8 +133,13 @@ void tdm_configure_dec( /* Get the coder_type of the secondary channel (last parameter on 2 bits) */ sts[1]->coder_type = get_indice_st( sts[0], element_brate_adapt, bstr_last_pos - TDM_SECONDARY_SIGNALLING, TDM_SECONDARY_SIGNALLING ); /* Get the LRTD config flag: 1 = LRTD configuration, favor closer bitrate per channel; 0 = Pri/Sec configuration, bitrates linked wrt. the mono */ /*----------------------------------------------------------------* * Get the SM/LRTD flag: * In case of LRTD, it transmit the primary channel (1 = L, 0 = R) * In case of normal TD it transmits the SM mode * The get the secondary channel coder type and pitch reusing flag *----------------------------------------------------------------*/ tdm_tmp_SM_LRTD_flag = sts[1]->coder_type & 0x1; sts[1]->coder_type >>= 1; hStereoTD->tdm_Pitch_reuse_flag = 0; Loading @@ -155,7 +160,10 @@ void tdm_configure_dec( } /*----------------------------------------------------------------* * Decode TDM parameters * Decode remaining TDM parameters * Get the down mixing ratio / or the bit allocation ratio * depending if the decoder is in LRTD or TD mode * Get the Lp reusing flag and the kind of LP filter (if inactive content) *----------------------------------------------------------------*/ /* Get the correlation ratio */ Loading @@ -164,7 +172,7 @@ void tdm_configure_dec( hStereoTD->tdm_use_IAWB_Ave_lpc = 0; if ( sts[1]->coder_type == INACTIVE ) { /* Get the flag on the LPC reusage type (primary channel of ave LPC */ /* Get the flag on the LPC reusage type (primary channel or ave LPC) */ hStereoTD->tdm_use_IAWB_Ave_lpc = get_indice_st( sts[0], element_brate_adapt, bstr_last_pos - TDM_SECONDARY_SIGNALLING - TDM_RATIO_BITS - TDM_LP_REUSE_BITS, TDM_LP_REUSE_BITS ); hStereoTD->tdm_lp_reuse_flag = 1; } Loading @@ -173,8 +181,8 @@ void tdm_configure_dec( /* Get the flag on the LPC reusage */ hStereoTD->tdm_lp_reuse_flag = get_indice_st( sts[0], element_brate_adapt, bstr_last_pos - TDM_SECONDARY_SIGNALLING - TDM_RATIO_BITS - TDM_LP_REUSE_BITS, TDM_LP_REUSE_BITS ); } sts[0]->tdm_LRTD_flag = hStereoTD->tdm_LRTD_flag; /* the flag was already read in function stereo_memory_dec() */ /* the flag was already read in function stereo_memory_dec() */ sts[0]->tdm_LRTD_flag = hStereoTD->tdm_LRTD_flag; sts[1]->tdm_LRTD_flag = hStereoTD->tdm_LRTD_flag; tdm_inst_ratio_idx = *tdm_ratio_idx; Loading @@ -182,7 +190,12 @@ void tdm_configure_dec( /* update past tdm_SM_flag */ hStereoTD->tdm_prev_last_SM_flag = hStereoTD->tdm_last_SM_flag; hStereoTD->tdm_last_SM_flag = hStereoTD->tdm_SM_flag; /*----------------------------------------------------------------* * Adjust variables depending of the LRTD state * read the transmitted ratio index, if it corresponds to the TDM_NQ * then no down-mix needed, can work for out-of-phase signal or when * switching from MDCT *----------------------------------------------------------------*/ idx_LRTD_pri_side = -1; if ( hStereoTD->tdm_LRTD_flag == 1 ) { Loading lib_enc/gs_enc.c +1 −1 Original line number Diff line number Diff line Loading @@ -460,7 +460,7 @@ void gsc_enc( Ener_per_band_comp( exc_diff, Ener_per_bd_iQ, MBANDS_GN, 1, st->L_frame ); /*--------------------------------------------------------------------------------------* * Gain quantizaion * Gain quantization *--------------------------------------------------------------------------------------*/ i = 0; Loading Loading
lib_dec/ivas_stereo_td_dec.c +20 −7 Original line number Diff line number Diff line Loading @@ -133,8 +133,13 @@ void tdm_configure_dec( /* Get the coder_type of the secondary channel (last parameter on 2 bits) */ sts[1]->coder_type = get_indice_st( sts[0], element_brate_adapt, bstr_last_pos - TDM_SECONDARY_SIGNALLING, TDM_SECONDARY_SIGNALLING ); /* Get the LRTD config flag: 1 = LRTD configuration, favor closer bitrate per channel; 0 = Pri/Sec configuration, bitrates linked wrt. the mono */ /*----------------------------------------------------------------* * Get the SM/LRTD flag: * In case of LRTD, it transmit the primary channel (1 = L, 0 = R) * In case of normal TD it transmits the SM mode * The get the secondary channel coder type and pitch reusing flag *----------------------------------------------------------------*/ tdm_tmp_SM_LRTD_flag = sts[1]->coder_type & 0x1; sts[1]->coder_type >>= 1; hStereoTD->tdm_Pitch_reuse_flag = 0; Loading @@ -155,7 +160,10 @@ void tdm_configure_dec( } /*----------------------------------------------------------------* * Decode TDM parameters * Decode remaining TDM parameters * Get the down mixing ratio / or the bit allocation ratio * depending if the decoder is in LRTD or TD mode * Get the Lp reusing flag and the kind of LP filter (if inactive content) *----------------------------------------------------------------*/ /* Get the correlation ratio */ Loading @@ -164,7 +172,7 @@ void tdm_configure_dec( hStereoTD->tdm_use_IAWB_Ave_lpc = 0; if ( sts[1]->coder_type == INACTIVE ) { /* Get the flag on the LPC reusage type (primary channel of ave LPC */ /* Get the flag on the LPC reusage type (primary channel or ave LPC) */ hStereoTD->tdm_use_IAWB_Ave_lpc = get_indice_st( sts[0], element_brate_adapt, bstr_last_pos - TDM_SECONDARY_SIGNALLING - TDM_RATIO_BITS - TDM_LP_REUSE_BITS, TDM_LP_REUSE_BITS ); hStereoTD->tdm_lp_reuse_flag = 1; } Loading @@ -173,8 +181,8 @@ void tdm_configure_dec( /* Get the flag on the LPC reusage */ hStereoTD->tdm_lp_reuse_flag = get_indice_st( sts[0], element_brate_adapt, bstr_last_pos - TDM_SECONDARY_SIGNALLING - TDM_RATIO_BITS - TDM_LP_REUSE_BITS, TDM_LP_REUSE_BITS ); } sts[0]->tdm_LRTD_flag = hStereoTD->tdm_LRTD_flag; /* the flag was already read in function stereo_memory_dec() */ /* the flag was already read in function stereo_memory_dec() */ sts[0]->tdm_LRTD_flag = hStereoTD->tdm_LRTD_flag; sts[1]->tdm_LRTD_flag = hStereoTD->tdm_LRTD_flag; tdm_inst_ratio_idx = *tdm_ratio_idx; Loading @@ -182,7 +190,12 @@ void tdm_configure_dec( /* update past tdm_SM_flag */ hStereoTD->tdm_prev_last_SM_flag = hStereoTD->tdm_last_SM_flag; hStereoTD->tdm_last_SM_flag = hStereoTD->tdm_SM_flag; /*----------------------------------------------------------------* * Adjust variables depending of the LRTD state * read the transmitted ratio index, if it corresponds to the TDM_NQ * then no down-mix needed, can work for out-of-phase signal or when * switching from MDCT *----------------------------------------------------------------*/ idx_LRTD_pri_side = -1; if ( hStereoTD->tdm_LRTD_flag == 1 ) { Loading
lib_enc/gs_enc.c +1 −1 Original line number Diff line number Diff line Loading @@ -460,7 +460,7 @@ void gsc_enc( Ener_per_band_comp( exc_diff, Ener_per_bd_iQ, MBANDS_GN, 1, st->L_frame ); /*--------------------------------------------------------------------------------------* * Gain quantizaion * Gain quantization *--------------------------------------------------------------------------------------*/ i = 0; Loading