LCOV - code coverage report
Current view: top level - lib_enc - updt_enc.c (source / functions) Hit Total Coverage
Test: Coverage on main @ 6baab0c613aa6c7100498ed7b93676aa8198a493 Lines: 165 171 96.5 %
Date: 2025-05-28 04:28:20 Functions: 3 3 100.0 %

          Line data    Source code
       1             : /******************************************************************************************************
       2             : 
       3             :    (C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB,
       4             :    Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
       5             :    Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
       6             :    Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
       7             :    contributors to this repository. All Rights Reserved.
       8             : 
       9             :    This software is protected by copyright law and by international treaties.
      10             :    The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB,
      11             :    Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
      12             :    Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
      13             :    Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
      14             :    contributors to this repository retain full ownership rights in their respective contributions in
      15             :    the software. This notice grants no license of any kind, including but not limited to patent
      16             :    license, nor is any license granted by implication, estoppel or otherwise.
      17             : 
      18             :    Contributors are required to enter into the IVAS codec Public Collaboration agreement before making
      19             :    contributions.
      20             : 
      21             :    This software is provided "AS IS", without any express or implied warranties. The software is in the
      22             :    development stage. It is intended exclusively for experts who have experience with such software and
      23             :    solely for the purpose of inspection. All implied warranties of non-infringement, merchantability
      24             :    and fitness for a particular purpose are hereby disclaimed and excluded.
      25             : 
      26             :    Any dispute, controversy or claim arising under or in relation to providing this software shall be
      27             :    submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in
      28             :    accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and
      29             :    the United Nations Convention on Contracts on the International Sales of Goods.
      30             : 
      31             : *******************************************************************************************************/
      32             : 
      33             : /*====================================================================================
      34             :     EVS Codec 3GPP TS26.443 Nov 04, 2021. Version 12.14.0 / 13.10.0 / 14.6.0 / 15.4.0 / 16.3.0
      35             :   ====================================================================================*/
      36             : 
      37             : #include <stdint.h>
      38             : #include "options.h"
      39             : #ifdef DEBUGGING
      40             : #include "debug.h"
      41             : #endif
      42             : #include "cnst.h"
      43             : #include "rom_com.h"
      44             : #include "prot.h"
      45             : #include "wmc_auto.h"
      46             : 
      47             : /*-------------------------------------------------------------------*
      48             :  * updt_enc()
      49             :  *
      50             :  * Common updates (all frame types)
      51             :  *-------------------------------------------------------------------*/
      52             : 
      53     1727951 : void updt_enc(
      54             :     Encoder_State *st,       /* i/o: state structure                          */
      55             :     const float *old_exc,    /* i  : buffer of excitation                     */
      56             :     const float *pitch_buf,  /* i  : floating pitch for each subframe         */
      57             :     const float Es_pred,     /* i  : predicited scaled innovation energy      */
      58             :     const float *Aq,         /* i  : A(z) quantized for all subframes         */
      59             :     const float *lsf_new,    /* i  : current frame LSF vector                 */
      60             :     const float *lsp_new,    /* i  : current frame LSP vector                 */
      61             :     const float *old_bwe_exc /* i  : buffer of excitation                     */
      62             : )
      63             : {
      64             :     int16_t i;
      65             : 
      66             :     /* update old excitation buffer */
      67     1727951 :     mvr2r( &old_exc[st->L_frame], st->hLPDmem->old_exc, L_EXC_MEM );
      68     1727951 :     if ( !st->Opt_AMR_WB && st->hBWE_TD != NULL )
      69             :     {
      70     1720487 :         mvr2r( &old_bwe_exc[L_FRAME32k], st->hBWE_TD->old_bwe_exc, PIT16k_MAX * 2 );
      71             :     }
      72             : 
      73             :     /* update old LSP and LSF vector */
      74     1727951 :     mvr2r( lsp_new, st->lsp_old, M );
      75     1727951 :     mvr2r( lsf_new, st->lsf_old, M );
      76             : 
      77             :     /* update last coder type */
      78     1727951 :     st->last_coder_type = st->coder_type;
      79     1727951 :     if ( st->coder_type == INACTIVE || ( st->bpf_off == 1 && st->coder_type != AUDIO && st->coder_type != TRANSITION ) )
      80             :     {
      81      372583 :         st->last_coder_type = UNVOICED;
      82             :     }
      83             : 
      84             :     /* this ensures that st->last_coder_type is never set to INACTIVE in case of AVQ inactive because the FEC does not distinguish between GSC inactive and AVQ inactive */
      85     1727951 :     if ( st->coder_type == INACTIVE && st->total_brate > ACELP_24k40 )
      86             :     {
      87       18206 :         st->last_coder_type = GENERIC;
      88             :     }
      89             : 
      90     1727951 :     if ( st->Opt_AMR_WB && st->coder_type == INACTIVE && st->core_brate != SID_1k75 && st->core_brate != FRAME_NO_DATA )
      91             :     {
      92             :         /* overwrite previous coding type to help FEC */
      93          34 :         st->last_coder_type = UNVOICED;
      94             :     }
      95             : 
      96             :     /* AC mode (GSC) - in speech we can consider that the last pitch band reached the max */
      97     1727951 :     if ( st->hGSCEnc != NULL && st->coder_type != AUDIO && st->coder_type != INACTIVE )
      98             :     {
      99     1314831 :         st->hGSCEnc->mem_last_pit_band = 10 + BAND1k2;
     100     1314831 :         st->hGSCEnc->past_dyn_dec = NOISE_LEVEL_SP0 - 1; /* tends to speech */
     101     1314831 :         st->hGSCEnc->noise_lev = NOISE_LEVEL_SP0 - 1;    /* tends to speech */
     102     1314831 :         st->hGSCEnc->mid_dyn = 40.0f * 0.5f + st->hGSCEnc->mid_dyn * 0.5f;
     103             :     }
     104             : 
     105             :     /* convert old LSP vector from 12kHz domain to 16kHz domain (needed in case of ACELP@12k8 <-> ACELP@16kHz switching) */
     106     1727951 :     if ( st->L_frame == L_FRAME )
     107             :     {
     108      991711 :         mvr2r( st->lsp_old, st->lsp_old16k, M );
     109             : 
     110      991711 :         st->rate_switching_reset_16kHz = lsp_convert_poly( st->lsp_old16k, L_FRAME16k, st->Opt_AMR_WB );
     111             :     }
     112             : 
     113             :     /* update buffer of old subframe pitch values */
     114     1727951 :     if ( st->last_L_frame != st->L_frame )
     115             :     {
     116       30319 :         if ( st->L_frame == L_FRAME )
     117             :         {
     118      103615 :             for ( i = 0; i < NB_SUBFR; i++ )
     119             :             {
     120       82892 :                 st->old_pitch_buf[NB_SUBFR + i] = 0.8f * st->old_pitch_buf[NB_SUBFR + i + 1];
     121             :             }
     122             :         }
     123             :         else
     124             :         {
     125       47980 :             for ( i = NB_SUBFR; i > 0; i-- )
     126             :             {
     127       38384 :                 st->old_pitch_buf[NB_SUBFR + i] = 1.25f * st->old_pitch_buf[NB_SUBFR + i - 1];
     128             :             }
     129        9596 :             st->old_pitch_buf[2 * NB_SUBFR16k - 1] = st->old_pitch_buf[2 * NB_SUBFR16k - 2];
     130             :         }
     131             :     }
     132             : 
     133     1727951 :     mvr2r( &st->old_pitch_buf[st->L_frame / L_SUBFR], st->old_pitch_buf, st->L_frame / L_SUBFR );
     134     1727951 :     mvr2r( pitch_buf, &st->old_pitch_buf[st->L_frame / L_SUBFR], st->L_frame / L_SUBFR );
     135             : 
     136             :     /* SC-VBR */
     137     1727951 :     st->last_Opt_SC_VBR = st->Opt_SC_VBR;
     138     1727951 :     if ( st->hSC_VBR != NULL )
     139             :     {
     140       46573 :         st->hSC_VBR->last_last_ppp_mode = st->hSC_VBR->last_ppp_mode;
     141       46573 :         st->hSC_VBR->last_ppp_mode = st->hSC_VBR->ppp_mode;
     142       46573 :         st->hSC_VBR->last_nelp_mode = st->hSC_VBR->nelp_mode;
     143             :     }
     144             : 
     145             :     /* core switching updates */
     146     1727951 :     mvr2r( &Aq[( st->L_frame / L_SUBFR - 1 ) * ( M + 1 )], st->old_Aq_12_8, M + 1 );
     147     1727951 :     st->old_Es_pred = Es_pred;
     148             : 
     149     1727951 :     return;
     150             : }
     151             : 
     152             : /*-------------------------------------------------------------------*
     153             :  * updt_IO_switch()
     154             :  *
     155             :  * Common updates for AMR-WB IO mode and EVS primary mode switching
     156             :  *-------------------------------------------------------------------*/
     157             : 
     158          45 : void updt_IO_switch_enc(
     159             :     Encoder_State *st,        /* i/o: state structure             */
     160             :     const int16_t input_frame /* i  : input frame length          */
     161             : )
     162             : {
     163             :     float xsp_tmp[M];
     164             : 
     165          45 :     if ( st->last_core == AMR_WB_CORE ) /* switching to EVS primary mode */
     166             :     {
     167             :         /* reset onset detection counter */
     168          25 :         st->tc_cnt = -1;
     169             : 
     170             :         /* force safety-net LSFQ in the first frames after the switching */
     171          25 :         st->Nb_ACELP_frames = 0;
     172             : 
     173             :         /* AMR-WB IO mode uses ISF(ISP), but EVS primary mode LSF(LSP) */
     174          25 :         mvr2r( stable_LSP, xsp_tmp, M );
     175          25 :         isf2lsf( st->lsf_old, st->lsf_old, xsp_tmp, M, INT_FS_12k8 );
     176          25 :         mvr2r( stable_LSP, xsp_tmp, M );
     177          25 :         isp2lsp( st->lsp_old, st->lsp_old, xsp_tmp, M );
     178          25 :         isp2lsp( st->lsp_old1, st->lsp_old1, xsp_tmp, M );
     179             : 
     180          25 :         mvr2r( stable_LSP, xsp_tmp, M );
     181          25 :         isp2lsp( st->hDtxEnc->lspCNG, st->hDtxEnc->lspCNG, xsp_tmp, M );
     182          25 :         if ( st->hTdCngEnc->old_enr_index >= 0 )
     183             :         {
     184           0 :             st->hTdCngEnc->old_enr_index = min( (int16_t) ( (float) st->hTdCngEnc->old_enr_index / STEP_AMR_WB_SID * STEP_SID ), 127 );
     185             :         }
     186             :         /* Perform preemphasis of the old input signal @16kHz */
     187          25 :         st->mem_preemph16k = 0;
     188          25 :         preemph( st->old_inp_16k, PREEMPH_FAC_16k, L_INP_MEM, &( st->mem_preemph16k ) );
     189             : 
     190             :         /* reset TD BWE buffers */
     191          25 :         set_f( st->hBWE_TD->old_speech_wb, 0.0f, ( L_LOOK_12k8 + L_SUBFR ) * 5 / 16 );
     192          25 :         set_f( st->hBWE_TD->old_bwe_exc, 0.0f, PIT16k_MAX * 2 );
     193          25 :         set_f( st->hBWE_TD->old_bwe_exc_extended, 0.0f, NL_BUFF_OFFSET );
     194          25 :         InitSWBencBufferStates( st->hBWE_TD, NULL );
     195             : 
     196          25 :         st->hBWE_TD->bwe_non_lin_prev_scale = 0.0;
     197          25 :         set_f( st->hBWE_TD->decim_state1, 0.0f, ( 2 * ALLPASSSECTIONS_STEEP + 1 ) );
     198          25 :         set_f( st->hBWE_TD->decim_state2, 0.0f, ( 2 * ALLPASSSECTIONS_STEEP + 1 ) );
     199          25 :         set_f( st->hBWE_FD->old_wtda_swb, 0, L_FRAME16k );
     200          25 :         set_f( st->hBWE_FD->old_input_wb, 0, NS2SA( 16000, DELAY_FD_BWE_ENC_NS ) );
     201             : 
     202          25 :         wb_tbe_extras_reset( st->hBWE_TD->mem_genSHBexc_filt_down_wb2, st->hBWE_TD->mem_genSHBexc_filt_down_wb3 );
     203          25 :         if ( input_frame >= L_FRAME32k )
     204             :         {
     205          25 :             swb_tbe_reset( st->hBWE_TD->mem_csfilt, st->hBWE_TD->mem_genSHBexc_filt_down_shb, st->hBWE_TD->state_lpc_syn, st->hBWE_TD->syn_overlap, st->hBWE_TD->state_syn_shbexc, &( st->hBWE_TD->tbe_demph ), &( st->hBWE_TD->tbe_premph ), st->hBWE_TD->mem_stp_swb, &( st->hBWE_TD->gain_prec_swb ) );
     206             :         }
     207             : 
     208          25 :         if ( input_frame == L_FRAME48k )
     209             :         {
     210          21 :             set_f( st->hBWE_TD->fb_state_lpc_syn, 0, LPC_SHB_ORDER );
     211          21 :             st->hBWE_TD->fb_tbe_demph = 0;
     212          21 :             fb_tbe_reset_enc( st->hBWE_TD->elliptic_bpf_2_48k_mem, &st->hBWE_TD->prev_fb_energy );
     213             :         }
     214             : 
     215             :         /* reset FD BWE buffers */
     216          25 :         st->hBWE_FD->prev_mode = NORMAL;
     217             : 
     218             :         /* reset the unvoiced/audio signal improvement  memories */
     219          25 :         st->hGSCEnc->seed_tcx = 15687;
     220             : 
     221          25 :         st->use_acelp_preq = 0;
     222             : 
     223          25 :         set_f( st->hSpMusClas->finc_prev, 0.0f, ATT_NSEG );
     224          25 :         st->hSpMusClas->lt_finc = 0.0f;
     225          25 :         st->hSpMusClas->last_strong_attack = 0;
     226          25 :         set_f( st->hSpMusClas->tod_lt_Bin_E, 0.0f, TOD_NSPEC );
     227          25 :         set_f( st->hSpMusClas->tod_S_map_lt, 0.0f, TOD_NSPEC );
     228          25 :         st->hSpMusClas->tod_thr_lt = TOD_THR_MASS;
     229          25 :         st->hSpMusClas->tod_weight = 0.0f;
     230          25 :         st->hSpMusClas->tod_S_mass_prev = TOD_THR_MASS;
     231          25 :         st->hSpMusClas->tod_S_mass_lt = TOD_THR_MASS;
     232             :     }
     233             :     else /* switching to AMR-WB IO mode */
     234             :     {
     235          20 :         set_f( st->mem_MA, 0, M );
     236             : 
     237             :         /* AMR-WB IO mode uses ISF(ISP), but EVS primary mode LSF(LSP) */
     238          20 :         mvr2r( stable_ISP, xsp_tmp, M );
     239          20 :         lsf2isf( st->lsf_old, st->lsf_old, xsp_tmp, M, INT_FS_12k8 );
     240          20 :         mvr2r( stable_ISP, xsp_tmp, M );
     241          20 :         lsp2isp( st->lsp_old, st->lsp_old, xsp_tmp, M );
     242          20 :         mvr2r( st->lsp_old, st->lsp_old1, M );
     243          20 :         lsp2isp( st->lsp_old1, st->lsp_old1, xsp_tmp, M );
     244          20 :         mvr2r( stable_ISP, xsp_tmp, M );
     245          20 :         lsp2isp( st->hDtxEnc->lspCNG, st->hDtxEnc->lspCNG, xsp_tmp, M );
     246          20 :         if ( st->hTdCngEnc->old_enr_index >= 0 )
     247             :         {
     248           0 :             st->hTdCngEnc->old_enr_index = min( (int16_t) ( (float) st->hTdCngEnc->old_enr_index / STEP_SID * STEP_AMR_WB_SID ), 63 );
     249             :         }
     250             : 
     251             :         /* gain quantization memory */
     252          20 :         set_f( st->hAmrwb_IO->past_qua_en, -14.0f, GAIN_PRED_ORDER );
     253             : 
     254             :         /* reset VBR signaling */
     255          20 :         if ( st->Opt_SC_VBR )
     256             :         {
     257           0 :             st->hSC_VBR->ppp_mode = 0;
     258           0 :             st->hSC_VBR->nelp_mode = 0;
     259             :         }
     260             : 
     261             :         /* reset the unvoiced/audio signal improvement  memories */
     262          20 :         st->hGSCEnc->seed_tcx = 15687;
     263             :     }
     264             : 
     265          45 :     if ( st->hTdCngEnc != NULL )
     266             :     {
     267             :         /* Force SID in case of AMR-WB IO mode/EVS primary mode switching */
     268          45 :         st->hDtxEnc->cnt_SID = 0;
     269          45 :         st->hDtxEnc->cng_cnt = 0;
     270          45 :         st->hTdCngEnc->ho_hist_size = 0;
     271          45 :         st->hTdCngEnc->burst_ho_cnt = 0;
     272             :     }
     273             : 
     274             :     /* LP memories */
     275          45 :     mvr2r( UVWB_Ave, st->mem_AR, M );
     276             : 
     277             :     /* FEC - update adaptive LSF mean vector */
     278          45 :     mvr2r( st->lsf_old, st->lsfoldbfi0, M );
     279          45 :     mvr2r( st->lsf_old, st->lsfoldbfi1, M );
     280          45 :     mvr2r( st->lsf_old, st->lsf_adaptive_mean, M );
     281             : 
     282          45 :     return;
     283             : }
     284             : 
     285             : 
     286             : /*-------------------------------------------------------------------*
     287             :  * updt_enc_common()
     288             :  *
     289             :  * Common updates for MODE1 and MODE2
     290             :  *-------------------------------------------------------------------*/
     291             : 
     292    15624663 : void updt_enc_common(
     293             :     Encoder_State *st /* i/o: encoder state structure     */
     294             : )
     295             : {
     296             :     /*---------------------------------------------------------------------*
     297             :      * Updates - main main codec parameters
     298             :      *---------------------------------------------------------------------*/
     299             : 
     300    15624663 :     st->last_sr_core = st->sr_core;
     301    15624663 :     st->last_codec_mode = st->codec_mode;
     302    15624663 :     st->last_L_frame = st->L_frame;
     303    15624663 :     st->last_core = st->core;
     304             : 
     305    15624663 :     st->last_total_brate = st->total_brate;
     306    15624663 :     st->last_bits_frame_nominal = st->bits_frame_nominal;
     307    15624663 :     st->last_core_brate = st->core_brate;
     308    15624663 :     st->last_extl = st->extl;
     309    15624663 :     st->last_input_bwidth = st->input_bwidth;
     310    15624663 :     st->last_bwidth = st->bwidth;
     311    15624663 :     st->last_coder_type_raw = st->coder_type_raw;
     312             : 
     313    15624663 :     if ( st->core_brate > SID_2k40 && st->hDtxEnc != NULL )
     314             :     {
     315     1828231 :         st->hDtxEnc->last_active_brate = st->total_brate;
     316             :     }
     317             : 
     318    15624663 :     if ( st->hBWE_TD != NULL )
     319             :     {
     320     4571089 :         if ( st->core == HQ_CORE )
     321             :         {
     322             :             /* in the HQ core, coder_type is not used so it could have been set to anything */
     323       84723 :             st->hBWE_TD->prev_coder_type = GENERIC;
     324             :         }
     325             :         else
     326             :         {
     327     4486366 :             st->hBWE_TD->prev_coder_type = st->coder_type;
     328             :         }
     329             :     }
     330             : 
     331    15624663 :     if ( st->Opt_DTX_ON && st->hTdCngEnc != NULL )
     332             :     {
     333      740524 :         if ( st->core_brate > SID_2k40 )
     334             :         {
     335      689450 :             if ( st->hDtxEnc->first_CNG == 1 )
     336             :             {
     337      288299 :                 if ( st->hTdCngEnc->act_cnt >= BUF_DEC_RATE )
     338             :                 {
     339       11284 :                     st->hTdCngEnc->act_cnt = 0;
     340             :                 }
     341      288299 :                 st->hTdCngEnc->act_cnt++;
     342             : 
     343      288299 :                 if ( st->hTdCngEnc->act_cnt == BUF_DEC_RATE && st->hTdCngEnc->ho_hist_size > 0 )
     344             :                 {
     345        2151 :                     st->hTdCngEnc->ho_hist_size--;
     346             :                 }
     347             :             }
     348             : 
     349      689450 :             if ( st->element_mode == IVAS_SCE || st->element_mode == IVAS_CPE_DFT || st->element_mode == IVAS_CPE_TD || st->hDtxEnc->first_CNG == 1 )
     350             :             {
     351      675652 :                 if ( ++( st->hTdCngEnc->act_cnt2 ) >= MIN_ACT_CNG_UPD )
     352             :                 {
     353      625573 :                     st->hTdCngEnc->act_cnt2 = MIN_ACT_CNG_UPD;
     354             :                 }
     355             : 
     356      675652 :                 if ( ( st->element_mode == IVAS_SCE || st->element_mode == IVAS_CPE_DFT || st->element_mode == IVAS_CPE_TD ) && st->hTdCngEnc->act_cnt2 >= MIN_ACT_CNG_UPD )
     357             :                 {
     358      621884 :                     st->hTdCngEnc->CNG_att = 0.0f;
     359             : 
     360      621884 :                     apply_scale( &st->hTdCngEnc->CNG_att, st->hFdCngEnc->hFdCngCom->CngBandwidth, st->hFdCngEnc->hFdCngCom->CngBitrate, scaleTableStereo, SIZE_SCALE_TABLE_STEREO );
     361             :                 }
     362             :             }
     363             :         }
     364             : 
     365      740524 :         if ( ( st->core_brate == SID_2k40 || st->core_brate == FRAME_NO_DATA ) && st->hDtxEnc->first_CNG == 0 && st->cng_type == LP_CNG )
     366             :         {
     367          86 :             st->hDtxEnc->first_CNG = 1;
     368             :         }
     369             :     }
     370             : 
     371             :     /*-----------------------------------------------------------------*
     372             :      * Increase the counter of initialization frames
     373             :      * Limit the max number of init. frames
     374             :      *-----------------------------------------------------------------*/
     375             : 
     376    15624663 :     if ( st->ini_frame < MAX_FRAME_COUNTER )
     377             :     {
     378     2649460 :         ( st->ini_frame )++;
     379             :     }
     380             : 
     381             :     /* synchronisation of CNG seeds */
     382    15624663 :     if ( st->hTdCngEnc != NULL && st->core_brate != FRAME_NO_DATA && st->core_brate != SID_2k40 && st->core != AMR_WB_CORE )
     383             :     {
     384      765808 :         own_random( &( st->hTdCngEnc->cng_seed ) );
     385      765808 :         own_random( &( st->hTdCngEnc->cng_ener_seed ) );
     386             :     }
     387             : 
     388             :     /*---------------------------------------------------------------------*
     389             :      * Updates - MODE2
     390             :      *---------------------------------------------------------------------*/
     391             : 
     392    15624663 :     if ( st->element_mode == EVS_MONO && st->mdct_sw == MODE2 )
     393             :     {
     394         935 :         st->codec_mode = MODE2;
     395             : 
     396         935 :         st->sr_core = getCoreSamplerateMode2( EVS_MONO, st->total_brate, st->bwidth, st->flag_ACELP16k, st->rf_mode, 0 );
     397             : 
     398         935 :         st->L_frame = (int16_t) ( st->sr_core / FRAMES_PER_SEC );
     399             : 
     400         935 :         if ( st->sr_core == INT_FS_12k8 )
     401             :         {
     402           0 :             st->preemph_fac = PREEMPH_FAC;
     403           0 :             st->gamma = GAMMA1;
     404             :         }
     405             :         else
     406             :         {
     407         935 :             st->preemph_fac = PREEMPH_FAC_16k;
     408         935 :             st->gamma = GAMMA16k;
     409             :         }
     410             : 
     411         935 :         st->igf = getIgfPresent( EVS_MONO, st->total_brate, st->bwidth, st->rf_mode );
     412             :     }
     413             : 
     414             :     /* update FER clas */
     415    15624663 :     if ( st->core != AMR_WB_CORE )
     416             :     {
     417    15619367 :         st->last_clas = st->clas;
     418             :     }
     419             : 
     420             :     /* Update Core */
     421    15624663 :     core_encode_update( st );
     422             : 
     423             :     /*---------------------------------------------------------------------*
     424             :      * RF mode updates
     425             :      *---------------------------------------------------------------------*/
     426             : 
     427    15624663 :     if ( st->rf_mode )
     428             :     {
     429        1600 :         if ( st->hSC_VBR != NULL )
     430             :         {
     431        1600 :             if ( st->hRF->rf_frame_type == RF_NELP )
     432             :             {
     433          40 :                 st->hSC_VBR->last_nelp_mode = 1;
     434             :             }
     435             :             else
     436             :             {
     437        1560 :                 st->hSC_VBR->last_nelp_mode = 0;
     438             :             }
     439             :         }
     440             :     }
     441             : 
     442    15624663 :     st->rf_mode_last = st->rf_mode;
     443             : 
     444    15624663 :     if ( st->Opt_RF_ON )
     445             :     {
     446        1600 :         st->L_frame = L_FRAME;
     447        1600 :         st->rf_mode = 1;
     448             :     }
     449             : 
     450             :     /*---------------------------------------------------------------------*
     451             :      * Other updates
     452             :      *---------------------------------------------------------------------*/
     453             : 
     454    15624663 :     if ( st->element_mode > EVS_MONO && st->hTcxEnc != NULL )
     455             :     {
     456    15493817 :         st->hTcxEnc->tcxltp_norm_corr_mem = st->hTcxEnc->tcxltp_norm_corr_past;
     457             :     }
     458             : 
     459    15624663 :     return;
     460             : }

Generated by: LCOV version 1.14