FreeCalypso > hg > efr-experiments
comparison src/reorder.c @ 0:56410792419a
src: original EFR source from ETSI
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 03 Apr 2024 05:31:37 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:56410792419a |
---|---|
1 /************************************************************************* | |
2 * | |
3 * FUNCTION: Reorder_lsf() | |
4 * | |
5 * PURPOSE: To make sure that the LSFs are properly ordered and to keep a | |
6 * certain minimum distance between adjacent LSFs. * | |
7 * The LSFs are in the frequency range 0-0.5 and represented in Q15 | |
8 * | |
9 *************************************************************************/ | |
10 | |
11 #include "typedef.h" | |
12 #include "basic_op.h" | |
13 #include "count.h" | |
14 | |
15 void Reorder_lsf ( | |
16 Word16 *lsf, /* (i/o) : vector of LSFs (range: 0<=val<=0.5) */ | |
17 Word16 min_dist, /* (i) : minimum required distance */ | |
18 Word16 n /* (i) : LPC order */ | |
19 ) | |
20 { | |
21 Word16 i; | |
22 Word16 lsf_min; | |
23 | |
24 lsf_min = min_dist; move16 (); | |
25 for (i = 0; i < n; i++) | |
26 { | |
27 test (); | |
28 if (sub (lsf[i], lsf_min) < 0) | |
29 { | |
30 lsf[i] = lsf_min; move16 (); | |
31 } | |
32 lsf_min = add (lsf[i], min_dist); | |
33 } | |
34 } |