From dc36cb5ba921e36be19089ce8e890a80a7b6f0e7 Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Wed, 25 Jun 2025 10:50:15 +0530 Subject: [PATCH 1/3] Cleanup macros in options.h Cleared up below macros: FIX_1378_ACELP_OUT_OF_BOUNDS , FIX_1379_MASA_ANGLE_ROUND , OPT_BIN_RENDERER_V1 , OPT_BIN_RENDERER_V2 , OPT_STEREO_32KBPS_V1 , OPT_AVOID_STATE_BUF_RESCALE , FIX_1310_SPEEDUP_ivas_dirac_dec_get_response_fx , FIX_1310_SPEEDUP_ivas_dirac_dec_output_synthesis_process_slot , IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST_BE , HARM_PUSH_BIT , HARM_ENC_INIT , DIV32_OPT_NEWTON , IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST_NONBE , MERGE_REQUEST_1378_SPEEDUP_ivas_mc_param_enc_fx_NONBE , MERGE_REQUEST_1564_SPEEDUP_ivas_dirac_dec_output_synthesis_cov_param_mc_synthesise_slot_fx_NONBE , FIX_1439_SPEEDUP_Copy_Scale_sig_16_32_no_sat , FIX_1439_SPEEDUP_stereo_icBWE_dec_fx , FIX_1439_SPEEDUP_ivas_swb_tbe_dec_fx , FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic , FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2 , FIX_1481_HARDCODE_DIV , VEC_ARITH_OPT_v1 , FIX_1486_IND_SHB_RES , FIX_1511_POC_RENORM , TEST_HR , REMOVE_EVS_DUPLICATES , FIX_1713_EXP , FIX_1733_CLDFB_BUG --- lib_com/basop_util.c | 2 - lib_com/basop_util.h | 2 - lib_com/bitstream_fx.c | 334 --------- lib_com/cldfb_fx.c | 59 -- lib_com/cnst.h | 8 - lib_com/fft_fx.c | 383 ---------- lib_com/hp50_fx.c | 20 - lib_com/ivas_prot_fx.h | 2 - lib_com/ivas_rom_com_fx.c | 14 - lib_com/ivas_spar_com_fx.c | 2 - lib_com/modif_fs_fx.c | 102 --- lib_com/mslvq_com_fx.c | 44 -- lib_com/options.h | 31 +- lib_com/prot_fx.h | 21 - lib_com/scale_mem_fx.c | 4 - lib_com/swb_tbe_com_fx.c | 250 ------- lib_com/tools.c | 2 - lib_com/tools_fx.c | 12 - lib_com/trans_inv_fx.c | 30 - lib_dec/acelp_core_dec_fx.c | 61 +- lib_dec/acelp_core_switch_dec_fx.c | 15 - lib_dec/core_switching_dec_fx.c | 8 - lib_dec/dec_acelp_fx.c | 12 - lib_dec/fd_cng_dec_fx.c | 4 - lib_dec/ivas_binRenderer_internal_fx.c | 139 ---- lib_dec/ivas_dirac_dec_fx.c | 60 -- lib_dec/ivas_dirac_output_synthesis_cov_fx.c | 51 +- lib_dec/ivas_ism_param_dec_fx.c | 4 - lib_dec/ivas_jbm_dec_fx.c | 4 - lib_dec/ivas_mc_param_dec_fx.c | 20 - lib_dec/ivas_mc_paramupmix_dec_fx.c | 33 - lib_dec/ivas_sba_rendering_internal_fx.c | 18 - lib_dec/ivas_spar_decoder_fx.c | 12 - lib_dec/ivas_stereo_cng_dec_fx.c | 17 - lib_dec/ivas_stereo_dft_dec_fx.c | 176 ----- lib_dec/ivas_stereo_icbwe_dec_fx.c | 9 - lib_dec/ivas_stereo_switching_dec_fx.c | 89 --- lib_dec/ivas_stereo_td_dec_fx.c | 21 - lib_dec/swb_tbe_dec_fx.c | 15 - lib_enc/acelp_core_switch_enc_fx.c | 17 - lib_enc/cng_enc_fx.c | 5 - lib_enc/dtx_fx.c | 4 - lib_enc/enc_gen_voic_fx.c | 17 - lib_enc/enc_ppp_fx.c | 8 - lib_enc/enc_tran_fx.c | 24 - lib_enc/eval_pit_contr_fx.c | 21 - lib_enc/igf_enc.c | 59 -- lib_enc/igf_enc_fx.c | 27 - lib_enc/init_enc_fx.c | 4 - lib_enc/ivas_init_enc_fx.c | 664 ------------------ lib_enc/ivas_mc_param_enc_fx.c | 248 ------- lib_enc/ivas_qmetadata_enc_fx.c | 16 - lib_enc/ivas_sce_enc_fx.c | 6 - lib_enc/ivas_sns_enc_fx.c | 4 - lib_enc/ivas_stereo_dmx_evs_fx.c | 18 - lib_enc/ivas_stereo_icbwe_enc_fx.c | 8 - lib_enc/lib_enc_fx.c | 414 ----------- lib_enc/speech_music_classif_fx.c | 4 - lib_enc/stat_enc.h | 4 - lib_enc/swb_pre_proc_fx.c | 4 - lib_enc/swb_tbe_enc_fx.c | 34 - lib_enc/tcx_utils_enc_fx.c | 20 - lib_enc/transition_enc_fx.c | 4 - lib_rend/ivas_dirac_ana_fx.c | 4 - .../ivas_dirac_dec_binaural_functions_fx.c | 171 ----- lib_rend/ivas_dirac_output_synthesis_dec_fx.c | 165 ----- lib_rend/ivas_dirac_rend_fx.c | 12 - lib_rend/ivas_efap_fx.c | 21 - lib_rend/ivas_omasa_ana_fx.c | 5 - lib_rend/ivas_reverb_fx.c | 41 -- lib_rend/ivas_sba_rendering_fx.c | 58 -- lib_rend/lib_rend_fx.c | 8 - 72 files changed, 5 insertions(+), 4204 deletions(-) diff --git a/lib_com/basop_util.c b/lib_com/basop_util.c index 3d6324783..7903d3580 100644 --- a/lib_com/basop_util.c +++ b/lib_com/basop_util.c @@ -1062,7 +1062,6 @@ Word32 BASOP_Util_Divide3232_Scale_cadence( Word32 x, Word32 y, Word16 *s ) return z; } -#ifdef DIV32_OPT_NEWTON Word32 div_w_newton( Word32 num, Word32 den ); /* Table of 256 precalculated estimates to be used by the "div_w_newton" @@ -1462,7 +1461,6 @@ Word32 BASOP_Util_Divide3232_Scale_newton( Word32 x, Word32 y, Word16 *s ) return z; } -#endif /* DIV32_OPT_NEWTON */ Word16 BASOP_Util_Divide3232_Scale( Word32 x, Word32 y, Word16 *s ) { diff --git a/lib_com/basop_util.h b/lib_com/basop_util.h index b1d4b5fc1..b5c69e1dd 100644 --- a/lib_com/basop_util.h +++ b/lib_com/basop_util.h @@ -333,11 +333,9 @@ Word32 BASOP_Util_Divide3232_Scale_cadence( Word32 x, /*!< i : Numerator*/ Word16 *s ); /*!< o : Additional scalefactor difference*/ -#ifdef DIV32_OPT_NEWTON Word32 BASOP_Util_Divide3232_Scale_newton( Word32 x, /*!< i : Numerator*/ Word32 y, /*!< i : Denominator*/ Word16 *s ); /*!< o : Additional scalefactor difference*/ -#endif /************************************************************************/ diff --git a/lib_com/bitstream_fx.c b/lib_com/bitstream_fx.c index 2b66f92cd..02b0a8fa1 100644 --- a/lib_com/bitstream_fx.c +++ b/lib_com/bitstream_fx.c @@ -242,130 +242,6 @@ Word16 rate2EVSmode( * * Push a new indice into the buffer *-------------------------------------------------------------------*/ -#ifndef HARM_PUSH_BIT -void push_indice_fx( - BSTR_ENC_HANDLE hBstr, /* i/o: encoder state structure */ - Word16 id, /* i : ID of the indice */ - UWord16 value, /* i : value of the quantized indice */ - Word16 nb_bits /* i : number of bits used to quantize the indice */ -) -{ - Word16 i; - - - IF( EQ_16( hBstr->last_ind_fx, id ) ) - { - /* indice with the same name as the previous one */ - i = hBstr->next_ind_fx; - move16(); - } - ELSE - { - /* new indice - find an empty slot in the list */ - i = id; - move16(); - WHILE( hBstr->ind_list[i].nb_bits != -1 ) - { - i = add( i, 1 ); - } - } - - /* store the values in the list */ - hBstr->ind_list[i].value = value; - move16(); - hBstr->ind_list[i].nb_bits = nb_bits; - move16(); - - /* updates */ - hBstr->next_ind_fx = add( i, 1 ); - move16(); - hBstr->last_ind_fx = id; - move16(); - hBstr->nb_bits_tot = add( hBstr->nb_bits_tot, nb_bits ); - move16(); - - return; -} -/*-------------------------------------------------------------------* - * push_next_indice() * - * Push a new indice into the buffer at the next position - *-------------------------------------------------------------------*/ - -void push_next_indice_fx( - BSTR_ENC_HANDLE hBstr, /* i/o: encoder state structure */ - UWord16 value, /* i : value of the quantized indice */ - Word16 nb_bits /* i : number of bits used to quantize the indice */ -) -{ - - /* store the values in the list */ - hBstr->ind_list[hBstr->next_ind_fx].value = value; - move16(); - hBstr->ind_list[hBstr->next_ind_fx].nb_bits = nb_bits; - move16(); - hBstr->next_ind_fx = add( hBstr->next_ind_fx, 1 ); - move16(); - - /* update the total number of bits already written */ - hBstr->nb_bits_tot = add( hBstr->nb_bits_tot, nb_bits ); - move16(); - - return; -} - - -/*-------------------------------------------------------------------* - * push_next_bits() - * Push a bit buffer into the buffer at the next position - *-------------------------------------------------------------------*/ - -void push_next_bits_fx( - BSTR_ENC_HANDLE hBstr, /* i/o: encoder state structure */ - Word16 bits[], /* i : bit buffer to pack, sequence of single bits */ - Word16 nb_bits /* i : number of bits to pack */ -) -{ - UWord16 code; - Word16 i, nb_bits_m15; - Indice *ptr; - - ptr = &hBstr->ind_list[hBstr->next_ind_fx]; - nb_bits_m15 = sub( nb_bits, 15 ); - i = 0; - move16(); - IF( nb_bits_m15 > 0 ) - { - FOR( ; i < nb_bits_m15; i += 16 ) - { - code = s_or( lshl( bits[i], 15 ), s_or( lshl( bits[i + 1], 14 ), s_or( lshl( bits[i + 2], 13 ), s_or( lshl( bits[i + 3], 12 ), - s_or( lshl( bits[i + 4], 11 ), s_or( lshl( bits[i + 5], 10 ), s_or( lshl( bits[i + 6], 9 ), s_or( lshl( bits[i + 7], 8 ), - s_or( lshl( bits[i + 8], 7 ), s_or( lshl( bits[i + 9], 6 ), s_or( lshl( bits[i + 10], 5 ), s_or( lshl( bits[i + 11], 4 ), - s_or( lshl( bits[i + 12], 3 ), s_or( lshl( bits[i + 13], 2 ), s_or( lshl( bits[i + 14], 1 ), bits[i + 15] ) ) ) ) ) ) ) ) ) ) ) ) ) ) ); - - ptr->value = code; - move16(); - ptr->nb_bits = 16; - move16(); - ++ptr; - } - } - IF( LT_16( i, nb_bits ) ) - { - FOR( ; i < nb_bits; ++i ) - { - ptr->value = bits[i]; - move16(); - ptr->nb_bits = 1; - move16(); - ++ptr; - } - } - hBstr->next_ind_fx = (Word16) ( ptr - hBstr->ind_list ); - move16(); - hBstr->nb_bits_tot = add( hBstr->nb_bits_tot, nb_bits ); - move16(); -} -#endif /*-------------------------------------------------------------------* * get_next_indice_fx( ) @@ -528,12 +404,6 @@ void reset_indices_enc_fx( move16(); hBstr->nb_bits_tot = 0; move16(); -#ifndef HARM_PUSH_BIT - hBstr->next_ind_fx = 0; - move16(); - hBstr->last_ind_fx = -1; - move16(); -#endif FOR( i = 0; i < max_num_indices; i++ ) { hBstr->ind_list[i].nb_bits = -1; @@ -564,215 +434,11 @@ void reset_indices_dec_fx( * * Write the buffer of indices to a file *-------------------------------------------------------------------*/ -#ifndef HARM_PUSH_BIT -void write_indices_fx( - Encoder_State *st_fx, /* i/o: encoder state structure */ - BSTR_ENC_HANDLE hBstr, /* i/o: encoder state structure */ - FILE *file /* i : output bitstream file */ - , - UWord8 *pFrame, /* i: byte array with bit packet and byte aligned coded speech data */ - Word16 pFrame_size /* i: size of the binary encoded access unit [bits] */ -) -{ - Word16 i, k; - Word16 stream[2 + MAX_BITS_PER_FRAME], *pt_stream; - Word32 mask; - UWord8 header; - Word16 isAmrWb = 0; - move16(); - - IF( st_fx->bitstreamformat == G192 ) - { - /*-----------------------------------------------------------------* - * Encode Sync Header and Frame Length - *-----------------------------------------------------------------*/ - pt_stream = stream; - FOR( i = 0; i < ( 2 + MAX_BITS_PER_FRAME ); ++i ) - { - stream[i] = 0; - move16(); - } - *pt_stream++ = SYNC_GOOD_FRAME; - move16(); - *pt_stream++ = hBstr->nb_bits_tot; - move16(); - - /*----------------------------------------------------------------* - * Bitstream packing (conversion of individual indices into a serial stream) - * Writing the serial stream into file - *----------------------------------------------------------------*/ - - FOR( i = 0; i < MAX_NUM_INDICES; i++ ) - { - IF( NE_16( hBstr->ind_list[i].nb_bits, -1 ) ) - { - /* mask from MSB to LSB */ - mask = L_shl( 1, sub( hBstr->ind_list[i].nb_bits, 1 ) ); - - /* write bit by bit */ - FOR( k = 0; k < hBstr->ind_list[i].nb_bits; k++ ) - { - IF( L_and( hBstr->ind_list[i].value, mask ) ) - { - *pt_stream++ = G192_BIN1; - move16(); - } - ELSE - { - *pt_stream++ = G192_BIN0; - move16(); - } - - mask = L_shr( mask, 1 ); - } - } - } - } - ELSE - { - /* Create and write ToC header */ - /* qbit always set to 1 on encoder side for AMRWBIO , no qbit in use for EVS, but set to 0(bad) */ - header = (UWord8) ( s_or( s_or( shl( st_fx->Opt_AMR_WB, 5 ), shl( st_fx->Opt_AMR_WB, 4 ) ), rate2EVSmode( L_mult0( hBstr->nb_bits_tot, 50 ), &isAmrWb ) ) ); - move16(); - fwrite( &header, sizeof( UWord8 ), 1, file ); - /* Write speech bits */ - fwrite( pFrame, sizeof( UWord8 ), shr( add( pFrame_size, 7 ), 3 ), file ); - } - - /* Clearing of indices */ - FOR( i = 0; i < MAX_NUM_INDICES; i++ ) - { - hBstr->ind_list[i].nb_bits = -1; - move16(); - } - - - IF( st_fx->bitstreamformat == G192 ) - { - /* write the serial stream into file */ - fwrite( stream, sizeof( unsigned short ), 2 + stream[1], file ); - } - /* reset index pointers */ - hBstr->nb_bits_tot = 0; - move16(); - hBstr->next_ind_fx = 0; - move16(); - hBstr->last_ind_fx = -1; - move16(); - - return; -} -#endif /*-------------------------------------------------------------------* * write_indices_buf_fx() * * Write the buffer of indices to a file *-------------------------------------------------------------------*/ -#ifndef HARM_PUSH_BIT -void write_indices_buf_fx( - Encoder_State *st_fx, /* i/o: encoder state structure */ - BSTR_ENC_HANDLE hBstr, /* i/o: encoder state structure */ - UWord16 *out_buf, /* i : output bitstream buf */ - UWord8 *pFrame, /* i: byte array with bit packet and byte aligned coded speech data */ - Word16 pFrame_size, /* i: size of the binary encoded access unit [bits] */ - UWord16 *num_bits ) -{ - Word16 i, k; - Word16 stream[2 + MAX_BITS_PER_FRAME], *pt_stream; - Word32 mask; - UWord8 header; - Word16 isAmrWb = 0; - - IF( st_fx->bitstreamformat == G192 ) - { - /*-----------------------------------------------------------------* - * Encode Sync Header and Frame Length - *-----------------------------------------------------------------*/ - pt_stream = stream; - FOR( i = 0; i < ( 2 + MAX_BITS_PER_FRAME ); ++i ) - { - stream[i] = 0; - move16(); - } - //*pt_stream++ = (Word16) SYNC_GOOD_FRAME; - //*pt_stream++ = hBstr->nb_bits_tot; - *num_bits = hBstr->nb_bits_tot; - move16(); - /*----------------------------------------------------------------* - * Bitstream packing (conversion of individual indices into a serial stream) - * Writing the serial stream into file - *----------------------------------------------------------------*/ - FOR( i = 0; i < MAX_NUM_INDICES; i++ ) - { - IF( NE_16( hBstr->ind_list[i].nb_bits, -1 ) ) - { - /* mask from MSB to LSB */ - mask = L_shl( 1, ( sub( hBstr->ind_list[i].nb_bits, 1 ) ) ); - - /* write bit by bit */ - FOR( k = 0; k < hBstr->ind_list[i].nb_bits; k++ ) - { - IF( L_and( hBstr->ind_list[i].value, mask ) ) - { - //*pt_stream++ = G192_BIN1; - *pt_stream++ = 1; - move16(); - } - ELSE - { - //*pt_stream++ = G192_BIN0; - *pt_stream++ = 0; - move16(); - } - - mask = L_shr( mask, 1 ); - } - } - } - } - ELSE - { - /* Create and write ToC header */ - /* qbit always set to 1 on encoder side for AMRWBIO , no qbit in use for EVS, but set to 0(bad) */ - header = (UWord8) ( s_or( s_or( shl( st_fx->Opt_AMR_WB, 5 ), shl( st_fx->Opt_AMR_WB, 4 ) ), rate2EVSmode( i_mult( hBstr->nb_bits_tot, 50 ), &isAmrWb ) ) ); - // fwrite(&header, sizeof(UWord8), 1, file); - memcpy( out_buf, &header, sizeof( UWord8 ) ); - *num_bits += sizeof( UWord8 ); - /* Write speech bits */ - // fwrite(pFrame, sizeof(UWord8), (pFrame_size + 7) >> 3, file); - memcpy( out_buf, pFrame, sizeof( UWord8 ) * ( shr( add( pFrame_size, 7 ), 3 ) ) ); - *num_bits += sizeof( UWord8 ) * ( shr( ( add( pFrame_size, 7 ) ), 3 ) ); - } - - /* Clearing of indices */ - FOR( i = 0; i < MAX_NUM_INDICES; i++ ) - { - hBstr->ind_list[i].nb_bits = -1; - move16(); - } - - - IF( st_fx->bitstreamformat == G192 ) - { - /* write the serial stream into file */ - // fwrite(stream, sizeof(unsigned short), 2 + stream[1], file); - // FILE *ftemp = fopen( "./output/bitstreams/out.COD", "ab" ); - // fwrite( stream, sizeof( unsigned short ), 2 + stream[1], ftemp ); - // fclose( ftemp ); - memcpy( out_buf, stream, sizeof( unsigned short ) * ( *num_bits ) ); - //*num_bits += sizeof( unsigned short ) * ( 2 + stream[1] ); - } - /* reset index pointers */ - hBstr->nb_bits_tot = 0; - hBstr->next_ind_fx = 0; - hBstr->last_ind_fx = -1; - move16(); - move16(); - move16(); - - return; -} -#endif /*-------------------------------------------------------------------* * indices_to_serial() * diff --git a/lib_com/cldfb_fx.c b/lib_com/cldfb_fx.c index 6c29d2a57..edddcb272 100644 --- a/lib_com/cldfb_fx.c +++ b/lib_com/cldfb_fx.c @@ -508,13 +508,8 @@ void cldfbAnalysis_ts_fx( rr12_fx = L_sub( r1_fx, r2_fx ); // q -1 ri12_fx = L_negate( L_add( i1_fx, i2_fx ) ); // q - 1 /*cplxMult(&rBuffer[2*k],&rBuffer[2*k+1],rr12,ri12,rot_vctr_re[k],rot_vctr_im[k]);*/ -#ifdef OPT_AVOID_STATE_BUF_RESCALE rBuffer_fx[2 * k] = Msub_32_32( Mpy_32_32( rr12_fx, rot_vctr_re_fx[k] ), ri12_fx, rot_vctr_im_fx[k] ); // q - 3 rBuffer_fx[2 * k + 1] = Madd_32_32( Mpy_32_32( rr12_fx, rot_vctr_im_fx[k] ), ri12_fx, rot_vctr_re_fx[k] ); // q - 3 -#else /* OPT_AVOID_STATE_BUF_RESCALE */ - rBuffer_fx[2 * k] = L_sub( Mpy_32_32( rr12_fx, rot_vctr_re_fx[k] ), Mpy_32_32( ri12_fx, rot_vctr_im_fx[k] ) ); // q - 3 - rBuffer_fx[2 * k + 1] = L_add( Mpy_32_32( rr12_fx, rot_vctr_im_fx[k] ), Mpy_32_32( ri12_fx, rot_vctr_re_fx[k] ) ); // q - 3 -#endif /* OPT_AVOID_STATE_BUF_RESCALE */ move32(); move32(); @@ -522,13 +517,8 @@ void cldfbAnalysis_ts_fx( ir12_fx = L_add( r1_fx, r2_fx ); // q - 1 ii12_fx = L_sub( i1_fx, i2_fx ); // q - 1 /*cplxMult(&iBuffer[2*k],&iBuffer[2*k+1],ir12,ii12,rot_vctr_re[k],rot_vctr_im[k]);*/ -#ifdef OPT_AVOID_STATE_BUF_RESCALE iBuffer_fx[2 * k] = Msub_32_32( Mpy_32_32( ir12_fx, rot_vctr_re_fx[k] ), ii12_fx, rot_vctr_im_fx[k] ); // q - 3 iBuffer_fx[2 * k + 1] = Madd_32_32( Mpy_32_32( ir12_fx, rot_vctr_im_fx[k] ), ii12_fx, rot_vctr_re_fx[k] ); // q - 3 -#else /* OPT_AVOID_STATE_BUF_RESCALE */ - iBuffer_fx[2 * k] = L_sub( Mpy_32_32( ir12_fx, rot_vctr_re_fx[k] ), Mpy_32_32( ii12_fx, rot_vctr_im_fx[k] ) ); // q - 3 - iBuffer_fx[2 * k + 1] = L_add( Mpy_32_32( ir12_fx, rot_vctr_im_fx[k] ), Mpy_32_32( ii12_fx, rot_vctr_re_fx[k] ) ); // q - 3 -#endif /* OPT_AVOID_STATE_BUF_RESCALE */ move32(); move32(); } @@ -595,13 +585,8 @@ void cldfbAnalysis_ts_fx( rr12_fx = L_add( r1_fx, r2_fx ); // q - 1 ri12_fx = L_sub( i1_fx, i2_fx ); // q - 1 /*cplxMult(&rBuffer[2*k],&rBuffer[2*k+1],rr12,ri12,rot_vctr_re[k],rot_vctr_im[k]);*/ -#ifdef OPT_AVOID_STATE_BUF_RESCALE rBuffer_fx[2 * k] = Msub_32_32( Mpy_32_32( rr12_fx, rot_vctr_re_fx[k] ), ri12_fx, rot_vctr_im_fx[k] ); // q - 3 rBuffer_fx[2 * k + 1] = Madd_32_32( Mpy_32_32( rr12_fx, rot_vctr_im_fx[k] ), ri12_fx, rot_vctr_re_fx[k] ); // q - 3 -#else /* OPT_AVOID_STATE_BUF_RESCALE */ - rBuffer_fx[2 * k] = L_sub( Mpy_32_32( rr12_fx, rot_vctr_re_fx[k] ), Mpy_32_32( ri12_fx, rot_vctr_im_fx[k] ) ); // q - 3 - rBuffer_fx[2 * k + 1] = L_add( Mpy_32_32( rr12_fx, rot_vctr_im_fx[k] ), Mpy_32_32( ri12_fx, rot_vctr_re_fx[k] ) ); // q - 3 -#endif /* OPT_AVOID_STATE_BUF_RESCALE */ move32(); move32(); @@ -609,13 +594,8 @@ void cldfbAnalysis_ts_fx( ir12_fx = L_sub( r1_fx, r2_fx ); // q - 1 ii12_fx = L_add( i1_fx, i2_fx ); // q - 1 /*cplxMult(&iBuffer[2*k],&iBuffer[2*k+1],ir12,ii12,rot_vctr_re[k],rot_vctr_im[k]);*/ -#ifdef OPT_AVOID_STATE_BUF_RESCALE iBuffer_fx[2 * k] = Msub_32_32( Mpy_32_32( ir12_fx, rot_vctr_re_fx[k] ), ii12_fx, rot_vctr_im_fx[k] ); // q - 3 iBuffer_fx[2 * k + 1] = Madd_32_32( Mpy_32_32( ir12_fx, rot_vctr_im_fx[k] ), ii12_fx, rot_vctr_re_fx[k] ); // q - 3 -#else /* OPT_AVOID_STATE_BUF_RESCALE */ - iBuffer_fx[2 * k] = L_sub( Mpy_32_32( ir12_fx, rot_vctr_re_fx[k] ), Mpy_32_32( ii12_fx, rot_vctr_im_fx[k] ) ); // q - 3 - iBuffer_fx[2 * k + 1] = L_add( Mpy_32_32( ir12_fx, rot_vctr_im_fx[k] ), Mpy_32_32( ii12_fx, rot_vctr_re_fx[k] ) ); // q - 3 -#endif /* OPT_AVOID_STATE_BUF_RESCALE */ move32(); move32(); } @@ -640,22 +620,6 @@ void cldfbAnalysis_ts_fx( } fft_cldfb_fx( rBuffer_fx, M2 ); -#ifndef FIX_1733_CLDFB_BUG - /* post modulation of DST IV */ - FOR( k = 0; k < M2; k++ ) - { - /*cplxMult(&realBuffer[M1-1-(2*k)],&realBuffer[2*k],rBuffer[2*k],rBuffer[2*k+1],rot_vctr_re[k],rot_vctr_im[k]);*/ -#ifdef OPT_AVOID_STATE_BUF_RESCALE - realBuffer_fx[( ( M1 - 1 ) - ( k * 2 ) )] = Msub_32_32( Mpy_32_32( rBuffer_fx[2 * k], rot_vctr_re_fx[k] ), rBuffer_fx[2 * k + 1], rot_vctr_im_fx[k] ); // q - 5 - realBuffer_fx[2 * k] = Madd_32_32( Mpy_32_32( rBuffer_fx[2 * k], rot_vctr_im_fx[k] ), rBuffer_fx[2 * k + 1], rot_vctr_re_fx[k] ); // q - 5 -#else /* OPT_AVOID_STATE_BUF_RESCALE */ - realBuffer_fx[( ( M1 - 1 ) - ( k * 2 ) )] = L_sub( Mpy_32_32( rBuffer_fx[2 * k], rot_vctr_re_fx[k] ), Mpy_32_32( rBuffer_fx[2 * k + 1], rot_vctr_im_fx[k] ) ); // q - 5 - realBuffer_fx[2 * k] = L_add( Mpy_32_32( rBuffer_fx[2 * k], rot_vctr_im_fx[k] ), Mpy_32_32( rBuffer_fx[2 * k + 1], rot_vctr_re_fx[k] ) ); // q - 5 -#endif /* OPT_AVOID_STATE_BUF_RESCALE */ - move32(); - move32(); - } -#endif *q_cldfb = sub( *q_cldfb, 2 ); move16(); @@ -676,35 +640,23 @@ void cldfbAnalysis_ts_fx( move32(); } -#ifdef FIX_1733_CLDFB_BUG /* post modulation of DST IV */ FOR( k = 0; k < M2; k++ ) { /*cplxMult(&realBuffer[M1-1-(2*k)],&realBuffer[2*k],rBuffer[2*k],rBuffer[2*k+1],rot_vctr_re[k],rot_vctr_im[k]);*/ -#ifdef OPT_AVOID_STATE_BUF_RESCALE realBuffer_fx[( ( M1 - 1 ) - ( k * 2 ) )] = Msub_32_32( Mpy_32_32( rBuffer_fx[2 * k], rot_vctr_re_fx[k] ), rBuffer_fx[2 * k + 1], rot_vctr_im_fx[k] ); // q - 5 realBuffer_fx[2 * k] = Madd_32_32( Mpy_32_32( rBuffer_fx[2 * k], rot_vctr_im_fx[k] ), rBuffer_fx[2 * k + 1], rot_vctr_re_fx[k] ); // q - 5 -#else /* OPT_AVOID_STATE_BUF_RESCALE */ - realBuffer_fx[( ( M1 - 1 ) - ( k * 2 ) )] = L_sub( Mpy_32_32( rBuffer_fx[2 * k], rot_vctr_re_fx[k] ), Mpy_32_32( rBuffer_fx[2 * k + 1], rot_vctr_im_fx[k] ) ); // q - 5 - realBuffer_fx[2 * k] = L_add( Mpy_32_32( rBuffer_fx[2 * k], rot_vctr_im_fx[k] ), Mpy_32_32( rBuffer_fx[2 * k + 1], rot_vctr_re_fx[k] ) ); // q - 5 -#endif /* OPT_AVOID_STATE_BUF_RESCALE */ move32(); move32(); } -#endif /* post modulation of DCT IV */ FOR( k = 0; k < M2; k++ ) { /* do it inplace */ /*cplxMult(&imagBuffer[2*k],&imagBuffer[M1-1-(2*k)],iBuffer[2*k],iBuffer[2*k+1],rot_vctr_re[k],rot_vctr_im[k]);*/ -#ifdef OPT_AVOID_STATE_BUF_RESCALE imagBuffer_fx[2 * k] = Msub_32_32( Mpy_32_32( iBuffer_fx[2 * k], rot_vctr_re_fx[k] ), iBuffer_fx[2 * k + 1], rot_vctr_im_fx[k] ); // q - 5 imagBuffer_fx[( M1 - 1 ) - ( k * 2 )] = Madd_32_32( Mpy_32_32( iBuffer_fx[2 * k], rot_vctr_im_fx[k] ), iBuffer_fx[2 * k + 1], rot_vctr_re_fx[k] ); // q - 5 -#else /* OPT_AVOID_STATE_BUF_RESCALE */ - imagBuffer_fx[2 * k] = L_sub( Mpy_32_32( iBuffer_fx[2 * k], rot_vctr_re_fx[k] ), Mpy_32_32( iBuffer_fx[2 * k + 1], rot_vctr_im_fx[k] ) ); // q - 5 - imagBuffer_fx[( M1 - 1 ) - ( k * 2 )] = L_add( Mpy_32_32( iBuffer_fx[2 * k], rot_vctr_im_fx[k] ), Mpy_32_32( iBuffer_fx[2 * k + 1], rot_vctr_re_fx[k] ) ); // q - 5 -#endif /* OPT_AVOID_STATE_BUF_RESCALE */ move32(); move32(); } @@ -725,13 +677,8 @@ void cldfbAnalysis_ts_fx( /*cplxMult(&realBuffer[k], &imagBuffer[k], realBuffer[k], imagBuffer[k], rot_vctr_delay_re[k], rot_vctr_delay_im[k]);*/ /*realBuffer[k] = rBuffer[k]; imagBuffer[k] = iBuffer[k];*/ -#ifdef OPT_AVOID_STATE_BUF_RESCALE cplx_aux_fx = Msub_32_32( Mpy_32_32( realBuffer_fx[k], rot_vctr_delay_re_fx[k] ), imagBuffer_fx[k], rot_vctr_delay_im_fx[k] ); // q - 5 imagBuffer_fx[k] = Madd_32_32( Mpy_32_32( realBuffer_fx[k], rot_vctr_delay_im_fx[k] ), imagBuffer_fx[k], rot_vctr_delay_re_fx[k] ); // q - 5 -#else /* OPT_AVOID_STATE_BUF_RESCALE */ - cplx_aux_fx = L_sub( Mpy_32_32( realBuffer_fx[k], rot_vctr_delay_re_fx[k] ), Mpy_32_32( imagBuffer_fx[k], rot_vctr_delay_im_fx[k] ) ); // q - 5 - imagBuffer_fx[k] = L_add( Mpy_32_32( realBuffer_fx[k], rot_vctr_delay_im_fx[k] ), Mpy_32_32( imagBuffer_fx[k], rot_vctr_delay_re_fx[k] ) ); // q - 5 -#endif /* OPT_AVOID_STATE_BUF_RESCALE */ realBuffer_fx[k] = cplx_aux_fx; move32(); move32(); @@ -1436,9 +1383,7 @@ void cldfbSynthesis_ivas_fx( Word32 *timeOut_fx, /* o : output time domain samples Qx - 1*/ const Word16 samplesToProcess, /* i : number of processed samples */ const Word16 shift, /* i : scale for state buffer */ -#ifdef OPT_AVOID_STATE_BUF_RESCALE const Word16 out_shift, /* i : scale for output buffer */ -#endif /* OPT_AVOID_STATE_BUF_RESCALE */ HANDLE_CLDFB_FILTER_BANK h_cldfb /* i : filter bank state */ ) { @@ -1675,16 +1620,13 @@ void cldfbSynthesis_ivas_fx( } } -#ifdef OPT_AVOID_STATE_BUF_RESCALE IF( 0 == out_shift ) { -#endif /* OPT_AVOID_STATE_BUF_RESCALE */ FOR( i = 0; i < M1; i++ ) { ptr_time_out_fx[( M1 - 1 ) - i] = synthesisBuffer_fx[4 * L2 + M1 + i]; move32(); } -#ifdef OPT_AVOID_STATE_BUF_RESCALE } ELSE { @@ -1694,7 +1636,6 @@ void cldfbSynthesis_ivas_fx( move32(); } } -#endif /* OPT_AVOID_STATE_BUF_RESCALE */ ptr_time_out_fx += M1; diff --git a/lib_com/cnst.h b/lib_com/cnst.h index 17dbc31c4..6030b53bd 100644 --- a/lib_com/cnst.h +++ b/lib_com/cnst.h @@ -534,15 +534,7 @@ enum IND_STEREO_ICBWE_MSFLAG, IND_SHB_ENER_SF, IND_SHB_RES_GS, -#ifndef FIX_1486_IND_SHB_RES - IND_SHB_RES_GS1, - IND_SHB_RES_GS2, - IND_SHB_RES_GS3, - IND_SHB_RES_GS4, - IND_SHB_VF, -#else IND_SHB_VF = IND_SHB_RES_GS + 5, -#endif IND_SHB_LSF, IND_SHB_MIRROR = IND_SHB_LSF + 5, IND_SHB_GRID, diff --git a/lib_com/fft_fx.c b/lib_com/fft_fx.c index 40c978014..b1323e156 100644 --- a/lib_com/fft_fx.c +++ b/lib_com/fft_fx.c @@ -4725,7 +4725,6 @@ static void fft_len16( cmplx t[4]; cmplx y[16]; -#ifdef OPT_STEREO_32KBPS_V1 s[0] = x[0]; // Qx move64(); s[1] = x[4]; // Qx @@ -4734,16 +4733,6 @@ static void fft_len16( move64(); s[3] = x[12]; // Qx move64(); -#else /* OPT_STEREO_32KBPS_V1 */ - s[0] = CL_shr( x[0], SCALEFACTOR16 ); // Qx - move64(); - s[1] = CL_shr( x[4], SCALEFACTOR16 ); // Qx - move64(); - s[2] = CL_shr( x[8], SCALEFACTOR16 ); // Qx - move64(); - s[3] = CL_shr( x[12], SCALEFACTOR16 ); // Qx - move64(); -#endif /* OPT_STEREO_32KBPS_V1 */ t[0] = CL_add( s[0], s[2] ); move64(); @@ -4763,7 +4752,6 @@ static void fft_len16( y[3] = CL_add( t[1], t[3] ); move64(); -#ifdef OPT_STEREO_32KBPS_V1 s[0] = x[1]; // Qx move64(); s[1] = x[5]; // Qx @@ -4772,16 +4760,6 @@ static void fft_len16( move64(); s[3] = x[13]; // Qx move64(); -#else /* OPT_STEREO_32KBPS_V1 */ - s[0] = CL_shr( x[1], SCALEFACTOR16 ); // Qx - move64(); - s[1] = CL_shr( x[5], SCALEFACTOR16 ); // Qx - move64(); - s[2] = CL_shr( x[9], SCALEFACTOR16 ); // Qx - move64(); - s[3] = CL_shr( x[13], SCALEFACTOR16 ); // Qx - move64(); -#endif /* OPT_STEREO_32KBPS_V1 */ t[0] = CL_add( s[0], s[2] ); move64(); @@ -4801,7 +4779,6 @@ static void fft_len16( y[7] = CL_add( t[1], t[3] ); move64(); -#ifdef OPT_STEREO_32KBPS_V1 s[0] = x[2]; // Qx move64(); s[1] = x[6]; // Qx @@ -4810,16 +4787,6 @@ static void fft_len16( move64(); s[3] = x[14]; // Qx move64(); -#else /* OPT_STEREO_32KBPS_V1 */ - s[0] = CL_shr( x[2], SCALEFACTOR16 ); // Qx - move64(); - s[1] = CL_shr( x[6], SCALEFACTOR16 ); // Qx - move64(); - s[2] = CL_shr( x[10], SCALEFACTOR16 ); // Qx - move64(); - s[3] = CL_shr( x[14], SCALEFACTOR16 ); // Qx - move64(); -#endif /* OPT_STEREO_32KBPS_V1 */ t[0] = CL_add( s[0], s[2] ); move64(); @@ -4841,7 +4808,6 @@ static void fft_len16( y[11] = CL_add( t[1], t[3] ); move64(); -#ifdef OPT_STEREO_32KBPS_V1 s[0] = x[3]; // Qx move64(); s[1] = x[7]; // Qx @@ -4850,16 +4816,6 @@ static void fft_len16( move64(); s[3] = x[15]; // Qx move64(); -#else /* OPT_STEREO_32KBPS_V1 */ - s[0] = CL_shr( x[3], SCALEFACTOR16 ); // Qx - move64(); - s[1] = CL_shr( x[7], SCALEFACTOR16 ); // Qx - move64(); - s[2] = CL_shr( x[11], SCALEFACTOR16 ); // Qx - move64(); - s[3] = CL_shr( x[15], SCALEFACTOR16 ); // Qx - move64(); -#endif /* OPT_STEREO_32KBPS_V1 */ t[0] = CL_add( s[0], s[2] ); move64(); @@ -5020,7 +4976,6 @@ static void fft_len20_fx( cmplx tt[4]; cmplx y[20]; -#ifdef OPT_STEREO_32KBPS_V1 xx[0] = x[0]; // Qx move64(); xx[1] = x[16]; // Qx @@ -5031,18 +4986,6 @@ static void fft_len20_fx( move64(); xx[4] = x[4]; // Qx move64(); -#else /* OPT_STEREO_32KBPS_V1 */ - xx[0] = CL_shr( x[0], SCALEFACTOR20 ); // Qx - move64(); - xx[1] = CL_shr( x[16], SCALEFACTOR20 ); // Qx - move64(); - xx[2] = CL_shr( x[12], SCALEFACTOR20 ); // Qx - move64(); - xx[3] = CL_shr( x[8], SCALEFACTOR20 ); // Qx - move64(); - xx[4] = CL_shr( x[4], SCALEFACTOR20 ); // Qx - move64(); -#endif /* OPT_STEREO_32KBPS_V1 */ s[0] = CL_add( xx[1], xx[4] ); move64(); @@ -5078,7 +5021,6 @@ static void fft_len20_fx( y[12] = CL_msu_j( s[2], s[3] ); move64(); -#ifdef OPT_STEREO_32KBPS_V1 xx[0] = x[5]; move64(); xx[1] = x[1]; @@ -5089,18 +5031,6 @@ static void fft_len20_fx( move64(); xx[4] = x[9]; move64(); -#else /* OPT_STEREO_32KBPS_V1 */ - xx[0] = CL_shr( x[5], SCALEFACTOR20 ); - move64(); - xx[1] = CL_shr( x[1], SCALEFACTOR20 ); - move64(); - xx[2] = CL_shr( x[17], SCALEFACTOR20 ); - move64(); - xx[3] = CL_shr( x[13], SCALEFACTOR20 ); - move64(); - xx[4] = CL_shr( x[9], SCALEFACTOR20 ); - move64(); -#endif /* OPT_STEREO_32KBPS_V1 */ s[0] = CL_add( xx[1], xx[4] ); move64(); @@ -5136,7 +5066,6 @@ static void fft_len20_fx( y[13] = CL_msu_j( s[2], s[3] ); move64(); -#ifdef OPT_STEREO_32KBPS_V1 xx[0] = x[10]; move64(); xx[1] = x[6]; @@ -5147,18 +5076,6 @@ static void fft_len20_fx( move64(); xx[4] = x[14]; move64(); -#else /* OPT_STEREO_32KBPS_V1 */ - xx[0] = CL_shr( x[10], SCALEFACTOR20 ); - move64(); - xx[1] = CL_shr( x[6], SCALEFACTOR20 ); - move64(); - xx[2] = CL_shr( x[2], SCALEFACTOR20 ); - move64(); - xx[3] = CL_shr( x[18], SCALEFACTOR20 ); - move64(); - xx[4] = CL_shr( x[14], SCALEFACTOR20 ); - move64(); -#endif /* OPT_STEREO_32KBPS_V1 */ s[0] = CL_add( xx[1], xx[4] ); move64(); @@ -5194,7 +5111,6 @@ static void fft_len20_fx( y[14] = CL_msu_j( s[2], s[3] ); move64(); -#ifdef OPT_STEREO_32KBPS_V1 xx[0] = x[15]; move64(); xx[1] = x[11]; @@ -5205,18 +5121,6 @@ static void fft_len20_fx( move64(); xx[4] = x[19]; move64(); -#else /* OPT_STEREO_32KBPS_V1 */ - xx[0] = CL_shr( x[15], SCALEFACTOR20 ); - move64(); - xx[1] = CL_shr( x[11], SCALEFACTOR20 ); - move64(); - xx[2] = CL_shr( x[7], SCALEFACTOR20 ); - move64(); - xx[3] = CL_shr( x[3], SCALEFACTOR20 ); - move64(); - xx[4] = CL_shr( x[19], SCALEFACTOR20 ); - move64(); -#endif /* OPT_STEREO_32KBPS_V1 */ s[0] = CL_add( xx[1], xx[4] ); move64(); @@ -6595,7 +6499,6 @@ static void fft_lenN( cmplx s[8]; cmplx y[8]; -#ifdef OPT_STEREO_32KBPS_V1 y[1] = xx[1 * dim1]; move64(); y[2] = xx[2 * dim1]; @@ -6827,288 +6730,6 @@ static void fft_lenN( move64(); } } -#else /* OPT_STEREO_32KBPS_V1 */ - test(); - test(); - test(); - test(); - IF( EQ_16( dim1, 30 ) || EQ_16( dim1, 20 ) || EQ_16( dim1, 15 ) || EQ_16( dim1, 10 ) || EQ_16( dim1, 5 ) ) - { - FOR( i = 0; i < dim1; i++ ) - { - { - y[0] = xx[i]; // y[0] = xx[i + 0 * dim1] - move64(); - }; - IF( i == 0 ) - { - { - y[1] = xx[( i + ( 1 * dim1 ) )]; - move64(); - }; - { - y[2] = xx[( i + ( 2 * dim1 ) )]; - move64(); - }; - { - y[3] = xx[( i + ( 3 * dim1 ) )]; - move64(); - }; - { - y[4] = xx[( i + ( 4 * dim1 ) )]; - move64(); - }; - { - y[5] = xx[( i + ( 5 * dim1 ) )]; - move64(); - }; - { - y[6] = xx[( i + ( 6 * dim1 ) )]; - move64(); - }; - { - y[7] = xx[( i + ( 7 * dim1 ) )]; - move64(); - }; - } - ELSE - { - { - y[1] = CL_mac_j( CL_scale( xx[( i + ( 1 * dim1 ) )], W[( ( ( sc * i ) + ( ( ( sc * 1 ) * dim1 ) << 1 ) ) - Woff )] ), - CL_scale( xx[( i + ( 1 * dim1 ) )], W[( ( ( ( sc * i ) + ( ( ( sc * 1 ) * dim1 ) << 1 ) ) + 1 ) - Woff )] ) ); // Qx - move64(); - }; - { - y[2] = CL_mac_j( CL_scale( xx[( i + ( 2 * dim1 ) )], W[( ( ( sc * i ) + ( ( ( sc * 2 ) * dim1 ) << 1 ) ) - Woff )] ), - CL_scale( xx[( i + ( 2 * dim1 ) )], W[( ( ( ( sc * i ) + ( ( ( sc * 2 ) * dim1 ) << 1 ) ) + 1 ) - Woff )] ) ); // Qx - move64(); - }; - { - y[3] = CL_mac_j( CL_scale( xx[( i + ( 3 * dim1 ) )], W[( ( ( sc * i ) + ( ( ( sc * 3 ) * dim1 ) << 1 ) ) - Woff )] ), - CL_scale( xx[( i + ( 3 * dim1 ) )], W[( ( ( ( sc * i ) + ( ( ( sc * 3 ) * dim1 ) << 1 ) ) + 1 ) - Woff )] ) ); // Qx - move64(); - }; - { - y[4] = CL_mac_j( CL_scale( xx[( i + ( 4 * dim1 ) )], W[( ( ( sc * i ) + ( ( ( sc * 4 ) * dim1 ) << 1 ) ) - Woff )] ), - CL_scale( xx[( i + ( 4 * dim1 ) )], W[( ( ( ( sc * i ) + ( ( ( sc * 4 ) * dim1 ) << 1 ) ) + 1 ) - Woff )] ) ); // Qx - move64(); - }; - { - y[5] = CL_mac_j( CL_scale( xx[( i + ( 5 * dim1 ) )], W[( ( ( sc * i ) + ( ( ( sc * 5 ) * dim1 ) << 1 ) ) - Woff )] ), - CL_scale( xx[( i + ( 5 * dim1 ) )], W[( ( ( ( sc * i ) + ( ( ( sc * 5 ) * dim1 ) << 1 ) ) + 1 ) - Woff )] ) ); // Qx - move64(); - }; - { - y[6] = CL_mac_j( CL_scale( xx[( i + ( 6 * dim1 ) )], W[( ( ( sc * i ) + ( ( ( sc * 6 ) * dim1 ) << 1 ) ) - Woff )] ), - CL_scale( xx[( i + ( 6 * dim1 ) )], W[( ( ( ( sc * i ) + ( ( ( sc * 6 ) * dim1 ) << 1 ) ) + 1 ) - Woff )] ) ); // Qx - move64(); - }; - { - y[7] = CL_mac_j( CL_scale( xx[( i + ( 7 * dim1 ) )], W[( ( ( sc * i ) + ( ( ( sc * 7 ) * dim1 ) << 1 ) ) - Woff )] ), - CL_scale( xx[( i + ( 7 * dim1 ) )], W[( ( ( ( sc * i ) + ( ( ( sc * 7 ) * dim1 ) << 1 ) ) + 1 ) - Woff )] ) ); // Qx - move64(); - }; - } - - t[0] = CL_add( y[0], y[4] ); - move64(); - t[1] = CL_sub( y[0], y[4] ); - move64(); - t[2] = CL_add( y[1], y[5] ); - move64(); - t[3] = CL_sub( y[1], y[5] ); - move64(); - t[4] = CL_add( y[2], y[6] ); - move64(); - t[5] = CL_sub( y[2], y[6] ); - move64(); - t[6] = CL_add( y[3], y[7] ); - move64(); - t[7] = CL_sub( y[3], y[7] ); - move64(); - - s[0] = CL_add( t[0], t[4] ); - move64(); - s[2] = CL_sub( t[0], t[4] ); - move64(); - s[4] = CL_mac_j( t[1], t[5] ); - move64(); - s[5] = CL_msu_j( t[1], t[5] ); - move64(); - s[1] = CL_add( t[2], t[6] ); - move64(); - s[3] = CL_swap_real_imag( CL_sub( CL_conjugate( t[2] ), CL_conjugate( t[6] ) ) ); - move64(); - - t[0] = CL_swap_real_imag( CL_add( t[3], t[7] ) ); - move64(); - t[1] = CL_sub( t[3], t[7] ); - move64(); - - s[6] = CL_scale( CL_add( CL_conjugate( t[0] ), t[1] ), FFT_C81 ); // Qx - move64(); - s[7] = CL_scale( CL_sub( t[0], CL_conjugate( t[1] ) ), FFT_C81 ); // Qx - move64(); - s[7] = CL_conjugate( s[7] ); - move64(); - - x[i] = CL_add( s[0], s[1] ); /*x[add(i + i_mult(0 , dim1)] = CL_add( s[0], s[1] )*/ - move64(); - x[( i + ( 1 * dim1 ) )] = CL_add( s[5], s[6] ); - move64(); - x[( i + ( 2 * dim1 ) )] = CL_sub( s[2], s[3] ); - move64(); - x[( i + ( 3 * dim1 ) )] = CL_add( s[4], s[7] ); - move64(); - x[( i + ( 4 * dim1 ) )] = CL_sub( s[0], s[1] ); - move64(); - x[( i + ( 5 * dim1 ) )] = CL_sub( s[5], s[6] ); - move64(); - x[( i + ( 6 * dim1 ) )] = CL_add( s[2], s[3] ); - move64(); - x[( i + ( 7 * dim1 ) )] = CL_sub( s[4], s[7] ); - move64(); - } - } - ELSE - { - FOR( i = 0; i < dim1; i++ ) - { - { - y[0] = xx[i]; /* y[0] = xx[i + 0 * dim1] */ - move64(); - }; - IF( i == 0 ) - { - { - y[1] = xx[( i + ( 1 * dim1 ) )]; - move64(); - }; - { - y[2] = xx[( i + ( 2 * dim1 ) )]; - move64(); - }; - { - y[3] = xx[( i + ( 3 * dim1 ) )]; - move64(); - }; - { - y[4] = xx[( i + ( 4 * dim1 ) )]; - move64(); - }; - { - y[5] = xx[( i + ( 5 * dim1 ) )]; - move64(); - }; - { - y[6] = xx[( i + ( 6 * dim1 ) )]; - move64(); - }; - { - y[7] = xx[( i + ( 7 * dim1 ) )]; - move64(); - }; - } - ELSE - { - { - y[1] = CL_mac_j( CL_scale( xx[( i + ( 1 * dim1 ) )], W[( ( ( sc * i ) + ( ( sc * 1 ) * dim1 ) ) - Woff )] ), - CL_scale( xx[( i + ( 1 * dim1 ) )], W[( ( ( ( sc * i ) + ( ( sc * 1 ) * dim1 ) ) + 1 ) - Woff )] ) ); // Qx - move64(); - }; - { - y[2] = CL_mac_j( CL_scale( xx[( i + ( 2 * dim1 ) )], W[( ( ( sc * i ) + ( ( sc * 2 ) * dim1 ) ) - Woff )] ), - CL_scale( xx[( i + ( 2 * dim1 ) )], W[( ( ( ( sc * i ) + ( ( sc * 2 ) * dim1 ) ) + 1 ) - Woff )] ) ); // Qx - move64(); - }; - { - y[3] = CL_mac_j( CL_scale( xx[( i + ( 3 * dim1 ) )], W[( ( ( sc * i ) + ( ( sc * 3 ) * dim1 ) ) - Woff )] ), - CL_scale( xx[( i + ( 3 * dim1 ) )], W[( ( ( ( sc * i ) + ( ( sc * 3 ) * dim1 ) ) + 1 ) - Woff )] ) ); // Qx - move64(); - }; - { - y[4] = CL_mac_j( CL_scale( xx[( i + ( 4 * dim1 ) )], W[( ( ( sc * i ) + ( ( sc * 4 ) * dim1 ) ) - Woff )] ), - CL_scale( xx[( i + ( 4 * dim1 ) )], W[( ( ( ( sc * i ) + ( ( sc * 4 ) * dim1 ) ) + 1 ) - Woff )] ) ); // Qx - move64(); - }; - { - y[5] = CL_mac_j( CL_scale( xx[( i + ( 5 * dim1 ) )], W[( ( ( sc * i ) + ( ( sc * 5 ) * dim1 ) ) - Woff )] ), - CL_scale( xx[( i + ( 5 * dim1 ) )], W[( ( ( ( sc * i ) + ( ( sc * 5 ) * dim1 ) ) + 1 ) - Woff )] ) ); // Qx - move64(); - }; - { - y[6] = CL_mac_j( CL_scale( xx[( i + ( 6 * dim1 ) )], W[( ( ( sc * i ) + ( ( sc * 6 ) * dim1 ) ) - Woff )] ), - CL_scale( xx[( i + ( 6 * dim1 ) )], W[( ( ( ( sc * i ) + ( ( sc * 6 ) * dim1 ) ) + 1 ) - Woff )] ) ); // Qx - move64(); - }; - { - y[7] = CL_mac_j( CL_scale( xx[( i + ( 7 * dim1 ) )], W[( ( ( sc * i ) + ( ( sc * 7 ) * dim1 ) ) - Woff )] ), - CL_scale( xx[( i + ( 7 * dim1 ) )], W[( ( ( ( sc * i ) + ( ( sc * 7 ) * dim1 ) ) + 1 ) - Woff )] ) ); // Qx - move64(); - }; - } - - t[0] = CL_add( y[0], y[4] ); - move64(); - t[1] = CL_sub( y[0], y[4] ); - move64(); - t[2] = CL_add( y[1], y[5] ); - move64(); - t[3] = CL_sub( y[1], y[5] ); - move64(); - t[4] = CL_add( y[2], y[6] ); - move64(); - t[5] = CL_sub( y[2], y[6] ); - move64(); - t[6] = CL_add( y[3], y[7] ); - move64(); - t[7] = CL_sub( y[3], y[7] ); - move64(); - - s[0] = CL_add( t[0], t[4] ); - move64(); - s[2] = CL_sub( t[0], t[4] ); - move64(); - s[4] = CL_mac_j( t[1], t[5] ); - move64(); - s[5] = CL_msu_j( t[1], t[5] ); - move64(); - s[1] = CL_add( t[2], t[6] ); - move64(); - s[3] = CL_swap_real_imag( CL_sub( CL_conjugate( t[2] ), CL_conjugate( t[6] ) ) ); - move64(); - - t[0] = CL_swap_real_imag( CL_add( t[3], t[7] ) ); - move64(); - t[1] = CL_sub( t[3], t[7] ); - move64(); - - s[6] = CL_scale( CL_add( CL_conjugate( t[0] ), t[1] ), FFT_C81 ); // Qx - move64(); - s[7] = CL_scale( CL_sub( t[0], CL_conjugate( t[1] ) ), FFT_C81 ); // Qx - move64(); - s[7] = CL_conjugate( s[7] ); - move64(); - - x[i] = CL_add( s[0], s[1] ); /*x[i + 0 * dim1] = CL_add( s[0], s[1] )*/ - move64(); - x[( i + ( 1 * dim1 ) )] = CL_add( s[5], s[6] ); - move64(); - x[( i + ( 2 * dim1 ) )] = CL_sub( s[2], s[3] ); - move64(); - x[( i + ( 3 * dim1 ) )] = CL_add( s[4], s[7] ); - move64(); - x[( i + ( 4 * dim1 ) )] = CL_sub( s[0], s[1] ); - move64(); - x[( i + ( 5 * dim1 ) )] = CL_sub( s[5], s[6] ); - move64(); - x[( i + ( 6 * dim1 ) )] = CL_add( s[2], s[3] ); - move64(); - x[( i + ( 7 * dim1 ) )] = CL_sub( s[4], s[7] ); - move64(); - } - } -#endif /* OPT_STEREO_32KBPS_V1 */ BREAK; } @@ -7501,11 +7122,7 @@ void rfft_fx( move32(); x[( length - ( i << 1 ) )] = Mpy_32_16_1( L_add( t1, t3 ), 16384 /*0.5.Q15*/ ); move32(); -#ifdef OPT_STEREO_32KBPS_V1 x[( ( length - ( i << 1 ) ) + 1 )] = Mpy_32_16_1( L_add( t2, t4 ), -16384 /*0.5.Q15*/ ); -#else /* OPT_STEREO_32KBPS_V1 */ - x[( ( length - ( i << 1 ) ) + 1 )] = Mpy_32_16_1( L_negate( L_add( t2, t4 ) ), 16384 /*0.5.Q15*/ ); -#endif /* OPT_STEREO_32KBPS_V1 */ move32(); } diff --git a/lib_com/hp50_fx.c b/lib_com/hp50_fx.c index f1864d7a7..4a055e073 100644 --- a/lib_com/hp50_fx.c +++ b/lib_com/hp50_fx.c @@ -532,11 +532,7 @@ void hp20_fx_32( move16(); } Qy1 = sub( Qy1, 34 ); -#ifdef OPT_STEREO_32KBPS_V1 R1 = W_mult0_32_32( W_shl_sat_l( y1_fx64, Qy1 ), a1_fx ); -#else /* OPT_STEREO_32KBPS_V1 */ - R1 = W_mult0_32_32( W_extract_l( W_shl( y1_fx64, Qy1 ) ), a1_fx ); -#endif /* OPT_STEREO_32KBPS_V1 */ Qy1 = add( Qy1, Qprev_y1 ); Qy2 = W_norm( y2_fx64 ); @@ -546,11 +542,7 @@ void hp20_fx_32( move16(); } Qy2 = sub( Qy2, 34 ); -#ifdef OPT_STEREO_32KBPS_V1 R2 = W_mult0_32_32( W_shl_sat_l( y2_fx64, Qy2 ), a2_fx ); -#else /* OPT_STEREO_32KBPS_V1 */ - R2 = W_mult0_32_32( W_extract_l( W_shl( y2_fx64, Qy2 ) ), a2_fx ); -#endif /* OPT_STEREO_32KBPS_V1 */ Qy2 = add( Qy2, Qprev_y2 ); Qx0 = W_norm( x0_fx64 ); @@ -560,11 +552,7 @@ void hp20_fx_32( move16(); } Qx0 = sub( Qx0, 34 ); -#ifdef OPT_STEREO_32KBPS_V1 R3 = W_mult0_32_32( W_shl_sat_l( x0_fx64, Qx0 ), b2_fx ); -#else /* OPT_STEREO_32KBPS_V1 */ - R3 = W_mult0_32_32( W_extract_l( W_shl( x0_fx64, Qx0 ) ), b2_fx ); -#endif /* OPT_STEREO_32KBPS_V1 */ Qx1 = W_norm( x1_fx64 ); if ( x1_fx64 == 0 ) @@ -573,11 +561,7 @@ void hp20_fx_32( move16(); } Qx1 = sub( Qx1, 34 ); -#ifdef OPT_STEREO_32KBPS_V1 R4 = W_mult0_32_32( W_shl_sat_l( x1_fx64, Qx1 ), b1_fx ); -#else /* OPT_STEREO_32KBPS_V1 */ - R4 = W_mult0_32_32( W_extract_l( W_shl( x1_fx64, Qx1 ) ), b1_fx ); -#endif /* OPT_STEREO_32KBPS_V1 */ Qx2 = W_norm( x2_fx64 ); if ( x2_fx64 == 0 ) @@ -586,11 +570,7 @@ void hp20_fx_32( move16(); } Qx2 = sub( Qx2, 34 ); -#ifdef OPT_STEREO_32KBPS_V1 R5 = W_mult0_32_32( W_shl_sat_l( x2_fx64, Qx2 ), b2_fx ); -#else /* OPT_STEREO_32KBPS_V1 */ - R5 = W_mult0_32_32( W_extract_l( W_shl( x2_fx64, Qx2 ) ), b2_fx ); -#endif /* OPT_STEREO_32KBPS_V1 */ Qmin = s_min( Qy1, Qy2 ); diff --git a/lib_com/ivas_prot_fx.h b/lib_com/ivas_prot_fx.h index 71d090a53..e35cf648c 100644 --- a/lib_com/ivas_prot_fx.h +++ b/lib_com/ivas_prot_fx.h @@ -4973,14 +4973,12 @@ void ivas_dirac_dec_get_response_fx( const Word16 ambisonics_order, Word16 Q_out ); -#ifdef FIX_1310_SPEEDUP_ivas_dirac_dec_get_response_fx /*This is a derivate to ivas_dirac_dec_get_response_fx with fixed Q_out=29*/ void ivas_dirac_dec_get_response_fx_29( const Word16 azimuth, const Word16 elevation, Word32 *response_fx, /*Q_out=29*/ const Word16 ambisonics_order ); -#endif void calculate_hodirac_sector_parameters_fx( DIRAC_ENC_HANDLE hDirAC, /* i : DirAC handle */ diff --git a/lib_com/ivas_rom_com_fx.c b/lib_com/ivas_rom_com_fx.c index e7ee30e8d..6bb2eaa10 100644 --- a/lib_com/ivas_rom_com_fx.c +++ b/lib_com/ivas_rom_com_fx.c @@ -1545,19 +1545,6 @@ const Word16 ivas_param_mc_quant_icc_fx[PARAM_MC_SZ_ICC_QUANTIZER] = { /* from 1 to 11 bits*/ /*q factor = 8*/ const Word32 no_phi_masa_inv_fx[NO_SPHERICAL_GRIDS][MAX_NO_THETA] = { -#ifndef FIX_1379_MASA_ANGLE_ROUND - { 1073741824 }, - { 536870912 }, - { 536870912, 1073741824 }, - { 268435456, 536870912 }, - { 178956970, 306783378, 1073741824, 2147483647 }, - { 153391689, 165191049, 238609294, 1073741824, 2147483647 }, - { 97612893, 102261126, 126322567, 195225786, 715827882, 2147483647 }, - { 65075262, 67108864, 74051160, 93368854, 126322567, 238609294, 2147483647 }, - { 44739242, 45691141, 47721858, 52377649, 61356675, 76695844, 107374182, 178956970, 1073741824, 2147483647 }, - { 35791394, 35791394, 37025580, 38347922, 39768215, 42949672, 46684427, 52377649, 59652323, 71582788, 93368854, 126322567, 214748364, 2147483647 }, - { 24129029, 24129029, 24403223, 24970740, 25565281, 26512143, 27889398, 29417584, 31580641, 34087042, 37675151, 42107522, 48806446, 56512727, 71582788, 93368854, 143165576, 268435456, 2147483647 } -#else { 1073741824 }, { 536870912 }, { 536870912, 1073741824 }, @@ -1569,7 +1556,6 @@ const Word32 no_phi_masa_inv_fx[NO_SPHERICAL_GRIDS][MAX_NO_THETA] = { { 44739243, 45691141, 47721859, 52377650, 61356676, 76695845, 107374182, 178956971, 1073741824, 2147483647 }, { 35791394, 35791394, 37025580, 38347922, 39768216, 42949673, 46684427, 52377650, 59652324, 71582788, 93368854, 126322568, 214748365, 2147483647 }, { 24129030, 24129030, 24403223, 24970740, 25565282, 26512144, 27889398, 29417584, 31580642, 34087042, 37675152, 42107523, 48806447, 56512728, 71582788, 93368854, 143165577, 268435456, 2147483647 }, -#endif }; diff --git a/lib_com/ivas_spar_com_fx.c b/lib_com/ivas_spar_com_fx.c index 15a529149..3805c9d36 100644 --- a/lib_com/ivas_spar_com_fx.c +++ b/lib_com/ivas_spar_com_fx.c @@ -7287,7 +7287,6 @@ void ivas_dirac_dec_get_response_fx( return; } -#ifdef FIX_1310_SPEEDUP_ivas_dirac_dec_get_response_fx /*This is a derivate to ivas_dirac_dec_get_response_fx with fixed Q_out=29*/ void ivas_dirac_dec_get_response_fx_29( const Word16 azimuth, @@ -7413,7 +7412,6 @@ void ivas_dirac_dec_get_response_fx_29( } return; } -#endif /*FIX_1310_SPEEDUP_ivas_dirac_dec_get_response_fx*/ /*-----------------------------------------------------------------------------------------* * Function ivas_get_bits_to_encode * diff --git a/lib_com/modif_fs_fx.c b/lib_com/modif_fs_fx.c index 2e39af523..a9b6581ed 100644 --- a/lib_com/modif_fs_fx.c +++ b/lib_com/modif_fs_fx.c @@ -1059,7 +1059,6 @@ void Decimate_allpass_steep_fx32( /* upper allpass filter chain */ FOR( k = 0; k < N / 2; k++ ) { -#ifdef OPT_STEREO_32KBPS_V1 temp[0] = Madd_32_16( mem[0], in[2 * k], AP1_STEEP_FX[0] ); // Qx move32(); mem[0] = Msub_32_16( in[2 * k], temp[0], AP1_STEEP_FX[0] ); // Qx @@ -1074,118 +1073,51 @@ void Decimate_allpass_steep_fx32( move32(); mem[ALLPASSSECTIONS_STEEP - 1] = Msub_32_16( temp[ALLPASSSECTIONS_STEEP - 2], out[k], AP1_STEEP_FX[ALLPASSSECTIONS_STEEP - 1] ); // Qx move32(); -#else /* OPT_STEREO_32KBPS_V1 */ - temp[0] = L_add( mem[0], Mpy_32_16_1( in[2 * k], AP1_STEEP_FX[0] ) ); // Qx - move32(); - mem[0] = L_sub( in[2 * k], Mpy_32_16_1( temp[0], AP1_STEEP_FX[0] ) ); // Qx - move32(); - - temp[1] = L_add( mem[1], Mpy_32_16_1( temp[0], AP1_STEEP_FX[1] ) ); // Qx - move32(); - mem[1] = L_sub( temp[0], Mpy_32_16_1( temp[1], AP1_STEEP_FX[1] ) ); // Qx - move32(); - - out[k] = L_add( mem[ALLPASSSECTIONS_STEEP - 1], Mpy_32_16_1( temp[ALLPASSSECTIONS_STEEP - 2], AP1_STEEP_FX[ALLPASSSECTIONS_STEEP - 1] ) ); // Qx - move32(); - mem[ALLPASSSECTIONS_STEEP - 1] = L_sub( temp[ALLPASSSECTIONS_STEEP - 2], Mpy_32_16_1( out[k], AP1_STEEP_FX[ALLPASSSECTIONS_STEEP - 1] ) ); // Qx - move32(); -#endif /* OPT_STEREO_32KBPS_V1 */ } /* lower allpass filter chain */ -#ifdef OPT_STEREO_32KBPS_V1 temp[0] = Madd_32_16( mem[ALLPASSSECTIONS_STEEP], mem[2 * ALLPASSSECTIONS_STEEP], AP2_STEEP_FX[0] ); // Qx move32(); mem[ALLPASSSECTIONS_STEEP] = Msub_32_16( mem[2 * ALLPASSSECTIONS_STEEP], temp[0], AP2_STEEP_FX[0] ); // Qx move32(); -#else /* OPT_STEREO_32KBPS_V1 */ - temp[0] = L_add( mem[ALLPASSSECTIONS_STEEP], Mpy_32_16_1( mem[2 * ALLPASSSECTIONS_STEEP], AP2_STEEP_FX[0] ) ); // Qx - move32(); - mem[ALLPASSSECTIONS_STEEP] = L_sub( mem[2 * ALLPASSSECTIONS_STEEP], Mpy_32_16_1( temp[0], AP2_STEEP_FX[0] ) ); // Qx - move32(); -#endif /* OPT_STEREO_32KBPS_V1 */ /* for better performance, unroll this loop */ FOR( n = 1; n < ALLPASSSECTIONS_STEEP - 1; n++ ) { -#ifdef OPT_STEREO_32KBPS_V1 temp[n] = Madd_32_16( mem[ALLPASSSECTIONS_STEEP + n], temp[n - 1], AP2_STEEP_FX[n] ); // Qx move32(); mem[ALLPASSSECTIONS_STEEP + 1] = Msub_32_16( temp[n - 1], temp[n], AP2_STEEP_FX[n] ); // Qx move32(); -#else /* OPT_STEREO_32KBPS_V1 */ - temp[n] = L_add( mem[ALLPASSSECTIONS_STEEP + n], Mpy_32_16_1( temp[n - 1], AP2_STEEP_FX[n] ) ); // Qx - move32(); - /*if ( fabs( temp[n] ) < 1e-12 ) - { - temp[n] = sign( temp[n] ) * 1e-12f; - }*/ - mem[ALLPASSSECTIONS_STEEP + 1] = L_sub( temp[n - 1], Mpy_32_16_1( temp[n], AP2_STEEP_FX[n] ) ); // Qx - move32(); -#endif /* OPT_STEREO_32KBPS_V1 */ } -#ifdef OPT_STEREO_32KBPS_V1 temp[ALLPASSSECTIONS_STEEP - 1] = Madd_32_16( mem[2 * ALLPASSSECTIONS_STEEP - 1], temp[ALLPASSSECTIONS_STEEP - 2], AP2_STEEP_FX[ALLPASSSECTIONS_STEEP - 1] ); // Qx move32(); mem[2 * ALLPASSSECTIONS_STEEP - 1] = Msub_32_16( temp[ALLPASSSECTIONS_STEEP - 2], temp[ALLPASSSECTIONS_STEEP - 1], AP2_STEEP_FX[ALLPASSSECTIONS_STEEP - 1] ); // Qx move32(); -#else /* OPT_STEREO_32KBPS_V1 */ - temp[ALLPASSSECTIONS_STEEP - 1] = L_add( mem[2 * ALLPASSSECTIONS_STEEP - 1], Mpy_32_16_1( temp[ALLPASSSECTIONS_STEEP - 2], AP2_STEEP_FX[ALLPASSSECTIONS_STEEP - 1] ) ); // Qx - move32(); - - mem[2 * ALLPASSSECTIONS_STEEP - 1] = L_sub( temp[ALLPASSSECTIONS_STEEP - 2], Mpy_32_16_1( temp[ALLPASSSECTIONS_STEEP - 1], AP2_STEEP_FX[ALLPASSSECTIONS_STEEP - 1] ) ); // Qx - move32(); -#endif /* OPT_STEREO_32KBPS_V1 */ out[0] = W_round48_L( W_mac_32_16( W_mult_32_16( out[0], 16384 /*0.5 in Q15*/ ), temp[ALLPASSSECTIONS_STEEP - 1], 16384 /*0.5 in Q15*/ ) ); // Qx move32(); FOR( k = 1; k < N / 2; k++ ) { -#ifdef OPT_STEREO_32KBPS_V1 temp[0] = Madd_32_16( mem[ALLPASSSECTIONS_STEEP], in[2 * k - 1], AP2_STEEP_FX[0] ); // Qx move32(); mem[ALLPASSSECTIONS_STEEP] = Msub_32_16( in[2 * k - 1], temp[0], AP2_STEEP_FX[0] ); // Qx move32(); -#else /* OPT_STEREO_32KBPS_V1 */ - temp[0] = L_add( mem[ALLPASSSECTIONS_STEEP], Mpy_32_16_1( in[sub( shl( k, 1 ), 1 )], AP2_STEEP_FX[0] ) ); // Qx - move32(); - mem[ALLPASSSECTIONS_STEEP] = L_sub( in[sub( shl( k, 1 ), 1 )], Mpy_32_16_1( temp[0], AP2_STEEP_FX[0] ) ); // Qx - move32(); -#endif /* OPT_STEREO_32KBPS_V1 */ /* for better performance, unroll this loop */ FOR( n = 1; n < ALLPASSSECTIONS_STEEP - 1; n++ ) { -#ifdef OPT_STEREO_32KBPS_V1 temp[n] = Madd_32_16( mem[ALLPASSSECTIONS_STEEP + n], temp[n - 1], AP2_STEEP_FX[n] ); // Qx move32(); mem[ALLPASSSECTIONS_STEEP + n] = Msub_32_16( temp[n - 1], temp[n], AP2_STEEP_FX[n] ); // Qx move32(); -#else /* OPT_STEREO_32KBPS_V1 */ - temp[n] = L_add( mem[ALLPASSSECTIONS_STEEP + n], Mpy_32_16_1( temp[n - 1], AP2_STEEP_FX[n] ) ); // Qx - move32(); - /*if ( fabs( temp[n] ) < 1e-12 ) - { - temp[n] = sign( temp[n] ) * 1e-12f; - }*/ - mem[ALLPASSSECTIONS_STEEP + n] = L_sub( temp[n - 1], Mpy_32_16_1( temp[n], AP2_STEEP_FX[n] ) ); // Qx - move32(); -#endif /* OPT_STEREO_32KBPS_V1 */ } -#ifdef OPT_STEREO_32KBPS_V1 temp[ALLPASSSECTIONS_STEEP - 1] = Madd_32_16( mem[2 * ALLPASSSECTIONS_STEEP - 1], temp[ALLPASSSECTIONS_STEEP - 2], AP2_STEEP_FX[ALLPASSSECTIONS_STEEP - 1] ); // Qx move32(); mem[2 * ALLPASSSECTIONS_STEEP - 1] = Msub_32_16( temp[ALLPASSSECTIONS_STEEP - 2], temp[ALLPASSSECTIONS_STEEP - 1], AP2_STEEP_FX[ALLPASSSECTIONS_STEEP - 1] ); // Qx move32(); -#else /* OPT_STEREO_32KBPS_V1 */ - temp[ALLPASSSECTIONS_STEEP - 1] = L_add( mem[2 * ALLPASSSECTIONS_STEEP - 1], Mpy_32_16_1( temp[ALLPASSSECTIONS_STEEP - 2], AP2_STEEP_FX[ALLPASSSECTIONS_STEEP - 1] ) ); // Qx - move32(); - mem[2 * ALLPASSSECTIONS_STEEP - 1] = L_sub( temp[ALLPASSSECTIONS_STEEP - 2], Mpy_32_16_1( temp[ALLPASSSECTIONS_STEEP - 1], AP2_STEEP_FX[ALLPASSSECTIONS_STEEP - 1] ) ); // Qx - move32(); -#endif /* OPT_STEREO_32KBPS_V1 */ out[k] = W_round48_L( W_mac_32_16( W_mult_32_16( out[k], 16384 /*0.5 in Q15*/ ), temp[ALLPASSSECTIONS_STEEP - 1], 16384 /*0.5 in Q15*/ ) ); // Qx move32(); } @@ -1487,21 +1419,12 @@ void interpolate_3_over_2_allpass_fx32( FOR( i = 0; i < len; i++ ) { /* Upper branch */ -#ifdef OPT_STEREO_32KBPS_V1 Vu[0] = Madd_32_16( mem[0], L_sub( input[i], mem[1] ), filt_coeff[0] ); // Qx + Q15 - Q15 -> Qx move32(); Vu[1] = Madd_32_16( mem[1], L_sub( Vu[0], mem[2] ), filt_coeff[1] ); // Qx + Q15 - Q15 -> Qx move32(); mem[3] = Madd_32_16( mem[2], L_sub( Vu[1], mem[3] ), filt_coeff[2] ); // Qx + Q15 - Q15 -> Qx move32(); -#else /* OPT_STEREO_32KBPS_V1 */ - Vu[0] = L_add( mem[0], Mpy_32_16_1( L_sub( input[i], mem[1] ), filt_coeff[0] ) ); // Qx + Q15 - Q15 -> Qx - move32(); - Vu[1] = L_add( mem[1], Mpy_32_16_1( L_sub( Vu[0], mem[2] ), filt_coeff[1] ) ); // Qx + Q15 - Q15 -> Qx - move32(); - mem[3] = L_add( mem[2], Mpy_32_16_1( L_sub( Vu[1], mem[3] ), filt_coeff[2] ) ); // Qx + Q15 - Q15 -> Qx - move32(); -#endif /* OPT_STEREO_32KBPS_V1 */ mem[1] = Vu[0]; // Qx move32(); @@ -1511,21 +1434,12 @@ void interpolate_3_over_2_allpass_fx32( move32(); /* Middle branch */ -#ifdef OPT_STEREO_32KBPS_V1 Vm[0] = Madd_32_16( mem[0], L_sub( input[i], mem[4] ), filt_coeff[3] ); // Qx + Q15 - Q15 -> Qx move32(); Vm[1] = Madd_32_16( mem[4], L_sub( Vm[0], mem[5] ), filt_coeff[4] ); // Qx + Q15 - Q15 -> Qx move32(); mem[6] = Madd_32_16( mem[5], L_sub( Vm[1], mem[6] ), filt_coeff[5] ); // Qx + Q15 - Q15 -> Qx move32(); -#else /* OPT_STEREO_32KBPS_V1 */ - Vm[0] = L_add( mem[0], Mpy_32_16_1( L_sub( input[i], mem[4] ), filt_coeff[3] ) ); // Qx + Q15 - Q15 -> Qx - move32(); - Vm[1] = L_add( mem[4], Mpy_32_16_1( L_sub( Vm[0], mem[5] ), filt_coeff[4] ) ); // Qx + Q15 - Q15 -> Qx - move32(); - mem[6] = L_add( mem[5], Mpy_32_16_1( L_sub( Vm[1], mem[6] ), filt_coeff[5] ) ); // Qx + Q15 - Q15 -> Qx - move32(); -#endif /* OPT_STEREO_32KBPS_V1 */ mem[4] = Vm[0]; // Qx move32(); @@ -1535,21 +1449,12 @@ void interpolate_3_over_2_allpass_fx32( move32(); /* Lower branch */ -#ifdef OPT_STEREO_32KBPS_V1 Vl[0] = Madd_32_16( mem[0], L_sub( input[i], mem[7] ), filt_coeff[6] ); // Qx + Q15 - Q15 -> Qx move32(); Vl[1] = Madd_32_16( mem[7], L_sub( Vl[0], mem[8] ), filt_coeff[7] ); // Qx + Q15 - Q15 -> Qx move32(); mem[9] = Madd_32_16( mem[8], L_sub( Vl[1], mem[9] ), filt_coeff[8] ); // Qx + Q15 - Q15 -> Qx move32(); -#else /* OPT_STEREO_32KBPS_V1 */ - Vl[0] = L_add( mem[0], Mpy_32_16_1( L_sub( input[i], mem[7] ), filt_coeff[6] ) ); // Qx + Q15 - Q15 -> Qx - move32(); - Vl[1] = L_add( mem[7], Mpy_32_16_1( L_sub( Vl[0], mem[8] ), filt_coeff[7] ) ); // Qx + Q15 - Q15 -> Qx - move32(); - mem[9] = L_add( mem[8], Mpy_32_16_1( L_sub( Vl[1], mem[9] ), filt_coeff[8] ) ); // Qx + Q15 - Q15 -> Qx - move32(); -#endif /* OPT_STEREO_32KBPS_V1 */ mem[0] = input[i]; // Qx move32(); @@ -1568,17 +1473,10 @@ void interpolate_3_over_2_allpass_fx32( { mem_temp = out1_buff[2 * i]; move32(); -#ifdef OPT_STEREO_32KBPS_V1 out[i] = Madd_32_16( Mpy_32_16_1( L_add( mem_temp, mem[10] ), 1550 ), L_add( mem[11], mem[14] ), -4965 ); // Qx + Q15 - Q15 -> Qx // 0.0473147f in Q15 -> 1550, -0.151521f in Q15 -> -4965 out[i] = Madd_32_16( out[i], L_add( mem[12], mem[13] ), 20125 ); // 0.614152f in Q15 -> 20125 -#else /* OPT_STEREO_32KBPS_V1 */ - out[i] = L_add( Mpy_32_16_1( L_add( mem_temp, mem[10] ), 1550 ), Mpy_32_16_1( L_add( mem[11], mem[14] ), -4965 ) ); // Qx + Q15 - Q15 -> Qx - // 0.0473147f in Q15 -> 1550, -0.151521f in Q15 -> -4965 - out[i] = L_add( out[i], Mpy_32_16_1( L_add( mem[12], mem[13] ), 20125 ) ); - // 0.614152f in Q15 -> 20125 -#endif /* OPT_STEREO_32KBPS_V1 */ mem[10] = mem[11]; // Qx move32(); mem[11] = mem[12]; // Qx diff --git a/lib_com/mslvq_com_fx.c b/lib_com/mslvq_com_fx.c index 8d5e8adf2..bbca86159 100644 --- a/lib_com/mslvq_com_fx.c +++ b/lib_com/mslvq_com_fx.c @@ -126,13 +126,10 @@ void init_lvq_fx( ) { Word16 i, j; -#ifdef OPT_STEREO_32KBPS_V1 Word16 k; -#endif /* OPT_STEREO_32KBPS_V1 */ /* safety-net mode */ FOR( i = 0; i < MAX_NO_MODES; i++ ) { -#ifdef OPT_STEREO_32KBPS_V1 FOR( ( j = 0, k = 0 ); j < MAX_NO_SCALES; j++ ) { if ( no_lead_fx[i][j] > 0 ) @@ -162,31 +159,10 @@ void init_lvq_fx( } no_scales[i][1] = k; move16(); -#else /* OPT_STEREO_32KBPS_V1 */ - j = 0; - move16(); - test(); - WHILE( ( LT_16( j, MAX_NO_SCALES ) ) && ( no_lead_fx[i][j] > 0 ) ) - { - j++; - } - no_scales[i][0] = j; - move16(); - j = MAX_NO_SCALES; - move16(); - test(); - WHILE( ( LT_16( j, shl( MAX_NO_SCALES, 1 ) ) ) && ( no_lead_fx[i][j] > 0 ) ) - { - j++; - } - no_scales[i][1] = sub( j, MAX_NO_SCALES ); - move16(); -#endif /* OPT_STEREO_32KBPS_V1 */ } /* predictive mode */ FOR( i = 0; i < MAX_NO_MODES_p; i++ ) { -#ifdef OPT_STEREO_32KBPS_V1 FOR( ( j = 0, k = 0 ); j < MAX_NO_SCALES; j++ ) { if ( no_lead_p_fx[i][j] > 0 ) @@ -218,26 +194,6 @@ void init_lvq_fx( no_scales_p[i][1] = k; move16(); -#else /* OPT_STEREO_32KBPS_V1 */ - j = 0; - move16(); - WHILE( ( LT_16( j, MAX_NO_SCALES ) ) && ( no_lead_p_fx[i][j] > 0 ) ) - { - test(); - j++; - } - no_scales_p[i][0] = j; - move16(); - j = MAX_NO_SCALES; - move16(); - WHILE( ( LT_16( j, shl( MAX_NO_SCALES, 1 ) ) ) && ( no_lead_p_fx[i][j] > 0 ) ) - { - test(); - j++; - } - no_scales_p[i][1] = sub( j, MAX_NO_SCALES ); - move16(); -#endif /* OPT_STEREO_32KBPS_V1 */ } /* index offsets for each truncation */ init_offset_fx( offset_scale1, offset_scale2, offset_scale1_p, offset_scale2_p, no_scales, no_scales_p ); diff --git a/lib_com/options.h b/lib_com/options.h index 1cd99a80c..5f33170bf 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -74,9 +74,7 @@ #define FIX_1737_FIX_867_CLDFB_NRG_SCALE #define FIX_1737_proto_fac_overflow -#define FIX_1378_ACELP_OUT_OF_BOUNDS -#define FIX_1379_MASA_ANGLE_ROUND /* Note: each compile switch (FIX_1101_...) is independent from the other ones */ #define OPT_MCT_ENC_V1_NBE @@ -85,41 +83,16 @@ #define OPT_SBA_DEC_V2_BE #define OPT_SBA_ENC_V2_BE #define OPT_SBA_ENC_V1_BE -#define OPT_BIN_RENDERER_V1 -#define OPT_BIN_RENDERER_V2 -#define OPT_STEREO_32KBPS_V1 /* Optimization made in stereo decoding path for 32kbps decoding */ -#define OPT_AVOID_STATE_BUF_RESCALE /* Optimization made to avoid rescale of synth state buffer */ #define OPT_SBA_DEC_PATH /* Optimization made in SBA decoding path */ #define OPT_IVAS_FILTER_ROM /* Optimization made in IVAS filter table */ -#define FIX_1310_SPEEDUP_ivas_dirac_dec_get_response_fx /*FhG: WMOPS tuning, nonbe*/ -#define FIX_1310_SPEEDUP_ivas_dirac_dec_output_synthesis_process_slot /*FhG: WMOPS tuning, nonbe*/ /* Both following 2 macros (IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST*) are independent from each other, they refer to different code blocks */ -#define IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST_BE /* FhG: reduces WMOPS of param_mc_prm_est, bit-exact to previous version */ //#define IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST_NONBE /* FhG: reduces WMOPS of param_mc_prm_est, not bit-exact to previous version. Obsoleted by MERGE_REQUEST_1378_SPEEDUP_ivas_mc_param_enc_fx_NONBE. */ -#define HARM_PUSH_BIT -#define HARM_ENC_INIT //#define HARM_SCE_INIT -#define DIV32_OPT_NEWTON /* FhG: faster 32 by 32 bit division */ -#define MERGE_REQUEST_1378_SPEEDUP_ivas_mc_param_enc_fx_NONBE /* FhG: reduce WMOPS of Cy calculation in ivas_param_mc_param_est_enc_fx() by using 64 Bit addition. Obsoletes IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST_NONBE. */ #define MERGE_REQUEST_1472_SPEEDUP_ivas_mc_param_enc_fx_NONBE /* FhG: reduce WMOPS of dmx calculation in ivas_param_mc_param_est_enc_fx() by using 64 Bit addition. Requires MERGE_REQUEST_1378_SPEEDUP_ivas_mc_param_enc_fx_NONBE. */ -#define MERGE_REQUEST_1564_SPEEDUP_ivas_dirac_dec_output_synthesis_cov_param_mc_synthesise_slot_fx_NONBE /* FhG: reduce WMOPS by inlining the matrix multiplications for the smoothing operation. */ -#define FIX_1439_SPEEDUP_Copy_Scale_sig_16_32_no_sat /*FhG: reduces WMOPS - bit-exact*/ -#define FIX_1439_SPEEDUP_stereo_icBWE_dec_fx /*FhG: reduces WMOPS - bit-exact*/ -#define FIX_1439_SPEEDUP_ivas_swb_tbe_dec_fx /*FhG: reduces WMOPS - bit-exact*/ -#define FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic /*FhG: reduces maintenance complexity & reduces WMOPS & prepares STAGE2 patch*/ -#define FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2 /*FhG: reduces WMOPS*/ -#define FIX_1481_HARDCODE_DIV /* FhG: hardcode division results in stereo_dmx_evs_init_encoder_fx() */ -#define VEC_ARITH_OPT_v1 -#define FIX_1486_IND_SHB_RES /* VA: Fix for issue 1486: align the usage of IND_SHB_RES_GS indices with float code */ -#define FIX_1511_POC_RENORM /* NTT: Fix for issue 1511: Renorm for POC. */ - -#define TEST_HR -#define REMOVE_EVS_DUPLICATES /* remove core-coder duplicated functions, ACELP low-band decoder */ - -#define FIX_1713_EXP /* VA: proposed correction to exp in ic-BWE*/ + + #define FIX_USAN_BASOP_UTIL_DIVIDE3232 /* Eri: Fix USAN error in BASOP_Util_Divide3232_Scale_newton by adding explicit type cast for -1 in hex */ -#define FIX_1733_CLDFB_BUG #define FIX_1740_MISING_POP_WMOPS /* VA: fix issue 1740: missing pop_wmops() */ #define NONBE_FIX_864_JBM_RENDER_FRAMESIZE /* FhG: issue #864: fix different behaviour of JBM TSM with different render frame sizes */ diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index d533c5612..2d4ea1901 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -3222,11 +3222,8 @@ void interp_code_4over2_fx( void wb_tbe_extras_reset_synth_fx( Word16 state_lsyn_filt_shb[], Word16 state_lsyn_filt_dwn_shb[], Word16 state_32and48k_WB_upsample[], Word16 state_resamp_HB[] ); -#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic void elliptic_bpf_48k_generic_fx( -#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2 const Word16 element_mode, -#endif Word16 IsUpsampled3, Word16 input_fx[], /* i : input signal Q_input_fx*/ Word16 *Q_input_fx, @@ -3235,16 +3232,6 @@ void elliptic_bpf_48k_generic_fx( Word16 memory_fx_Q[], const Word16 full_band_bpf[][5] /* i : filter coefficients b0,b1,b2,a0,a1,a2 Q13 */ ); -#else -void elliptic_bpf_48k_generic_fx( - const Word16 input_fx[], /* i : i signal Q_input_fx */ - Word16 *Q_input_fx, - Word16 output_fx[], /* o : output signal */ - Word32 memory_fx[][4], /* i/o: 4 arrays of 4 for memory memory_fx_Q */ - Word16 memory_fx_Q[], - const Word16 full_band_bpf[][5] /* i : filter coefficients b0,b1,b2,a0,a1,a2 Q13 */ -); -#endif void synthesise_fb_high_band_fx( const Word16 excitation_in[], /* i : full band excitation */ @@ -3258,10 +3245,8 @@ void synthesise_fb_high_band_fx( Word32 bpf_memory[][4], /* i/o: memory for elliptic bpf 48k */ Word16 bpf_memory_Q[], Word16 Qout -#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2 , Word16 element_mode -#endif ); void prep_tbe_exc_fx( @@ -6028,14 +6013,12 @@ void v_add_fixed( const Word16 hdrm /* i : headroom for when subtraction result > 1 or < -1 */ ); -#ifdef VEC_ARITH_OPT_v1 void v_add_fixed_no_hdrm( const Word32 x1[], /* i : Input vector 1 */ const Word32 x2[], /* i : Input vector 2 */ Word32 y[], /* o : Output vector that contains vector 1 + vector 2 */ const Word16 N /* i : Vector length */ ); -#endif /* VEC_ARITH_OPT_v1 */ void v_add_fixed_me( const Word32 x1[], /* i : Input vector 1 */ @@ -6071,14 +6054,12 @@ void v_sub_fixed( const Word16 hdrm /* i : headroom for when subtraction result > 1 or < -1 */ ); -#ifdef VEC_ARITH_OPT_v1 void v_sub_fixed_no_hdrm( const Word32 x1[], /* i : Input vector 1 */ const Word32 x2[], /* i : Input vector 2 */ Word32 y[], /* o : Output vector that contains vector 1 - vector 2 */ const Word16 N /* i : Vector length */ ); -#endif /* VEC_ARITH_OPT_v1 */ /*! r: dot product of x[] and y[] */ Word32 dotp_fixed( @@ -9385,9 +9366,7 @@ void cldfbSynthesis_ivas_fx( Word32 *timeOut_fx, /* o : output time domain samples Qx - 1*/ const Word16 samplesToProcess, /* i : number of processed samples */ const Word16 shift, /* i : scale for state buffer */ -#ifdef OPT_AVOID_STATE_BUF_RESCALE const Word16 out_shift, /* i : scale for output buffer */ -#endif HANDLE_CLDFB_FILTER_BANK h_cldfb /* i : filter bank state */ ); diff --git a/lib_com/scale_mem_fx.c b/lib_com/scale_mem_fx.c index 2ce2ffd12..168a96011 100644 --- a/lib_com/scale_mem_fx.c +++ b/lib_com/scale_mem_fx.c @@ -307,12 +307,10 @@ void scale_sig32( /* saturation can occur here */ x[i] = L_shl( x[i], exp0 ); move32(); -#ifdef OPT_STEREO_32KBPS_V1 if ( 0 == exp0 ) { i = lg; } -#endif /* OPT_STEREO_32KBPS_V1 */ } } @@ -329,12 +327,10 @@ void scale_sig32_r( /* saturation can occur here */ x[i] = L_shl_r( x[i], exp0 ); move32(); -#ifdef OPT_STEREO_32KBPS_V1 if ( 0 == exp0 ) { i = lg; } -#endif /* OPT_STEREO_32KBPS_V1 */ } } diff --git a/lib_com/swb_tbe_com_fx.c b/lib_com/swb_tbe_com_fx.c index 2cb51ae93..f37381b69 100644 --- a/lib_com/swb_tbe_com_fx.c +++ b/lib_com/swb_tbe_com_fx.c @@ -6368,15 +6368,9 @@ void wb_tbe_extras_reset_synth_fx( *-------------------------------------------------------------------*/ void elliptic_bpf_48k_generic_fx( -#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2 const int16_t element_mode, -#endif -#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic Word16 IsUpsampled3, Word16 input_fx[], /* i : input signal Q_input_fx*/ -#else - const Word16 input_fx[], /* i : input signal Q_input_fx*/ -#endif Word16 *Q_input_fx, Word16 output_fx[], /* o : output signal memory_fx_Q */ Word32 memory_fx2[][4], /* i/o: 4 arrays of 4 for memory */ @@ -6385,27 +6379,18 @@ void elliptic_bpf_48k_generic_fx( ) { Word16 i, j; -#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic Word16 memory_fx0, Q_temp, Q_temp2; Word32 L_tmp_buffer[L_FRAME48k + 4], L_tmp2_buffer[L_FRAME48k + 4], L_output_buffer[L_FRAME48k + 4], L_tmpX; Word32 L_tmpMax; -#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2 Word64 W_tmpX; Word64 W_tmpY; -#endif Word32 *L_tmp = &L_tmp_buffer[4]; Word32 *L_tmp2 = &L_tmp2_buffer[4]; Word32 *L_output = &L_output_buffer[4]; -#else - Word16 memory_fx0[4][4], memory_fx[4][4], Q_temp, Q_temp2; - Word32 L_tmp[L_FRAME48k], L_tmp2[L_FRAME48k], L_output[L_FRAME48k], L_tmpX, memory2_fx[4][4], L_tmpMax; - Word32 memory2_fx_2[4], memory2_fx_3[4]; -#endif FOR( i = 0; i < 4; i++ ) { -#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic memory_fx0 = extract_l( memory_fx2[0][i] ); input_fx[i - 4] = shl_sat( memory_fx0, sub( *Q_input_fx, memory_fx_Q[0] ) ); L_tmp[i - 4] = L_shl_sat( memory_fx2[1][i], sub( add( *Q_input_fx, 11 ), memory_fx_Q[1] ) ); @@ -6416,24 +6401,11 @@ void elliptic_bpf_48k_generic_fx( move32(); move32(); move32(); -#else - memory_fx0[0][i] = extract_l( memory_fx2[0][i] ); - memory_fx[0][i] = shl_sat( memory_fx0[0][i], sub( *Q_input_fx, memory_fx_Q[0] ) ); - memory2_fx[1][i] = L_shl_sat( memory_fx2[1][i], sub( add( *Q_input_fx, 11 ), memory_fx_Q[1] ) ); - memory2_fx[2][i] = L_shl_sat( memory_fx2[2][i], sub( add( *Q_input_fx, 6 ), memory_fx_Q[2] ) ); - move32(); - move32(); - move32(); - move32(); - move32(); -#endif } -#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic L_tmpMax = L_add( 0, 0 ); IF( !IsUpsampled3 ) { -#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2 IF( element_mode ) { FOR( i = 0; i < L_FRAME48k; i++ ) @@ -6453,7 +6425,6 @@ void elliptic_bpf_48k_generic_fx( } } ELSE -#endif /*FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2*/ { FOR( i = 0; i < L_FRAME48k; i++ ) { @@ -6472,7 +6443,6 @@ void elliptic_bpf_48k_generic_fx( } /*IsUpsampled3*/ ELSE { -#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2 IF( element_mode ) { FOR( i = 0; i < L_FRAME48k; ) @@ -6508,7 +6478,6 @@ void elliptic_bpf_48k_generic_fx( } } ELSE -#endif /*FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2*/ { FOR( i = 0; i < L_FRAME48k; ) { @@ -6542,63 +6511,6 @@ void elliptic_bpf_48k_generic_fx( } /*IsUpsampled3*/ -#else /*FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic*/ - L_tmpX = L_shr( L_mult( memory_fx[0][0], full_band_bpf_fx[0][4] ), 3 ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmpX = L_add( L_shr( L_mult( memory_fx[0][1], full_band_bpf_fx[0][3] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmpX = L_add( L_shr( L_mult( memory_fx[0][2], full_band_bpf_fx[0][2] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmpX = L_add( L_shr( L_mult( memory_fx[0][3], full_band_bpf_fx[0][1] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmpX = L_add( L_shr( L_mult( input_fx[0], full_band_bpf_fx[0][0] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[1][3], full_band_bpf_fx[3][1] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ - L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[1][2], full_band_bpf_fx[3][2] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ - L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[1][1], full_band_bpf_fx[3][3] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ - L_tmp[0] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[1][0], full_band_bpf_fx[3][4] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ - move32(); - - L_tmpX = L_shr( L_mult( memory_fx[0][1], full_band_bpf_fx[0][4] ), 3 ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmpX = L_add( L_shr( L_mult( memory_fx[0][2], full_band_bpf_fx[0][3] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmpX = L_add( L_shr( L_mult( memory_fx[0][3], full_band_bpf_fx[0][2] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmpX = L_add( L_shr( L_mult( input_fx[0], full_band_bpf_fx[0][1] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmpX = L_add( L_shr( L_mult( input_fx[1], full_band_bpf_fx[0][0] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[0], full_band_bpf_fx[3][1] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ - L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[1][3], full_band_bpf_fx[3][2] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ - L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[1][2], full_band_bpf_fx[3][3] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ - L_tmp[1] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[1][1], full_band_bpf_fx[3][4] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ - move32(); - - L_tmpX = L_shr( L_mult( memory_fx[0][2], full_band_bpf_fx[0][4] ), 3 ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmpX = L_add( L_shr( L_mult( memory_fx[0][3], full_band_bpf_fx[0][3] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmpX = L_add( L_shr( L_mult( input_fx[0], full_band_bpf_fx[0][2] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmpX = L_add( L_shr( L_mult( input_fx[1], full_band_bpf_fx[0][1] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmpX = L_add( L_shr( L_mult( input_fx[2], full_band_bpf_fx[0][0] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[1], full_band_bpf_fx[3][1] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ - L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[0], full_band_bpf_fx[3][2] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ - L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[1][3], full_band_bpf_fx[3][3] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ - L_tmp[2] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[1][2], full_band_bpf_fx[3][4] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ - move32(); - L_tmpX = L_shr( L_mult( memory_fx[0][3], full_band_bpf_fx[0][4] ), 3 ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmpX = L_add( L_shr( L_mult( input_fx[0], full_band_bpf_fx[0][3] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmpX = L_add( L_shr( L_mult( input_fx[1], full_band_bpf_fx[0][2] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmpX = L_add( L_shr( L_mult( input_fx[2], full_band_bpf_fx[0][1] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmpX = L_add( L_shr( L_mult( input_fx[3], full_band_bpf_fx[0][0] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[2], full_band_bpf_fx[3][1] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ - L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[1], full_band_bpf_fx[3][2] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ - L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[0], full_band_bpf_fx[3][3] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ - L_tmp[3] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[1][3], full_band_bpf_fx[3][4] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ - move32(); - FOR( i = 4; i < L_FRAME48k; i++ ) - { - L_tmpX = L_shr( L_mult( input_fx[i - 4], full_band_bpf_fx[0][4] ), 3 ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmpX = L_add_sat( L_shr( L_mult( input_fx[i - 3], full_band_bpf_fx[0][3] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[i - 1], full_band_bpf_fx[3][1] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ - L_tmpX = L_add_sat( L_shr( L_mult( input_fx[i - 2], full_band_bpf_fx[0][2] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[i - 2], full_band_bpf_fx[3][2] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ - L_tmpX = L_add_sat( L_shr( L_mult( input_fx[i - 1], full_band_bpf_fx[0][1] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[i - 3], full_band_bpf_fx[3][3] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ - L_tmpX = L_add_sat( L_shr( L_mult( input_fx[i], full_band_bpf_fx[0][0] ), 3 ), L_tmpX ); /*Q_input_fx + 13 + 1 - 3*/ - L_tmp[i] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[i - 4], full_band_bpf_fx[3][4] ), 2 ) ); /*Q_input_fx + 11 + 13 -15 +2*/ - move32(); - } -#endif /*FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic*/ memory_fx2[0][0] = input_fx[L_FRAME48k - 4]; memory_fx2[0][1] = input_fx[L_FRAME48k - 3]; @@ -6610,9 +6522,7 @@ void elliptic_bpf_48k_generic_fx( move32(); move32(); -#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic L_tmpMax = L_add( 0, 0 ); -#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2 IF( element_mode ) { FOR( i = 0; i < L_FRAME48k; i++ ) @@ -6632,7 +6542,6 @@ void elliptic_bpf_48k_generic_fx( } } ELSE -#endif /*FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2*/ { FOR( i = 0; i < L_FRAME48k; i++ ) { @@ -6649,66 +6558,6 @@ void elliptic_bpf_48k_generic_fx( L_tmpMax = L_max( L_tmpMax, L_abs( L_tmp2[i] ) ); } } -#else /*FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic*/ - L_tmpX = L_shr( Mult_32_16( memory2_fx[1][0], full_band_bpf_fx[1][4] ), 3 ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmpX = L_add( L_shr( Mult_32_16( memory2_fx[1][1], full_band_bpf_fx[1][3] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmpX = L_add( L_shr( Mult_32_16( memory2_fx[1][2], full_band_bpf_fx[1][2] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmpX = L_add( L_shr( Mult_32_16( memory2_fx[1][3], full_band_bpf_fx[1][1] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[0], full_band_bpf_fx[1][0] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[2][3], full_band_bpf_fx[4][1] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ - L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[2][2], full_band_bpf_fx[4][2] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2*/ - L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[2][1], full_band_bpf_fx[4][3] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2*/ - L_tmp2[0] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[2][0], full_band_bpf_fx[4][4] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2*/ - move32(); - L_tmpMax = L_abs( L_tmp2[0] ); - L_tmpX = L_shr( Mult_32_16( memory2_fx[1][1], full_band_bpf_fx[1][4] ), 3 ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmpX = L_add( L_shr( Mult_32_16( memory2_fx[1][2], full_band_bpf_fx[1][3] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmpX = L_add( L_shr( Mult_32_16( memory2_fx[1][3], full_band_bpf_fx[1][2] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[0], full_band_bpf_fx[1][1] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[1], full_band_bpf_fx[1][0] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp2[0], full_band_bpf_fx[4][1] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ - L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[2][3], full_band_bpf_fx[4][2] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ - L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[2][2], full_band_bpf_fx[4][3] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ - L_tmp2[1] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[2][1], full_band_bpf_fx[4][4] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ - move32(); - L_tmpMax = L_max( L_tmpMax, L_abs( L_tmp2[1] ) ); - L_tmpX = L_shr( Mult_32_16( memory2_fx[1][2], full_band_bpf_fx[1][4] ), 3 ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmpX = L_add( L_shr( Mult_32_16( memory2_fx[1][3], full_band_bpf_fx[1][3] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[0], full_band_bpf_fx[1][2] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[1], full_band_bpf_fx[1][1] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[2], full_band_bpf_fx[1][0] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp2[1], full_band_bpf_fx[4][1] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ - L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp2[0], full_band_bpf_fx[4][2] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ - L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[2][3], full_band_bpf_fx[4][3] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ - L_tmp2[2] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[2][2], full_band_bpf_fx[4][4] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ - move32(); - L_tmpMax = L_max( L_tmpMax, L_abs( L_tmp2[2] ) ); - L_tmpX = L_shr( Mult_32_16( memory2_fx[1][3], full_band_bpf_fx[1][4] ), 3 ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[0], full_band_bpf_fx[1][3] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[1], full_band_bpf_fx[1][2] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[2], full_band_bpf_fx[1][1] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[3], full_band_bpf_fx[1][0] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp2[2], full_band_bpf_fx[4][1] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ - L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp2[1], full_band_bpf_fx[4][2] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ - L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp2[0], full_band_bpf_fx[4][3] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ - L_tmp2[3] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[2][3], full_band_bpf_fx[4][4] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ /*14 + Q_input_fx - shift_flag*/ - move32(); - L_tmpMax = L_max( L_tmpMax, L_abs( L_tmp2[3] ) ); - FOR( i = 4; i < L_FRAME48k; i++ ) - { - L_tmpX = L_shr( Mult_32_16( L_tmp[i - 4], full_band_bpf_fx[1][4] ), 3 ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmpX = L_add_sat( L_shr( Mult_32_16( L_tmp[i - 3], full_band_bpf_fx[1][3] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp2[i - 1], full_band_bpf_fx[4][1] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ - L_tmpX = L_add_sat( L_shr( Mult_32_16( L_tmp[i - 2], full_band_bpf_fx[1][2] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp2[i - 2], full_band_bpf_fx[4][2] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ - L_tmpX = L_add_sat( L_shr( Mult_32_16( L_tmp[i - 1], full_band_bpf_fx[1][1] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp2[i - 3], full_band_bpf_fx[4][3] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ - L_tmpX = L_add_sat( L_shr( Mult_32_16( L_tmp[i], full_band_bpf_fx[1][0] ), 3 ), L_tmpX ); /*Q_input_fx + 11 + 13 - 15 -3*/ - L_tmp2[i] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp2[i - 4], full_band_bpf_fx[4][4] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ - move32(); - L_tmpMax = L_max( L_tmpMax, L_abs( L_tmp2[i] ) ); - } -#endif Q_temp = norm_l( L_tmpMax ); @@ -6724,7 +6573,6 @@ void elliptic_bpf_48k_generic_fx( move32(); move32(); move32(); -#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic FOR( j = 0; j < 4; j++ ) { L_tmp2[j - 4] = L_shl_sat( memory_fx2[2][j], sub( add( add( *Q_input_fx, 6 ), Q_temp ), memory_fx_Q[2] ) ); @@ -6733,19 +6581,7 @@ void elliptic_bpf_48k_generic_fx( move32(); move32(); } -#else - FOR( j = 0; j < 4; j++ ) - { - memory2_fx_2[j] = L_shl_sat( memory_fx2[2][j], sub( add( add( *Q_input_fx, 6 ), Q_temp ), memory_fx_Q[2] ) ); - memory2_fx_3[j] = L_shl_sat( memory_fx2[3][j], sub( add( add( *Q_input_fx, 1 ), Q_temp ), memory_fx_Q[3] ) ); - move32(); - move32(); - move32(); - } -#endif -#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic L_tmpMax = L_add( 0, 0 ); -#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2 IF( element_mode ) { FOR( i = 0; i < L_FRAME48k; i++ ) @@ -6765,7 +6601,6 @@ void elliptic_bpf_48k_generic_fx( } } ELSE -#endif /*FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2*/ { FOR( i = 0; i < L_FRAME48k; i++ ) { @@ -6786,73 +6621,6 @@ void elliptic_bpf_48k_generic_fx( } } -#else /*FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic*/ - L_tmpX = L_shr( Mult_32_16( memory2_fx_2[0], full_band_bpf_fx[2][4] ), 3 ); /* *Q_input_fx+6 +Q_temp +13 -15 -3 */ - L_tmpX = L_add_sat( L_shr( Mult_32_16( memory2_fx_2[1], full_band_bpf_fx[2][3] ), 3 ), L_tmpX ); /*Q_input_fx + 6 +Q_temp+13 -15 -3*/ - L_tmpX = L_add_sat( L_shr( Mult_32_16( memory2_fx_2[2], full_band_bpf_fx[2][2] ), 3 ), L_tmpX ); /*Q_input_fx + 6 +Q_temp+13 -15 -3*/ - L_tmpX = L_add_sat( L_shr( Mult_32_16( memory2_fx_2[3], full_band_bpf_fx[2][1] ), 3 ), L_tmpX ); /*Q_input_fx + 6 +Q_temp+13 -15 -3*/ - L_tmpX = L_add_sat( L_shr( Mult_32_16( L_tmp2[0], full_band_bpf_fx[2][0] ), 3 ), L_tmpX ); /*Q_input_fx + 6 +Q_temp+13 -15 -3*/ - L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx_3[3], full_band_bpf_fx[5][1] ), 2 ) ); /*Q_input_fx + 1 +Q_temp+13 -15 + 2 */ - L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx_3[2], full_band_bpf_fx[5][2] ), 2 ) ); /*Q_input_fx + 1 +Q_temp+13 -15 + 2 */ - L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx_3[1], full_band_bpf_fx[5][3] ), 2 ) ); /*Q_input_fx + 1 +Q_temp+13 -15 + 2 */ - L_output[0] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx_3[0], full_band_bpf_fx[5][4] ), 2 ) ); /*Q_input_fx + 1 +Q_temp+13 -15 + 2 */ - move32(); - L_tmpMax = L_abs( L_output[0] ); - - L_tmpX = L_shr( Mult_32_16( memory2_fx_2[1], full_band_bpf_fx[2][4] ), 3 ); /*Q_input_fx + 6 +Q_temp +13 -15 -3 */ - L_tmpX = L_add_sat( L_shr( Mult_32_16( memory2_fx_2[2], full_band_bpf_fx[2][3] ), 3 ), L_tmpX ); /*Q_input_fx +Q_temp+ 6 +13 -15 -3*/ - L_tmpX = L_add_sat( L_shr( Mult_32_16( memory2_fx_2[3], full_band_bpf_fx[2][2] ), 3 ), L_tmpX ); /*Q_input_fx +Q_temp+ 6 +13 -15 -3*/ - L_tmpX = L_add_sat( L_shr( Mult_32_16( L_tmp2[0], full_band_bpf_fx[2][1] ), 3 ), L_tmpX ); /*Q_input_fx +Q_temp+ 6 +13 -15 -3*/ - L_tmpX = L_add_sat( L_shr( Mult_32_16( L_tmp2[1], full_band_bpf_fx[2][0] ), 3 ), L_tmpX ); /*Q_input_fx+Q_temp + 6 +13 -15 -3*/ - L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_output[0], full_band_bpf_fx[5][1] ), 2 ) ); /*Q_input_fx + 1 +13 -15 + 2+Q_temp*/ - L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx_3[3], full_band_bpf_fx[5][2] ), 2 ) ); /*Q_input_fx + 1 +13 -15 + 2+Q_temp*/ - L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx_3[2], full_band_bpf_fx[5][3] ), 2 ) ); /*Q_input_fx + 1 +13 -15 + 2+Q_temp*/ - L_output[1] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx_3[1], full_band_bpf_fx[5][4] ), 2 ) ); /*Q_input_fx + 1 +13 -15 + 2+Q_temp*/ - move32(); - L_tmpMax = L_max( L_tmpMax, L_abs( L_output[1] ) ); - - L_tmpX = L_shr( Mult_32_16( memory2_fx_2[2], full_band_bpf_fx[2][4] ), 3 ); /*Q_input_fx + 6 +Q_temp+13 -15 -3 */ - L_tmpX = L_add_sat( L_shr( Mult_32_16( memory2_fx_2[3], full_band_bpf_fx[2][3] ), 3 ), L_tmpX ); /*Q_input_fx +Q_temp+ 6 +13 -15 -3*/ - L_tmpX = L_add_sat( L_shr( Mult_32_16( L_tmp2[0], full_band_bpf_fx[2][2] ), 3 ), L_tmpX ); /*Q_input_fx +Q_temp+ 6 +13 -15 -3*/ - L_tmpX = L_add_sat( L_shr( Mult_32_16( L_tmp2[1], full_band_bpf_fx[2][1] ), 3 ), L_tmpX ); /*Q_input_fx +Q_temp + 6 +13 -15 -3*/ - L_tmpX = L_add_sat( L_shr( Mult_32_16( L_tmp2[2], full_band_bpf_fx[2][0] ), 3 ), L_tmpX ); /*Q_input_fx +Q_temp + 6 +13 -15 -3*/ - L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_output[1], full_band_bpf_fx[5][1] ), 2 ) ); /*Q_input_fx + 1 +Q_temp+13 -15 + 2*/ - L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_output[0], full_band_bpf_fx[5][2] ), 2 ) ); /*Q_input_fx + 1 +Q_temp+13 -15 + 2*/ - L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx_3[3], full_band_bpf_fx[5][3] ), 2 ) ); /*Q_input_fx + 1+Q_temp +13 -15 + 2*/ - L_output[2] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx_3[2], full_band_bpf_fx[5][4] ), 2 ) ); /*Q_input_fx + 1 +Q_temp+13 -15 + 2*/ - move32(); - L_tmpMax = L_max( L_tmpMax, L_abs( L_output[2] ) ); - - L_tmpX = L_shr( Mult_32_16( memory2_fx_2[3], full_band_bpf_fx[2][4] ), 3 ); /*Q_input_fx + 6 +Q_temp +13 -15 -3 */ - L_tmpX = L_add_sat( L_shr( Mult_32_16( L_tmp2[0], full_band_bpf_fx[2][3] ), 3 ), L_tmpX ); /*Q_input_fx + 6 +Q_temp+13 -15 -3*/ - L_tmpX = L_add_sat( L_shr( Mult_32_16( L_tmp2[1], full_band_bpf_fx[2][2] ), 3 ), L_tmpX ); /*Q_input_fx + 6 +Q_temp+13 -15 -3*/ - L_tmpX = L_add_sat( L_shr( Mult_32_16( L_tmp2[2], full_band_bpf_fx[2][1] ), 3 ), L_tmpX ); /*Q_input_fx + 6 +Q_temp+13 -15 -3*/ - L_tmpX = L_add_sat( L_shr( Mult_32_16( L_tmp2[3], full_band_bpf_fx[2][0] ), 3 ), L_tmpX ); /*Q_input_fx + 6 +Q_temp+13 -15 -3*/ - L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_output[2], full_band_bpf_fx[5][1] ), 2 ) ); /*Q_input_fx + 1 +Q_temp+13 -15 + 2*/ - L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_output[1], full_band_bpf_fx[5][2] ), 2 ) ); /*Q_input_fx + 1 +Q_temp+13 -15 + 2*/ - L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_output[0], full_band_bpf_fx[5][3] ), 2 ) ); /*Q_input_fx + 1 +Q_temp+13 -15 + 2*/ - L_output[3] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx_3[3], full_band_bpf_fx[5][4] ), 2 ) ); /*Q_input_fx + 1 +Q_temp+13 -15 + 2*/ - move32(); - L_tmpMax = L_max( L_tmpMax, L_abs( L_output[3] ) ); - - FOR( i = 4; i < L_FRAME48k; i++ ) - { - L_tmpX = L_shr( Mult_32_16( L_tmp2[i - 4], full_band_bpf_fx[2][4] ), 3 ); /*Q_input_fx + 6 +Q_temp+13 -15 -3 */ - L_tmpX = L_add_sat( L_shr( Mult_32_16( L_tmp2[i - 3], full_band_bpf_fx[2][3] ), 3 ), L_tmpX ); /*Q_input_fx + 6 +Q_temp +13 -15 -3*/ - L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_output[i - 1], full_band_bpf_fx[5][1] ), 2 ) ); /*Q_input_fx + 1 +Q_temp+13 -15 + 2*/ - - L_tmpX = L_add_sat( L_shr( Mult_32_16( L_tmp2[i - 2], full_band_bpf_fx[2][2] ), 3 ), L_tmpX ); /*Q_input_fx + 6 +Q_temp+13 -15 -3*/ - L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_output[i - 2], full_band_bpf_fx[5][2] ), 2 ) ); /*Q_input_fx + 1 +Q_temp+13 -15 + 2*/ - - L_tmpX = L_add_sat( L_shr( Mult_32_16( L_tmp2[i - 1], full_band_bpf_fx[2][1] ), 3 ), L_tmpX ); /*Q_input_fx + 6 +Q_temp +13 -15 -3*/ - L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_output[i - 3], full_band_bpf_fx[5][3] ), 2 ) ); /*Q_input_fx + 1 +Q_temp+13 -15 + 2*/ - - L_tmpX = L_add_sat( L_shr( Mult_32_16( L_tmp2[i], full_band_bpf_fx[2][0] ), 3 ), L_tmpX ); /*Q_input_fx + 6 +Q_temp +13 -15 -3*/ - L_output[i] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_output[i - 4], full_band_bpf_fx[5][4] ), 2 ) ); /*Q_input_fx + 1 +Q_temp+13 -15 + 2*/ - move32(); - L_tmpMax = L_max( L_tmpMax, L_abs( L_output[i] ) ); - } -#endif memory_fx2[2][0] = L_tmp2[L_FRAME48k - 4]; memory_fx2[2][1] = L_tmp2[L_FRAME48k - 3]; @@ -6918,19 +6686,13 @@ void synthesise_fb_high_band_fx( Word32 bpf_memory[][4], /* i/o: memory for elliptic bpf 48k */ Word16 bpf_memory_Q[], Word16 Qout -#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2 , int16_t element_mode -#endif ) { Word16 i, j; -#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic Word16 excitation_in_interp3_buffer[L_FRAME48k + 4]; Word16 *excitation_in_interp3 = &excitation_in_interp3_buffer[0] + 4; -#else - Word16 excitation_in_interp3[L_FRAME48k]; -#endif Word16 tmp[L_FRAME48k]; Word32 temp1; Word32 ratio2; @@ -6955,32 +6717,20 @@ void synthesise_fb_high_band_fx( IF( EQ_16( L_frame, L_FRAME16k ) ) { /* for 16kHz ACELP core */ -#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic elliptic_bpf_48k_generic_fx( -#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2 element_mode, -#endif 1, // IsUpsampled3 excitation_in_interp3, &exp_tmp, tmp, bpf_memory, bpf_memory_Q, full_band_bpf_3_fx ); -#else - elliptic_bpf_48k_generic_fx( excitation_in_interp3, &exp_tmp, tmp, bpf_memory, bpf_memory_Q, full_band_bpf_3_fx ); -#endif } ELSE { /* for 12.8kHz ACELP core */ -#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic elliptic_bpf_48k_generic_fx( -#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2 element_mode, -#endif 1, // IsUpsampled3 excitation_in_interp3, &exp_tmp, tmp, bpf_memory, bpf_memory_Q, full_band_bpf_1_fx ); -#else - elliptic_bpf_48k_generic_fx( excitation_in_interp3, &exp_tmp, tmp, bpf_memory, bpf_memory_Q, full_band_bpf_1_fx ); -#endif } /* temp1 = sum2_f( tmp, L_FRAME48k ) + 0.001f */ temp1 = sum2_fx_mod( tmp, L_FRAME48k ); diff --git a/lib_com/tools.c b/lib_com/tools.c index 9166d16eb..3cf11ea92 100644 --- a/lib_com/tools.c +++ b/lib_com/tools.c @@ -777,7 +777,6 @@ void v_sub_fixed( return; } -#ifdef VEC_ARITH_OPT_v1 void v_sub_fixed_no_hdrm( const Word32 x1[], /* i : Input vector 1 */ const Word32 x2[], /* i : Input vector 2 */ @@ -795,7 +794,6 @@ void v_sub_fixed_no_hdrm( return; } -#endif /* VEC_ARITH_OPT_v1 */ /*-------------------------------------------------------------------* * v_multc_fixed() diff --git a/lib_com/tools_fx.c b/lib_com/tools_fx.c index 137e2a40e..a83dfb56b 100644 --- a/lib_com/tools_fx.c +++ b/lib_com/tools_fx.c @@ -818,7 +818,6 @@ void Copy_Scale_sig_16_32_no_sat( } return; } -#ifdef FIX_1439_SPEEDUP_Copy_Scale_sig_16_32_no_sat L_tmp = L_shl_o( 1, exp0 - 1, &Overflow ); IF( L_tmp >= 0x7FFF ) @@ -840,15 +839,6 @@ void Copy_Scale_sig_16_32_no_sat( move32(); } } -#else - L_tmp = L_shl_o( 1, exp0 - 1, &Overflow ); - FOR( i = 0; i < lg; i++ ) - { - // y[i] = L_mult0(x[i], L_tmp); - y[i] = W_extract_l( W_mult_32_16( L_tmp, x[i] ) ); - move32(); /* Overflow can occur here */ - } -#endif } void Copy_Scale_sig_32_16( @@ -4600,7 +4590,6 @@ void v_add_fixed( return; } -#ifdef VEC_ARITH_OPT_v1 void v_add_fixed_no_hdrm( const Word32 x1[], /* i : Input vector 1 */ const Word32 x2[], /* i : Input vector 2 */ @@ -4618,7 +4607,6 @@ void v_add_fixed_no_hdrm( return; } -#endif /* VEC_ARITH_OPT_v1 */ void v_add_fixed_me( const Word32 x1[], /* i : Input vector 1 */ diff --git a/lib_com/trans_inv_fx.c b/lib_com/trans_inv_fx.c index 0683e266c..36678487a 100644 --- a/lib_com/trans_inv_fx.c +++ b/lib_com/trans_inv_fx.c @@ -84,9 +84,7 @@ void preecho_sb_fx( UWord16 tmp_u16; Word32 mean_prev_hb_fx_loc, mean_prev_nc_fx_loc, mean_prev_fx_loc; /* */ Word16 q16p1, qmemp1, qtmp; -#ifdef OPT_STEREO_32KBPS_V1 Word16 shift_q = sub( 15, q_sig32 ); -#endif /* OPT_STEREO_32KBPS_V1 */ q16p1 = add( q_sig16, 1 ); qmemp1 = q16p1; @@ -139,7 +137,6 @@ void preecho_sb_fx( /* len3xLp20 = framelength/2-(short)((float)framelength*N_ZERO_MDCT/FRAME_SIZE_MS); in float*/ fxptr1 = imdct_mem_fx; -#ifdef OPT_STEREO_32KBPS_V1 FOR( i = 0; i < len3xLp20; i++ ) { *fxptr1++ = negate( extract_h( L_shl_sat( wtda_audio_fx[len3xLp20 - 1 - i], shift_q ) ) ); /*Q-1*/ @@ -150,19 +147,6 @@ void preecho_sb_fx( *fxptr1++ = negate( extract_h( L_shl_sat( wtda_audio_fx[i], shift_q ) ) ); /*Q-1*/ move16(); /*convert to Word16 Q-1 with saturation (saturation not a problem here) */ } -#else /* OPT_STEREO_32KBPS_V1 */ - fx32ptr1 = wtda_audio_fx + len3xLp20 - 1; /*q_sig32*/ - FOR( i = 0; i < len3xLp20; i++ ) - { - *fxptr1++ = negate( extract_h( L_shl_sat( *fx32ptr1--, sub( 15, q_sig32 ) ) ) ); /*Q-1*/ - move16(); /*convert to Word16 Q-1 with saturation (saturation not a problem here) */ - } - FOR( i = 0; i < L_shr( framelength, 1 ); i++ ) - { - *fxptr1++ = negate( extract_h( L_shl_sat( wtda_audio_fx[i], sub( 15, q_sig32 ) ) ) ); /*Q-1*/ - move16(); /*convert to Word16 Q-1 with saturation (saturation not a problem here) */ - } -#endif /* OPT_STEREO_32KBPS_V1 */ qmemp1 = 0; /*already in q-1*/ move16(); @@ -408,7 +392,6 @@ void preecho_sb_fx( move16(); FOR( i = 1; i <= NUMSF; i++ ) { -#ifdef OPT_STEREO_32KBPS_V1 max_es_hb_fx = L_max( max_es_hb_fx, es_mdct_hb_fx[i] ); /* max energy low band, 8 present and 1 future subframes */ max_es_fx = L_max( max_es_fx, es_mdct_fx[i] ); /* max energy low band, 8 present and 1 future subframes */ @@ -418,19 +401,6 @@ void preecho_sb_fx( maxind = i; move16(); } -#else /* OPT_STEREO_32KBPS_V1 */ - IF( GE_32( es_mdct_hb_fx[i], max_es_hb_fx ) ) /* '=' to handle the first window*/ - { - max_es_hb_fx = L_add( es_mdct_hb_fx[i], 0 ); /* max energy low band, 8 present and 1 future subframes */ - } - - IF( GE_32( es_mdct_fx[i], max_es_fx ) ) /* '=' to handle the first window*/ - { - max_es_fx = L_add( es_mdct_fx[i], 0 ); /* max energy low band, 8 present and 1 future subframes */ - maxind = i; - move16(); - } -#endif /* OPT_STEREO_32KBPS_V1 */ } cnt2 = cnt5 = 0; diff --git a/lib_dec/acelp_core_dec_fx.c b/lib_dec/acelp_core_dec_fx.c index 847e16594..76bf9d622 100644 --- a/lib_dec/acelp_core_dec_fx.c +++ b/lib_dec/acelp_core_dec_fx.c @@ -2042,15 +2042,6 @@ ivas_error acelp_core_dec_fx( scale_sig32( realBuffer_fx[i], CLDFB_NO_CHANNELS_MAX, Q_real ); // Q_real scale_sig32( imagBuffer_fx[i], CLDFB_NO_CHANNELS_MAX, Q_real ); // Q_real } -#ifndef OPT_AVOID_STATE_BUF_RESCALE -#ifdef OPT_STEREO_32KBPS_V1 - scale_sig32( st->cldfbSynHB->cldfb_state_fx, st->cldfbSynHB->p_filter_length, sub( Q_real, Q11 ) ); // Q10 - > (Q_real-1) -#else /* OPT_STEREO_32KBPS_V1 */ - scale_sig32_r( st->cldfbSynHB->cldfb_state_fx, st->cldfbSynHB->p_filter_length, sub( sub( Q_real, 1 ), Q10 ) ); // (Q_real-1) -#endif /* OPT_STEREO_32KBPS_V1 */ - st->cldfbSynHB->Q_cldfb_state = sub( Q_real, 1 ); - move16(); -#endif /* OPT_AVOID_STATE_BUF_RESCALE */ FOR( j = 0; j < CLDFB_NO_CHANNELS_MAX; j++ ) { @@ -2070,18 +2061,8 @@ ivas_error acelp_core_dec_fx( } } -#ifdef OPT_AVOID_STATE_BUF_RESCALE cldfbSynthesis_ivas_fx( realBuffer_fx, imagBuffer_fx, save_hb_synth_fx, -1, sub( Q11, Q_real ), -10, st->cldfbSynHB ); -#else /* OPT_AVOID_STATE_BUF_RESCALE */ - cldfbSynthesis_ivas_fx( realBuffer_fx, imagBuffer_fx, save_hb_synth_fx, -1, 0, st->cldfbSynHB ); -#endif /* OPT_AVOID_STATE_BUF_RESCALE */ - -#ifndef OPT_AVOID_STATE_BUF_RESCALE - Scale_sig32( save_hb_synth_fx, L_FRAME48k, negate( ( sub( Q_real, 1 ) ) ) ); // Q0 - Scale_sig32( st->cldfbSynHB->cldfb_state_fx, st->cldfbSynHB->p_filter_length, sub( Q10, sub( Q_real, 1 ) ) ); // Q10 - st->cldfbSynHB->Q_cldfb_state = Q10; - move16(); -#endif /* OPT_AVOID_STATE_BUF_RESCALE */ + /* restore lowband */ FOR( j = 0; j < CLDFB_NO_CHANNELS_MAX; j++ ) { @@ -2093,21 +2074,8 @@ ivas_error acelp_core_dec_fx( move32(); } } -#ifndef OPT_AVOID_STATE_BUF_RESCALE - Scale_sig32( st->cldfbSyn->cldfb_state_fx, st->cldfbSyn->p_filter_length, sub( sub( Q_real, 1 ), Q10 ) ); // Q_real-1 - st->cldfbSynHB->Q_cldfb_state = sub( Q_real, 1 ); - move16(); -#endif /* OPT_AVOID_STATE_BUF_RESCALE */ -#ifdef OPT_AVOID_STATE_BUF_RESCALE cldfbSynthesis_ivas_fx( pRealSave_fx, pImagSave_fx, synth_fx, -1, sub( Q11, Q_real ), -10, st->cldfbSyn ); -#else /* OPT_AVOID_STATE_BUF_RESCALE */ - cldfbSynthesis_ivas_fx( pRealSave_fx, pImagSave_fx, synth_fx, -1, 0, st->cldfbSyn ); - Scale_sig32( synth_fx, L_FRAME48k, negate( sub( Q_real, 1 ) ) ); // Q0 - Scale_sig32( st->cldfbSyn->cldfb_state_fx, st->cldfbSyn->p_filter_length, sub( Q10, sub( Q_real, 1 ) ) ); // Q10 - st->cldfbSynHB->Q_cldfb_state = Q10; - move16(); -#endif /* OPT_AVOID_STATE_BUF_RESCALE */ } ELSE { @@ -2131,19 +2099,11 @@ ivas_error acelp_core_dec_fx( scale_sig32( realBuffer_fx[i], CLDFB_NO_CHANNELS_MAX, Q_real ); // Q_real scale_sig32( imagBuffer_fx[i], CLDFB_NO_CHANNELS_MAX, Q_real ); // Q_real } -#ifdef OPT_STEREO_32KBPS_V1 scale_sig32( st->cldfbSyn->cldfb_state_fx, st->cldfbSyn->p_filter_length, sub( Q_real, Q11 ) ); // Q10 - > (Q_real-1) -#else /* OPT_STEREO_32KBPS_V1 */ - scale_sig32_r( st->cldfbSyn->cldfb_state_fx, st->cldfbSyn->p_filter_length, sub( sub( Q_real, 1 ), Q10 ) ); //(Q_real - 1) -#endif /* OPT_STEREO_32KBPS_V1 */ st->cldfbSyn->Q_cldfb_state = sub( Q_real, 1 ); move16(); -#ifdef OPT_AVOID_STATE_BUF_RESCALE cldfbSynthesis_ivas_fx( realBuffer_fx, imagBuffer_fx, synth_fx, -1, 0, 0, st->cldfbSyn ); -#else /* OPT_AVOID_STATE_BUF_RESCALE */ - cldfbSynthesis_ivas_fx( realBuffer_fx, imagBuffer_fx, synth_fx, -1, 0, st->cldfbSyn ); -#endif /* OPT_AVOID_STATE_BUF_RESCALE */ scale_sig32( synth_fx, output_frame, negate( sub( Q_real, 1 ) ) ); // Q0 scale_sig32( st->cldfbSyn->cldfb_state_fx, st->cldfbSyn->p_filter_length, sub( Q10, sub( Q_real, 1 ) ) ); // Q10 st->cldfbSyn->Q_cldfb_state = Q10; @@ -2224,26 +2184,9 @@ ivas_error acelp_core_dec_fx( scale_sig32( realBuffer_fx[i], CLDFB_NO_CHANNELS_MAX, Q_real ); // Q_real scale_sig32( imagBuffer_fx[i], CLDFB_NO_CHANNELS_MAX, Q_real ); // Q_real } -#ifndef OPT_AVOID_STATE_BUF_RESCALE -#ifdef OPT_STEREO_32KBPS_V1 - scale_sig32( st->cldfbSyn->cldfb_state_fx, st->cldfbSyn->p_filter_length, sub( Q_real, Q11 ) ); // Q10 - > (Q_real-1) -#else /* OPT_STEREO_32KBPS_V1 */ - scale_sig32_r( st->cldfbSyn->cldfb_state_fx, st->cldfbSyn->p_filter_length, sub( sub( Q_real, 1 ), Q10 ) ); //(Q_real - 1) -#endif /* OPT_STEREO_32KBPS_V1 */ -#endif /* OPT_AVOID_STATE_BUF_RESCALE */ -#ifdef OPT_AVOID_STATE_BUF_RESCALE cldfbSynthesis_ivas_fx( realBuffer_fx, imagBuffer_fx, synth_fx /*dummy*/, NS2SA_FX2( st->output_Fs, FRAME_SIZE_NS /*DELAY_CLDFB_NS*/ ), sub( Q10, sub( Q_real, 1 ) ), -10, st->cldfbSyn ); -#else /* OPT_AVOID_STATE_BUF_RESCALE */ - cldfbSynthesis_ivas_fx( realBuffer_fx, imagBuffer_fx, synth_fx /*dummy*/, NS2SA_FX2( st->output_Fs, FRAME_SIZE_NS /*DELAY_CLDFB_NS*/ ), 0, st->cldfbSyn ); -#endif /* OPT_AVOID_STATE_BUF_RESCALE */ - -#ifndef OPT_AVOID_STATE_BUF_RESCALE - Scale_sig32( synth_fx, output_frame, negate( sub( Q_real, 1 ) ) ); // Q0 - Scale_sig32( st->cldfbSyn->cldfb_state_fx, st->cldfbSyn->p_filter_length, sub( Q10, sub( Q_real, 1 ) ) ); // Q10 - st->cldfbSyn->Q_cldfb_state = Q10; - move16(); -#endif /* OPT_AVOID_STATE_BUF_RESCALE */ + IF( st->p_bpf_noise_buf_32 ) { Copy_Scale_sig_16_32_DEPREC( bpf_error_signal_16fx, bpf_error_signal_fx, st->L_frame, -1 ); // Q_syn-1 diff --git a/lib_dec/acelp_core_switch_dec_fx.c b/lib_dec/acelp_core_switch_dec_fx.c index b12682385..109f360cb 100644 --- a/lib_dec/acelp_core_switch_dec_fx.c +++ b/lib_dec/acelp_core_switch_dec_fx.c @@ -832,25 +832,10 @@ ivas_error acelp_core_switch_dec_bfi_ivas_fx( } /*cldfbSynthesis_fx( st_fx->cldfbSyn, realBuffer, imagBuffer, &scaleFactor, synth_out, negate(st_fx->Q_syn), CLDFB_NO_COL_MAX_SWITCH_BFI, workBuffer );*/ -#ifndef OPT_AVOID_STATE_BUF_RESCALE - Scale_sig32( st_fx->cldfbSyn->cldfb_state_fx, st_fx->cldfbSyn->cldfb_state_length, 1 ); // Q_cldfb_state+1 - st_fx->cldfbSyn->Q_cldfb_state = add( st_fx->cldfbSyn->Q_cldfb_state, 1 ); - move16(); - Copy_Scale_sig_16_32_DEPREC( synth_out, synth32, L_FRAME48k, 5 ); /*11-5-1*/ - - cldfbSynthesis_ivas_fx( realBuffer, imagBuffer, synth32, extract_l( Mpy_32_16_1( st_fx->output_Fs, 328 ) ), 0, st_fx->cldfbSyn ); -#else /* OPT_AVOID_STATE_BUF_RESCALE */ Word16 out_len = extract_l( Mpy_32_16_1( st_fx->output_Fs, 328 ) ); cldfbSynthesis_ivas_fx( realBuffer, imagBuffer, synth32, out_len, -1, 0, st_fx->cldfbSyn ); Copy_Scale_sig_32_16( synth32, synth_out, out_len, -4 ); -#endif /* OPT_AVOID_STATE_BUF_RESCALE */ -#ifndef OPT_AVOID_STATE_BUF_RESCALE - Scale_sig32( st_fx->cldfbSyn->cldfb_state_fx, st_fx->cldfbSyn->cldfb_state_length, -1 ); // Q_cldfb_state-1 - st_fx->cldfbSyn->Q_cldfb_state = sub( st_fx->cldfbSyn->Q_cldfb_state, 1 ); - move16(); - Copy_Scale_sig_32_16( synth32, synth_out, L_FRAME48k, -5 ); // 11-5-1 -> 11 -#endif /* OPT_AVOID_STATE_BUF_RESCALE */ // Scale_sig( synth_out, L_FRAME48k, negate( st_fx->Q_syn ) ); diff --git a/lib_dec/core_switching_dec_fx.c b/lib_dec/core_switching_dec_fx.c index ba7c73741..106cb0e60 100644 --- a/lib_dec/core_switching_dec_fx.c +++ b/lib_dec/core_switching_dec_fx.c @@ -2056,11 +2056,7 @@ static void core_switch_lb_upsamp_fx( } /* synthesis of the combined signal */ -#ifdef OPT_AVOID_STATE_BUF_RESCALE cldfbSynthesis_ivas_fx( realBuffer_fx, imagBuffer_fx, output, i_mult( CLDFB_OVRLP_MIN_SLOTS, st->cldfbSyn->no_channels ), 0, 0, st->cldfbSyn ); -#else /* OPT_AVOID_STATE_BUF_RESCALE */ - cldfbSynthesis_ivas_fx( realBuffer_fx, imagBuffer_fx, output, i_mult( CLDFB_OVRLP_MIN_SLOTS, st->cldfbSyn->no_channels ), 0, st->cldfbSyn ); -#endif /* OPT_AVOID_STATE_BUF_RESCALE */ /*rescaling whole buffer to a common Q*/ no_col = st->cldfbSyn->no_col; @@ -2368,11 +2364,7 @@ ivas_error core_switching_pre_dec_ivas_fx( return error; } -#ifdef OPT_AVOID_STATE_BUF_RESCALE cldfbSynthesis_ivas_fx( realBuffer_fx, imagBuffer_fx, fer_samples_fx, delay_comp, 0, 0, st->cldfbSyn ); -#else /* OPT_AVOID_STATE_BUF_RESCALE */ - cldfbSynthesis_ivas_fx( realBuffer_fx, imagBuffer_fx, fer_samples_fx, delay_comp, 0, st->cldfbSyn ); -#endif /* OPT_AVOID_STATE_BUF_RESCALE */ cldfb_restore_memory_ivas_fx( st->cldfbSyn ); Copy_Scale_sig_32_16( syn_Overl_fx, st->hTcxDec->syn_Overl, 320, 15 ); Copy_Scale_sig_32_16( fer_samples_fx, st->hHQ_core->fer_samples_fx, 960, 9 ); diff --git a/lib_dec/dec_acelp_fx.c b/lib_dec/dec_acelp_fx.c index 51cbef624..e7f8c98ce 100644 --- a/lib_dec/dec_acelp_fx.c +++ b/lib_dec/dec_acelp_fx.c @@ -169,20 +169,9 @@ void D_ACELP_indexing_fx( pulses = pulsestrack[0]; move16(); -#ifndef FIX_1378_ACELP_OUT_OF_BOUNDS - /* safety check in case of bit errors */ - IF( GE_64( s, pulsestostates[16][pulses - 1] ) ) - { - set16_fx( code, 0, L_SUBFR ); - *BER_detect = 1; - move16(); - return; - } -#endif IF( pulses ) { -#ifdef FIX_1378_ACELP_OUT_OF_BOUNDS /* safety check in case of bit errors */ IF( GE_64( s, pulsestostates[16][pulses - 1] ) ) { @@ -191,7 +180,6 @@ void D_ACELP_indexing_fx( move16(); return; } -#endif D_ACELP_decode_arithtrack_fx( code, s, pulses, num_tracks, 16 ); } ELSE diff --git a/lib_dec/fd_cng_dec_fx.c b/lib_dec/fd_cng_dec_fx.c index adf838f42..501276dfc 100644 --- a/lib_dec/fd_cng_dec_fx.c +++ b/lib_dec/fd_cng_dec_fx.c @@ -4758,11 +4758,7 @@ void generate_masking_noise_ivas_fx( } ELSE { -#ifdef VEC_ARITH_OPT_v1 v_add_fixed_no_hdrm( maskingNoise_fx, timeDomainBuffer, timeDomainBuffer, s_min( hFdCngCom->frameSize, length ) ); /*Q31 - *exp_out*/ -#else /* VEC_ARITH_OPT_v1 */ - v_add_fixed( maskingNoise_fx, timeDomainBuffer, timeDomainBuffer, s_min( hFdCngCom->frameSize, length ), 0 ); /*Q31 - *exp_out*/ -#endif /* VEC_ARITH_OPT_v1 */ } return; diff --git a/lib_dec/ivas_binRenderer_internal_fx.c b/lib_dec/ivas_binRenderer_internal_fx.c index 908d3b79b..efd9d0c67 100644 --- a/lib_dec/ivas_binRenderer_internal_fx.c +++ b/lib_dec/ivas_binRenderer_internal_fx.c @@ -54,7 +54,6 @@ * * *-------------------------------------------------------------------------*/ -#ifdef OPT_BIN_RENDERER_V2 static void ivas_binRenderer_filterModule_fx( Word32 out_Conv_CLDFB_real[BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : real part of Binaural signals Q6 */ Word32 out_Conv_CLDFB_imag[BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : imag part of Binaural signals Q6 */ @@ -184,117 +183,6 @@ static void ivas_binRenderer_filterModule_fx( return; } -#else /* OPT_BIN_RENDERER_V2 */ -static void ivas_binRenderer_filterModule_fx( - Word64 out_Conv_CLDFB_real[BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : real part of Binaural signals Q29 */ - Word64 out_Conv_CLDFB_imag[BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : imag part of Binaural signals Q29 */ - Word32 CLDFB_real[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : real part of LS signals Q_curr*/ - Word32 CLDFB_imag[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : imag part of LS signals Q_curr*/ - const Word16 numTimeSlots, /* i : number of time slots to process */ - BINAURAL_RENDERER_HANDLE hBinRenderer, /* i/o: fastconv binaural renderer handle */ - Word16 Q_curr ) -{ - Word16 bandIdx, k, chIdx, tapIdx; - Word32 *filterStatesLeftRealPtr_fx, *filterStatesLeftImagPtr_fx; - Word16 Q_filterStates; - const Word32 *filterTapsLeftRealPtr_fx, *filterTapsLeftImagPtr_fx, *filterTapsRightRealPtr_fx, *filterTapsRightImagPtr_fx; - Word16 shift_q; - Q_filterStates = hBinRenderer->hBinRenConvModule->Q_filterStatesLeft; - move16(); - - FOR( bandIdx = 0; bandIdx < hBinRenderer->conv_band; bandIdx++ ) - { - FOR( chIdx = 0; chIdx < hBinRenderer->nInChannels; chIdx++ ) - { - filterStatesLeftRealPtr_fx = (Word32 *) &( hBinRenderer->hBinRenConvModule->filterStatesLeftReal_fx[bandIdx][chIdx][0] ); - filterStatesLeftImagPtr_fx = (Word32 *) &( hBinRenderer->hBinRenConvModule->filterStatesLeftImag_fx[bandIdx][chIdx][0] ); - - filterTapsLeftRealPtr_fx = hBinRenderer->hBinRenConvModule->filterTapsLeftReal_fx[bandIdx][chIdx]; // Q29 - filterTapsLeftImagPtr_fx = hBinRenderer->hBinRenConvModule->filterTapsLeftImag_fx[bandIdx][chIdx]; // Q29 - filterTapsRightRealPtr_fx = hBinRenderer->hBinRenConvModule->filterTapsRightReal_fx[bandIdx][chIdx]; // Q29 - filterTapsRightImagPtr_fx = hBinRenderer->hBinRenConvModule->filterTapsRightImag_fx[bandIdx][chIdx]; // Q29 - - FOR( k = 0; k < numTimeSlots; k++ ) - { - Word64 outRealLeft_fx = 0, outRealRight_fx = 0, outImagLeft_fx = 0, outImagRight_fx = 0; - move64(); - move64(); - move64(); - move64(); - - FOR( tapIdx = hBinRenderer->hBinRenConvModule->numTapsArray[bandIdx] - 1; tapIdx > 0; tapIdx-- ) - { - filterStatesLeftRealPtr_fx[tapIdx] = filterStatesLeftRealPtr_fx[tapIdx - 1]; - move32(); - filterStatesLeftImagPtr_fx[tapIdx] = filterStatesLeftImagPtr_fx[tapIdx - 1]; - move32(); - - - outRealLeft_fx = W_mac_32_32( outRealLeft_fx, filterStatesLeftRealPtr_fx[tapIdx], filterTapsLeftRealPtr_fx[tapIdx] ); // Q30 + Q_filterStates - outRealLeft_fx = W_mac_32_32( outRealLeft_fx, L_negate( filterStatesLeftImagPtr_fx[tapIdx] ), filterTapsLeftImagPtr_fx[tapIdx] ); // Q30 + Q_filterStates - - outImagLeft_fx = W_mac_32_32( outImagLeft_fx, filterStatesLeftRealPtr_fx[tapIdx], filterTapsLeftImagPtr_fx[tapIdx] ); // Q30 + Q_filterStates - outImagLeft_fx = W_mac_32_32( outImagLeft_fx, filterStatesLeftImagPtr_fx[tapIdx], filterTapsLeftRealPtr_fx[tapIdx] ); // Q30 + Q_filterStates - - outRealRight_fx = W_mac_32_32( outRealRight_fx, filterStatesLeftRealPtr_fx[tapIdx], filterTapsRightRealPtr_fx[tapIdx] ); // Q30 + Q_filterStates - outRealRight_fx = W_mac_32_32( outRealRight_fx, L_negate( filterStatesLeftImagPtr_fx[tapIdx] ), filterTapsRightImagPtr_fx[tapIdx] ); // Q30 + Q_filterStates - - outImagRight_fx = W_mac_32_32( outImagRight_fx, filterStatesLeftRealPtr_fx[tapIdx], filterTapsRightImagPtr_fx[tapIdx] ); // Q30 + Q_filterStates - outImagRight_fx = W_mac_32_32( outImagRight_fx, filterStatesLeftImagPtr_fx[tapIdx], filterTapsRightRealPtr_fx[tapIdx] ); // Q30 + Q_filterStates - } - - shift_q = add( sub( Q_filterStates, Q_curr ), 1 ); - - IF( shift_q != 0 ) - { - outRealLeft_fx = W_shr( outRealLeft_fx, shift_q ); // Q_curr - outImagLeft_fx = W_shr( outImagLeft_fx, shift_q ); // Q_curr - outRealRight_fx = W_shr( outRealRight_fx, shift_q ); // Q_curr - outImagRight_fx = W_shr( outImagRight_fx, shift_q ); // Q_curr - hBinRenderer->hBinRenConvModule->Q_filterStatesLeft = Q_curr; - move16(); - } - - filterStatesLeftRealPtr_fx[0] = CLDFB_real[chIdx][k][bandIdx]; - move32(); - filterStatesLeftImagPtr_fx[0] = CLDFB_imag[chIdx][k][bandIdx]; - move32(); - - - /* Left Real and Imag */ - // Q29 + Q_curr - - Word32 temp1 = L_shr( filterStatesLeftRealPtr_fx[0], 1 ); - Word32 temp2 = L_shr( filterStatesLeftImagPtr_fx[0], 1 ); - - - outRealLeft_fx = W_mac_32_32( outRealLeft_fx, temp1, filterTapsLeftRealPtr_fx[0] ); - outRealLeft_fx = W_mac_32_32( outRealLeft_fx, L_negate( temp2 ), filterTapsLeftImagPtr_fx[0] ); - out_Conv_CLDFB_real[0][k][bandIdx] = W_add( out_Conv_CLDFB_real[0][k][bandIdx], outRealLeft_fx ); // Q29 - move64(); - - outImagLeft_fx = W_mac_32_32( outImagLeft_fx, temp1, filterTapsLeftImagPtr_fx[0] ); - outImagLeft_fx = W_mac_32_32( outImagLeft_fx, temp2, filterTapsLeftRealPtr_fx[0] ); - out_Conv_CLDFB_imag[0][k][bandIdx] = W_add( out_Conv_CLDFB_imag[0][k][bandIdx], outImagLeft_fx ); // Q29 - move64(); - - /* Right Real and Imag */ - outRealRight_fx = W_mac_32_32( outRealRight_fx, temp1, filterTapsRightRealPtr_fx[0] ); - outRealRight_fx = W_mac_32_32( outRealRight_fx, L_negate( temp2 ), filterTapsRightImagPtr_fx[0] ); - out_Conv_CLDFB_real[1][k][bandIdx] = W_add( out_Conv_CLDFB_real[1][k][bandIdx], outRealRight_fx ); // Q29 - move64(); - - outImagRight_fx = W_mac_32_32( outImagRight_fx, temp1, filterTapsRightImagPtr_fx[0] ); - outImagRight_fx = W_mac_32_32( outImagRight_fx, temp2, filterTapsRightRealPtr_fx[0] ); - out_Conv_CLDFB_imag[1][k][bandIdx] = W_add( out_Conv_CLDFB_imag[1][k][bandIdx], outImagRight_fx ); // Q29 - move64(); - } - } - } - - return; -} -#endif /* OPT_BIN_RENDERER_V2 */ /*------------------------------------------------------------------------- * ivas_binRenderer_convModuleOpen() @@ -1613,11 +1501,6 @@ void ivas_binRenderer_fx( ) { Word16 chIdx, i, j, k; -#ifndef OPT_BIN_RENDERER_V2 - // to be checked: feasibility with 32 bit buffers - Word64 Cldfb_RealBuffer_Binaural_64fx[BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; - Word64 Cldfb_ImagBuffer_Binaural_64fx[BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]; -#endif /* OPT_BIN_RENDERER_V2 */ push_wmops( "fastconv_binaural_rendering" ); /* Compute Convolution */ @@ -1629,10 +1512,6 @@ void ivas_binRenderer_fx( { set32_fx( Cldfb_RealBuffer_Binaural_fx[chIdx][k], 0, CLDFB_NO_CHANNELS_MAX ); set32_fx( Cldfb_ImagBuffer_Binaural_fx[chIdx][k], 0, CLDFB_NO_CHANNELS_MAX ); -#ifndef OPT_BIN_RENDERER_V2 - set64_fx( Cldfb_RealBuffer_Binaural_64fx[chIdx][k], 0, CLDFB_NO_CHANNELS_MAX ); - set64_fx( Cldfb_ImagBuffer_Binaural_64fx[chIdx][k], 0, CLDFB_NO_CHANNELS_MAX ); -#endif /* OPT_BIN_RENDERER_V2 */ } } #endif /* OPT_SBA_DEC_V2_BE */ @@ -1673,25 +1552,7 @@ void ivas_binRenderer_fx( ivas_sba2mc_cldfb_fixed( *( hBinRenderer->hInputSetup ), RealBuffer_fx, ImagBuffer_fx, hBinRenderer->nInChannels, hBinRenderer->conv_band, numTimeSlots, hBinRenderer->hoa_dec_mtx ); } -#ifdef OPT_BIN_RENDERER_V2 ivas_binRenderer_filterModule_fx( Cldfb_RealBuffer_Binaural_fx, Cldfb_ImagBuffer_Binaural_fx, RealBuffer_fx, ImagBuffer_fx, numTimeSlots, hBinRenderer, *Q_in ); -#else /* OPT_BIN_RENDERER_V2 */ - ivas_binRenderer_filterModule_fx( Cldfb_RealBuffer_Binaural_64fx, Cldfb_ImagBuffer_Binaural_64fx, RealBuffer_fx, ImagBuffer_fx, numTimeSlots, hBinRenderer, *Q_in ); - - FOR( i = 0; i < BINAURAL_CHANNELS; i++ ) - { - FOR( j = 0; j < MAX_PARAM_SPATIAL_SUBFRAMES; j++ ) - { - FOR( k = 0; k < CLDFB_NO_CHANNELS_MAX; k++ ) - { - Cldfb_RealBuffer_Binaural_fx[i][j][k] = W_extract_l( W_shr( Cldfb_RealBuffer_Binaural_64fx[i][j][k], 29 ) ); //(*Q_in + 29) - 29 - move32(); - Cldfb_ImagBuffer_Binaural_fx[i][j][k] = W_extract_l( W_shr( Cldfb_ImagBuffer_Binaural_64fx[i][j][k], 29 ) ); //(*Q_in + 29) - 29 - move32(); - } - } - } -#endif /* OPT_BIN_RENDERER_V2 */ /* Obtain the binaural dmx and compute the reverb */ IF( hBinRenderer->hReverb != NULL ) { diff --git a/lib_dec/ivas_dirac_dec_fx.c b/lib_dec/ivas_dirac_dec_fx.c index a778424dd..48fce8b95 100644 --- a/lib_dec/ivas_dirac_dec_fx.c +++ b/lib_dec/ivas_dirac_dec_fx.c @@ -2314,16 +2314,6 @@ void ivas_dirac_dec_render_sf_fx( } } -#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; @@ -3171,11 +3161,7 @@ void ivas_dirac_dec_render_sf_fx( v_multc_fixed( onset_filter_fx, 536870912 /* 0.25f in Q31 */, onset_filter_fx, hSpatParamRendCom->num_freq_bands ); -#ifdef VEC_ARITH_OPT_v1 v_add_fixed_no_hdrm( onset_filter_fx, onset_filter_subframe_fx, onset_filter_subframe_fx, hSpatParamRendCom->num_freq_bands ); /* Q31 */ -#else /* VEC_ARITH_OPT_v1 */ - v_add_fixed( onset_filter_fx, onset_filter_subframe_fx, onset_filter_subframe_fx, hSpatParamRendCom->num_freq_bands, 0 ); /* Q31 */ -#endif /* VEC_ARITH_OPT_v1 */ p_onset_filter_fx = onset_filter_subframe_fx; } ELSE @@ -3923,9 +3909,6 @@ void ivas_dirac_dec_render_sf_fx( { Word16 j, k, j2, l; Word16 num_objects, nchan_out_woLFE, lfe_index; -#ifndef FIX_1379_MASA_ANGLE_ROUND - Word16 az1, el1; -#endif Word16 n_slots_to_render; Word16 n_samples_to_render; Word16 interp_offset; @@ -3959,20 +3942,11 @@ void ivas_dirac_dec_render_sf_fx( Word16 el_q0 = extract_l( L_shr( st_ivas->hIsmMetaData[i]->elevation_fx, Q22 ) ); Word32 az1_32, el1_32; rotateAziEle_fixed( az_q0, el_q0, &az1_32, &el1_32, st_ivas->hCombinedOrientationData->Rmat_fx[0], st_ivas->hIntSetup.is_planar_setup ); -#ifndef FIX_1379_MASA_ANGLE_ROUND - az1 = extract_h( az1_32 ); - el1 = extract_h( el1_32 ); -#endif IF( st_ivas->hEFAPdata != NULL ) { -#ifdef FIX_1379_MASA_ANGLE_ROUND const Word32 azi_fx = L_shl( az1_32, Q22 - Q16 ); // Q16 -> Q22 const Word32 ele_fx = L_shl( el1_32, Q22 - Q16 ); // Q16 -> Q22 -#else - const Word32 azi_fx = L_shl( az1, Q22 ); // Q0 -> Q22 - const Word32 ele_fx = L_shl( el1, Q22 ); // Q0 -> Q22 -#endif efap_determine_gains_fx( st_ivas->hEFAPdata, st_ivas->hIsmRendererData->gains_fx[i], azi_fx, ele_fx, EFAP_MODE_EFAP ); } } @@ -4012,27 +3986,13 @@ void ivas_dirac_dec_render_sf_fx( { Word32 g_fx; w2_fx = sub( MAX16B, *w1_fx ); -#ifdef OPT_BIN_RENDERER_V2 g_fx = Madd_32_16( Mpy_32_16_1( gain_fx, *w1_fx ), prev_gain_fx, w2_fx ); // Q15 -#else /* OPT_BIN_RENDERER_V2 */ - g_fx = L_add( Mpy_32_16_1( gain_fx, *w1_fx ), Mpy_32_16_1( prev_gain_fx, w2_fx ) ); // Q15 -#endif /* OPT_BIN_RENDERER_V2 */ FOR( l = 0; l < hSpatParamRendCom->num_freq_bands; l++ ) { -#ifdef OPT_BIN_RENDERER_V2 Cldfb_RealBuffer_fx[j2][0][k * hSpatParamRendCom->num_freq_bands + l] = Madd_32_32( Cldfb_RealBuffer_fx[j2][0][k * hSpatParamRendCom->num_freq_bands + l], g_fx, *tc_re_fx ); move32(); tc_re_fx++; Cldfb_ImagBuffer_fx[j2][0][k * hSpatParamRendCom->num_freq_bands + l] = Madd_32_32( Cldfb_ImagBuffer_fx[j2][0][k * hSpatParamRendCom->num_freq_bands + l], g_fx, *tc_im_fx ); -#else /* OPT_BIN_RENDERER_V2 */ - Word32 tmp; - tmp = Mpy_32_32( g_fx, *tc_re_fx ); - Cldfb_RealBuffer_fx[j2][0][k * hSpatParamRendCom->num_freq_bands + l] = L_add( Cldfb_RealBuffer_fx[j2][0][k * hSpatParamRendCom->num_freq_bands + l], tmp ); - move32(); - tc_re_fx++; - tmp = Mpy_32_32( g_fx, *tc_im_fx ); - Cldfb_ImagBuffer_fx[j2][0][k * hSpatParamRendCom->num_freq_bands + l] = L_add( Cldfb_ImagBuffer_fx[j2][0][k * hSpatParamRendCom->num_freq_bands + l], tmp ); -#endif /* OPT_BIN_RENDERER_V2 */ move32(); tc_re_fx++; } @@ -4062,10 +4022,6 @@ void ivas_dirac_dec_render_sf_fx( Cldfb_RealBuffer_Binaural_fx, Cldfb_ImagBuffer_Binaural_fx, Cldfb_RealBuffer_fx, Cldfb_ImagBuffer_fx, &input_q ); -#ifndef OPT_BIN_RENDERER_V2 - Scale_sig32( Cldfb_RealBuffer_Binaural_fx[0][0], i_mult( BINAURAL_CHANNELS, i_mult( MAX_PARAM_SPATIAL_SUBFRAMES, CLDFB_NO_CHANNELS_MAX ) ), sub( Q6, input_q ) ); // Q6 - Scale_sig32( Cldfb_ImagBuffer_Binaural_fx[0][0], i_mult( BINAURAL_CHANNELS, i_mult( MAX_PARAM_SPATIAL_SUBFRAMES, CLDFB_NO_CHANNELS_MAX ) ), sub( Q6, input_q ) ); // Q6 -#endif /* OPT_BIN_RENDERER_V2 */ /* Inverse CLDFB*/ FOR( ch = 0; ch < st_ivas->hDecoderConfig->nchan_out; ch++ ) @@ -4086,11 +4042,7 @@ void ivas_dirac_dec_render_sf_fx( st_ivas->cldfbSynDec[ch]->Q_cldfb_state = ( Q6 - 1 ); move16(); -#ifdef OPT_AVOID_STATE_BUF_RESCALE cldfbSynthesis_ivas_fx( RealBuffer_fx, ImagBuffer_fx, synth_fx, i_mult( hSpatParamRendCom->num_freq_bands, hSpatParamRendCom->subframe_nbslots[subframe_idx] ), 0, 0, st_ivas->cldfbSynDec[ch] ); -#else /* OPT_AVOID_STATE_BUF_RESCALE */ - cldfbSynthesis_ivas_fx( RealBuffer_fx, ImagBuffer_fx, synth_fx, i_mult( hSpatParamRendCom->num_freq_bands, hSpatParamRendCom->subframe_nbslots[subframe_idx] ), 0, st_ivas->cldfbSynDec[ch] ); -#endif /* OPT_AVOID_STATE_BUF_RESCALE */ Word16 no_col = st_ivas->cldfbSynDec[ch]->no_col; move16(); @@ -4193,11 +4145,7 @@ void ivas_dirac_dec_render_sf_fx( ImagBuffer_fx[i] = Cldfb_ImagBuffer_fx[idx_in][i]; move32(); } -#ifdef OPT_AVOID_STATE_BUF_RESCALE cldfbSynthesis_ivas_fx( RealBuffer_fx, ImagBuffer_fx, &( output_buf_fx[ch][subframe_start_sample] ), num_samples_subframe, 0, 0, st_ivas->cldfbSynDec[idx_in] ); -#else /* OPT_AVOID_STATE_BUF_RESCALE */ - cldfbSynthesis_ivas_fx( RealBuffer_fx, ImagBuffer_fx, &( output_buf_fx[ch][subframe_start_sample] ), num_samples_subframe, 0, st_ivas->cldfbSynDec[idx_in] ); -#endif /* OPT_AVOID_STATE_BUF_RESCALE*/ IF( !st_ivas->hLsSetupCustom->separate_ch_found ) { @@ -4237,11 +4185,7 @@ void ivas_dirac_dec_render_sf_fx( scale_sig32( st_ivas->cldfbSynDec[cldfbSynIdx]->cldfb_state_fx, st_ivas->cldfbSynDec[cldfbSynIdx]->p_filter_length, sub( ( Q6 - 1 ), st_ivas->cldfbSynDec[cldfbSynIdx]->Q_cldfb_state ) ); // Q6-1 st_ivas->cldfbSynDec[cldfbSynIdx]->Q_cldfb_state = ( Q6 - 1 ); move16(); -#ifdef OPT_AVOID_STATE_BUF_RESCALE cldfbSynthesis_ivas_fx( RealBuffer_fx, ImagBuffer_fx, p_out, samplesToProcess, 0, 0, st_ivas->cldfbSynDec[cldfbSynIdx] ); -#else /* OPT_AVOID_STATE_BUF_RESCALE */ - cldfbSynthesis_ivas_fx( RealBuffer_fx, ImagBuffer_fx, p_out, samplesToProcess, 0, st_ivas->cldfbSynDec[cldfbSynIdx] ); -#endif /* OPT_AVOID_STATE_BUF_RESCALE*/ // Calculating length of output Word16 no_col = st_ivas->cldfbSynDec[cldfbSynIdx]->no_col; @@ -4309,11 +4253,7 @@ void ivas_dirac_dec_render_sf_fx( scale_sig32( st_ivas->cldfbSynDec[idx_in]->cldfb_state_fx, st_ivas->cldfbSynDec[idx_in]->p_filter_length, sub( ( Q6 - 1 ), st_ivas->cldfbSynDec[idx_in]->Q_cldfb_state ) ); st_ivas->cldfbSynDec[idx_in]->Q_cldfb_state = ( Q6 - 1 ); move16(); -#ifdef OPT_AVOID_STATE_BUF_RESCALE cldfbSynthesis_ivas_fx( RealBuffer_fx, ImagBuffer_fx, p_out, samplesToProcess, 0, 0, st_ivas->cldfbSynDec[idx_in] ); -#else /* OPT_AVOID_STATE_BUF_RESCALE */ - cldfbSynthesis_ivas_fx( RealBuffer_fx, ImagBuffer_fx, p_out, samplesToProcess, 0, st_ivas->cldfbSynDec[idx_in] ); -#endif /* OPT_AVOID_STATE_BUF_RESCALE */ // Scaling output from Q6-1 to Q11 Scale_sig32( p_out, out_len, ( Q11 - ( Q6 - 1 ) ) ); diff --git a/lib_dec/ivas_dirac_output_synthesis_cov_fx.c b/lib_dec/ivas_dirac_output_synthesis_cov_fx.c index 45c1a38a9..0d8e029d1 100644 --- a/lib_dec/ivas_dirac_output_synthesis_cov_fx.c +++ b/lib_dec/ivas_dirac_output_synthesis_cov_fx.c @@ -517,14 +517,7 @@ void ivas_dirac_dec_output_synthesis_cov_param_mc_synthesise_slot_fx( Word16 mixing_matrix_buffer_e; Word32 input_f_real_fx[PARAM_MC_MAX_TRANSPORT_CHANS]; Word32 input_f_imag_fx[PARAM_MC_MAX_TRANSPORT_CHANS]; -#ifdef MERGE_REQUEST_1564_SPEEDUP_ivas_dirac_dec_output_synthesis_cov_param_mc_synthesise_slot_fx_NONBE - -#else - Word32 output_f_real_fx[MAX_CICP_CHANNELS]; - Word32 output_f_imag_fx[MAX_CICP_CHANNELS]; - Word16 output_f_real_e; - Word16 output_f_imag_e; -#endif + Word32 diff_f_real_fx[MAX_CICP_CHANNELS]; Word32 diff_f_imag_fx[MAX_CICP_CHANNELS]; @@ -532,12 +525,7 @@ void ivas_dirac_dec_output_synthesis_cov_param_mc_synthesise_slot_fx( set_zero_fx( input_f_real_fx, PARAM_MC_MAX_TRANSPORT_CHANS ); set_zero_fx( input_f_imag_fx, PARAM_MC_MAX_TRANSPORT_CHANS ); -#ifdef MERGE_REQUEST_1564_SPEEDUP_ivas_dirac_dec_output_synthesis_cov_param_mc_synthesise_slot_fx_NONBE -#else - set_zero_fx( output_f_real_fx, MAX_CICP_CHANNELS ); - set_zero_fx( output_f_imag_fx, MAX_CICP_CHANNELS ); -#endif set_zero_fx( diff_f_real_fx, MAX_CICP_CHANNELS ); set_zero_fx( diff_f_imag_fx, MAX_CICP_CHANNELS ); @@ -601,7 +589,6 @@ void ivas_dirac_dec_output_synthesis_cov_param_mc_synthesise_slot_fx( } /* apply residual mixing */ -#ifdef MERGE_REQUEST_1564_SPEEDUP_ivas_dirac_dec_output_synthesis_cov_param_mc_synthesise_slot_fx_NONBE { Word16 shifter; #ifdef OPT_SBA_DEC_V2_BE @@ -638,23 +625,6 @@ void ivas_dirac_dec_output_synthesis_cov_param_mc_synthesise_slot_fx( } -#else - - matrix_product_mant_exp_fx( mixing_matrix_res_smooth_fx, mixing_matrix_res_smooth_e, nY, nY, 0, diff_f_real_fx, 25, nY, 1, 0, output_f_real_fx, &output_f_real_e ); - scale_sig32( output_f_real_fx, nY, sub( Q6, sub( Q31, output_f_real_e ) ) ); // Q6 - - - matrix_product_mant_exp_fx( mixing_matrix_res_smooth_fx, mixing_matrix_res_smooth_e, nY, nY, 0, diff_f_imag_fx, 25, nY, 1, 0, output_f_imag_fx, &output_f_imag_e ); - scale_sig32( output_f_imag_fx, nY, sub( Q6, sub( Q31, output_f_imag_e ) ) ); // Q6 - - FOR( ch_idx = 0; ch_idx < nY; ch_idx++ ) - { - Cldfb_RealBuffer_fx[ch_idx][slot_idx_sfr][band] = output_f_real_fx[ch_idx]; // Q6 - move32(); - Cldfb_ImagBuffer_fx[ch_idx][slot_idx_sfr][band] = output_f_imag_fx[ch_idx]; // Q6 - move32(); - } -#endif } ELSE { @@ -678,7 +648,6 @@ void ivas_dirac_dec_output_synthesis_cov_param_mc_synthesise_slot_fx( } /* apply mixing matrix */ -#ifdef MERGE_REQUEST_1564_SPEEDUP_ivas_dirac_dec_output_synthesis_cov_param_mc_synthesise_slot_fx_NONBE { Word16 shifter; shifter = 31 - mixing_matrix_smooth_e; @@ -707,24 +676,6 @@ void ivas_dirac_dec_output_synthesis_cov_param_mc_synthesise_slot_fx( move32(); } } -#else - - matrix_product_mant_exp_fx( mixing_matrix_smooth_fx, mixing_matrix_smooth_e, nY, nX, 0, input_f_real_fx, 25, nX, 1, 0, output_f_real_fx, &output_f_real_e ); - scale_sig32( output_f_real_fx, MAX_CICP_CHANNELS, sub( 6, sub( 31, output_f_real_e ) ) ); // Q6 - - - matrix_product_mant_exp_fx( mixing_matrix_smooth_fx, mixing_matrix_smooth_e, nY, nX, 0, input_f_imag_fx, 25, nX, 1, 0, output_f_imag_fx, &output_f_imag_e ); - scale_sig32( output_f_imag_fx, MAX_CICP_CHANNELS, sub( 6, sub( 31, output_f_imag_e ) ) ); // Q6 - - /* collect output */ - FOR( ch_idx = 0; ch_idx < nY; ch_idx++ ) - { - Cldfb_RealBuffer_fx[ch_idx][slot_idx_sfr][band] = L_add( Cldfb_RealBuffer_fx[ch_idx][slot_idx_sfr][band], output_f_real_fx[ch_idx] ); - move32(); - Cldfb_ImagBuffer_fx[ch_idx][slot_idx_sfr][band] = L_add( Cldfb_ImagBuffer_fx[ch_idx][slot_idx_sfr][band], output_f_imag_fx[ch_idx] ); - move32(); - } -#endif } } diff --git a/lib_dec/ivas_ism_param_dec_fx.c b/lib_dec/ivas_ism_param_dec_fx.c index 30a32c92c..f3e37c5c0 100644 --- a/lib_dec/ivas_ism_param_dec_fx.c +++ b/lib_dec/ivas_ism_param_dec_fx.c @@ -1533,11 +1533,7 @@ static void ivas_ism_param_dec_render_sf_fx( Scale_sig32( st_ivas->cldfbSynDec[ch]->cldfb_state_fx, st_ivas->cldfbSynDec[ch]->p_filter_length, sub( sub( Q_real, 1 ), Q11 ) ); // Q_real-1 st_ivas->cldfbSynDec[ch]->Q_cldfb_state = sub( Q_real, 1 ); move16(); -#ifdef OPT_AVOID_STATE_BUF_RESCALE cldfbSynthesis_ivas_fx( RealBuffer_fx, ImagBuffer_fx, output_f_fx[ch], i_mult( hSpatParamRendCom->num_freq_bands, hSpatParamRendCom->subframe_nbslots[subframe_idx] ), 0, 0, st_ivas->cldfbSynDec[ch] ); -#else /* OPT_AVOID_STATE_BUF_RESCALE */ - cldfbSynthesis_ivas_fx( RealBuffer_fx, ImagBuffer_fx, output_f_fx[ch], i_mult( hSpatParamRendCom->num_freq_bands, hSpatParamRendCom->subframe_nbslots[subframe_idx] ), 0, st_ivas->cldfbSynDec[ch] ); -#endif /* OPT_AVOID_STATE_BUF_RESCALE */ Scale_sig32( st_ivas->cldfbSynDec[ch]->cldfb_state_fx, st_ivas->cldfbSynDec[ch]->p_filter_length, sub( Q11, sub( Q_real, 1 ) ) ); // Q11 st_ivas->cldfbSynDec[ch]->Q_cldfb_state = Q11; move16(); diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index a36982777..fefae52f9 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -2137,11 +2137,7 @@ ivas_error ivas_jbm_dec_render_fx( /* add already rendered SBA part */ FOR( n = 0; n < nchan_out; n++ ) { -#ifdef VEC_ARITH_OPT_v1 v_add_fixed_no_hdrm( p_output_fx[n], p_tc_fx[n + st_ivas->nchan_ism], p_output_fx[n], *nSamplesRendered ); -#else /* VEC_ARITH_OPT_v1 */ - v_add_fixed( p_output_fx[n], p_tc_fx[n + st_ivas->nchan_ism], p_output_fx[n], *nSamplesRendered, 0 ); -#endif /* VEC_ARITH_OPT_v1 */ } } ELSE IF( EQ_32( st_ivas->renderer_type, RENDERER_OSBA_AMBI ) || EQ_32( st_ivas->renderer_type, RENDERER_OSBA_LS ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) ) diff --git a/lib_dec/ivas_mc_param_dec_fx.c b/lib_dec/ivas_mc_param_dec_fx.c index 2ba8c9c9e..71c1b39fc 100644 --- a/lib_dec/ivas_mc_param_dec_fx.c +++ b/lib_dec/ivas_mc_param_dec_fx.c @@ -2084,13 +2084,8 @@ void ivas_param_mc_dec_render_fx( { IF( hLsSetup.index_lfe[idx_lfe] != ch ) { -#ifdef VEC_ARITH_OPT_v1 v_add_fixed_no_hdrm( Cldfb_RealBuffer_fx[ch][slot_idx], Cldfb_RealBuffer_fx[hLsSetup.index_lfe[idx_lfe]][slot_idx], Cldfb_RealBuffer_fx[ch][slot_idx], 1 ); v_add_fixed_no_hdrm( Cldfb_ImagBuffer_fx[ch][slot_idx], Cldfb_ImagBuffer_fx[hLsSetup.index_lfe[idx_lfe]][slot_idx], Cldfb_ImagBuffer_fx[ch][slot_idx], 1 ); -#else /* VEC_ARITH_OPT_v1 */ - v_add_fixed( Cldfb_RealBuffer_fx[ch][slot_idx], Cldfb_RealBuffer_fx[hLsSetup.index_lfe[idx_lfe]][slot_idx], Cldfb_RealBuffer_fx[ch][slot_idx], 1, 0 ); - v_add_fixed( Cldfb_ImagBuffer_fx[ch][slot_idx], Cldfb_ImagBuffer_fx[hLsSetup.index_lfe[idx_lfe]][slot_idx], Cldfb_ImagBuffer_fx[ch][slot_idx], 1, 0 ); -#endif /* VEC_ARITH_OPT_v1 */ } } } @@ -2151,16 +2146,6 @@ void ivas_param_mc_dec_render_fx( } } -#ifndef OPT_BIN_RENDERER_V2 - FOR( Word16 idx1 = 0; idx1 < BINAURAL_CHANNELS; idx1++ ) - { - FOR( Word16 idx2 = 0; idx2 < hParamMC->subframe_nbslots[subframe_idx]; idx2++ ) - { - Scale_sig32( Cldfb_RealBuffer_Binaural_fx[idx1][idx2], CLDFB_NO_CHANNELS_MAX, sub( Q6, input_q ) ); // Q6 - Scale_sig32( Cldfb_ImagBuffer_Binaural_fx[idx1][idx2], CLDFB_NO_CHANNELS_MAX, sub( Q6, input_q ) ); // Q6 - } - } -#endif /* OPT_BIN_RENDERER_V2 */ /* update combined orientation access index */ ivas_combined_orientation_update_index( st_ivas->hCombinedOrientationData, hParamMC->num_freq_bands * hParamMC->subframe_nbslots[subframe_idx] ); } @@ -2196,13 +2181,8 @@ void ivas_param_mc_dec_render_fx( Word16 len = add( imult1616( slot_idx_start_cldfb_synth, hParamMC->num_freq_bands ), imult1616( hParamMC->num_freq_bands, hParamMC->subframe_nbslots[subframe_idx] ) ); scale_sig32( output_f_fx[ch], len, 5 - 11 ); -#ifdef OPT_AVOID_STATE_BUF_RESCALE cldfbSynthesis_ivas_fx( RealBuffer_fx, ImagBuffer_fx, &( output_f_fx[ch][slot_idx_start_cldfb_synth * hParamMC->num_freq_bands] ), imult1616( hParamMC->num_freq_bands, hParamMC->subframe_nbslots[subframe_idx] ), 0, 0, st_ivas->cldfbSynDec[ch] ); -#else /* OPT_AVOID_STATE_BUF_RESCALE */ - cldfbSynthesis_ivas_fx( RealBuffer_fx, ImagBuffer_fx, &( output_f_fx[ch][slot_idx_start_cldfb_synth * hParamMC->num_freq_bands] ), - imult1616( hParamMC->num_freq_bands, hParamMC->subframe_nbslots[subframe_idx] ), 0, st_ivas->cldfbSynDec[ch] ); -#endif /* OPT_AVOID_STATE_BUF_RESCALE */ scale_sig32( output_f_fx[ch], len, 11 - 5 ); // Q11 } diff --git a/lib_dec/ivas_mc_paramupmix_dec_fx.c b/lib_dec/ivas_mc_paramupmix_dec_fx.c index 7a1ef1126..5840cb08f 100644 --- a/lib_dec/ivas_mc_paramupmix_dec_fx.c +++ b/lib_dec/ivas_mc_paramupmix_dec_fx.c @@ -847,16 +847,6 @@ static void ivas_mc_paramupmix_dec_sf( Cldfb_RealBuffer_subfr_fx, Cldfb_ImagBuffer_subfr_fx, &input_q ); -#ifndef OPT_BIN_RENDERER_V2 - FOR( Word16 idx1 = 0; idx1 < BINAURAL_CHANNELS; idx1++ ) - { - FOR( Word16 idx2 = 0; idx2 < MAX_PARAM_SPATIAL_SUBFRAMES; idx2++ ) - { - Scale_sig32( Cldfb_RealBuffer_Binaural_fx[idx1][idx2], CLDFB_NO_CHANNELS_MAX, sub( 6, input_q ) ); // Q6 - Scale_sig32( Cldfb_ImagBuffer_Binaural_fx[idx1][idx2], CLDFB_NO_CHANNELS_MAX, sub( 6, input_q ) ); // Q6 - } - } -#endif /* OPT_BIN_RENDERER_V2 */ /* Implement CLDFB synthesis */ FOR( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { @@ -868,28 +858,10 @@ static void ivas_mc_paramupmix_dec_sf( RealBuffer_fx[slot_idx] = Cldfb_RealBuffer_Binaural_fx[ch][slot_idx]; // Q6 ImagBuffer_fx[slot_idx] = Cldfb_ImagBuffer_Binaural_fx[ch][slot_idx]; // Q6 } -#ifndef OPT_AVOID_STATE_BUF_RESCALE - scale_sig32( st_ivas->cldfbSynDec[ch]->cldfb_state_fx, st_ivas->cldfbSynDec[ch]->cldfb_size, Q5 - Q11 ); // Q11 -> Q5 - st_ivas->cldfbSynDec[ch]->Q_cldfb_state = Q5; - move16(); - cldfbSynthesis_ivas_fx( RealBuffer_fx, ImagBuffer_fx, &( output_fx[ch][0] ), imult1616( maxBand, st_ivas->hTcBuffer->subframe_nbslots[subframeIdx] ), 0, st_ivas->cldfbSynDec[ch] ); // output_fx returned in Q5 -#else /* OPT_AVOID_STATE_BUF_RESCALE */ cldfbSynthesis_ivas_fx( RealBuffer_fx, ImagBuffer_fx, &( output_fx[ch][0] ), imult1616( maxBand, st_ivas->hTcBuffer->subframe_nbslots[subframeIdx] ), 6, 0, st_ivas->cldfbSynDec[ch] ); // output_fx returned in Q11 -#endif /* OPT_AVOID_STATE_BUF_RESCALE */ -#ifndef OPT_AVOID_STATE_BUF_RESCALE - scale_sig32( st_ivas->cldfbSynDec[ch]->cldfb_state_fx, st_ivas->cldfbSynDec[ch]->cldfb_size, Q11 - Q5 ); // Q5 -> Q11 - st_ivas->cldfbSynDec[ch]->Q_cldfb_state = Q11; - move16(); -#endif /* OPT_AVOID_STATE_BUF_RESCALE */ } -#ifndef OPT_AVOID_STATE_BUF_RESCALE - FOR( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) - { - Scale_sig32( output_fx[ch], imult1616( maxBand, st_ivas->hTcBuffer->subframe_nbslots[subframeIdx] ), 6 ); // Q5 -> Q11 - } -#endif /* OPT_AVOID_STATE_BUF_RESCALE */ } ELSE { @@ -915,13 +887,8 @@ static void ivas_mc_paramupmix_dec_sf( ptr_re_fx[0] = Cldfb_RealBuffer_fx[ch][slot_idx]; // Q6 ptr_im_fx[0] = Cldfb_ImagBuffer_fx[ch][slot_idx]; // Q6 -#ifdef OPT_AVOID_STATE_BUF_RESCALE cldfbSynthesis_ivas_fx( ptr_re_fx, ptr_im_fx, &( pPcm_temp_fx[ch][L_mult0( hMCParamUpmix->num_freq_bands, slot_idx )] ), hMCParamUpmix->num_freq_bands, 0, 0, st_ivas->cldfbSynDec[ch] ); -#else /* OPT_AVOID_STATE_BUF_RESCALE */ - cldfbSynthesis_ivas_fx( ptr_re_fx, ptr_im_fx, &( pPcm_temp_fx[ch][L_mult0( hMCParamUpmix->num_freq_bands, slot_idx )] ), - hMCParamUpmix->num_freq_bands, 0, st_ivas->cldfbSynDec[ch] ); -#endif /* OPT_AVOID_STATE_BUF_RESCALE */ } scale_sig32( st_ivas->cldfbSynDec[ch]->cldfb_state_fx, st_ivas->cldfbSynDec[ch]->cldfb_size, sub( Q11, st_ivas->cldfbSynDec[ch]->Q_cldfb_state ) ); // Q6 -> Q11 st_ivas->cldfbSynDec[ch]->Q_cldfb_state = Q11; diff --git a/lib_dec/ivas_sba_rendering_internal_fx.c b/lib_dec/ivas_sba_rendering_internal_fx.c index ba8c529d7..374efb593 100644 --- a/lib_dec/ivas_sba_rendering_internal_fx.c +++ b/lib_dec/ivas_sba_rendering_internal_fx.c @@ -77,11 +77,7 @@ void ivas_sba2mc_cldfb_fixed( FOR( m = 0; m < nb_channels_in; m++ ) { -#ifdef OPT_BIN_RENDERER_V2 g_fx = L_shl_sat( hoa_dec_mtx[( ( SBA_NHARM_HOA3 * n ) + m )], Q2 ); -#else /* OPT_BIN_RENDERER_V2 */ - g_fx = hoa_dec_mtx[( ( SBA_NHARM_HOA3 * n ) + m )]; // Q29 -#endif /* OPT_BIN_RENDERER_V2 */ p_realOut_fx = realOut_fx[n]; p_imagOut_fx = imagOut_fx[n]; @@ -91,15 +87,9 @@ void ivas_sba2mc_cldfb_fixed( p_imag_fx = ImagBuffer[m][iBlock]; /*Q_imag*/ FOR( iBand = 0; iBand < nb_bands; iBand++ ) { -#ifdef OPT_BIN_RENDERER_V2 *p_realOut_fx = Madd_32_32( *p_realOut_fx, g_fx, *( p_real_fx++ ) ); // Q_real move32(); *p_imagOut_fx = Madd_32_32( *p_imagOut_fx, g_fx, *( p_imag_fx++ ) ); // Q_imag -#else /* OPT_BIN_RENDERER_V2 */ - *p_realOut_fx = L_add( *p_realOut_fx, Mpy_32_32( L_shl_sat( g_fx, Q2 ), *( p_real_fx++ ) ) ); // Q_real - move32(); - *p_imagOut_fx = L_add( *p_imagOut_fx, Mpy_32_32( L_shl_sat( g_fx, Q2 ), *( p_imag_fx++ ) ) ); // Q_imag -#endif /* OPT_BIN_RENDERER_V2 */ move32(); p_realOut_fx++; p_imagOut_fx++; @@ -177,11 +167,7 @@ void ivas_mc2sba_fx( /* Add LFE to omni W with gain*/ FOR( k = 0; k < output_frame; k++ ) { -#ifdef OPT_BIN_RENDERER_V2 buffer_tmp_fx[0][k] = Madd_32_16( buffer_tmp_fx[0][k], L_shl( in_buffer_td_fx[i][k], 1 ), gain_lfe_fx ); /*Q+14-15+1==Q*/ -#else /* OPT_BIN_RENDERER_V2 */ - buffer_tmp_fx[0][k] = L_add( buffer_tmp_fx[0][k], L_shl( Mult_32_16( in_buffer_td_fx[i][k], gain_lfe_fx ), 1 ) ); /*Q+14-15+1==Q*/ -#endif /* OPT_BIN_RENDERER_V2 */ move32(); } } @@ -210,11 +196,7 @@ void ivas_mc2sba_fx( { FOR( k = 0; k < output_frame; k++ ) { -#ifdef OPT_BIN_RENDERER_V2 buffer_tmp_fx[j][k] = Madd_32_32( buffer_tmp_fx[j][k], L_shl_sat( in_buffer_td_fx[i][k], 2 ), gains_fx[j] ); /*Q+29-31+2==Q*/ -#else /* OPT_BIN_RENDERER_V2 */ - buffer_tmp_fx[j][k] = L_add( buffer_tmp_fx[j][k], L_shl( Mult_32_32( in_buffer_td_fx[i][k], gains_fx[j] ), 2 ) ); /*Q+29-31+2==Q*/ -#endif /* OPT_BIN_RENDERER_V2 */ move32(); } } diff --git a/lib_dec/ivas_spar_decoder_fx.c b/lib_dec/ivas_spar_decoder_fx.c index fa5f6779f..abf953f37 100644 --- a/lib_dec/ivas_spar_decoder_fx.c +++ b/lib_dec/ivas_spar_decoder_fx.c @@ -787,11 +787,7 @@ void ivas_spar_get_cldfb_gains_fx( cldfbAnalysis_ts_fx_fixed_q( ts_inout_fx, ts_re_fx, ts_im_fx, num_cldfb_bands, cldfbAnaDec0, &q_cldfb ); cldfb_reset_memory_fx( cldfbSynDec0 ); -#ifdef OPT_AVOID_STATE_BUF_RESCALE cldfbSynthesis_ivas_fx( pp_ts_re_fx, pp_ts_im_fx, ts_inout_fx, num_cldfb_bands, 0, 0, cldfbSynDec0 ); -#else /* OPT_AVOID_STATE_BUF_RESCALE */ - cldfbSynthesis_ivas_fx( pp_ts_re_fx, pp_ts_im_fx, ts_inout_fx, num_cldfb_bands, 0, cldfbSynDec0 ); -#endif /* OPT_AVOID_STATE_BUF_RESCALE */ FOR( sample = 0; sample < stride; sample++ ) { T_fx[( ( slot * stride ) + sample )][slot] = ts_inout_fx[sample]; /*Q21*/ @@ -2104,11 +2100,7 @@ void ivas_spar_dec_upmixer_sf_fx( { FOR( ts = 0; ts < hSpar->subframe_nbslots[hSpar->subframes_rendered]; ts++ ) { -#ifdef OPT_AVOID_STATE_BUF_RESCALE cldfbSynthesis_ivas_fx( &cldfb_in_ts_re_fx[idx_in][ts], &cldfb_in_ts_im_fx[idx_in][ts], &output_fx[ch][i_mult( ts, num_cldfb_bands )], num_cldfb_bands, 6, 0, st_ivas->cldfbSynDec[idx_in] ); -#else /* OPT_AVOID_STATE_BUF_RESCALE */ - cldfbSynthesis_ivas_fx( &cldfb_in_ts_re_fx[idx_in][ts], &cldfb_in_ts_im_fx[idx_in][ts], &output_fx[ch][i_mult( ts, num_cldfb_bands )], num_cldfb_bands, 6, st_ivas->cldfbSynDec[idx_in] ); -#endif /* OPT_AVOID_STATE_BUF_RESCALE */ } } @@ -2123,11 +2115,7 @@ void ivas_spar_dec_upmixer_sf_fx( { FOR( ts = 0; ts < hSpar->subframe_nbslots[hSpar->subframes_rendered]; ts++ ) { -#ifdef OPT_AVOID_STATE_BUF_RESCALE cldfbSynthesis_ivas_fx( &cldfb_in_ts_re_fx[out_ch][ts], &cldfb_in_ts_im_fx[out_ch][ts], &output_fx[out_ch][i_mult( ts, num_cldfb_bands )], num_cldfb_bands, 6, 0, st_ivas->cldfbSynDec[out_ch] ); -#else /* OPT_AVOID_STATE_BUF_RESCALE */ - cldfbSynthesis_ivas_fx( &cldfb_in_ts_re_fx[out_ch][ts], &cldfb_in_ts_im_fx[out_ch][ts], &output_fx[out_ch][i_mult( ts, num_cldfb_bands )], num_cldfb_bands, 6, st_ivas->cldfbSynDec[out_ch] ); -#endif /* OPT_AVOID_STATE_BUF_RESCALE */ } } } diff --git a/lib_dec/ivas_stereo_cng_dec_fx.c b/lib_dec/ivas_stereo_cng_dec_fx.c index 8ec147ff7..d48e035a6 100644 --- a/lib_dec/ivas_stereo_cng_dec_fx.c +++ b/lib_dec/ivas_stereo_cng_dec_fx.c @@ -1446,11 +1446,7 @@ void stereo_cna_update_params_fx( { IF( EQ_16( hCPE->nchan_out, 1 ) ) { -#ifdef OPT_STEREO_32KBPS_V1 c_LR_fx = MAX_32; -#else /* OPT_STEREO_32KBPS_V1 */ - c_LR_fx = MAX_WORD16; -#endif /* OPT_STEREO_32KBPS_V1 */ move32(); c_ILD_fx = 0; move32(); @@ -1513,11 +1509,7 @@ void stereo_cna_update_params_fx( dotLR_fx_q = add( dotLR_fx_q, sub( sub( 31, temp_res_q ), 31 ) ); dotLR_fx = W_deposit32_l( L_shl_sat( W_extract_l( dotLR_fx ), sub( 31, dotLR_fx_q ) ) ); /* Q31 */ /* estimate L/R correlation factor and ILD in time domain */ -#ifdef OPT_STEREO_32KBPS_V1 c_LR_fx = W_extract_l( dotLR_fx ); /* Q31 */ -#else /* OPT_STEREO_32KBPS_V1 */ - c_LR_fx = extract_h( W_extract_l( dotLR_fx ) ); /* Q15 */ -#endif /* OPT_STEREO_32KBPS_V1 */ temp_res_q = 0; move16(); @@ -1556,24 +1548,15 @@ void stereo_cna_update_params_fx( /* update of long-term ILD and LR correlation factors for stereo CNA */ IF( !hFdCngDec->first_cna_noise_updated ) { -#ifdef OPT_STEREO_32KBPS_V1 hFdCngDec->cna_LR_LT_fx = extract_h( c_LR_fx ); -#else /* OPT_STEREO_32KBPS_V1 */ - hFdCngDec->cna_LR_LT_fx = extract_l( c_LR_fx ); -#endif /* OPT_STEREO_32KBPS_V1 */ move16(); hFdCngDec->cna_ILD_LT_fx = extract_l( c_ILD_fx ); move16(); } ELSE { -#ifdef OPT_STEREO_32KBPS_V1 hFdCngDec->cna_LR_LT_fx = extract_h( L_add_sat( Mpy_32_16_1( STEREO_CNA_LR_CORR_LT_FILT_FX, hFdCngDec->cna_LR_LT_fx ), Mpy_32_32( ONE_IN_Q31 - STEREO_CNA_LR_CORR_LT_FILT_FX, c_LR_fx ) ) ); /* Q31 */ -#else /* OPT_STEREO_32KBPS_V1 */ - hFdCngDec->cna_LR_LT_fx = extract_h( L_add_sat( Mpy_32_16_1( STEREO_CNA_LR_CORR_LT_FILT_FX, hFdCngDec->cna_LR_LT_fx ), - Mpy_32_16_1( L_sub( ONE_IN_Q31, STEREO_CNA_LR_CORR_LT_FILT_FX ), extract_l( c_LR_fx ) ) ) ); /* Q31 */ -#endif /* OPT_STEREO_32KBPS_V1 */ move16(); hFdCngDec->cna_ILD_LT_fx = extract_h( L_add_sat( Mpy_32_16_1( STEREO_CNA_ILD_LT_FILT_FX, hFdCngDec->cna_ILD_LT_fx ), diff --git a/lib_dec/ivas_stereo_dft_dec_fx.c b/lib_dec/ivas_stereo_dft_dec_fx.c index 11f266d2e..4aebd5145 100644 --- a/lib_dec/ivas_stereo_dft_dec_fx.c +++ b/lib_dec/ivas_stereo_dft_dec_fx.c @@ -1881,10 +1881,6 @@ void stereo_dft_dec_fx( HANDLE_FD_CNG_COM hFdCngCom = hFdCngDec->hFdCngCom; Word16 *cna_seed = &( hFdCngCom->seed ); Word32 DFT_W, DFT_Y; -#ifndef OPT_STEREO_32KBPS_V1 - Word16 q_samp_ratio = Q15; - move16(); -#endif /* OPT_STEREO_32KBPS_V1 */ Word16 len; output_frame = (Word16) Mpy_32_32( L_add( st0->output_Fs, FRAMES_PER_SEC_BY_2 ), ONE_BY_FRAMES_PER_SEC_Q31 ); /* Q0 */ @@ -1893,12 +1889,7 @@ void stereo_dft_dec_fx( * Initialization *-----------------------------------------------------------------*/ -#ifdef OPT_STEREO_32KBPS_V1 samp_ratio = divide3232( st0->sr_core, st0->output_Fs ); // Q15 -#else /* OPT_STEREO_32KBPS_V1 */ - samp_ratio = (Word16) BASOP_Util_Divide3232_Scale( st0->sr_core, st0->output_Fs, &q_samp_ratio ); - samp_ratio = shr( samp_ratio, sub( Q15 - Q12, q_samp_ratio ) ); -#endif /* OPT_STEREO_32KBPS_V1 */ stop = shr( STEREO_DFT32MS_N_32k, 1 ); @@ -2473,17 +2464,10 @@ void stereo_dft_dec_fx( /*Nyquist Freq.*/ IF( EQ_16( hStereoDft->band_limits[b], shr( hStereoDft->NFFT, 1 ) ) ) { -#ifdef OPT_STEREO_32KBPS_V1 DFT_L[1] = Madd_32_16( pDFT_DMX[1], pDFT_DMX[1], g ); /* qDFT */ move32(); DFT_R[1] = Msub_32_16( pDFT_DMX[1], pDFT_DMX[1], g ); /* qDFT */ move32(); -#else /* OPT_STEREO_32KBPS_V1 */ - DFT_L[1] = L_add( pDFT_DMX[1], Mpy_32_16_1( pDFT_DMX[1], g ) ); /* qDFT */ - move32(); - DFT_R[1] = L_sub( pDFT_DMX[1], Mpy_32_16_1( pDFT_DMX[1], g ) ); /* qDFT */ - move32(); -#endif /* OPT_STEREO_32KBPS_V1 */ DFT_L[1] = Mpy_32_16_1( DFT_L[1], INV_SQRT2_FX_Q15 ); /* qDFT */ move32(); DFT_R[1] = Mpy_32_16_1( DFT_R[1], INV_SQRT2_FX_Q15 ); /* qDFT */ @@ -2616,34 +2600,20 @@ void stereo_dft_dec_fx( q_cna_level = sub( Q31, add( q_cna_level, Q16 ) ); /* generate comfort noise from gaussian noise and add to the decoded DFT spectrum */ -#ifdef OPT_STEREO_32KBPS_V1 Word16 shift = sub( q_cna_level, hStereoDft->q_dft ); -#endif /* OPT_STEREO_32KBPS_V1 */ N1 = L_shl( Mpy_32_16_1( scale_fact, rand_gauss_fix( &ftmp, cna_seed ) ), Q2 ); /* q_cna_level */ N2 = L_shl( Mpy_32_16_1( scale_fact, rand_gauss_fix( &ftmp, cna_seed ) ), Q2 ); /* q_cna_level */ -#ifdef OPT_STEREO_32KBPS_V1 l_tmp = Madd_32_16( Madd_32_16( N1, N1, g ), N2, gamma ); /* q_cna_level */ l_tmp = L_shr( l_tmp, shift ); /* q_dft */ -#else /* OPT_STEREO_32KBPS_V1 */ - l_tmp = L_add( Madd_32_16( N1, N1, g ), Mpy_32_16_1( N2, gamma ) ); /* q_cna_level */ - l_tmp = L_shr( l_tmp, sub( q_cna_level, hStereoDft->q_dft ) ); /* q_dft */ -#endif /* OPT_STEREO_32KBPS_V1 */ DFT_L[2 * i] = L_add_sat( DFT_L[2 * i], l_tmp ); /* q_dft */ move32(); -#ifdef OPT_STEREO_32KBPS_V1 l_tmp = Msub_32_16( Msub_32_16( N1, N1, g ), N2, gamma ); /* q_cna_level */ l_tmp = L_shr( l_tmp, shift ); /* q_dft */ DFT_R[2 * i] = L_add_sat( DFT_R[2 * i], l_tmp ); /* q_dft */ -#else /* OPT_STEREO_32KBPS_V1 */ - l_tmp = L_sub( Msub_32_16( N1, N1, g ), Mpy_32_16_1( N2, gamma ) ); /* q_cna_level */ - l_tmp = L_shr( l_tmp, sub( q_cna_level, hStereoDft->q_dft ) ); /* q_dft */ - DFT_R[2 * i] = L_add( DFT_R[2 * i], l_tmp ); /* q_dft */ -#endif /* OPT_STEREO_32KBPS_V1 */ move32(); N1 = L_shl( Mpy_32_16_1( scale_fact, rand_gauss_fix( &ftmp, cna_seed ) ), Q2 ); /* q_cna_level */ N2 = L_shl( Mpy_32_16_1( scale_fact, rand_gauss_fix( &ftmp, cna_seed ) ), Q2 ); /* q_cna_level */ -#ifdef OPT_STEREO_32KBPS_V1 l_tmp = Madd_32_16( Madd_32_16( N1, N1, g ), N2, gamma ); /* q_cna_level */ l_tmp = L_shr( l_tmp, shift ); /* q_dft */ DFT_L[2 * i + 1] = L_add_sat( DFT_L[2 * i + 1], l_tmp ); /* q_dft */ @@ -2652,16 +2622,6 @@ void stereo_dft_dec_fx( l_tmp = L_shr( l_tmp, shift ); /* q_dft */ DFT_R[2 * i + 1] = L_add_sat( DFT_R[2 * i + 1], l_tmp ); /* q_dft */ move32(); -#else /* OPT_STEREO_32KBPS_V1 */ - l_tmp = L_add( Madd_32_16( N1, N1, g ), Mpy_32_16_1( N2, gamma ) ); /* q_cna_level */ - l_tmp = L_shr( l_tmp, sub( q_cna_level, hStereoDft->q_dft ) ); /* q_dft */ - DFT_L[2 * i + 1] = L_add( DFT_L[2 * i + 1], l_tmp ); /* q_dft */ - move32(); - l_tmp = L_sub( Msub_32_16( N1, N1, g ), Mpy_32_16_1( N2, gamma ) ); /* q_cna_level */ - l_tmp = L_shr( l_tmp, sub( q_cna_level, hStereoDft->q_dft ) ); /* q_dft */ - DFT_R[2 * i + 1] = L_add( DFT_R[2 * i + 1], l_tmp ); /* q_dft */ - move32(); -#endif /* OPT_STEREO_32KBPS_V1 */ } } @@ -2749,12 +2709,7 @@ static void stereo_dft_compute_td_stefi_params_fx( return; } -#ifdef OPT_STEREO_32KBPS_V1 bin0 = round_fx( L_mult0( hStereoDft->NFFT, samp_ratio ) ); -#else /* OPT_STEREO_32KBPS_V1 */ - bin0 = extract_l( L_shr_r( Mpy_32_16_1( (Word32) hStereoDft->NFFT, samp_ratio ), 1 ) ); /* Q0 */ - bin0 = shl( bin0, Q3 ); -#endif /* OPT_STEREO_32KBPS_V1 */ bin0 = s_min( bin0, hStereoDft->band_limits[hStereoDft->nbands] ); /* Q0 */ b = hStereoDft->nbands; /* Q0 */ move16(); @@ -2919,11 +2874,7 @@ static void stereo_dft_dequantize_ipd_fx( *-------------------------------------------------------------------------*/ void stereo_dft_generate_res_pred_fx( STEREO_DFT_DEC_DATA_HANDLE hStereoDft, /* i/o: decoder DFT stereo handle */ -#ifdef OPT_STEREO_32KBPS_V1 const Word16 samp_ratio, /* i : sampling ratio Q15*/ -#else /* OPT_STEREO_32KBPS_V1 */ - const Word16 samp_ratio, /* i : sampling ratio Q13*/ -#endif /* OPT_STEREO_32KBPS_V1 */ Word32 *pDFT_DMX, /* i : downmix signal qDFT*/ Word32 *DFT_PRED_RES, /* o : residual prediction signal qDFT*/ Word32 *pPredGain, /* i : residual prediction gains Q31*/ @@ -2941,9 +2892,6 @@ void stereo_dft_generate_res_pred_fx( /* variables for enhanced stereo filling */ Word16 norm_fac, q_norm_fac; -#ifndef OPT_STEREO_32KBPS_V1 - Word16 lim_norm_fac; -#endif /* OPT_STEREO_32KBPS_V1 */ Word16 q_sqrt; Word16 alpha; // gain_limit; @@ -2957,12 +2905,7 @@ void stereo_dft_generate_res_pred_fx( Word32 pred_gain_avg; Word32 g2; Word16 nbands_respred; -#ifdef OPT_STEREO_32KBPS_V1 Word16 q_new, diff; -#else /* OPT_STEREO_32KBPS_V1 */ - q_norm_fac = 0; - move16(); -#endif /* OPT_STEREO_32KBPS_V1 */ Word16 len; push_wmops( "gen_respred" ); @@ -2985,12 +2928,7 @@ void stereo_dft_generate_res_pred_fx( /* In ACELP mode the downmix signal is not available in bandwidth extension area. * * Therefore, the downmix energy in the corresponding subbands is estimated. */ -#ifdef OPT_STEREO_32KBPS_V1 bin0 = round_fx( L_mult0( hStereoDft->NFFT, samp_ratio ) ); -#else /* OPT_STEREO_32KBPS_V1 */ - bin0 = (Word16) ( L_shr( L_add( L_mult0( hStereoDft->NFFT, samp_ratio ), ONE_IN_Q12 ), Q12 + 1 ) ); /* Q0 */ - move16(); -#endif /* OPT_STEREO_32KBPS_V1 */ bin0 = s_min( bin0, hStereoDft->band_limits[hStereoDft->nbands] ); /* Q0 */ b = hStereoDft->nbands; move16(); @@ -3035,22 +2973,12 @@ void stereo_dft_generate_res_pred_fx( len = s_min( hStereoDft->band_limits[b + 1], bin0 ); FOR( i = hStereoDft->band_limits[b]; i < len; i++ ) { -#ifdef OPT_STEREO_32KBPS_V1 dmx_nrg_64bit = W_mac_32_32( W_mac_32_32( dmx_nrg_64bit, pDFT_DMX[2 * i], pDFT_DMX[2 * i] ), pDFT_DMX[2 * i + 1], pDFT_DMX[2 * i + 1] ); /* 2 * q_dft + 1 */ rev_nrg_64bit = W_mac_32_32( W_mac_32_32( rev_nrg_64bit, ap_filt_DMX[2 * i], ap_filt_DMX[2 * i] ), ap_filt_DMX[2 * i + 1], ap_filt_DMX[2 * i + 1] ); /* 2 * q_dft + 1 */ -#else /* OPT_STEREO_32KBPS_V1 */ - dmx_nrg_64bit = W_add( dmx_nrg_64bit, - W_add( W_mult0_32_32( pDFT_DMX[2 * i], pDFT_DMX[2 * i] ), - W_mult0_32_32( pDFT_DMX[2 * i + 1], pDFT_DMX[2 * i + 1] ) ) ); /* 2 * q_dft */ - rev_nrg_64bit = W_add( rev_nrg_64bit, - W_add( W_mult0_32_32( ap_filt_DMX[2 * i], ap_filt_DMX[2 * i] ), - W_mult0_32_32( ap_filt_DMX[2 * i + 1], ap_filt_DMX[2 * i + 1] ) ) ); /* 2 * q_dft */ -#endif /* OPT_STEREO_32KBPS_V1 */ } -#ifdef OPT_STEREO_32KBPS_V1 q_new = add( shl( hStereoDft->q_dft, 1 ), 1 ); q_shift = W_norm( dmx_nrg_64bit ); dmx_nrg = W_shl_sat_l( dmx_nrg_64bit, sub( q_shift, 32 ) ); // 2 * hStereoDft->q_dft + 1 - (q_shift - 32) @@ -3059,54 +2987,26 @@ void stereo_dft_generate_res_pred_fx( rev_nrg = W_shl_sat_l( rev_nrg_64bit, sub( q_shift, 32 ) ); // 2 * hStereoDft->q_dft + 1 - (q_shift - 32) rev_nrg_q = add( q_new, sub( q_shift, 32 ) ); move16(); -#else /* OPT_STEREO_32KBPS_V1 */ - q_shift = W_norm( dmx_nrg_64bit ); - dmx_nrg = W_extract_l( W_shl( dmx_nrg_64bit, sub( q_shift, 32 ) ) ); // 2 * hStereoDft->q_dft + (q_shift - 32) - dmx_nrg_q = add( imult1616( 2, hStereoDft->q_dft ), sub( q_shift, 32 ) ); - q_shift = W_norm( rev_nrg_64bit ); - rev_nrg = W_extract_l( W_shl( rev_nrg_64bit, sub( q_shift, 32 ) ) ); // 2 * hStereoDft->q_dft + (q_shift - 32) - rev_nrg_q = add( imult1616( 2, hStereoDft->q_dft ), sub( q_shift, 32 ) ); -#endif /* OPT_STEREO_32KBPS_V1 */ /* Reach a common Q for dmx_nrg and rev_nrg */ q_com = s_min( dmx_nrg_q, rev_nrg_q ); dmx_nrg = L_shl( dmx_nrg, sub( q_com, dmx_nrg_q ) ); /* q_com */ rev_nrg = L_shl( rev_nrg, sub( q_com, rev_nrg_q ) ); /* q_com */ -#ifdef OPT_STEREO_32KBPS_V1 diff = sub( hStereoDft->q_smoothed_nrg, q_com ); IF( diff < 0 ) -#else /* OPT_STEREO_32KBPS_V1 */ - IF( LT_16( hStereoDft->q_smoothed_nrg, q_com ) ) -#endif /* OPT_STEREO_32KBPS_V1 */ { -#ifdef OPT_STEREO_32KBPS_V1 rev_nrg = L_shl( rev_nrg, shl( diff, 1 ) ); dmx_nrg = L_shl( dmx_nrg, shl( diff, 1 ) ); -#else /* OPT_STEREO_32KBPS_V1 */ - rev_nrg = L_shr( rev_nrg, shl( sub( q_com, hStereoDft->q_smoothed_nrg ), 1 ) ); - dmx_nrg = L_shr( dmx_nrg, shl( sub( q_com, hStereoDft->q_smoothed_nrg ), 1 ) ); -#endif /* OPT_STEREO_32KBPS_V1 */ q_com = hStereoDft->q_smoothed_nrg; move16(); } -#ifdef OPT_STEREO_32KBPS_V1 ELSE -#else /* OPT_STEREO_32KBPS_V1 */ - ELSE IF( GT_16( hStereoDft->q_smoothed_nrg, q_com ) ) -#endif /* OPT_STEREO_32KBPS_V1 */ { -#ifdef OPT_STEREO_32KBPS_V1 hStereoDft->smooth_res_nrg_fx[b] = L_shr( hStereoDft->smooth_res_nrg_fx[b], shl( diff, 1 ) ); /* hStereoDft->q_smoothed_nrg */ move32(); hStereoDft->smooth_dmx_nrg_fx[b] = L_shr( hStereoDft->smooth_dmx_nrg_fx[b], shl( diff, 1 ) ); /* hStereoDft->q_smoothed_nrg */ move32(); -#else /* OPT_STEREO_32KBPS_V1 */ - hStereoDft->smooth_res_nrg_fx[b] = L_shr( hStereoDft->smooth_res_nrg_fx[b], shl( sub( hStereoDft->q_smoothed_nrg, q_com ), 1 ) ); /* hStereoDft->q_smoothed_nrg */ - move32(); - hStereoDft->smooth_dmx_nrg_fx[b] = L_shr( hStereoDft->smooth_dmx_nrg_fx[b], shl( sub( hStereoDft->q_smoothed_nrg, q_com ), 1 ) ); /* hStereoDft->q_smoothed_nrg */ - move32(); -#endif /* OPT_STEREO_32KBPS_V1 */ q_smoothed_nrg_local[b] = q_com; move16(); } @@ -3116,15 +3016,12 @@ void stereo_dft_generate_res_pred_fx( hStereoDft->smooth_dmx_nrg_fx[b] = Madd_32_16( Mpy_32_16_1( hStereoDft->smooth_dmx_nrg_fx[b], alpha ), dmx_nrg, sub( (Word16) ( 0x7FFF ), alpha ) ); /* hStereoDft->q_smoothed_nrg */ move32(); -#ifdef OPT_STEREO_32KBPS_V1 // Compute norm_fac in Q14 norm_fac = MAX_16; move16(); -#endif /* OPT_STEREO_32KBPS_V1 */ /* normalization factor */ IF( hStereoDft->smooth_res_nrg_fx[b] != 0 ) { -#ifdef OPT_STEREO_32KBPS_V1 norm_fac = 0; move16(); IF( hStereoDft->smooth_dmx_nrg_fx[b] != 0 ) @@ -3147,88 +3044,15 @@ void stereo_dft_generate_res_pred_fx( norm_fac = extract_h( prod ); } -#else /* OPT_STEREO_32KBPS_V1 */ - norm_fac = BASOP_Util_Divide3232_Scale( hStereoDft->smooth_dmx_nrg_fx[b], hStereoDft->smooth_res_nrg_fx[b], &q_norm_fac ); /* q_norm_fac */ - norm_fac = Sqrt16( norm_fac, &q_norm_fac ); - IF( norm_fac != 0 ) - { - /* gain compressor */ - test(); - test(); - test(); - test(); - test(); - test(); - test(); - test(); - IF( LE_16( q_norm_fac, -Q1 ) || ( EQ_16( q_norm_fac, Q1 ) && GT_16( (Word16) 0x3333, norm_fac ) ) || ( ( q_norm_fac == 0 ) && GT_16( (Word16) 0x6666, norm_fac ) ) ) - { - lim_norm_fac = (Word16) 0x5000; - move16(); - } - ELSE IF( GT_16( q_norm_fac, Q1 ) || ( EQ_16( q_norm_fac, Q1 ) && LT_16( (Word16) 0x5000, norm_fac ) ) || ( ( q_norm_fac == 0 ) && GT_16( (Word16) 0x6666, norm_fac ) ) ) - { - lim_norm_fac = (Word16) 0x3333; - move16(); - } - ELSE - { - lim_norm_fac = norm_fac; - move16(); - } - IF( EQ_16( lim_norm_fac, norm_fac ) ) - { - norm_fac = ONE_IN_Q14; - move16(); - q_norm_fac = Q1; - move16(); - } - ELSE - { - norm_fac = extract_l( L_shr( L_mult0( norm_fac, lim_norm_fac ), Q15 ) ); /* q_norm_fac */ - q_norm_fac = add( q_norm_fac, 1 ); - test(); - IF( q_norm_fac < 0 ) - { - norm_fac = shl( norm_fac, q_norm_fac ); - q_norm_fac = 0; - move16(); - } - ELSE IF( GT_16( q_norm_fac, 2 ) && LT_16( norm_s( norm_fac ), sub( q_norm_fac, Q1 ) ) ) - { - norm_fac = MAX_16; - move16(); - q_norm_fac = Q1; - move16(); - } - } - } -#endif /* OPT_STEREO_32KBPS_V1 */ } -#ifndef OPT_STEREO_32KBPS_V1 - ELSE - { - norm_fac = MAX_16; - move16(); - q_norm_fac = Q1; - move16(); - } -#endif /* OPT_STEREO_32KBPS_V1 */ len = s_min( hStereoDft->band_limits[b + 1], bin0 ); FOR( i = hStereoDft->band_limits[b]; i < len; i++ ) { -#ifdef OPT_STEREO_32KBPS_V1 DFT_PRED_RES[2 * i] = L_shl( Mpy_32_32( Mpy_32_16_1( pPredGain[b], norm_fac ), ap_filt_DMX[2 * i] ), 1 ); /* q_dft */ move32(); DFT_PRED_RES[2 * i + 1] = L_shl( Mpy_32_32( Mpy_32_16_1( pPredGain[b], norm_fac ), ap_filt_DMX[2 * i + 1] ), 1 ); /* q_dft */ move32(); -#else /* OPT_STEREO_32KBPS_V1 */ - DFT_PRED_RES[2 * i] = L_shl( Mpy_32_32( Mpy_32_16_1( pPredGain[b], norm_fac ), ap_filt_DMX[2 * i] ), q_norm_fac ); /* q_dft */ - move32(); - DFT_PRED_RES[2 * i + 1] = L_shl( Mpy_32_32( Mpy_32_16_1( pPredGain[b], norm_fac ), ap_filt_DMX[2 * i + 1] ), q_norm_fac ); /* q_dft */ - move32(); -#endif /* OPT_STEREO_32KBPS_V1 */ } } diff --git a/lib_dec/ivas_stereo_icbwe_dec_fx.c b/lib_dec/ivas_stereo_icbwe_dec_fx.c index 772eb2d7d..af31aea40 100644 --- a/lib_dec/ivas_stereo_icbwe_dec_fx.c +++ b/lib_dec/ivas_stereo_icbwe_dec_fx.c @@ -904,9 +904,7 @@ void stereo_icBWE_dec_fx( winSlope_fx = div_s( 1, winLen_fx ); /* Q15 */ alpha_fx = winSlope_fx; /* Q15 */ move16(); -#ifdef FIX_1439_SPEEDUP_stereo_icBWE_dec_fx Word16 winSlope_fx_ = sub( 32767 /* 1.0 in Q15*/, winSlope_fx ); -#endif FOR( i = 0; i < winLen_fx; i++ ) { L_tmp = L_mult0( alpha_fx, icbweM2Ref_fx ); /* Q29 */ @@ -914,17 +912,10 @@ void stereo_icBWE_dec_fx( tmp = shl( round_fx( L_tmp ), 1 ); /* Q14 */ synthRef_fx[i] = Mpy_32_16_1( synthRef_fx[i], tmp ); /* Qsyn - 1 */ move32(); -#ifdef FIX_1439_SPEEDUP_stereo_icBWE_dec_fx if ( LE_16( alpha_fx, winSlope_fx_ ) ) { alpha_fx = add( alpha_fx, winSlope_fx ); /* Q15 */ } -#else - IF( LE_16( alpha_fx, sub( 32767 /* 1.0 in Q15*/, winSlope_fx ) ) ) - { - alpha_fx = add( alpha_fx, winSlope_fx ); /* Q15 */ - } -#endif } FOR( ; i < NS2SA_FX2( st->output_Fs, FRAME_SIZE_NS ); i++ ) diff --git a/lib_dec/ivas_stereo_switching_dec_fx.c b/lib_dec/ivas_stereo_switching_dec_fx.c index 522e741e8..b72a23f63 100644 --- a/lib_dec/ivas_stereo_switching_dec_fx.c +++ b/lib_dec/ivas_stereo_switching_dec_fx.c @@ -2306,19 +2306,10 @@ static Word32 ncross_corr_self_fx( Word64 c_c_fx; Word32 c_c_fx_return; Word64 energy_x_fx, energy_y_fx; -#ifndef OPT_STEREO_32KBPS_V1 - Word16 c_c_fx_q; - Word64 energy_xy_fx; -#endif /* OPT_STEREO_32KBPS_V1 */ UWord16 j; Word32 *signal_a_fx, *signal_b_fx; Word32 temp_x, temp_y; Word16 headroom_left_x, headroom_left_y; -#ifndef OPT_STEREO_32KBPS_V1 - Word16 x_inv_q, y_inv_q; - Word16 x_q, y_q; - Word16 res_q; -#endif /* OPT_STEREO_32KBPS_V1 */ c_c_fx = 0; move64(); energy_x_fx = 0; @@ -2329,20 +2320,13 @@ static Word32 ncross_corr_self_fx( signal_b_fx = &signal_fx[y]; /* Q11 */ FOR( j = 0; j < corr_len; j += subsampling ) { -#ifdef OPT_STEREO_32KBPS_V1 c_c_fx = W_mac_32_32( c_c_fx, signal_a_fx[j], signal_b_fx[j] ); /* 2 * Q11 + 1*/ energy_x_fx = W_mac_32_32( energy_x_fx, signal_a_fx[j], signal_a_fx[j] ); /* 2 * Q11+ 1 */ energy_y_fx = W_mac_32_32( energy_y_fx, signal_b_fx[j], signal_b_fx[j] ); /* 2 * Q11+ 1 */ -#else /* OPT_STEREO_32KBPS_V1 */ - c_c_fx = W_add( c_c_fx, W_mult0_32_32( ( signal_a_fx[j] ), ( signal_b_fx[j] ) ) ); /* 2 * Q11 */ - energy_x_fx = W_add( energy_x_fx, W_mult0_32_32( ( signal_a_fx[j] ), ( signal_a_fx[j] ) ) ); /* 2 * Q11 */ - energy_y_fx = W_add( energy_y_fx, W_mult0_32_32( ( signal_b_fx[j] ), ( signal_b_fx[j] ) ) ); /* 2 * Q11 */ -#endif /* OPT_STEREO_32KBPS_V1 */ } headroom_left_x = W_norm( energy_x_fx ); headroom_left_y = W_norm( energy_y_fx ); -#ifdef OPT_STEREO_32KBPS_V1 temp_x = W_extract_h( W_shl( energy_x_fx, headroom_left_x ) ); // Q23 + headroom_left_x -32 temp_y = W_extract_h( W_shl( energy_y_fx, headroom_left_y ) ); // Q23 + headroom_left_y -32 Word64 prod = W_mult0_32_32( temp_x, temp_y ); // Q(headroom_left_x + headroom_left_y - 18) @@ -2365,79 +2349,6 @@ static Word32 ncross_corr_self_fx( quo_e = add( sub( sub( 40, q_cc ), q_prod ), quo_e ); c_c_fx_return = L_shl_sat( num, quo_e ); // Q31 } -#else /* OPT_STEREO_32KBPS_V1 */ - IF( LT_16( headroom_left_x, 32 ) ) - { - energy_x_fx = W_shr( energy_x_fx, sub( 32, headroom_left_x ) ); /* 2 * Q11 - (32 -headroom_left_x) */ - x_q = sub( 31, ( sub( ( 2 * OUTPUT_Q ), sub( 32, headroom_left_x ) ) ) ); - } - ELSE - { - x_q = 31 - ( 2 * OUTPUT_Q ); - } - IF( LT_16( headroom_left_y, 32 ) ) - { - energy_y_fx = W_shr( energy_y_fx, sub( 32, headroom_left_y ) ); /* 2 * Q11 - (32 -headroom_left_y) */ - y_q = sub( 31, ( sub( ( 2 * OUTPUT_Q ), ( sub( 32, headroom_left_y ) ) ) ) ); - } - ELSE - { - y_q = 31 - ( 2 * OUTPUT_Q ); - } - - x_inv_q = x_q; - move16(); - y_inv_q = y_q; - move16(); - - temp_x = Sqrt32( W_extract_l( energy_x_fx ), &x_q ); - IF( x_q < 0 ) - { - temp_x = L_shr( temp_x, i_mult( -1, x_q ) ); /* Q0 */ - x_q = 0; - move16(); - } - - temp_y = Sqrt32( W_extract_l( energy_y_fx ), &y_q ); - IF( y_q < 0 ) - { - temp_y = L_shr( temp_y, i_mult( -1, y_q ) ); /* Q0 */ - y_q = 0; - move16(); - } - - energy_xy_fx = Mpy_32_32( temp_x, temp_y ); /* x_q + y_q - 31 */ - res_q = add( y_q, x_q ); - - IF( ( energy_xy_fx < L_shr( ONE_IN_Q31, res_q ) ) || energy_xy_fx == 0 ) - { - energy_xy_fx = ONE_IN_Q31; /* conceal silent frames */ - res_q = 0; - c_c_fx = W_shl( c_c_fx, 31 - ( 2 * OUTPUT_Q ) ); /* Q31 */ - } - ELSE - { - Word32 temp_x_inv = ISqrt32( W_extract_l( energy_x_fx ), &x_inv_q ); - Word32 temp_y_inv = ISqrt32( W_extract_l( energy_y_fx ), &y_inv_q ); - Word16 headroom_left_c_c; - energy_xy_fx = Mpy_32_32( temp_x_inv, temp_y_inv ); /* exp(x_inv_q + y_inv_q) */ - res_q = add( x_inv_q, y_inv_q ); - headroom_left_c_c = W_norm( c_c_fx ); - c_c_fx_q = OUTPUT_Q * 2; - move16(); - IF( LT_16( headroom_left_c_c, 32 ) ) - { - c_c_fx = W_shr( c_c_fx, extract_l( sub( 32, headroom_left_c_c ) ) ); /* c_c_fx_q - (32 - headroom_left_c_c) */ - c_c_fx_q = sub( c_c_fx_q, sub( 32, headroom_left_c_c ) ); - } - c_c_fx = W_deposit32_l( Mpy_32_32( W_extract_l( c_c_fx ), W_extract_l( energy_xy_fx ) ) ); /* c_c_fx_q + (31 - res_q) - 31 */ - c_c_fx_q = add( c_c_fx_q, sub( sub( 31, res_q ), 31 ) ); - c_c_fx = W_extract_l( W_shl_sat_l( c_c_fx, extract_l( sub( 31, c_c_fx_q ) ) ) ); /* Q31 */ - } - - c_c_fx_return = W_extract_l( c_c_fx ); /* Q31 */ - move32(); -#endif /* OPT_STEREO_32KBPS_V1 */ return c_c_fx_return; } diff --git a/lib_dec/ivas_stereo_td_dec_fx.c b/lib_dec/ivas_stereo_td_dec_fx.c index 023c9a2e5..6209d5684 100644 --- a/lib_dec/ivas_stereo_td_dec_fx.c +++ b/lib_dec/ivas_stereo_td_dec_fx.c @@ -355,26 +355,16 @@ void tdm_upmix_plain_fx( { FOR( i = start_index; i < end_index; i++ ) { -#ifdef OPT_STEREO_32KBPS_V1 Word32 temp_left = Madd_32_32( SCh_2_R_fx[i], L_sub( PCh_2_L_fx[i], SCh_2_R_fx[i] ), LR_ratio_fx ); /* Qx */ Left_fx[i] = W_shl_sat_l( W_mult0_32_32( temp_left, inv_den_LR_ratio_fx ), -30 ); /* Qx */ move32(); Word32 temp_right = Msub_32_32( PCh_2_L_fx[i], L_add( PCh_2_L_fx[i], SCh_2_R_fx[i] ), LR_ratio_fx ); /* Qx */ Right_fx[i] = W_shl_sat_l( W_mult0_32_32( temp_right, inv_den_LR_ratio_fx ), -30 ); /* Qx */ move32(); -#else /* OPT_STEREO_32KBPS_V1 */ - Word32 temp_left = L_add( Mpy_32_32( L_sub( PCh_2_L_fx[i], SCh_2_R_fx[i] ), LR_ratio_fx ), SCh_2_R_fx[i] ); /* Qx */ - Left_fx[i] = L_shl_sat( Mpy_32_32( temp_left, inv_den_LR_ratio_fx ), 1 ); /* Qx + 1 */ - move32(); - Word32 temp_right = L_add( Mpy_32_32( L_add( PCh_2_L_fx[i], SCh_2_R_fx[i] ), L_negate( LR_ratio_fx ) ), PCh_2_L_fx[i] ); /* Qx */ - Right_fx[i] = L_shl_sat( Mpy_32_32( temp_right, inv_den_LR_ratio_fx ), 1 ); /* Qx + 1 */ - move32(); -#endif /* OPT_STEREO_32KBPS_V1 */ } } ELSE { -#ifdef OPT_STEREO_32KBPS_V1 Word32 inv_den_LR_ratio_fx_neg = L_negate( inv_den_LR_ratio_fx ); FOR( i = start_index; i < end_index; i++ ) { @@ -385,17 +375,6 @@ void tdm_upmix_plain_fx( Right_fx[i] = W_shl_sat_l( W_mult0_32_32( temp_right, inv_den_LR_ratio_fx_neg ), -30 ); /* Qx */ move32(); } -#else /* OPT_STEREO_32KBPS_V1 */ - FOR( i = start_index; i < end_index; i++ ) - { - Word32 temp_left = L_sub( Mpy_32_32( L_add( PCh_2_L_fx[i], SCh_2_R_fx[i] ), LR_ratio_fx ), SCh_2_R_fx[i] ); /* Qx */ - Left_fx[i] = L_shl_sat( Mpy_32_32( temp_left, inv_den_LR_ratio_fx ), 1 ); /* Qx + 1 */ - move32(); - Word32 temp_right = L_sub( Mpy_32_32( L_sub( PCh_2_L_fx[i], SCh_2_R_fx[i] ), LR_ratio_fx ), PCh_2_L_fx[i] ); /* Qx */ - Right_fx[i] = L_shl_sat( Mpy_32_32( temp_right, inv_den_LR_ratio_fx ), 1 ); /* Qx + 1 */ - move32(); - } -#endif /* OPT_STEREO_32KBPS_V1 */ } return; diff --git a/lib_dec/swb_tbe_dec_fx.c b/lib_dec/swb_tbe_dec_fx.c index 1234e2853..73d8ef11c 100644 --- a/lib_dec/swb_tbe_dec_fx.c +++ b/lib_dec/swb_tbe_dec_fx.c @@ -4663,10 +4663,8 @@ void fb_tbe_dec_fx( /* FB TBE synthesis */ synthesise_fb_high_band_fx( fb_exc, Q_fb_exc, fb_synth, fb_exc_energy, ratio, st->L_frame, st->bfi, &( hBWE_TD->prev_fbbwe_ratio_fx ), hBWE_TD->fbbwe_hpf_mem_fx, hBWE_TD->fbbwe_hpf_mem_fx_Q, hb_synth_exp -#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2 , st->element_mode -#endif /*FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2*/ ); /* add the fb_synth component to the hb_synth component */ @@ -4737,10 +4735,8 @@ void fb_tbe_dec_ivas_fx( /* FB TBE synthesis */ synthesise_fb_high_band_fx( fb_exc, Q_fb_exc, fb_synth, fb_exc_energy, ratio, st->L_frame, st->bfi, &( hBWE_TD->prev_fbbwe_ratio_fx ), hBWE_TD->fbbwe_hpf_mem_fx, hBWE_TD->fbbwe_hpf_mem_fx_Q, hb_synth_exp -#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2 , st->element_mode -#endif /*FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2*/ ); test(); @@ -7045,23 +7041,12 @@ void ivas_swb_tbe_dec_fx( tmp1 = 0; move16(); -#ifdef FIX_1439_SPEEDUP_ivas_swb_tbe_dec_fx Word32 idx32 = L_shr_r( 0x00333333, 10 ); /*NUM_SHB_SUBFR/L_FRAME16k*/ // Q16 -#endif FOR( i = 0; i < L_FRAME16k; i++ ) { -#ifndef FIX_1439_SPEEDUP_ivas_swb_tbe_dec_fx - Word16 idx = 0; - move16(); - IF( i != 0 ) - { - idx = idiv1616( i_mult( NUM_SHB_SUBFR, i ), L_FRAME16k ); - } -#else Word16 idx; idx = extract_h( imult3216( idx32, i ) ); /*Q0*/ -#endif L_tmp1 = Mult_32_16( L_tmp, GainShape_fx[idx] ); /* Q : 18 + tmp +15 -15*/ White_exc16k_fx[i] = round_fx( Mult_32_16( L_tmp1, White_exc16k_fx[i] ) ); /* 18 + tmp +*Q_white_exc -15 -16 */ move16(); diff --git a/lib_enc/acelp_core_switch_enc_fx.c b/lib_enc/acelp_core_switch_enc_fx.c index aaaf08b26..8db68e089 100644 --- a/lib_enc/acelp_core_switch_enc_fx.c +++ b/lib_enc/acelp_core_switch_enc_fx.c @@ -46,10 +46,8 @@ void acelp_core_switch_enc_fx( Word16 Aq[2 * ( M + 1 )]; LPD_state_HANDLE hLPDmem; /* ACELP LPDmem memories */ BSTR_ENC_HANDLE hBstr = st_fx->hBstr; -#ifdef HARM_PUSH_BIT UWord16 value; Word16 nb_bits; -#endif hLPDmem = st_fx->hLPDmem; /* initializations */ @@ -140,7 +138,6 @@ void acelp_core_switch_enc_fx( encod_gen_voic_core_switch_fx( st_fx, st_fx->last_L_frame, inp, Aq, A, T_op, exc, cbrate, shift, Q_new ); -#ifdef HARM_PUSH_BIT i = find_indice( hBstr, TAG_ACELP_SUBFR_LOOP_START, &value, &nb_bits ); #ifdef DEBUGGING assert( i >= 0 && "Internal error in ACELP core switching - unable to find ACELP subframe indices!" ); @@ -151,20 +148,6 @@ void acelp_core_switch_enc_fx( i++; } delete_indice( hBstr, TAG_ACELP_SUBFR_LOOP_START ); -#else - /*----------------------------------------------------------------* - * bit-stream: modify the layer of sub frame CELP - *----------------------------------------------------------------*/ - FOR( i = 0; i < 20; i++ ) - { - hBstr->ind_list[IND_CORE_SWITCHING_CELP_SUBFRAME + i].value = hBstr->ind_list[TAG_ACELP_SUBFR_LOOP_START + i].value; /* Q0 */ - move16(); - hBstr->ind_list[IND_CORE_SWITCHING_CELP_SUBFRAME + i].nb_bits = hBstr->ind_list[TAG_ACELP_SUBFR_LOOP_START + i].nb_bits; /* Q0 */ - move16(); - hBstr->ind_list[TAG_ACELP_SUBFR_LOOP_START + i].nb_bits = -1; /* Q0 */ - move16(); - } -#endif /*----------------------------------------------------------------* * BWE encoding *----------------------------------------------------------------*/ diff --git a/lib_enc/cng_enc_fx.c b/lib_enc/cng_enc_fx.c index 9dea812a6..6dc3963f8 100644 --- a/lib_enc/cng_enc_fx.c +++ b/lib_enc/cng_enc_fx.c @@ -2455,12 +2455,7 @@ static void shb_CNG_encod_fx( push_indice( hBstr, IND_SHB_CNG_GAIN, idx_ener_fx, 4 ); push_indice( hBstr, IND_SID_BW, 1, 1 ); -#ifdef HARM_PUSH_BIT delete_indice( hBstr, IND_CNG_ENV1 ); -#else - hBstr->nb_bits_tot = sub( hBstr->nb_bits_tot, hBstr->ind_list[IND_CNG_ENV1].nb_bits ); - hBstr->ind_list[IND_CNG_ENV1].nb_bits = -1; -#endif move16(); move16(); diff --git a/lib_enc/dtx_fx.c b/lib_enc/dtx_fx.c index 7966fc7d8..247dcbda3 100644 --- a/lib_enc/dtx_fx.c +++ b/lib_enc/dtx_fx.c @@ -838,11 +838,7 @@ void dtx_fx( /* reset the bitstream (IVAS format signalling was already written) */ IF( NE_16( st_fx->element_mode, IVAS_CPE_MDCT ) && st_fx->hBstr != NULL ) { -#ifdef HARM_PUSH_BIT reset_indices_enc_fx( st_fx->hBstr, st_fx->hBstr->nb_ind_tot ); -#else - reset_indices_enc_fx( st_fx->hBstr, MAX_NUM_INDICES ); -#endif } } diff --git a/lib_enc/enc_gen_voic_fx.c b/lib_enc/enc_gen_voic_fx.c index da3555cdb..fc1f3e993 100644 --- a/lib_enc/enc_gen_voic_fx.c +++ b/lib_enc/enc_gen_voic_fx.c @@ -522,12 +522,10 @@ void encod_gen_voic_ivas_fx( set16_fx( code_preQ_fx, 0, L_SUBFR ); shift_wsp = add( Q_new, shift ); -#ifdef TEST_HR if ( LT_32( st_fx->core_brate, MIN_BRATE_AVQ_EXC ) ) { shift_wsp = sub( shift_wsp, 1 ); } -#endif /* set and write harmonicity flag */ harm_flag_acelp = 0; move16(); @@ -630,33 +628,18 @@ void encod_gen_voic_ivas_fx( IF( LE_32( st_fx->core_brate, ACELP_8k00 ) ) { -#ifdef TEST_HR gain_enc_lbr_ivas_fx( hBstr, st_fx->acelp_cfg.gains_mode, st_fx->coder_type, i_subfr_fx, xn_fx, y1_fx, shift_wsp, y2_fx, code_fx, &gain_pit_fx, &gain_code_fx, &gain_inov_fx, &norm_gain_code_fx, g_corr_fx, gc_mem, gp_mem, clip_gain_fx, L_SUBFR ); -#else - gain_enc_lbr_ivas_fx( hBstr, st_fx->acelp_cfg.gains_mode, st_fx->coder_type, i_subfr_fx, xn_fx, y1_fx, sub( shift_wsp, 1 ), y2_fx, code_fx, - &gain_pit_fx, &gain_code_fx, &gain_inov_fx, &norm_gain_code_fx, g_corr_fx, gc_mem, gp_mem, clip_gain_fx, L_SUBFR ); -#endif } ELSE IF( GT_32( st_fx->core_brate, ACELP_32k ) ) { -#ifdef TEST_HR gain_enc_SQ_ivas_fx( hBstr, st_fx->acelp_cfg.gains_mode, i_subfr_fx, xn_fx, y1_fx, y2_fx, code_fx, Es_pred_fx, &gain_pit_fx, &gain_code_fx, &gain_inov_fx, &norm_gain_code_fx, g_corr_fx, clip_gain_fx, shift_wsp ); -#else - gain_enc_SQ_ivas_fx( hBstr, st_fx->acelp_cfg.gains_mode, i_subfr_fx, xn_fx, y1_fx, y2_fx, code_fx, Es_pred_fx, - &gain_pit_fx, &gain_code_fx, &gain_inov_fx, &norm_gain_code_fx, g_corr_fx, clip_gain_fx, sub( shift_wsp, 1 ) ); -#endif } ELSE { -#ifdef TEST_HR gain_enc_mless_ivas_fx( hBstr, st_fx->acelp_cfg.gains_mode, st_fx->element_mode, L_frame, i_subfr_fx, -1, xn_fx, y1_fx, shift_wsp, y2_fx, code_fx, Es_pred_fx, &gain_pit_fx, &gain_code_fx, &gain_inov_fx, &norm_gain_code_fx, g_corr_fx, clip_gain_fx ); -#else - gain_enc_mless_ivas_fx( hBstr, st_fx->acelp_cfg.gains_mode, st_fx->element_mode, L_frame, i_subfr_fx, -1, xn_fx, y1_fx, sub( shift_wsp, 1 ), y2_fx, code_fx, Es_pred_fx, - &gain_pit_fx, &gain_code_fx, &gain_inov_fx, &norm_gain_code_fx, g_corr_fx, clip_gain_fx ); -#endif } IF( st_fx->Opt_SC_VBR ) { diff --git a/lib_enc/enc_ppp_fx.c b/lib_enc/enc_ppp_fx.c index 9d1ffad60..fca36f460 100644 --- a/lib_enc/enc_ppp_fx.c +++ b/lib_enc/enc_ppp_fx.c @@ -189,11 +189,7 @@ ivas_error encod_ppp_fx( /* We write signalling indices again only in case of bump_up */ /* delete previous indices */ -#ifdef HARM_PUSH_BIT reset_indices_enc_fx( hBstr, hBstr->nb_ind_tot ); -#else - reset_indices_enc_fx( hBstr, MAX_NUM_INDICES ); -#endif /* signalling matrix (writing of signalling bits) */ signalling_enc_fx( st_fx ); } @@ -376,11 +372,7 @@ ivas_error encod_ppp_ivas_fx( /* We write signalling indices again only in case of bump_up */ /* delete previous indices */ -#ifdef HARM_PUSH_BIT reset_indices_enc_fx( hBstr, hBstr->nb_ind_tot ); -#else - reset_indices_enc_fx( hBstr, MAX_NUM_INDICES ); -#endif /* signalling matrix (writing of signalling bits) */ signalling_enc_fx( st_fx ); } diff --git a/lib_enc/enc_tran_fx.c b/lib_enc/enc_tran_fx.c index 9802dc15b..fb601aeba 100644 --- a/lib_enc/enc_tran_fx.c +++ b/lib_enc/enc_tran_fx.c @@ -520,12 +520,10 @@ Word16 encod_tran_ivas_fx( move16(); set16_fx( code_preQ, 0, L_SUBFR ); shift_wsp = add( Q_new, shift ); -#ifdef TEST_HR if ( LT_32( st_fx->core_brate, MIN_BRATE_AVQ_EXC ) ) { shift_wsp = sub( shift_wsp, 1 ); } -#endif /*----------------------------------------------------------------* * ACELP subframe loop *----------------------------------------------------------------*/ @@ -546,11 +544,7 @@ Word16 encod_tran_ivas_fx( q_h1 = sub( 14, norm_s( h1[0] ) ); Copy_Scale_sig( h1, h2_fx, L_SUBFR, sub( 11, q_h1 ) ); /*Q11*/ -#ifdef TEST_HR Scale_sig( h1, L_SUBFR, sub( 14, q_h1 ) ); -#else - Scale_sig( h1, L_SUBFR, sub( 13, q_h1 ) ); -#endif /* scaling of xn[] to limit dynamic at 12 bits */ Scale_sig( xn, L_SUBFR, shift ); @@ -569,9 +563,6 @@ Word16 encod_tran_ivas_fx( IF( GE_32( st_fx->core_brate, MIN_BRATE_AVQ_EXC ) ) { -#ifndef TEST_HR - Scale_sig( h1, L_SUBFR, add( 1, shift ) ); /* set h1[] in Q14 with scaling for convolution */ -#endif transf_cdbk_enc_ivas_fx( st_fx, 0, i_subfr, cn, exc_fx, p_Aq, Aw_fx, h1, xn, xn2, y1, y2, Es_pred_fx, &gain_pit, gain_code, g_corr, clip_gain, &gain_preQ, code_preQ, unbits, Q_new, shift ); } @@ -599,37 +590,22 @@ Word16 encod_tran_ivas_fx( IF( Jopt_flag == 0 ) { /* SQ gain_code */ -#ifdef TEST_HR gain_enc_tc_ivas_fx( hBstr, st_fx->acelp_cfg.gains_mode, i_subfr, xn, y2, code, Es_pred_fx, &gain_pit, &gain_code, &gain_inov, &norm_gain_code, shift_wsp ); -#else - gain_enc_tc_ivas_fx( hBstr, st_fx->acelp_cfg.gains_mode, i_subfr, xn, y2, code, Es_pred_fx, - &gain_pit, &gain_code, &gain_inov, &norm_gain_code, sub( shift_wsp, 1 ) ); -#endif } ELSE { IF( GT_32( st_fx->core_brate, ACELP_32k ) ) { /* SQ gain_pit and gain_code */ -#ifdef TEST_HR gain_enc_SQ_ivas_fx( hBstr, st_fx->acelp_cfg.gains_mode, i_subfr, xn, y1, y2, code, Es_pred_fx, &gain_pit, &gain_code, &gain_inov, &norm_gain_code, g_corr, clip_gain, shift_wsp ); -#else - gain_enc_SQ_ivas_fx( hBstr, st_fx->acelp_cfg.gains_mode, i_subfr, xn, y1, y2, code, Es_pred_fx, - &gain_pit, &gain_code, &gain_inov, &norm_gain_code, g_corr, clip_gain, sub( shift_wsp, 1 ) ); -#endif } ELSE { /* VQ gain_pit and gain_code */ -#ifdef TEST_HR gain_enc_mless_ivas_fx( hBstr, st_fx->acelp_cfg.gains_mode, st_fx->element_mode, L_frame_fx, i_subfr, tc_subfr, xn, y1, shift_wsp, y2, code, Es_pred_fx, &gain_pit, &gain_code, &gain_inov, &norm_gain_code, g_corr, clip_gain ); -#else - gain_enc_mless_ivas_fx( hBstr, st_fx->acelp_cfg.gains_mode, st_fx->element_mode, L_frame_fx, i_subfr, tc_subfr, xn, y1, sub( shift_wsp, 1 ), y2, code, Es_pred_fx, - &gain_pit, &gain_code, &gain_inov, &norm_gain_code, g_corr, clip_gain ); -#endif } } gp_clip_test_gain_pit_fx( st_fx->element_mode, st_fx->core_brate, gain_pit, st_fx->clip_var_fx ); diff --git a/lib_enc/eval_pit_contr_fx.c b/lib_enc/eval_pit_contr_fx.c index 5e1c8dfe3..ce7f05968 100644 --- a/lib_enc/eval_pit_contr_fx.c +++ b/lib_enc/eval_pit_contr_fx.c @@ -379,7 +379,6 @@ Word16 Pit_exc_contribution_len_fx( /* o : bin where pit set16_fx( pitch_buf, shl( L_SUBFR, 6 ), NB_SUBFR16k ); -#ifdef HARM_PUSH_BIT /* pitch contribution useless - delete all previously written indices belonging to pitch contribution */ for ( i = TAG_ACELP_SUBFR_LOOP_START; i < TAG_ACELP_SUBFR_LOOP_END; i++ ) { @@ -387,26 +386,6 @@ Word16 Pit_exc_contribution_len_fx( /* o : bin where pit } delete_indice( hBstr, IND_ES_PRED ); -#else - /* pitch contribution useless - delete all previously written indices belonging to pitch contribution */ - FOR( i = TAG_ACELP_SUBFR_LOOP_START; i < TAG_ACELP_SUBFR_LOOP_END; i++ ) - { - IF( hBstr->ind_list[i].nb_bits != -1 ) - { - hBstr->nb_bits_tot = sub( hBstr->nb_bits_tot, hBstr->ind_list[i].nb_bits ); /* Q0 */ - hBstr->ind_list[i].nb_bits = -1; - move16(); - } - } - - IF( hBstr->ind_list[IND_ES_PRED].nb_bits != -1 ) - { - hBstr->nb_bits_tot = sub( hBstr->nb_bits_tot, hBstr->ind_list[IND_ES_PRED].nb_bits ); /* Q0 */ - move16(); - hBstr->ind_list[IND_ES_PRED].nb_bits = -1; - move16(); - } -#endif } IF( LT_32( st_fx->core_brate, CFREQ_BITRATE ) ) { diff --git a/lib_enc/igf_enc.c b/lib_enc/igf_enc.c index 70b5166df..fe1ba10c1 100644 --- a/lib_enc/igf_enc.c +++ b/lib_enc/igf_enc.c @@ -2367,65 +2367,6 @@ void IGFEncSetMode_ivas_fx( * * IGF bitstream concatenation for TCX10 modes *-------------------------------------------------------------------*/ -#ifndef HARM_PUSH_BIT /* Float code */ -void IGFEncConcatenateBitstream( - const IGF_ENC_INSTANCE_HANDLE hIGFEnc, /* i : instance handle of IGF Encoder */ - const Word16 bsBits, /* i : number of IGF bits written to list of indices */ - BSTR_ENC_HANDLE hBstr /* i/o: bitstream handle */ -) -{ - Word16 i; - IGF_ENC_PRIVATE_DATA_HANDLE hPrivateData; - Indice *ind_list; - UWord8 *pFrame; /* byte array with bit packet and byte aligned coded speech data */ - Word16 *pFrame_size; /* number of bits in the binary encoded access unit [bits] */ - Word16 k, nb_bits_written; - Word32 imask; - UWord8 omask; - - hPrivateData = &hIGFEnc->igfData; - - ind_list = &hBstr->ind_list[sub( hBstr->nb_ind_tot, bsBits )]; /* here, we assume that each bit has been written as a single indice */ - pFrame = hPrivateData->igfBitstream; - pFrame_size = &hPrivateData->igfBitstreamBits; - nb_bits_written = 0; - move16(); - - omask = (UWord8) shr( 0x80, s_and( *pFrame_size, 0x7 ) ); - pFrame += shr( *pFrame_size, 3 ); - - /* bitstream packing (conversion of individual indices into a serial stream) */ - FOR( i = 0; i < bsBits; i++ ){ - IF( ind_list[i].nb_bits > 0 ){ - /* mask from MSB to LSB */ - imask = L_shl( 1, ( sub( ind_list[i].nb_bits, 1 ) ) ); - - /* write bit by bit */ - FOR( k = 0; k < ind_list[i].nb_bits; k++ ) - { - pack_bit( ind_list[i].value & imask, &pFrame, &omask ); - imask = L_shr( imask, 1 ); - } - nb_bits_written = add( nb_bits_written, ind_list[i].nb_bits ); - - /* delete the indice */ - ind_list[i].nb_bits = -1; - move16(); -} -} - -*pFrame_size = add( *pFrame_size, nb_bits_written ); -move16(); - -/* update list of indices */ -hBstr->nb_ind_tot = sub( hBstr->nb_ind_tot, bsBits ); -hBstr->nb_bits_tot = sub( hBstr->nb_bits_tot, nb_bits_written ); -move16(); -move16(); - -return; -} -#endif /*-------------------------------------------------------------------* * IGFEncResetTCX10BitCounter_ivas_fx() diff --git a/lib_enc/igf_enc_fx.c b/lib_enc/igf_enc_fx.c index a7b5eabb3..e0562467a 100644 --- a/lib_enc/igf_enc_fx.c +++ b/lib_enc/igf_enc_fx.c @@ -1627,33 +1627,6 @@ hBstr->nb_bits_tot = sub( hBstr->nb_bits_tot, nb_bits_written ); return; } -#ifndef HARM_PUSH_BIT /* old bitstream */ -/**********************************************************************/ /* - IGF bitsream concatenation for TCX10 modes - **************************************************************************/ -void IGFEncConcatenateBitstream_fx( const IGF_ENC_INSTANCE_HANDLE hInstance, /**< in: | instance handle of IGF Encoder */ - Word16 bsBits, /**< in: Q0 | number of IGF bits written to list of indices */ - Word16 *next_ind, /**< in/out: | pointer to actual bit indice */ - Word16 *nb_bits, /**< in/out: | total number of bits already written */ - Indice *ind_list_fx /**< in: | pointer to list of indices */ -) -{ - IGF_ENC_PRIVATE_DATA_HANDLE hPrivateData; - - hPrivateData = &hInstance->igfData; - *next_ind = *next_ind - bsBits; - move16(); - indices_to_serial_generic( - &ind_list_fx[*next_ind], - bsBits, - hPrivateData->igfBitstream, - &hPrivateData->igfBitstreamBits ); - - *nb_bits = sub( *nb_bits, bsBits ); - move16(); - return; -} -#endif /**********************************************************************/ /* IGF reset bitsream bit counter for TCX10 modes **************************************************************************/ diff --git a/lib_enc/init_enc_fx.c b/lib_enc/init_enc_fx.c index ba1d47f79..9e3045be1 100644 --- a/lib_enc/init_enc_fx.c +++ b/lib_enc/init_enc_fx.c @@ -2163,13 +2163,9 @@ ivas_error init_encoder_ivas_fx( } ELSE { -#ifndef HARM_ENC_INIT - InitTransientDetection_ivas_fx( frame_length, NS2SA_FX2( st->input_Fs, DELAY_FIR_RESAMPL_NS ), st->hTranDet, 0 ); -#else InitTransientDetection_fx( extract_l( Mult_32_16( st->input_Fs, 0x0290 ) ), NS2SA_FX2( st->input_Fs, DELAY_FIR_RESAMPL_NS ), &st->transientDetection ); -#endif } /*-----------------------------------------------------------------* diff --git a/lib_enc/ivas_init_enc_fx.c b/lib_enc/ivas_init_enc_fx.c index 7d88b1264..2285acc0c 100644 --- a/lib_enc/ivas_init_enc_fx.c +++ b/lib_enc/ivas_init_enc_fx.c @@ -272,59 +272,6 @@ Word16 getNumChanAnalysis_fx( return n; } -#ifndef HARM_ENC_INIT -/*-------------------------------------------------------------------* - * copy_encoder_config_ivas_fx() - * - * Copy configuration structrue to the state structrure - *-------------------------------------------------------------------*/ - -void copy_encoder_config_ivas_fx( - Encoder_Struct *st_ivas, /* i : IVAS encoder structure */ - Encoder_State *st, /* o : encoder state structure */ - const Word16 flag_all /* i : flag 1==update all, 0=partial update Q0*/ -) -{ - IF( flag_all ) - { - st->input_Fs = st_ivas->hEncoderConfig->input_Fs; /* Q0 */ - move32(); - - st->last_codec_mode = st_ivas->last_codec_mode; /* Q0 */ - move16(); - st->last_total_brate = st_ivas->hEncoderConfig->last_ivas_total_brate; /* Q0 */ - move32(); - - st->Opt_DTX_ON = st_ivas->hEncoderConfig->Opt_DTX_ON; /* Q0 */ - move16(); - - st->last_Opt_SC_VBR = st_ivas->hEncoderConfig->last_Opt_SC_VBR; /* Q0 */ - move16(); - } - - st->Opt_AMR_WB = st_ivas->hEncoderConfig->Opt_AMR_WB; /* Q0 */ - st->Opt_SC_VBR = st_ivas->hEncoderConfig->Opt_SC_VBR; /* Q0 */ - move16(); - move16(); - - st->codec_mode = st_ivas->codec_mode; /* Q0 */ - st->max_bwidth = st_ivas->hEncoderConfig->max_bwidth; /* Q0 */ - move16(); - move16(); - - st->Opt_RF_ON = st_ivas->hEncoderConfig->Opt_RF_ON; /* Q0 */ - st->rf_fec_offset = st_ivas->hEncoderConfig->rf_fec_offset; /* Q0 */ - st->rf_fec_indicator = st_ivas->hEncoderConfig->rf_fec_indicator; /* Q0 */ - move16(); - move16(); - move16(); - - st->element_mode = st_ivas->hEncoderConfig->element_mode_init; /* Q0 */ - move16(); - - return; -} -#endif /*-------------------------------------------------------------------* * copy_encoder_config_fx() * @@ -467,617 +414,6 @@ void ivas_initialize_handles_enc_fx( * * Initialize IVAS encoder state structure *-------------------------------------------------------------------*/ -#ifndef HARM_ENC_INIT -ivas_error ivas_init_encoder( - Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */ -) -{ - Word16 i, n; - Word16 nchan_inp_buff; - Word16 sce_id, cpe_id; - IVAS_FORMAT ivas_format; - Word32 input_Fs, ivas_total_brate; - Word32 element_brate_tmp[MAX_NUM_OBJECTS]; - ENCODER_CONFIG_HANDLE hEncoderConfig; - ivas_error error; - - error = IVAS_ERR_OK; - - hEncoderConfig = st_ivas->hEncoderConfig; - ivas_format = hEncoderConfig->ivas_format; - input_Fs = hEncoderConfig->input_Fs; /* Q0 */ - ivas_total_brate = hEncoderConfig->ivas_total_brate; /* Q0 */ - move32(); - move32(); - - hEncoderConfig->last_ivas_total_brate = ivas_total_brate; /* Q0 */ - move32(); - - if ( NE_32( ivas_format, MONO_FORMAT ) ) - { - /* In IVAS, ensure that minimum coded bandwidth is WB */ - hEncoderConfig->max_bwidth = s_max( hEncoderConfig->max_bwidth, WB ); /* Q0 */ - move16(); - } - st_ivas->ism_mode = ISM_MODE_NONE; - st_ivas->mc_mode = MC_MODE_NONE; - move32(); - move32(); - - st_ivas->nchan_transport = -1; - move16(); - - /*-----------------------------------------------------------------* - * Allocate floating-point input audio buffers - *-----------------------------------------------------------------*/ - - nchan_inp_buff = hEncoderConfig->nchan_inp; /* Q0 */ - move16(); - - IF( EQ_32( ivas_format, MONO_FORMAT ) ) - { - nchan_inp_buff = 0; - move16(); - } - ELSE IF( EQ_32( ivas_format, MASA_ISM_FORMAT ) ) - { - if ( EQ_32( sub( hEncoderConfig->nchan_inp, hEncoderConfig->nchan_ism ), 1 ) ) /* mono is duplicated in monoMASA */ - { - nchan_inp_buff = add( nchan_inp_buff, 1 ); - } - - nchan_inp_buff = add( nchan_inp_buff, 1 ); /* for *data_separated_object */ - } - - FOR( n = 0; n < nchan_inp_buff; n++ ) - { - /* note: these are intra-frame heap memories */ - IF( ( st_ivas->p_data_fx[n] = (Word32 *) malloc( Mpy_32_16_1( input_Fs, INV_FRAME_PER_SEC_Q15 ) * sizeof( Word32 ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for floating-point input audio buffer!\n" ) ); - } - set32_fx( st_ivas->p_data_fx[n], 0, extract_l( Mpy_32_16_1( input_Fs, INV_FRAME_PER_SEC_Q15 ) ) ); - } - st_ivas->q_data_fx = Q11; - move16(); - FOR( ; n < MAX_INPUT_CHANNELS + MAX_NUM_OBJECTS; n++ ) - { - st_ivas->p_data_fx[n] = NULL; - } - /*-----------------------------------------------------------------* - * Allocate and initialize buffer of indices - *-----------------------------------------------------------------*/ - - /* set the maximum allowed number of indices in the list */ - st_ivas->ivas_max_num_indices = get_ivas_max_num_indices_fx( ivas_format, ivas_total_brate ); /* Q0 */ - move16(); - - /* allocate buffer of indices */ - IF( ( st_ivas->ind_list = (INDICE_HANDLE) malloc( st_ivas->ivas_max_num_indices * sizeof( Indice ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of indices!\n" ) ); - } - - /* reset the list of indices */ - for ( i = 0; i < st_ivas->ivas_max_num_indices; i++ ) - { - st_ivas->ind_list[i].nb_bits = -1; - move16(); - } - - /* set the maximum allowed number of metadata indices in the list */ - st_ivas->ivas_max_num_indices_metadata = get_ivas_max_num_indices_metadata_fx( st_ivas->hEncoderConfig->ivas_format, st_ivas->hEncoderConfig->ivas_total_brate ); /* Q0 */ - move16(); - - /* allocate buffer of metadata indices */ - IF( st_ivas->ivas_max_num_indices_metadata > 0 ) - { - IF( ( st_ivas->ind_list_metadata = (INDICE_HANDLE) malloc( st_ivas->ivas_max_num_indices_metadata * sizeof( Indice ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for buffer of metadata indices!\n" ) ); - } - - /* reset the list of metadata indices */ - for ( i = 0; i < st_ivas->ivas_max_num_indices_metadata; i++ ) - { - st_ivas->ind_list_metadata[i].nb_bits = -1; - move16(); - } - } - ELSE - { - st_ivas->ind_list_metadata = NULL; - } - - /*-----------------------------------------------------------------* - * Allocate and initialize SCE/CPE and other handles - *-----------------------------------------------------------------*/ - - IF( EQ_32( ivas_format, MONO_FORMAT ) ) - { - st_ivas->nSCE = 1; /* in mono, there is always only one SCE */ - move16(); - st_ivas->nCPE = 0; - move16(); - st_ivas->nchan_transport = 1; - move16(); - sce_id = 0; - move16(); - - test(); - IF( st_ivas->hEncoderConfig->element_mode_init != EVS_MONO ) - { - IF( ( error = create_sce_enc_fx( st_ivas, sce_id, ivas_total_brate ) ) != IVAS_ERR_OK ) - { - return error; - } - } - ELSE - { - IF( NE_32( ( error = create_evs_sce_enc_fx( st_ivas, sce_id, ivas_total_brate ) ), IVAS_ERR_OK ) ) - { - return error; - } - } - - /* prepare stereo downmix for EVS */ - IF( EQ_16( hEncoderConfig->stereo_dmx_evs, 1 ) ) - { - IF( ( error = stereo_dmx_evs_init_encoder_fx( &( st_ivas->hStereoDmxEVS ), input_Fs ) ) != IVAS_ERR_OK ) - { - return error; - } - } - } - ELSE IF( EQ_32( ivas_format, STEREO_FORMAT ) ) - { - st_ivas->nSCE = 0; - st_ivas->nCPE = 1; /* in stereo, there is always only one CPE */ - st_ivas->nchan_transport = CPE_CHANNELS; - cpe_id = 0; - move16(); - move16(); - move16(); - move16(); - - IF( ( error = create_cpe_enc_fx( st_ivas, cpe_id, ivas_total_brate ) ) != IVAS_ERR_OK ) - { - return error; - } - } - ELSE IF( EQ_32( ivas_format, ISM_FORMAT ) ) - { - st_ivas->ism_mode = ivas_ism_mode_select( hEncoderConfig->nchan_inp, ivas_total_brate ); - - IF( ( error = ivas_ism_metadata_enc_create_fx( st_ivas, hEncoderConfig->nchan_inp, element_brate_tmp ) ) != IVAS_ERR_OK ) - { - return error; - } - - FOR( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) - { - IF( ( error = create_sce_enc_fx( st_ivas, sce_id, element_brate_tmp[sce_id] ) ) != IVAS_ERR_OK ) - { - return error; - } - } - - IF( EQ_32( st_ivas->ism_mode, ISM_MODE_PARAM ) ) - { - IF( ( error = ivas_param_ism_enc_open_fx( st_ivas ) ) != IVAS_ERR_OK ) - { - return error; - } - } - - IF( st_ivas->hEncoderConfig->Opt_DTX_ON ) - { - IF( ( error = ivas_ism_dtx_open( st_ivas ) ) != IVAS_ERR_OK ) - { - return error; - } - } - } - ELSE IF( EQ_32( ivas_format, SBA_FORMAT ) || EQ_32( ivas_format, MASA_FORMAT ) ) - { - IF( ( error = ivas_qmetadata_open_fx( &( st_ivas->hQMetaData ) ) ) != IVAS_ERR_OK ) - { - return error; - } - - IF( EQ_32( ivas_format, SBA_FORMAT ) ) - { - st_ivas->sba_analysis_order = ivas_sba_get_analysis_order_fx( ivas_total_brate, st_ivas->hEncoderConfig->sba_order ); /* Q0 */ - move16(); - - IF( ( error = ivas_spar_enc_open_fx( st_ivas, 0 ) ) != IVAS_ERR_OK ) - { - return error; - } - - IF( ( error = ivas_dirac_enc_open_fx( st_ivas ) ) != IVAS_ERR_OK ) - { - return error; - } - } - ELSE - { - st_ivas->nchan_transport = hEncoderConfig->nchan_inp; /* Q0 */ - move16(); - - IF( ( error = ivas_masa_enc_open_fx( st_ivas ) ) != IVAS_ERR_OK ) - { - return error; - } - } - - FOR( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) - { - IF( ( error = create_sce_enc_fx( st_ivas, sce_id, ivas_total_brate / st_ivas->nchan_transport ) ) != IVAS_ERR_OK ) - { - return error; - } - - if ( EQ_32( ivas_format, SBA_FORMAT ) && st_ivas->hEncoderConfig->Opt_DTX_ON ) - { - st_ivas->hSCE[sce_id]->hCoreCoder[0]->dtx_sce_sba = 1; - move16(); - } - } - - FOR( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) - { - Word32 res_dec, res_frac; - iDiv_and_mod_32( ivas_total_brate, st_ivas->nchan_transport, &res_dec, &res_frac, 0 ); - IF( ( error = create_cpe_enc_fx( st_ivas, cpe_id, imult3216( res_dec, CPE_CHANNELS ) ) ) != IVAS_ERR_OK ) - { - return error; - } - - FOR( n = 0; n < CPE_CHANNELS; n++ ) - { - if ( hEncoderConfig->Opt_DTX_ON ) - { - st_ivas->hCPE[cpe_id]->hCoreCoder[n]->cng_sba_flag = 1; - move16(); - } - } - } - - IF( GT_16( st_ivas->nCPE, 1 ) ) - { - IF( ( error = create_mct_enc_fx( st_ivas ) ) != IVAS_ERR_OK ) - { - return error; - } - } - } - ELSE IF( EQ_32( ivas_format, MASA_ISM_FORMAT ) ) - { - Word32 ism_total_brate; - Word16 k; - - st_ivas->ism_mode = ivas_omasa_ism_mode_select_fx( ivas_total_brate, hEncoderConfig->nchan_ism ); /* Q0 */ - move32(); - st_ivas->nchan_transport = 2; - move16(); - - IF( ( error = ivas_ism_metadata_enc_create_fx( st_ivas, hEncoderConfig->nchan_ism, element_brate_tmp ) ) != IVAS_ERR_OK ) - { - return error; - } - - k = 0; - move16(); - while ( k < SIZE_IVAS_BRATE_TBL && NE_32( ivas_total_brate, ivas_brate_tbl[k] ) ) - { - k++; - } - - ism_total_brate = 0; - move32(); - FOR( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) - { - ism_total_brate = L_add( ism_total_brate, sep_object_brate[k - 2][st_ivas->nSCE - 1] ); - IF( ( error = create_sce_enc_fx( st_ivas, sce_id, sep_object_brate[k - 2][st_ivas->nSCE - 1] ) ) != IVAS_ERR_OK ) - { - return error; - } - } - - IF( ( error = ivas_qmetadata_open_fx( &( st_ivas->hQMetaData ) ) ) != IVAS_ERR_OK ) - { - return error; - } - IF( ( error = ivas_masa_enc_open_fx( st_ivas ) ) != IVAS_ERR_OK ) - { - return error; - } - - IF( NE_32( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) ) - { - IF( ( error = ivas_omasa_enc_open_fx( st_ivas ) ) != IVAS_ERR_OK ) - { - return error; - } - } - - if ( GE_32( L_sub( ivas_total_brate, ism_total_brate ), MIN_BRATE_MDCT_STEREO ) ) - { - st_ivas->hEncoderConfig->element_mode_init = IVAS_CPE_MDCT; - move16(); - } - else - { - st_ivas->hEncoderConfig->element_mode_init = IVAS_CPE_DFT; - move16(); - } - - IF( ( error = create_cpe_enc_fx( st_ivas, 0, L_sub( ivas_total_brate, ism_total_brate ) ) ) != IVAS_ERR_OK ) - { - return error; - } - } - ELSE IF( EQ_32( ivas_format, SBA_ISM_FORMAT ) ) - { - st_ivas->ism_mode = ISM_MODE_NONE; - - if ( GE_32( ivas_total_brate, IVAS_256k ) ) - { - st_ivas->ism_mode = ISM_SBA_MODE_DISC; - } - - IF( ( error = ivas_ism_metadata_enc_create_fx( st_ivas, hEncoderConfig->nchan_ism, element_brate_tmp ) ) != IVAS_ERR_OK ) - { - return error; - } - - /* allocate and initialize SBA handles */ - IF( ( error = ivas_qmetadata_open_fx( &( st_ivas->hQMetaData ) ) ) != IVAS_ERR_OK ) - { - return error; - } - - st_ivas->sba_analysis_order = ivas_sba_get_analysis_order_fx( ivas_total_brate, st_ivas->hEncoderConfig->sba_order ); - move16(); - - IF( ( error = ivas_spar_enc_open_fx( st_ivas, 0 ) ) != IVAS_ERR_OK ) - { - return error; - } - - IF( ( error = ivas_dirac_enc_open_fx( st_ivas ) ) != IVAS_ERR_OK ) - { - return error; - } - - IF( EQ_32( st_ivas->ism_mode, ISM_MODE_NONE ) ) - { - /* allocate and initialize SBA core-coders */ - IF( EQ_16( st_ivas->nchan_transport, 1 ) ) - { - IF( ( error = create_sce_enc_fx( st_ivas, 0, ivas_total_brate ) ) != IVAS_ERR_OK ) - { - return error; - } - } - - FOR( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) - { - Word32 res_dec, res_frac; - iDiv_and_mod_32( ivas_total_brate, st_ivas->nchan_transport, &res_dec, &res_frac, 0 ); - IF( ( error = create_cpe_enc_fx( st_ivas, cpe_id, imult3216( res_dec, CPE_CHANNELS ) ) ) != IVAS_ERR_OK ) - { - return error; - } - } - - IF( GT_16( st_ivas->nCPE, 1 ) ) - { - IF( ( error = create_mct_enc_fx( st_ivas ) ) != IVAS_ERR_OK ) - { - return error; - } - } - } - ELSE - { - /* allocate and initialize MCT core coder */ - st_ivas->nCPE = add( st_ivas->nCPE, shr( add( st_ivas->hEncoderConfig->nchan_ism, 1 ), 1 ) ); - - FOR( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) - { - Word32 res_dec, res_frac; - iDiv_and_mod_32( ivas_total_brate, st_ivas->nchan_transport, &res_dec, &res_frac, 0 ); - IF( ( error = create_cpe_enc_fx( st_ivas, cpe_id, imult3216( res_dec, CPE_CHANNELS ) ) ) != IVAS_ERR_OK ) - { - return error; - } - } - - IF( ( error = create_mct_enc_fx( st_ivas ) ) != IVAS_ERR_OK ) - { - return error; - } - } - IF( ( error = ivas_osba_enc_open_fx( st_ivas ) ) != IVAS_ERR_OK ) - { - return error; - } - } - ELSE IF( EQ_32( ivas_format, MC_FORMAT ) ) - { - st_ivas->mc_mode = ivas_mc_mode_select_fx( hEncoderConfig->mc_input_setup, ivas_total_brate ); /* Q0 */ - - IF( ( error = ivas_create_lfe_lpf_enc_fx( &st_ivas->hLfeLpf, hEncoderConfig->input_Fs ) ) != IVAS_ERR_OK ) - { - return error; - } - - IF( EQ_32( st_ivas->mc_mode, MC_MODE_MCT ) ) - { - st_ivas->nSCE = 0; - st_ivas->nCPE = idiv1616( hEncoderConfig->nchan_inp, CPE_CHANNELS ); /* Q0 */ - move16(); - move16(); - - FOR( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) - { - Word32 res_dec, res_frac; - iDiv_and_mod_32( ivas_total_brate, sub( hEncoderConfig->nchan_inp, 1 ), &res_dec, &res_frac, 0 ); - IF( ( error = create_cpe_enc_fx( st_ivas, cpe_id, imult3216( res_dec, CPE_CHANNELS ) ) ) != IVAS_ERR_OK ) - { - return error; - } - } - - IF( ( error = create_mct_enc_fx( st_ivas ) ) != IVAS_ERR_OK ) - { - return error; - } - - IF( ( error = ivas_create_lfe_enc_fx( &st_ivas->hLFE, input_Fs ) ) != IVAS_ERR_OK ) - { - return error; - } - - st_ivas->nchan_transport = ivas_mc_ls_setup_get_num_channels_fx( st_ivas->hEncoderConfig->mc_input_setup ); /* Q0 */ - move16(); - } - ELSE IF( EQ_32( st_ivas->mc_mode, MC_MODE_PARAMUPMIX ) ) - { - st_ivas->nSCE = 0; - st_ivas->nCPE = MC_PARAMUPMIX_MAX_TRANSPORT_CHANS / 2; - st_ivas->nchan_transport = MC_PARAMUPMIX_MAX_TRANSPORT_CHANS; - move16(); - move16(); - move16(); - - IF( ( error = ivas_mc_paramupmix_enc_open_fx( st_ivas ) ) != IVAS_ERR_OK ) - { - return error; - } - - FOR( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) - { - Word32 res_dec, res_frac; - iDiv_and_mod_32( ivas_total_brate, st_ivas->nCPE, &res_dec, &res_frac, 0 ); - IF( ( error = create_cpe_enc_fx( st_ivas, cpe_id, res_dec ) ) != IVAS_ERR_OK ) - { - return error; - } - } - - IF( ( error = create_mct_enc_fx( st_ivas ) ) != IVAS_ERR_OK ) - { - return error; - } - - IF( ( error = ivas_create_lfe_enc_fx( &st_ivas->hLFE, input_Fs ) ) != IVAS_ERR_OK ) - { - return error; - } - } - ELSE IF( EQ_32( st_ivas->mc_mode, MC_MODE_PARAMMC ) ) - { - IF( ( error = ivas_param_mc_enc_open_fx( st_ivas ) ) != IVAS_ERR_OK ) - { - return error; - } - - FOR( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) - { - Word32 res_dec, res_frac; - iDiv_and_mod_32( ivas_total_brate, add( st_ivas->nCPE, st_ivas->nSCE ), &res_dec, &res_frac, 0 ); - IF( ( error = create_cpe_enc_fx( st_ivas, cpe_id, res_dec ) ) != IVAS_ERR_OK ) - { - return error; - } - } - - IF( GT_16( st_ivas->nCPE, 1 ) ) - { - IF( ( error = create_mct_enc_fx( st_ivas ) ) != IVAS_ERR_OK ) - { - return error; - } - } - } - ELSE IF( EQ_32( st_ivas->mc_mode, MC_MODE_MCMASA ) ) - { - Word32 brate_sce, brate_cpe; - - ivas_mcmasa_setNumTransportChannels_fx( &( st_ivas->nchan_transport ), &( hEncoderConfig->element_mode_init ), ivas_total_brate ); - - IF( ( error = ivas_qmetadata_open_fx( &( st_ivas->hQMetaData ) ) ) != IVAS_ERR_OK ) - { - return error; - } - - IF( ( error = ivas_masa_enc_open_fx( st_ivas ) ) != IVAS_ERR_OK ) - { - return error; - } - IF( ( error = ivas_mcmasa_enc_open_fx( st_ivas ) ) != IVAS_ERR_OK ) - { - return error; - } - - ivas_mcmasa_split_brate_fx( st_ivas->hMcMasa->separateChannelEnabled, ivas_total_brate, st_ivas->nSCE, st_ivas->nCPE, &brate_sce, &brate_cpe ); - - FOR( sce_id = 0; sce_id < st_ivas->nSCE; sce_id++ ) - { - IF( ( error = create_sce_enc_fx( st_ivas, sce_id, brate_sce ) ) != IVAS_ERR_OK ) - { - return error; - } - } - - FOR( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) - { - hEncoderConfig->element_mode_init = IVAS_CPE_MDCT; - move16(); - - IF( ( error = create_cpe_enc_fx( st_ivas, cpe_id, brate_cpe ) ) != IVAS_ERR_OK ) - { - return error; - } - } - } - } - - /*-----------------------------------------------------------------* - * Allocate and initialize HP20 filter memories - *-----------------------------------------------------------------*/ - - /* set number of input channels used for analysis/coding */ - n = getNumChanAnalysis_fx( st_ivas ); /* Q0 */ - move16(); - - IF( n > 0 ) - { - IF( ( st_ivas->mem_hp20_in_fx = (Word32 **) malloc( n * sizeof( Word32 * ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HP20 filter memory\n" ) ); - } - } - ELSE - { - st_ivas->mem_hp20_in_fx = NULL; - } - - FOR( i = 0; i < n; i++ ) - { - IF( ( st_ivas->mem_hp20_in_fx[i] = (Word32 *) malloc( ( L_HP20_MEM + 2 ) * sizeof( Word32 ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HP20 filter memory\n" ) ); - } - - set32_fx( st_ivas->mem_hp20_in_fx[i], 0, L_HP20_MEM + 2 ); - } - return error; -} -#endif ivas_error ivas_init_encoder_fx( Encoder_Struct *st_ivas /* i/o: IVAS encoder structure */ ) diff --git a/lib_enc/ivas_mc_param_enc_fx.c b/lib_enc/ivas_mc_param_enc_fx.c index ac836b674..8b09f3644 100644 --- a/lib_enc/ivas_mc_param_enc_fx.c +++ b/lib_enc/ivas_mc_param_enc_fx.c @@ -675,15 +675,10 @@ static void ivas_param_mc_param_est_enc_fx( #endif Word32 a_fx, b_fx, c_fx, d_fx; /* Tmp complex values */ Word16 a_e, b_e, c_e, d_e; /* Tmp complex values */ -#ifdef MERGE_REQUEST_1378_SPEEDUP_ivas_mc_param_enc_fx_NONBE Word64 Cy_sum_real_64[PARAM_MC_MAX_PARAMETER_BANDS][MAX_CICP_CHANNELS][MAX_CICP_CHANNELS]; Word64 Cy_sum_imag_64[PARAM_MC_MAX_PARAM_BAND_ABS_COV_ENC][MAX_CICP_CHANNELS][MAX_CICP_CHANNELS]; Word16 sub62gb; Word16 sub35gb; -#else - Word32 Cy_sum_imag_fx[PARAM_MC_MAX_PARAM_BAND_ABS_COV_ENC][MAX_CICP_CHANNELS][MAX_CICP_CHANNELS]; - Word16 Cy_sum_imag_e[PARAM_MC_MAX_PARAM_BAND_ABS_COV_ENC][MAX_CICP_CHANNELS][MAX_CICP_CHANNELS]; -#endif Word32 Cx_sum_imag_fx[PARAM_MC_MAX_PARAM_BAND_ABS_COV_ENC][PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS]; Word16 Cx_sum_imag_e[PARAM_MC_MAX_PARAM_BAND_ABS_COV_ENC][PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS]; Word32 real_part_fx, imag_part_fx; @@ -712,7 +707,6 @@ static void ivas_param_mc_param_est_enc_fx( move16(); band_step = 1; move16(); -#ifdef MERGE_REQUEST_1378_SPEEDUP_ivas_mc_param_enc_fx_NONBE FOR( cur_param_band = 0; cur_param_band < PARAM_MC_MAX_PARAMETER_BANDS; cur_param_band++ ) { FOR( ch_idx1 = 0; ch_idx1 < MAX_CICP_CHANNELS; ch_idx1++ ) @@ -720,18 +714,12 @@ static void ivas_param_mc_param_est_enc_fx( set64_fx( Cy_sum_real_64[cur_param_band][ch_idx1], 0, MAX_CICP_CHANNELS ); } } -#endif FOR( cur_param_band = 0; cur_param_band < PARAM_MC_MAX_PARAM_BAND_ABS_COV_ENC; cur_param_band++ ) { FOR( ch_idx1 = 0; ch_idx1 < MAX_CICP_CHANNELS; ch_idx1++ ) { -#ifdef MERGE_REQUEST_1378_SPEEDUP_ivas_mc_param_enc_fx_NONBE set64_fx( Cy_sum_imag_64[cur_param_band][ch_idx1], 0, MAX_CICP_CHANNELS ); -#else - set32_fx( Cy_sum_imag_fx[cur_param_band][ch_idx1], 0, MAX_CICP_CHANNELS ); - set16_fx( Cy_sum_imag_e[cur_param_band][ch_idx1], 0, MAX_CICP_CHANNELS ); -#endif } FOR( ch_idx1 = 0; ch_idx1 < PARAM_MC_MAX_TRANSPORT_CHANS; ch_idx1++ ) @@ -760,23 +748,16 @@ static void ivas_param_mc_param_est_enc_fx( } } -#if defined( IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST_BE ) || defined( IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST_NONBE ) Word16 gb = find_guarded_bits_fx( l_ts ); #ifndef MERGE_REQUEST_1472_SPEEDUP_ivas_mc_param_enc_fx_NONBE Word16 add20gb = add( 20, gb ); #endif -#endif -#ifdef MERGE_REQUEST_1378_SPEEDUP_ivas_mc_param_enc_fx_NONBE sub35gb = sub( 32, sub( 11, find_guarded_bits_fx( l_ts ) ) ); // 31 - (((11 - gb) + 31 + norm) - 32) sub62gb = sub( 63, shl( sub( 11, find_guarded_bits_fx( l_ts ) ), 1 ) ); // 31 - ((2*(11 - gb) + norm) - 32) -#endif FOR( ts = start_ts; ts < num_time_slots; ts++ ) { -#if !defined( IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST_BE ) && !defined( IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST_NONBE ) - Word16 gb = find_guarded_bits_fx( l_ts ); -#endif ivas_fb_mixer_get_windowed_fr_fx( hParamMC->hFbMixer, pcm_in_fx, p_slot_frame_f_real_fx, p_slot_frame_f_imag_fx, l_ts, l_ts, hParamMC->hFbMixer->fb_cfg->num_in_chans, gb ); ivas_fb_mixer_update_prior_input_fx( hParamMC->hFbMixer, pcm_in_fx, l_ts, hParamMC->hFbMixer->fb_cfg->num_in_chans ); @@ -822,26 +803,6 @@ static void ivas_param_mc_param_est_enc_fx( move64(); move64(); -#else -#ifndef IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST_BE - dmx_real_fx[ch_idx1] = 0; - move32(); - dmx_real_e[ch_idx1] = 0; - move16(); - dmx_imag_fx[ch_idx1] = 0; - move32(); - dmx_imag_e[ch_idx1] = 0; - move16(); - FOR( inp_ch = 0; inp_ch < nchan_input; inp_ch++ ) - { - L_tmp = Mpy_32_32( slot_frame_f_real_fx[inp_ch][cur_cldfb_band], ( *p_dmx_fac_fx ) ); - dmx_real_fx[ch_idx1] = BASOP_Util_Add_Mant32Exp( dmx_real_fx[ch_idx1], dmx_real_e[ch_idx1], L_tmp, add( 20, gb ), &dmx_real_e[ch_idx1] ); - move32(); - L_tmp = Mpy_32_32( slot_frame_f_imag_fx[inp_ch][cur_cldfb_band], ( *p_dmx_fac_fx ) ); - dmx_imag_fx[ch_idx1] = BASOP_Util_Add_Mant32Exp( dmx_imag_fx[ch_idx1], dmx_imag_e[ch_idx1], L_tmp, add( 20, gb ), &dmx_imag_e[ch_idx1] ); - move32(); - p_dmx_fac_fx++; - } #else Word32 real_fx = L_add( 0, 0 ); Word16 real_e = add( 0, 0 ); @@ -863,7 +824,6 @@ static void ivas_param_mc_param_est_enc_fx( move16(); move32(); move16(); -#endif #endif } @@ -910,7 +870,6 @@ static void ivas_param_mc_param_est_enc_fx( move32(); } } -#ifdef MERGE_REQUEST_1378_SPEEDUP_ivas_mc_param_enc_fx_NONBE FOR( ch_idx1 = 0; ch_idx1 < nchan_input; ++ch_idx1 ) { a_fx = slot_frame_f_real_fx[ch_idx1][cur_cldfb_band]; @@ -930,65 +889,6 @@ static void ivas_param_mc_param_est_enc_fx( move64(); } } -#else - /* Cy for input channels */ - FOR( ch_idx1 = 0; ch_idx1 < nchan_input; ++ch_idx1 ) - { -#ifdef IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST_NONBE - a_e = norm_l( slot_frame_f_real_fx[ch_idx1][cur_cldfb_band] ); - a_fx = L_shl( slot_frame_f_real_fx[ch_idx1][cur_cldfb_band], a_e ); - a_e = sub( add20gb, a_e ); - if ( a_fx == 0 ) - { - a_e = 0; - move16(); - } - b_e = norm_l( slot_frame_f_imag_fx[ch_idx1][cur_cldfb_band] ); - b_fx = L_shl( slot_frame_f_imag_fx[ch_idx1][cur_cldfb_band], b_e ); - b_e = sub( add20gb, b_e ); - if ( b_fx == 0 ) - { - b_e = 0; - move16(); - } -#endif - FOR( ch_idx2 = ch_idx1; ch_idx2 < nchan_input; ++ch_idx2 ) - { -#ifndef IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST_NONBE - a_fx = BASOP_Util_Add_Mant32Exp( slot_frame_f_real_fx[ch_idx1][cur_cldfb_band], add( 20, gb ), 0, 0, &a_e ); - b_fx = BASOP_Util_Add_Mant32Exp( slot_frame_f_imag_fx[ch_idx1][cur_cldfb_band], add( 20, gb ), 0, 0, &b_e ); - c_fx = BASOP_Util_Add_Mant32Exp( slot_frame_f_real_fx[ch_idx2][cur_cldfb_band], add( 20, gb ), 0, 0, &c_e ); - d_fx = BASOP_Util_Add_Mant32Exp( slot_frame_f_imag_fx[ch_idx2][cur_cldfb_band], add( 20, gb ), 0, 0, &d_e ); -#else - c_e = norm_l( slot_frame_f_real_fx[ch_idx2][cur_cldfb_band] ); - c_fx = L_shl( slot_frame_f_real_fx[ch_idx2][cur_cldfb_band], c_e ); - c_e = sub( add20gb, c_e ); - if ( c_fx == 0 ) - { - c_e = 0; - move16(); - } - d_e = norm_l( slot_frame_f_imag_fx[ch_idx2][cur_cldfb_band] ); - d_fx = L_shl( slot_frame_f_imag_fx[ch_idx2][cur_cldfb_band], d_e ); - d_e = sub( add20gb, d_e ); - if ( d_fx == 0 ) - { - d_e = 0; - move16(); - } -#endif - /* (a-ib)(c+id) = ac + bd + i(ad-bc) */ - L_tmp = BASOP_Util_Add_Mant32Exp( Mpy_32_32( a_fx, c_fx ), add( a_e, c_e ), Mpy_32_32( b_fx, d_fx ), add( b_e, d_e ), &tmp_e ); - Cy_sum_fx[cur_param_band][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cy_sum_fx[cur_param_band][ch_idx1][ch_idx2], Cy_sum_e[cur_param_band][ch_idx1][ch_idx2], - L_tmp, tmp_e, &Cy_sum_e[cur_param_band][ch_idx1][ch_idx2] ); - move32(); - L_tmp = BASOP_Util_Add_Mant32Exp( Mpy_32_32( a_fx, d_fx ), add( a_e, d_e ), L_negate( Mpy_32_32( b_fx, c_fx ) ), add( b_e, c_e ), &tmp_e ); - Cy_sum_imag_fx[cur_param_band][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cy_sum_imag_fx[cur_param_band][ch_idx1][ch_idx2], Cy_sum_imag_e[cur_param_band][ch_idx1][ch_idx2], - L_tmp, tmp_e, &Cy_sum_imag_e[cur_param_band][ch_idx1][ch_idx2] ); - move32(); - } - } -#endif } } @@ -1026,27 +926,6 @@ static void ivas_param_mc_param_est_enc_fx( dmx_imag_64[ch_idx1] = imag_64; move64(); move64(); -#else -#ifndef IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST_BE - dmx_real_fx[ch_idx1] = 0; - move32(); - dmx_real_e[ch_idx1] = 0; - move16(); - dmx_imag_fx[ch_idx1] = 0; - move32(); - dmx_imag_e[ch_idx1] = 0; - move16(); - - FOR( inp_ch = 0; inp_ch < nchan_input; inp_ch++ ) - { - L_tmp = Mpy_32_32( slot_frame_f_real_fx[inp_ch][cur_cldfb_band], ( *p_dmx_fac_fx ) ); - dmx_real_fx[ch_idx1] = BASOP_Util_Add_Mant32Exp( dmx_real_fx[ch_idx1], dmx_real_e[ch_idx1], L_tmp, add( 20, gb ), &dmx_real_e[ch_idx1] ); - move32(); - L_tmp = Mpy_32_32( slot_frame_f_imag_fx[inp_ch][cur_cldfb_band], ( *p_dmx_fac_fx ) ); - dmx_imag_fx[ch_idx1] = BASOP_Util_Add_Mant32Exp( dmx_imag_fx[ch_idx1], dmx_imag_e[ch_idx1], L_tmp, add( 20, gb ), &dmx_imag_e[ch_idx1] ); - move32(); - p_dmx_fac_fx++; - } #else Word32 real_fx = L_add( 0, 0 ); Word16 real_e = 0; @@ -1071,7 +950,6 @@ static void ivas_param_mc_param_est_enc_fx( move32(); dmx_imag_e[ch_idx1] = imag_e; move16(); -#endif #endif } @@ -1083,7 +961,6 @@ static void ivas_param_mc_param_est_enc_fx( CONVERT_DMX( dmx_real_64[ch_idx1], a_fx, a_e ); CONVERT_DMX( dmx_imag_64[ch_idx1], b_fx, b_e ); #else -#ifdef IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST_BE a_fx = dmx_real_fx[ch_idx1]; move32(); a_e = dmx_real_e[ch_idx1]; @@ -1092,7 +969,6 @@ static void ivas_param_mc_param_est_enc_fx( move32(); b_e = dmx_imag_e[ch_idx1]; move16(); -#endif #endif FOR( ch_idx2 = 0; ch_idx2 < nchan_transport; ++ch_idx2 ) @@ -1106,34 +982,10 @@ static void ivas_param_mc_param_est_enc_fx( Cx_sum_fx[cur_param_band][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cx_sum_fx[cur_param_band][ch_idx1][ch_idx2], Cx_sum_e[cur_param_band][ch_idx1][ch_idx2], L_tmp, tmp_e, &Cx_sum_e[cur_param_band][ch_idx1][ch_idx2] ); #else -#ifndef IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST_BE - a_fx = dmx_real_fx[ch_idx1]; - move32(); - a_e = dmx_real_e[ch_idx1]; - move16(); - b_fx = dmx_imag_fx[ch_idx1]; - move32(); - b_e = dmx_imag_e[ch_idx1]; - move16(); - c_fx = dmx_real_fx[ch_idx2]; - move32(); - c_e = dmx_real_e[ch_idx2]; - move16(); - d_fx = dmx_imag_fx[ch_idx2]; - move32(); - d_e = dmx_imag_e[ch_idx2]; - move16(); - - /* (a-ib)(c+id) = ac + bd + i(ad-bc) */ - L_tmp = BASOP_Util_Add_Mant32Exp( Mpy_32_32( a_fx, c_fx ), add( a_e, c_e ), Mpy_32_32( b_fx, d_fx ), add( b_e, d_e ), &tmp_e ); - Cx_sum_fx[cur_param_band][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cx_sum_fx[cur_param_band][ch_idx1][ch_idx2], Cx_sum_e[cur_param_band][ch_idx1][ch_idx2], L_tmp, tmp_e, - &Cx_sum_e[cur_param_band][ch_idx1][ch_idx2] ); -#else /* (a-ib)(c+id) = ac + bd + i(ad-bc) */ L_tmp = BASOP_Util_Add_Mant32Exp( Mpy_32_32( a_fx, dmx_real_fx[ch_idx2] ), add( a_e, dmx_real_e[ch_idx2] ), Mpy_32_32( b_fx, dmx_imag_fx[ch_idx2] ), add( b_e, dmx_imag_e[ch_idx2] ), &tmp_e ); Cx_sum_fx[cur_param_band][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cx_sum_fx[cur_param_band][ch_idx1][ch_idx2], Cx_sum_e[cur_param_band][ch_idx1][ch_idx2], L_tmp, tmp_e, &Cx_sum_e[cur_param_band][ch_idx1][ch_idx2] ); -#endif #endif move32(); } @@ -1142,7 +994,6 @@ static void ivas_param_mc_param_est_enc_fx( /* Cy for input channels */ FOR( ch_idx1 = 0; ch_idx1 < nchan_input; ++ch_idx1 ) { -#ifdef IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST_NONBE a_e = norm_l( slot_frame_f_real_fx[ch_idx1][cur_cldfb_band] ); a_fx = L_shl( slot_frame_f_real_fx[ch_idx1][cur_cldfb_band], a_e ); a_e = sub( add20gb, a_e ); @@ -1159,8 +1010,6 @@ static void ivas_param_mc_param_est_enc_fx( b_e = 0; move16(); } -#endif -#ifdef MERGE_REQUEST_1378_SPEEDUP_ivas_mc_param_enc_fx_NONBE a_fx = slot_frame_f_real_fx[ch_idx1][cur_cldfb_band]; b_fx = slot_frame_f_imag_fx[ch_idx1][cur_cldfb_band]; move32(); @@ -1176,39 +1025,6 @@ static void ivas_param_mc_param_est_enc_fx( W_add( W_mult0_32_32( a_fx, c_fx ), W_mult0_32_32( b_fx, d_fx ) ) ); move64(); } -#else - FOR( ch_idx2 = ch_idx1; ch_idx2 < nchan_input; ++ch_idx2 ) - { -#ifndef IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST_NONBE - a_fx = BASOP_Util_Add_Mant32Exp( slot_frame_f_real_fx[ch_idx1][cur_cldfb_band], add( 20, gb ), 0, 0, &a_e ); - b_fx = BASOP_Util_Add_Mant32Exp( slot_frame_f_imag_fx[ch_idx1][cur_cldfb_band], add( 20, gb ), 0, 0, &b_e ); - c_fx = BASOP_Util_Add_Mant32Exp( slot_frame_f_real_fx[ch_idx2][cur_cldfb_band], add( 20, gb ), 0, 0, &c_e ); - d_fx = BASOP_Util_Add_Mant32Exp( slot_frame_f_imag_fx[ch_idx2][cur_cldfb_band], add( 20, gb ), 0, 0, &d_e ); -#else - c_e = norm_l( slot_frame_f_real_fx[ch_idx2][cur_cldfb_band] ); - c_fx = L_shl( slot_frame_f_real_fx[ch_idx2][cur_cldfb_band], c_e ); - c_e = sub( add20gb, c_e ); - if ( c_fx == 0 ) - { - c_e = 0; - move16(); - } - d_e = norm_l( slot_frame_f_imag_fx[ch_idx2][cur_cldfb_band] ); - d_fx = L_shl( slot_frame_f_imag_fx[ch_idx2][cur_cldfb_band], d_e ); - d_e = sub( add20gb, d_e ); - if ( d_fx == 0 ) - { - d_e = 0; - move16(); - } -#endif - /* (a-ib)(c+id) = ac + bd + i(ad-bc) */ - L_tmp = BASOP_Util_Add_Mant32Exp( Mpy_32_32( a_fx, c_fx ), add( a_e, c_e ), Mpy_32_32( b_fx, d_fx ), add( b_e, d_e ), &tmp_e ); - Cy_sum_fx[cur_param_band][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cy_sum_fx[cur_param_band][ch_idx1][ch_idx2], Cy_sum_e[cur_param_band][ch_idx1][ch_idx2], L_tmp, tmp_e, - &Cy_sum_e[cur_param_band][ch_idx1][ch_idx2] ); - move32(); - } -#endif } } } @@ -1222,7 +1038,6 @@ static void ivas_param_mc_param_est_enc_fx( { FOR( ch_idx1 = 0; ch_idx1 < nchan_input; ++ch_idx1 ) { -#ifdef MERGE_REQUEST_1378_SPEEDUP_ivas_mc_param_enc_fx_NONBE Cy_sum_real_64[cur_param_band][hParamMC->lfe_index][ch_idx1] = 0; move64(); Cy_sum_real_64[cur_param_band][ch_idx1][hParamMC->lfe_index] = 0; @@ -1231,24 +1046,6 @@ static void ivas_param_mc_param_est_enc_fx( move64(); Cy_sum_imag_64[cur_param_band][ch_idx1][hParamMC->lfe_index] = 0; move64(); -#else - Cy_sum_fx[cur_param_band][hParamMC->lfe_index][ch_idx1] = 0; - move32(); - Cy_sum_e[cur_param_band][hParamMC->lfe_index][ch_idx1] = 0; - move16(); - Cy_sum_fx[cur_param_band][ch_idx1][hParamMC->lfe_index] = 0; - move32(); - Cy_sum_e[cur_param_band][ch_idx1][hParamMC->lfe_index] = 0; - move16(); - Cy_sum_imag_fx[cur_param_band][hParamMC->lfe_index][ch_idx1] = 0; - move32(); - Cy_sum_imag_e[cur_param_band][hParamMC->lfe_index][ch_idx1] = 0; - move16(); - Cy_sum_imag_fx[cur_param_band][ch_idx1][hParamMC->lfe_index] = 0; - move32(); - Cy_sum_imag_e[cur_param_band][ch_idx1][hParamMC->lfe_index] = 0; - move16(); -#endif } } @@ -1256,21 +1053,10 @@ static void ivas_param_mc_param_est_enc_fx( { FOR( ch_idx1 = 0; ch_idx1 < nchan_input; ++ch_idx1 ) { -#ifdef MERGE_REQUEST_1378_SPEEDUP_ivas_mc_param_enc_fx_NONBE Cy_sum_real_64[cur_param_band][hParamMC->lfe_index][ch_idx1] = 0; move64(); Cy_sum_real_64[cur_param_band][ch_idx1][hParamMC->lfe_index] = 0; move64(); -#else - Cy_sum_fx[cur_param_band][hParamMC->lfe_index][ch_idx1] = 0; - move32(); - Cy_sum_e[cur_param_band][hParamMC->lfe_index][ch_idx1] = 0; - move16(); - Cy_sum_fx[cur_param_band][ch_idx1][hParamMC->lfe_index] = 0; - move32(); - Cy_sum_e[cur_param_band][ch_idx1][hParamMC->lfe_index] = 0; - move16(); -#endif } } } @@ -1307,16 +1093,9 @@ static void ivas_param_mc_param_est_enc_fx( /* get ICLDs */ FOR( k = 0; k < nchan_input; ++k ) { -#ifdef MERGE_REQUEST_1378_SPEEDUP_ivas_mc_param_enc_fx_NONBE CONVERT_CY( Cy_sum_real_64[cur_param_band][k][k], Nrg_fx[k], Nrg_e[k] ); move32(); move16(); -#else - Nrg_fx[k] = Cy_sum_fx[cur_param_band][k][k]; - move32(); - Nrg_e[k] = Cy_sum_e[cur_param_band][k][k]; - move16(); -#endif } FOR( k = 0; k < num_ilds_to_code; ++k ) { @@ -1383,22 +1162,11 @@ static void ivas_param_mc_param_est_enc_fx( { FOR( ch_idx2 = ch_idx1; ch_idx2 < nchan_input; ++ch_idx2 ) { -#ifdef MERGE_REQUEST_1378_SPEEDUP_ivas_mc_param_enc_fx_NONBE Cy_sum_real_64[cur_param_band - 1][ch_idx1][ch_idx2] = W_add( Cy_sum_real_64[cur_param_band - 1][ch_idx1][ch_idx2], Cy_sum_real_64[cur_param_band][ch_idx1][ch_idx2] ); move64(); Cy_sum_imag_64[cur_param_band - 1][ch_idx1][ch_idx2] = W_add( Cy_sum_imag_64[cur_param_band - 1][ch_idx1][ch_idx2], Cy_sum_imag_64[cur_param_band][ch_idx1][ch_idx2] ); move64(); -#else - Cy_sum_fx[cur_param_band - 1][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cy_sum_fx[cur_param_band - 1][ch_idx1][ch_idx2], Cy_sum_e[cur_param_band - 1][ch_idx1][ch_idx2], - Cy_sum_fx[cur_param_band][ch_idx1][ch_idx2], Cy_sum_e[cur_param_band][ch_idx1][ch_idx2], - &Cy_sum_e[cur_param_band - 1][ch_idx1][ch_idx2] ); - move32(); - Cy_sum_imag_fx[cur_param_band - 1][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cy_sum_imag_fx[cur_param_band - 1][ch_idx1][ch_idx2], Cy_sum_imag_e[cur_param_band - 1][ch_idx1][ch_idx2], - Cy_sum_imag_fx[cur_param_band][ch_idx1][ch_idx2], Cy_sum_imag_e[cur_param_band][ch_idx1][ch_idx2], - &Cy_sum_imag_e[cur_param_band - 1][ch_idx1][ch_idx2] ); - move32(); -#endif } } } @@ -1422,14 +1190,7 @@ static void ivas_param_mc_param_est_enc_fx( { FOR( ch_idx2 = ch_idx1; ch_idx2 < nchan_input; ++ch_idx2 ) { -#ifdef MERGE_REQUEST_1378_SPEEDUP_ivas_mc_param_enc_fx_NONBE Cy_sum_real_64[cur_param_band - 1][ch_idx1][ch_idx2] = W_add( Cy_sum_real_64[cur_param_band - 1][ch_idx1][ch_idx2], Cy_sum_real_64[cur_param_band][ch_idx1][ch_idx2] ); -#else - Cy_sum_fx[cur_param_band - 1][ch_idx1][ch_idx2] = BASOP_Util_Add_Mant32Exp( Cy_sum_fx[cur_param_band - 1][ch_idx1][ch_idx2], Cy_sum_e[cur_param_band - 1][ch_idx1][ch_idx2], - Cy_sum_fx[cur_param_band][ch_idx1][ch_idx2], Cy_sum_e[cur_param_band][ch_idx1][ch_idx2], - &Cy_sum_e[cur_param_band - 1][ch_idx1][ch_idx2] ); - move32(); -#endif } } } @@ -1438,7 +1199,6 @@ static void ivas_param_mc_param_est_enc_fx( band_step = 2; move16(); } -#ifdef MERGE_REQUEST_1378_SPEEDUP_ivas_mc_param_enc_fx_NONBE { // convert the 64 bit fixpoint back into the 48 bit float format FOR( cur_param_band = 0; cur_param_band < PARAM_MC_MAX_PARAMETER_BANDS; cur_param_band++ ) @@ -1454,7 +1214,6 @@ static void ivas_param_mc_param_est_enc_fx( } } } -#endif /* map complex covariances to real values */ FOR( cur_param_band = 0; cur_param_band < hParamMC->max_param_band_abs_cov; cur_param_band += band_step ) @@ -1491,16 +1250,9 @@ static void ivas_param_mc_param_est_enc_fx( { FOR( ch_idx2 = ch_idx1; ch_idx2 < nchan_input; ch_idx2++ ) { -#ifdef MERGE_REQUEST_1378_SPEEDUP_ivas_mc_param_enc_fx_NONBE CONVERT_CY( Cy_sum_imag_64[cur_param_band][ch_idx1][ch_idx2], imag_part_fx, imag_part_e ); move32(); move16(); -#else - imag_part_fx = Cy_sum_imag_fx[cur_param_band][ch_idx1][ch_idx2]; - move32(); - imag_part_e = Cy_sum_imag_e[cur_param_band][ch_idx1][ch_idx2]; - move16(); -#endif real_part_fx = Cy_sum_fx[cur_param_band][ch_idx1][ch_idx2]; move32(); real_part_e = Cy_sum_e[cur_param_band][ch_idx1][ch_idx2]; diff --git a/lib_enc/ivas_qmetadata_enc_fx.c b/lib_enc/ivas_qmetadata_enc_fx.c index 9a7c4038b..3040bc24a 100644 --- a/lib_enc/ivas_qmetadata_enc_fx.c +++ b/lib_enc/ivas_qmetadata_enc_fx.c @@ -1073,11 +1073,7 @@ void ivas_qmetadata_enc_sid_encode_fx( /*compute the average direction */ ivas_qmetadata_azimuth_elevation_to_direction_vector_fx( q_direction->band_data[b].azimuth_fx[m], q_direction->band_data[b].elevation_fx[m], direction_vector_fx ); scale_sig32( direction_vector_fx, 3, Q22 - Q30 ); // Q30 -> Q22 -#ifdef VEC_ARITH_OPT_v1 v_add_fixed_no_hdrm( avg_direction_vector_fx, direction_vector_fx, avg_direction_vector_fx, 3 ); // Q22 -#else /* VEC_ARITH_OPT_v1 */ - v_add_fixed( avg_direction_vector_fx, direction_vector_fx, avg_direction_vector_fx, 3, 0 ); // Q22 -#endif /* VEC_ARITH_OPT_v1 */ } ivas_qmetadata_direction_vector_to_azimuth_elevation_fx( avg_direction_vector_fx, Q22, &avg_azimuth_fx[b], &avg_elevation_fx[b] ); @@ -2421,11 +2417,7 @@ static Word16 ivas_qmetadata_entropy_encode_dir_fx( /*compute the average direction */ ivas_qmetadata_azimuth_elevation_to_direction_vector_fx( q_direction->band_data[i].azimuth_fx[j], q_direction->band_data[i].elevation_fx[j], direction_vector ); scale_sig32( direction_vector, 3, -8 ); // Q30 -> Q22 -#ifdef VEC_ARITH_OPT_v1 v_add_fixed_no_hdrm( avg_direction_vector, direction_vector, avg_direction_vector, 3 ); -#else /* VEC_ARITH_OPT_v1 */ - v_add_fixed( avg_direction_vector, direction_vector, avg_direction_vector, 3, 0 ); -#endif /* VEC_ARITH_OPT_v1 */ } } } @@ -2688,11 +2680,7 @@ static Word16 ivas_qmetadata_entropy_encode_dir_fx( IF( LT_16( idx, 4 ) ) { -#ifdef VEC_ARITH_OPT_v1 v_add_fixed_no_hdrm( avg_direction_vector, direction_vector, avg_direction_vector, 3 ); -#else /* VEC_ARITH_OPT_v1 */ - v_add_fixed( avg_direction_vector, direction_vector, avg_direction_vector, 3, 0 ); -#endif /* VEC_ARITH_OPT_v1 */ } } /* project the quantized average azimuth angle to the same grid as the current sample */ @@ -2723,11 +2711,7 @@ static Word16 ivas_qmetadata_entropy_encode_dir_fx( ivas_qmetadata_azimuth_elevation_to_direction_vector_fx( q_direction->band_data[i].azimuth_fx[j], q_direction->band_data[i].elevation_fx[j], direction_vector ); scale_sig32( direction_vector, 3, -8 ); // Q30 -> Q22 -#ifdef VEC_ARITH_OPT_v1 v_add_fixed_no_hdrm( avg_direction_vector, direction_vector, avg_direction_vector, 3 ); -#else /* VEC_ARITH_OPT_v1 */ - v_add_fixed( avg_direction_vector, direction_vector, avg_direction_vector, 3, 0 ); -#endif /* VEC_ARITH_OPT_v1 */ ivas_qmetadata_direction_vector_to_azimuth_elevation_fx( avg_direction_vector, Q22, &avg_azimuth, &avg_elevation ); avg_azimuth_index_upd = quantize_phi_enc_fx( L_add( avg_azimuth, 180 << Q22 ), 0, &avg_azimuth, avg_azimuth_alphabet ); diff --git a/lib_enc/ivas_sce_enc_fx.c b/lib_enc/ivas_sce_enc_fx.c index f0811aea6..879a98246 100644 --- a/lib_enc/ivas_sce_enc_fx.c +++ b/lib_enc/ivas_sce_enc_fx.c @@ -612,7 +612,6 @@ ivas_error create_evs_sce_enc_fx( { return error; } -#ifdef HARM_PUSH_BIT /*-----------------------------------------------------------------* * Bitstream *-----------------------------------------------------------------*/ @@ -626,11 +625,6 @@ ivas_error create_evs_sce_enc_fx( st_fx->hBstr->nb_bits_tot = 0; move16(); st_fx->hBstr->st_ivas = st_ivas; -#else - st_fx->hBstr->ind_list = ind_list; - // st_fx->hBstr->ind_list_fx = st->hBstr->ind_list; - reset_indices_enc_fx( st_fx->hBstr, MAX_NUM_INDICES ); -#endif hSCE->hCoreCoder[0] = st_fx; diff --git a/lib_enc/ivas_sns_enc_fx.c b/lib_enc/ivas_sns_enc_fx.c index 2eaefb483..e74e2297c 100644 --- a/lib_enc/ivas_sns_enc_fx.c +++ b/lib_enc/ivas_sns_enc_fx.c @@ -672,11 +672,7 @@ Word16 quantize_sns_fx( Word32 ener_side_fx; Word16 ener_side_q; -#ifdef VEC_ARITH_OPT_v1 v_sub_fixed_no_hdrm( snsQ_out_fx[0][k], snsQ_out_fx[1][k], side_fx, M ); -#else /* VEC_ARITH_OPT_v1 */ - v_sub_fixed( snsQ_out_fx[0][k], snsQ_out_fx[1][k], side_fx, M, 0 ); -#endif /* VEC_ARITH_OPT_v1 */ Word64 L64_sum; L64_sum = 1; diff --git a/lib_enc/ivas_stereo_dmx_evs_fx.c b/lib_enc/ivas_stereo_dmx_evs_fx.c index f84f90e46..f82f8ac13 100644 --- a/lib_enc/ivas_stereo_dmx_evs_fx.c +++ b/lib_enc/ivas_stereo_dmx_evs_fx.c @@ -98,10 +98,8 @@ #define STEREO_DMX_EVS_TRNS_EGY_FORGETTING_Q15 24576 -#ifdef FIX_1511_POC_RENORM #define STEREO_DMX_EVS_POC_RENORM_TH 33554432 // 65536 << 9 #define STEREO_DMX_EVS_POC_RENORM_SHIFT 3 -#endif const Word32 ipd_ff_Q31[STEREO_DMX_EVS_NB_SUBBAND_MAX] = { 2027355264, 2027355264, 2027355264, 2027355264, 2027355264, 2027355264, 2027355264, 2027355264, 2027355264, 2027355264, @@ -417,7 +415,6 @@ static void calc_poc_fx( Rr = L_add( L_add( specRr[i], Mpy_32_32_r( specLr[i], eps_cos ) ), Mpy_32_32_r( specLi[i], eps_sin ) ); Ri = L_add( L_sub( specRi[i], Mpy_32_32_r( specLr[i], eps_sin ) ), Mpy_32_32_r( specLi[i], eps_cos ) ); -#ifdef FIX_1511_POC_RENORM IF( ( LT_32( L_abs( Lr ), STEREO_DMX_EVS_POC_RENORM_TH ) ) && ( LT_32( L_abs( Li ), STEREO_DMX_EVS_POC_RENORM_TH ) ) && ( LT_32( L_abs( Rr ), STEREO_DMX_EVS_POC_RENORM_TH ) ) && @@ -428,7 +425,6 @@ static void calc_poc_fx( Rr = L_shl( Rr, STEREO_DMX_EVS_POC_RENORM_SHIFT ); Ri = L_shl( Ri, STEREO_DMX_EVS_POC_RENORM_SHIFT ); } -#endif specPOr[i] = L_add( Mpy_32_32_r( Lr, Rr ), Mpy_32_32_r( Li, Ri ) ); // 2*spec_e move32(); @@ -442,7 +438,6 @@ static void calc_poc_fx( Rr = L_add( L_sub( specRr[j], Mpy_32_32_r( specLr[j], eps_cos ) ), Mpy_32_32_r( specLi[j], eps_sin ) ); Ri = L_sub( L_sub( specRi[j], Mpy_32_32_r( specLr[j], eps_sin ) ), Mpy_32_32_r( specLi[j], eps_cos ) ); -#ifdef FIX_1511_POC_RENORM IF( ( LT_32( L_abs( Lr ), STEREO_DMX_EVS_POC_RENORM_TH ) ) && ( LT_32( L_abs( Li ), STEREO_DMX_EVS_POC_RENORM_TH ) ) && ( LT_32( L_abs( Rr ), STEREO_DMX_EVS_POC_RENORM_TH ) ) && @@ -453,7 +448,6 @@ static void calc_poc_fx( Rr = L_shl( Rr, STEREO_DMX_EVS_POC_RENORM_SHIFT ); Ri = L_shl( Ri, STEREO_DMX_EVS_POC_RENORM_SHIFT ); } -#endif specPOr[j] = L_add( Mpy_32_32_r( Lr, Rr ), Mpy_32_32_r( Li, Ri ) ); // 2*spec_e move32(); @@ -476,7 +470,6 @@ static void calc_poc_fx( Rr = L_add( L_add( specRr[i], Mpy_32_32_r( specLr[i], eps_cos ) ), Mpy_32_32_r( specLi[i], eps_sin ) ); Ri = L_add( L_sub( specRi[i], Mpy_32_32_r( specLr[i], eps_sin ) ), Mpy_32_32_r( specLi[i], eps_cos ) ); -#ifdef FIX_1511_POC_RENORM IF( ( LT_32( L_abs( Lr ), STEREO_DMX_EVS_POC_RENORM_TH ) ) && ( LT_32( L_abs( Li ), STEREO_DMX_EVS_POC_RENORM_TH ) ) && ( LT_32( L_abs( Rr ), STEREO_DMX_EVS_POC_RENORM_TH ) ) && @@ -487,7 +480,6 @@ static void calc_poc_fx( Rr = L_shl( Rr, STEREO_DMX_EVS_POC_RENORM_SHIFT ); Ri = L_shl( Ri, STEREO_DMX_EVS_POC_RENORM_SHIFT ); } -#endif specPOr[i] = L_add( Mpy_32_32_r( Lr, Rr ), Mpy_32_32_r( Li, Ri ) ); // 2*spec_e move32(); @@ -500,7 +492,6 @@ static void calc_poc_fx( Rr = L_add( L_sub( specRr[j], Mpy_32_32_r( specLr[j], eps_cos ) ), Mpy_32_32_r( specLi[j], eps_sin ) ); Ri = L_sub( L_sub( specRi[j], Mpy_32_32_r( specLr[j], eps_sin ) ), Mpy_32_32_r( specLi[j], eps_cos ) ); -#ifdef FIX_1511_POC_RENORM IF( ( LT_32( L_abs( Lr ), STEREO_DMX_EVS_POC_RENORM_TH ) ) && ( LT_32( L_abs( Li ), STEREO_DMX_EVS_POC_RENORM_TH ) ) && ( LT_32( L_abs( Rr ), STEREO_DMX_EVS_POC_RENORM_TH ) ) && @@ -511,7 +502,6 @@ static void calc_poc_fx( Rr = L_shl( Rr, STEREO_DMX_EVS_POC_RENORM_SHIFT ); Ri = L_shl( Ri, STEREO_DMX_EVS_POC_RENORM_SHIFT ); } -#endif specPOr[j] = L_add( Mpy_32_32_r( Lr, Rr ), Mpy_32_32_r( Li, Ri ) ); // 2*spec_e move32(); @@ -2486,7 +2476,6 @@ ivas_error stereo_dmx_evs_init_encoder_fx( fad_g = hStereoDmxEVS->hPHA->fad_g_fx; // fad_r = 1.0f / (float) ( fad_len + 1 ); -#ifdef FIX_1481_HARDCODE_DIV SWITCH( fad_len ) { case STEREO_DMX_EVS_FAD_LEN_16: @@ -2511,9 +2500,6 @@ ivas_error stereo_dmx_evs_init_encoder_fx( fad_r = BASOP_Util_Divide3232_Scale_newton( 1, add( fad_len, 1 ), &tmp_e ); BREAK; } -#else - fad_r = BASOP_Util_Divide3232_Scale_cadence( 1, add( fad_len, 1 ), &tmp_e ); -#endif fad_r = L_shl_r( fad_r, tmp_e ); fad_len2 = shr( fad_len, 1 ); FOR( ( n = 0, m = ( fad_len - 1 ) ); n < fad_len2; ( n++, m-- ) ) @@ -2631,7 +2617,6 @@ ivas_error stereo_dmx_evs_init_encoder_fx( move16(); fad_g = hStereoDmxEVS->hPHA->fad_g_prc_fx; // fad_r = 1.0f / (float) ( fad_len + 1 ); -#ifdef FIX_1481_HARDCODE_DIV SWITCH( fad_len ) { case STEREO_DMX_EVS_FADE_LEN_PRC_Q0 * 16: @@ -2656,9 +2641,6 @@ ivas_error stereo_dmx_evs_init_encoder_fx( fad_r = BASOP_Util_Divide3232_Scale_newton( 1, add( fad_len, 1 ), &tmp_e ); BREAK; } -#else - fad_r = BASOP_Util_Divide3232_Scale_cadence( 1, add( fad_len, 1 ), &tmp_e ); -#endif fad_r = L_shl_r( fad_r, tmp_e ); fad_len2 = shr( fad_len, 1 ); FOR( ( n = 0, m = ( fad_len - 1 ) ); n < fad_len2; ( n++, m-- ) ) diff --git a/lib_enc/ivas_stereo_icbwe_enc_fx.c b/lib_enc/ivas_stereo_icbwe_enc_fx.c index 95c49aeae..ff5d67d6a 100644 --- a/lib_enc/ivas_stereo_icbwe_enc_fx.c +++ b/lib_enc/ivas_stereo_icbwe_enc_fx.c @@ -828,11 +828,7 @@ void stereo_icBWE_enc_ivas_fx( ELSE { -#ifndef FIX_1713_EXP - max_e = s_max( hStereoICBWE->mem_shb_speech_nonref_e, shb_speech_nonref_e ); -#else max_e = s_max( hStereoICBWE->mem_shb_speech_ref_e, shb_speech_ref_e ); -#endif Copy_Scale_sig( hStereoICBWE->mem_shb_speech_ref_fx, hStereoICBWE->mem_shb_speech_ref_fx, L_LOOK_16k, negate( sub( max_e, hStereoICBWE->mem_shb_speech_ref_e ) ) ); // mem_shb_speech_ref_e set32_fx( shb_frame_ref_fx, 0, L_LOOK_16k + L_FRAME16k ); @@ -858,11 +854,7 @@ void stereo_icBWE_enc_ivas_fx( /* shb_frame_ref_ICBWE @ (8.75 - shb_speech_delay (=1.25) ms) after shb_speech */ Copy_Scale_sig32( shb_speech_nonref_fx, shb_frame_nonref_fx + L_LOOK_16k - nonRefMemLen, L_FRAME16k, negate( sub( max_e, shb_speech_nonref_e ) ) ); /* Q31-max_e */ -#ifndef FIX_1713_EXP - Copy_Scale_sig_32_16( shb_frame_nonref_fx + L_FRAME16k, hStereoICBWE->mem_shb_speech_nonref_fx, L_LOOK_16k, sub( negate( sub( max_e, hStereoICBWE->mem_shb_speech_ref_e ) ), Q16 ) ); // mem_shb_speech_ref_e -#else Copy_Scale_sig_32_16( shb_frame_nonref_fx + L_FRAME16k, hStereoICBWE->mem_shb_speech_nonref_fx, L_LOOK_16k, sub( negate( sub( max_e, hStereoICBWE->mem_shb_speech_nonref_e ) ), Q16 ) ); // mem_shb_speech_ref_e -#endif /* core switching reset */ test(); diff --git a/lib_enc/lib_enc_fx.c b/lib_enc/lib_enc_fx.c index 1771f875a..27de8ad87 100644 --- a/lib_enc/lib_enc_fx.c +++ b/lib_enc/lib_enc_fx.c @@ -609,53 +609,6 @@ ivas_error IVAS_ENC_ConfigureForAmbisonics( return error; } -#ifndef HARM_ENC_INIT -ivas_error IVAS_ENC_ConfigureForAmbisonics_fx( - IVAS_ENC_HANDLE hIvasEnc, /* i/o: IVAS encoder handle */ - const Word32 inputFs, /* i : input sampling frequency */ - const Word32 bitrate, /* i : requested bitrate of the output bitstream */ - const bool max_bwidth_user, /* i : shows if bandwidth limitation was set by the user (true) or if default bandwidth was used (false) */ - const IVAS_ENC_BANDWIDTH maxBandwidth, /* i : bandwidth limitation */ - const IVAS_ENC_DTX_CONFIG dtxConfig, /* i : configuration of DTX, can by set to default by using IVAS_ENC_GetDefaultDtxConfig() */ - const IVAS_ENC_SBA_ORDER order, /* i : order of the Ambisonics input */ - const bool isPlanar, /* i : if true, input is treated as planar Ambisonics */ - const bool Opt_PCA_ON /* i : PCA option flag */ -) -{ - ENCODER_CONFIG_HANDLE hEncoderConfig; - ivas_error error; - - IF( ( error = doCommonConfigureChecks( hIvasEnc ) ) != IVAS_ERR_OK ) - { - return error; - } - - hEncoderConfig = hIvasEnc->st_ivas->hEncoderConfig; - - hEncoderConfig->ivas_format = SBA_FORMAT; - hEncoderConfig->element_mode_init = IVAS_SCE; /* Just needs to be something not mono, will be set later */ - hEncoderConfig->sba_planar = isPlanar; - hEncoderConfig->sba_order = order; - move16(); - move16(); - move16(); - - /* Input in ACN/SN3D in all cases (3D and planar): get number of channels */ - hEncoderConfig->nchan_inp = ivas_sba_get_nchan_fx( hEncoderConfig->sba_order, 0 ); /*planar input arg. deliberately set to zero since input always in ACN/SN3D*/ - move16(); - - - hEncoderConfig->Opt_PCA_ON = (Word16) Opt_PCA_ON; - move16(); - - hIvasEnc->maxBandwidthUser = max_bwidth_user; - - error = configureEncoder( hIvasEnc, inputFs, bitrate, maxBandwidth, dtxConfig, IVAS_ENC_GetDefaultChannelAwareConfig() ); - - - return error; -} -#endif /*---------------------------------------------------------------------* * IVAS_ENC_ConfigureForSBAObjects() * @@ -1213,340 +1166,6 @@ static ivas_error configureEncoder( return error; } -#ifndef HARM_ENC_INIT -static ivas_error configureEncoder_fx( - IVAS_ENC_HANDLE hIvasEnc, - const Word32 inputFs, - const Word32 initBitrate, - const IVAS_ENC_BANDWIDTH initBandwidth, - const IVAS_ENC_DTX_CONFIG dtxConfig, - const IVAS_ENC_CHANNEL_AWARE_CONFIG caConfig ) -{ - Encoder_Struct *st_ivas; - ENCODER_CONFIG_HANDLE hEncoderConfig; - ivas_error error; - Word32 cpe_brate; - - error = IVAS_ERR_OK; - - st_ivas = hIvasEnc->st_ivas; - hEncoderConfig = st_ivas->hEncoderConfig; - - /*-----------------------------------------------------------------* - * Bandwidth limitation - *-----------------------------------------------------------------*/ - - IF( ( error = setBandwidth_fx( hIvasEnc, initBandwidth ) ) != IVAS_ERR_OK ) - { - return error; - } - - /*-----------------------------------------------------------------* - * DTX/CNG - *-----------------------------------------------------------------*/ - - IF( dtxConfig.enabled ) - { - hEncoderConfig->Opt_DTX_ON = 1; - move16(); - - IF( dtxConfig.variable_SID_rate ) - { - hEncoderConfig->var_SID_rate_flag = 1; - hEncoderConfig->interval_SID = 0; - move16(); - move16(); - } - ELSE - { - hEncoderConfig->var_SID_rate_flag = 0; - move16(); - test(); - IF( GE_16( dtxConfig.SID_interval, 3 ) && LE_16( dtxConfig.SID_interval, 100 ) ) - { - hEncoderConfig->interval_SID = dtxConfig.SID_interval; - move16(); - } - ELSE - { - return IVAS_ERR_INVALID_DTX_UPDATE_RATE; - } - } - } - ELSE - { - hEncoderConfig->Opt_DTX_ON = 0; - move16(); - } - - /*-----------------------------------------------------------------* - * Bitrate - *-----------------------------------------------------------------*/ - - hEncoderConfig->ivas_total_brate = initBitrate; - move16(); - - /* SC-VBR at 5.90 kbps */ - IF( EQ_32( hEncoderConfig->ivas_total_brate, ACELP_5k90 ) ) - { - hEncoderConfig->ivas_total_brate = ACELP_7k20; - hEncoderConfig->Opt_SC_VBR = 1; - hEncoderConfig->last_Opt_SC_VBR = hEncoderConfig->Opt_SC_VBR; - move32(); - move16(); - move16(); - - IF( ( hEncoderConfig->max_bwidth != NB ) ) - { - hEncoderConfig->max_bwidth = WB; - move16(); - } - } - - /* check if the entered bitrate is supported */ - test(); - IF( NE_16( hEncoderConfig->ivas_format, UNDEFINED_FORMAT ) && NE_16( hEncoderConfig->ivas_format, MONO_FORMAT ) ) /* IVAS */ - { - IF( !is_IVAS_bitrate_fx( hEncoderConfig->ivas_total_brate ) ) - { - IF( hEncoderConfig->Opt_SC_VBR ) - { - return IVAS_ERROR( IVAS_ERR_INVALID_BITRATE, "Incorrect bitrate specification in IVAS [bps]: %d", ACELP_5k90 ); - } - ELSE - { - return IVAS_ERROR( IVAS_ERR_INVALID_BITRATE, "Incorrect bitrate specification in IVAS [bps]: %d", hEncoderConfig->ivas_total_brate ); - } - } - - IF( EQ_16( hEncoderConfig->ivas_format, STEREO_FORMAT ) ) - { - { - hEncoderConfig->element_mode_init = IVAS_CPE_DFT; - move16(); - IF( GE_32( hEncoderConfig->ivas_total_brate, MIN_BRATE_MDCT_STEREO ) ) - { - hEncoderConfig->element_mode_init = IVAS_CPE_MDCT; - move16(); - } - } - - test(); - test(); - IF( ( EQ_16( hEncoderConfig->element_mode_init, IVAS_CPE_TD ) || EQ_32( hEncoderConfig->element_mode_init, IVAS_CPE_DFT ) ) && GT_32( hEncoderConfig->ivas_total_brate, IVAS_48k ) ) - { - return IVAS_ERROR( IVAS_ERR_INVALID_BITRATE, "Too high bitrate for TD/DFT Stereo specified in IVAS: %d", hEncoderConfig->ivas_total_brate ); - } - - test(); - IF( EQ_16( hEncoderConfig->element_mode_init, IVAS_CPE_MDCT ) && LT_32( hEncoderConfig->ivas_total_brate, IVAS_48k ) ) - { - return IVAS_ERROR( IVAS_ERR_INVALID_BITRATE, "Too low bitrate for MDCT Stereo specified in IVAS: %d", hEncoderConfig->ivas_total_brate ); - } - - test(); - IF( LT_32( hEncoderConfig->ivas_total_brate, IVAS_256k ) ) - { - return IVAS_ERROR( IVAS_ERR_INVALID_BITRATE, "Too high bitrate for Stereo specified in IVAS: %d", hEncoderConfig->ivas_total_brate ); - } - } - ELSE IF( EQ_16( hEncoderConfig->ivas_format, ISM_FORMAT ) ) - { - IF( ( error = sanitizeBitrateISM_fx( hEncoderConfig, hIvasEnc->extMetadataApi ) ) != IVAS_ERR_OK ) - { - return error; - } - } - ELSE IF( EQ_16( hEncoderConfig->ivas_format, SBA_FORMAT ) ) - { - /* nothing */ - } - ELSE IF( EQ_16( hEncoderConfig->ivas_format, MASA_FORMAT ) ) - { - /* adapt element_mode according to the bitrate */ - test(); - IF( EQ_16( hEncoderConfig->nchan_inp, 2 ) && NE_16( hEncoderConfig->element_mode_init, IVAS_SCE ) ) - { - IF( GE_32( hEncoderConfig->ivas_total_brate, IVAS_48k ) ) - { - hEncoderConfig->element_mode_init = IVAS_CPE_MDCT; - move16(); - } - ELSE IF( LT_32( hEncoderConfig->ivas_total_brate, MASA_STEREO_MIN_BITRATE ) ) - { - hEncoderConfig->element_mode_init = IVAS_CPE_DFT; - move16(); - } - } - } - ELSE IF( EQ_32( hEncoderConfig->ivas_format, MASA_ISM_FORMAT ) ) - { - st_ivas->ism_mode = ivas_omasa_ism_mode_select_fx( st_ivas->hEncoderConfig->ivas_total_brate, hEncoderConfig->nchan_ism ); - - cpe_brate = calculate_cpe_brate_MASA_ISM_fx( st_ivas->ism_mode, st_ivas->hEncoderConfig->ivas_total_brate, hEncoderConfig->nchan_ism ); - - /*adapt element_mode according to the bit-rate*/ - IF( NE_16( hEncoderConfig->element_mode_init, IVAS_SCE ) ) - { - IF( GE_32( cpe_brate, IVAS_48k ) ) - { - hEncoderConfig->element_mode_init = IVAS_CPE_MDCT; - move16(); - } - } - } - ELSE IF( EQ_16( hEncoderConfig->ivas_format, SBA_ISM_FORMAT ) ) - { - st_ivas->ism_mode = ISM_MODE_NONE; - } - } - ELSE /* EVS mono */ - { - hEncoderConfig->ivas_format = MONO_FORMAT; - hEncoderConfig->element_mode_init = EVS_MONO; - move16(); - - IF( !is_EVS_bitrate( hEncoderConfig->ivas_total_brate, &hEncoderConfig->Opt_AMR_WB ) ) - { - return IVAS_ERROR( IVAS_ERR_INVALID_BITRATE, "Incorrect bitrate specification in EVS mono: %d", hEncoderConfig->ivas_total_brate ); - } - - IF( EQ_16( hEncoderConfig->stereo_dmx_evs, 1 ) ) - { - hEncoderConfig->nchan_inp = 2; - move16(); - } - } - - /*-----------------------------------------------------------------* - * Input sampling frequency - *-----------------------------------------------------------------*/ - test(); - test(); - test(); - IF( NE_32( inputFs, 8000 ) && NE_32( inputFs, 16000 ) && NE_32( inputFs, 32000 ) && NE_32( inputFs, 48000 ) ) - { - return IVAS_ERR_INVALID_SAMPLING_RATE; - } - - hEncoderConfig->input_Fs = inputFs; - move32(); - - /*-----------------------------------------------------------------* - * Channel-aware mode - *-----------------------------------------------------------------*/ - - IF( ( error = setChannelAwareConfig_fx( hIvasEnc, caConfig ) ) != IVAS_ERR_OK ) - { - return error; - } - - /*-----------------------------------------------------------------* - * Set codec mode - *-----------------------------------------------------------------*/ - - st_ivas->codec_mode = MODE1; /* Note: in IVAS, set MODE1 */ - move16(); - - IF( EQ_16( hEncoderConfig->ivas_format, MONO_FORMAT ) ) - { - IF( hEncoderConfig->Opt_AMR_WB ) - { - st_ivas->codec_mode = MODE1; - move16(); - } - ELSE - { - st_ivas->codec_mode = get_codec_mode( hEncoderConfig->ivas_total_brate ); - move16(); - } - } - - test(); - IF( EQ_32( hEncoderConfig->ivas_total_brate, IVAS_13k2 ) && EQ_16( hEncoderConfig->Opt_RF_ON, 1 ) ) - { - st_ivas->codec_mode = MODE2; - move16(); - } - - st_ivas->last_codec_mode = st_ivas->codec_mode; - move16(); - - /*-----------------------------------------------------------------* - * Sanity checks - *-----------------------------------------------------------------*/ - - assert( hEncoderConfig->ivas_format != UNDEFINED_FORMAT && "\n IVAS format undefined" ); - - test(); - test(); - IF( ( NE_16( hEncoderConfig->ivas_format, MONO_FORMAT ) || hEncoderConfig->stereo_dmx_evs ) && EQ_32( hEncoderConfig->input_Fs, 8000 ) ) - { - return IVAS_ERROR( IVAS_ERR_INVALID_SAMPLING_RATE, "8kHz input sampling rate is not supported in IVAS." ); - } - - test(); - test(); - test(); - test(); - test(); - test(); - IF( hEncoderConfig->Opt_DTX_ON && NE_16( hEncoderConfig->ivas_format, MONO_FORMAT ) && - ( ( EQ_16( hEncoderConfig->ivas_format, SBA_FORMAT ) && GT_32( ivas_get_sba_num_TCs_fx( hEncoderConfig->ivas_total_brate, 1 ), 2 ) ) || - EQ_16( hEncoderConfig->ivas_format, MC_FORMAT ) || EQ_16( hEncoderConfig->ivas_format, MASA_ISM_FORMAT ) || EQ_16( hEncoderConfig->ivas_format, SBA_ISM_FORMAT ) ) ) - { - return IVAS_ERROR( IVAS_ERR_DTX_NOT_SUPPORTED, "DTX is not supported in this IVAS format and element mode." ); - } - - test(); - test(); - test(); - IF( hEncoderConfig->Opt_PCA_ON && !( EQ_16( hEncoderConfig->ivas_format, SBA_FORMAT ) && EQ_32( hEncoderConfig->ivas_total_brate, PCA_BRATE ) && EQ_16( hEncoderConfig->sba_order, SBA_FOA_ORDER ) ) ) - { - return IVAS_ERROR( IVAS_ERR_NOT_SUPPORTED_OPTION, "PCA supported at SBA FOA 256 kbps only." ); - } - - IF( ( error = sanitizeBandwidth_fx( hIvasEnc ) ) != IVAS_ERR_OK ) - { - return error; - } - - test(); - test(); - test(); - IF( hEncoderConfig->is_binaural && !( ( EQ_16( hEncoderConfig->ivas_format, MONO_FORMAT ) && hEncoderConfig->stereo_dmx_evs ) || EQ_16( hEncoderConfig->ivas_format, STEREO_FORMAT ) ) ) - { - return IVAS_ERROR( IVAS_ERR_NOT_SUPPORTED_OPTION, "'-binaural' option is supported only with '-stereo' or '-stereo_dmx_evs'" ); - } - - /*-----------------------------------------------------------------* - * Finalize initialization - *-----------------------------------------------------------------*/ - - IF( ( error = ivas_init_encoder_fx( st_ivas ) ) != IVAS_ERR_OK ) - { - return error; - } - - IF( EQ_16( hEncoderConfig->ivas_format, MONO_FORMAT ) ) - { - hIvasEnc->hCoreCoder = st_ivas->hSCE[0]->hCoreCoder[0]; /* Note: this is needed for switching in EVS mono */ - } - ELSE - { - hIvasEnc->hCoreCoder = NULL; - } - - hIvasEnc->Opt_RF_ON_loc = hEncoderConfig->Opt_RF_ON; - hIvasEnc->rf_fec_offset_loc = hEncoderConfig->rf_fec_offset; - move16(); - move16(); - - hIvasEnc->isConfigured = true; - - return error; -} -#endif /*---------------------------------------------------------------------* * IVAS_ENC_GetDelay() * @@ -1826,7 +1445,6 @@ ivas_error IVAS_ENC_EncodeFrameToSerial( /* set pointers to the new buffers of indices in each element */ FOR( n = 0; n < st_ivas->nSCE; n++ ) { -#ifdef HARM_PUSH_BIT st_ivas->hSCE[n]->hCoreCoder[0]->hBstr->ind_list = st_ivas->ind_list; st_ivas->hSCE[n]->hCoreCoder[0]->hBstr->ivas_ind_list_zero = &st_ivas->ind_list; @@ -1835,23 +1453,6 @@ ivas_error IVAS_ENC_EncodeFrameToSerial( st_ivas->hSCE[n]->hMetaData->ind_list = st_ivas->ind_list_metadata; st_ivas->hSCE[n]->hMetaData->ivas_ind_list_zero = &st_ivas->ind_list_metadata; } -#else - test(); - IF( !( hIvasEnc->hCoreCoder == NULL && EQ_32( hEncoderConfig->ivas_format, MONO_FORMAT ) ) ) - { - if ( ( hEncoderConfig->element_mode_init != EVS_MONO ) ) - { - st_ivas->hSCE[n]->hCoreCoder[0]->hBstr->ind_list = st_ivas->ind_list; - } - st_ivas->hSCE[n]->hCoreCoder[0]->hBstr->ivas_ind_list_zero = &st_ivas->ind_list; - } - - IF( st_ivas->hSCE[n]->hMetaData != NULL ) - { - st_ivas->hSCE[n]->hMetaData->ind_list = st_ivas->ind_list_metadata; - st_ivas->hSCE[n]->hMetaData->ivas_ind_list_zero = &st_ivas->ind_list_metadata; - } -#endif } FOR( n = 0; n < st_ivas->nCPE; n++ ) @@ -1916,21 +1517,6 @@ ivas_error IVAS_ENC_EncodeFrameToSerial( } /* write indices into bitstream buffer */ -#ifndef HARM_PUSH_BIT - IF( hEncoderConfig->element_mode_init == EVS_MONO ) - { - test(); - IF( EQ_16( hEncoderConfig->ivas_format, MONO_FORMAT ) && ( hCoreCoder->element_mode == EVS_MONO ) ) - { - /* write indices into bitstream file */ - UWord8 pFrame[( MAX_BITS_PER_FRAME + 7 ) >> 3]; - Word16 pFrame_size = 0; - move16(); - write_indices_buf_fx( hCoreCoder, hCoreCoder->hBstr, outputBitStream, pFrame, pFrame_size, numOutBits ); - } - } - ELSE -#endif { write_indices_ivas_fx( st_ivas, outputBitStream, numOutBits #ifdef DBG_BITSTREAM_ANALYSIS diff --git a/lib_enc/speech_music_classif_fx.c b/lib_enc/speech_music_classif_fx.c index fd983741b..59f3b35f6 100644 --- a/lib_enc/speech_music_classif_fx.c +++ b/lib_enc/speech_music_classif_fx.c @@ -2181,11 +2181,7 @@ Word16 ivas_smc_gmm_fx( } /* PCA */ -#ifdef VEC_ARITH_OPT_v1 v_sub_fixed_no_hdrm( FV_fx, pca_mean_fx, FV_fx, N_SMC_FEATURES ); -#else /* VEC_ARITH_OPT_v1 */ - v_sub_fixed( FV_fx, pca_mean_fx, FV_fx, N_SMC_FEATURES, 0 ); -#endif /* VEC_ARITH_OPT_v1 */ v_mult_mat_fixed( FV_fx, FV_fx, pca_components_fx, N_SMC_FEATURES, N_PCA_COEF, 0 ); /*------------------------------------------------------------------* * Calculation of posterior probability diff --git a/lib_enc/stat_enc.h b/lib_enc/stat_enc.h index 0647b6ebc..85261a3a7 100644 --- a/lib_enc/stat_enc.h +++ b/lib_enc/stat_enc.h @@ -95,10 +95,6 @@ typedef struct bitstream_enc_data_structure void *st_ivas; /* IVAS encoder structure */ // Word16 nb_bits_tot_fx; /* total number of bits already written */ // Indice *ind_list_fx; /* list of indices */ -#ifndef HARM_PUSH_BIT - Word16 next_ind_fx; /* pointer to the next empty slot in the list of indices */ - Word16 last_ind_fx; /* last written indice */ -#endif } BSTR_ENC_DATA, *BSTR_ENC_HANDLE; /*----------------------------------------------------------------------------------* diff --git a/lib_enc/swb_pre_proc_fx.c b/lib_enc/swb_pre_proc_fx.c index 0e89e16c1..85277e298 100644 --- a/lib_enc/swb_pre_proc_fx.c +++ b/lib_enc/swb_pre_proc_fx.c @@ -1275,11 +1275,7 @@ void swb_pre_proc_ivas_fx( thr = icbwe_thr_TDM_fx; regV = icbwe_regressionValuesTDM_fx; -#ifdef OPT_AVOID_STATE_BUF_RESCALE cldfbSynthesis_ivas_fx( realBufferFlipped, imagBufferFlipped, shb_speech_fx_32, -1, 0, 0, st->cldfbSynTd ); -#else /* OPT_AVOID_STATE_BUF_RESCALE */ - cldfbSynthesis_ivas_fx( realBufferFlipped, imagBufferFlipped, shb_speech_fx_32, -1, 0, st->cldfbSynTd ); -#endif /* OPT_AVOID_STATE_BUF_RESCALE */ Copy_Scale_sig_32_16( shb_speech_fx_32, shb_speech, L_FRAME16k, negate( sub( q_reImBuffer, 1 ) ) ); *Q_shb_spch = 0; move16(); diff --git a/lib_enc/swb_tbe_enc_fx.c b/lib_enc/swb_tbe_enc_fx.c index 08c920c4a..6b65f9afa 100644 --- a/lib_enc/swb_tbe_enc_fx.c +++ b/lib_enc/swb_tbe_enc_fx.c @@ -5697,11 +5697,7 @@ static void Quant_shb_res_gshape_fx( move16(); IF( NE_16( st_fx->codec_mode, MODE2 ) ) { -#ifdef FIX_1486_IND_SHB_RES push_indice( st_fx->hBstr, IND_SHB_RES_GS + i, idxSubGain_fx[i], NUM_BITS_SHB_RES_GS ); -#else - push_indice( st_fx->hBstr, IND_SHB_RES_GS1 + i, idxSubGain_fx[i], NUM_BITS_SHB_RES_GS ); -#endif } } } @@ -5737,11 +5733,7 @@ static void Quant_shb_res_gshape_ivas_fx( } ELSE { -#ifdef FIX_1486_IND_SHB_RES push_indice( st->hBstr, IND_SHB_RES_GS + i, idxSubGain_fx[i], NUM_BITS_SHB_RES_GS ); -#else - push_indice( st->hBstr, IND_SHB_RES_GS1 + i, idxSubGain_fx[i], NUM_BITS_SHB_RES_GS ); -#endif } } } @@ -7321,12 +7313,8 @@ void fb_tbe_enc_fx( Word16 ratio; Word16 tmp_vec[L_FRAME48k]; Word16 idxGain; -#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic Word16 input_fhb_buffer[L_FRAME48k + 4]; Word16 *input_fhb = &input_fhb_buffer[0] + 4; -#else - Word16 input_fhb[L_FRAME48k]; -#endif Word16 Sample_Delay_HP; Word32 fb_exc_energy, temp2; Word32 L_tmp; @@ -7352,16 +7340,10 @@ void fb_tbe_enc_fx( Copy_Scale_sig( new_input, input_fhb, L_FRAME48k, exp_temp ); -#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic elliptic_bpf_48k_generic_fx( -#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2 st->element_mode, -#endif /*FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2*/ 0, // IsUpsampled3 input_fhb, &exp_temp, tmp_vec, hBWE_TD->elliptic_bpf_2_48k_mem_fx, hBWE_TD->elliptic_bpf_2_48k_mem_fx_Q, full_band_bpf_2_fx ); -#else - elliptic_bpf_48k_generic_fx( input_fhb, &exp_temp, tmp_vec, hBWE_TD->elliptic_bpf_2_48k_mem_fx, hBWE_TD->elliptic_bpf_2_48k_mem_fx_Q, full_band_bpf_2_fx ); -#endif Sample_Delay_HP = NS2SA( 48000, ACELP_LOOK_NS + DELAY_FD_BWE_ENC_12k8_NS + DELAY_FIR_RESAMPL_NS ) - L_FRAME48k / 2; IF( NE_16( st->last_extl, FB_TBE ) ) @@ -7459,12 +7441,8 @@ void fb_tbe_enc_ivas_fx( Word16 ratio; Word16 tmp_vec[L_FRAME48k]; Word16 idxGain; -#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic Word16 input_fhb_new_buffer[L_FRAME48k + NS2SA( 48000, DELAY_FIR_RESAMPL_NS ) + 4]; Word16 *input_fhb_new = &input_fhb_new_buffer[0] + 4; -#else - Word16 input_fhb_new[L_FRAME48k + NS2SA( 48000, DELAY_FIR_RESAMPL_NS )]; -#endif Word16 input_fhb[L_FRAME48k]; Word16 Sample_Delay_HP; Word64 fb_exc_energy; @@ -7491,29 +7469,17 @@ void fb_tbe_enc_ivas_fx( exp_temp = add( exp_temp, Q_new_input ); IF( EQ_16( st->element_mode, IVAS_CPE_DFT ) ) { -#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic elliptic_bpf_48k_generic_fx( -#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2 st->element_mode, -#endif /*FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2*/ 0, // IsUpsampled3 input_fhb_new, &exp_temp, tmp_vec, hBWE_TD->elliptic_bpf_2_48k_mem_fx, hBWE_TD->elliptic_bpf_2_48k_mem_fx_Q, full_band_bpf_2_fx ); -#else - elliptic_bpf_48k_generic_fx( input_fhb_new, &exp_temp, tmp_vec, hBWE_TD->elliptic_bpf_2_48k_mem_fx, hBWE_TD->elliptic_bpf_2_48k_mem_fx_Q, full_band_bpf_2_fx ); -#endif } ELSE { -#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic elliptic_bpf_48k_generic_fx( -#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2 st->element_mode, -#endif /*FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2*/ 0, // IsUpsampled3 input_fhb_new + NS2SA( 48000, DELAY_FIR_RESAMPL_NS ), &exp_temp, tmp_vec, hBWE_TD->elliptic_bpf_2_48k_mem_fx, hBWE_TD->elliptic_bpf_2_48k_mem_fx_Q, full_band_bpf_2_fx ); -#else - elliptic_bpf_48k_generic_fx( input_fhb_new + NS2SA( 48000, DELAY_FIR_RESAMPL_NS ), &exp_temp, tmp_vec, hBWE_TD->elliptic_bpf_2_48k_mem_fx, hBWE_TD->elliptic_bpf_2_48k_mem_fx_Q, full_band_bpf_2_fx ); -#endif } test(); diff --git a/lib_enc/tcx_utils_enc_fx.c b/lib_enc/tcx_utils_enc_fx.c index 29154688e..9a15cec28 100644 --- a/lib_enc/tcx_utils_enc_fx.c +++ b/lib_enc/tcx_utils_enc_fx.c @@ -3786,11 +3786,7 @@ void ProcessIGF_fx( Word16 igfGridIdx; Word16 isIndepFlag; Word16 bsBits; -#ifndef HARM_PUSH_BIT - Word16 bsStart, pBsStart; -#else Word16 pBsStart; -#endif BSTR_ENC_HANDLE hBstr = st->hBstr; IGF_ENC_INSTANCE_HANDLE hIGFEnc = st->hIGFEnc; @@ -3867,9 +3863,6 @@ void ProcessIGF_fx( } } -#ifndef HARM_PUSH_BIT - bsStart = hBstr->next_ind_fx; -#endif move16(); hInstance->infoTotalBitsPerFrameWritten = 0; move16(); @@ -3877,18 +3870,6 @@ void ProcessIGF_fx( { IGFEncWriteBitstream_fx( hInstance, NULL, &hInstance->infoTotalBitsPerFrameWritten, igfGridIdx, isIndepFlag ); } -#ifndef HARM_PUSH_BIT - ELSE - { - IGFEncWriteBitstream_fx( hInstance, st->hBstr, &hInstance->infoTotalBitsPerFrameWritten, igfGridIdx, isIndepFlag ); - } - - bsBits = sub( hBstr->next_ind_fx, bsStart ); - IF( !isTCX20 ) - { - IGFEncConcatenateBitstream_fx( hInstance, bsBits, &hBstr->next_ind_fx, &hBstr->nb_bits_tot, hBstr->ind_list ); - } -#else ELSE { pBsStart = hBstr->nb_ind_tot; @@ -3899,7 +3880,6 @@ void ProcessIGF_fx( bsBits = sub( hBstr->nb_ind_tot, pBsStart ); IGFEncConcatenateBitstream_ivas_fx( hIGFEnc, bsBits, hBstr ); } -#endif } void attenuateNbSpectrum_fx( Word16 L_frame, Word32 *spectrum ) diff --git a/lib_enc/transition_enc_fx.c b/lib_enc/transition_enc_fx.c index 82e41026d..c1c032e4e 100644 --- a/lib_enc/transition_enc_fx.c +++ b/lib_enc/transition_enc_fx.c @@ -2081,11 +2081,7 @@ static void tc_enc_ivas_fx( /*--------------------------------------------------------------* * compute glottal-shape codebook excitation *--------------------------------------------------------------*/ -#ifdef TEST_HR Copy( h1, h1_fx, L_SUBFR + ( M + 1 ) ); -#else - Copy_Scale_sig( h1, h1_fx, L_SUBFR + ( M + 1 ), 1 ); -#endif /* create filtered glottal codebook contribution */ conv_fx( &exc_fx[i_subfr], h1_fx, yy1_fx, L_SUBFR ); diff --git a/lib_rend/ivas_dirac_ana_fx.c b/lib_rend/ivas_dirac_ana_fx.c index df75d6d0a..e170afdc6 100644 --- a/lib_rend/ivas_dirac_ana_fx.c +++ b/lib_rend/ivas_dirac_ana_fx.c @@ -496,11 +496,7 @@ static void ivas_dirac_dmx_fx( v_add_fx( data_in_fx[0], data_in_fx[1], data_out_fx[0], input_frame ); v_multc_fixed( data_out_fx[0], ONE_IN_Q30, data_out_fx[0], input_frame ); // ONE_IN_Q30 = 0.5* ONE_IN_Q31 -#ifdef VEC_ARITH_OPT_v1 v_sub_fixed_no_hdrm( data_in_fx[0], data_in_fx[1], data_out_fx[1], input_frame ); -#else /* VEC_ARITH_OPT_v1 */ - v_sub_fixed( data_in_fx[0], data_in_fx[1], data_out_fx[1], input_frame, 0 ); -#endif /* VEC_ARITH_OPT_v1 */ v_multc_fixed( data_out_fx[1], ONE_IN_Q30, data_out_fx[1], input_frame ); FOR( i = 0; i < nchan_transport; i++ ) diff --git a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c index c92f800af..656d8f732 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c @@ -694,9 +694,7 @@ static void ivas_dirac_dec_binaural_internal_fx( move32(); move32(); move32(); -#ifdef OPT_BIN_RENDERER_V1 Word16 ch_len = s_max( 4, numInChannels ); -#endif /* OPT_BIN_RENDERER_V1 */ FOR( i = 0; i < 6; i++ ) { FOR( j = 0; j < 4; j++ ) @@ -856,24 +854,11 @@ static void ivas_dirac_dec_binaural_internal_fx( Scale_sig( st_ivas->hSpar->hFbMixer->cldfb_cross_fade_fx, CLDFB_NO_COL_MAX, Q15 - st_ivas->hSpar->hFbMixer->cldfb_cross_fade_q ); st_ivas->hSpar->hFbMixer->cldfb_cross_fade_q = Q15; move16(); -#ifndef OPT_BIN_RENDERER_V1 - FOR( Word16 idx = 0; idx < CLDFB_NO_CHANNELS_MAX; idx++ ) - { - Scale_sig32( st_ivas->hSpar->hFbMixer->pFb->fb_bin_to_band.pp_cldfb_weights_per_spar_band_fx[idx], IVAS_MAX_NUM_FB_BANDS, Q31 - Q22 ); /*Q31 to Q22*/ - } -#endif /* OPT_BIN_RENDERER_V1 */ ivas_sba_prototype_renderer_fx( st_ivas, Cldfb_RealBuffer_in_fx, Cldfb_ImagBuffer_in_fx, q_cldfb, subframe ); -#ifndef OPT_BIN_RENDERER_V1 - FOR( Word16 idx = 0; idx < CLDFB_NO_CHANNELS_MAX; idx++ ) - { - Scale_sig32( st_ivas->hSpar->hFbMixer->pFb->fb_bin_to_band.pp_cldfb_weights_per_spar_band_fx[idx], IVAS_MAX_NUM_FB_BANDS, Q22 - Q31 ); /*Q31 to Q22*/ - } -#endif /* OPT_BIN_RENDERER_V1 */ } Word16 q_inp = Q6; move16(); -#ifdef OPT_BIN_RENDERER_V1 FOR( Word16 cha = 0; cha < ch_len; cha++ ) { FOR( slot = 0; slot < 4; slot++ ) @@ -888,18 +873,6 @@ static void ivas_dirac_dec_binaural_internal_fx( move16(); } } -#else /* OPT_BIN_RENDERER_V1 */ - FOR( Word16 cha = 0; cha < 6; cha++ ) - { - FOR( slot = 0; slot < 4; slot++ ) - { - scale_sig32( Cldfb_RealBuffer_in_fx[cha][slot], 60, sub( q_inp, q_cldfb[cha][slot] ) ); // Q6 - scale_sig32( Cldfb_ImagBuffer_in_fx[cha][slot], 60, sub( q_inp, q_cldfb[cha][slot] ) ); // Q6 - q_cldfb[cha][slot] = 6; - move16(); - } - } -#endif /* OPT_BIN_RENDERER_V1 */ test(); test(); @@ -1876,7 +1849,6 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices_fx( q_CrEne = Q31; move16(); -#ifdef OPT_BIN_RENDERER_V1 Word16 q_diff = sub( hDiracDecBin->ChEne_e[0][bin], hDiracDecBin->ChEne_e[1][bin] ); IF( q_diff > 0 ) @@ -1945,67 +1917,6 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices_fx( move32(); move16(); move16(); -#else /* OPT_BIN_RENDERER_V1 */ - IF( GT_16( hDiracDecBin->ChEne_e[0][bin], hDiracDecBin->ChEne_e[1][bin] ) ) - { - hDiracDecBin->ChEne_fx[1][bin] = L_shr( hDiracDecBin->ChEne_fx[1][bin], sub( hDiracDecBin->ChEne_e[0][bin], hDiracDecBin->ChEne_e[1][bin] ) ); - hDiracDecBin->q_ChEne = sub( 31, hDiracDecBin->ChEne_e[0][bin] ); - hDiracDecBin->ChEne_e[1][bin] = hDiracDecBin->ChEne_e[0][bin]; - } - ELSE - { - hDiracDecBin->ChEne_fx[0][bin] = L_shr( hDiracDecBin->ChEne_fx[0][bin], sub( hDiracDecBin->ChEne_e[1][bin], hDiracDecBin->ChEne_e[0][bin] ) ); - hDiracDecBin->q_ChEne = sub( 31, hDiracDecBin->ChEne_e[1][bin] ); - hDiracDecBin->ChEne_e[0][bin] = hDiracDecBin->ChEne_e[1][bin]; - } - move32(); - move16(); - - IF( GT_16( hDiracDecBin->ChEneOut_e[0][bin], hDiracDecBin->ChEneOut_e[1][bin] ) ) - { - hDiracDecBin->ChEneOut_fx[1][bin] = L_shr( hDiracDecBin->ChEneOut_fx[1][bin], sub( hDiracDecBin->ChEneOut_e[0][bin], hDiracDecBin->ChEneOut_e[1][bin] ) ); - hDiracDecBin->q_ChEneOut = sub( 31, hDiracDecBin->ChEneOut_e[0][bin] ); - hDiracDecBin->ChEneOut_e[1][bin] = hDiracDecBin->ChEneOut_e[0][bin]; - } - ELSE - { - hDiracDecBin->ChEneOut_fx[0][bin] = L_shr( hDiracDecBin->ChEneOut_fx[0][bin], sub( hDiracDecBin->ChEneOut_e[1][bin], hDiracDecBin->ChEneOut_e[0][bin] ) ); - hDiracDecBin->q_ChEneOut = sub( 31, hDiracDecBin->ChEneOut_e[1][bin] ); - hDiracDecBin->ChEneOut_e[0][bin] = hDiracDecBin->ChEneOut_e[1][bin]; - } - move32(); - move16(); - - IF( GT_16( hDiracDecBin->ChCrossRe_e[bin], hDiracDecBin->ChCrossIm_e[bin] ) ) - { - hDiracDecBin->ChCrossIm_fx[bin] = L_shr( hDiracDecBin->ChCrossIm_fx[bin], sub( hDiracDecBin->ChCrossRe_e[bin], hDiracDecBin->ChCrossIm_e[bin] ) ); - hDiracDecBin->q_ChCross = sub( 31, hDiracDecBin->ChCrossRe_e[bin] ); - hDiracDecBin->ChCrossIm_e[bin] = hDiracDecBin->ChCrossRe_e[bin]; - } - ELSE - { - hDiracDecBin->ChCrossRe_fx[bin] = L_shr( hDiracDecBin->ChCrossRe_fx[bin], sub( hDiracDecBin->ChCrossIm_e[bin], hDiracDecBin->ChCrossRe_e[bin] ) ); - hDiracDecBin->q_ChCross = sub( 31, hDiracDecBin->ChCrossIm_e[bin] ); - hDiracDecBin->ChCrossRe_e[bin] = hDiracDecBin->ChCrossIm_e[bin]; - } - move32(); - move16(); - - IF( GT_16( hDiracDecBin->ChCrossReOut_e[bin], hDiracDecBin->ChCrossImOut_e[bin] ) ) - { - hDiracDecBin->ChCrossImOut_fx[bin] = L_shr( hDiracDecBin->ChCrossImOut_fx[bin], sub( hDiracDecBin->ChCrossReOut_e[bin], hDiracDecBin->ChCrossImOut_e[bin] ) ); - hDiracDecBin->q_ChCrossOut = sub( 31, hDiracDecBin->ChCrossReOut_e[bin] ); - hDiracDecBin->ChCrossImOut_e[bin] = hDiracDecBin->ChCrossReOut_e[bin]; - } - ELSE - { - hDiracDecBin->ChCrossReOut_fx[bin] = L_shr( hDiracDecBin->ChCrossReOut_fx[bin], sub( hDiracDecBin->ChCrossImOut_e[bin], hDiracDecBin->ChCrossReOut_e[bin] ) ); - hDiracDecBin->q_ChCrossOut = sub( 31, hDiracDecBin->ChCrossImOut_e[bin] ); - hDiracDecBin->ChCrossReOut_e[bin] = hDiracDecBin->ChCrossImOut_e[bin]; - } - move32(); - move16(); -#endif /* OPT_BIN_RENDERER_V1 */ formulate2x2MixingMatrix_fx( hDiracDecBin->ChEne_fx[0][bin], hDiracDecBin->ChEne_fx[1][bin], hDiracDecBin->q_ChEne, @@ -2515,10 +2426,8 @@ static void ivas_dirac_dec_binaural_process_output_fx( Word32 *decSlotImPointer_fx; Word16 q_inp_mix, q_reverb = 31; move16(); -#ifdef OPT_BIN_RENDERER_V1 Word16 ch_len = s_max( 4, numInChannels ); Word16 eff_q; -#endif /* OPT_BIN_RENDERER_V1 */ IF( processReverb ) @@ -2532,11 +2441,7 @@ static void ivas_dirac_dec_binaural_process_output_fx( Word16 shift = s_min( L_norm_arr( cldfbSynDec[0]->cldfb_state_fx, cldfbSynDec[0]->p_filter_length ), L_norm_arr( cldfbSynDec[1]->cldfb_state_fx, cldfbSynDec[1]->p_filter_length ) ); q_inp_mix = 31; move16(); -#ifdef OPT_BIN_RENDERER_V1 FOR( Word16 i = 0; i < ch_len; i++ ) -#else /* OPT_BIN_RENDERER_V1 */ - FOR( Word16 i = 0; i < 6; i++ ) -#endif /* OPT_BIN_RENDERER_V1 */ { FOR( Word16 j = 0; j < nSlots; j++ ) { @@ -2564,13 +2469,9 @@ static void ivas_dirac_dec_binaural_process_output_fx( } -#ifdef OPT_BIN_RENDERER_V1 eff_q = sub( add( q_inp_mix, q_mat ), 15 ); FOR( Word16 i = 0; i < ch_len; i++ ) -#else /* OPT_BIN_RENDERER_V1 */ - FOR( Word16 i = 0; i < 6; i++ ) -#endif /* OPT_BIN_RENDERER_V1 */ { FOR( Word16 j = 0; j < nSlots; j++ ) { @@ -2580,13 +2481,8 @@ static void ivas_dirac_dec_binaural_process_output_fx( test(); IF( processReverb && LT_16( i, 2 ) ) { -#ifdef OPT_BIN_RENDERER_V1 scale_sig32( reverbRe_fx[i][j], CLDFB_NO_CHANNELS_MAX, eff_q ); /*q_inp_mix+q_mat-15*/ scale_sig32( reverbIm_fx[i][j], CLDFB_NO_CHANNELS_MAX, eff_q ); /*q_inp_mix+q_mat-15*/ -#else /* OPT_BIN_RENDERER_V1 */ - scale_sig32( reverbRe_fx[i][j], CLDFB_NO_CHANNELS_MAX, sub( add( q_inp_mix, q_mat ), 15 ) ); /*q_inp_mix+q_mat-15*/ - scale_sig32( reverbIm_fx[i][j], CLDFB_NO_CHANNELS_MAX, sub( add( q_inp_mix, q_mat ), 15 ) ); /*q_inp_mix+q_mat-15*/ -#endif /* OPT_BIN_RENDERER_V1 */ } } } @@ -2713,11 +2609,7 @@ static void ivas_dirac_dec_binaural_process_output_fx( outSlotRePr_fx = &( outSlotRe_fx[0] ); outSlotImPr_fx = &( outSlotIm_fx[0] ); -#ifdef OPT_AVOID_STATE_BUF_RESCALE cldfbSynthesis_ivas_fx( &outSlotRePr_fx, &outSlotImPr_fx, &( output_fx[chA][nBins * slot + offsetSamples] ), nBins, 0, 0, cldfbSynDec[chA] ); -#else /* OPT_AVOID_STATE_BUF_RESCALE */ - cldfbSynthesis_ivas_fx( &outSlotRePr_fx, &outSlotImPr_fx, &( output_fx[chA][nBins * slot + offsetSamples] ), nBins, 0, cldfbSynDec[chA] ); -#endif /* OPT_AVOID_STATE_BUF_RESCALE */ cldfbSynDec[chA]->Q_cldfb_state = sub( q_result, 1 ); move16(); } @@ -2748,11 +2640,7 @@ static void adaptTransportSignalsHeadtracked_fx( Word16 e_div, is_zero, i; move16(); -#ifdef OPT_BIN_RENDERER_V1 FOR( i = 0; i < 2; i++ ) -#else /* OPT_BIN_RENDERER_V1 */ - FOR( i = 0; i < 6; i++ ) -#endif /* OPT_BIN_RENDERER_V1 */ { FOR( Word16 j = 0; j < nSlots; j++ ) { @@ -4389,18 +4277,11 @@ static void formulate2x2MixingMatrix_fx( Sx_fx[1] = Sqrt32( Sx_fx[1], &exp1 ); move32(); q_Sx = sub( 31, s_max( exp, exp1 ) ); -#ifdef OPT_BIN_RENDERER_V1 Word16 q_diff = sub( 31, q_Sx ); Sx_fx[0] = L_shr( Sx_fx[0], sub( q_diff, exp ) ); // q_Sx move32(); Sx_fx[1] = L_shr( Sx_fx[1], sub( q_diff, exp1 ) ); // q_Sx move32(); -#else /* OPT_BIN_RENDERER_V1 */ - Sx_fx[0] = L_shr( Sx_fx[0], sub( sub( 31, exp ), q_Sx ) ); // q_Sx - move32(); - Sx_fx[1] = L_shr( Sx_fx[1], sub( sub( 31, exp1 ), q_Sx ) ); // q_Sx - move32(); -#endif /* OPT_BIN_RENDERER_V1 */ matrixDiagMul_fx( Uxre_fx, Uxim_fx, q_Ux, Sx_fx, q_Sx, Kxre_fx, Kxim_fx, &q_Kx ); @@ -4468,18 +4349,11 @@ static void formulate2x2MixingMatrix_fx( move32(); q_Ghat = sub( 31, s_max( exp, exp1 ) ); -#ifdef OPT_BIN_RENDERER_V1 q_diff = sub( 31, q_Ghat ); Ghat_fx[0] = L_shr( Ghat_fx[0], sub( q_diff, exp ) ); // q_Ghat move32(); Ghat_fx[1] = L_shr( Ghat_fx[1], sub( q_diff, exp1 ) ); // q_Ghat move32(); -#else /* OPT_BIN_RENDERER_V1 */ - Ghat_fx[0] = L_shr( Ghat_fx[0], sub( sub( 31, exp ), q_Ghat ) ); // q_Ghat - move32(); - Ghat_fx[1] = L_shr( Ghat_fx[1], sub( sub( 31, exp1 ), q_Ghat ) ); // q_Ghat - move32(); -#endif /* OPT_BIN_RENDERER_V1 */ /* Matrix multiplication, tmp = Ky' * G_hat * Q */ FOR( chA = 0; chA < BINAURAL_CHANNELS; chA++ ) @@ -4551,28 +4425,9 @@ static void formulate2x2MixingMatrix_fx( move32(); // 1310720000 = 10,000.0f in Q17 -#ifdef OPT_BIN_RENDERER_V1 Word32 thresh = L_shl_sat( 1310720000, sub( q_div, Q17 ) ); // q_div div_fx[0] = L_min( div_fx[0], thresh ); // q_div div_fx[1] = L_min( div_fx[1], thresh ); // q_div -#else /* OPT_BIN_RENDERER_V1 */ - IF( LT_16( q_div, Q17 ) ) - { - div_fx[0] = L_min( L_shr( 1310720000, sub( Q17, q_div ) ), div_fx[0] ); // q_div - move32(); - div_fx[1] = L_min( L_shr( 1310720000, sub( Q17, q_div ) ), div_fx[1] ); // q_div - move32(); - } - ELSE - { - div_fx[0] = L_min( 1310720000, L_shr( div_fx[0], sub( q_div, Q17 ) ) ); - move32(); - div_fx[1] = L_min( 1310720000, L_shr( div_fx[1], sub( q_div, Q17 ) ) ); - move32(); - q_div = Q17; - move16(); - } -#endif /* OPT_BIN_RENDERER_V1 */ matrixMul_fx( Are_fx, Aim_fx, &q_A, Ure_fx, Uim_fx, &q_U, tmpRe_fx, tmpIm_fx, &q_temp ); @@ -4589,21 +4444,11 @@ static void formulate2x2MixingMatrix_fx( W_tmp = W_mult0_32_32( tmpRe_fx[chA][chB], div_fx[chB] ); IF( W_tmp != 0 ) { -#ifdef OPT_BIN_RENDERER_V1 Word16 hdrm = sub( W_norm( W_tmp ), 32 ); tmpRe_fx[chA][chB] = W_shl_sat_l( W_tmp, hdrm ); move32(); hdrm_re[chA][chB] = add( add( q_temp, q_div ), hdrm ); move16(); -#else /* OPT_BIN_RENDERER_V1 */ - hdrm_re[chA][chB] = sub( W_norm( W_tmp ), 0 ); - move16(); - W_tmp = W_shl( W_tmp, hdrm_re[chA][chB] ); - tmpRe_fx[chA][chB] = W_extract_h( W_tmp ); - move32(); - hdrm_re[chA][chB] = sub( add( add( q_temp, q_div ), hdrm_re[chA][chB] ), 32 ); - move16(); -#endif /* OPT_BIN_RENDERER_V1 */ } ELSE { @@ -4614,22 +4459,12 @@ static void formulate2x2MixingMatrix_fx( W_tmp = W_mult0_32_32( tmpIm_fx[chA][chB], div_fx[chB] ); IF( W_tmp != 0 ) { -#ifdef OPT_BIN_RENDERER_V1 Word16 hdrm = sub( W_norm( W_tmp ), 32 ); move16(); tmpIm_fx[chA][chB] = W_shl_sat_l( W_tmp, hdrm ); move32(); hdrm_im[chA][chB] = add( add( q_temp, q_div ), hdrm ); move16(); -#else /* OPT_BIN_RENDERER_V1 */ - hdrm_im[chA][chB] = sub( W_norm( W_tmp ), 0 ); - move16(); - W_tmp = W_shl( W_tmp, hdrm_im[chA][chB] ); - tmpIm_fx[chA][chB] = W_extract_h( W_tmp ); - move32(); - hdrm_im[chA][chB] = sub( add( add( q_temp, q_div ), hdrm_im[chA][chB] ), 32 ); - move16(); -#endif /* OPT_BIN_RENDERER_V1 */ } ELSE { @@ -4644,9 +4479,7 @@ static void formulate2x2MixingMatrix_fx( move16(); minimum_s( hdrm_im[0], BINAURAL_CHANNELS * BINAURAL_CHANNELS, &exp ); q_temp = s_min( q_temp, exp ); -#ifdef OPT_BIN_RENDERER_V1 q_temp = sub( q_temp, 1 ); -#endif /* OPT_BIN_RENDERER_V1 */ FOR( chA = 0; chA < BINAURAL_CHANNELS; chA++ ) { @@ -4660,11 +4493,7 @@ static void formulate2x2MixingMatrix_fx( } matrixTransp2Mul_fx( tmpRe_fx, tmpIm_fx, &q_temp, Ure_fx, Uim_fx, &q_U, -#ifdef OPT_BIN_RENDERER_V1 0 /*int Ascale*/, -#else /* OPT_BIN_RENDERER_V1 */ - 1 /*int Ascale*/, -#endif /* OPT_BIN_RENDERER_V1 */ 0 /*int Bscale*/, Pre_fx, Pim_fx, &q_P ); /* Nearest orthonormal matrix P to matrix A formulated */ diff --git a/lib_rend/ivas_dirac_output_synthesis_dec_fx.c b/lib_rend/ivas_dirac_output_synthesis_dec_fx.c index c96878d55..8b54b80c7 100644 --- a/lib_rend/ivas_dirac_output_synthesis_dec_fx.c +++ b/lib_rend/ivas_dirac_output_synthesis_dec_fx.c @@ -919,7 +919,6 @@ void ivas_dirac_dec_output_synthesis_process_slot_fx( } c = Madd_32_16( ONE_IN_Q27 /*1 Q27*/, L_sub( h_dirac_output_synthesis_params->diffuse_compensation_factor_fx, ONE_IN_Q27 /*1 Q27*/ ), 5461 ); /*Diffuseness modellling nrg compensation*/ /* 1.0 / 6.0 = 5461 in Q15*/ /*Q27*/ Word16 diff_c_exp = sub( q_diffuseness, 4 ); -#ifdef FIX_1310_SPEEDUP_ivas_dirac_dec_output_synthesis_process_slot FOR( ; k < num_freq_bands; k++ ) { a = h_dirac_output_synthesis_state->direct_responses_fx[ch_idx * num_freq_bands + k]; // Q = h_dirac_output_synthesis_state->q_direct_responses @@ -984,71 +983,6 @@ void ivas_dirac_dec_output_synthesis_process_slot_fx( } } -#else - FOR( ; k < num_freq_bands; k++ ) - { - a = h_dirac_output_synthesis_state->direct_responses_fx[ch_idx * num_freq_bands + k]; // Q = h_dirac_output_synthesis_state->q_direct_responses - move32(); - IF( reference_power[k + num_freq_bands] == 0 ) - { - b = 0; - move16(); - b_exp = 0; - move16(); - } - ELSE - { - IF( reference_power[k + ( ch_idx + 1 ) * num_freq_bands] == 0 ) - { - b = MAX_16; - move16(); - b_exp = 0; - move16(); - } - ELSE - { - b = BASOP_Util_Divide3232_Scale( reference_power[k + num_freq_bands], reference_power[k + ( ch_idx + 1 ) * num_freq_bands], &b_exp ); /*q(15-b_exp)*/ - } - } - - mpy_a_a_b = Mpy_32_32( a, Mpy_32_16_1( a, b ) ); // Q = (h_dirac_output_synthesis_state->q_direct_responses + (15 - b_exp) - 15) + (h_dirac_output_synthesis_state->q_direct_responses) - 31 - mpy_diff_aab = Mpy_32_32( L_sub( L_shl( 1, q_diffuseness ), diffuseness[k] ), mpy_a_a_b ); // Q = 2*(h_dirac_output_synthesis_state->q_direct_responses) - b_exp - 31 + q_diffuseness -31 - mpy_diff_c = Mpy_32_32( diffuseness[k], c2 ); // Q = q_diffuseness - 4 - - q_diff_aab = add( add( h_dirac_output_synthesis_state->direct_responses_q, sub( sub( 15, b_exp ), 15 ) ), add( sub( h_dirac_output_synthesis_state->direct_responses_q, 31 ), sub( q_diffuseness, 31 ) ) ); - q_diff_c = sub( q_diffuseness, 4 ); - Word16 minq = sub( s_min( q_diff_aab, q_diff_c ), 1 ); - Word32 op1 = L_shr( mpy_diff_aab, sub( q_diff_aab, minq ) ); - Word32 op2 = L_shr( mpy_diff_c, sub( q_diff_c, minq ) ); - sqr_inp = L_add( op1, op2 ); - sqr_exp = sub( 31, minq ); - sqr = Sqrt32( sqr_inp, &sqr_exp ); /*Q(31-sqr_exp)*/ - sqr = L_shr( sqr, 2 ); /*Q(31-sqr_exp)*/ - IF( h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k] != 0 ) - { - IF( GT_16( sqr_exp, cy_cross_dir_smooth_e ) ) - { - h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k] = L_shr( h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k], sub( sqr_exp, cy_cross_dir_smooth_e ) ); /*h_dirac_output_synthesis_state->q_cy_cross_dir_smooth->Q( 31- sqr_exp )*/ - move32(); - Q_temp_cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k] = sqr_exp; // sub( 31, sqr_exp ); - move16(); - } - ELSE - { - sqr = L_shr( sqr, sub( cy_cross_dir_smooth_e, sqr_exp ) ); /*Q(31- sqr_exp)->h_dirac_output_synthesis_state->q_cy_cross_dir_smooth*/ - } - h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k] = L_add( h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k], sqr ); /*Q_temp_cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k]*/ - move32(); - } - ELSE - { - h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k] = L_add( h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k], sqr ); /*Q(31- sqr_exp)*/ - move32(); - Q_temp_cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k] = sqr_exp; // sub( 31, sqr_exp ); - move16(); - } - } -#endif } ELSE { @@ -1262,7 +1196,6 @@ void ivas_dirac_dec_output_synthesis_process_slot_fx( } } c = Madd_32_16( ONE_IN_Q27 /*1 Q27*/, L_sub( h_dirac_output_synthesis_params->diffuse_compensation_factor_fx, ONE_IN_Q27 /*1 Q27*/ ), 5461 ); /*Diffuseness modellling nrg compensation*/ /* 1.0 / 6.0 = 5461 in Q15*/ /*Q27*/ -#ifdef FIX_1310_SPEEDUP_ivas_dirac_dec_output_synthesis_process_slot FOR( ; k < num_freq_bands; k++ ) { a = h_dirac_output_synthesis_state->direct_responses_fx[ch_idx * num_freq_bands + k]; // Q = h_dirac_output_synthesis_state->q_direct_responses @@ -1329,89 +1262,6 @@ void ivas_dirac_dec_output_synthesis_process_slot_fx( move16(); } } -#else - FOR( ; k < num_freq_bands; k++ ) - { - a = h_dirac_output_synthesis_state->direct_responses_fx[ch_idx * num_freq_bands + k]; // Q = h_dirac_output_synthesis_state->q_direct_responses - move32(); - IF( reference_power[k + num_freq_bands] == 0 ) - { - b = 0; - move16(); - b_exp = 0; - move16(); - } - ELSE - { - IF( reference_power[k + ( ch_idx + 1 ) * num_freq_bands] == 0 ) - { - b = MAX_16; - move16(); - b_exp = 0; - move16(); - } - ELSE - { - b = BASOP_Util_Divide3232_Scale( reference_power[k + num_freq_bands], reference_power[k + ( ch_idx + 1 ) * num_freq_bands], &b_exp ); /*q(15-b_exp)*/ - } - } - - mpy_a_a_b = Mpy_32_32( a, Mpy_32_16_1( a, b ) ); // Q = (h_dirac_output_synthesis_state->q_direct_responses + (15 - b_exp) - 15) + (h_dirac_output_synthesis_state->q_direct_responses) - 31 - mpy_diff_aab = Mpy_32_32( L_sub( L_shl( 1, q_diffuseness ), diffuseness[k] ), mpy_a_a_b ); // Q = 2*(h_dirac_output_synthesis_state->q_direct_responses) - b_exp - 31 + q_diffuseness -31 - mpy_diff_c = Mpy_32_32( diffuseness[k], c ); // Q = q_diffuseness - 4 - - q_diff_aab = add( add( h_dirac_output_synthesis_state->direct_responses_q, sub( sub( 15, b_exp ), 15 ) ), add( sub( h_dirac_output_synthesis_state->direct_responses_q, 31 ), sub( q_diffuseness, 31 ) ) ); - q_diff_c = sub( q_diffuseness, 4 ); - - test(); - IF( mpy_diff_c != 0 && mpy_diff_aab != 0 ) - { - sqr_inp = BASOP_Util_Add_Mant32Exp( mpy_diff_c, sub( 31, q_diff_c ), mpy_diff_aab, sub( 31, q_diff_aab ), &sqr_exp ); /*q(31-sqr_exp)*/ - } - ELSE - { - IF( mpy_diff_c == 0 ) - { - sqr_inp = mpy_diff_aab; /*q_diff_aab*/ - move32(); - sqr_exp = sub( 31, q_diff_aab ); - } - ELSE - { - sqr_inp = mpy_diff_c; - move32(); - sqr_exp = sub( 31, q_diff_c ); /*q_diff_c*/ - } - } - sqr = Sqrt32( sqr_inp, &sqr_exp ); /*Q(31-sqr_exp)*/ - sqr = L_shr( sqr, 2 ); /*Q(31-sqr_exp)*/ - IF( h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k] != 0 ) - { - IF( LT_16( sub( 31, sqr_exp ), h_dirac_output_synthesis_state->q_cy_cross_dir_smooth ) ) - { - h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k] = L_shr( h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k], sub( h_dirac_output_synthesis_state->q_cy_cross_dir_smooth, sub( 31, sqr_exp ) ) ); /*h_dirac_output_synthesis_state->q_cy_cross_dir_smooth->Q( 31- sqr_exp )*/ - move32(); - h_dirac_output_synthesis_state->Q_temp_cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k] = sub( 31, sqr_exp ); - move16(); - } - ELSE - { - sqr = L_shr( sqr, sub( sub( 31, sqr_exp ), h_dirac_output_synthesis_state->q_cy_cross_dir_smooth ) ); /*Q(31- sqr_exp)->h_dirac_output_synthesis_state->q_cy_cross_dir_smooth*/ - h_dirac_output_synthesis_state->Q_temp_cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k] = h_dirac_output_synthesis_state->q_cy_cross_dir_smooth; - move16(); - } - h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k] = L_add( h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k], sqr ); /*Q_temp_cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k]*/ - move32(); - } - ELSE - { - h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k] = L_add( h_dirac_output_synthesis_state->cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k], sqr ); /*Q(31- sqr_exp)*/ - move32(); - h_dirac_output_synthesis_state->Q_temp_cy_cross_dir_smooth_fx[ch_idx * num_freq_bands + k] = sub( 31, sqr_exp ); - move16(); - } - } -#endif } ELSE { @@ -1568,17 +1418,10 @@ void ivas_dirac_dec_output_synthesis_process_slot_fx( { Scale_sig32( aux_buf, num_freq_bands, sub( h_dirac_output_synthesis_state->q_cy_auto_diff_smooth, temp_q ) ); /*temp_q->(h_dirac_output_synthesis_state->q_cy_auto_diff_smooth)*/ } -#ifdef VEC_ARITH_OPT_v1 v_add_fixed_no_hdrm( aux_buf, &h_dirac_output_synthesis_state->cy_auto_diff_smooth_fx[ch_idx * num_freq_bands_diff], &h_dirac_output_synthesis_state->cy_auto_diff_smooth_fx[ch_idx * num_freq_bands_diff], num_freq_bands_diff ); /*h_dirac_output_synthesis_state->q_cy_auto_diff_smooth*/ -#else /* VEC_ARITH_OPT_v1 */ - v_add_fixed( aux_buf, - &h_dirac_output_synthesis_state->cy_auto_diff_smooth_fx[ch_idx * num_freq_bands_diff], - &h_dirac_output_synthesis_state->cy_auto_diff_smooth_fx[ch_idx * num_freq_bands_diff], - num_freq_bands_diff, 0 ); /*h_dirac_output_synthesis_state->q_cy_auto_diff_smooth*/ -#endif /* VEC_ARITH_OPT_v1 */ } return; @@ -3647,19 +3490,11 @@ void ivas_dirac_dec_compute_directional_responses_fx( } ELSE { -#ifdef FIX_1310_SPEEDUP_ivas_dirac_dec_get_response_fx ivas_dirac_dec_get_response_fx_29( azimuth[k], elevation[k], direct_response_hoa_fx, hDirACRend->hOutSetup.ambisonics_order ); -#else - ivas_dirac_dec_get_response_fx( azimuth[k], elevation[k], direct_response_hoa_fx, hDirACRend->hOutSetup.ambisonics_order, Q_direct_response_hoa ); -#endif IF( hodirac_flag ) { -#ifdef FIX_1310_SPEEDUP_ivas_dirac_dec_get_response_fx ivas_dirac_dec_get_response_fx_29( azimuth2[k], elevation2[k], direct_response_dir2_fx, hDirACRend->hOutSetup.ambisonics_order ); -#else - ivas_dirac_dec_get_response_fx( azimuth2[k], elevation2[k], direct_response_dir2_fx, hDirACRend->hOutSetup.ambisonics_order, Q_direct_response_dir2 ); -#endif } } diff --git a/lib_rend/ivas_dirac_rend_fx.c b/lib_rend/ivas_dirac_rend_fx.c index 947d1943e..4b35bbd30 100644 --- a/lib_rend/ivas_dirac_rend_fx.c +++ b/lib_rend/ivas_dirac_rend_fx.c @@ -4543,11 +4543,7 @@ static void ivas_masa_ext_dirac_render_sf_fx( hDirACRend->h_freq_domain_decorr_ap_state ); v_multc_fixed( onset_filter_fx, 536870912 /* 0.25f in Q31 */, onset_filter_fx, hSpatParamRendCom->num_freq_bands ); /* Q31 */ -#ifdef VEC_ARITH_OPT_v1 v_add_fixed_no_hdrm( onset_filter_fx, onset_filter_subframe_fx, onset_filter_subframe_fx, hSpatParamRendCom->num_freq_bands ); /* Q31 */ -#else /* VEC_ARITH_OPT_v1 */ - v_add_fixed( onset_filter_fx, onset_filter_subframe_fx, onset_filter_subframe_fx, hSpatParamRendCom->num_freq_bands, 0 ); /* Q31 */ -#endif /* VEC_ARITH_OPT_v1 */ p_onset_filter_fx = onset_filter_subframe_fx; /*q31*/ } ELSE @@ -4645,11 +4641,7 @@ static void ivas_masa_ext_dirac_render_sf_fx( DirAC_mem.reference_power_smooth_q = DirAC_mem.reference_power_q; move16(); #endif -#ifdef VEC_ARITH_OPT_v1 v_add_fixed_no_hdrm( reference_power_fix, reference_power_smooth_fx, reference_power_smooth_fx, hSpatParamRendCom->num_freq_bands ); // DirAC_mem.reference_power_smooth_q -#else /* VEC_ARITH_OPT_v1 */ - v_add_fixed( reference_power_fix, reference_power_smooth_fx, reference_power_smooth_fx, hSpatParamRendCom->num_freq_bands, 0 ); // DirAC_mem.reference_power_smooth_q -#endif /* VEC_ARITH_OPT_v1 */ } } /*Rescaling proto_direct_buffer_f*/ @@ -5077,11 +5069,7 @@ static void ivas_masa_ext_dirac_render_sf_fx( ImagBuffer_fx[i] = Cldfb_ImagBuffer_fx[idx_in][i]; // q_cldfb } Word16 out_size = imult1616( hSpatParamRendCom->num_freq_bands, hSpatParamRendCom->subframe_nbslots[subframe_idx] ); -#ifdef OPT_AVOID_STATE_BUF_RESCALE cldfbSynthesis_ivas_fx( RealBuffer_fx, ImagBuffer_fx, &( output_f_fx[ch][index_slot * hSpatParamRendCom->num_freq_bands] ), out_size, 0, 0, hMasaExtRend->cldfbSynRend[idx_in] ); -#else /* OPT_AVOID_STATE_BUF_RESCALE */ - cldfbSynthesis_ivas_fx( RealBuffer_fx, ImagBuffer_fx, &( output_f_fx[ch][index_slot * hSpatParamRendCom->num_freq_bands] ), out_size, 0, hMasaExtRend->cldfbSynRend[idx_in] ); -#endif /* OPT_AVOID_STATE_BUF_RESCALE */ scale_sig32( &( output_f_fx[ch][index_slot * hSpatParamRendCom->num_freq_bands] ), out_size, sub( 11, q_out ) ); // q11 idx_in++; } diff --git a/lib_rend/ivas_efap_fx.c b/lib_rend/ivas_efap_fx.c index 2ac397e2c..3a2092294 100644 --- a/lib_rend/ivas_efap_fx.c +++ b/lib_rend/ivas_efap_fx.c @@ -1525,11 +1525,7 @@ static void get_poly_gains_fx( A[1] = elePoly[i - 1]; // q22 move32(); -#ifdef VEC_ARITH_OPT_v1 v_sub_fixed_no_hdrm( P, A, P_minus_A, 2 ); /* Precalculate value of (P-A) q22*/ -#else /* VEC_ARITH_OPT_v1 */ - v_sub_fixed( P, A, P_minus_A, 2, 0 ); /* Precalculate value of (P-A) q22*/ -#endif /* VEC_ARITH_OPT_v1 */ FOR( j = i; j < numChan - 2 + i; ++j ) { @@ -1582,11 +1578,7 @@ static Word32 get_tri_gain_fx( tmpN[1] = L_sub( C[0], B[0] ); // q22 move32(); -#ifdef VEC_ARITH_OPT_v1 v_sub_fixed_no_hdrm( B, A, tmpSub1, 2 ); // tmpSub1 q22 -#else /* VEC_ARITH_OPT_v1 */ - v_sub_fixed( B, A, tmpSub1, 2, 0 ); // tmpSub1 q22 -#endif /* VEC_ARITH_OPT_v1 */ tmpDot1 = dotp_fixed( tmpN, tmpSub1, 2 ); // Q13 @@ -2245,11 +2237,7 @@ static void sort_channels_vertex_fx( move32(); } -#ifdef VEC_ARITH_OPT_v1 v_sub_fixed_no_hdrm( tmpV1, tmpV2, tmpV3, 3 ); // tmpV3 Q30 -#else /* VEC_ARITH_OPT_v1 */ - v_sub_fixed( tmpV1, tmpV2, tmpV3, 3, 0 ); // tmpV3 Q30 -#endif /* VEC_ARITH_OPT_v1 */ Word16 exp2 = 2; move16(); normV = ISqrt32( dotp_fixed( tmpV3, tmpV3, 3 ) /*q29*/, &exp2 ); // q=31-exp2 @@ -2431,11 +2419,7 @@ static Word16 in_poly_fx( /* Angles are in Q22 */ A[1] = poly.polyEle[0]; // q22 move32(); -#ifdef VEC_ARITH_OPT_v1 v_sub_fixed_no_hdrm( P, A, P_minus_A, 2 ); /* Precalculate value of (P-A) q22*/ -#else /* VEC_ARITH_OPT_v1 */ - v_sub_fixed( P, A, P_minus_A, 2, 0 ); /* Precalculate value of (P-A) q22*/ -#endif /* VEC_ARITH_OPT_v1 */ FOR( n = 1; n < sub( numVertices, 1 ); ++n ) { @@ -2504,13 +2488,8 @@ static Word16 in_tri_fx( I'll just compute the determinant and if it's equal to 0, that means the two vectors are colinear */ -#ifdef VEC_ARITH_OPT_v1 v_sub_fixed_no_hdrm( B, A, tmpDot1, 2 ); // tmpDot1 q22 v_sub_fixed_no_hdrm( C, A, tmpDot2, 2 ); // tmpDot2 q22 -#else /* VEC_ARITH_OPT_v1 */ - v_sub_fixed( B, A, tmpDot1, 2, 0 ); // tmpDot1 q22 - v_sub_fixed( C, A, tmpDot2, 2, 0 ); // tmpDot2 q22 -#endif /* VEC_ARITH_OPT_v1 */ /* Verification of the non-colinearity : Q22 * Q22 = Q13 */ #ifdef OPT_SBA_REND_V1_BE diff --git a/lib_rend/ivas_omasa_ana_fx.c b/lib_rend/ivas_omasa_ana_fx.c index 84f1ff3dc..1ef2805b5 100644 --- a/lib_rend/ivas_omasa_ana_fx.c +++ b/lib_rend/ivas_omasa_ana_fx.c @@ -489,13 +489,8 @@ static void ivas_omasa_param_est_ana_fx( FOR( i = 1; i < nchan_ism; i++ ) { -#ifdef VEC_ARITH_OPT_v1 v_add_fixed_no_hdrm( Chnl_RealBuffer_fx[i], Foa_RealBuffer_fx[0], Foa_RealBuffer_fx[0], num_freq_bins ); // Q: Chnl_RealBuffer_q v_add_fixed_no_hdrm( Chnl_ImagBuffer_fx[i], Foa_ImagBuffer_fx[0], Foa_ImagBuffer_fx[0], num_freq_bins ); // Q: Chnl_ImagBuffer_q -#else /* VEC_ARITH_OPT_v1 */ - v_add_fixed( Chnl_RealBuffer_fx[i], Foa_RealBuffer_fx[0], Foa_RealBuffer_fx[0], num_freq_bins, 0 ); // Q: Chnl_RealBuffer_q - v_add_fixed( Chnl_ImagBuffer_fx[i], Foa_ImagBuffer_fx[0], Foa_ImagBuffer_fx[0], num_freq_bins, 0 ); // Q: Chnl_ImagBuffer_q -#endif /* VEC_ARITH_OPT_v1 */ } /* Y */ diff --git a/lib_rend/ivas_reverb_fx.c b/lib_rend/ivas_reverb_fx.c index b9b897f4a..9ea501f10 100644 --- a/lib_rend/ivas_reverb_fx.c +++ b/lib_rend/ivas_reverb_fx.c @@ -2177,23 +2177,13 @@ void ivas_binaural_reverb_processSubframe_fx( { IF( s_and( ch, 1 ) ) { -#ifdef VEC_ARITH_OPT_v1 v_add_fixed_no_hdrm( hReverb->preDelayBufferReal_fx[idx], inReal[ch][sample], hReverb->preDelayBufferReal_fx[idx], hReverb->numBins ); v_add_fixed_no_hdrm( hReverb->preDelayBufferImag_fx[idx], inImag[ch][sample], hReverb->preDelayBufferImag_fx[idx], hReverb->numBins ); -#else /* VEC_ARITH_OPT_v1 */ - v_add_fixed( hReverb->preDelayBufferReal_fx[idx], inReal[ch][sample], hReverb->preDelayBufferReal_fx[idx], hReverb->numBins, 0 ); - v_add_fixed( hReverb->preDelayBufferImag_fx[idx], inImag[ch][sample], hReverb->preDelayBufferImag_fx[idx], hReverb->numBins, 0 ); -#endif /* VEC_ARITH_OPT_v1 */ } ELSE { -#ifdef VEC_ARITH_OPT_v1 v_sub_fixed_no_hdrm( hReverb->preDelayBufferReal_fx[idx], inImag[ch][sample], hReverb->preDelayBufferReal_fx[idx], hReverb->numBins ); v_add_fixed_no_hdrm( hReverb->preDelayBufferImag_fx[idx], inReal[ch][sample], hReverb->preDelayBufferImag_fx[idx], hReverb->numBins ); -#else /* VEC_ARITH_OPT_v1 */ - v_sub_fixed( hReverb->preDelayBufferReal_fx[idx], inImag[ch][sample], hReverb->preDelayBufferReal_fx[idx], hReverb->numBins, 0 ); - v_add_fixed( hReverb->preDelayBufferImag_fx[idx], inReal[ch][sample], hReverb->preDelayBufferImag_fx[idx], hReverb->numBins, 0 ); -#endif /* VEC_ARITH_OPT_v1 */ } } idx = add( idx, 1 ) % hReverb->preDelayBufferLength; @@ -2223,40 +2213,20 @@ void ivas_binaural_reverb_processSubframe_fx( SWITCH( phaseShiftTypePr[tapIdx] ) { case 0: /* 0 degrees phase */ -#ifdef VEC_ARITH_OPT_v1 v_add_fixed_no_hdrm( hReverb->outputBufferReal_fx[bin][ch], tapRealPr_fx[tapIdx], hReverb->outputBufferReal_fx[bin][ch], numSlots ); v_add_fixed_no_hdrm( hReverb->outputBufferImag_fx[bin][ch], tapImagPr_fx[tapIdx], hReverb->outputBufferImag_fx[bin][ch], numSlots ); -#else /* VEC_ARITH_OPT_v1 */ - v_add_fixed( hReverb->outputBufferReal_fx[bin][ch], tapRealPr_fx[tapIdx], hReverb->outputBufferReal_fx[bin][ch], numSlots, 0 ); - v_add_fixed( hReverb->outputBufferImag_fx[bin][ch], tapImagPr_fx[tapIdx], hReverb->outputBufferImag_fx[bin][ch], numSlots, 0 ); -#endif /* VEC_ARITH_OPT_v1 */ BREAK; case 1: /* 90 degrees phase */ -#ifdef VEC_ARITH_OPT_v1 v_sub_fixed_no_hdrm( hReverb->outputBufferReal_fx[bin][ch], tapImagPr_fx[tapIdx], hReverb->outputBufferReal_fx[bin][ch], numSlots ); v_add_fixed_no_hdrm( hReverb->outputBufferImag_fx[bin][ch], tapRealPr_fx[tapIdx], hReverb->outputBufferImag_fx[bin][ch], numSlots ); -#else /* VEC_ARITH_OPT_v1 */ - v_sub_fixed( hReverb->outputBufferReal_fx[bin][ch], tapImagPr_fx[tapIdx], hReverb->outputBufferReal_fx[bin][ch], numSlots, 0 ); - v_add_fixed( hReverb->outputBufferImag_fx[bin][ch], tapRealPr_fx[tapIdx], hReverb->outputBufferImag_fx[bin][ch], numSlots, 0 ); -#endif /* VEC_ARITH_OPT_v1 */ BREAK; case 2: /* 180 degrees phase */ -#ifdef VEC_ARITH_OPT_v1 v_sub_fixed_no_hdrm( hReverb->outputBufferReal_fx[bin][ch], tapRealPr_fx[tapIdx], hReverb->outputBufferReal_fx[bin][ch], numSlots ); v_sub_fixed_no_hdrm( hReverb->outputBufferImag_fx[bin][ch], tapImagPr_fx[tapIdx], hReverb->outputBufferImag_fx[bin][ch], numSlots ); -#else /* VEC_ARITH_OPT_v1 */ - v_sub_fixed( hReverb->outputBufferReal_fx[bin][ch], tapRealPr_fx[tapIdx], hReverb->outputBufferReal_fx[bin][ch], numSlots, 0 ); - v_sub_fixed( hReverb->outputBufferImag_fx[bin][ch], tapImagPr_fx[tapIdx], hReverb->outputBufferImag_fx[bin][ch], numSlots, 0 ); -#endif /* VEC_ARITH_OPT_v1 */ BREAK; default: /* 270 degrees phase */ -#ifdef VEC_ARITH_OPT_v1 v_add_fixed_no_hdrm( hReverb->outputBufferReal_fx[bin][ch], tapImagPr_fx[tapIdx], hReverb->outputBufferReal_fx[bin][ch], numSlots ); v_sub_fixed_no_hdrm( hReverb->outputBufferImag_fx[bin][ch], tapRealPr_fx[tapIdx], hReverb->outputBufferImag_fx[bin][ch], numSlots ); -#else /* VEC_ARITH_OPT_v1 */ - v_add_fixed( hReverb->outputBufferReal_fx[bin][ch], tapImagPr_fx[tapIdx], hReverb->outputBufferReal_fx[bin][ch], numSlots, 0 ); - v_sub_fixed( hReverb->outputBufferImag_fx[bin][ch], tapRealPr_fx[tapIdx], hReverb->outputBufferImag_fx[bin][ch], numSlots, 0 ); -#endif /* VEC_ARITH_OPT_v1 */ BREAK; } } @@ -2271,7 +2241,6 @@ void ivas_binaural_reverb_processSubframe_fx( { Word32 leftRe_fx, rightRe_fx, leftIm_fx, rightIm_fx; -#ifdef OPT_BIN_RENDERER_V2 leftRe_fx = Madd_32_32( Mpy_32_32( hReverb->binauralCoherenceDirectGains_fx[bin], hReverb->outputBufferReal_fx[bin][0][sample] ), hReverb->binauralCoherenceCrossmixGains_fx[bin], hReverb->outputBufferReal_fx[bin][1][sample] ); // Q_in rightRe_fx = Madd_32_32( Mpy_32_32( hReverb->binauralCoherenceDirectGains_fx[bin], hReverb->outputBufferReal_fx[bin][1][sample] ), @@ -2280,16 +2249,6 @@ void ivas_binaural_reverb_processSubframe_fx( hReverb->binauralCoherenceCrossmixGains_fx[bin], hReverb->outputBufferImag_fx[bin][1][sample] ); // Q_in rightIm_fx = Madd_32_32( Mpy_32_32( hReverb->binauralCoherenceDirectGains_fx[bin], hReverb->outputBufferImag_fx[bin][1][sample] ), hReverb->binauralCoherenceCrossmixGains_fx[bin], hReverb->outputBufferImag_fx[bin][0][sample] ); // Q_in -#else /* OPT_BIN_RENDERER_V2 */ - leftRe_fx = L_add( Mpy_32_32( hReverb->binauralCoherenceDirectGains_fx[bin], hReverb->outputBufferReal_fx[bin][0][sample] ), - Mpy_32_32( hReverb->binauralCoherenceCrossmixGains_fx[bin], hReverb->outputBufferReal_fx[bin][1][sample] ) ); // Q_in - rightRe_fx = L_add( Mpy_32_32( hReverb->binauralCoherenceDirectGains_fx[bin], hReverb->outputBufferReal_fx[bin][1][sample] ), - Mpy_32_32( hReverb->binauralCoherenceCrossmixGains_fx[bin], hReverb->outputBufferReal_fx[bin][0][sample] ) ); // Q_in - leftIm_fx = L_add( Mpy_32_32( hReverb->binauralCoherenceDirectGains_fx[bin], hReverb->outputBufferImag_fx[bin][0][sample] ), - Mpy_32_32( hReverb->binauralCoherenceCrossmixGains_fx[bin], hReverb->outputBufferImag_fx[bin][1][sample] ) ); // Q_in - rightIm_fx = L_add( Mpy_32_32( hReverb->binauralCoherenceDirectGains_fx[bin], hReverb->outputBufferImag_fx[bin][1][sample] ), - Mpy_32_32( hReverb->binauralCoherenceCrossmixGains_fx[bin], hReverb->outputBufferImag_fx[bin][0][sample] ) ); // Q_in -#endif /* OPT_BIN_RENDERER_V2 */ hReverb->outputBufferReal_fx[bin][0][sample] = leftRe_fx; // Q_in move32(); diff --git a/lib_rend/ivas_sba_rendering_fx.c b/lib_rend/ivas_sba_rendering_fx.c index 896742151..ff077e63e 100644 --- a/lib_rend/ivas_sba_rendering_fx.c +++ b/lib_rend/ivas_sba_rendering_fx.c @@ -87,11 +87,7 @@ void ivas_sba_prototype_renderer_fx( Word16 norm_q = 31; // to handle overflow move16(); -#ifdef OPT_BIN_RENDERER_V1 FOR( Word16 i = 0; i < 2; i++ ) -#else /* OPT_BIN_RENDERER_V1 */ - FOR( Word16 i = 0; i < 6; i++ ) -#endif /* OPT_BIN_RENDERER_V1 */ { FOR( Word16 j = 0; j < CLDFB_SLOTS_PER_SUBFRAME; j++ ) { @@ -100,38 +96,21 @@ void ivas_sba_prototype_renderer_fx( } norm_q = sub( sub( 31, norm_q ), 2 ); // to handle overflow Word16 q_inp[2][CLDFB_SLOTS_PER_SUBFRAME]; -#ifdef OPT_BIN_RENDERER_V1 FOR( Word16 i = 0; i < 2; i++ ) -#else /* OPT_BIN_RENDERER_V1 */ - FOR( Word16 i = 0; i < 6; i++ ) -#endif /* OPT_BIN_RENDERER_V1 */ { FOR( Word16 j = 0; j < CLDFB_SLOTS_PER_SUBFRAME; j++ ) { -#ifdef OPT_BIN_RENDERER_V1 q_inp[i][j] = s_min( L_norm_arr( inRe_fx[i][j], num_cldfb_bands ), L_norm_arr( inIm_fx[i][j], num_cldfb_bands ) ); -#else /* OPT_BIN_RENDERER_V1 */ - q_inp[i][j] = s_min( L_norm_arr( inRe_fx[i][j], CLDFB_NO_CHANNELS_MAX ), L_norm_arr( inIm_fx[i][j], CLDFB_NO_CHANNELS_MAX ) ); -#endif /* OPT_BIN_RENDERER_V1 */ move16(); norm_q = s_min( q_inp[i][j], norm_q ); } } -#ifdef OPT_BIN_RENDERER_V1 FOR( Word16 i = 0; i < 2; i++ ) -#else /* OPT_BIN_RENDERER_V1 */ - FOR( Word16 i = 0; i < 6; i++ ) -#endif /* OPT_BIN_RENDERER_V1 */ { FOR( Word16 j = 0; j < CLDFB_SLOTS_PER_SUBFRAME; j++ ) { -#ifdef OPT_BIN_RENDERER_V1 scale_sig32( inRe_fx[i][j], num_cldfb_bands, sub( norm_q, 2 ) ); // q_cldfb -> q_cldfb + 2 -norm_q scale_sig32( inIm_fx[i][j], num_cldfb_bands, sub( norm_q, 2 ) ); // q_cldfb -> q_cldfb + 2 -norm_q -#else /* OPT_BIN_RENDERER_V1 */ - scale_sig32( inRe_fx[i][j], CLDFB_NO_CHANNELS_MAX, sub( norm_q, 2 ) ); // q_cldfb -> q_cldfb + 2 -norm_q - scale_sig32( inIm_fx[i][j], CLDFB_NO_CHANNELS_MAX, sub( norm_q, 2 ) ); // q_cldfb -> q_cldfb + 2 -norm_q -#endif /* OPT_BIN_RENDERER_V1 */ q_cldfb[i][j] = sub( add( q_cldfb[i][j], norm_q ), 2 ); move16(); } @@ -199,21 +178,12 @@ void ivas_sba_prototype_renderer_fx( FOR( spar_band = bin2band->p_spar_start_bands[cldfb_band]; spar_band < num_spar_bands; spar_band++ ) { /* accumulate contributions from all SPAR bands */ -#ifdef OPT_BIN_RENDERER_V1 cldfb_par_fx = Madd_32_32( cldfb_par_fx, mixer_mat_fx[out_ch][in_ch][spar_band], L_shl_sat( bin2band->pp_cldfb_weights_per_spar_band_fx[cldfb_band][spar_band], 9 ) ); // hMdDec->Q_mixer_matrix -#else /* OPT_BIN_RENDERER_V1 */ - cldfb_par_fx = L_add( cldfb_par_fx, Mpy_32_32( mixer_mat_fx[out_ch][in_ch][spar_band], bin2band->pp_cldfb_weights_per_spar_band_fx[cldfb_band][spar_band] ) ); // hMdDec->Q_mixer_matrix -#endif /* OPT_BIN_RENDERER_V1 */ } } -#ifdef OPT_BIN_RENDERER_V1 out_re_fx[out_ch] = Madd_32_32( out_re_fx[out_ch], inRe_fx[in_ch][ts][cldfb_band], cldfb_par_fx ); // hMdDec->Q_mixer_matrix+q_cldfb[i][j] -31 out_im_fx[out_ch] = Madd_32_32( out_im_fx[out_ch], inIm_fx[in_ch][ts][cldfb_band], cldfb_par_fx ); // hMdDec->Q_mixer_matrix+q_cldfb[i][j] -31 -#else /* OPT_BIN_RENDERER_V1 */ - out_re_fx[out_ch] = L_add( out_re_fx[out_ch], Mpy_32_32( inRe_fx[in_ch][ts][cldfb_band], cldfb_par_fx ) ); // hMdDec->Q_mixer_matrix+q_cldfb[i][j] -31 - out_im_fx[out_ch] = L_add( out_im_fx[out_ch], Mpy_32_32( inIm_fx[in_ch][ts][cldfb_band], cldfb_par_fx ) ); // hMdDec->Q_mixer_matrix+q_cldfb[i][j] -31 -#endif /* OPT_BIN_RENDERER_V1 */ move32(); move32(); } @@ -272,17 +242,11 @@ void ivas_sba_prototype_renderer_fx( { IF( EQ_16( st_ivas->nchan_transport, 1 ) ) /* Dual mono */ { -#ifdef OPT_BIN_RENDERER_V1 Copy32( inRe_fx[0][ts], inRe_fx[1][ts], num_cldfb_bands ); Copy32( inIm_fx[0][ts], inIm_fx[1][ts], num_cldfb_bands ); -#else /* OPT_BIN_RENDERER_V1 */ - Copy32( inRe_fx[0][ts], inRe_fx[1][ts], CLDFB_NO_CHANNELS_MAX ); - Copy32( inIm_fx[0][ts], inIm_fx[1][ts], CLDFB_NO_CHANNELS_MAX ); -#endif /* OPT_BIN_RENDERER_V1 */ } ELSE IF( EQ_16( st_ivas->nchan_transport, 2 ) ) /* Opposing cardioids */ { -#ifdef OPT_BIN_RENDERER_V1 Word32 temp_signal_fx; FOR( Word16 idx = 0; idx < num_cldfb_bands; idx++ ) { @@ -306,28 +270,6 @@ void ivas_sba_prototype_renderer_fx( inIm_fx[0][ts][idx] = temp_signal_fx; move32(); } -#else /* OPT_BIN_RENDERER_V1 */ - Word32 temp_signal_fx[CLDFB_NO_CHANNELS_MAX]; - FOR( Word16 idx = 0; idx < CLDFB_NO_CHANNELS_MAX; idx++ ) - { - temp_signal_fx[idx] = L_add( L_shr( inRe_fx[0][ts][idx], 1 ), L_shr( inRe_fx[1][ts][idx], 1 ) ); // q_cldfb[][]-1 - move32(); - inRe_fx[1][ts][idx] = L_sub( L_shr( inRe_fx[0][ts][idx], 1 ), L_shr( inRe_fx[1][ts][idx], 1 ) ); // q_cldfb[][]-1 - move32(); - inRe_fx[0][ts][idx] = temp_signal_fx[idx]; - move32(); - } - - FOR( Word16 idx = 0; idx < CLDFB_NO_CHANNELS_MAX; idx++ ) - { - temp_signal_fx[idx] = L_add( L_shr( inIm_fx[0][ts][idx], 1 ), L_shr( inIm_fx[1][ts][idx], 1 ) ); // q_cldfb[][]-1 - move32(); - inIm_fx[1][ts][idx] = L_sub( L_shr( inIm_fx[0][ts][idx], 1 ), L_shr( inIm_fx[1][ts][idx], 1 ) ); // q_cldfb[][]-1 - move32(); - inIm_fx[0][ts][idx] = temp_signal_fx[idx]; - move32(); - } -#endif /* OPT_BIN_RENDERER_V1 */ } } } diff --git a/lib_rend/lib_rend_fx.c b/lib_rend/lib_rend_fx.c index 3b800ed07..957aaee0d 100644 --- a/lib_rend/lib_rend_fx.c +++ b/lib_rend/lib_rend_fx.c @@ -5755,11 +5755,7 @@ static ivas_error renderLfeToBinaural_fx( { writePtr = getSmplPtr_fx( outAudio, ear_idx, 0 ); move32(); -#ifdef VEC_ARITH_OPT_v1 v_add_fixed_no_hdrm( writePtr, tmpLfeBuffer, writePtr, frame_size ); /* Q(out_q) */ -#else /* VEC_ARITH_OPT_v1 */ - v_add_fixed( writePtr, tmpLfeBuffer, writePtr, frame_size, 0 ); /* Q(out_q) */ -#endif /* VEC_ARITH_OPT_v1 */ } pop_wmops(); @@ -6764,11 +6760,7 @@ static void renderMasaToMasa( ELSE IF( EQ_16( masaInput->base.inputBuffer.config.numChannels, 2 ) && EQ_16( outAudio.config.numChannels, 1 ) ) { // v_add( tmpBuffer[0], tmpBuffer[1], tmpBuffer[0], masaInput->base.inputBuffer.config.numSamplesPerChannel ); -#ifdef VEC_ARITH_OPT_v1 v_add_fixed_no_hdrm( tmpBuffer_fx[0], tmpBuffer_fx[1], tmpBuffer_fx[0], masaInput->base.inputBuffer.config.numSamplesPerChannel ); -#else /* VEC_ARITH_OPT_v1 */ - v_add_fixed( tmpBuffer_fx[0], tmpBuffer_fx[1], tmpBuffer_fx[0], masaInput->base.inputBuffer.config.numSamplesPerChannel, 0 ); -#endif /* VEC_ARITH_OPT_v1 */ } /* Copy metadata */ -- GitLab From 81d0cb71e489fa477aa00582f0a324d97e604579 Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Wed, 25 Jun 2025 11:08:01 +0530 Subject: [PATCH 2/3] Clang formatting --- lib_com/cldfb_fx.c | 42 +++++++++---------- lib_com/prot_fx.h | 18 ++++---- lib_com/swb_tbe_com_fx.c | 6 +-- lib_dec/ivas_dirac_output_synthesis_cov_fx.c | 2 - lib_dec/ivas_mc_paramupmix_dec_fx.c | 2 - lib_dec/ivas_stereo_cng_dec_fx.c | 2 +- lib_dec/ivas_stereo_dft_dec_fx.c | 28 ++++++------- lib_dec/swb_tbe_dec_fx.c | 14 +++---- lib_enc/ivas_mc_param_enc_fx.c | 1 - lib_enc/ivas_qmetadata_enc_fx.c | 2 +- lib_enc/ivas_stereo_icbwe_enc_fx.c | 2 +- lib_enc/lib_enc_fx.c | 31 +++++++------- lib_rend/ivas_dirac_output_synthesis_dec_fx.c | 3 +- lib_rend/ivas_dirac_rend_fx.c | 2 +- 14 files changed, 70 insertions(+), 85 deletions(-) diff --git a/lib_com/cldfb_fx.c b/lib_com/cldfb_fx.c index edddcb272..30b8d57d0 100644 --- a/lib_com/cldfb_fx.c +++ b/lib_com/cldfb_fx.c @@ -505,18 +505,18 @@ void cldfbAnalysis_ts_fx( #endif /* OPT_IVAS_FILTER_ROM */ /* folding + pre modulation of DST IV */ - rr12_fx = L_sub( r1_fx, r2_fx ); // q -1 - ri12_fx = L_negate( L_add( i1_fx, i2_fx ) ); // q - 1 - /*cplxMult(&rBuffer[2*k],&rBuffer[2*k+1],rr12,ri12,rot_vctr_re[k],rot_vctr_im[k]);*/ + rr12_fx = L_sub( r1_fx, r2_fx ); // q -1 + ri12_fx = L_negate( L_add( i1_fx, i2_fx ) ); // q - 1 + /*cplxMult(&rBuffer[2*k],&rBuffer[2*k+1],rr12,ri12,rot_vctr_re[k],rot_vctr_im[k]);*/ rBuffer_fx[2 * k] = Msub_32_32( Mpy_32_32( rr12_fx, rot_vctr_re_fx[k] ), ri12_fx, rot_vctr_im_fx[k] ); // q - 3 rBuffer_fx[2 * k + 1] = Madd_32_32( Mpy_32_32( rr12_fx, rot_vctr_im_fx[k] ), ri12_fx, rot_vctr_re_fx[k] ); // q - 3 move32(); move32(); ///* folding + pre modulation of DCT IV */ - ir12_fx = L_add( r1_fx, r2_fx ); // q - 1 - ii12_fx = L_sub( i1_fx, i2_fx ); // q - 1 - /*cplxMult(&iBuffer[2*k],&iBuffer[2*k+1],ir12,ii12,rot_vctr_re[k],rot_vctr_im[k]);*/ + ir12_fx = L_add( r1_fx, r2_fx ); // q - 1 + ii12_fx = L_sub( i1_fx, i2_fx ); // q - 1 + /*cplxMult(&iBuffer[2*k],&iBuffer[2*k+1],ir12,ii12,rot_vctr_re[k],rot_vctr_im[k]);*/ iBuffer_fx[2 * k] = Msub_32_32( Mpy_32_32( ir12_fx, rot_vctr_re_fx[k] ), ii12_fx, rot_vctr_im_fx[k] ); // q - 3 iBuffer_fx[2 * k + 1] = Madd_32_32( Mpy_32_32( ir12_fx, rot_vctr_im_fx[k] ), ii12_fx, rot_vctr_re_fx[k] ); // q - 3 move32(); @@ -575,25 +575,25 @@ void cldfbAnalysis_ts_fx( i2_fx = Msub_32_16( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 3 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 3 * L2 )] ); // q i2_fx = Msub_32_16( i2_fx, timeBuffer_fx[( L2 - 3 * M2 + ( 2 * k ) + 4 * L2 )], ptr_pf_fx[( L2 - 3 * M2 + ( 2 * k ) + 4 * L2 )] ); // q - r1_fx = Mpy_32_16_1( r1_fx, ptr_pf_sf ); // q - 1 - r2_fx = Mpy_32_16_1( r2_fx, ptr_pf_sf ); // q - 1 - i1_fx = Mpy_32_16_1( i1_fx, ptr_pf_sf ); // q - 1 - i2_fx = Mpy_32_16_1( i2_fx, ptr_pf_sf ); // q - 1 + r1_fx = Mpy_32_16_1( r1_fx, ptr_pf_sf ); // q - 1 + r2_fx = Mpy_32_16_1( r2_fx, ptr_pf_sf ); // q - 1 + i1_fx = Mpy_32_16_1( i1_fx, ptr_pf_sf ); // q - 1 + i2_fx = Mpy_32_16_1( i2_fx, ptr_pf_sf ); // q - 1 #endif /* OPT_IVAS_FILTER_ROM */ /* folding + pre modulation of DST IV */ - rr12_fx = L_add( r1_fx, r2_fx ); // q - 1 - ri12_fx = L_sub( i1_fx, i2_fx ); // q - 1 - /*cplxMult(&rBuffer[2*k],&rBuffer[2*k+1],rr12,ri12,rot_vctr_re[k],rot_vctr_im[k]);*/ + rr12_fx = L_add( r1_fx, r2_fx ); // q - 1 + ri12_fx = L_sub( i1_fx, i2_fx ); // q - 1 + /*cplxMult(&rBuffer[2*k],&rBuffer[2*k+1],rr12,ri12,rot_vctr_re[k],rot_vctr_im[k]);*/ rBuffer_fx[2 * k] = Msub_32_32( Mpy_32_32( rr12_fx, rot_vctr_re_fx[k] ), ri12_fx, rot_vctr_im_fx[k] ); // q - 3 rBuffer_fx[2 * k + 1] = Madd_32_32( Mpy_32_32( rr12_fx, rot_vctr_im_fx[k] ), ri12_fx, rot_vctr_re_fx[k] ); // q - 3 move32(); move32(); /* folding + pre modulation of DCT IV */ - ir12_fx = L_sub( r1_fx, r2_fx ); // q - 1 - ii12_fx = L_add( i1_fx, i2_fx ); // q - 1 - /*cplxMult(&iBuffer[2*k],&iBuffer[2*k+1],ir12,ii12,rot_vctr_re[k],rot_vctr_im[k]);*/ + ir12_fx = L_sub( r1_fx, r2_fx ); // q - 1 + ii12_fx = L_add( i1_fx, i2_fx ); // q - 1 + /*cplxMult(&iBuffer[2*k],&iBuffer[2*k+1],ir12,ii12,rot_vctr_re[k],rot_vctr_im[k]);*/ iBuffer_fx[2 * k] = Msub_32_32( Mpy_32_32( ir12_fx, rot_vctr_re_fx[k] ), ii12_fx, rot_vctr_im_fx[k] ); // q - 3 iBuffer_fx[2 * k + 1] = Madd_32_32( Mpy_32_32( ir12_fx, rot_vctr_im_fx[k] ), ii12_fx, rot_vctr_re_fx[k] ); // q - 3 move32(); @@ -1378,11 +1378,11 @@ void cldfbAnalysis_ts_fx_fixed_q( * Conduct inverse multple overlap cmplex low delay MDCT *--------------------------------------------------------------------*/ void cldfbSynthesis_ivas_fx( - Word32 **realBuffer_fx, /* i : real values Qx*/ - Word32 **imagBuffer_fx, /* i : imag values Qx*/ - Word32 *timeOut_fx, /* o : output time domain samples Qx - 1*/ - const Word16 samplesToProcess, /* i : number of processed samples */ - const Word16 shift, /* i : scale for state buffer */ + Word32 **realBuffer_fx, /* i : real values Qx*/ + Word32 **imagBuffer_fx, /* i : imag values Qx*/ + Word32 *timeOut_fx, /* o : output time domain samples Qx - 1*/ + const Word16 samplesToProcess, /* i : number of processed samples */ + const Word16 shift, /* i : scale for state buffer */ const Word16 out_shift, /* i : scale for output buffer */ HANDLE_CLDFB_FILTER_BANK h_cldfb /* i : filter bank state */ ) diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index 2d4ea1901..666484359 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -3244,10 +3244,8 @@ void synthesise_fb_high_band_fx( Word16 *prev_fbbwe_ratio, /* o : previous frame energy for FEC */ Word32 bpf_memory[][4], /* i/o: memory for elliptic bpf 48k */ Word16 bpf_memory_Q[], - Word16 Qout - , - Word16 element_mode -); + Word16 Qout, + Word16 element_mode ); void prep_tbe_exc_fx( const Word16 L_frame_fx, /* i : length of the frame */ @@ -9361,12 +9359,12 @@ void cldfbAnalysis_ivas_fx( ); void cldfbSynthesis_ivas_fx( - Word32 **realBuffer_fx, /* i : real values Qx*/ - Word32 **imagBuffer_fx, /* i : imag values Qx*/ - Word32 *timeOut_fx, /* o : output time domain samples Qx - 1*/ - const Word16 samplesToProcess, /* i : number of processed samples */ - const Word16 shift, /* i : scale for state buffer */ - const Word16 out_shift, /* i : scale for output buffer */ + Word32 **realBuffer_fx, /* i : real values Qx*/ + Word32 **imagBuffer_fx, /* i : imag values Qx*/ + Word32 *timeOut_fx, /* o : output time domain samples Qx - 1*/ + const Word16 samplesToProcess, /* i : number of processed samples */ + const Word16 shift, /* i : scale for state buffer */ + const Word16 out_shift, /* i : scale for output buffer */ HANDLE_CLDFB_FILTER_BANK h_cldfb /* i : filter bank state */ ); diff --git a/lib_com/swb_tbe_com_fx.c b/lib_com/swb_tbe_com_fx.c index f37381b69..8ddfa3e5f 100644 --- a/lib_com/swb_tbe_com_fx.c +++ b/lib_com/swb_tbe_com_fx.c @@ -6685,10 +6685,8 @@ void synthesise_fb_high_band_fx( Word16 *prev_fbbwe_ratio, /* o : previous frame energy for FEC */ Word32 bpf_memory[][4], /* i/o: memory for elliptic bpf 48k */ Word16 bpf_memory_Q[], - Word16 Qout - , - int16_t element_mode -) + Word16 Qout, + int16_t element_mode ) { Word16 i, j; Word16 excitation_in_interp3_buffer[L_FRAME48k + 4]; diff --git a/lib_dec/ivas_dirac_output_synthesis_cov_fx.c b/lib_dec/ivas_dirac_output_synthesis_cov_fx.c index 0d8e029d1..532ca0358 100644 --- a/lib_dec/ivas_dirac_output_synthesis_cov_fx.c +++ b/lib_dec/ivas_dirac_output_synthesis_cov_fx.c @@ -623,8 +623,6 @@ void ivas_dirac_dec_output_synthesis_cov_param_mc_synthesise_slot_fx( #endif /* OPT_SBA_DEC_V2_BE */ } } - - } ELSE { diff --git a/lib_dec/ivas_mc_paramupmix_dec_fx.c b/lib_dec/ivas_mc_paramupmix_dec_fx.c index 5840cb08f..46b28ec8c 100644 --- a/lib_dec/ivas_mc_paramupmix_dec_fx.c +++ b/lib_dec/ivas_mc_paramupmix_dec_fx.c @@ -859,9 +859,7 @@ static void ivas_mc_paramupmix_dec_sf( ImagBuffer_fx[slot_idx] = Cldfb_ImagBuffer_Binaural_fx[ch][slot_idx]; // Q6 } cldfbSynthesis_ivas_fx( RealBuffer_fx, ImagBuffer_fx, &( output_fx[ch][0] ), imult1616( maxBand, st_ivas->hTcBuffer->subframe_nbslots[subframeIdx] ), 6, 0, st_ivas->cldfbSynDec[ch] ); // output_fx returned in Q11 - } - } ELSE { diff --git a/lib_dec/ivas_stereo_cng_dec_fx.c b/lib_dec/ivas_stereo_cng_dec_fx.c index d48e035a6..463032467 100644 --- a/lib_dec/ivas_stereo_cng_dec_fx.c +++ b/lib_dec/ivas_stereo_cng_dec_fx.c @@ -1509,7 +1509,7 @@ void stereo_cna_update_params_fx( dotLR_fx_q = add( dotLR_fx_q, sub( sub( 31, temp_res_q ), 31 ) ); dotLR_fx = W_deposit32_l( L_shl_sat( W_extract_l( dotLR_fx ), sub( 31, dotLR_fx_q ) ) ); /* Q31 */ /* estimate L/R correlation factor and ILD in time domain */ - c_LR_fx = W_extract_l( dotLR_fx ); /* Q31 */ + c_LR_fx = W_extract_l( dotLR_fx ); /* Q31 */ temp_res_q = 0; move16(); diff --git a/lib_dec/ivas_stereo_dft_dec_fx.c b/lib_dec/ivas_stereo_dft_dec_fx.c index 4aebd5145..7d3bec07d 100644 --- a/lib_dec/ivas_stereo_dft_dec_fx.c +++ b/lib_dec/ivas_stereo_dft_dec_fx.c @@ -2603,9 +2603,9 @@ void stereo_dft_dec_fx( Word16 shift = sub( q_cna_level, hStereoDft->q_dft ); N1 = L_shl( Mpy_32_16_1( scale_fact, rand_gauss_fix( &ftmp, cna_seed ) ), Q2 ); /* q_cna_level */ N2 = L_shl( Mpy_32_16_1( scale_fact, rand_gauss_fix( &ftmp, cna_seed ) ), Q2 ); /* q_cna_level */ - l_tmp = Madd_32_16( Madd_32_16( N1, N1, g ), N2, gamma ); /* q_cna_level */ - l_tmp = L_shr( l_tmp, shift ); /* q_dft */ - DFT_L[2 * i] = L_add_sat( DFT_L[2 * i], l_tmp ); /* q_dft */ + l_tmp = Madd_32_16( Madd_32_16( N1, N1, g ), N2, gamma ); /* q_cna_level */ + l_tmp = L_shr( l_tmp, shift ); /* q_dft */ + DFT_L[2 * i] = L_add_sat( DFT_L[2 * i], l_tmp ); /* q_dft */ move32(); l_tmp = Msub_32_16( Msub_32_16( N1, N1, g ), N2, gamma ); /* q_cna_level */ l_tmp = L_shr( l_tmp, shift ); /* q_dft */ @@ -2614,9 +2614,9 @@ void stereo_dft_dec_fx( N1 = L_shl( Mpy_32_16_1( scale_fact, rand_gauss_fix( &ftmp, cna_seed ) ), Q2 ); /* q_cna_level */ N2 = L_shl( Mpy_32_16_1( scale_fact, rand_gauss_fix( &ftmp, cna_seed ) ), Q2 ); /* q_cna_level */ - l_tmp = Madd_32_16( Madd_32_16( N1, N1, g ), N2, gamma ); /* q_cna_level */ - l_tmp = L_shr( l_tmp, shift ); /* q_dft */ - DFT_L[2 * i + 1] = L_add_sat( DFT_L[2 * i + 1], l_tmp ); /* q_dft */ + l_tmp = Madd_32_16( Madd_32_16( N1, N1, g ), N2, gamma ); /* q_cna_level */ + l_tmp = L_shr( l_tmp, shift ); /* q_dft */ + DFT_L[2 * i + 1] = L_add_sat( DFT_L[2 * i + 1], l_tmp ); /* q_dft */ move32(); l_tmp = Msub_32_16( Msub_32_16( N1, N1, g ), N2, gamma ); /* q_cna_level */ l_tmp = L_shr( l_tmp, shift ); /* q_dft */ @@ -2874,14 +2874,14 @@ static void stereo_dft_dequantize_ipd_fx( *-------------------------------------------------------------------------*/ void stereo_dft_generate_res_pred_fx( STEREO_DFT_DEC_DATA_HANDLE hStereoDft, /* i/o: decoder DFT stereo handle */ - const Word16 samp_ratio, /* i : sampling ratio Q15*/ - Word32 *pDFT_DMX, /* i : downmix signal qDFT*/ - Word32 *DFT_PRED_RES, /* o : residual prediction signal qDFT*/ - Word32 *pPredGain, /* i : residual prediction gains Q31*/ - const Word16 k, /* i : subframe index Q0*/ - Word32 *ap_filt_DMX, /* i : enhanced stereo filling signal qDFT*/ - Word16 *stop, /* o : last FD stereo filling bin Q0*/ - const Word16 bfi /* i : BFI flag Q0*/ + const Word16 samp_ratio, /* i : sampling ratio Q15*/ + Word32 *pDFT_DMX, /* i : downmix signal qDFT*/ + Word32 *DFT_PRED_RES, /* o : residual prediction signal qDFT*/ + Word32 *pPredGain, /* i : residual prediction gains Q31*/ + const Word16 k, /* i : subframe index Q0*/ + Word32 *ap_filt_DMX, /* i : enhanced stereo filling signal qDFT*/ + Word16 *stop, /* o : last FD stereo filling bin Q0*/ + const Word16 bfi /* i : BFI flag Q0*/ ) { /* general variables */ diff --git a/lib_dec/swb_tbe_dec_fx.c b/lib_dec/swb_tbe_dec_fx.c index 73d8ef11c..679e206e0 100644 --- a/lib_dec/swb_tbe_dec_fx.c +++ b/lib_dec/swb_tbe_dec_fx.c @@ -4662,10 +4662,8 @@ void fb_tbe_dec_fx( fb_exc_energy = sum2_fx_mod( fb_exc, L_FRAME16k ); /* FB TBE synthesis */ - synthesise_fb_high_band_fx( fb_exc, Q_fb_exc, fb_synth, fb_exc_energy, ratio, st->L_frame, st->bfi, &( hBWE_TD->prev_fbbwe_ratio_fx ), hBWE_TD->fbbwe_hpf_mem_fx, hBWE_TD->fbbwe_hpf_mem_fx_Q, hb_synth_exp - , - st->element_mode - ); + synthesise_fb_high_band_fx( fb_exc, Q_fb_exc, fb_synth, fb_exc_energy, ratio, st->L_frame, st->bfi, &( hBWE_TD->prev_fbbwe_ratio_fx ), hBWE_TD->fbbwe_hpf_mem_fx, hBWE_TD->fbbwe_hpf_mem_fx_Q, hb_synth_exp, + st->element_mode ); /* add the fb_synth component to the hb_synth component */ /* v_add_fx( hb_synth, fb_synth, hb_synth, L_FRAME48k );*/ @@ -4734,10 +4732,8 @@ void fb_tbe_dec_ivas_fx( fb_exc_energy = sum2_fx_mod( fb_exc, L_FRAME16k ); /* FB TBE synthesis */ - synthesise_fb_high_band_fx( fb_exc, Q_fb_exc, fb_synth, fb_exc_energy, ratio, st->L_frame, st->bfi, &( hBWE_TD->prev_fbbwe_ratio_fx ), hBWE_TD->fbbwe_hpf_mem_fx, hBWE_TD->fbbwe_hpf_mem_fx_Q, hb_synth_exp - , - st->element_mode - ); + synthesise_fb_high_band_fx( fb_exc, Q_fb_exc, fb_synth, fb_exc_energy, ratio, st->L_frame, st->bfi, &( hBWE_TD->prev_fbbwe_ratio_fx ), hBWE_TD->fbbwe_hpf_mem_fx, hBWE_TD->fbbwe_hpf_mem_fx_Q, hb_synth_exp, + st->element_mode ); test(); IF( GE_16( st->element_mode, IVAS_CPE_DFT ) && ( st->idchan == 0 ) ) @@ -7046,7 +7042,7 @@ void ivas_swb_tbe_dec_fx( FOR( i = 0; i < L_FRAME16k; i++ ) { Word16 idx; - idx = extract_h( imult3216( idx32, i ) ); /*Q0*/ + idx = extract_h( imult3216( idx32, i ) ); /*Q0*/ L_tmp1 = Mult_32_16( L_tmp, GainShape_fx[idx] ); /* Q : 18 + tmp +15 -15*/ White_exc16k_fx[i] = round_fx( Mult_32_16( L_tmp1, White_exc16k_fx[i] ) ); /* 18 + tmp +*Q_white_exc -15 -16 */ move16(); diff --git a/lib_enc/ivas_mc_param_enc_fx.c b/lib_enc/ivas_mc_param_enc_fx.c index 8b09f3644..226e7c164 100644 --- a/lib_enc/ivas_mc_param_enc_fx.c +++ b/lib_enc/ivas_mc_param_enc_fx.c @@ -1166,7 +1166,6 @@ static void ivas_param_mc_param_est_enc_fx( move64(); Cy_sum_imag_64[cur_param_band - 1][ch_idx1][ch_idx2] = W_add( Cy_sum_imag_64[cur_param_band - 1][ch_idx1][ch_idx2], Cy_sum_imag_64[cur_param_band][ch_idx1][ch_idx2] ); move64(); - } } } diff --git a/lib_enc/ivas_qmetadata_enc_fx.c b/lib_enc/ivas_qmetadata_enc_fx.c index 3040bc24a..15adcee9c 100644 --- a/lib_enc/ivas_qmetadata_enc_fx.c +++ b/lib_enc/ivas_qmetadata_enc_fx.c @@ -1072,7 +1072,7 @@ void ivas_qmetadata_enc_sid_encode_fx( { /*compute the average direction */ ivas_qmetadata_azimuth_elevation_to_direction_vector_fx( q_direction->band_data[b].azimuth_fx[m], q_direction->band_data[b].elevation_fx[m], direction_vector_fx ); - scale_sig32( direction_vector_fx, 3, Q22 - Q30 ); // Q30 -> Q22 + scale_sig32( direction_vector_fx, 3, Q22 - Q30 ); // Q30 -> Q22 v_add_fixed_no_hdrm( avg_direction_vector_fx, direction_vector_fx, avg_direction_vector_fx, 3 ); // Q22 } diff --git a/lib_enc/ivas_stereo_icbwe_enc_fx.c b/lib_enc/ivas_stereo_icbwe_enc_fx.c index ff5d67d6a..67ba071a0 100644 --- a/lib_enc/ivas_stereo_icbwe_enc_fx.c +++ b/lib_enc/ivas_stereo_icbwe_enc_fx.c @@ -853,7 +853,7 @@ void stereo_icBWE_enc_ivas_fx( move16(); /* shb_frame_ref_ICBWE @ (8.75 - shb_speech_delay (=1.25) ms) after shb_speech */ - Copy_Scale_sig32( shb_speech_nonref_fx, shb_frame_nonref_fx + L_LOOK_16k - nonRefMemLen, L_FRAME16k, negate( sub( max_e, shb_speech_nonref_e ) ) ); /* Q31-max_e */ + Copy_Scale_sig32( shb_speech_nonref_fx, shb_frame_nonref_fx + L_LOOK_16k - nonRefMemLen, L_FRAME16k, negate( sub( max_e, shb_speech_nonref_e ) ) ); /* Q31-max_e */ Copy_Scale_sig_32_16( shb_frame_nonref_fx + L_FRAME16k, hStereoICBWE->mem_shb_speech_nonref_fx, L_LOOK_16k, sub( negate( sub( max_e, hStereoICBWE->mem_shb_speech_nonref_e ) ), Q16 ) ); // mem_shb_speech_ref_e /* core switching reset */ diff --git a/lib_enc/lib_enc_fx.c b/lib_enc/lib_enc_fx.c index 27de8ad87..6c105228f 100644 --- a/lib_enc/lib_enc_fx.c +++ b/lib_enc/lib_enc_fx.c @@ -1509,27 +1509,26 @@ ivas_error IVAS_ENC_EncodeFrameToSerial( } } ELSE /* IVAS */ - { - IF( NE_32( ( error = ivas_enc_fx( st_ivas, inputBuffer, inputBufferSize ) ), IVAS_ERR_OK ) ) { - return error; - } - } + IF( NE_32( ( error = ivas_enc_fx( st_ivas, inputBuffer, inputBufferSize ) ), IVAS_ERR_OK ) ){ + return error; +} +} - /* write indices into bitstream buffer */ - { - write_indices_ivas_fx( st_ivas, outputBitStream, numOutBits +/* write indices into bitstream buffer */ +{ + write_indices_ivas_fx( st_ivas, outputBitStream, numOutBits #ifdef DBG_BITSTREAM_ANALYSIS - , - frame + , + frame #endif - ); - } - /* Reset switching flag before next call - can be set to "true" by some setters */ - hIvasEnc->switchingActive = false; - move16(); + ); +} +/* Reset switching flag before next call - can be set to "true" by some setters */ +hIvasEnc->switchingActive = false; +move16(); - return error; +return error; } diff --git a/lib_rend/ivas_dirac_output_synthesis_dec_fx.c b/lib_rend/ivas_dirac_output_synthesis_dec_fx.c index 8b54b80c7..eea8dffbb 100644 --- a/lib_rend/ivas_dirac_output_synthesis_dec_fx.c +++ b/lib_rend/ivas_dirac_output_synthesis_dec_fx.c @@ -982,7 +982,6 @@ void ivas_dirac_dec_output_synthesis_process_slot_fx( move16(); } } - } ELSE { @@ -1090,7 +1089,7 @@ void ivas_dirac_dec_output_synthesis_process_slot_fx( move16(); } free( exp_temp_cy_cross_dir_smooth_fx ); -#else /* OPT_SBA_DEC_PATH */ +#else /* OPT_SBA_DEC_PATH */ /*Direct gain*/ Word16 *Q_temp_cy_cross_dir_smooth_fx = (Word16 *) malloc( num_freq_bands * num_channels_dir * sizeof( Word16 ) ); diff --git a/lib_rend/ivas_dirac_rend_fx.c b/lib_rend/ivas_dirac_rend_fx.c index 4b35bbd30..0535d2582 100644 --- a/lib_rend/ivas_dirac_rend_fx.c +++ b/lib_rend/ivas_dirac_rend_fx.c @@ -4542,7 +4542,7 @@ static void ivas_masa_ext_dirac_render_sf_fx( hDirACRend->h_freq_domain_decorr_ap_params, hDirACRend->h_freq_domain_decorr_ap_state ); - v_multc_fixed( onset_filter_fx, 536870912 /* 0.25f in Q31 */, onset_filter_fx, hSpatParamRendCom->num_freq_bands ); /* Q31 */ + v_multc_fixed( onset_filter_fx, 536870912 /* 0.25f in Q31 */, onset_filter_fx, hSpatParamRendCom->num_freq_bands ); /* Q31 */ v_add_fixed_no_hdrm( onset_filter_fx, onset_filter_subframe_fx, onset_filter_subframe_fx, hSpatParamRendCom->num_freq_bands ); /* Q31 */ p_onset_filter_fx = onset_filter_subframe_fx; /*q31*/ } -- GitLab From edeae1116cf183daed960d1bff67de35c8e7fb97 Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Wed, 25 Jun 2025 12:11:42 +0530 Subject: [PATCH 3/3] Revert changes related to one macro --- lib_enc/ivas_mc_param_enc_fx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib_enc/ivas_mc_param_enc_fx.c b/lib_enc/ivas_mc_param_enc_fx.c index 226e7c164..ba2c52073 100644 --- a/lib_enc/ivas_mc_param_enc_fx.c +++ b/lib_enc/ivas_mc_param_enc_fx.c @@ -994,6 +994,7 @@ static void ivas_param_mc_param_est_enc_fx( /* Cy for input channels */ FOR( ch_idx1 = 0; ch_idx1 < nchan_input; ++ch_idx1 ) { +#ifdef IMPROVE_HIGH_COMPLEXITY_PARAM_MC_PRM_EST_NONBE a_e = norm_l( slot_frame_f_real_fx[ch_idx1][cur_cldfb_band] ); a_fx = L_shl( slot_frame_f_real_fx[ch_idx1][cur_cldfb_band], a_e ); a_e = sub( add20gb, a_e ); @@ -1010,6 +1011,7 @@ static void ivas_param_mc_param_est_enc_fx( b_e = 0; move16(); } +#endif a_fx = slot_frame_f_real_fx[ch_idx1][cur_cldfb_band]; b_fx = slot_frame_f_imag_fx[ch_idx1][cur_cldfb_band]; move32(); -- GitLab