LCOV - code coverage report
Current view: top level - lib_enc - reordernorm_fx.c (source / functions) Hit Total Coverage
Test: Coverage on main enc/dec/rend @ 3b2f07138c61dcf997bbf4165d0882f794b2995f Lines: 20 23 87.0 %
Date: 2025-05-03 01:55:50 Functions: 1 1 100.0 %

          Line data    Source code
       1             : /*====================================================================================
       2             :     EVS Codec 3GPP TS26.452 Aug 12, 2021. Version 16.3.0
       3             :   ====================================================================================*/
       4             : 
       5             : #include <stdint.h>
       6             : #include "options.h" /* Compilation switches                   */
       7             : #include "cnst.h"    /* Common constants                       */
       8             : #include "rom_com_fx.h"
       9             : #include "rom_com.h"
      10             : #include "prot_fx.h"     /* Function prototypes                    */
      11             : #include "prot_fx_enc.h" /* Function prototypes                    */
      12             : 
      13             : /*--------------------------------------------------------------------------*/
      14             : /*  Function  reordernorm_fx                                                */
      15             : /*  ~~~~~~~~~~~~~~~~~~~~~                                                   */
      16             : /*                                                                          */
      17             : /*  Reorder quantization indices and norms                                  */
      18             : /*--------------------------------------------------------------------------*/
      19             : 
      20         493 : void reordernorm_fx(
      21             :     const Word16 *ynrm,     /* i  : quantization indices for norms     Q0 */
      22             :     const Word16 *normqlg2, /* i  : quantized norms                    Q0 */
      23             :     Word16 *idxbuf,         /* o  : reordered quantization indices     Q0 */
      24             :     Word16 *normbuf,        /* o  : reordered quantized norms          Q0 */
      25             :     const Word16 nb_sfm     /* i  : number of bands                    Q0 */
      26             : )
      27             : {
      28             :     Word16 i;
      29         493 :     const Word16 *order = NULL;
      30             : 
      31         493 :     SWITCH( nb_sfm )
      32             :     {
      33         382 :         case NB_SFM:
      34         382 :             order = norm_order_48; // Q0
      35         382 :             BREAK;
      36          95 :         case SFM_N_SWB:
      37          95 :             order = norm_order_32; // Q0
      38          95 :             BREAK;
      39          16 :         case SFM_N_WB:
      40          16 :             order = norm_order_16; // Q0
      41          16 :             BREAK;
      42           0 :         default:
      43           0 :             order = norm_order_48; // Q0
      44           0 :             BREAK;
      45             :     }
      46             : 
      47       21422 :     FOR( i = 0; i < nb_sfm; i++ )
      48             :     {
      49       20929 :         idxbuf[i] = ynrm[order[i]]; // Q0
      50       20929 :         move16();
      51       20929 :         move16();
      52       20929 :         normbuf[i] = normqlg2[order[i]]; // Q0
      53       20929 :         move16();
      54       20929 :         move16();
      55             :     }
      56             : 
      57         493 :     return;
      58             : }

Generated by: LCOV version 1.14