Loading lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -117,6 +117,7 @@ #define FIX_2320_OOB_SCE_SWITCHING /* VA: basop issue 2320: Correct the length of the buffer to be scaled in SCE/CPE switching */ #define FIX_2302_LSF_CDBK_THRESHOLD /* VA: basop issue 2302: fix threshold for LSF Q codebook-type decision */ #define FIX_1500_ISM_MD_DTX /* VA: float issue 1500: fix ISM elevation metadata smoothing in DTX */ #define FIX_2348_REPLACE_FEC_ENC /* VA: basop issue 2348: replace FEC_encode_ivas_fx with FEC_encode_fx */ /* ##################### End NON-BE switches ########################### */ Loading lib_com/prot_fx.h +2 −1 Original line number Diff line number Diff line Loading @@ -10671,6 +10671,7 @@ Word16 msvq_stage1_dct_recalc_candidates_fdcng_wb_fx( Word16 *dist_ptr_e /* i/o: exp for updated MSE vector for stage1 */ ); #ifndef FIX_2348_REPLACE_FEC_ENC void FEC_encode_ivas_fx( BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ const ACELP_config acelp_cfg, /* i/o: configuration of the ACELP */ Loading @@ -10684,7 +10685,7 @@ void FEC_encode_ivas_fx( const Word32 total_brate, /* i : total codec bitrate Q0*/ const Word16 Q_synth /* i : input scaling */ ); #endif ivas_error IGF_Reconfig_fx( IGF_ENC_INSTANCE_HANDLE *hIGFEnc, /* i/o: instance handle of IGF Encoder */ const Word16 igf, /* i : IGF on/off */ Loading lib_enc/FEC_enc_fx.c +18 −10 Original line number Diff line number Diff line Loading @@ -8,7 +8,6 @@ #include "rom_com.h" /* Static table prototypes */ #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ #include "ivas_prot_fx.h" /* Function prototypes */ /*============================================================================*/ Loading Loading @@ -63,6 +62,7 @@ void FEC_encode_fx( move16(); sign = 0; move16(); test(); test(); IF( GT_16( coder_type, UNVOICED ) && LT_16( coder_type, AUDIO ) && acelp_cfg.FEC_mode > 0 ) Loading @@ -70,6 +70,7 @@ void FEC_encode_fx( /*-----------------------------------------------------------------* * encode signal class (not needed for VC mode since it is clearly voiced) (2 bits) *-----------------------------------------------------------------*/ IF( NE_16( coder_type, VOICED ) ) { /* encode signal clas with 2 bits */ Loading @@ -94,12 +95,14 @@ void FEC_encode_fx( index = 3; move16(); } push_indice( hBstr, IND_FEC_CLAS, index, FEC_BITS_CLS ); } /*-----------------------------------------------------------------* * encode frame energy (5 bits) *-----------------------------------------------------------------*/ IF( GT_16( acelp_cfg.FEC_mode, 1 ) ) /* GENERIC and VOICED frames */ { /* frame energy (maximum energy per pitch period for voiced frames or mean energy per sample over 2nd halframe for unvoiced frames) */ Loading @@ -114,14 +117,16 @@ void FEC_encode_fx( Ltmp = Mpy_32_16( enr_lg_ent, enr_lg_frac, LG10_s3_0 ); /* Q14 */ tmpS = extract_h( L_shl( Ltmp, 1 ) ); /* Q15 + 1 -> Q0*/ tmpS = s_min( tmpS, 31 ); tmpS = s_min( tmpS, FEC_ENR_QLIMIT ); tmpS = s_max( tmpS, 0 ); push_indice( hBstr, IND_FEC_ENR, tmpS, FEC_BITS_ENR ); } /*-----------------------------------------------------------------* * Encode last glottal pulse position (8 bits) *-----------------------------------------------------------------*/ IF( GT_16( acelp_cfg.FEC_mode, 2 ) ) /* GENERIC frames */ { /* retrieve the last glottal pulse position of the previous frame */ Loading Loading @@ -262,9 +267,11 @@ void FEC_lsf_estim_enc_fx( move16(); } } /*----------------------------------------------------------------------* * Extrapolate LSF vector *----------------------------------------------------------------------*/ tmp = sub( 32767, alpha ); /* Q15 */ /* extrapolate the old LSF vector */ FOR( i = 0; i < M; i++ ) Loading Loading @@ -292,7 +299,7 @@ void FEC_lsf_estim_enc_fx( return; } #ifndef FIX_2348_REPLACE_FEC_ENC /*-------------------------------------------------------------------* * FEC_encode() * Loading Loading @@ -464,3 +471,4 @@ void FEC_encode_ivas_fx( return; } #endif lib_enc/acelp_core_enc_fx.c +5 −0 Original line number Diff line number Diff line Loading @@ -1369,9 +1369,14 @@ ivas_error acelp_core_enc_ivas_fx( * Encode supplementary information for Frame Error Concealment *-----------------------------------------------------------------*/ #ifndef FIX_2348_REPLACE_FEC_ENC Scale_sig( syn_fx, L_FRAME, sub( s_min( st->Q_syn, Q_new ), st->Q_syn ) ); // min( st->Q_syn, Q_new ) Scale_sig( res_fx, st->L_frame, sub( s_min( st->Q_syn, Q_new ), Q_new ) ); // min( st->Q_syn, Q_new ) FEC_encode_ivas_fx( hBstr, st->acelp_cfg, syn_fx, st->coder_type, st->clas, pitch_buf, res_fx, &st->Last_pulse_pos, st->L_frame, st->total_brate, s_min( st->Q_syn, Q_new ) ); #else FEC_encode_fx( hBstr, st->acelp_cfg, syn_fx, st->coder_type, st->clas, pitch_buf, res_fx, &st->Last_pulse_pos, st->L_frame, st->total_brate, add( st->Q_syn, 1 ), 0 ); #endif IF( st->hBWE_TD != NULL ) { IF( EQ_16( st->L_frame, L_FRAME ) ) Loading Loading
lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -117,6 +117,7 @@ #define FIX_2320_OOB_SCE_SWITCHING /* VA: basop issue 2320: Correct the length of the buffer to be scaled in SCE/CPE switching */ #define FIX_2302_LSF_CDBK_THRESHOLD /* VA: basop issue 2302: fix threshold for LSF Q codebook-type decision */ #define FIX_1500_ISM_MD_DTX /* VA: float issue 1500: fix ISM elevation metadata smoothing in DTX */ #define FIX_2348_REPLACE_FEC_ENC /* VA: basop issue 2348: replace FEC_encode_ivas_fx with FEC_encode_fx */ /* ##################### End NON-BE switches ########################### */ Loading
lib_com/prot_fx.h +2 −1 Original line number Diff line number Diff line Loading @@ -10671,6 +10671,7 @@ Word16 msvq_stage1_dct_recalc_candidates_fdcng_wb_fx( Word16 *dist_ptr_e /* i/o: exp for updated MSE vector for stage1 */ ); #ifndef FIX_2348_REPLACE_FEC_ENC void FEC_encode_ivas_fx( BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ const ACELP_config acelp_cfg, /* i/o: configuration of the ACELP */ Loading @@ -10684,7 +10685,7 @@ void FEC_encode_ivas_fx( const Word32 total_brate, /* i : total codec bitrate Q0*/ const Word16 Q_synth /* i : input scaling */ ); #endif ivas_error IGF_Reconfig_fx( IGF_ENC_INSTANCE_HANDLE *hIGFEnc, /* i/o: instance handle of IGF Encoder */ const Word16 igf, /* i : IGF on/off */ Loading
lib_enc/FEC_enc_fx.c +18 −10 Original line number Diff line number Diff line Loading @@ -8,7 +8,6 @@ #include "rom_com.h" /* Static table prototypes */ #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ #include "ivas_prot_fx.h" /* Function prototypes */ /*============================================================================*/ Loading Loading @@ -63,6 +62,7 @@ void FEC_encode_fx( move16(); sign = 0; move16(); test(); test(); IF( GT_16( coder_type, UNVOICED ) && LT_16( coder_type, AUDIO ) && acelp_cfg.FEC_mode > 0 ) Loading @@ -70,6 +70,7 @@ void FEC_encode_fx( /*-----------------------------------------------------------------* * encode signal class (not needed for VC mode since it is clearly voiced) (2 bits) *-----------------------------------------------------------------*/ IF( NE_16( coder_type, VOICED ) ) { /* encode signal clas with 2 bits */ Loading @@ -94,12 +95,14 @@ void FEC_encode_fx( index = 3; move16(); } push_indice( hBstr, IND_FEC_CLAS, index, FEC_BITS_CLS ); } /*-----------------------------------------------------------------* * encode frame energy (5 bits) *-----------------------------------------------------------------*/ IF( GT_16( acelp_cfg.FEC_mode, 1 ) ) /* GENERIC and VOICED frames */ { /* frame energy (maximum energy per pitch period for voiced frames or mean energy per sample over 2nd halframe for unvoiced frames) */ Loading @@ -114,14 +117,16 @@ void FEC_encode_fx( Ltmp = Mpy_32_16( enr_lg_ent, enr_lg_frac, LG10_s3_0 ); /* Q14 */ tmpS = extract_h( L_shl( Ltmp, 1 ) ); /* Q15 + 1 -> Q0*/ tmpS = s_min( tmpS, 31 ); tmpS = s_min( tmpS, FEC_ENR_QLIMIT ); tmpS = s_max( tmpS, 0 ); push_indice( hBstr, IND_FEC_ENR, tmpS, FEC_BITS_ENR ); } /*-----------------------------------------------------------------* * Encode last glottal pulse position (8 bits) *-----------------------------------------------------------------*/ IF( GT_16( acelp_cfg.FEC_mode, 2 ) ) /* GENERIC frames */ { /* retrieve the last glottal pulse position of the previous frame */ Loading Loading @@ -262,9 +267,11 @@ void FEC_lsf_estim_enc_fx( move16(); } } /*----------------------------------------------------------------------* * Extrapolate LSF vector *----------------------------------------------------------------------*/ tmp = sub( 32767, alpha ); /* Q15 */ /* extrapolate the old LSF vector */ FOR( i = 0; i < M; i++ ) Loading Loading @@ -292,7 +299,7 @@ void FEC_lsf_estim_enc_fx( return; } #ifndef FIX_2348_REPLACE_FEC_ENC /*-------------------------------------------------------------------* * FEC_encode() * Loading Loading @@ -464,3 +471,4 @@ void FEC_encode_ivas_fx( return; } #endif
lib_enc/acelp_core_enc_fx.c +5 −0 Original line number Diff line number Diff line Loading @@ -1369,9 +1369,14 @@ ivas_error acelp_core_enc_ivas_fx( * Encode supplementary information for Frame Error Concealment *-----------------------------------------------------------------*/ #ifndef FIX_2348_REPLACE_FEC_ENC Scale_sig( syn_fx, L_FRAME, sub( s_min( st->Q_syn, Q_new ), st->Q_syn ) ); // min( st->Q_syn, Q_new ) Scale_sig( res_fx, st->L_frame, sub( s_min( st->Q_syn, Q_new ), Q_new ) ); // min( st->Q_syn, Q_new ) FEC_encode_ivas_fx( hBstr, st->acelp_cfg, syn_fx, st->coder_type, st->clas, pitch_buf, res_fx, &st->Last_pulse_pos, st->L_frame, st->total_brate, s_min( st->Q_syn, Q_new ) ); #else FEC_encode_fx( hBstr, st->acelp_cfg, syn_fx, st->coder_type, st->clas, pitch_buf, res_fx, &st->Last_pulse_pos, st->L_frame, st->total_brate, add( st->Q_syn, 1 ), 0 ); #endif IF( st->hBWE_TD != NULL ) { IF( EQ_16( st->L_frame, L_FRAME ) ) Loading