diff --git a/Workspace_msvc/lib_enc.vcxproj b/Workspace_msvc/lib_enc.vcxproj
index 43e7af2af14af672f137859d9dd72b04aace709b..88c7c4098d4c37a50ebfd61fcdb68045f6d61412 100644
--- a/Workspace_msvc/lib_enc.vcxproj
+++ b/Workspace_msvc/lib_enc.vcxproj
@@ -408,25 +408,15 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/Workspace_msvc/lib_enc.vcxproj.filters b/Workspace_msvc/lib_enc.vcxproj.filters
index abc2ccec7162cae15eb0dd94fbadef0a8deabae2..c109732e95e211ffcb16435a6931959a8640029b 100644
--- a/Workspace_msvc/lib_enc.vcxproj.filters
+++ b/Workspace_msvc/lib_enc.vcxproj.filters
@@ -160,15 +160,6 @@
enc_all_c
-
- enc_all_c
-
-
- enc_all_c
-
-
- enc_all_c
-
enc_all_c
@@ -307,36 +298,6 @@
enc_all_c
-
- enc_all_c
-
-
- enc_all_c
-
-
- enc_all_c
-
-
- enc_all_c
-
-
- enc_all_c
-
-
- enc_all_c
-
-
- enc_all_c
-
-
- enc_all_c
-
-
- enc_all_c
-
-
- enc_all_c
-
enc_all_c
diff --git a/lib_enc/acelp_core_enc_fx.c b/lib_enc/acelp_core_enc_fx.c
index 55d440912ec0d92fa4e384fcfe6e1a91b8a70979..9497234a13a2aff318ddfddbc7944daba6f82831 100644
--- a/lib_enc/acelp_core_enc_fx.c
+++ b/lib_enc/acelp_core_enc_fx.c
@@ -1398,6 +1398,12 @@ ivas_error acelp_core_enc_ivas_fx(
v_multc_fixed_16_16( res_fx, att_fx, res_fx, st->L_frame );
}
+ // Scaling Aq and Aw to Q12
+ FOR( Word16 k = 0; k < NB_SUBFR16k; k++ )
+ {
+ Scale_sig( &Aq[( M + 1 ) * k], M + 1, sub( norm_s( Aq[( M + 1 ) * k] ), 2 ) );
+ Scale_sig( &Aw[( M + 1 ) * k], M + 1, sub( norm_s( Aw[( M + 1 ) * k] ), 2 ) );
+ }
/*-----------------------------------------------------------------*
* Determine TC subframe classification
*-----------------------------------------------------------------*/
diff --git a/lib_enc/ivas_stereo_dmx_evs.c b/lib_enc/ivas_stereo_dmx_evs.c
index 4ef16ce9f9478c3996a549eb09447a7715e51be3..1f54e0545df3bb1ffe65d9129ac4e605edf42aea 100644
--- a/lib_enc/ivas_stereo_dmx_evs.c
+++ b/lib_enc/ivas_stereo_dmx_evs.c
@@ -1945,7 +1945,7 @@ void stereo_dmx_evs_enc_fx(
move16();
}
- create_M_signal_fx( data_fx[0], data_fx[1], dmx_poc_data, dmx_weight, input_frame, hStereoDmxEVS->s_wnd_fx,
+ create_M_signal_fx( data_fx[0], data_fx[1], dmx_poc_data, L_deposit_h( dmx_weight ), input_frame, hStereoDmxEVS->s_wnd_fx,
hStereoDmxEVS->dmx_weight_fx, hStereoDmxEVS->pre_dmx_energy_fx, hStereoDmxEVS->pre_dmx_energy_fx_e, hStereoDmxEVS->aux_dmx_energy_fx, hStereoDmxEVS->aux_dmx_energy_fx_e );
// Downscaling signals to avoid accumulation overflows
diff --git a/lib_enc/ivas_stereo_td_enc.c b/lib_enc/ivas_stereo_td_enc.c
index a06c30301f01b177e5479575a7f2a72e33203533..02bdd15613093d4aea1f1b8bb6e51fd00be4db50 100644
--- a/lib_enc/ivas_stereo_td_enc.c
+++ b/lib_enc/ivas_stereo_td_enc.c
@@ -473,7 +473,7 @@ void tdm_configure_enc_fx(
}
}
ELSE IF( ( LT_16( sts[1]->coder_type, AUDIO ) && NE_16( sts[1]->coder_type, UNVOICED ) ) || /* TC and VC are not supported in secondary channel */
- ( ( EQ_16( sts[1]->coder_type, AUDIO ) && LE_32( hCPE->element_brate, IVAS_24k4 ) ) || ( EQ_16( sts[0]->sp_aud_decision1, 1 ) && GE_32( hCPE->element_brate, IVAS_16k4 ) ) || ( EQ_16( sts[1]->sp_aud_decision0, 1 ) && GE_32( hCPE->element_brate, IVAS_13k2 ) ) ) )
+ ( ( EQ_16( sts[1]->coder_type, AUDIO ) && LE_32( hCPE->element_brate, IVAS_24k4 ) ) || ( EQ_16( sts[0]->sp_aud_decision1, 1 ) && GE_32( hCPE->element_brate, IVAS_16k4 ) ) || ( EQ_16( sts[1]->sp_aud_decision0, 1 ) && GT_32( hCPE->element_brate, IVAS_13k2 ) ) ) )
{
sts[1]->coder_type = GENERIC;
move16();
@@ -485,7 +485,7 @@ void tdm_configure_enc_fx(
}
test();
- IF( GE_32( hCPE->element_brate, IVAS_24k4 ) && EQ_16( hCPE->hStereoClassif->lrtd_mode, 1 ) )
+ IF( GT_32( hCPE->element_brate, IVAS_24k4 ) && EQ_16( hCPE->hStereoClassif->lrtd_mode, 1 ) )
{
if ( EQ_16( sts[1]->coder_type, UNVOICED ) )
{
diff --git a/lib_enc/tcq_core_enc.c b/lib_enc/tcq_core_enc.c
deleted file mode 100644
index d54084f0bc6c24a06147b1d7ab2b249bc7ca568d..0000000000000000000000000000000000000000
--- a/lib_enc/tcq_core_enc.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/******************************************************************************************************
-
- (C) 2022-2024 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB,
- Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
- Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
- Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
- contributors to this repository. All Rights Reserved.
-
- This software is protected by copyright law and by international treaties.
- The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB,
- Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
- Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
- Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
- contributors to this repository retain full ownership rights in their respective contributions in
- the software. This notice grants no license of any kind, including but not limited to patent
- license, nor is any license granted by implication, estoppel or otherwise.
-
- Contributors are required to enter into the IVAS codec Public Collaboration agreement before making
- contributions.
-
- This software is provided "AS IS", without any express or implied warranties. The software is in the
- development stage. It is intended exclusively for experts who have experience with such software and
- solely for the purpose of inspection. All implied warranties of non-infringement, merchantability
- and fitness for a particular purpose are hereby disclaimed and excluded.
-
- Any dispute, controversy or claim arising under or in relation to providing this software shall be
- submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in
- accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and
- the United Nations Convention on Contracts on the International Sales of Goods.
-
-*******************************************************************************************************/
-
-/*====================================================================================
- EVS Codec 3GPP TS26.443 Nov 04, 2021. Version 12.14.0 / 13.10.0 / 14.6.0 / 15.4.0 / 16.3.0
- ====================================================================================*/
-
-#include
-#include "options.h"
-#include "rom_com.h"
-#include "prot.h"
-#include "cnst.h"
-#include "basop_util.h"
-#include "basop_proto_func.h"
-#include "wmc_auto.h"
-
-/*---------------------------------------------------------------------*
- * tcq_core_LR_enc()
- *
- * Main Generic Audio Encoder Routine for LR-MDCT
- *---------------------------------------------------------------------*/
diff --git a/lib_enc/tcx_ltp_enc.c b/lib_enc/tcx_ltp_enc.c
deleted file mode 100644
index 8c3c60e18ff0099bcd3230c9c2514dc481606cc6..0000000000000000000000000000000000000000
--- a/lib_enc/tcx_ltp_enc.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/******************************************************************************************************
-
- (C) 2022-2024 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB,
- Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
- Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
- Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
- contributors to this repository. All Rights Reserved.
-
- This software is protected by copyright law and by international treaties.
- The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB,
- Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
- Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
- Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
- contributors to this repository retain full ownership rights in their respective contributions in
- the software. This notice grants no license of any kind, including but not limited to patent
- license, nor is any license granted by implication, estoppel or otherwise.
-
- Contributors are required to enter into the IVAS codec Public Collaboration agreement before making
- contributions.
-
- This software is provided "AS IS", without any express or implied warranties. The software is in the
- development stage. It is intended exclusively for experts who have experience with such software and
- solely for the purpose of inspection. All implied warranties of non-infringement, merchantability
- and fitness for a particular purpose are hereby disclaimed and excluded.
-
- Any dispute, controversy or claim arising under or in relation to providing this software shall be
- submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in
- accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and
- the United Nations Convention on Contracts on the International Sales of Goods.
-
-*******************************************************************************************************/
-
-/*====================================================================================
- EVS Codec 3GPP TS26.443 Nov 04, 2021. Version 12.14.0 / 13.10.0 / 14.6.0 / 15.4.0 / 16.3.0
- ====================================================================================*/
-
-#include
-#include "options.h"
-#include
-#include "prot.h"
-#include "rom_enc.h"
-#include "rom_com.h"
-#include "wmc_auto.h"
diff --git a/lib_enc/tcx_utils_enc.c b/lib_enc/tcx_utils_enc.c
deleted file mode 100644
index cf330dfa2b09c5952b84e5bdd8a907070bc65201..0000000000000000000000000000000000000000
--- a/lib_enc/tcx_utils_enc.c
+++ /dev/null
@@ -1,259 +0,0 @@
-/******************************************************************************************************
-
- (C) 2022-2024 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB,
- Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
- Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
- Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
- contributors to this repository. All Rights Reserved.
-
- This software is protected by copyright law and by international treaties.
- The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB,
- Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
- Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
- Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
- contributors to this repository retain full ownership rights in their respective contributions in
- the software. This notice grants no license of any kind, including but not limited to patent
- license, nor is any license granted by implication, estoppel or otherwise.
-
- Contributors are required to enter into the IVAS codec Public Collaboration agreement before making
- contributions.
-
- This software is provided "AS IS", without any express or implied warranties. The software is in the
- development stage. It is intended exclusively for experts who have experience with such software and
- solely for the purpose of inspection. All implied warranties of non-infringement, merchantability
- and fitness for a particular purpose are hereby disclaimed and excluded.
-
- Any dispute, controversy or claim arising under or in relation to providing this software shall be
- submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in
- accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and
- the United Nations Convention on Contracts on the International Sales of Goods.
-
-*******************************************************************************************************/
-
-/*====================================================================================
- EVS Codec 3GPP TS26.443 Nov 04, 2021. Version 12.14.0 / 13.10.0 / 14.6.0 / 15.4.0 / 16.3.0
- ====================================================================================*/
-
-#include
-#include
-#include "options.h"
-#include
-#include "prot.h"
-#include "prot_fx.h"
-#include "prot_fx_enc.h"
-#include "rom_com.h"
-#include "cnst.h"
-#include "wmc_auto.h"
-#include "ivas_prot.h"
-
-#define ONE_POINT_ONE_FIVE_Q7 147
-#define ONE_POINT_ONE_FIVE_Q23 9646899
-
-
-/*---------------------------------------------------------------------*
- * AdaptLowFreqEmph()
- *
- *
- *---------------------------------------------------------------------*/
-
-
-/*---------------------------------------------------------------------*
- * ProcessIGF_ivas_fx()
- *
- *
- *---------------------------------------------------------------------*/
-void ProcessIGF_ivas_fx(
- Encoder_State *st, /* i : Encoder state */
- Word32 *pMDCTSpectrum, /* i : MDCT spectrum (*q_spectrum) */
- const Word32 *pITFMDCTSpectrum, /* i : MDCT spectrum fir ITF */
- Word16 *q_spectrum, /* i/o: Q of spectrum */
- Word32 *pPowerSpectrum, /* i : MDCT^2 + MDST^2 spectrum, or estimate (*q_powerSpec) */
- Word16 *exp_powerSpec, /* i/o: Q of power spectrum */
- const Word16 isTCX20, /* i : flag indicating if the input is TCX20 or TCX10/2xTCX5 */
- const Word16 frameno, /* i : flag indicating index of current subframe */
- const Word16 sp_aud_decision0, /* i : first stage switching decision */
- const Word16 vad_hover_flag /* i : VAD hangover flag */
-)
-{
- Word16 igfGridIdx, isIndepFlag, bsBits, pBsStart, curr_order;
- Word16 predictionGain;
- Word16 A[ITF_MAX_FILTER_ORDER + 1];
- Word16 q_A;
-
- IGF_ENC_INSTANCE_HANDLE hIGFEnc = st->hIGFEnc;
- BSTR_ENC_HANDLE hBstr = st->hBstr;
-
- isIndepFlag = 1;
- move16();
- test();
- IF( st->last_core == ACELP_CORE && isTCX20 )
- {
- igfGridIdx = IGF_GRID_LB_TRAN;
- move16();
- }
- ELSE IF( isTCX20 )
- {
- igfGridIdx = IGF_GRID_LB_NORM;
- move16();
- }
- ELSE
- {
- /* It is short block */
- igfGridIdx = IGF_GRID_LB_SHORT;
- move16();
- if ( EQ_16( frameno, 1 ) )
- {
- isIndepFlag = 0;
- move16();
- }
- }
-
- IGFSaveSpectrumForITF_ivas_fx( hIGFEnc, igfGridIdx, pITFMDCTSpectrum, sub( Q31, *q_spectrum ) );
-
- IGFEncApplyMono_ivas_fx( st, igfGridIdx, pMDCTSpectrum, sub( Q31, *q_spectrum ), pPowerSpectrum, exp_powerSpec, isTCX20, st->hTcxEnc->fUseTns[frameno], sp_aud_decision0, vad_hover_flag );
-
- curr_order = 0;
- move16();
- predictionGain = 0;
- move16();
- q_A = 0;
- move16();
-
- ITF_Detect_fx( hIGFEnc->spec_be_igf, hIGFEnc->infoStartLine, hIGFEnc->infoStopLine, 8 /*maxOrder*/, A, &q_A, &predictionGain, &curr_order, sub( 31, hIGFEnc->spec_be_igf_e ) );
-
- test();
- IF( LT_32( L_deposit_l( hIGFEnc->tns_predictionGain ), 9646899 /* 1.15 in Q23 */ ) && LT_32( L_deposit_l( predictionGain ), 9646899 /* 1.15 in Q23 */ ) )
- {
- hIGFEnc->flatteningTrigger = 1;
- move16();
- }
- ELSE
- {
- hIGFEnc->flatteningTrigger = 0;
- move16();
- }
-
- hIGFEnc->infoTotalBitsPerFrameWritten = 0;
- move16();
-
- IF( isTCX20 )
- {
- IGFEncWriteBitstream_ivas_fx( hIGFEnc, NULL, &hIGFEnc->infoTotalBitsPerFrameWritten, igfGridIdx, isIndepFlag );
- }
- ELSE
- {
- pBsStart = hBstr->nb_ind_tot;
- move16();
-
- IGFEncWriteBitstream_ivas_fx( hIGFEnc, hBstr, &hIGFEnc->infoTotalBitsPerFrameWritten, igfGridIdx, isIndepFlag );
-
- bsBits = sub( hBstr->nb_ind_tot, pBsStart );
- IGFEncConcatenateBitstream( hIGFEnc, bsBits, hBstr );
- }
-
- return;
-}
-
-/*---------------------------------------------------------------------*
- * ProcessStereoIGF()
- *
- *
- *---------------------------------------------------------------------*/
-
-void ProcessStereoIGF_fx(
- STEREO_MDCT_ENC_DATA_HANDLE hStereoMdct,
- Encoder_State *sts[CPE_CHANNELS], /* i : Encoder state */
- Word16 ms_mask[2][MAX_SFB], /* i : bandwise MS mask */
- Word32 *pITFMDCTSpectrum_fx[CPE_CHANNELS][NB_DIV], /* i : MDCT spectrum fir ITF */
- Word16 q_pITFMDCTSpectrum_1,
- Word16 q_pITFMDCTSpectrum_2,
- Word32 *pPowerSpectrum_fx[CPE_CHANNELS], /* i/o: MDCT^2 + MDST^2 spectrum, or estimate */
- Word32 *pPowerSpectrumMsInv_fx[CPE_CHANNELS][NB_DIV], /* i : inverse power spectrum */
- Word32 *inv_spectrum_fx[CPE_CHANNELS][NB_DIV], /* i : inverse spectrum */
- const Word16 frameno, /* i : flag indicating index of current subfr. */
- const Word16 sp_aud_decision0, /* i : sp_aud_decision0 */
- const Word32 element_brate /* i : element bitrate */
-)
-{
- Word16 ch, igfGridIdx, isIndepFlag, bsBits, pBsStart, curr_order;
- Word16 predictionGain;
- Word16 A[ITF_MAX_FILTER_ORDER + 1];
- Word16 Q_A;
- IGF_ENC_INSTANCE_HANDLE hIGFEnc[CPE_CHANNELS];
- BSTR_ENC_HANDLE hBstr;
- hIGFEnc[0] = sts[0]->hIGFEnc;
- hIGFEnc[1] = sts[1]->hIGFEnc;
-
- isIndepFlag = 1;
- move16();
-
- test();
- IF( sts[0]->last_core == ACELP_CORE && EQ_16( sts[0]->core, TCX_20_CORE ) )
- {
- igfGridIdx = IGF_GRID_LB_TRAN;
- }
- ELSE IF( EQ_16( sts[0]->core, TCX_20_CORE ) )
- {
- igfGridIdx = IGF_GRID_LB_NORM;
- }
- ELSE
- {
- /* It is short block */
- igfGridIdx = IGF_GRID_LB_SHORT;
- if ( EQ_16( frameno, 1 ) )
- {
- isIndepFlag = 0;
- move16();
- }
- }
- move16();
-
- IGFSaveSpectrumForITF_ivas_fx( hIGFEnc[0], igfGridIdx, pITFMDCTSpectrum_fx[0][frameno], sub( Q31, q_pITFMDCTSpectrum_1 ) );
-
- IGFSaveSpectrumForITF_ivas_fx( hIGFEnc[1], igfGridIdx, pITFMDCTSpectrum_fx[1][frameno], sub( Q31, q_pITFMDCTSpectrum_2 ) );
-
-
- IGFEncApplyStereo_fx( hStereoMdct, ms_mask, hIGFEnc, igfGridIdx, sts, pPowerSpectrum_fx, pPowerSpectrumMsInv_fx, inv_spectrum_fx, frameno, sp_aud_decision0, element_brate );
-
- FOR( ch = 0; ch < CPE_CHANNELS; ch++ )
- {
- curr_order = 0;
- move16();
-
- Q_A = 0;
- move16();
-
- predictionGain = 0;
- move16();
-
- ITF_Detect_fx( hIGFEnc[ch]->spec_be_igf, hIGFEnc[ch]->infoStartLine, hIGFEnc[ch]->infoStopLine, 8 /*maxOrder*/, A, &Q_A, &predictionGain, &curr_order, sub( 31, hIGFEnc[ch]->spec_be_igf_e ) );
-
- test();
- hIGFEnc[ch]->flatteningTrigger = LT_32( hIGFEnc[ch]->tns_predictionGain, ONE_POINT_ONE_FIVE_Q23 ) && LT_32( predictionGain, ONE_POINT_ONE_FIVE_Q7 );
- move16();
-
- hIGFEnc[ch]->infoTotalBitsPerFrameWritten = 0;
- move16();
-
- IF( EQ_16( sts[ch]->core, TCX_20_CORE ) )
- {
- IGFEncWriteBitstream_ivas_fx( hIGFEnc[ch], NULL, &hIGFEnc[ch]->infoTotalBitsPerFrameWritten, igfGridIdx, isIndepFlag );
- }
- ELSE
- {
- hBstr = sts[ch]->hBstr;
- pBsStart = hBstr->nb_ind_tot;
- move16();
-
- if ( ch > 0 )
- {
- hBstr->ind_list = sts[0]->hBstr->ind_list + sts[0]->hBstr->nb_ind_tot;
- }
- IGFEncWriteBitstream_ivas_fx( hIGFEnc[ch], hBstr, &hIGFEnc[ch]->infoTotalBitsPerFrameWritten, igfGridIdx, isIndepFlag );
-
- bsBits = sub( hBstr->nb_ind_tot, pBsStart );
- IGFEncConcatenateBitstream( hIGFEnc[ch], bsBits, hBstr );
- }
- }
- return;
-}
diff --git a/lib_enc/tcx_utils_enc_fx.c b/lib_enc/tcx_utils_enc_fx.c
index 7098e4502c1311f8ef380b390cae106204e5c93b..cc36da486d9bc11e92631d0aa3d6746ecf83c86a 100644
--- a/lib_enc/tcx_utils_enc_fx.c
+++ b/lib_enc/tcx_utils_enc_fx.c
@@ -15,10 +15,14 @@
#include "rom_com.h"
#include "prot_fx.h" /* Function prototypes */
#include "prot_fx_enc.h" /* Function prototypes */
+#include "ivas_prot_fx.h"
#define inv_int InvIntTable
extern const Word16 int_sqr[17];
+#define ONE_POINT_ONE_FIVE_Q7 147
+#define ONE_POINT_ONE_FIVE_Q23 9646899
+
static Word16 quantize( Word32 x, Word16 invGain, Word16 shift, Word32 offset )
{
Word16 tmp16;
@@ -3713,3 +3717,204 @@ void attenuateNbSpectrum_fx( Word16 L_frame, Word32 *spectrum )
att = mult_r( att, att );
}
}
+
+/*---------------------------------------------------------------------*
+ * ProcessIGF_ivas_fx()
+ *
+ *
+ *---------------------------------------------------------------------*/
+void ProcessIGF_ivas_fx(
+ Encoder_State *st, /* i : Encoder state */
+ Word32 *pMDCTSpectrum, /* i : MDCT spectrum (*q_spectrum) */
+ const Word32 *pITFMDCTSpectrum, /* i : MDCT spectrum fir ITF */
+ Word16 *q_spectrum, /* i/o: Q of spectrum */
+ Word32 *pPowerSpectrum, /* i : MDCT^2 + MDST^2 spectrum, or estimate (*q_powerSpec) */
+ Word16 *exp_powerSpec, /* i/o: Q of power spectrum */
+ const Word16 isTCX20, /* i : flag indicating if the input is TCX20 or TCX10/2xTCX5 */
+ const Word16 frameno, /* i : flag indicating index of current subframe */
+ const Word16 sp_aud_decision0, /* i : first stage switching decision */
+ const Word16 vad_hover_flag /* i : VAD hangover flag */
+)
+{
+ Word16 igfGridIdx, isIndepFlag, bsBits, pBsStart, curr_order;
+ Word16 predictionGain;
+ Word16 A[ITF_MAX_FILTER_ORDER + 1];
+ Word16 q_A;
+
+ IGF_ENC_INSTANCE_HANDLE hIGFEnc = st->hIGFEnc;
+ BSTR_ENC_HANDLE hBstr = st->hBstr;
+
+ isIndepFlag = 1;
+ move16();
+ test();
+ IF( st->last_core == ACELP_CORE && isTCX20 )
+ {
+ igfGridIdx = IGF_GRID_LB_TRAN;
+ move16();
+ }
+ ELSE IF( isTCX20 )
+ {
+ igfGridIdx = IGF_GRID_LB_NORM;
+ move16();
+ }
+ ELSE
+ {
+ /* It is short block */
+ igfGridIdx = IGF_GRID_LB_SHORT;
+ move16();
+ if ( EQ_16( frameno, 1 ) )
+ {
+ isIndepFlag = 0;
+ move16();
+ }
+ }
+
+ IGFSaveSpectrumForITF_ivas_fx( hIGFEnc, igfGridIdx, pITFMDCTSpectrum, sub( Q31, *q_spectrum ) );
+
+ IGFEncApplyMono_ivas_fx( st, igfGridIdx, pMDCTSpectrum, sub( Q31, *q_spectrum ), pPowerSpectrum, exp_powerSpec, isTCX20, st->hTcxEnc->fUseTns[frameno], sp_aud_decision0, vad_hover_flag );
+
+ curr_order = 0;
+ move16();
+ predictionGain = 0;
+ move16();
+ q_A = 0;
+ move16();
+
+ ITF_Detect_fx( hIGFEnc->spec_be_igf, hIGFEnc->infoStartLine, hIGFEnc->infoStopLine, 8 /*maxOrder*/, A, &q_A, &predictionGain, &curr_order, sub( 31, hIGFEnc->spec_be_igf_e ) );
+
+ test();
+ IF( LT_32( L_deposit_l( hIGFEnc->tns_predictionGain ), 9646899 /* 1.15 in Q23 */ ) && LT_32( L_deposit_l( predictionGain ), 9646899 /* 1.15 in Q23 */ ) )
+ {
+ hIGFEnc->flatteningTrigger = 1;
+ move16();
+ }
+ ELSE
+ {
+ hIGFEnc->flatteningTrigger = 0;
+ move16();
+ }
+
+ hIGFEnc->infoTotalBitsPerFrameWritten = 0;
+ move16();
+
+ IF( isTCX20 )
+ {
+ IGFEncWriteBitstream_ivas_fx( hIGFEnc, NULL, &hIGFEnc->infoTotalBitsPerFrameWritten, igfGridIdx, isIndepFlag );
+ }
+ ELSE
+ {
+ pBsStart = hBstr->nb_ind_tot;
+ move16();
+
+ IGFEncWriteBitstream_ivas_fx( hIGFEnc, hBstr, &hIGFEnc->infoTotalBitsPerFrameWritten, igfGridIdx, isIndepFlag );
+
+ bsBits = sub( hBstr->nb_ind_tot, pBsStart );
+ IGFEncConcatenateBitstream( hIGFEnc, bsBits, hBstr );
+ }
+
+ return;
+}
+
+/*---------------------------------------------------------------------*
+ * ProcessStereoIGF()
+ *
+ *
+ *---------------------------------------------------------------------*/
+
+void ProcessStereoIGF_fx(
+ STEREO_MDCT_ENC_DATA_HANDLE hStereoMdct,
+ Encoder_State *sts[CPE_CHANNELS], /* i : Encoder state */
+ Word16 ms_mask[2][MAX_SFB], /* i : bandwise MS mask */
+ Word32 *pITFMDCTSpectrum_fx[CPE_CHANNELS][NB_DIV], /* i : MDCT spectrum fir ITF */
+ Word16 q_pITFMDCTSpectrum_1,
+ Word16 q_pITFMDCTSpectrum_2,
+ Word32 *pPowerSpectrum_fx[CPE_CHANNELS], /* i/o: MDCT^2 + MDST^2 spectrum, or estimate */
+ Word32 *pPowerSpectrumMsInv_fx[CPE_CHANNELS][NB_DIV], /* i : inverse power spectrum */
+ Word32 *inv_spectrum_fx[CPE_CHANNELS][NB_DIV], /* i : inverse spectrum */
+ const Word16 frameno, /* i : flag indicating index of current subfr. */
+ const Word16 sp_aud_decision0, /* i : sp_aud_decision0 */
+ const Word32 element_brate /* i : element bitrate */
+)
+{
+ Word16 ch, igfGridIdx, isIndepFlag, bsBits, pBsStart, curr_order;
+ Word16 predictionGain;
+ Word16 A[ITF_MAX_FILTER_ORDER + 1];
+ Word16 Q_A;
+ IGF_ENC_INSTANCE_HANDLE hIGFEnc[CPE_CHANNELS];
+ BSTR_ENC_HANDLE hBstr;
+ hIGFEnc[0] = sts[0]->hIGFEnc;
+ hIGFEnc[1] = sts[1]->hIGFEnc;
+
+ isIndepFlag = 1;
+ move16();
+
+ test();
+ IF( sts[0]->last_core == ACELP_CORE && EQ_16( sts[0]->core, TCX_20_CORE ) )
+ {
+ igfGridIdx = IGF_GRID_LB_TRAN;
+ }
+ ELSE IF( EQ_16( sts[0]->core, TCX_20_CORE ) )
+ {
+ igfGridIdx = IGF_GRID_LB_NORM;
+ }
+ ELSE
+ {
+ /* It is short block */
+ igfGridIdx = IGF_GRID_LB_SHORT;
+ if ( EQ_16( frameno, 1 ) )
+ {
+ isIndepFlag = 0;
+ move16();
+ }
+ }
+ move16();
+
+ IGFSaveSpectrumForITF_ivas_fx( hIGFEnc[0], igfGridIdx, pITFMDCTSpectrum_fx[0][frameno], sub( Q31, q_pITFMDCTSpectrum_1 ) );
+
+ IGFSaveSpectrumForITF_ivas_fx( hIGFEnc[1], igfGridIdx, pITFMDCTSpectrum_fx[1][frameno], sub( Q31, q_pITFMDCTSpectrum_2 ) );
+
+
+ IGFEncApplyStereo_fx( hStereoMdct, ms_mask, hIGFEnc, igfGridIdx, sts, pPowerSpectrum_fx, pPowerSpectrumMsInv_fx, inv_spectrum_fx, frameno, sp_aud_decision0, element_brate );
+
+ FOR( ch = 0; ch < CPE_CHANNELS; ch++ )
+ {
+ curr_order = 0;
+ move16();
+
+ Q_A = 0;
+ move16();
+
+ predictionGain = 0;
+ move16();
+
+ ITF_Detect_fx( hIGFEnc[ch]->spec_be_igf, hIGFEnc[ch]->infoStartLine, hIGFEnc[ch]->infoStopLine, 8 /*maxOrder*/, A, &Q_A, &predictionGain, &curr_order, sub( 31, hIGFEnc[ch]->spec_be_igf_e ) );
+
+ test();
+ hIGFEnc[ch]->flatteningTrigger = LT_32( hIGFEnc[ch]->tns_predictionGain, ONE_POINT_ONE_FIVE_Q23 ) && LT_32( predictionGain, ONE_POINT_ONE_FIVE_Q7 );
+ move16();
+
+ hIGFEnc[ch]->infoTotalBitsPerFrameWritten = 0;
+ move16();
+
+ IF( EQ_16( sts[ch]->core, TCX_20_CORE ) )
+ {
+ IGFEncWriteBitstream_ivas_fx( hIGFEnc[ch], NULL, &hIGFEnc[ch]->infoTotalBitsPerFrameWritten, igfGridIdx, isIndepFlag );
+ }
+ ELSE
+ {
+ hBstr = sts[ch]->hBstr;
+ pBsStart = hBstr->nb_ind_tot;
+ move16();
+
+ if ( ch > 0 )
+ {
+ hBstr->ind_list = sts[0]->hBstr->ind_list + sts[0]->hBstr->nb_ind_tot;
+ }
+ IGFEncWriteBitstream_ivas_fx( hIGFEnc[ch], hBstr, &hIGFEnc[ch]->infoTotalBitsPerFrameWritten, igfGridIdx, isIndepFlag );
+
+ bsBits = sub( hBstr->nb_ind_tot, pBsStart );
+ IGFEncConcatenateBitstream( hIGFEnc[ch], bsBits, hBstr );
+ }
+ }
+ return;
+}
diff --git a/lib_enc/tfa_enc.c b/lib_enc/tfa_enc.c
deleted file mode 100644
index 825401325748d89d4db5894372ff8dd2e53d76ec..0000000000000000000000000000000000000000
--- a/lib_enc/tfa_enc.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/******************************************************************************************************
-
- (C) 2022-2024 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB,
- Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
- Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
- Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
- contributors to this repository. All Rights Reserved.
-
- This software is protected by copyright law and by international treaties.
- The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB,
- Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
- Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
- Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
- contributors to this repository retain full ownership rights in their respective contributions in
- the software. This notice grants no license of any kind, including but not limited to patent
- license, nor is any license granted by implication, estoppel or otherwise.
-
- Contributors are required to enter into the IVAS codec Public Collaboration agreement before making
- contributions.
-
- This software is provided "AS IS", without any express or implied warranties. The software is in the
- development stage. It is intended exclusively for experts who have experience with such software and
- solely for the purpose of inspection. All implied warranties of non-infringement, merchantability
- and fitness for a particular purpose are hereby disclaimed and excluded.
-
- Any dispute, controversy or claim arising under or in relation to providing this software shall be
- submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in
- accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and
- the United Nations Convention on Contracts on the International Sales of Goods.
-
-*******************************************************************************************************/
-
-/*====================================================================================
- EVS Codec 3GPP TS26.443 Nov 04, 2021. Version 12.14.0 / 13.10.0 / 14.6.0 / 15.4.0 / 16.3.0
- ====================================================================================*/
-
-#include
-#include "options.h"
-#include
-#include "prot.h"
-#include "wmc_auto.h"
diff --git a/lib_enc/tns_base_enc.c b/lib_enc/tns_base_enc.c
deleted file mode 100644
index b3f3a90b7702920cfd9566005e7f7d543a794b94..0000000000000000000000000000000000000000
--- a/lib_enc/tns_base_enc.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/******************************************************************************************************
-
- (C) 2022-2024 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB,
- Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
- Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
- Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
- contributors to this repository. All Rights Reserved.
-
- This software is protected by copyright law and by international treaties.
- The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB,
- Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
- Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
- Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
- contributors to this repository retain full ownership rights in their respective contributions in
- the software. This notice grants no license of any kind, including but not limited to patent
- license, nor is any license granted by implication, estoppel or otherwise.
-
- Contributors are required to enter into the IVAS codec Public Collaboration agreement before making
- contributions.
-
- This software is provided "AS IS", without any express or implied warranties. The software is in the
- development stage. It is intended exclusively for experts who have experience with such software and
- solely for the purpose of inspection. All implied warranties of non-infringement, merchantability
- and fitness for a particular purpose are hereby disclaimed and excluded.
-
- Any dispute, controversy or claim arising under or in relation to providing this software shall be
- submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in
- accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and
- the United Nations Convention on Contracts on the International Sales of Goods.
-
-*******************************************************************************************************/
-
-/*====================================================================================
- EVS Codec 3GPP TS26.443 Nov 04, 2021. Version 12.14.0 / 13.10.0 / 14.6.0 / 15.4.0 / 16.3.0
- ====================================================================================*/
-
-#include
-#include
-#include "options.h"
-#include "wmc_auto.h"
-#include "cnst.h"
-#include "rom_com.h"
-#include "prot.h"
-#include "stat_com.h"
-
-/*----------------------------------------------------------------------------
- * Local constants
- *---------------------------------------------------------------------------*/
-
-#define HLM_MIN_NRG ( PCM16_TO_FLT_FAC * 2 * NORM_MDCT_FACTOR / ( 640 * 640 ) )
-
-#define MAX_SUBDIVISIONS 3
-
-
-/*---------------------------------------------------------------------*
- * EncodeTnsData()
- *
- *
- *---------------------------------------------------------------------*/
-
-void EncodeTnsData(
- STnsConfig const *pTnsConfig, /* i : TNS Configuration struct */
- STnsData const *pTnsData, /* i : TNS data struct (quantized param) */
- int16_t *stream, /* o : internal data stream */
- int16_t *pnSize, /* o : number of written parameters */
- int16_t *pnBits /* o : number of written bits */
-)
-{
- *pnSize = 0;
- *pnBits = 0;
-
- if ( pTnsConfig->nMaxFilters > 1 )
- {
- if ( pTnsConfig->allowTnsOnWhite )
- {
- if ( pTnsConfig->iFilterBorders[0] < 512 )
- {
- GetParameters( &tnsEnabledOnWhiteSWBTCX10BitMap, 1, pTnsData, &stream, pnSize, pnBits );
- }
- else
- {
- GetParameters( &tnsEnabledOnWhiteSWBTCX20BitMap, 1, pTnsData, &stream, pnSize, pnBits );
- }
- }
- else
- {
- if ( pTnsConfig->iFilterBorders[0] < 512 )
- {
- GetParameters( &tnsEnabledSWBTCX10BitMap, 1, pTnsData, &stream, pnSize, pnBits );
- }
- else
- {
- GetParameters( &tnsEnabledSWBTCX20BitMap, 1, pTnsData, &stream, pnSize, pnBits );
- }
- }
- }
- else
- {
- GetParameters( &tnsEnabledWBTCX20BitMap, 1, pTnsData, &stream, pnSize, pnBits );
- }
-
- return;
-}
diff --git a/lib_enc/transient_detection.c b/lib_enc/transient_detection.c
deleted file mode 100644
index 8e87e5685392d3f3d073201ea23f756e0c7592f3..0000000000000000000000000000000000000000
--- a/lib_enc/transient_detection.c
+++ /dev/null
@@ -1,183 +0,0 @@
-/******************************************************************************************************
-
- (C) 2022-2024 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB,
- Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
- Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
- Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
- contributors to this repository. All Rights Reserved.
-
- This software is protected by copyright law and by international treaties.
- The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB,
- Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
- Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
- Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
- contributors to this repository retain full ownership rights in their respective contributions in
- the software. This notice grants no license of any kind, including but not limited to patent
- license, nor is any license granted by implication, estoppel or otherwise.
-
- Contributors are required to enter into the IVAS codec Public Collaboration agreement before making
- contributions.
-
- This software is provided "AS IS", without any express or implied warranties. The software is in the
- development stage. It is intended exclusively for experts who have experience with such software and
- solely for the purpose of inspection. All implied warranties of non-infringement, merchantability
- and fitness for a particular purpose are hereby disclaimed and excluded.
-
- Any dispute, controversy or claim arising under or in relation to providing this software shall be
- submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in
- accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and
- the United Nations Convention on Contracts on the International Sales of Goods.
-
-*******************************************************************************************************/
-
-/*====================================================================================
- EVS Codec 3GPP TS26.443 Nov 04, 2021. Version 12.14.0 / 13.10.0 / 14.6.0 / 15.4.0 / 16.3.0
- ====================================================================================*/
-
-#include
-#include "options.h"
-#include "stat_enc.h"
-#include "cnst.h"
-#include "prot.h"
-#include "ivas_prot.h"
-#include
-#include "wmc_auto.h"
-
-#include "prot_fx.h"
-#include "ivas_prot_fx.h"
-/*---------------------------------------------------------------*
- * Local constants
- *---------------------------------------------------------------*/
-
-#define MIN_BLOCK_ENERGY 107.37f
-
-#define THR_HIGH 8.5f
-#define THR_NORM_HIGH 8.0f
-#define THR_NORM_LOW 4.5f
-#define THR_LOW 4.25f
-#define THR_LOW_STEP 1.0f
-
-/*---------------------------------------------------------------*
- * Local function prototypes
- *---------------------------------------------------------------*/
-
-
-/*-------------------------------------------------------------------*
- * InitTransientDetection()
- *
- *
- *-------------------------------------------------------------------*/
-
-
-/*-------------------------------------------------------------------*
- * GetTCXAvgTemporalFlatnessMeasure()
- *
- *
- *-------------------------------------------------------------------*/
-
-
-/*-------------------------------------------------------------------*
- * GetTCXMaxenergyChange()
- *
- *
- *-------------------------------------------------------------------*/
-
-
-/*---------------------------------------------------------------*
- * Local functions
- *---------------------------------------------------------------*/
-
-/** TCX decision.
- * Check if there is an attack in a subblock. Version for TCX Long/Short decision.
- * See TCheckSubblocksForAttack for definition of parameters.
- * It is assumed that the delay of MDCT overlap was not taken into account, so that the last subblock corresponds to the newest input subblock.
- */
-
-
-/** Init transient detector.
- * Fills TransientDetector structure with sensible content and enable it.
- * @param pSubblockEnergies Subblock energies used in this transient detector.
- * @param nDelay Delay for this transient detector.
- * @param nSubblocksToCheck Number of subblocks to check in this transient detector.
- * @param pCheckSubblockForAttack Attack detection function for this transient detector.
- * @param pSetAttackPosition Function for finalizing this transient detector.
- * @param attackRatioThreshold Attack ratio threshold.
- * @param pTransientDetector Structure to be initialized.
- */
-
-
-/*-------------------------------------------------------------------*
- * set_transient_stereo()
- *
- *
- *-------------------------------------------------------------------*/
-void set_transient_stereo_fx(
- CPE_ENC_HANDLE hCPE, /* i : CPE structure */
- Word16 currFlatness[] /* i/o: current flatness */
-)
-{
- Word16 n, attackIsPresent;
- Word16 currFlatnessMax;
- Encoder_State **sts;
-
- sts = hCPE->hCoreCoder;
-
- /* for DFT/TD based stereo ,map avg. flatness to individual stereo channels (M/S or X/Y) */
- maximum_fx( currFlatness, CPE_CHANNELS, &currFlatnessMax );
- attackIsPresent = 0;
- move16();
-
- FOR( n = 0; n < CPE_CHANNELS; n++ )
- {
- attackIsPresent = s_max( attackIsPresent, sts[n]->hTranDet->transientDetector.bIsAttackPresent );
- }
-
- set16_fx( currFlatness, currFlatnessMax, CPE_CHANNELS );
-
- FOR( n = 0; n < CPE_CHANNELS; n++ )
- {
- sts[n]->hTranDet->transientDetector.bIsAttackPresent = attackIsPresent;
- move16();
- }
-
- IF( hCPE->hStereoDft != NULL )
- {
- IF( hCPE->hStereoDft->attackPresent )
- {
- hCPE->hStereoDft->wasTransient = 1;
- move16();
- }
- ELSE IF( hCPE->hStereoDft->wasTransient )
- {
- hCPE->hStereoDft->wasTransient = 0;
- move16();
- }
-
- hCPE->hStereoDft->attackPresent = attackIsPresent;
- move16();
-
- hCPE->hStereoDft->hItd->currFlatness_fx = 0;
- move16();
- FOR( n = 0; n < CPE_CHANNELS; n++ )
- {
- hCPE->hStereoDft->hItd->currFlatness_fx = s_max( hCPE->hStereoDft->hItd->currFlatness_fx, currFlatness[n] );
- }
- }
-
- IF( hCPE->hStereoMdct != NULL )
- {
- hCPE->hStereoMdct->hItd->currFlatness_fx = 0;
- move16();
- FOR( n = 0; n < CPE_CHANNELS; n++ )
- {
- hCPE->hStereoMdct->hItd->currFlatness_fx = s_max( hCPE->hStereoMdct->hItd->currFlatness_fx, currFlatness[n] );
- }
- }
-
- return;
-}
-/*-------------------------------------------------------------------*
- * transient_analysis()
- *
- *
- *-------------------------------------------------------------------*/
diff --git a/lib_enc/transient_detection_fx.c b/lib_enc/transient_detection_fx.c
index bb977b432ecc2b0a6bc72f5775a7f9227452a986..47808cca05819e0cbdc9c55c4ff687004824fcd7 100644
--- a/lib_enc/transient_detection_fx.c
+++ b/lib_enc/transient_detection_fx.c
@@ -1686,3 +1686,76 @@ Word16 transient_analysis_ivas_fx(
return prel_force_td != 0;
}
+
+/*-------------------------------------------------------------------*
+ * set_transient_stereo()
+ *
+ *
+ *-------------------------------------------------------------------*/
+void set_transient_stereo_fx(
+ CPE_ENC_HANDLE hCPE, /* i : CPE structure */
+ Word16 currFlatness[] /* i/o: current flatness */
+)
+{
+ Word16 n, attackIsPresent;
+ Word16 currFlatnessMax;
+ Encoder_State **sts;
+
+ sts = hCPE->hCoreCoder;
+
+ /* for DFT/TD based stereo ,map avg. flatness to individual stereo channels (M/S or X/Y) */
+ maximum_fx( currFlatness, CPE_CHANNELS, &currFlatnessMax );
+ attackIsPresent = 0;
+ move16();
+
+ FOR( n = 0; n < CPE_CHANNELS; n++ )
+ {
+ attackIsPresent = s_max( attackIsPresent, sts[n]->hTranDet->transientDetector.bIsAttackPresent );
+ }
+
+ set16_fx( currFlatness, currFlatnessMax, CPE_CHANNELS );
+
+ FOR( n = 0; n < CPE_CHANNELS; n++ )
+ {
+ sts[n]->hTranDet->transientDetector.bIsAttackPresent = attackIsPresent;
+ move16();
+ }
+
+ IF( hCPE->hStereoDft != NULL )
+ {
+ IF( hCPE->hStereoDft->attackPresent )
+ {
+ hCPE->hStereoDft->wasTransient = 1;
+ move16();
+ }
+ ELSE IF( hCPE->hStereoDft->wasTransient )
+ {
+ hCPE->hStereoDft->wasTransient = 0;
+ move16();
+ }
+
+ hCPE->hStereoDft->attackPresent = attackIsPresent;
+ move16();
+
+ hCPE->hStereoDft->hItd->currFlatness_fx = 0;
+ move16();
+ FOR( n = 0; n < CPE_CHANNELS; n++ )
+ {
+ hCPE->hStereoDft->hItd->currFlatness_fx = s_max( hCPE->hStereoDft->hItd->currFlatness_fx, currFlatness[n] );
+ move16();
+ }
+ }
+
+ IF( hCPE->hStereoMdct != NULL )
+ {
+ hCPE->hStereoMdct->hItd->currFlatness_fx = 0;
+ move16();
+ FOR( n = 0; n < CPE_CHANNELS; n++ )
+ {
+ hCPE->hStereoMdct->hItd->currFlatness_fx = s_max( hCPE->hStereoMdct->hItd->currFlatness_fx, currFlatness[n] );
+ move16();
+ }
+ }
+
+ return;
+}
diff --git a/lib_enc/transition_enc.c b/lib_enc/transition_enc.c
deleted file mode 100644
index 5f6981ef6a10eb4df6842d5c37d90c5468adf943..0000000000000000000000000000000000000000
--- a/lib_enc/transition_enc.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/******************************************************************************************************
-
- (C) 2022-2024 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB,
- Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
- Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
- Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
- contributors to this repository. All Rights Reserved.
-
- This software is protected by copyright law and by international treaties.
- The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB,
- Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
- Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
- Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
- contributors to this repository retain full ownership rights in their respective contributions in
- the software. This notice grants no license of any kind, including but not limited to patent
- license, nor is any license granted by implication, estoppel or otherwise.
-
- Contributors are required to enter into the IVAS codec Public Collaboration agreement before making
- contributions.
-
- This software is provided "AS IS", without any express or implied warranties. The software is in the
- development stage. It is intended exclusively for experts who have experience with such software and
- solely for the purpose of inspection. All implied warranties of non-infringement, merchantability
- and fitness for a particular purpose are hereby disclaimed and excluded.
-
- Any dispute, controversy or claim arising under or in relation to providing this software shall be
- submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in
- accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and
- the United Nations Convention on Contracts on the International Sales of Goods.
-
-*******************************************************************************************************/
-
-/*====================================================================================
- EVS Codec 3GPP TS26.443 Nov 04, 2021. Version 12.14.0 / 13.10.0 / 14.6.0 / 15.4.0 / 16.3.0
- ====================================================================================*/
-
-#include
-#include "options.h"
-#include
-#include "cnst.h"
-#include "rom_com.h"
-#include "prot.h"
-#include "wmc_auto.h"
-#include "prot_fx.h"
diff --git a/lib_enc/update_decision.c b/lib_enc/update_decision.c
deleted file mode 100644
index 825401325748d89d4db5894372ff8dd2e53d76ec..0000000000000000000000000000000000000000
--- a/lib_enc/update_decision.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/******************************************************************************************************
-
- (C) 2022-2024 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB,
- Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
- Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
- Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
- contributors to this repository. All Rights Reserved.
-
- This software is protected by copyright law and by international treaties.
- The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB,
- Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
- Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
- Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
- contributors to this repository retain full ownership rights in their respective contributions in
- the software. This notice grants no license of any kind, including but not limited to patent
- license, nor is any license granted by implication, estoppel or otherwise.
-
- Contributors are required to enter into the IVAS codec Public Collaboration agreement before making
- contributions.
-
- This software is provided "AS IS", without any express or implied warranties. The software is in the
- development stage. It is intended exclusively for experts who have experience with such software and
- solely for the purpose of inspection. All implied warranties of non-infringement, merchantability
- and fitness for a particular purpose are hereby disclaimed and excluded.
-
- Any dispute, controversy or claim arising under or in relation to providing this software shall be
- submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in
- accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and
- the United Nations Convention on Contracts on the International Sales of Goods.
-
-*******************************************************************************************************/
-
-/*====================================================================================
- EVS Codec 3GPP TS26.443 Nov 04, 2021. Version 12.14.0 / 13.10.0 / 14.6.0 / 15.4.0 / 16.3.0
- ====================================================================================*/
-
-#include
-#include "options.h"
-#include
-#include "prot.h"
-#include "wmc_auto.h"
diff --git a/lib_enc/updt_enc.c b/lib_enc/updt_enc.c
deleted file mode 100644
index cb36dd4b04c94cce04cb194654b8bf337ab9c5cd..0000000000000000000000000000000000000000
--- a/lib_enc/updt_enc.c
+++ /dev/null
@@ -1,274 +0,0 @@
-/******************************************************************************************************
-
- (C) 2022-2024 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB,
- Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
- Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
- Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
- contributors to this repository. All Rights Reserved.
-
- This software is protected by copyright law and by international treaties.
- The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB,
- Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
- Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
- Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
- contributors to this repository retain full ownership rights in their respective contributions in
- the software. This notice grants no license of any kind, including but not limited to patent
- license, nor is any license granted by implication, estoppel or otherwise.
-
- Contributors are required to enter into the IVAS codec Public Collaboration agreement before making
- contributions.
-
- This software is provided "AS IS", without any express or implied warranties. The software is in the
- development stage. It is intended exclusively for experts who have experience with such software and
- solely for the purpose of inspection. All implied warranties of non-infringement, merchantability
- and fitness for a particular purpose are hereby disclaimed and excluded.
-
- Any dispute, controversy or claim arising under or in relation to providing this software shall be
- submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in
- accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and
- the United Nations Convention on Contracts on the International Sales of Goods.
-
-*******************************************************************************************************/
-
-/*====================================================================================
- EVS Codec 3GPP TS26.443 Nov 04, 2021. Version 12.14.0 / 13.10.0 / 14.6.0 / 15.4.0 / 16.3.0
- ====================================================================================*/
-
-#include
-#include "options.h"
-#include "cnst.h"
-#include "rom_com.h"
-#include "prot.h"
-#include "prot_fx.h"
-#include "prot_fx_enc.h"
-#include "ivas_prot_fx.h"
-#include "wmc_auto.h"
-
-/*-------------------------------------------------------------------*
- * updt_enc()
- *
- * Common updates (all frame types)
- *-------------------------------------------------------------------*/
-
-
-void updt_enc_common_ivas_fx(
- Encoder_State *st, /* i/o: encoder state structure */
- const Word16 Q_new /* i : CUrrent frame scaling */
-)
-{
- /*---------------------------------------------------------------------*
- * Updates - main main codec parameters
- *---------------------------------------------------------------------*/
- st->last_sr_core = st->sr_core;
- move32();
- st->last_codec_mode = st->codec_mode;
- move16();
- st->last_L_frame = st->L_frame;
- move16();
- st->last_core = st->core;
- move16();
-
- st->last_total_brate = st->total_brate;
- move32();
- st->last_bits_frame_nominal = st->bits_frame_nominal;
- move16();
- st->last_core_brate = st->core_brate;
- move32();
- st->last_extl = st->extl;
- move16();
- st->last_input_bwidth = st->input_bwidth;
- move16();
- st->last_bwidth = st->bwidth;
- move16();
- st->last_coder_type_raw = st->coder_type_raw;
- move16();
- st->prev_Q_new = Q_new;
- move16();
-
- test();
- IF( GT_32( st->core_brate, SID_2k40 ) && st->hDtxEnc != NULL )
- {
- st->hDtxEnc->last_active_brate = st->total_brate;
- move32();
- }
-
- IF( st->hBWE_TD != NULL )
- {
- IF( EQ_16( st->core, HQ_CORE ) )
- {
- /* in the HQ core, coder_type is not used so it could have been set to anything */
- st->hBWE_TD->prev_coder_type = GENERIC;
- move16();
- }
- ELSE
- {
- st->hBWE_TD->prev_coder_type = st->coder_type;
- move16();
- }
- }
-
- test();
- IF( st->Opt_DTX_ON && st->hTdCngEnc != NULL )
- {
- IF( GT_32( st->core_brate, SID_2k40 ) )
- {
- IF( EQ_16( st->hDtxEnc->first_CNG, 1 ) )
- {
- IF( GE_16( st->hTdCngEnc->act_cnt, BUF_DEC_RATE ) )
- {
- st->hTdCngEnc->act_cnt = 0;
- move16();
- }
- st->hTdCngEnc->act_cnt = add( st->hTdCngEnc->act_cnt, 1 );
- move16();
-
- test();
- IF( EQ_16( st->hTdCngEnc->act_cnt, BUF_DEC_RATE ) && st->hTdCngEnc->ho_hist_size > 0 )
- {
- st->hTdCngEnc->ho_hist_size = sub( st->hTdCngEnc->ho_hist_size, 1 );
- move16();
- }
- }
-
- test();
- test();
- test();
- IF( EQ_16( st->element_mode, IVAS_SCE ) || EQ_16( st->element_mode, IVAS_CPE_DFT ) || EQ_16( st->element_mode, IVAS_CPE_TD ) || EQ_16( st->hDtxEnc->first_CNG, 1 ) )
- {
- IF( GE_16( ++( st->hTdCngEnc->act_cnt2 ), MIN_ACT_CNG_UPD ) )
- {
- st->hTdCngEnc->act_cnt2 = MIN_ACT_CNG_UPD;
- move16();
- }
-
- test();
- test();
- test();
- test();
- IF( ( EQ_16( st->element_mode, IVAS_SCE ) || EQ_16( st->element_mode, IVAS_CPE_DFT ) || EQ_16( st->element_mode, IVAS_CPE_TD ) ) && GE_16( st->hTdCngEnc->act_cnt2, MIN_ACT_CNG_UPD ) )
- {
- Word32 cng_att_fx32 = 0;
-
- apply_scale( &cng_att_fx32, st->hFdCngEnc->hFdCngCom->CngBandwidth, st->hFdCngEnc->hFdCngCom->CngBitrate, scaleTableStereo, SIZE_SCALE_TABLE_STEREO );
-
- st->hTdCngEnc->CNG_att_fx = extract_l( L_shr( cng_att_fx32, Q16 ) ); // Q23
- }
- }
- }
-
- test();
- test();
- test();
- IF( ( EQ_32( st->core_brate, SID_2k40 ) || EQ_32( st->core_brate, FRAME_NO_DATA ) ) && st->hDtxEnc->first_CNG == 0 && EQ_16( st->cng_type, LP_CNG ) )
- {
- st->hDtxEnc->first_CNG = 1;
- move16();
- }
- }
-
- /*-----------------------------------------------------------------*
- * Increase the counter of initialization frames
- * Limit the max number of init. frames
- *-----------------------------------------------------------------*/
-
- IF( LT_16( st->ini_frame, MAX_FRAME_COUNTER ) )
- {
- st->ini_frame = add( st->ini_frame, 1 );
- }
-
- /* synchronisation of CNG seeds */
- test();
- test();
- IF( st->hTdCngEnc != NULL && NE_32( st->core_brate, FRAME_NO_DATA ) && NE_32( st->core_brate, SID_2k40 ) && NE_16( st->core, AMR_WB_CORE ) )
- {
- Random( &( st->hTdCngEnc->cng_seed ) );
- Random( &( st->hTdCngEnc->cng_ener_seed ) );
- }
-
- /*---------------------------------------------------------------------*
- * Updates - MODE2
- *---------------------------------------------------------------------*/
-
- test();
- IF( EQ_16( st->element_mode, EVS_MONO ) && EQ_16( st->mdct_sw, MODE2 ) )
- {
- st->codec_mode = MODE2;
- move16();
-
- st->sr_core = getCoreSamplerateMode2( EVS_MONO, st->total_brate, st->bwidth, st->flag_ACELP16k, st->rf_mode, 0 );
- move16();
-
- Word16 exp;
- st->L_frame = BASOP_Util_Divide3232_Scale( st->sr_core, FRAMES_PER_SEC, &exp );
- st->L_frame = shr( st->L_frame, sub( 15, exp ) );
- move16();
-
- IF( EQ_32( st->sr_core, INT_FS_12k8 ) )
- {
- st->preemph_fac = PREEMPH_FAC;
- st->gamma = GAMMA1;
- }
- ELSE
- {
-
- st->preemph_fac = PREEMPH_FAC_16k;
- st->gamma = GAMMA16k;
- }
-
- st->igf = getIgfPresent_fx( EVS_MONO, st->total_brate, st->bwidth, st->rf_mode );
- }
-
- /* update FER clas */
- IF( NE_16( st->core, AMR_WB_CORE ) )
- {
- st->last_clas = st->clas;
- move16();
- }
-
- /* Update Core */
- core_encode_update_ivas_fx( st );
-
- /*---------------------------------------------------------------------*
- * RF mode updates
- *---------------------------------------------------------------------*/
-
- IF( st->rf_mode )
- {
- IF( st->hSC_VBR != NULL )
- {
- IF( st->hRF->rf_frame_type == RF_NELP )
- {
- st->hSC_VBR->last_nelp_mode = 1;
- move16();
- }
- ELSE
- {
- st->hSC_VBR->last_nelp_mode = 0;
- move16();
- }
- }
- }
-
- st->rf_mode_last = st->rf_mode;
- move16();
-
- IF( st->Opt_RF_ON )
- {
- st->L_frame = L_FRAME;
- st->rf_mode = 1;
- move16();
- move16();
- }
-
- /*---------------------------------------------------------------------*
- * Other updates
- *---------------------------------------------------------------------*/
-
- test();
- IF( st->element_mode > EVS_MONO && st->hTcxEnc != NULL )
- {
- st->hTcxEnc->tcxltp_norm_corr_mem = st->hTcxEnc->tcxltp_norm_corr_past;
- }
-
- return;
-}
diff --git a/lib_enc/updt_enc_fx.c b/lib_enc/updt_enc_fx.c
index 6a3202a1595650cd87d2d6cc049bafe6db557b4e..bb35fa6a05bbca937178aaa1d5ef1133404ec45a 100644
--- a/lib_enc/updt_enc_fx.c
+++ b/lib_enc/updt_enc_fx.c
@@ -10,6 +10,7 @@
#include "prot_fx.h" /* Function prototypes */
#include "prot_fx_enc.h" /* Function prototypes */
#include "basop_util.h" /* Function prototypes */
+#include "ivas_prot_fx.h"
/*-------------------------------------------------------------------*
* updt_enc()
@@ -547,3 +548,232 @@ void updt_enc_common_fx(
return;
}
#endif
+
+void updt_enc_common_ivas_fx(
+ Encoder_State *st, /* i/o: encoder state structure */
+ const Word16 Q_new /* i : CUrrent frame scaling */
+)
+{
+ /*---------------------------------------------------------------------*
+ * Updates - main main codec parameters
+ *---------------------------------------------------------------------*/
+ st->last_sr_core = st->sr_core;
+ move32();
+ st->last_codec_mode = st->codec_mode;
+ move16();
+ st->last_L_frame = st->L_frame;
+ move16();
+ st->last_core = st->core;
+ move16();
+
+ st->last_total_brate = st->total_brate;
+ move32();
+ st->last_bits_frame_nominal = st->bits_frame_nominal;
+ move16();
+ st->last_core_brate = st->core_brate;
+ move32();
+ st->last_extl = st->extl;
+ move16();
+ st->last_input_bwidth = st->input_bwidth;
+ move16();
+ st->last_bwidth = st->bwidth;
+ move16();
+ st->last_coder_type_raw = st->coder_type_raw;
+ move16();
+ st->prev_Q_new = Q_new;
+ move16();
+
+ test();
+ if ( GT_32( st->core_brate, SID_2k40 ) && st->hDtxEnc != NULL )
+ {
+ st->hDtxEnc->last_active_brate = st->total_brate;
+ move32();
+ }
+
+ IF( st->hBWE_TD != NULL )
+ {
+ IF( EQ_16( st->core, HQ_CORE ) )
+ {
+ /* in the HQ core, coder_type is not used so it could have been set to anything */
+ st->hBWE_TD->prev_coder_type = GENERIC;
+ move16();
+ }
+ ELSE
+ {
+ st->hBWE_TD->prev_coder_type = st->coder_type;
+ move16();
+ }
+ }
+
+ test();
+ IF( st->Opt_DTX_ON && st->hTdCngEnc != NULL )
+ {
+ IF( GT_32( st->core_brate, SID_2k40 ) )
+ {
+ IF( EQ_16( st->hDtxEnc->first_CNG, 1 ) )
+ {
+ if ( GE_16( st->hTdCngEnc->act_cnt, BUF_DEC_RATE ) )
+ {
+ st->hTdCngEnc->act_cnt = 0;
+ move16();
+ }
+ st->hTdCngEnc->act_cnt = add( st->hTdCngEnc->act_cnt, 1 );
+ move16();
+
+ test();
+ IF( EQ_16( st->hTdCngEnc->act_cnt, BUF_DEC_RATE ) && st->hTdCngEnc->ho_hist_size > 0 )
+ {
+ st->hTdCngEnc->ho_hist_size = sub( st->hTdCngEnc->ho_hist_size, 1 );
+ move16();
+ }
+ }
+
+ test();
+ test();
+ test();
+ IF( EQ_16( st->element_mode, IVAS_SCE ) || EQ_16( st->element_mode, IVAS_CPE_DFT ) || EQ_16( st->element_mode, IVAS_CPE_TD ) || EQ_16( st->hDtxEnc->first_CNG, 1 ) )
+ {
+ if ( GE_16( ++( st->hTdCngEnc->act_cnt2 ), MIN_ACT_CNG_UPD ) )
+ {
+ st->hTdCngEnc->act_cnt2 = MIN_ACT_CNG_UPD;
+ move16();
+ }
+
+ test();
+ test();
+ test();
+ IF( ( EQ_16( st->element_mode, IVAS_SCE ) || EQ_16( st->element_mode, IVAS_CPE_DFT ) || EQ_16( st->element_mode, IVAS_CPE_TD ) ) && GE_16( st->hTdCngEnc->act_cnt2, MIN_ACT_CNG_UPD ) )
+ {
+ Word32 cng_att_fx32 = 0;
+ move32();
+
+ apply_scale( &cng_att_fx32, st->hFdCngEnc->hFdCngCom->CngBandwidth, st->hFdCngEnc->hFdCngCom->CngBitrate, scaleTableStereo, SIZE_SCALE_TABLE_STEREO );
+
+ st->hTdCngEnc->CNG_att_fx = extract_l( L_shr( cng_att_fx32, Q16 ) ); // Q23
+ move16();
+ }
+ }
+ }
+
+ test();
+ test();
+ test();
+ if ( ( EQ_32( st->core_brate, SID_2k40 ) || EQ_32( st->core_brate, FRAME_NO_DATA ) ) && st->hDtxEnc->first_CNG == 0 && EQ_16( st->cng_type, LP_CNG ) )
+ {
+ st->hDtxEnc->first_CNG = 1;
+ move16();
+ }
+ }
+
+ /*-----------------------------------------------------------------*
+ * Increase the counter of initialization frames
+ * Limit the max number of init. frames
+ *-----------------------------------------------------------------*/
+
+ IF( LT_16( st->ini_frame, MAX_FRAME_COUNTER ) )
+ {
+ st->ini_frame = add( st->ini_frame, 1 );
+ }
+
+ /* synchronisation of CNG seeds */
+ test();
+ test();
+ test();
+ IF( st->hTdCngEnc != NULL && ( st->core_brate != FRAME_NO_DATA ) && NE_32( st->core_brate, SID_2k40 ) && NE_16( st->core, AMR_WB_CORE ) )
+ {
+ Random( &( st->hTdCngEnc->cng_seed ) );
+ Random( &( st->hTdCngEnc->cng_ener_seed ) );
+ }
+
+ /*---------------------------------------------------------------------*
+ * Updates - MODE2
+ *---------------------------------------------------------------------*/
+
+ test();
+ IF( ( st->element_mode == EVS_MONO ) && EQ_16( st->mdct_sw, MODE2 ) )
+ {
+ st->codec_mode = MODE2;
+ move16();
+
+ st->sr_core = getCoreSamplerateMode2( EVS_MONO, st->total_brate, st->bwidth, st->flag_ACELP16k, st->rf_mode, 0 );
+ move16();
+
+ Word16 exp;
+ st->L_frame = BASOP_Util_Divide3232_Scale( st->sr_core, FRAMES_PER_SEC, &exp );
+ move16();
+ st->L_frame = shr( st->L_frame, sub( 15, exp ) );
+ move16();
+
+ IF( EQ_32( st->sr_core, INT_FS_12k8 ) )
+ {
+ st->preemph_fac = PREEMPH_FAC;
+ st->gamma = GAMMA1;
+ }
+ ELSE
+ {
+
+ st->preemph_fac = PREEMPH_FAC_16k;
+ st->gamma = GAMMA16k;
+ }
+ move16();
+ move16();
+
+ st->igf = getIgfPresent_fx( EVS_MONO, st->total_brate, st->bwidth, st->rf_mode );
+ move16();
+ }
+
+ /* update FER clas */
+ if ( NE_16( st->core, AMR_WB_CORE ) )
+ {
+ st->last_clas = st->clas;
+ move16();
+ }
+
+ /* Update Core */
+ core_encode_update_ivas_fx( st );
+
+ /*---------------------------------------------------------------------*
+ * RF mode updates
+ *---------------------------------------------------------------------*/
+
+ IF( st->rf_mode )
+ {
+ IF( st->hSC_VBR != NULL )
+ {
+ IF( EQ_16( st->hRF->rf_frame_type, RF_NELP ) )
+ {
+ st->hSC_VBR->last_nelp_mode = 1;
+ move16();
+ }
+ ELSE
+ {
+ st->hSC_VBR->last_nelp_mode = 0;
+ move16();
+ }
+ }
+ }
+
+ st->rf_mode_last = st->rf_mode;
+ move16();
+
+ IF( st->Opt_RF_ON )
+ {
+ st->L_frame = L_FRAME;
+ st->rf_mode = 1;
+ move16();
+ move16();
+ }
+
+ /*---------------------------------------------------------------------*
+ * Other updates
+ *---------------------------------------------------------------------*/
+
+ test();
+ if ( st->element_mode > EVS_MONO && st->hTcxEnc != NULL )
+ {
+ st->hTcxEnc->tcxltp_norm_corr_mem = st->hTcxEnc->tcxltp_norm_corr_past;
+ move16();
+ }
+
+ return;
+}
diff --git a/lib_enc/updt_tar.c b/lib_enc/updt_tar.c
deleted file mode 100644
index e748899a9667996f0776eb65127752b66796a660..0000000000000000000000000000000000000000
--- a/lib_enc/updt_tar.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/******************************************************************************************************
-
- (C) 2022-2024 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB,
- Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
- Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
- Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
- contributors to this repository. All Rights Reserved.
-
- This software is protected by copyright law and by international treaties.
- The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB,
- Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
- Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
- Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
- contributors to this repository retain full ownership rights in their respective contributions in
- the software. This notice grants no license of any kind, including but not limited to patent
- license, nor is any license granted by implication, estoppel or otherwise.
-
- Contributors are required to enter into the IVAS codec Public Collaboration agreement before making
- contributions.
-
- This software is provided "AS IS", without any express or implied warranties. The software is in the
- development stage. It is intended exclusively for experts who have experience with such software and
- solely for the purpose of inspection. All implied warranties of non-infringement, merchantability
- and fitness for a particular purpose are hereby disclaimed and excluded.
-
- Any dispute, controversy or claim arising under or in relation to providing this software shall be
- submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in
- accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and
- the United Nations Convention on Contracts on the International Sales of Goods.
-
-*******************************************************************************************************/
-
-/*====================================================================================
- EVS Codec 3GPP TS26.443 Nov 04, 2021. Version 12.14.0 / 13.10.0 / 14.6.0 / 15.4.0 / 16.3.0
- ====================================================================================*/
-
-#include
-#include "options.h"
-#include "prot.h"
-#include "wmc_auto.h"