Loading lib_dec/ivas_dirac_dec_fx.c +21 −21 Original line number Diff line number Diff line Loading @@ -2217,27 +2217,6 @@ void ivas_dirac_dec_render_sf_fx( move16(); move16(); FOR( i = 0; i < MAX_OUTPUT_CHANNELS; i++ ) { FOR( Word16 j = 0; j < MAX_PARAM_SPATIAL_SUBFRAMES; j++ ) { set32_fx( Cldfb_RealBuffer_fx[i][j], 0, CLDFB_NO_CHANNELS_MAX ); set32_fx( Cldfb_ImagBuffer_fx[i][j], 0, CLDFB_NO_CHANNELS_MAX ); } } #ifndef OPT_BIN_RENDERER_V2 FOR( i = 0; i < BINAURAL_CHANNELS; i++ ) { FOR( Word16 j = 0; j < MAX_PARAM_SPATIAL_SUBFRAMES; j++ ) { set32_fx( Cldfb_RealBuffer_Binaural_fx[i][j], 0, CLDFB_NO_CHANNELS_MAX ); set32_fx( Cldfb_RealBuffer_Binaural_fx[i][j], 0, CLDFB_NO_CHANNELS_MAX ); } } #endif /* OPT_BIN_RENDERER_V2 */ /* local copies of azi, ele, diffuseness */ Word16 azimuth[CLDFB_NO_CHANNELS_MAX]; Word16 elevation[CLDFB_NO_CHANNELS_MAX]; Loading Loading @@ -2288,6 +2267,27 @@ void ivas_dirac_dec_render_sf_fx( push_wmops( "ivas_dirac_dec_render" ); /* Initialize aux buffers */ FOR( i = 0; i < MAX_OUTPUT_CHANNELS; i++ ) { FOR( Word16 j = 0; j < MAX_PARAM_SPATIAL_SUBFRAMES; j++ ) { set32_fx( Cldfb_RealBuffer_fx[i][j], 0, CLDFB_NO_CHANNELS_MAX ); set32_fx( Cldfb_ImagBuffer_fx[i][j], 0, CLDFB_NO_CHANNELS_MAX ); } } #ifndef OPT_BIN_RENDERER_V2 FOR( i = 0; i < BINAURAL_CHANNELS; i++ ) { FOR( Word16 j = 0; j < MAX_PARAM_SPATIAL_SUBFRAMES; j++ ) { set32_fx( Cldfb_RealBuffer_Binaural_fx[i][j], 0, CLDFB_NO_CHANNELS_MAX ); set32_fx( Cldfb_ImagBuffer_Binaural_fx[i][j], 0, CLDFB_NO_CHANNELS_MAX ); } } #endif /* OPT_BIN_RENDERER_V2 */ hDirAC = st_ivas->hDirAC; hDirACRend = st_ivas->hDirACRend; hSpatParamRendCom = st_ivas->hSpatParamRendCom; Loading lib_enc/ivas_core_enc_fx.c +11 −6 Original line number Diff line number Diff line Loading @@ -113,7 +113,7 @@ ivas_error ivas_core_enc_fx( Word16 diff_nBits; ivas_error error; Word16 max_num_indices_BWE; Word16 i; Word16 i, shift, Q_min; set32_fx( new_swb_speech_buffer_fx, 0, L_FRAME48k + STEREO_DFT_OVL_MAX ); set16_fx( new_swb_speech_buffer_fx_16, 0, L_FRAME48k + STEREO_DFT_OVL_MAX ); Loading Loading @@ -531,11 +531,16 @@ ivas_error ivas_core_enc_fx( st->hTcxEnc->exp_buf_speech_ltp = st->exp_buf_speech_enc; move16(); } Scale_sig( st->input_fx, input_frame, sub( -1, st->q_inp ) ); Scale_sig( st->input_fx - input_frame, input_frame, sub( -1, st->q_old_inp ) ); st->q_inp = -1; shift = norm_arr( st->input_fx, input_frame ); Q_min = s_max( -2, add( st->q_inp, shift ) ); scale_sig( st->input_fx, input_frame, sub( Q_min, st->q_inp ) ); st->q_inp = Q_min; move16(); st->q_old_inp = -1; shift = norm_arr( st->input_fx - input_frame, input_frame ); Q_min = s_max( -2, add( st->q_old_inp, shift ) ); scale_sig( st->input_fx - input_frame, input_frame, sub( Q_min, st->q_old_inp ) ); st->q_old_inp = Q_min; move16(); } Loading Loading @@ -707,7 +712,7 @@ ivas_error ivas_core_enc_fx( Word16 Q_shb_spch_16 = Q_shb_spch; move16(); Word16 shift = add( getScaleFactor16( shb_speech_fx, L_FRAME16k ), Q16 ); shift = add( getScaleFactor16( shb_speech_fx, L_FRAME16k ), Q16 ); Copy_Scale_sig_16_32_no_sat( shb_speech_fx, shb_speech_fx32, L_FRAME16k, shift ); // Q_shb_spch Q_shb_spch = add( Q_shb_spch, shift ); Loading lib_enc/ivas_core_pre_proc_front_fx.c +2 −2 Original line number Diff line number Diff line Loading @@ -232,7 +232,7 @@ ivas_error pre_proc_front_ivas_fx( Word16 Q_min = add( sub( 15, st->exp_old_inp_12k8 ), norm_arr( st->old_inp_12k8_fx, L_INP_MEM ) ); Word16 input_frame_full = shl( input_frame, 1 ); //(old frame input length + new frame input length) Q_min = s_min( Q_min, sub( add( getScaleFactor32( st->input32_fx - input_frame, input_frame_full ), st->q_inp32 ), 16 ) ); Q_min = s_max( -1, Q_min ); Q_min = s_max( -2, Q_min ); Copy_Scale_sig_32_16( st->input32_fx - input_frame, st->input_fx - input_frame, input_frame_full, sub( Q_min, st->q_inp32 ) ); // Q_min st->q_inp = Q_min; move16(); Loading Loading @@ -682,7 +682,7 @@ ivas_error pre_proc_front_ivas_fx( } st->mem_preemph_fx = shl_sat( st->mem_preemph_fx_q_inp, sub( -1, st->q_inp ) ); /*Q(-1) saturation added as float value goes above 65536 for +10 dB test (ltv48_MC512.wav and ltv48_MC51.wav) */ move16(); st->mem_preemph_DFT_fx = shl( st->mem_preemph_DFT_fx_q_inp, sub( -1, st->q_inp ) ); /*Q(-1)*/ st->mem_preemph_DFT_fx = shl_sat( st->mem_preemph_DFT_fx_q_inp, sub( -1, st->q_inp ) ); /*Q(-1)*/ move16(); st->mem_preemph_q = st->q_inp; move16(); Loading lib_enc/ivas_cpe_enc_fx.c +6 −4 Original line number Diff line number Diff line Loading @@ -649,10 +649,11 @@ ivas_error ivas_cpe_enc_fx( hCPE->hStereoDft->Spd_R_smooth_fx_e = sub( hCPE->hStereoDft->Spd_R_smooth_fx_e, temp ); move16(); q_com = MAX_16; move16(); FOR( n = 0; n < CPE_CHANNELS; n++ ) { q_com = sub( add( L_norm_arr( sts[n]->input32_fx, input_frame ), sts[n]->q_inp32 ), 16 ); q_com = s_min( q_com, sub( add( L_norm_arr( sts[n]->input32_fx, input_frame ), sts[n]->q_inp32 ), 16 ) ); q_com = s_min( q_com, sub( add( L_norm_arr( sts[n]->old_input_signal32_fx, input_frame ), sts[n]->q_old_inp32 ), 16 ) ); q_com = s_min( q_com, add( norm_arr( hCPE->input_mem_fx[n], hCPE->hStereoDft->dft_ovl ), hCPE->q_input_mem[n] ) ); Loading @@ -661,7 +662,9 @@ ivas_error ivas_cpe_enc_fx( q_com = 0; move16(); } } FOR( n = 0; n < CPE_CHANNELS; n++ ) { Copy_Scale_sig_32_16( sts[n]->input32_fx, sts[n]->input_fx, input_frame, sub( q_com, sts[n]->q_inp32 ) ); sts[n]->q_inp = q_com; move16(); Loading @@ -674,7 +677,6 @@ ivas_error ivas_cpe_enc_fx( hCPE->q_input_mem[n] = q_com; move16(); } stereo_dft_hybrid_ITD_flag_fx( hCPE->hStereoDft->hConfig, input_Fs, hCPE->hStereoDft->hItd->hybrid_itd_max ); /* Time Domain ITD compensation using extrapolation */ Loading lib_enc/ivas_stereo_dft_enc_itd_fx.c +24 −2 Original line number Diff line number Diff line Loading @@ -169,7 +169,8 @@ static void stereo_dft_quantize_itd_fx( Word16 *ind ) { Word16 itd; Word16 input_fs_by_stereo_dft_itd_fs = 0; move16(); // itd = (int16_t) ( sign( in ) * 0.5f + in ); itd = in; move16(); Loading @@ -188,9 +189,30 @@ static void stereo_dft_quantize_itd_fx( move16(); } SWITCH( input_Fs ) { case 8000: input_fs_by_stereo_dft_itd_fs = 1; // Q2 move16(); BREAK; case 16000: input_fs_by_stereo_dft_itd_fs = 2; // Q2 move16(); BREAK; case 32000: input_fs_by_stereo_dft_itd_fs = 4; // Q2 move16(); BREAK; case 48000: input_fs_by_stereo_dft_itd_fs = 6; // Q2 move16(); BREAK; default: assert( 0 ); } /*Convert back @ fs*/ //*out = (float) ( itd * input_Fs ) / ( (float) ( STEREO_DFT_ITD_FS ) ); *out = Mpy_32_32( L_shl( itd * input_Fs, 2 ), 1099511628 /*Q45*/ ); // Q45+Q2-Q31 = Q16 *out = L_shl( L_mult( itd, input_fs_by_stereo_dft_itd_fs ), Q13 ); // Q16 move32(); return; Loading Loading
lib_dec/ivas_dirac_dec_fx.c +21 −21 Original line number Diff line number Diff line Loading @@ -2217,27 +2217,6 @@ void ivas_dirac_dec_render_sf_fx( move16(); move16(); FOR( i = 0; i < MAX_OUTPUT_CHANNELS; i++ ) { FOR( Word16 j = 0; j < MAX_PARAM_SPATIAL_SUBFRAMES; j++ ) { set32_fx( Cldfb_RealBuffer_fx[i][j], 0, CLDFB_NO_CHANNELS_MAX ); set32_fx( Cldfb_ImagBuffer_fx[i][j], 0, CLDFB_NO_CHANNELS_MAX ); } } #ifndef OPT_BIN_RENDERER_V2 FOR( i = 0; i < BINAURAL_CHANNELS; i++ ) { FOR( Word16 j = 0; j < MAX_PARAM_SPATIAL_SUBFRAMES; j++ ) { set32_fx( Cldfb_RealBuffer_Binaural_fx[i][j], 0, CLDFB_NO_CHANNELS_MAX ); set32_fx( Cldfb_RealBuffer_Binaural_fx[i][j], 0, CLDFB_NO_CHANNELS_MAX ); } } #endif /* OPT_BIN_RENDERER_V2 */ /* local copies of azi, ele, diffuseness */ Word16 azimuth[CLDFB_NO_CHANNELS_MAX]; Word16 elevation[CLDFB_NO_CHANNELS_MAX]; Loading Loading @@ -2288,6 +2267,27 @@ void ivas_dirac_dec_render_sf_fx( push_wmops( "ivas_dirac_dec_render" ); /* Initialize aux buffers */ FOR( i = 0; i < MAX_OUTPUT_CHANNELS; i++ ) { FOR( Word16 j = 0; j < MAX_PARAM_SPATIAL_SUBFRAMES; j++ ) { set32_fx( Cldfb_RealBuffer_fx[i][j], 0, CLDFB_NO_CHANNELS_MAX ); set32_fx( Cldfb_ImagBuffer_fx[i][j], 0, CLDFB_NO_CHANNELS_MAX ); } } #ifndef OPT_BIN_RENDERER_V2 FOR( i = 0; i < BINAURAL_CHANNELS; i++ ) { FOR( Word16 j = 0; j < MAX_PARAM_SPATIAL_SUBFRAMES; j++ ) { set32_fx( Cldfb_RealBuffer_Binaural_fx[i][j], 0, CLDFB_NO_CHANNELS_MAX ); set32_fx( Cldfb_ImagBuffer_Binaural_fx[i][j], 0, CLDFB_NO_CHANNELS_MAX ); } } #endif /* OPT_BIN_RENDERER_V2 */ hDirAC = st_ivas->hDirAC; hDirACRend = st_ivas->hDirACRend; hSpatParamRendCom = st_ivas->hSpatParamRendCom; Loading
lib_enc/ivas_core_enc_fx.c +11 −6 Original line number Diff line number Diff line Loading @@ -113,7 +113,7 @@ ivas_error ivas_core_enc_fx( Word16 diff_nBits; ivas_error error; Word16 max_num_indices_BWE; Word16 i; Word16 i, shift, Q_min; set32_fx( new_swb_speech_buffer_fx, 0, L_FRAME48k + STEREO_DFT_OVL_MAX ); set16_fx( new_swb_speech_buffer_fx_16, 0, L_FRAME48k + STEREO_DFT_OVL_MAX ); Loading Loading @@ -531,11 +531,16 @@ ivas_error ivas_core_enc_fx( st->hTcxEnc->exp_buf_speech_ltp = st->exp_buf_speech_enc; move16(); } Scale_sig( st->input_fx, input_frame, sub( -1, st->q_inp ) ); Scale_sig( st->input_fx - input_frame, input_frame, sub( -1, st->q_old_inp ) ); st->q_inp = -1; shift = norm_arr( st->input_fx, input_frame ); Q_min = s_max( -2, add( st->q_inp, shift ) ); scale_sig( st->input_fx, input_frame, sub( Q_min, st->q_inp ) ); st->q_inp = Q_min; move16(); st->q_old_inp = -1; shift = norm_arr( st->input_fx - input_frame, input_frame ); Q_min = s_max( -2, add( st->q_old_inp, shift ) ); scale_sig( st->input_fx - input_frame, input_frame, sub( Q_min, st->q_old_inp ) ); st->q_old_inp = Q_min; move16(); } Loading Loading @@ -707,7 +712,7 @@ ivas_error ivas_core_enc_fx( Word16 Q_shb_spch_16 = Q_shb_spch; move16(); Word16 shift = add( getScaleFactor16( shb_speech_fx, L_FRAME16k ), Q16 ); shift = add( getScaleFactor16( shb_speech_fx, L_FRAME16k ), Q16 ); Copy_Scale_sig_16_32_no_sat( shb_speech_fx, shb_speech_fx32, L_FRAME16k, shift ); // Q_shb_spch Q_shb_spch = add( Q_shb_spch, shift ); Loading
lib_enc/ivas_core_pre_proc_front_fx.c +2 −2 Original line number Diff line number Diff line Loading @@ -232,7 +232,7 @@ ivas_error pre_proc_front_ivas_fx( Word16 Q_min = add( sub( 15, st->exp_old_inp_12k8 ), norm_arr( st->old_inp_12k8_fx, L_INP_MEM ) ); Word16 input_frame_full = shl( input_frame, 1 ); //(old frame input length + new frame input length) Q_min = s_min( Q_min, sub( add( getScaleFactor32( st->input32_fx - input_frame, input_frame_full ), st->q_inp32 ), 16 ) ); Q_min = s_max( -1, Q_min ); Q_min = s_max( -2, Q_min ); Copy_Scale_sig_32_16( st->input32_fx - input_frame, st->input_fx - input_frame, input_frame_full, sub( Q_min, st->q_inp32 ) ); // Q_min st->q_inp = Q_min; move16(); Loading Loading @@ -682,7 +682,7 @@ ivas_error pre_proc_front_ivas_fx( } st->mem_preemph_fx = shl_sat( st->mem_preemph_fx_q_inp, sub( -1, st->q_inp ) ); /*Q(-1) saturation added as float value goes above 65536 for +10 dB test (ltv48_MC512.wav and ltv48_MC51.wav) */ move16(); st->mem_preemph_DFT_fx = shl( st->mem_preemph_DFT_fx_q_inp, sub( -1, st->q_inp ) ); /*Q(-1)*/ st->mem_preemph_DFT_fx = shl_sat( st->mem_preemph_DFT_fx_q_inp, sub( -1, st->q_inp ) ); /*Q(-1)*/ move16(); st->mem_preemph_q = st->q_inp; move16(); Loading
lib_enc/ivas_cpe_enc_fx.c +6 −4 Original line number Diff line number Diff line Loading @@ -649,10 +649,11 @@ ivas_error ivas_cpe_enc_fx( hCPE->hStereoDft->Spd_R_smooth_fx_e = sub( hCPE->hStereoDft->Spd_R_smooth_fx_e, temp ); move16(); q_com = MAX_16; move16(); FOR( n = 0; n < CPE_CHANNELS; n++ ) { q_com = sub( add( L_norm_arr( sts[n]->input32_fx, input_frame ), sts[n]->q_inp32 ), 16 ); q_com = s_min( q_com, sub( add( L_norm_arr( sts[n]->input32_fx, input_frame ), sts[n]->q_inp32 ), 16 ) ); q_com = s_min( q_com, sub( add( L_norm_arr( sts[n]->old_input_signal32_fx, input_frame ), sts[n]->q_old_inp32 ), 16 ) ); q_com = s_min( q_com, add( norm_arr( hCPE->input_mem_fx[n], hCPE->hStereoDft->dft_ovl ), hCPE->q_input_mem[n] ) ); Loading @@ -661,7 +662,9 @@ ivas_error ivas_cpe_enc_fx( q_com = 0; move16(); } } FOR( n = 0; n < CPE_CHANNELS; n++ ) { Copy_Scale_sig_32_16( sts[n]->input32_fx, sts[n]->input_fx, input_frame, sub( q_com, sts[n]->q_inp32 ) ); sts[n]->q_inp = q_com; move16(); Loading @@ -674,7 +677,6 @@ ivas_error ivas_cpe_enc_fx( hCPE->q_input_mem[n] = q_com; move16(); } stereo_dft_hybrid_ITD_flag_fx( hCPE->hStereoDft->hConfig, input_Fs, hCPE->hStereoDft->hItd->hybrid_itd_max ); /* Time Domain ITD compensation using extrapolation */ Loading
lib_enc/ivas_stereo_dft_enc_itd_fx.c +24 −2 Original line number Diff line number Diff line Loading @@ -169,7 +169,8 @@ static void stereo_dft_quantize_itd_fx( Word16 *ind ) { Word16 itd; Word16 input_fs_by_stereo_dft_itd_fs = 0; move16(); // itd = (int16_t) ( sign( in ) * 0.5f + in ); itd = in; move16(); Loading @@ -188,9 +189,30 @@ static void stereo_dft_quantize_itd_fx( move16(); } SWITCH( input_Fs ) { case 8000: input_fs_by_stereo_dft_itd_fs = 1; // Q2 move16(); BREAK; case 16000: input_fs_by_stereo_dft_itd_fs = 2; // Q2 move16(); BREAK; case 32000: input_fs_by_stereo_dft_itd_fs = 4; // Q2 move16(); BREAK; case 48000: input_fs_by_stereo_dft_itd_fs = 6; // Q2 move16(); BREAK; default: assert( 0 ); } /*Convert back @ fs*/ //*out = (float) ( itd * input_Fs ) / ( (float) ( STEREO_DFT_ITD_FS ) ); *out = Mpy_32_32( L_shl( itd * input_Fs, 2 ), 1099511628 /*Q45*/ ); // Q45+Q2-Q31 = Q16 *out = L_shl( L_mult( itd, input_fs_by_stereo_dft_itd_fs ), Q13 ); // Q16 move32(); return; Loading