LCOV - code coverage report
Current view: top level - lib_dec - decision_matrix_dec.c (source / functions) Hit Total Coverage
Test: Coverage on main -- conformance test test_26252.py @ efe53129c9ed87a5067dd0a8fb9dca41db9c4add Lines: 104 231 45.0 %
Date: 2026-02-12 06:30:15 Functions: 1 1 100.0 %

          Line data    Source code
       1             : /******************************************************************************************************
       2             : 
       3             :    (C) 2022-2026 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 "stat_dec.h"
      43             : #include "rom_com.h"
      44             : #include "prot.h"
      45             : #include "wmc_auto.h"
      46             : 
      47             : /*-----------------------------------------------------------------*
      48             :  * decision_matrix_dec()
      49             :  *
      50             :  * ACELP/HQ core selection
      51             :  * Read ACELP signaling bits from the bitstream
      52             :  * Set extension layers
      53             :  *-----------------------------------------------------------------*/
      54             : 
      55        2617 : void decision_matrix_dec(
      56             :     Decoder_State *st,           /* i/o: decoder state structure             */
      57             :     int16_t *sharpFlag,          /* o  : formant sharpening flag             */
      58             :     int16_t *hq_core_type,       /* o  : HQ core type                        */
      59             :     int16_t *core_switching_flag /* o  : ACELP->HQ switching frame flag      */
      60             : )
      61             : {
      62             :     int16_t start_idx;
      63             :     int16_t ppp_nelp_mode;
      64             :     int32_t ind;
      65             :     int16_t nBits;
      66             :     int16_t tmp;
      67             : 
      68             :     /* init */
      69        2617 :     st->core = -1;
      70        2617 :     st->core_brate = 0;
      71        2617 :     st->extl = -1;
      72        2617 :     st->extl_brate = 0;
      73        2617 :     st->ppp_mode_dec = 0;
      74        2617 :     st->nelp_mode_dec = 0;
      75        2617 :     st->igf = 0;
      76             : 
      77        2617 :     if ( st->total_brate > ACELP_8k00 )
      78             :     {
      79        2617 :         st->vbr_hw_BWE_disable_dec = 0;
      80             :     }
      81             : 
      82        2617 :     if ( st->mdct_sw == MODE2 )
      83             :     {
      84         150 :         st->core = HQ_CORE;
      85             :     }
      86             :     else
      87             :     {
      88        2467 :         if ( st->total_brate == FRAME_NO_DATA || st->total_brate == SID_2k40 )
      89             :         {
      90           0 :             st->core = ACELP_CORE;
      91           0 :             st->core_brate = st->total_brate;
      92             : 
      93           0 :             if ( st->total_brate != FRAME_NO_DATA )
      94             :             {
      95           0 :                 st->cng_type = get_next_indice( st, 1 );
      96             : 
      97           0 :                 if ( st->cng_type == LP_CNG )
      98             :                 {
      99           0 :                     st->L_frame = L_FRAME;
     100             : 
     101           0 :                     if ( get_next_indice( st, 1 ) == 1 )
     102             :                     {
     103           0 :                         st->L_frame = L_FRAME16k;
     104           0 :                         st->nb_subfr = NB_SUBFR16k;
     105           0 :                         st->bwidth = max( st->bwidth, WB );
     106             :                     }
     107             :                 }
     108             :                 else
     109             :                 {
     110           0 :                     st->bwidth = get_next_indice( st, 2 );
     111             : 
     112           0 :                     if ( get_next_indice( st, 1 ) == 0 )
     113             :                     {
     114           0 :                         st->L_frame = L_FRAME;
     115             :                     }
     116             :                     else
     117             :                     {
     118           0 :                         st->L_frame = L_FRAME16k;
     119             :                     }
     120             :                 }
     121             :             }
     122             : 
     123           0 :             if ( st->output_Fs >= 32000 && st->bwidth >= SWB )
     124             :             {
     125           0 :                 st->extl = SWB_CNG;
     126             :             }
     127             : 
     128           0 :             if ( st->total_brate == FRAME_NO_DATA && st->prev_bfi && !st->bfi && st->L_frame > L_FRAME16k )
     129             :             {
     130           0 :                 st->L_frame = st->last_CNG_L_frame;
     131             :             }
     132             : 
     133           0 :             return;
     134             :         }
     135             : 
     136             :         /* SC-VBR */
     137        2467 :         else if ( st->total_brate == PPP_NELP_2k80 )
     138             :         {
     139           0 :             st->core = ACELP_CORE;
     140           0 :             st->core_brate = PPP_NELP_2k80;
     141           0 :             st->L_frame = L_FRAME;
     142           0 :             st->fscale = sr2fscale( INT_FS_12k8 );
     143             : 
     144           0 :             if ( st->ini_frame == 0 )
     145             :             {
     146             :                 /* avoid switching of internal ACELP Fs in the very first frame */
     147           0 :                 st->last_L_frame = st->L_frame;
     148           0 :                 st->last_core = st->core;
     149           0 :                 st->last_core_brate = st->core_brate;
     150           0 :                 st->last_extl = st->extl;
     151             :             }
     152             : 
     153           0 :             st->vbr_hw_BWE_disable_dec = 1;
     154             : 
     155           0 :             get_next_indice( st, 1 );
     156             : 
     157           0 :             ppp_nelp_mode = get_next_indice( st, 2 );
     158             : 
     159             :             /* 0 - PPP_NB, 1 - PPP_WB, 2 - NELP_NB, 3 - NELP_WB */
     160           0 :             if ( ppp_nelp_mode == 0 )
     161             :             {
     162           0 :                 st->ppp_mode_dec = 1;
     163           0 :                 st->coder_type = VOICED;
     164           0 :                 st->bwidth = NB;
     165             :             }
     166           0 :             else if ( ppp_nelp_mode == 1 )
     167             :             {
     168           0 :                 st->ppp_mode_dec = 1;
     169           0 :                 st->coder_type = VOICED;
     170           0 :                 st->bwidth = WB;
     171             :             }
     172           0 :             else if ( ppp_nelp_mode == 2 )
     173             :             {
     174           0 :                 st->nelp_mode_dec = 1;
     175           0 :                 st->coder_type = UNVOICED;
     176           0 :                 st->bwidth = NB;
     177             :             }
     178           0 :             else if ( ppp_nelp_mode == 3 )
     179             :             {
     180           0 :                 st->nelp_mode_dec = 1;
     181           0 :                 st->coder_type = UNVOICED;
     182           0 :                 st->bwidth = WB;
     183             :             }
     184             : 
     185           0 :             return;
     186             :         }
     187             : 
     188             :         /*---------------------------------------------------------------------*
     189             :          * ACELP/HQ core selection
     190             :          *---------------------------------------------------------------------*/
     191             : 
     192        2467 :         if ( st->total_brate < ACELP_24k40 )
     193             :         {
     194        1467 :             st->core = ACELP_CORE;
     195             :         }
     196        1000 :         else if ( st->total_brate >= ACELP_24k40 && st->total_brate <= ACELP_64k )
     197             :         {
     198             :             /* read the ACELP/HQ core selection bit */
     199        1000 :             tmp = get_next_indice( st, 1 );
     200             : 
     201        1000 :             if ( tmp == 0 )
     202             :             {
     203         669 :                 st->core = ACELP_CORE;
     204             :             }
     205             :             else
     206             :             {
     207         331 :                 st->core = HQ_CORE;
     208             :             }
     209             :         }
     210             :     }
     211             : 
     212             :     /*-----------------------------------------------------------------*
     213             :      * Read ACELP signaling bits from the bitstream
     214             :      *-----------------------------------------------------------------*/
     215             : 
     216        2617 :     if ( st->core == ACELP_CORE )
     217             :     {
     218             :         /* find the section in the ACELP signaling table corresponding to bitrate */
     219        2136 :         start_idx = 0;
     220      108879 :         while ( acelp_sig_tbl[start_idx] != st->total_brate )
     221             :         {
     222      106743 :             start_idx++;
     223      106743 :             if ( start_idx >= MAX_ACELP_SIG )
     224             :             {
     225           0 :                 st->BER_detect = 1;
     226           0 :                 start_idx = 0;
     227           0 :                 break;
     228             :             }
     229             :         }
     230             : 
     231             :         /* skip the bitrate */
     232        2136 :         start_idx += 1;
     233             : 
     234             :         /* retrieve the number of bits */
     235        2136 :         nBits = (int16_t) acelp_sig_tbl[start_idx++];
     236             : 
     237        2136 :         start_idx += get_next_indice( st, nBits );
     238        2136 :         if ( start_idx >= MAX_ACELP_SIG )
     239             :         {
     240           0 :             ind = 0;
     241           0 :             st->BER_detect = 1;
     242             :         }
     243             :         else
     244             :         {
     245             :             /* retrieve the signaling indice */
     246        2136 :             ind = acelp_sig_tbl[start_idx];
     247             : 
     248             :             /* convert signaling indice into signaling information */
     249        2136 :             st->coder_type = ind & 0x7;
     250        2136 :             if ( st->coder_type == LR_MDCT )
     251             :             {
     252          54 :                 st->core = HQ_CORE;
     253          54 :                 st->bwidth = ( ind >> 3 ) & 0x7;
     254             :             }
     255             :             else
     256             :             {
     257        2082 :                 st->bwidth = ( ind >> 3 ) & 0x7;
     258        2082 :                 *sharpFlag = ( ind >> 6 ) & 0x1;
     259             :             }
     260             :         }
     261             : 
     262             :         /* detect corrupted signaling (due to bit errors) */
     263        2136 :         if ( ( st->BER_detect ) ||
     264        2136 :              ( ind >= 1 << 7 ) ||
     265        2136 :              ( st->total_brate <= ACELP_13k20 && st->bwidth == FB ) ||
     266        2136 :              ( st->total_brate >= ACELP_32k && st->bwidth == NB ) ||
     267        2136 :              ( st->total_brate >= ACELP_32k && !( st->coder_type == GENERIC || st->coder_type == TRANSITION || st->coder_type == INACTIVE ) ) ||
     268        2136 :              ( st->total_brate < ACELP_13k20 && st->bwidth != NB && st->coder_type == LR_MDCT ) ||
     269        2136 :              ( st->total_brate >= ACELP_13k20 && st->coder_type == UNVOICED ) ||
     270        2136 :              ( st->total_brate >= ACELP_13k20 && st->coder_type == AUDIO && st->bwidth == NB ) )
     271             :         {
     272           0 :             st->BER_detect = 0;
     273           0 :             st->bfi = 1;
     274           0 :             if ( st->ini_frame == 0 )
     275             :             {
     276           0 :                 st->core = ACELP_CORE;
     277           0 :                 st->L_frame = L_FRAME;
     278           0 :                 st->last_core = st->core;
     279           0 :                 st->last_core_brate = st->core_brate;
     280             :             }
     281           0 :             else if ( st->last_total_brate == -1 ) /* can happen in case of BER when no good frame was received before */
     282             :             {
     283           0 :                 st->coder_type = st->last_coder_type;
     284           0 :                 st->bwidth = st->last_bwidth;
     285           0 :                 st->total_brate = st->last_total_brate_ber;
     286           0 :                 if ( st->last_core == AMR_WB_CORE )
     287             :                 {
     288           0 :                     st->core = ACELP_CORE;
     289           0 :                     st->codec_mode = MODE1;
     290             :                 }
     291           0 :                 else if ( st->last_core_bfi == TCX_20_CORE || st->last_core_bfi == TCX_10_CORE )
     292             :                 {
     293           0 :                     st->core = st->last_core_bfi;
     294           0 :                     st->codec_mode = MODE2;
     295             :                 }
     296             :                 else
     297             :                 {
     298           0 :                     st->core = st->last_core;
     299           0 :                     st->codec_mode = MODE1;
     300             :                 }
     301           0 :                 st->core_brate = st->last_core_brate;
     302           0 :                 st->extl = st->last_extl;
     303           0 :                 st->extl_brate = st->total_brate - st->core_brate;
     304             :             }
     305             :             else
     306             :             {
     307           0 :                 st->coder_type = st->last_coder_type;
     308           0 :                 st->bwidth = st->last_bwidth;
     309           0 :                 st->total_brate = st->last_total_brate;
     310           0 :                 if ( st->last_core == AMR_WB_CORE )
     311             :                 {
     312           0 :                     st->core = ACELP_CORE;
     313           0 :                     st->codec_mode = MODE1;
     314             :                 }
     315           0 :                 else if ( st->last_core == TCX_20_CORE || st->last_core == TCX_10_CORE )
     316             :                 {
     317           0 :                     st->core = st->last_core;
     318           0 :                     st->codec_mode = MODE2;
     319             :                 }
     320             :                 else
     321             :                 {
     322           0 :                     st->core = st->last_core;
     323           0 :                     st->codec_mode = MODE1;
     324             :                 }
     325           0 :                 st->core_brate = st->last_core_brate;
     326           0 :                 st->extl = st->last_extl;
     327           0 :                 st->extl_brate = st->total_brate - st->core_brate;
     328             :             }
     329           0 :             return;
     330             :         }
     331             :     }
     332             : 
     333             :     /*-----------------------------------------------------------------*
     334             :      * Set extension layers
     335             :      *-----------------------------------------------------------------*/
     336             : 
     337        2617 :     if ( st->core == ACELP_CORE && st->bwidth == WB && st->total_brate < ACELP_9k60 )
     338             :     {
     339           0 :         if ( st->vbr_hw_BWE_disable_dec == 0 )
     340             :         {
     341           0 :             st->extl = WB_BWE;
     342             :         }
     343             :     }
     344        2617 :     else if ( st->core == ACELP_CORE && st->bwidth == WB && st->total_brate >= ACELP_9k60 && st->total_brate <= ACELP_16k40 )
     345             :     {
     346             :         /* read the WB TBE/BWE selection bit */
     347           0 :         if ( get_next_indice( st, 1 ) )
     348             :         {
     349           0 :             st->extl = WB_BWE;
     350           0 :             st->extl_brate = WB_BWE_0k35;
     351             :         }
     352             :         else
     353             :         {
     354           0 :             st->extl = WB_TBE;
     355           0 :             st->extl_brate = WB_TBE_1k05;
     356             :         }
     357             :     }
     358        2617 :     else if ( st->core == ACELP_CORE && ( st->bwidth == SWB || st->bwidth == FB ) && st->total_brate >= ACELP_13k20 )
     359             :     {
     360        2082 :         if ( st->total_brate >= ACELP_48k )
     361             :         {
     362         669 :             st->extl = SWB_BWE_HIGHRATE;
     363         669 :             if ( st->bwidth == FB )
     364             :             {
     365           0 :                 st->extl = FB_BWE_HIGHRATE;
     366             :             }
     367             : 
     368         669 :             st->extl_brate = SWB_BWE_16k;
     369             :         }
     370             : 
     371             :         /* read the SWB TBE/BWE selection bit */
     372             :         else
     373             :         {
     374        1413 :             tmp = get_next_indice( st, 1 );
     375             : 
     376        1413 :             if ( tmp )
     377             :             {
     378           6 :                 st->extl = SWB_BWE;
     379           6 :                 st->extl_brate = SWB_BWE_1k6;
     380             :             }
     381             :             else
     382             :             {
     383        1407 :                 st->extl = SWB_TBE;
     384        1407 :                 st->extl_brate = SWB_TBE_1k6;
     385        1407 :                 if ( st->total_brate >= ACELP_24k40 )
     386             :                 {
     387           0 :                     st->extl_brate = SWB_TBE_2k8;
     388             :                 }
     389             :             }
     390             :         }
     391             : 
     392             :         /* set FB TBE and FB BWE extension layers */
     393        2082 :         if ( st->bwidth == FB && st->total_brate >= ACELP_24k40 )
     394             :         {
     395           0 :             if ( st->extl == SWB_BWE )
     396             :             {
     397           0 :                 st->extl = FB_BWE;
     398           0 :                 st->extl_brate = FB_BWE_1k8;
     399             :             }
     400           0 :             else if ( st->extl == SWB_TBE )
     401             :             {
     402           0 :                 st->extl = FB_TBE;
     403           0 :                 st->extl_brate = FB_TBE_3k0;
     404             :             }
     405             :         }
     406             :     }
     407             : 
     408             :     /* set core bitrate */
     409        2617 :     st->core_brate = st->total_brate - st->extl_brate;
     410             : 
     411             :     /*-----------------------------------------------------------------*
     412             :      * Read HQ signaling bits from the bitstream
     413             :      * Set HQ core type
     414             :      *-----------------------------------------------------------------*/
     415             : 
     416        2617 :     if ( st->core == HQ_CORE )
     417             :     {
     418         535 :         if ( st->mdct_sw != MODE2 )
     419             :         {
     420             :             /* skip the HQ/TCX core switching flag */
     421         385 :             get_next_indice_tmp( st, 1 );
     422             :         }
     423             : 
     424             :         /* read ACELP->HQ core switching flag */
     425         535 :         *core_switching_flag = get_next_indice( st, 1 );
     426             : 
     427         535 :         if ( *core_switching_flag == 1 )
     428             :         {
     429          35 :             st->last_L_frame_ori = st->last_L_frame;
     430             : 
     431             :             /* read ACELP L_frame info */
     432          35 :             if ( get_next_indice( st, 1 ) == 0 )
     433             :             {
     434           7 :                 st->last_L_frame = L_FRAME;
     435             :             }
     436             :             else
     437             :             {
     438          28 :                 st->last_L_frame = L_FRAME16k;
     439             :             }
     440             :         }
     441             : 
     442         535 :         if ( st->mdct_sw != MODE2 )
     443             :         {
     444             :             /* read/set band-width (needed for different I/O sampling rate support) */
     445         385 :             if ( st->total_brate > ACELP_16k40 )
     446             :             {
     447         331 :                 ind = get_next_indice( st, 2 );
     448             : 
     449         331 :                 if ( ind == 0 )
     450             :                 {
     451           0 :                     st->bwidth = NB;
     452             :                 }
     453         331 :                 else if ( ind == 1 )
     454             :                 {
     455           0 :                     st->bwidth = WB;
     456             :                 }
     457         331 :                 else if ( ind == 2 )
     458             :                 {
     459         331 :                     st->bwidth = SWB;
     460             :                 }
     461             :                 else
     462             :                 {
     463           0 :                     st->bwidth = FB;
     464             :                 }
     465             :             }
     466             :         }
     467             : 
     468             :         /* detect bit errors in signaling */
     469         535 :         if ( ( ( st->total_brate >= ACELP_24k40 && st->bwidth == NB ) ||
     470         535 :                ( st->core == HQ_CORE && st->total_brate <= LRMDCT_CROSSOVER_POINT && st->bwidth == FB ) ) )
     471             :         {
     472           0 :             st->bfi = 1;
     473             : 
     474           0 :             st->core_brate = st->total_brate;
     475           0 :             st->extl = -1;
     476           0 :             st->extl_brate = 0;
     477           0 :             if ( st->last_core == AMR_WB_CORE )
     478             :             {
     479           0 :                 st->core = ACELP_CORE;
     480           0 :                 st->L_frame = L_FRAME;
     481           0 :                 st->codec_mode = MODE1;
     482           0 :                 st->last_L_frame = L_FRAME;
     483             : 
     484           0 :                 if ( st->total_brate >= ACELP_16k40 )
     485             :                 {
     486           0 :                     st->total_brate = ACELP_13k20;
     487           0 :                     st->core_brate = st->total_brate;
     488             :                 }
     489             :             }
     490             :             else
     491             :             {
     492             :                 /* make sure, we are in a valid configuration wrt to bandwidth */
     493           0 :                 st->bwidth = WB;
     494             :             }
     495             :         }
     496             : 
     497             :         /* set HQ core type */
     498         535 :         *hq_core_type = NORMAL_HQ_CORE;
     499         535 :         if ( ( st->bwidth == SWB || st->bwidth == WB ) && st->total_brate <= LRMDCT_CROSSOVER_POINT )
     500             :         {
     501          54 :             *hq_core_type = LOW_RATE_HQ_CORE;
     502             :         }
     503         481 :         else if ( st->bwidth == NB )
     504             :         {
     505           0 :             *hq_core_type = LOW_RATE_HQ_CORE;
     506             :         }
     507             :     }
     508             : 
     509             :     /*-----------------------------------------------------------------*
     510             :      * Set ACELP frame length
     511             :      *-----------------------------------------------------------------*/
     512             : 
     513        2617 :     if ( st->core_brate == FRAME_NO_DATA )
     514             :     {
     515             :         /* prevent "L_frame" changes in CNG segments */
     516           0 :         st->L_frame = st->last_L_frame;
     517             :     }
     518        2617 :     else if ( st->core_brate == SID_2k40 && st->bwidth == WB && st->first_CNG && st->hTdCngDec->act_cnt2 < MIN_ACT_CNG_UPD )
     519             :     {
     520             :         /* prevent "L_frame" changes in SID frame after short segment of active frames */
     521           0 :         st->L_frame = st->last_CNG_L_frame;
     522             :     }
     523        2617 :     else if ( ( st->core_brate == SID_2k40 && st->total_brate >= ACELP_9k60 && st->bwidth == WB ) || ( st->total_brate >= ACELP_32k && st->total_brate < HQ_96k ) || ( st->total_brate == ACELP_24k40 && st->bwidth >= WB ) )
     524             :     {
     525        1150 :         st->L_frame = L_FRAME16k;
     526             :     }
     527             :     else
     528             :     {
     529        1467 :         st->L_frame = L_FRAME;
     530             :     }
     531             : 
     532        2617 :     if ( st->L_frame == L_FRAME16k )
     533             :     {
     534        1150 :         st->nb_subfr = NB_SUBFR16k;
     535             :     }
     536             :     else
     537             :     {
     538        1467 :         st->nb_subfr = NB_SUBFR;
     539             :     }
     540             : 
     541        2617 :     st->extl_orig = st->extl;
     542        2617 :     st->extl_brate_orig = st->extl_brate;
     543             : 
     544        2617 :     if ( st->output_Fs == 8000 )
     545             :     {
     546           0 :         st->extl = -1;
     547             :     }
     548        2617 :     else if ( st->output_Fs == 16000 && st->L_frame == L_FRAME16k )
     549             :     {
     550           0 :         st->extl = -1;
     551           0 :         st->extl_brate = 0;
     552             :     }
     553             : 
     554        2617 :     if ( st->ini_frame == 0 )
     555             :     {
     556             :         /* avoid switching of internal ACELP Fs in the very first frame */
     557           3 :         st->last_L_frame = st->L_frame;
     558           3 :         st->last_core = st->core;
     559           3 :         st->last_core_brate = st->core_brate;
     560           3 :         st->last_extl = st->extl;
     561             :     }
     562             : 
     563             :     /*-----------------------------------------------------------------*
     564             :      * set inactive coder_type flag in ACELP core
     565             :      *-----------------------------------------------------------------*/
     566             : 
     567        2617 :     st->inactive_coder_type_flag = 0; /* AVQ by default */
     568        2617 :     if ( st->total_brate <= MAX_GSC_INACTIVE_BRATE )
     569             :     {
     570        1617 :         st->inactive_coder_type_flag = 1; /* GSC */
     571             :     }
     572             : 
     573        2617 :     return;
     574             : }

Generated by: LCOV version 1.14