LCOV - code coverage report
Current view: top level - lib_lc3plus - sns_interpolate_scf.c (source / functions) Hit Total Coverage
Test: Coverage on main -- short test vectors @ 6c9ddc4024a9c0e1ecb8f643f114a84a0e26ec6b Lines: 0 37 0.0 %
Date: 2025-05-23 08:37:30 Functions: 0 1 0.0 %

          Line data    Source code
       1             : /******************************************************************************
       2             : *                        ETSI TS 103 634 V1.5.1                               *
       3             : *              Low Complexity Communication Codec Plus (LC3plus)              *
       4             : *                                                                             *
       5             : * Copyright licence is solely granted through ETSI Intellectual Property      *
       6             : * Rights Policy, 3rd April 2019. No patent licence is granted by implication, *
       7             : * estoppel or otherwise.                                                      *
       8             : ******************************************************************************/
       9             : 
      10             : #include "options.h"
      11             : #include "wmc_auto.h"
      12             : #include "functions.h"
      13             : 
      14           0 : void processSnsInterpolateScf_fl(LC3_FLOAT* gains, LC3_INT encoder_side, LC3_INT bands_number, LC3_FLOAT* gains_int)
      15             : {
      16             :     LC3_INT   i, n, d, n4;
      17             :     LC3_FLOAT tmp[MAX_BANDS_NUMBER_PLC], ratio;
      18             : 
      19             :     /* Interpolation */
      20             : 
      21           0 :     gains_int[0] = gains[0];
      22           0 :     gains_int[1] = gains[0];
      23             : 
      24           0 :        for (n = 0; n <= 14; n++) {
      25           0 :         gains_int[n * 4 + 2] = gains[n] + (gains[n + 1] - gains[n]) * 0.125;
      26           0 :         gains_int[n * 4 + 3] = gains[n] + (gains[n + 1] - gains[n]) * 0.375;
      27           0 :         gains_int[n * 4 + 4] = gains[n] + (gains[n + 1] - gains[n]) * 0.625;
      28           0 :         gains_int[n * 4 + 5] = gains[n] + (gains[n + 1] - gains[n]) * 0.875;
      29             :     }
      30             : 
      31           0 :     gains_int[62] = gains[15] + (gains[15] - gains[14]) * 0.125;
      32           0 :     gains_int[63] = gains[15] + (gains[15] - gains[14]) * 0.375;
      33             : 
      34             :     /* For 5ms */
      35             : 
      36           0 :     if (bands_number < 64) {
      37           0 :         d = 64 - bands_number;
      38             : 
      39           0 :         if (d < 32)
      40             :         {
      41           0 :             i = 0;
      42           0 :             for (n = 0; n < 2 * d; n = n + 2) {
      43           0 :                 tmp[i] = (gains_int[n] + gains_int[n + 1]) / (LC3_FLOAT)2.0;
      44           0 :                 i++;
      45             :             }
      46             : 
      47           0 :             for (n = 1; n < d; n++) {
      48           0 :                 gains_int[n] = gains_int[2 * n];
      49             :             }
      50             : 
      51           0 :             for (n = 2 * d; n < 64; n++) {
      52           0 :                 gains_int[n - d] = gains_int[n];
      53             :             }
      54             : 
      55           0 :             move_float(gains_int, tmp, d);
      56             :         }
      57           0 :         else if (bands_number < 32)
      58             :         {
      59           0 :             ratio = LC3_FABS((LC3_FLOAT) ((LC3_FLOAT)1.0 - (LC3_FLOAT)32.0 / (LC3_FLOAT) bands_number));
      60           0 :             n4 = LC3_ROUND(ratio * (LC3_FLOAT)bands_number);
      61             :             
      62           0 :             for (i = 0; i < n4; i++)
      63             :             {
      64           0 :                 tmp[i] = (gains_int[4 * i] + gains_int[4 * i + 1] + gains_int[4 * i + 2] + gains_int[4 * i + 3]) / 4.0;
      65             :             }
      66             :             
      67           0 :             for (i = 0; i < bands_number - n4; i++)
      68             :             {
      69           0 :                 tmp[n4 + i] = (gains_int[4 * n4 + 2 * i] + gains_int[4 * n4 + 2 * i + 1]) / 2.0;
      70             :             }
      71             :             
      72           0 :             move_float(gains_int, tmp, bands_number);
      73             :         } else {
      74           0 :             assert(0 && "Unsupported number of bands!");
      75             :         }
      76             :     }
      77             : 
      78             :     /* Inversion at encoder-side */
      79             : 
      80           0 :     if (encoder_side == 1) {
      81           0 :         for (n = 0; n < bands_number; n++) {
      82           0 :             gains_int[n] = -gains_int[n];
      83             :         }
      84             :     }
      85             : 
      86             :     /* Linear domain */
      87             : 
      88           0 :     for (n = 0; n < bands_number; n++) {
      89           0 :         gains_int[n] = LC3_POW(2, gains_int[n]);
      90             :     }
      91           0 : }

Generated by: LCOV version 1.14