Line data Source code
1 : /****************************************************************************** 2 : * ETSI TS 103 634 V1.6.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 895850 : 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 895850 : LC3_FLOAT rc[9], s, st[9] = {0}; 18 : LC3_INT order_tmp; 19 : 20 895850 : if (numfilters == 2) { 21 891739 : startfreq[0] = floor(600 * N * 2 / fs) + 1; 22 891739 : stopfreq[0] = bw_fcbin / 2; 23 891739 : startfreq[1] = bw_fcbin / 2 + 1; 24 891739 : stopfreq[1] = bw_fcbin; 25 : } else { 26 4111 : startfreq[0] = floor(600 * N * 2 / fs) + 1; 27 4111 : stopfreq[0] = bw_fcbin; 28 : } 29 : 30 2683439 : for (f = 0; f < numfilters; f++) { 31 1787589 : order_tmp = order[f]; 32 : 33 1787589 : if (order_tmp > 0) { 34 31385 : j = 0; 35 : 36 147960 : for (i = f * 8; i < f * 8 + order_tmp; i++) { 37 116575 : rc[j] = quants_pts_tns[rc_idx[i]]; 38 116575 : j++; 39 : } 40 : 41 3160555 : for (m = startfreq[f]; m <= stopfreq[f]; m++) { 42 3129170 : s = x[m - 1] - rc[order_tmp - 1] * st[order_tmp - 1]; 43 : 44 11842270 : for (l = order_tmp - 2; l >= 0; l--) { 45 8713100 : s = s - rc[l] * st[l]; 46 8713100 : st[l + 1] = rc[l] * s + st[l]; 47 : } 48 : 49 3129170 : st[0] = s; 50 3129170 : x[m - 1] = s; 51 : } 52 : } 53 : } 54 895850 : }