LCOV - code coverage report
Current view: top level - lib_lc3plus - per_band_energy.c (source / functions) Hit Total Coverage
Test: Coverage on main -- conformance test test_26252.py @ 9b04ec3cb36f5e8dc438cf854fa3e349998fa1e9 Lines: 17 24 70.8 %
Date: 2025-10-31 05:34:26 Functions: 1 1 100.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      590506 : void processPerBandEnergy_fl(LC3_INT bands_number, const LC3_INT* acc_coeff_per_band, LC3_INT16 hrmode, LC3_INT16 frame_dms, LC3_FLOAT* d2, LC3_FLOAT* d)
      15             : {
      16             :     LC3_INT   i, j, start, stop, maxBwBin;
      17             :     LC3_FLOAT sum;
      18             : 
      19             : #ifdef ENABLE_HR_MODE_FL
      20      590506 :     if (hrmode)
      21             :     {
      22           0 :         maxBwBin = MAX_BW_HR;
      23             :     }
      24             :     else
      25             : #else
      26             :     UNUSED(hrmode);
      27             : #endif
      28             :     {
      29      590506 :         maxBwBin = MAX_BW;
      30             :     }
      31      590506 :     switch (frame_dms)
      32             :     {
      33           0 :     case 25:
      34           0 :         maxBwBin = maxBwBin >> 2;
      35           0 :         break;
      36      558314 :     case 50:
      37      558314 :         maxBwBin = maxBwBin >> 1;
      38      558314 :         break;
      39           0 :     case 75:
      40           0 :         maxBwBin = (maxBwBin >> 2) * 3;
      41           0 :         break;
      42             :     }
      43             : 
      44    33358064 :     for (i = 0; i < bands_number; i++) {
      45    32767558 :         sum   = 0;
      46    32767558 :         start = acc_coeff_per_band[i];
      47    32767558 :         stop = MIN(acc_coeff_per_band[i + 1], maxBwBin);
      48             : 
      49   157307158 :         for (j = start; j < stop; j++) {
      50   124539600 :             sum += d[j] * d[j];
      51             :         }
      52             : 
      53    32767558 :         if (stop - start > 0) {
      54    32767558 :             sum   = sum / (LC3_FLOAT)(stop - start);
      55             :         }
      56    32767558 :         d2[i] = sum;
      57             :     }
      58      590506 : }

Generated by: LCOV version 1.14