Loading lib_com/ivas_fb_mixer_fx.c +28 −3 Original line number Diff line number Diff line Loading @@ -614,13 +614,22 @@ void ivas_fb_mixer_get_windowed_fr_fx( Word16 n_new_samples; Word32 fr_in_block_fx[L_FRAME48k * 2]; const Word16 *win_ptr_fx; #ifdef OPT_MCT_ENC_V1_BE Word16 two_mdft_len = shl( mdft_len, 1 ); Word16 tmp = sub( shl( mdft_len, 1 ), length ); Word16 gb_neg = negate( gb ); n_old_samples = s_min( ( sub( hFbMixer->fb_cfg->prior_input_length, hFbMixer->fb_cfg->windowed_fr_offset ) ), two_mdft_len ); offset = sub( tmp, hFbMixer->ana_window_offset ); rev_offset = sub( two_mdft_len, hFbMixer->ana_window_offset ); set32_fx( fr_in_block_fx, 0, offset ); #else n_old_samples = s_min( ( sub( hFbMixer->fb_cfg->prior_input_length, hFbMixer->fb_cfg->windowed_fr_offset ) ), ( shl( mdft_len, 1 ) ) ); n_new_samples = s_max( 0, sub( shl( length, 1 ), n_old_samples ) ); offset = sub( sub( shl( mdft_len, 1 ), length ), hFbMixer->ana_window_offset ); rev_offset = sub( shl( mdft_len, 1 ), hFbMixer->ana_window_offset ); set32_fx( fr_in_block_fx, 0, offset ); #endif n_new_samples = s_max( 0, sub( shl( length, 1 ), n_old_samples ) ); FOR( ch_idx = 0; ch_idx < nchan_fb_in; ch_idx++ ) { Copy32( &hFbMixer->ppFilterbank_prior_input_fx[ch_idx][offset + hFbMixer->fb_cfg->windowed_fr_offset], &fr_in_block_fx[offset], sub( n_old_samples, offset ) ); // Qx Loading @@ -628,25 +637,41 @@ void ivas_fb_mixer_get_windowed_fr_fx( win_ptr_fx = hFbMixer->pAna_window_fx; /*Q15*/ #ifdef OPT_MCT_ENC_V1_BE FOR( j = offset; j < tmp; j++ ) #else FOR( j = offset; j < sub( shl( mdft_len, 1 ), length ); j++ ) #endif { fr_in_block_fx[j] = Mpy_32_16_1( fr_in_block_fx[j], ( *( win_ptr_fx++ ) ) ); // Qx + 15 - 15 = Qx move32(); } #ifdef OPT_MCT_ENC_V1_BE FOR( j = rev_offset; j < two_mdft_len; j++ ) #else FOR( j = rev_offset; j < shl( mdft_len, 1 ); j++ ) #endif { fr_in_block_fx[j] = Mpy_32_16_1( fr_in_block_fx[j], ( *( --win_ptr_fx ) ) ); // Qx + 15 - 15 = Qx move32(); } #ifdef OPT_MCT_ENC_V1_BE scale_sig32( fr_in_block_fx, two_mdft_len, gb_neg ); #else FOR( Word16 i = 0; i < shl( mdft_len, 1 ); i++ ) { fr_in_block_fx[i] = L_shr( fr_in_block_fx[i], gb ); // Qx - gb move32(); } #endif #ifdef OPT_MCT_ENC_V1_BE ivas_mdft_fx( fr_in_block_fx, frame_f_real_fx[ch_idx], frame_f_imag_fx[ch_idx], two_mdft_len, mdft_len ); #else ivas_mdft_fx( fr_in_block_fx, frame_f_real_fx[ch_idx], frame_f_imag_fx[ch_idx], shl( mdft_len, 1 ), mdft_len ); #endif } return; Loading lib_com/ivas_tools_fx.c +8 −0 Original line number Diff line number Diff line Loading @@ -1955,7 +1955,11 @@ void v_multc_acc_32_16( FOR( i = 0; i < N; i++ ) { #ifdef OPT_MCT_ENC_V1_BE y[i] = Madd_32_16( y[i], x[i], c ); #else y[i] = L_add( y[i], Mpy_32_16_1( x[i], c ) ); #endif move32(); } Loading @@ -1972,7 +1976,11 @@ void v_multc_acc_32_32( FOR( i = 0; i < N; i++ ) { #ifdef OPT_MCT_ENC_V1_BE y[i] = Madd_32_32( y[i], x[i], c ); /*Qx*/ #else y[i] = L_add( y[i], Mpy_32_32( x[i], c ) ); /*Qx*/ #endif move32(); } Loading lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -78,6 +78,7 @@ /* Note: each compile switch (FIX_1101_...) is independent from the other ones */ #define OPT_MCT_ENC_V1_NBE #define OPT_MCT_ENC_V1_BE #define OPT_SBA_REND_V1_BE #define OPT_HEAD_ROT_REND_V1_BE #define OPT_SBA_DEC_V2_BE Loading lib_com/tns_base.c +13 −4 Original line number Diff line number Diff line Loading @@ -1207,8 +1207,13 @@ static Word32 FIRLattice( move32(); FOR( i = 0; i < order - 1; i++ ) { #ifdef OPT_MCT_ENC_V1_BE tmp = Madd_32_16( state[i], x, parCoeff[i] ); /*Q0*/ x = Madd_32_16( x, state[i], parCoeff[i] ); /* exponent: 31+0 */ #else tmp = L_add( state[i], Mpy_32_16_1( x, parCoeff[i] ) ); /*Q0*/ x = L_add( x, Mpy_32_16_1( state[i], parCoeff[i] ) ); /* exponent: 31+0 */ #endif state[i] = tmpSave; /*Q0*/ move32(); tmpSave = tmp; /*Q0*/ Loading @@ -1216,7 +1221,11 @@ static Word32 FIRLattice( } /* last stage: only need half operations */ #ifdef OPT_MCT_ENC_V1_BE x = Madd_32_16( x, state[order - 1], parCoeff[order - 1] ); /*Q0*/ #else x = L_add( x, Mpy_32_16_1( state[order - 1], parCoeff[order - 1] ) ); /*Q0*/ #endif state[order - 1] = tmpSave; /*Q0*/ move32(); Loading lib_dec/ivas_jbm_dec_fx.c +3 −3 Original line number Diff line number Diff line Loading @@ -1031,18 +1031,18 @@ ivas_error ivas_jbm_dec_tc_fx( { num_md_sub_frames = ivas_get_spar_dec_md_num_subframes( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->last_active_ivas_total_brate ); SPAR_DEC_HANDLE hSpar = st_ivas->hSpar; Word16 Q_p_output = 14; move16(); Word16 nchan_transport; // num_bands_out = hSpar->hFbMixer->pFb->filterbank_num_bands; nchan_transport = hSpar->hMdDec->spar_md_cfg.nchan_transport; move16(); nchan_out = nchan_transport; move16(); Word16 Q_p_output = max( 3, sub( L_norm_arr( p_output_fx[sba_ch_idx], imult1616( output_frame, nchan_transport ) ), 1 ) ); FOR( ch = 0; ch < nchan_transport; ch++ ) { Scale_sig32( p_output_fx[sba_ch_idx + ch], output_frame, sub( Q_p_output, Q11 ) ); // Q_p_output Scale_sig32( p_output_fx[sba_ch_idx + ch], output_frame, Q_p_output ); // Q_p_output + Q11 } Q_p_output = add( Q11, Q_p_output ); hSpar->hMdDec->Q_mixer_mat = 31; move16(); Loading Loading
lib_com/ivas_fb_mixer_fx.c +28 −3 Original line number Diff line number Diff line Loading @@ -614,13 +614,22 @@ void ivas_fb_mixer_get_windowed_fr_fx( Word16 n_new_samples; Word32 fr_in_block_fx[L_FRAME48k * 2]; const Word16 *win_ptr_fx; #ifdef OPT_MCT_ENC_V1_BE Word16 two_mdft_len = shl( mdft_len, 1 ); Word16 tmp = sub( shl( mdft_len, 1 ), length ); Word16 gb_neg = negate( gb ); n_old_samples = s_min( ( sub( hFbMixer->fb_cfg->prior_input_length, hFbMixer->fb_cfg->windowed_fr_offset ) ), two_mdft_len ); offset = sub( tmp, hFbMixer->ana_window_offset ); rev_offset = sub( two_mdft_len, hFbMixer->ana_window_offset ); set32_fx( fr_in_block_fx, 0, offset ); #else n_old_samples = s_min( ( sub( hFbMixer->fb_cfg->prior_input_length, hFbMixer->fb_cfg->windowed_fr_offset ) ), ( shl( mdft_len, 1 ) ) ); n_new_samples = s_max( 0, sub( shl( length, 1 ), n_old_samples ) ); offset = sub( sub( shl( mdft_len, 1 ), length ), hFbMixer->ana_window_offset ); rev_offset = sub( shl( mdft_len, 1 ), hFbMixer->ana_window_offset ); set32_fx( fr_in_block_fx, 0, offset ); #endif n_new_samples = s_max( 0, sub( shl( length, 1 ), n_old_samples ) ); FOR( ch_idx = 0; ch_idx < nchan_fb_in; ch_idx++ ) { Copy32( &hFbMixer->ppFilterbank_prior_input_fx[ch_idx][offset + hFbMixer->fb_cfg->windowed_fr_offset], &fr_in_block_fx[offset], sub( n_old_samples, offset ) ); // Qx Loading @@ -628,25 +637,41 @@ void ivas_fb_mixer_get_windowed_fr_fx( win_ptr_fx = hFbMixer->pAna_window_fx; /*Q15*/ #ifdef OPT_MCT_ENC_V1_BE FOR( j = offset; j < tmp; j++ ) #else FOR( j = offset; j < sub( shl( mdft_len, 1 ), length ); j++ ) #endif { fr_in_block_fx[j] = Mpy_32_16_1( fr_in_block_fx[j], ( *( win_ptr_fx++ ) ) ); // Qx + 15 - 15 = Qx move32(); } #ifdef OPT_MCT_ENC_V1_BE FOR( j = rev_offset; j < two_mdft_len; j++ ) #else FOR( j = rev_offset; j < shl( mdft_len, 1 ); j++ ) #endif { fr_in_block_fx[j] = Mpy_32_16_1( fr_in_block_fx[j], ( *( --win_ptr_fx ) ) ); // Qx + 15 - 15 = Qx move32(); } #ifdef OPT_MCT_ENC_V1_BE scale_sig32( fr_in_block_fx, two_mdft_len, gb_neg ); #else FOR( Word16 i = 0; i < shl( mdft_len, 1 ); i++ ) { fr_in_block_fx[i] = L_shr( fr_in_block_fx[i], gb ); // Qx - gb move32(); } #endif #ifdef OPT_MCT_ENC_V1_BE ivas_mdft_fx( fr_in_block_fx, frame_f_real_fx[ch_idx], frame_f_imag_fx[ch_idx], two_mdft_len, mdft_len ); #else ivas_mdft_fx( fr_in_block_fx, frame_f_real_fx[ch_idx], frame_f_imag_fx[ch_idx], shl( mdft_len, 1 ), mdft_len ); #endif } return; Loading
lib_com/ivas_tools_fx.c +8 −0 Original line number Diff line number Diff line Loading @@ -1955,7 +1955,11 @@ void v_multc_acc_32_16( FOR( i = 0; i < N; i++ ) { #ifdef OPT_MCT_ENC_V1_BE y[i] = Madd_32_16( y[i], x[i], c ); #else y[i] = L_add( y[i], Mpy_32_16_1( x[i], c ) ); #endif move32(); } Loading @@ -1972,7 +1976,11 @@ void v_multc_acc_32_32( FOR( i = 0; i < N; i++ ) { #ifdef OPT_MCT_ENC_V1_BE y[i] = Madd_32_32( y[i], x[i], c ); /*Qx*/ #else y[i] = L_add( y[i], Mpy_32_32( x[i], c ) ); /*Qx*/ #endif move32(); } Loading
lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -78,6 +78,7 @@ /* Note: each compile switch (FIX_1101_...) is independent from the other ones */ #define OPT_MCT_ENC_V1_NBE #define OPT_MCT_ENC_V1_BE #define OPT_SBA_REND_V1_BE #define OPT_HEAD_ROT_REND_V1_BE #define OPT_SBA_DEC_V2_BE Loading
lib_com/tns_base.c +13 −4 Original line number Diff line number Diff line Loading @@ -1207,8 +1207,13 @@ static Word32 FIRLattice( move32(); FOR( i = 0; i < order - 1; i++ ) { #ifdef OPT_MCT_ENC_V1_BE tmp = Madd_32_16( state[i], x, parCoeff[i] ); /*Q0*/ x = Madd_32_16( x, state[i], parCoeff[i] ); /* exponent: 31+0 */ #else tmp = L_add( state[i], Mpy_32_16_1( x, parCoeff[i] ) ); /*Q0*/ x = L_add( x, Mpy_32_16_1( state[i], parCoeff[i] ) ); /* exponent: 31+0 */ #endif state[i] = tmpSave; /*Q0*/ move32(); tmpSave = tmp; /*Q0*/ Loading @@ -1216,7 +1221,11 @@ static Word32 FIRLattice( } /* last stage: only need half operations */ #ifdef OPT_MCT_ENC_V1_BE x = Madd_32_16( x, state[order - 1], parCoeff[order - 1] ); /*Q0*/ #else x = L_add( x, Mpy_32_16_1( state[order - 1], parCoeff[order - 1] ) ); /*Q0*/ #endif state[order - 1] = tmpSave; /*Q0*/ move32(); Loading
lib_dec/ivas_jbm_dec_fx.c +3 −3 Original line number Diff line number Diff line Loading @@ -1031,18 +1031,18 @@ ivas_error ivas_jbm_dec_tc_fx( { num_md_sub_frames = ivas_get_spar_dec_md_num_subframes( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->last_active_ivas_total_brate ); SPAR_DEC_HANDLE hSpar = st_ivas->hSpar; Word16 Q_p_output = 14; move16(); Word16 nchan_transport; // num_bands_out = hSpar->hFbMixer->pFb->filterbank_num_bands; nchan_transport = hSpar->hMdDec->spar_md_cfg.nchan_transport; move16(); nchan_out = nchan_transport; move16(); Word16 Q_p_output = max( 3, sub( L_norm_arr( p_output_fx[sba_ch_idx], imult1616( output_frame, nchan_transport ) ), 1 ) ); FOR( ch = 0; ch < nchan_transport; ch++ ) { Scale_sig32( p_output_fx[sba_ch_idx + ch], output_frame, sub( Q_p_output, Q11 ) ); // Q_p_output Scale_sig32( p_output_fx[sba_ch_idx + ch], output_frame, Q_p_output ); // Q_p_output + Q11 } Q_p_output = add( Q11, Q_p_output ); hSpar->hMdDec->Q_mixer_mat = 31; move16(); Loading