Loading lib_enc/enc_higher_acelp_fx.c +0 −42 Original line number Diff line number Diff line Loading @@ -301,7 +301,6 @@ void transf_cdbk_enc_fx( * DCT transform *--------------------------------------------------------------*/ #ifdef NONBE_FIX_ISSUE_2518_TRANSENC_SAT_FIX Word16 q_x_tran; IF( EQ_16( st_fx->element_mode, EVS_MONO ) ) { Loading @@ -314,13 +313,6 @@ void transf_cdbk_enc_fx( q_x_tran = s_min( Q_AVQ_OUT_DEC, norm_arr( x_norm, Nsv * WIDTH_BAND ) ); Copy_Scale_sig_nosat( x_norm, x_tran, Nsv * WIDTH_BAND, q_x_tran ); } #else FOR( i = 0; i < Nsv * WIDTH_BAND; i++ ) { x_tran[i] = shl_sat( x_norm[i], Q_AVQ_OUT_DEC ); move16(); } #endif test(); test(); Loading @@ -336,13 +328,8 @@ void transf_cdbk_enc_fx( edct2_fx( L_SUBFR, 1, x_tran, out32, &Qdct, ip_edct2_64, w_edct2_64_fx ); /*qdct = sub(Q_AVQ_OUT_DEC,qdct+Q_AVQ_OUT_DEC);*/ Qdct = negate( Qdct ); #ifdef NONBE_FIX_ISSUE_2518_TRANSENC_SAT_FIX Copy_Scale_sig_32_16( out32, code_preQ, L_SUBFR, Qdct ); /* Output in q_x_tran */ /*qdct = q_x_tran;*/ #else Copy_Scale_sig_32_16( out32, code_preQ, L_SUBFR, Qdct ); /* Output in Q_AVQ_OUT_DEC */ /*qdct = Q_AVQ_OUT_DEC;*/ #endif } /*--------------------------------------------------------------* Loading @@ -368,27 +355,18 @@ void transf_cdbk_enc_fx( test(); IF( GT_16( st_fx->element_mode, EVS_MONO ) && NE_16( st_fx->coder_type, INACTIVE ) && GE_32( st_fx->core_brate, MIN_BRATE_AVQ_EXC ) && LE_32( st_fx->core_brate, MAX_BRATE_AVQ_EXC_TD ) && !harm_flag_acelp && code_preQ[0] != 0 ) { #ifdef NONBE_FIX_ISSUE_2518_TRANSENC_SAT_FIX IF( GT_16( abs_s( st_fx->last_code_preq ), shl_sat( abs_s( code_preQ[0] ), sub( Q_AVQ_OUT_DEC + 4, q_x_tran ) ) ) ) #else IF( GT_16( abs_s( st_fx->last_code_preq ), shl_sat( abs_s( code_preQ[0] ), 4 ) ) ) #endif { st_fx->mem_preemp_preQ_fx = shr( st_fx->mem_preemp_preQ_fx, 4 ); move16(); } #ifdef NONBE_FIX_ISSUE_2518_TRANSENC_SAT_FIX ELSE IF( GT_16( abs_s( st_fx->last_code_preq ), shl_sat( abs_s( code_preQ[0] ), sub( Q_AVQ_OUT_DEC + 3, q_x_tran ) ) ) ) #else ELSE IF( GT_16( abs_s( st_fx->last_code_preq ), shl_sat( abs_s( code_preQ[0] ), 3 ) ) ) #endif { st_fx->mem_preemp_preQ_fx = shr( st_fx->mem_preemp_preQ_fx, 3 ); move16(); } } #ifdef NONBE_FIX_ISSUE_2518_TRANSENC_SAT_FIX st_fx->last_code_preq = shl_sat( code_preQ[L_SUBFR - 1], sub( 1, q_x_tran ) ); // Q0 ? Q1 move16(); Loading @@ -397,12 +375,6 @@ void transf_cdbk_enc_fx( preemph_fx( code_preQ, FAC_PRE_AVQ_FX, L_SUBFR, &( st_fx->mem_preemp_preQ_fx ) ); st_fx->mem_preemp_preQ_fx = shl_sat( st_fx->mem_preemp_preQ_fx, sub( Q_AVQ_OUT_DEC, q_x_tran ) ); move16(); #else st_fx->last_code_preq = shr( code_preQ[L_SUBFR - 1], 9 ); // Q0 move16(); preemph_fx( code_preQ, FAC_PRE_AVQ_FX, L_SUBFR, &( st_fx->mem_preemp_preQ_fx ) ); #endif /*--------------------------------------------------------------* * For inactive segments Loading @@ -415,36 +387,22 @@ void transf_cdbk_enc_fx( IF( EQ_16( st_fx->coder_type, INACTIVE ) ) { /*ftemp = fcode_preQ[0] *fh1[L_SUBFR-1];*/ #ifdef NONBE_FIX_ISSUE_2518_TRANSENC_SAT_FIX Ltmp = L_mult( code_preQ[0], h1[L_SUBFR - 1] ); /*1+14+shift + q_x_tran */ #else Ltmp = L_mult( code_preQ[0], h1[L_SUBFR - 1] ); /*1+14+shift + Q_AVQ_OUT */ #endif FOR( i = 1; i < L_SUBFR; i++ ) { /*ftemp += fcode_preQ[i] * fh1[L_SUBFR-1-i];*/ Ltmp = L_mac( Ltmp, code_preQ[i], h1[L_SUBFR - 1 - i] ); } /*fxn[L_SUBFR-1] -= *fgain_preQ * ftemp;*/ #ifdef NONBE_FIX_ISSUE_2518_TRANSENC_SAT_FIX Ltmp = L_shr( Mult_32_16( Ltmp, *gain_preQ ), sub( add( q_x_tran, 2 ), Q_new ) ); /* (2 + 1 + 14 +shift+Q_AVQ_OUT)-(Q_AVQ_OUT+2-Q_new) = 15 + Q_new + shift */ #else Ltmp = L_shr( Mult_32_16( Ltmp, *gain_preQ ), sub( add( Q_AVQ_OUT_DEC, 2 ), Q_new ) ); /* (2 + 1 + 14 +shift+Q_AVQ_OUT)-(Q_AVQ_OUT+2-Q_new) = 15 + Q_new + shift */ #endif xn[L_SUBFR - 1] = round_fx( L_sub( L_mult( xn[L_SUBFR - 1], 32767 ), Ltmp ) ); /* -> Q_new + shift -1 */ } ELSE { conv_fx( code_preQ, h1, x_tran, L_SUBFR ); #ifdef NONBE_FIX_ISSUE_2518_TRANSENC_SAT_FIX updt_tar_HR_fx( cn, cn, code_preQ, *gain_preQ, sub( Q_new, add( -15 + 2, q_x_tran ) ), L_SUBFR ); updt_tar_HR_fx( xn, xn, x_tran, *gain_preQ, sub( Q_new, add( -15 + 2, q_x_tran ) ), L_SUBFR ); #else updt_tar_HR_fx( cn, cn, code_preQ, *gain_preQ, sub( Q_new, add( -15 + 2, Q_AVQ_OUT_DEC ) ), L_SUBFR ); updt_tar_HR_fx( xn, xn, x_tran, *gain_preQ, sub( Q_new, add( -15 + 2, Q_AVQ_OUT_DEC ) ), L_SUBFR ); #endif *gain_pit = corr_xy1_fx( xn, y1, g_corr, L_SUBFR, 0, &Overflow ); /* Q14 */ move16(); /* clip gain if necessary to avoid problems at decoder */ Loading Loading
lib_enc/enc_higher_acelp_fx.c +0 −42 Original line number Diff line number Diff line Loading @@ -301,7 +301,6 @@ void transf_cdbk_enc_fx( * DCT transform *--------------------------------------------------------------*/ #ifdef NONBE_FIX_ISSUE_2518_TRANSENC_SAT_FIX Word16 q_x_tran; IF( EQ_16( st_fx->element_mode, EVS_MONO ) ) { Loading @@ -314,13 +313,6 @@ void transf_cdbk_enc_fx( q_x_tran = s_min( Q_AVQ_OUT_DEC, norm_arr( x_norm, Nsv * WIDTH_BAND ) ); Copy_Scale_sig_nosat( x_norm, x_tran, Nsv * WIDTH_BAND, q_x_tran ); } #else FOR( i = 0; i < Nsv * WIDTH_BAND; i++ ) { x_tran[i] = shl_sat( x_norm[i], Q_AVQ_OUT_DEC ); move16(); } #endif test(); test(); Loading @@ -336,13 +328,8 @@ void transf_cdbk_enc_fx( edct2_fx( L_SUBFR, 1, x_tran, out32, &Qdct, ip_edct2_64, w_edct2_64_fx ); /*qdct = sub(Q_AVQ_OUT_DEC,qdct+Q_AVQ_OUT_DEC);*/ Qdct = negate( Qdct ); #ifdef NONBE_FIX_ISSUE_2518_TRANSENC_SAT_FIX Copy_Scale_sig_32_16( out32, code_preQ, L_SUBFR, Qdct ); /* Output in q_x_tran */ /*qdct = q_x_tran;*/ #else Copy_Scale_sig_32_16( out32, code_preQ, L_SUBFR, Qdct ); /* Output in Q_AVQ_OUT_DEC */ /*qdct = Q_AVQ_OUT_DEC;*/ #endif } /*--------------------------------------------------------------* Loading @@ -368,27 +355,18 @@ void transf_cdbk_enc_fx( test(); IF( GT_16( st_fx->element_mode, EVS_MONO ) && NE_16( st_fx->coder_type, INACTIVE ) && GE_32( st_fx->core_brate, MIN_BRATE_AVQ_EXC ) && LE_32( st_fx->core_brate, MAX_BRATE_AVQ_EXC_TD ) && !harm_flag_acelp && code_preQ[0] != 0 ) { #ifdef NONBE_FIX_ISSUE_2518_TRANSENC_SAT_FIX IF( GT_16( abs_s( st_fx->last_code_preq ), shl_sat( abs_s( code_preQ[0] ), sub( Q_AVQ_OUT_DEC + 4, q_x_tran ) ) ) ) #else IF( GT_16( abs_s( st_fx->last_code_preq ), shl_sat( abs_s( code_preQ[0] ), 4 ) ) ) #endif { st_fx->mem_preemp_preQ_fx = shr( st_fx->mem_preemp_preQ_fx, 4 ); move16(); } #ifdef NONBE_FIX_ISSUE_2518_TRANSENC_SAT_FIX ELSE IF( GT_16( abs_s( st_fx->last_code_preq ), shl_sat( abs_s( code_preQ[0] ), sub( Q_AVQ_OUT_DEC + 3, q_x_tran ) ) ) ) #else ELSE IF( GT_16( abs_s( st_fx->last_code_preq ), shl_sat( abs_s( code_preQ[0] ), 3 ) ) ) #endif { st_fx->mem_preemp_preQ_fx = shr( st_fx->mem_preemp_preQ_fx, 3 ); move16(); } } #ifdef NONBE_FIX_ISSUE_2518_TRANSENC_SAT_FIX st_fx->last_code_preq = shl_sat( code_preQ[L_SUBFR - 1], sub( 1, q_x_tran ) ); // Q0 ? Q1 move16(); Loading @@ -397,12 +375,6 @@ void transf_cdbk_enc_fx( preemph_fx( code_preQ, FAC_PRE_AVQ_FX, L_SUBFR, &( st_fx->mem_preemp_preQ_fx ) ); st_fx->mem_preemp_preQ_fx = shl_sat( st_fx->mem_preemp_preQ_fx, sub( Q_AVQ_OUT_DEC, q_x_tran ) ); move16(); #else st_fx->last_code_preq = shr( code_preQ[L_SUBFR - 1], 9 ); // Q0 move16(); preemph_fx( code_preQ, FAC_PRE_AVQ_FX, L_SUBFR, &( st_fx->mem_preemp_preQ_fx ) ); #endif /*--------------------------------------------------------------* * For inactive segments Loading @@ -415,36 +387,22 @@ void transf_cdbk_enc_fx( IF( EQ_16( st_fx->coder_type, INACTIVE ) ) { /*ftemp = fcode_preQ[0] *fh1[L_SUBFR-1];*/ #ifdef NONBE_FIX_ISSUE_2518_TRANSENC_SAT_FIX Ltmp = L_mult( code_preQ[0], h1[L_SUBFR - 1] ); /*1+14+shift + q_x_tran */ #else Ltmp = L_mult( code_preQ[0], h1[L_SUBFR - 1] ); /*1+14+shift + Q_AVQ_OUT */ #endif FOR( i = 1; i < L_SUBFR; i++ ) { /*ftemp += fcode_preQ[i] * fh1[L_SUBFR-1-i];*/ Ltmp = L_mac( Ltmp, code_preQ[i], h1[L_SUBFR - 1 - i] ); } /*fxn[L_SUBFR-1] -= *fgain_preQ * ftemp;*/ #ifdef NONBE_FIX_ISSUE_2518_TRANSENC_SAT_FIX Ltmp = L_shr( Mult_32_16( Ltmp, *gain_preQ ), sub( add( q_x_tran, 2 ), Q_new ) ); /* (2 + 1 + 14 +shift+Q_AVQ_OUT)-(Q_AVQ_OUT+2-Q_new) = 15 + Q_new + shift */ #else Ltmp = L_shr( Mult_32_16( Ltmp, *gain_preQ ), sub( add( Q_AVQ_OUT_DEC, 2 ), Q_new ) ); /* (2 + 1 + 14 +shift+Q_AVQ_OUT)-(Q_AVQ_OUT+2-Q_new) = 15 + Q_new + shift */ #endif xn[L_SUBFR - 1] = round_fx( L_sub( L_mult( xn[L_SUBFR - 1], 32767 ), Ltmp ) ); /* -> Q_new + shift -1 */ } ELSE { conv_fx( code_preQ, h1, x_tran, L_SUBFR ); #ifdef NONBE_FIX_ISSUE_2518_TRANSENC_SAT_FIX updt_tar_HR_fx( cn, cn, code_preQ, *gain_preQ, sub( Q_new, add( -15 + 2, q_x_tran ) ), L_SUBFR ); updt_tar_HR_fx( xn, xn, x_tran, *gain_preQ, sub( Q_new, add( -15 + 2, q_x_tran ) ), L_SUBFR ); #else updt_tar_HR_fx( cn, cn, code_preQ, *gain_preQ, sub( Q_new, add( -15 + 2, Q_AVQ_OUT_DEC ) ), L_SUBFR ); updt_tar_HR_fx( xn, xn, x_tran, *gain_preQ, sub( Q_new, add( -15 + 2, Q_AVQ_OUT_DEC ) ), L_SUBFR ); #endif *gain_pit = corr_xy1_fx( xn, y1, g_corr, L_SUBFR, 0, &Overflow ); /* Q14 */ move16(); /* clip gain if necessary to avoid problems at decoder */ Loading