LCOV - code coverage report
Current view: top level - lib_com - tcx_ltp.c (source / functions) Hit Total Coverage
Test: Coverage on main -- merged total coverage @ efe53129c9ed87a5067dd0a8fb9dca41db9c4add Lines: 414 431 96.1 %
Date: 2026-02-12 08:06:51 Functions: 12 12 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 <assert.h>
      38             : #include <stdint.h>
      39             : #include "options.h"
      40             : #ifdef DEBUGGING
      41             : #include "debug.h"
      42             : #endif
      43             : #include "prot.h"
      44             : #include "rom_com.h"
      45             : #include "wmc_auto.h"
      46             : 
      47             : /*-------------------------------------------------------------------
      48             :  * Local constants
      49             :  *-------------------------------------------------------------------*/
      50             : 
      51             : #define ALPHA 0.85f
      52             : 
      53             : /*-------------------------------------------------------------------
      54             :  * tcx_ltp_get_lpc()
      55             :  *
      56             :  *
      57             :  *-------------------------------------------------------------------*/
      58             : 
      59       18625 : static void tcx_ltp_get_lpc(
      60             :     float *input,
      61             :     const int16_t length,
      62             :     float *A,
      63             :     const int16_t lpcorder )
      64             : {
      65             :     int16_t i, j;
      66             :     float s, r[TCXLTP_LTP_ORDER + 1];
      67             : 
      68      484250 :     for ( i = 0; i <= lpcorder; i++ )
      69             :     {
      70      465625 :         s = 0.0;
      71             : 
      72   335238125 :         for ( j = 0; j < length - i; j++ )
      73             :         {
      74   334772500 :             s += input[j] * input[j + i];
      75             :         }
      76      465625 :         r[i] = s;
      77             :     }
      78             : 
      79       18625 :     if ( r[0] < 100.0f )
      80             :     {
      81           0 :         r[0] = 100.0f;
      82             :     }
      83       18625 :     r[0] *= 1.0001f;
      84             : 
      85       18625 :     lev_dur( A, r, lpcorder, NULL );
      86             : 
      87       18625 :     return;
      88             : }
      89             : 
      90             : 
      91             : /*-------------------------------------------------------------------
      92             :  * tcx_ltp_get_zir()
      93             :  *
      94             :  *
      95             :  *-------------------------------------------------------------------*/
      96             : 
      97       18625 : static void tcx_ltp_get_zir(
      98             :     float *zir,
      99             :     const int16_t length,
     100             :     float *synth_ltp,
     101             :     float *synth,
     102             :     float *A,
     103             :     const int16_t lpcorder,
     104             :     const float gain,
     105             :     const int16_t pitch_int,
     106             :     const int16_t pitch_fr,
     107             :     const int16_t pitres,
     108             :     const int16_t filtIdx )
     109             : {
     110             :     float buf[TCXLTP_LTP_ORDER], alpha, step;
     111             :     float *x0, *x1, s;
     112             :     float *y0, *y1, s2;
     113             :     const float *w0, *w1, *v0, *v1;
     114             :     int16_t i, j, k, L;
     115             : 
     116       18625 :     x0 = &synth_ltp[-pitch_int];
     117       18625 :     x1 = x0 - 1;
     118       18625 :     y0 = synth;
     119       18625 :     y1 = y0 - 1;
     120             : 
     121       18625 :     assert( filtIdx >= 0 );
     122             : 
     123       18625 :     w0 = &tcxLtpFilters[filtIdx].filt[pitch_fr];
     124       18625 :     w1 = &tcxLtpFilters[filtIdx].filt[pitres - pitch_fr];
     125       18625 :     v0 = &tcxLtpFilters[filtIdx].filt[0];
     126       18625 :     v1 = &tcxLtpFilters[filtIdx].filt[pitres];
     127       18625 :     L = tcxLtpFilters[filtIdx].length;
     128             : 
     129      465625 :     for ( j = 0; j < lpcorder; j++ )
     130             :     {
     131      447000 :         s = 0;
     132      447000 :         s2 = 0;
     133     2529408 :         for ( i = 0, k = 0; i < L; i++, k += pitres )
     134             :         {
     135     2082408 :             s += w0[k] * x0[i] + w1[k] * x1[-i];
     136     2082408 :             s2 += v0[k] * y0[i] + v1[k] * y1[-i];
     137             :         }
     138      447000 :         s2 *= ALPHA;
     139             : 
     140      447000 :         buf[j] = ( synth[j] - gain * s2 ) - ( synth_ltp[j] - gain * s );
     141             : 
     142             : 
     143      447000 :         x0++;
     144      447000 :         x1++;
     145      447000 :         y0++;
     146      447000 :         y1++;
     147             :     }
     148             : 
     149       18625 :     set_f( zir, 0.0f, length );
     150             : 
     151       18625 :     syn_filt( A, lpcorder, zir, zir, length, buf, 0 );
     152             : 
     153       18625 :     alpha = 1.f;
     154       18625 :     step = 1.f / (float) ( length / 2 );
     155             : 
     156     1720425 :     for ( j = length / 2; j < length; j++ )
     157             :     {
     158     1701800 :         zir[j] *= alpha;
     159     1701800 :         alpha -= step;
     160             :     }
     161             : 
     162       18625 :     return;
     163             : }
     164             : 
     165             : 
     166             : /*-------------------------------------------------------------------
     167             :  * predict_signal()
     168             :  *
     169             :  *
     170             :  *-------------------------------------------------------------------*/
     171             : 
     172    15477535 : void predict_signal(
     173             :     const float excI[],     /* i  : input excitation buffer  */
     174             :     float excO[],           /* o  : output excitation buffer */
     175             :     const int16_t T0,       /* i  : integer pitch lag        */
     176             :     int16_t frac,           /* i  : fraction of lag          */
     177             :     const int16_t frac_max, /* i  : max fraction             */
     178             :     const int16_t L_subfr   /* i  : subframe size            */
     179             : )
     180             : {
     181             :     int16_t j;
     182             :     float s;
     183             :     const float *x0, *win;
     184             : 
     185    15477535 :     x0 = &excI[-T0 - 1];
     186    15477535 :     frac = -frac;
     187             : 
     188    15477535 :     if ( frac < 0 )
     189             :     {
     190     7852512 :         frac += frac_max;
     191     7852512 :         x0--;
     192             :     }
     193             : 
     194    15477535 :     if ( frac_max == 6 )
     195             :     {
     196     2616687 :         win = &inter6_2tcx2[frac][0];
     197             :     }
     198             :     else
     199             :     {
     200    12860848 :         win = &inter4_2tcx2[frac][0];
     201             :     }
     202             : 
     203  4275916911 :     for ( j = 0; j < L_subfr; j++ )
     204             :     {
     205  4260439376 :         s = win[1] * x0[1] + win[2] * x0[2];
     206  4260439376 :         excO[j] = s + win[0] * x0[0] + win[3] * x0[3];
     207  4260439376 :         x0++;
     208             :     }
     209             : 
     210    15477535 :     return;
     211             : }
     212             : 
     213             : 
     214             : /*-------------------------------------------------------------------
     215             :  * tcx_ltp_synth_filter()
     216             :  *
     217             :  *
     218             :  *-------------------------------------------------------------------*/
     219             : 
     220   129271001 : static void tcx_ltp_synth_filter(
     221             :     float *synth_ltp,
     222             :     float *synth,
     223             :     const int16_t length,
     224             :     const int16_t pitch_int,
     225             :     const int16_t pitch_fr,
     226             :     const float gain,
     227             :     const int16_t pitch_res,
     228             :     const int16_t filtIdx )
     229             : {
     230             :     float *x0, *x1, s;
     231             :     float *y0, *y1, s2;
     232             :     const float *v0, *v1;
     233             :     const float *w0, *w1;
     234             :     int16_t i, j, k, L;
     235             : 
     236   129271001 :     if ( gain > 0.f )
     237             :     {
     238    23005358 :         x0 = &synth_ltp[-pitch_int];
     239    23005358 :         x1 = x0 - 1;
     240    23005358 :         y0 = synth;
     241    23005358 :         y1 = y0 - 1;
     242             : 
     243    23005358 :         assert( filtIdx >= 0 );
     244             : 
     245    23005358 :         w0 = &tcxLtpFilters[filtIdx].filt[pitch_fr];
     246    23005358 :         w1 = &tcxLtpFilters[filtIdx].filt[pitch_res - pitch_fr];
     247    23005358 :         v0 = &tcxLtpFilters[filtIdx].filt[0];
     248    23005358 :         v1 = &tcxLtpFilters[filtIdx].filt[pitch_res];
     249             : 
     250    23005358 :         L = tcxLtpFilters[filtIdx].length;
     251             : 
     252             : 
     253  6297836716 :         for ( j = 0; j < length; j++ )
     254             :         {
     255  6274831358 :             s = 0;
     256  6274831358 :             s2 = 0;
     257 47632243817 :             for ( i = 0, k = 0; i < L; i++, k += pitch_res )
     258             :             {
     259 41357412459 :                 s += w0[k] * x0[i] + w1[k] * x1[-i];
     260 41357412459 :                 s2 += v0[k] * y0[i] + v1[k] * y1[-i];
     261             :             }
     262             : 
     263  6274831358 :             s2 *= ALPHA;
     264  6274831358 :             synth_ltp[j] = synth[j] - gain * s2 + gain * s;
     265             : 
     266  6274831358 :             x0++;
     267  6274831358 :             x1++;
     268  6274831358 :             y0++;
     269  6274831358 :             y1++;
     270             :         }
     271             :     }
     272             :     else
     273             :     {
     274   106265643 :         mvr2r( synth, synth_ltp, length );
     275             :     }
     276             : 
     277   129271001 :     return;
     278             : }
     279             : 
     280             : 
     281             : /*-------------------------------------------------------------------
     282             :  * tcx_ltp_synth_filter_zir()
     283             :  *
     284             :  *
     285             :  *-------------------------------------------------------------------*/
     286             : 
     287       18625 : static void tcx_ltp_synth_filter_zir(
     288             :     float *synth_ltp,
     289             :     float *synth,
     290             :     const int16_t length,
     291             :     const int16_t pitch_int,
     292             :     const int16_t pitch_fr,
     293             :     const float gain,
     294             :     const int16_t pitch_res,
     295             :     float *zir,
     296             :     const int16_t filtIdx )
     297             : {
     298             :     float *x0, *x1, s;
     299             :     float *y0, *y1, s2;
     300             :     const float *v0, *v1;
     301             :     const float *w0, *w1;
     302             :     int16_t i, j, k, L;
     303             : 
     304       18625 :     x0 = &synth_ltp[-pitch_int];
     305       18625 :     x1 = x0 - 1;
     306       18625 :     y0 = synth;
     307       18625 :     y1 = y0 - 1;
     308             : 
     309       18625 :     assert( filtIdx >= 0 );
     310             : 
     311       18625 :     w0 = &tcxLtpFilters[filtIdx].filt[pitch_fr];
     312       18625 :     w1 = &tcxLtpFilters[filtIdx].filt[pitch_res - pitch_fr];
     313       18625 :     v0 = &tcxLtpFilters[filtIdx].filt[0];
     314       18625 :     v1 = &tcxLtpFilters[filtIdx].filt[pitch_res];
     315       18625 :     L = tcxLtpFilters[filtIdx].length;
     316             : 
     317     3422225 :     for ( j = 0; j < length; j++ )
     318             :     {
     319     3403600 :         s = 0;
     320     3403600 :         s2 = 0;
     321             : 
     322    20645360 :         for ( i = 0, k = 0; i < L; i++, k += pitch_res )
     323             :         {
     324    17241760 :             s += w0[k] * x0[i] + w1[k] * x1[-i];
     325    17241760 :             s2 += v0[k] * y0[i] + v1[k] * y1[-i];
     326             :         }
     327             : 
     328     3403600 :         s2 *= ALPHA;
     329             : 
     330     3403600 :         synth_ltp[j] = ( synth[j] - gain * s2 + gain * s ) - zir[j];
     331             : 
     332     3403600 :         x0++;
     333     3403600 :         x1++;
     334     3403600 :         y0++;
     335     3403600 :         y1++;
     336             :     }
     337             : 
     338       18625 :     return;
     339             : }
     340             : 
     341             : 
     342             : /*-------------------------------------------------------------------
     343             :  * tcx_ltp_synth_filter_fadein()
     344             :  *
     345             :  *
     346             :  *-------------------------------------------------------------------*/
     347             : 
     348        5139 : static void tcx_ltp_synth_filter_fadein(
     349             :     float *synth_ltp,
     350             :     float *synth,
     351             :     const int16_t length,
     352             :     const int16_t pitch_int,
     353             :     const int16_t pitch_fr,
     354             :     const float gain,
     355             :     const int16_t pitch_res,
     356             :     const int16_t filtIdx )
     357             : {
     358             :     float *x0, *x1, s;
     359             :     float *y0, *y1, s2;
     360             :     const float *v0, *v1;
     361             :     const float *w0, *w1;
     362             :     int16_t i, j, k, L;
     363             :     float alpha, step;
     364             : 
     365        5139 :     if ( gain > 0.f )
     366             :     {
     367        5139 :         x0 = &synth_ltp[-pitch_int];
     368        5139 :         x1 = x0 - 1;
     369        5139 :         y0 = synth;
     370        5139 :         y1 = y0 - 1;
     371             : 
     372        5139 :         assert( filtIdx >= 0 );
     373             : 
     374        5139 :         w0 = &tcxLtpFilters[filtIdx].filt[pitch_fr];
     375        5139 :         w1 = &tcxLtpFilters[filtIdx].filt[pitch_res - pitch_fr];
     376        5139 :         v0 = &tcxLtpFilters[filtIdx].filt[0];
     377        5139 :         v1 = &tcxLtpFilters[filtIdx].filt[pitch_res];
     378        5139 :         L = tcxLtpFilters[filtIdx].length;
     379             : 
     380        5139 :         alpha = 0.f;
     381        5139 :         step = 1.f / (float) ( length );
     382             : 
     383             : 
     384      914979 :         for ( j = 0; j < length; j++ )
     385             :         {
     386      909840 :             s = 0;
     387      909840 :             s2 = 0;
     388             : 
     389     5521680 :             for ( i = 0, k = 0; i < L; i++, k += pitch_res )
     390             :             {
     391     4611840 :                 s += w0[k] * x0[i] + w1[k] * x1[-i];
     392     4611840 :                 s2 += v0[k] * y0[i] + v1[k] * y1[-i];
     393             :             }
     394             : 
     395      909840 :             s2 *= ALPHA;
     396             : 
     397      909840 :             synth_ltp[j] = synth[j] - alpha * gain * s2 + alpha * gain * s;
     398             : 
     399      909840 :             alpha += step;
     400             : 
     401      909840 :             x0++;
     402      909840 :             x1++;
     403      909840 :             y0++;
     404      909840 :             y1++;
     405             :         }
     406             :     }
     407             :     else
     408             :     {
     409           0 :         mvr2r( synth, synth_ltp, length );
     410             :     }
     411             : 
     412        5139 :     return;
     413             : }
     414             : 
     415             : 
     416             : /*-------------------------------------------------------------------
     417             :  * tcx_ltp_synth_filter_fadeout()
     418             :  *
     419             :  *
     420             :  *-------------------------------------------------------------------*/
     421             : 
     422        5066 : static void tcx_ltp_synth_filter_fadeout(
     423             :     float *synth_ltp,
     424             :     float *synth,
     425             :     const int16_t length,
     426             :     const int16_t pitch_int,
     427             :     const int16_t pitch_fr,
     428             :     const float gain,
     429             :     const int16_t pitch_res,
     430             :     const int16_t filtIdx )
     431             : {
     432             :     float *x0, *x1, s;
     433             :     float *y0, *y1, s2;
     434             :     const float *v0, *v1;
     435             :     const float *w0, *w1;
     436             :     int16_t i, j, k, L;
     437             :     float alpha, step;
     438             : 
     439        5066 :     if ( gain > 0.f )
     440             :     {
     441        5066 :         x0 = &synth_ltp[-pitch_int];
     442        5066 :         x1 = x0 - 1;
     443        5066 :         y0 = synth;
     444        5066 :         y1 = y0 - 1;
     445             : 
     446        5066 :         assert( filtIdx >= 0 );
     447             : 
     448        5066 :         w0 = &tcxLtpFilters[filtIdx].filt[pitch_fr];
     449        5066 :         w1 = &tcxLtpFilters[filtIdx].filt[pitch_res - pitch_fr];
     450        5066 :         v0 = &tcxLtpFilters[filtIdx].filt[0];
     451        5066 :         v1 = &tcxLtpFilters[filtIdx].filt[pitch_res];
     452        5066 :         L = tcxLtpFilters[filtIdx].length;
     453             : 
     454        5066 :         alpha = 1.f;
     455        5066 :         step = 1.f / (float) ( length );
     456             : 
     457      903266 :         for ( j = 0; j < length; j++ )
     458             :         {
     459      898200 :             s = 0;
     460      898200 :             s2 = 0;
     461             : 
     462     5464520 :             for ( i = 0, k = 0; i < L; i++, k += pitch_res )
     463             :             {
     464     4566320 :                 s += w0[k] * x0[i] + w1[k] * x1[-i];
     465     4566320 :                 s2 += v0[k] * y0[i] + v1[k] * y1[-i];
     466             :             }
     467             : 
     468      898200 :             s2 *= ALPHA;
     469      898200 :             synth_ltp[j] = synth[j] - alpha * gain * s2 + alpha * gain * s;
     470      898200 :             alpha -= step;
     471             : 
     472      898200 :             x0++;
     473      898200 :             x1++;
     474      898200 :             y0++;
     475      898200 :             y1++;
     476             :         }
     477             :     }
     478             :     else
     479             :     {
     480           0 :         mvr2r( synth, synth_ltp, length );
     481             :     }
     482             : 
     483        5066 :     return;
     484             : }
     485             : 
     486             : 
     487             : /*-------------------------------------------------------------------
     488             :  * tcx_ltp_decode_params()
     489             :  *
     490             :  *
     491             :  *-------------------------------------------------------------------*/
     492             : 
     493    48364679 : int16_t tcx_ltp_decode_params(
     494             :     int16_t *ltp_param,
     495             :     int16_t *pitch_int,
     496             :     int16_t *pitch_fr,
     497             :     float *gain,
     498             :     const int16_t pitmin,
     499             :     const int16_t pitfr1,
     500             :     const int16_t pitfr2,
     501             :     const int16_t pitmax,
     502             :     const int16_t pitres )
     503             : {
     504    48364679 :     int16_t gainbits = 2;
     505             : 
     506             :     /* Decode Pitch and Gain */
     507    48364679 :     if ( ( ltp_param ) && ( ltp_param[0] ) )
     508             :     {
     509    26821578 :         if ( ltp_param[1] < ( ( pitfr2 - pitmin ) * pitres ) )
     510             :         {
     511    18775357 :             *pitch_int = pitmin + ( ltp_param[1] / pitres );
     512    18775357 :             *pitch_fr = ltp_param[1] - ( *pitch_int - pitmin ) * pitres;
     513             :         }
     514     8046221 :         else if ( ltp_param[1] < ( ( pitfr2 - pitmin ) * pitres + ( pitfr1 - pitfr2 ) * ( pitres >> 1 ) ) )
     515             :         {
     516     3553481 :             *pitch_int = pitfr2 + ( ( ltp_param[1] - ( pitfr2 - pitmin ) * pitres ) / ( pitres >> 1 ) );
     517     3553481 :             *pitch_fr = ( ltp_param[1] - ( pitfr2 - pitmin ) * pitres ) - ( *pitch_int - pitfr2 ) * ( pitres >> 1 );
     518     3553481 :             *pitch_fr = *pitch_fr << 1; /* was *= (pitres>>1); */
     519             :         }
     520             :         else
     521             :         {
     522     4492740 :             *pitch_int = ltp_param[1] + pitfr1 - ( ( pitfr2 - pitmin ) * pitres ) - ( ( pitfr1 - pitfr2 ) * ( pitres >> 1 ) );
     523     4492740 :             *pitch_fr = 0;
     524             :         }
     525    26821578 :         *gain = (float) ( ltp_param[2] + 1 ) * 0.625f / (float) ( 1 << gainbits );
     526    26821578 :         if ( *pitch_int < PIT_MIN_SHORTER )
     527             :         {
     528             :             /*pitch out of range due to bit error */
     529           0 :             *pitch_int = PIT_MIN_SHORTER;
     530           0 :             return 1;
     531             :         }
     532    26821578 :         if ( *pitch_int > PIT_MAX_MAX )
     533             :         {
     534             :             /*pitch out of range due to bit error */
     535           0 :             *pitch_int = PIT_MAX_MAX;
     536           0 :             return 1;
     537             :         }
     538             :     }
     539             :     else
     540             :     {
     541    21543101 :         *pitch_int = pitmax;
     542    21543101 :         *pitch_fr = 0;
     543    21543101 :         *gain = 0.0f;
     544             :     }
     545             : 
     546    48364679 :     return 0;
     547             : }
     548             : 
     549             : /*-------------------------------------------------------------------
     550             :  *tcx_ltp_synth_filter_10()
     551             :  *
     552             :  *
     553             :  ---------------------------------------------------------------------*/
     554     1563435 : static void tcx_ltp_synth_filter_10(
     555             :     float *out,
     556             :     float *in,
     557             :     const int16_t length,
     558             :     const int16_t pitch_int,
     559             :     const int16_t pitch_fr,
     560             :     const float gain,
     561             :     const int16_t pitch_res,
     562             :     const int16_t filtIdx )
     563             : {
     564             :     float *x0, *x1, s;
     565             :     float *y0, *y1, s2;
     566             :     const float *v0, *v1;
     567             :     const float *w0, *w1;
     568             :     int16_t i, j, k, L;
     569             :     float curr_gain, gain_step;
     570             : 
     571     1563435 :     x0 = &out[-pitch_int];
     572     1563435 :     x1 = x0 - 1;
     573     1563435 :     y0 = in;
     574     1563435 :     y1 = y0 - 1;
     575             : 
     576     1563435 :     assert( filtIdx >= 0 );
     577             : 
     578     1563435 :     w0 = &tcxLtpFilters[filtIdx].filt[pitch_fr];
     579     1563435 :     w1 = &tcxLtpFilters[filtIdx].filt[pitch_res - pitch_fr];
     580     1563435 :     v0 = &tcxLtpFilters[filtIdx].filt[0];
     581     1563435 :     v1 = &tcxLtpFilters[filtIdx].filt[pitch_res];
     582     1563435 :     L = tcxLtpFilters[filtIdx].length;
     583             : 
     584     1563435 :     curr_gain = gain;
     585     1563435 :     gain_step = -gain / length;
     586             : 
     587   297240395 :     for ( j = 0; j < length; j++ )
     588             :     {
     589   295676960 :         s = 0;
     590   295676960 :         s2 = 0;
     591             : 
     592  2223539760 :         for ( i = 0, k = 0; i < L; i++, k += pitch_res )
     593             :         {
     594  1927862800 :             s += w0[k] * x0[i] + w1[k] * x1[-i];
     595  1927862800 :             s2 += v0[k] * y0[i] + v1[k] * y1[-i];
     596             :         }
     597             : 
     598   295676960 :         out[j] = in[j] - curr_gain * s2 * ALPHA + curr_gain * s;
     599             : 
     600   295676960 :         x0++;
     601   295676960 :         x1++;
     602   295676960 :         y0++;
     603   295676960 :         y1++;
     604             : 
     605   295676960 :         curr_gain += gain_step;
     606             :     }
     607             : 
     608     1563435 :     return;
     609             : }
     610             : 
     611             : 
     612             : /*-------------------------------------------------------------------
     613             :  *tcx_ltp_synth_filter_01()
     614             :  *
     615             :  *
     616             :  ---------------------------------------------------------------------*/
     617             : 
     618     1648771 : static void tcx_ltp_synth_filter_01(
     619             :     float *out,
     620             :     float *in,
     621             :     const int16_t length,
     622             :     const int16_t pitch_int,
     623             :     const int16_t pitch_fr,
     624             :     const float gain,
     625             :     const int16_t pitch_res,
     626             :     const int16_t filtIdx )
     627             : {
     628             :     float *x0, *x1, s;
     629             :     float *y0, *y1, s2;
     630             :     const float *v0, *v1;
     631             :     const float *w0, *w1;
     632             :     int16_t i, j, k, L;
     633             :     float curr_gain, gain_step;
     634             : 
     635     1648771 :     x0 = &out[-pitch_int];
     636     1648771 :     x1 = x0 - 1;
     637     1648771 :     y0 = in;
     638     1648771 :     y1 = y0 - 1;
     639             : 
     640     1648771 :     assert( filtIdx >= 0 );
     641             : 
     642     1648771 :     w0 = &tcxLtpFilters[filtIdx].filt[pitch_fr];
     643     1648771 :     w1 = &tcxLtpFilters[filtIdx].filt[pitch_res - pitch_fr];
     644     1648771 :     v0 = &tcxLtpFilters[filtIdx].filt[0];
     645     1648771 :     v1 = &tcxLtpFilters[filtIdx].filt[pitch_res];
     646     1648771 :     L = tcxLtpFilters[filtIdx].length;
     647             : 
     648     1648771 :     curr_gain = 0.0f;
     649     1648771 :     gain_step = gain / length;
     650             : 
     651   313008531 :     for ( j = 0; j < length; j++ )
     652             :     {
     653   311359760 :         s = 0;
     654   311359760 :         s2 = 0;
     655             : 
     656  2338734480 :         for ( i = 0, k = 0; i < L; i++, k += pitch_res )
     657             :         {
     658  2027374720 :             s += w0[k] * x0[i] + w1[k] * x1[-i];
     659  2027374720 :             s2 += v0[k] * y0[i] + v1[k] * y1[-i];
     660             :         }
     661             : 
     662   311359760 :         out[j] = in[j] - curr_gain * s2 * ALPHA + curr_gain * s;
     663             : 
     664   311359760 :         x0++;
     665   311359760 :         x1++;
     666   311359760 :         y0++;
     667   311359760 :         y1++;
     668             : 
     669   311359760 :         curr_gain += gain_step;
     670             :     }
     671             : 
     672     1648771 :     return;
     673             : }
     674             : 
     675             : #define MAX_TCX_LTP_FILTER_LEN 8
     676             : #define MAX_TRANSITION_LEN     240 /* L_FRAME_48K / 4 */
     677             : 
     678             : /*-------------------------------------------------------------------
     679             :  *tcx_ltp_synth_filter_11_unequal_pitch()
     680             :  *
     681             :  * blend between two filters by means of OAO
     682             :  * filter the input signal at the initial subinterval with
     683             :  * the first filter unit according to parameters associated to
     684             :  * the preceding update interval with scaling from non-zero gain towards 0
     685             :  * followed by the second filter unit according to parameters associated to
     686             :  * the current update interval with scaling from 0 towards non-zero gain
     687             :  ---------------------------------------------------------------------*/
     688             : 
     689     7447911 : static void tcx_ltp_synth_filter_11_unequal_pitch(
     690             :     float *out,
     691             :     float *in,
     692             :     const int16_t length,
     693             :     const int16_t cur_pitch_int,
     694             :     const int16_t cur_pitch_fr,
     695             :     const float cur_gain,
     696             :     const int16_t pitch_res,
     697             :     const int16_t filtIdx,
     698             :     const int16_t prev_pitch_int,
     699             :     const int16_t prev_pitch_fr,
     700             :     const float prev_gain,
     701             :     const int16_t prev_pitch_res,
     702             :     const int16_t prev_filtIdx )
     703             : {
     704             :     float *x0, *x1, s;
     705             :     float *y0, *y1, s2;
     706             :     float *l0, *l1, s3;
     707             :     float *m0, *m1, s4;
     708             :     const float *v0, *v1;
     709             :     const float *w0, *w1;
     710             :     const float *p0, *p1;
     711             :     const float *q0, *q1;
     712             :     int16_t i, j, k, L;
     713             :     int16_t prev_L;
     714             :     float temp_buf[MAX_TRANSITION_LEN + 2 * MAX_TCX_LTP_FILTER_LEN];
     715             :     float *temp_ptr;
     716             :     float gain, gain_step;
     717             : 
     718     7447911 :     x0 = &out[-prev_pitch_int];
     719     7447911 :     x1 = x0 - 1;
     720     7447911 :     y0 = in;
     721     7447911 :     y1 = y0 - 1;
     722             : 
     723     7447911 :     assert( filtIdx >= 0 && prev_filtIdx >= 0 );
     724             : 
     725     7447911 :     w0 = &tcxLtpFilters[prev_filtIdx].filt[prev_pitch_fr];
     726     7447911 :     w1 = &tcxLtpFilters[prev_filtIdx].filt[prev_pitch_res - prev_pitch_fr];
     727     7447911 :     v0 = &tcxLtpFilters[prev_filtIdx].filt[0];
     728     7447911 :     v1 = &tcxLtpFilters[prev_filtIdx].filt[prev_pitch_res];
     729             : 
     730     7447911 :     prev_L = tcxLtpFilters[prev_filtIdx].length;
     731             : 
     732     7447911 :     p0 = &tcxLtpFilters[filtIdx].filt[cur_pitch_fr];
     733     7447911 :     p1 = &tcxLtpFilters[filtIdx].filt[pitch_res - cur_pitch_fr];
     734     7447911 :     q0 = &tcxLtpFilters[filtIdx].filt[0];
     735     7447911 :     q1 = &tcxLtpFilters[filtIdx].filt[pitch_res];
     736             : 
     737     7447911 :     L = tcxLtpFilters[filtIdx].length;
     738             : 
     739             :     /* 1. decreasing gain filter. The first filter unit with the parameters associated to the previous interval and scaling towards 0 */
     740     7447911 :     gain = prev_gain;
     741     7447911 :     gain_step = -prev_gain / length;
     742             : 
     743  1408100791 :     for ( j = 0; j < length; j++ )
     744             :     {
     745  1400652880 :         s = 0;
     746  1400652880 :         s2 = 0;
     747             : 
     748 10647056800 :         for ( i = 0, k = 0; i < prev_L; i++, k += prev_pitch_res )
     749             :         {
     750  9246403920 :             s += w0[k] * x0[i] + w1[k] * x1[-i];
     751  9246403920 :             s2 += v0[k] * y0[i] + v1[k] * y1[-i];
     752             :         }
     753             : 
     754  1400652880 :         out[j] = in[j] - gain * s2 * ALPHA + gain * s;
     755             : 
     756  1400652880 :         x0++;
     757  1400652880 :         x1++;
     758  1400652880 :         y0++;
     759  1400652880 :         y1++;
     760             : 
     761  1400652880 :         gain += gain_step;
     762             :     }
     763             : 
     764     7447911 :     mvr2r( out - L, temp_buf, length + L );
     765     7447911 :     mvr2r( in + length, temp_buf + length + L, L );
     766     7447911 :     temp_ptr = &temp_buf[0] + L;
     767             : 
     768     7447911 :     m0 = temp_ptr;
     769     7447911 :     m1 = temp_ptr - 1;
     770     7447911 :     l0 = &out[-cur_pitch_int];
     771     7447911 :     l1 = l0 - 1;
     772             : 
     773             :     /* 2. increasing gain filter. The second filter unit with the parameters associated to the current interval and scaling from 0 towards current gain */
     774     7447911 :     gain = 0.0f;
     775     7447911 :     gain_step = cur_gain / length;
     776             : 
     777  1408100791 :     for ( j = 0; j < length; j++ )
     778             :     {
     779  1400652880 :         s3 = 0;
     780  1400652880 :         s4 = 0;
     781             : 
     782 10647149360 :         for ( i = 0, k = 0; i < L; i++, k += pitch_res )
     783             :         {
     784  9246496480 :             s3 += p0[k] * l0[i] + p1[k] * l1[-i];
     785  9246496480 :             s4 += q0[k] * m0[i] + q1[k] * m1[-i];
     786             :         }
     787             : 
     788  1400652880 :         out[j] = *( temp_ptr + j ) - gain * s4 * ALPHA + gain * s3;
     789             : 
     790  1400652880 :         l0++;
     791  1400652880 :         l1++;
     792  1400652880 :         m0++;
     793  1400652880 :         m1++;
     794             : 
     795  1400652880 :         gain += gain_step;
     796             :     }
     797             : 
     798     7447911 :     return;
     799             : }
     800             : 
     801             : 
     802             : /*-------------------------------------------------------------------
     803             :  * tcx_ltp_post()
     804             :  *
     805             :  *
     806             :  *-------------------------------------------------------------------*/
     807             : 
     808    63827188 : void tcx_ltp_post(
     809             :     Decoder_State *st,
     810             :     TCX_LTP_DEC_HANDLE hTcxLtpDec,
     811             :     const int16_t core,
     812             :     const int16_t output_frame,
     813             :     const int16_t delay,
     814             :     float sig[],
     815             :     const float tcx_buf[] )
     816             : {
     817             :     int16_t tmp, L_transition, lpcorder, filtIdx;
     818             :     int16_t bfi, L_frame_core, SideInfoOnly;
     819             :     float gain, gain2;
     820             :     float zir[L_FRAME_PLUS / 4], A[TCXLTP_LTP_ORDER + 1];
     821             :     float buf_in[TCXLTP_MAX_DELAY + L_FRAME48k + TCXLTP_MAX_DELAY], buf_out[2 * L_FRAME48k];
     822             :     float *sig_in, *sig_out;
     823             :     int16_t pitch_int, pitch_fr;
     824             :     int16_t tcx_buf_len;
     825             :     int32_t total_brate;
     826             : 
     827    63827188 :     total_brate = ( st->element_mode == IVAS_CPE_MDCT ? st->bits_frame_nominal * FRAMES_PER_SEC : st->total_brate );
     828    63827188 :     filtIdx = 0; /* just to avoid compilation warnings */
     829    63827188 :     tcx_buf_len = NS2SA( st->output_Fs, TCXLTP_DELAY_NS );
     830    63827188 :     SideInfoOnly = 0;
     831             : 
     832    63827188 :     if ( total_brate >= HQ_96k )
     833             :     {
     834    23418420 :         SideInfoOnly = 1;
     835             :     }
     836             : 
     837    63827188 :     L_frame_core = st->L_frame;
     838    63827188 :     if ( st->element_mode == IVAS_CPE_MDCT )
     839             :     {
     840    44010900 :         L_frame_core = L_FRAME;
     841             :     }
     842             : 
     843    63827188 :     if ( core == ACELP_CORE )
     844             :     {
     845     8418544 :         bfi = 0;
     846     8418544 :         pitch_int = 0;
     847     8418544 :         pitch_fr = 0;
     848     8418544 :         gain = 0.0f;
     849             : 
     850     8418544 :         L_frame_core = st->L_frame_past;
     851             :     }
     852             :     else
     853             :     {
     854    55408644 :         bfi = st->bfi;
     855    55408644 :         pitch_int = hTcxLtpDec->tcxltp_pitch_int;
     856    55408644 :         pitch_fr = hTcxLtpDec->tcxltp_pitch_fr;
     857    55408644 :         gain = hTcxLtpDec->tcxltp_gain;
     858             :     }
     859             : 
     860             :     /******** Init ********/
     861             : 
     862             :     /* Parameters */
     863    63827188 :     L_transition = output_frame / 4;
     864    63827188 :     lpcorder = TCXLTP_LTP_ORDER;
     865             : 
     866             : 
     867             :     /* Input buffer */
     868    63827188 :     sig_in = buf_in + tcx_buf_len;
     869    63827188 :     mvr2r( hTcxLtpDec->tcxltp_mem_in, buf_in, tcx_buf_len );
     870    63827188 :     mvr2r( sig, buf_in + tcx_buf_len, output_frame );
     871    63827188 :     if ( core > ACELP_CORE )
     872             :     {
     873    55408644 :         mvr2r( tcx_buf, sig_in + output_frame, tcx_buf_len );
     874             :     }
     875    63827188 :     mvr2r( sig + output_frame - tcx_buf_len, hTcxLtpDec->tcxltp_mem_in, tcx_buf_len );
     876             : 
     877             :     /* Output buffer */
     878    63827188 :     sig_out = buf_out + output_frame;
     879    63827188 :     mvr2r( hTcxLtpDec->tcxltp_mem_out, buf_out, output_frame );
     880             : 
     881             :     /* TCX-LTP parameters: integer pitch, fractional pitch, gain */
     882             : 
     883    63827188 :     if ( !( SideInfoOnly || hTcxLtpDec->tcxltp ) || core == ACELP_CORE )
     884             :     {
     885             :         /* No LTP */
     886    26765236 :         pitch_int = 0;
     887    26765236 :         pitch_fr = 0;
     888    26765236 :         gain = 0.f;
     889             :     }
     890    37061952 :     else if ( !bfi )
     891             :     {
     892             :         /* LTP and good frame */
     893    35806794 :         if ( output_frame != L_frame_core )
     894             :         {
     895    34734575 :             tmp = pitch_int * st->pit_res_max + pitch_fr;
     896    34734575 :             tmp = ( tmp * output_frame + L_frame_core / 2 ) / L_frame_core;
     897    34734575 :             pitch_int = tmp / st->pit_res_max;
     898    34734575 :             pitch_fr = tmp % st->pit_res_max;
     899             :         }
     900             : 
     901    35806794 :         if ( st->element_mode == EVS_MONO ) /* hard tunings for EVS_MONO, HQ_48k is TCX only */
     902             :         {
     903       64625 :             if ( total_brate == HQ_48k && L_frame_core == L_FRAME16k )
     904             :             {
     905        2894 :                 gain *= 0.32f;
     906             :             }
     907       61731 :             else if ( total_brate == HQ_48k && L_frame_core == 512 )
     908             :             {
     909        6538 :                 gain *= 0.40f;
     910             :             }
     911             :             else
     912             :             {
     913       55193 :                 gain *= 0.64f;
     914             :             }
     915             :         }
     916    35742169 :         else if ( ( st->element_mode > IVAS_SCE ) && ( total_brate >= IVAS_96k ) )
     917             :         {
     918    21379238 :             gain *= 0.40f;
     919             :         }
     920             :         else
     921             :         {
     922    14362931 :             gain *= 0.64f;
     923             :         }
     924             :     }
     925             :     else
     926             :     {
     927             :         /* PLC: [TCX: Fade-out]
     928             :          * PLC: LTP and bad frame (concealment) */
     929     1255158 :         if ( st->pit_res_max == st->pit_res_max_past ) /* ensure consistent core SR to previous frame; otherwise, set gain to 0 */
     930             :         {
     931     1255158 :             pitch_int = hTcxLtpDec->tcxltp_pitch_int_post_prev;
     932     1255158 :             pitch_fr = hTcxLtpDec->tcxltp_pitch_fr_post_prev;
     933     1255158 :             gain = hTcxLtpDec->tcxltp_gain_post_prev * st->hTcxDec->damping;
     934             :         }
     935             :         else
     936             :         {
     937           0 :             gain = 0.f;
     938             :         }
     939             :     }
     940             : 
     941    63827188 :     if ( SideInfoOnly )
     942             :     {
     943    23418420 :         gain = 0.f;
     944    23418420 :         if ( bfi )
     945             :         {
     946      772279 :             hTcxLtpDec->tcxltp_gain_post_prev = 0.f;
     947             :         }
     948             :     }
     949    63827188 :     gain2 = gain;
     950             : 
     951    63827188 :     if ( L_frame_core == L_FRAME )
     952             :     {
     953    48594824 :         switch ( output_frame )
     954             :         {
     955        8548 :             case L_FRAME8k:
     956        8548 :                 filtIdx = 0;
     957        8548 :                 break;
     958     7456483 :             case L_FRAME16k:
     959     7456483 :                 filtIdx = 1;
     960     7456483 :                 break;
     961    11111012 :             case L_FRAME32k:
     962    11111012 :                 filtIdx = 2;
     963    11111012 :                 break;
     964    30018781 :             case L_FRAME48k:
     965    30018781 :                 filtIdx = 3;
     966    30018781 :                 break;
     967           0 :             default:
     968           0 :                 assert( 0 );
     969             :                 break;
     970             :         }
     971             :     }
     972    15232364 :     else if ( L_frame_core == L_FRAME16k )
     973             :     {
     974    10491229 :         switch ( output_frame )
     975             :         {
     976         910 :             case L_FRAME8k:
     977         910 :                 filtIdx = 4;
     978         910 :                 break;
     979     2204914 :             case L_FRAME16k:
     980     2204914 :                 filtIdx = 5;
     981     2204914 :                 break;
     982     2550084 :             case L_FRAME32k:
     983     2550084 :                 filtIdx = 6;
     984     2550084 :                 break;
     985     5735321 :             case L_FRAME48k:
     986     5735321 :                 filtIdx = 7;
     987     5735321 :                 break;
     988           0 :             default:
     989           0 :                 assert( 0 );
     990             :                 break;
     991             :         }
     992             :     }
     993     4741135 :     else if ( L_frame_core == 512 )
     994             :     {
     995      834734 :         switch ( output_frame )
     996             :         {
     997           0 :             case L_FRAME8k:
     998           0 :                 filtIdx = 8;
     999           0 :                 break;
    1000       10567 :             case L_FRAME16k:
    1001       10567 :                 filtIdx = 9;
    1002       10567 :                 break;
    1003      220126 :             case L_FRAME32k:
    1004      220126 :                 filtIdx = 10;
    1005      220126 :                 break;
    1006      604041 :             case L_FRAME48k:
    1007      604041 :                 filtIdx = 11;
    1008      604041 :                 break;
    1009           0 :             default:
    1010           0 :                 assert( 0 );
    1011             :                 break;
    1012             :         }
    1013             :     }
    1014             :     else
    1015             :     {
    1016     3906401 :         filtIdx = -1;
    1017             :     }
    1018             : 
    1019             : 
    1020             :     /******** Previous-frame part ********/
    1021    63827188 :     tcx_ltp_synth_filter( sig_out, sig_in, delay, hTcxLtpDec->tcxltp_pitch_int_post_prev, hTcxLtpDec->tcxltp_pitch_fr_post_prev, hTcxLtpDec->tcxltp_gain_post_prev, st->pit_res_max_past, hTcxLtpDec->tcxltp_filt_idx_prev );
    1022             : 
    1023             :     /******** Transition part - initial subinterval ********/
    1024             : 
    1025    63827188 :     if ( st->element_mode != EVS_MONO )
    1026             :     {
    1027    63598983 :         if ( gain == 0.f && hTcxLtpDec->tcxltp_gain_post_prev == 0.f )
    1028             :         {
    1029             :             /* The filtering is deactivated, just copy input to the output */
    1030    51329638 :             mvr2r( sig_in + delay, sig_out + delay, L_transition );
    1031             :         }
    1032    12269345 :         else if ( gain == 0.f && hTcxLtpDec->tcxltp_gain_post_prev != 0.f )
    1033             :         {
    1034             :             /* Filtering with the first filter unit */
    1035     1563435 :             tcx_ltp_synth_filter_10( sig_out + delay, sig_in + delay, L_transition, hTcxLtpDec->tcxltp_pitch_int_post_prev, hTcxLtpDec->tcxltp_pitch_fr_post_prev, hTcxLtpDec->tcxltp_gain_post_prev, st->pit_res_max_past, hTcxLtpDec->tcxltp_filt_idx_prev );
    1036             :         }
    1037    10705910 :         else if ( gain != 0.f && hTcxLtpDec->tcxltp_gain_post_prev == 0.f )
    1038             :         {
    1039             :             /* Filtering with the second filter unit */
    1040     1648771 :             tcx_ltp_synth_filter_01( sig_out + delay, sig_in + delay, L_transition, pitch_int, pitch_fr, gain, st->pit_res_max, filtIdx );
    1041             :         }
    1042     9057139 :         else if ( gain == hTcxLtpDec->tcxltp_gain_post_prev && pitch_int == hTcxLtpDec->tcxltp_pitch_int_post_prev && pitch_fr == hTcxLtpDec->tcxltp_pitch_fr_post_prev && st->pit_res_max == st->pit_res_max_past && filtIdx == hTcxLtpDec->tcxltp_filt_idx_prev )
    1043             :         {
    1044     1609228 :             tcx_ltp_synth_filter( sig_out + delay, sig_in + delay, L_transition, pitch_int, pitch_fr, gain, st->pit_res_max, filtIdx );
    1045             :         }
    1046             :         else
    1047             :         {
    1048             :             /* Filtering with the first filter unit, followed by the filtering with the second filter unit */
    1049     7447911 :             tcx_ltp_synth_filter_11_unequal_pitch( sig_out + delay, sig_in + delay, L_transition, pitch_int, pitch_fr, gain, st->pit_res_max, filtIdx,
    1050     7447911 :                                                    hTcxLtpDec->tcxltp_pitch_int_post_prev, hTcxLtpDec->tcxltp_pitch_fr_post_prev, hTcxLtpDec->tcxltp_gain_post_prev, st->pit_res_max_past, hTcxLtpDec->tcxltp_filt_idx_prev );
    1051             :         }
    1052             :     }
    1053             :     else
    1054             :     {
    1055      228205 :         if ( gain == 0.f && hTcxLtpDec->tcxltp_gain_post_prev == 0.f )
    1056             :         {
    1057      191978 :             mvr2r( sig_in + delay, sig_out + delay, L_transition );
    1058             :         }
    1059       36227 :         else if ( hTcxLtpDec->tcxltp_gain_post_prev == 0.f )
    1060             :         {
    1061        5139 :             tcx_ltp_synth_filter_fadein( sig_out + delay, sig_in + delay, L_transition, pitch_int, pitch_fr, gain, st->pit_res_max, filtIdx );
    1062             :         }
    1063       31088 :         else if ( gain == 0.f )
    1064             :         {
    1065        5066 :             tcx_ltp_synth_filter_fadeout( sig_out + delay, sig_in + delay, L_transition, hTcxLtpDec->tcxltp_pitch_int_post_prev, hTcxLtpDec->tcxltp_pitch_fr_post_prev, hTcxLtpDec->tcxltp_gain_post_prev, st->pit_res_max_past, hTcxLtpDec->tcxltp_filt_idx_prev );
    1066             :         }
    1067       26022 :         else if ( gain == hTcxLtpDec->tcxltp_gain_post_prev && pitch_int == hTcxLtpDec->tcxltp_pitch_int_post_prev && pitch_fr == hTcxLtpDec->tcxltp_pitch_fr_post_prev )
    1068             :         {
    1069        7397 :             tcx_ltp_synth_filter( sig_out + delay, sig_in + delay, L_transition, pitch_int, pitch_fr, gain, st->pit_res_max, filtIdx );
    1070             :         }
    1071             :         else
    1072             :         {
    1073             :             {
    1074       18625 :                 tcx_ltp_get_lpc( sig_out + delay - output_frame, output_frame, A, lpcorder );
    1075       18625 :                 tcx_ltp_get_zir( zir, L_transition, sig_out + delay - lpcorder, sig_in + delay - lpcorder, A, lpcorder, gain, pitch_int, pitch_fr, st->pit_res_max, filtIdx );
    1076       18625 :                 tcx_ltp_synth_filter_zir( sig_out + delay, sig_in + delay, L_transition, pitch_int, pitch_fr, gain, st->pit_res_max, zir, filtIdx );
    1077             :             }
    1078             :         }
    1079             :     }
    1080             : 
    1081             :     /******** Current-frame part - subsequent subinterval, filtered with the third filter unit ********/
    1082    63827188 :     tcx_ltp_synth_filter( sig_out + ( delay + L_transition ), sig_in + ( delay + L_transition ), output_frame - ( delay + L_transition ), pitch_int, pitch_fr, gain, st->pit_res_max, filtIdx );
    1083             : 
    1084             :     /******** Output ********/
    1085             : 
    1086             :     /* copy to output */
    1087    63827188 :     mvr2r( sig_out, sig, output_frame );
    1088             : 
    1089             :     /* Update */
    1090    63827188 :     hTcxLtpDec->tcxltp_pitch_int_post_prev = pitch_int;
    1091    63827188 :     hTcxLtpDec->tcxltp_pitch_fr_post_prev = pitch_fr;
    1092    63827188 :     hTcxLtpDec->tcxltp_gain_post_prev = gain2;
    1093    63827188 :     hTcxLtpDec->tcxltp_filt_idx_prev = filtIdx;
    1094    63827188 :     st->pit_res_max_past = st->pit_res_max;
    1095    63827188 :     mvr2r( sig_out, hTcxLtpDec->tcxltp_mem_out, output_frame );
    1096             : 
    1097    63827188 :     return;
    1098             : }

Generated by: LCOV version 1.14