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 1768748 : void processTnsDecoder_fl(LC3_FLOAT* x, LC3_INT* rc_idx, LC3_INT* order, LC3_INT numfilters, LC3_INT bw_fcbin, LC3_INT N, LC3_INT fs) 15 : { 16 : LC3_INT startfreq[2], stopfreq[2], f, i, j, m, l; 17 1768748 : LC3_FLOAT rc[9], s, st[9] = {0}; 18 : LC3_INT order_tmp; 19 : 20 1768748 : if (numfilters == 2) { 21 1750588 : startfreq[0] = floor(600 * N * 2 / fs) + 1; 22 1750588 : stopfreq[0] = bw_fcbin / 2; 23 1750588 : startfreq[1] = bw_fcbin / 2 + 1; 24 1750588 : stopfreq[1] = bw_fcbin; 25 : } else { 26 18160 : startfreq[0] = floor(600 * N * 2 / fs) + 1; 27 18160 : stopfreq[0] = bw_fcbin; 28 : } 29 : 30 5288084 : for (f = 0; f < numfilters; f++) { 31 3519336 : order_tmp = order[f]; 32 : 33 3519336 : if (order_tmp > 0) { 34 280046 : j = 0; 35 : 36 1344077 : for (i = f * 8; i < f * 8 + order_tmp; i++) { 37 1064031 : rc[j] = quants_pts_tns[rc_idx[i]]; 38 1064031 : j++; 39 : } 40 : 41 29024348 : for (m = startfreq[f]; m <= stopfreq[f]; m++) { 42 28744302 : s = x[m - 1] - rc[order_tmp - 1] * st[order_tmp - 1]; 43 : 44 114051754 : for (l = order_tmp - 2; l >= 0; l--) { 45 85307452 : s = s - rc[l] * st[l]; 46 85307452 : st[l + 1] = rc[l] * s + st[l]; 47 : } 48 : 49 28744302 : st[0] = s; 50 28744302 : x[m - 1] = s; 51 : } 52 : } 53 : } 54 1768748 : }