annotate libtwamr/s10_8pf.c @ 421:09534cdc59ec

libtwamr/tw_amr.h: rm trailing spaces from enum Mode list
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 07 May 2024 05:40:10 +0000
parents ebd064c52fe3
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
316
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 ********************************************************************************
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 *
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 * GSM AMR-NB speech codec R98 Version 7.6.0 December 12, 2001
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 * R99 Version 3.3.0
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 * REL-4 Version 4.1.0
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 *
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 ********************************************************************************
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 *
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 * File : s10_8pf.c
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 * Purpose : Searches a 35/31 bit algebraic codebook containing
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 * : 10/8 pulses in a frame of 40 samples.
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 *
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 ********************************************************************************
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 /*
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 ********************************************************************************
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 * MODULE INCLUDE FILE AND VERSION ID
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 ********************************************************************************
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 #include "namespace.h"
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 #include "s10_8pf.h"
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 /*
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 ********************************************************************************
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 * INCLUDE FILES
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 ********************************************************************************
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 #include "typedef.h"
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 #include "basic_op.h"
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 #include "no_count.h"
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 #include "cnst.h"
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 /*
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 ********************************************************************************
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 * LOCAL VARIABLES AND TABLES
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 ********************************************************************************
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 /*************************************************************************
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 *
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 * FUNCTION search_10and8i40()
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 *
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43 * PURPOSE: Search the best codevector; determine positions of the 10/8
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44 * pulses in the 40-sample frame.
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45 *
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46 * search_10and8i40 (10,5,5,dn, rr, ipos, pos_max, codvec); for GSMEFR
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
47 * search_10and8i40 (8, 4,4,dn, rr, ipos, pos_max, codvec); for 10.2
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48 *
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
49 *************************************************************************/
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
50
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
51 #define _1_2 (Word16)(32768L/2)
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
52 #define _1_4 (Word16)(32768L/4)
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
53 #define _1_8 (Word16)(32768L/8)
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
54 #define _1_16 (Word16)(32768L/16)
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
55 #define _1_32 (Word16)(32768L/32)
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
56 #define _1_64 (Word16)(32768L/64)
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
57 #define _1_128 (Word16)(32768L/128)
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
58
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
59 void search_10and8i40 (
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
60 Word16 nbPulse, /* i : nbpulses to find */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
61 Word16 step, /* i : stepsize */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
62 Word16 nbTracks, /* i : nbTracks */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
63 Word16 dn[], /* i : correlation between target and h[] */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
64 Word16 rr[][L_CODE], /* i : matrix of autocorrelation */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
65 Word16 ipos[], /* i : starting position for each pulse */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
66 Word16 pos_max[], /* i : position of maximum of dn[] */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
67 Word16 codvec[] /* o : algebraic codebook vector */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
68 )
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
69 {
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
70 Word16 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9;
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
71 Word16 i, j, k, pos, ia, ib;
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
72 Word16 psk, ps, ps0, ps1, ps2, sq, sq2;
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
73 Word16 alpk, alp, alp_16;
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
74 Word16 rrv[L_CODE];
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
75 Word32 s, alp0, alp1, alp2;
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
76 Word16 gsmefrFlag;
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
77
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
78
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
79 test();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
80 if (sub(nbPulse, 10) == 0)
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
81 {
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
82 gsmefrFlag=1; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
83 }
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
84 else
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
85 {
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
86 gsmefrFlag=0; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
87 }
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
88
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
89 /* fix i0 on maximum of correlation position */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
90 i0 = pos_max[ipos[0]]; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
91
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
92 /*------------------------------------------------------------------*
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
93 * i1 loop: *
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
94 *------------------------------------------------------------------*/
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
95
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
96 /* Default value */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
97 psk = -1; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
98 alpk = 1; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
99 for (i = 0; i < nbPulse; i++)
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
100 {
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
101 codvec[i] = i; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
102 }
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
103
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
104 for (i = 1; i < nbTracks; i++)
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
105 {
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
106 i1 = pos_max[ipos[1]]; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
107 ps0 = add (dn[i0], dn[i1]);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
108 alp0 = L_mult (rr[i0][i0], _1_16);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
109 alp0 = L_mac (alp0, rr[i1][i1], _1_16);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
110 alp0 = L_mac (alp0, rr[i0][i1], _1_8);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
111
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
112 /*----------------------------------------------------------------*
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
113 * i2 and i3 loop: *
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
114 *----------------------------------------------------------------*/
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
115
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
116 /* initialize 4 indices for next loop. */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
117 move16 (); /* initialize "rr[i3][i3]" pointer */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
118 move16 (); /* initialize "rr[i0][i3]" pointer */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
119 move16 (); /* initialize "rr[i1][i3]" pointer */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
120 move16 (); /* initialize "rrv[i3]" pointer */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
121
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
122 for (i3 = ipos[3]; i3 < L_CODE; i3 += step)
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
123 {
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
124 s = L_mult (rr[i3][i3], _1_8); /* index incr= step+L_CODE */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
125 s = L_mac (s, rr[i0][i3], _1_4); /* index increment = step */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
126 s = L_mac (s, rr[i1][i3], _1_4); /* index increment = step */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
127 rrv[i3] = round (s); move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
128 }
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
129
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
130 /* Default value */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
131 sq = -1; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
132 alp = 1; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
133 ps = 0; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
134 ia = ipos[2]; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
135 ib = ipos[3]; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
136
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
137 /* initialize 4 indices for i2 loop. */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
138 move16 (); /* initialize "dn[i2]" pointer */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
139 move16 (); /* initialize "rr[i2][i2]" pointer */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
140 move16 (); /* initialize "rr[i0][i2]" pointer */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
141 move16 (); /* initialize "rr[i1][i2]" pointer */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
142
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
143 for (i2 = ipos[2]; i2 < L_CODE; i2 += step)
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
144 {
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
145 /* index increment = step */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
146 ps1 = add (ps0, dn[i2]);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
147
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
148 /* index incr= step+L_CODE */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
149 alp1 = L_mac (alp0, rr[i2][i2], _1_16);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
150 /* index increment = step */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
151 alp1 = L_mac (alp1, rr[i0][i2], _1_8);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
152 /* index increment = step */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
153 alp1 = L_mac (alp1, rr[i1][i2], _1_8);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
154
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
155 /* initialize 3 indices for i3 inner loop */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
156 move16 (); /* initialize "dn[i3]" pointer */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
157 move16 (); /* initialize "rrv[i3]" pointer */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
158 move16 (); /* initialize "rr[i2][i3]" pointer */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
159
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
160 for (i3 = ipos[3]; i3 < L_CODE; i3 += step)
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
161 {
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
162 /* index increment = step */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
163 ps2 = add (ps1, dn[i3]);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
164
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
165 /* index increment = step */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
166 alp2 = L_mac (alp1, rrv[i3], _1_2);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
167 /* index increment = step */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
168 alp2 = L_mac (alp2, rr[i2][i3], _1_8);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
169
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
170 sq2 = mult (ps2, ps2);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
171
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
172 alp_16 = round (alp2);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
173
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
174 s = L_msu (L_mult (alp, sq2), sq, alp_16);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
175
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
176 test ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
177 if (s > 0)
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
178 {
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
179 sq = sq2; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
180 ps = ps2; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
181 alp = alp_16; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
182 ia = i2; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
183 ib = i3; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
184 }
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
185 }
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
186 }
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
187 i2 = ia; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
188 i3 = ib; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
189
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
190 /*----------------------------------------------------------------*
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
191 * i4 and i5 loop: *
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
192 *----------------------------------------------------------------*/
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
193
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
194 ps0 = ps; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
195 alp0 = L_mult (alp, _1_2);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
196
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
197 /* initialize 6 indices for next loop (see i2-i3 loop) */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
198 move16 (); move16 (); move16 (); move16 (); move16 (); move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
199
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
200 for (i5 = ipos[5]; i5 < L_CODE; i5 += step)
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
201 {
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
202 s = L_mult (rr[i5][i5], _1_8);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
203 s = L_mac (s, rr[i0][i5], _1_4);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
204 s = L_mac (s, rr[i1][i5], _1_4);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
205 s = L_mac (s, rr[i2][i5], _1_4);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
206 s = L_mac (s, rr[i3][i5], _1_4);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
207 rrv[i5] = round (s); move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
208 }
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
209
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
210 /* Default value */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
211 sq = -1; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
212 alp = 1; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
213 ps = 0; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
214 ia = ipos[4]; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
215 ib = ipos[5]; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
216
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
217 /* initialize 6 indices for i4 loop (see i2-i3 loop) */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
218 move16 (); move16 (); move16 (); move16 (); move16 (); move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
219
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
220 for (i4 = ipos[4]; i4 < L_CODE; i4 += step)
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
221 {
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
222 ps1 = add (ps0, dn[i4]);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
223
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
224 alp1 = L_mac (alp0, rr[i4][i4], _1_32);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
225 alp1 = L_mac (alp1, rr[i0][i4], _1_16);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
226 alp1 = L_mac (alp1, rr[i1][i4], _1_16);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
227 alp1 = L_mac (alp1, rr[i2][i4], _1_16);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
228 alp1 = L_mac (alp1, rr[i3][i4], _1_16);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
229
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
230 /* initialize 3 indices for i5 inner loop (see i2-i3 loop) */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
231 move16 (); move16 (); move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
232
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
233 for (i5 = ipos[5]; i5 < L_CODE; i5 += step)
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
234 {
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
235 ps2 = add (ps1, dn[i5]);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
236
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
237 alp2 = L_mac (alp1, rrv[i5], _1_4);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
238 alp2 = L_mac (alp2, rr[i4][i5], _1_16);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
239
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
240 sq2 = mult (ps2, ps2);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
241
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
242 alp_16 = round (alp2);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
243
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
244 s = L_msu (L_mult (alp, sq2), sq, alp_16);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
245
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
246 test ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
247 if (s > 0)
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
248 {
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
249 sq = sq2; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
250 ps = ps2; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
251 alp = alp_16; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
252 ia = i4; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
253 ib = i5; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
254 }
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
255 }
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
256 }
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
257 i4 = ia; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
258 i5 = ib; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
259
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
260 /*----------------------------------------------------------------*
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
261 * i6 and i7 loop: *
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
262 *----------------------------------------------------------------*/
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
263
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
264 ps0 = ps; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
265 alp0 = L_mult (alp, _1_2);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
266
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
267 /* initialize 8 indices for next loop (see i2-i3 loop) */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
268 move16 (); move16 (); move16 (); move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
269 move16 (); move16 (); move16 (); move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
270
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
271 for (i7 = ipos[7]; i7 < L_CODE; i7 += step)
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
272 {
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
273 s = L_mult (rr[i7][i7], _1_16);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
274 s = L_mac (s, rr[i0][i7], _1_8);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
275 s = L_mac (s, rr[i1][i7], _1_8);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
276 s = L_mac (s, rr[i2][i7], _1_8);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
277 s = L_mac (s, rr[i3][i7], _1_8);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
278 s = L_mac (s, rr[i4][i7], _1_8);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
279 s = L_mac (s, rr[i5][i7], _1_8);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
280 rrv[i7] = round (s); move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
281 }
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
282
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
283 /* Default value */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
284 sq = -1; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
285 alp = 1; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
286 ps = 0; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
287 ia = ipos[6]; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
288 ib = ipos[7]; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
289
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
290 /* initialize 8 indices for i6 loop (see i2-i3 loop) */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
291 move16 (); move16 (); move16 (); move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
292 move16 (); move16 (); move16 (); move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
293
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
294 for (i6 = ipos[6]; i6 < L_CODE; i6 += step)
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
295 {
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
296 ps1 = add (ps0, dn[i6]);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
297
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
298 alp1 = L_mac (alp0, rr[i6][i6], _1_64);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
299 alp1 = L_mac (alp1, rr[i0][i6], _1_32);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
300 alp1 = L_mac (alp1, rr[i1][i6], _1_32);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
301 alp1 = L_mac (alp1, rr[i2][i6], _1_32);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
302 alp1 = L_mac (alp1, rr[i3][i6], _1_32);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
303 alp1 = L_mac (alp1, rr[i4][i6], _1_32);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
304 alp1 = L_mac (alp1, rr[i5][i6], _1_32);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
305
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
306 /* initialize 3 indices for i7 inner loop (see i2-i3 loop) */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
307 move16 (); move16 (); move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
308
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
309 for (i7 = ipos[7]; i7 < L_CODE; i7 += step)
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
310 {
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
311 ps2 = add (ps1, dn[i7]);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
312
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
313 alp2 = L_mac (alp1, rrv[i7], _1_4);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
314 alp2 = L_mac (alp2, rr[i6][i7], _1_32);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
315
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
316 sq2 = mult (ps2, ps2);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
317
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
318 alp_16 = round (alp2);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
319
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
320 s = L_msu (L_mult (alp, sq2), sq, alp_16);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
321
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
322 test ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
323 if (s > 0)
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
324 {
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
325 sq = sq2; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
326 ps = ps2; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
327 alp = alp_16; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
328 ia = i6; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
329 ib = i7; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
330 }
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
331 }
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
332 }
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
333 i6 = ia; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
334 i7 = ib; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
335
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
336 /* now finished searching a set of 8 pulses */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
337
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
338 test();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
339 if(gsmefrFlag != 0){
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
340 /* go on with the two last pulses for GSMEFR */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
341 /*----------------------------------------------------------------*
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
342 * i8 and i9 loop: *
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
343 *----------------------------------------------------------------*/
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
344
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
345 ps0 = ps; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
346 alp0 = L_mult (alp, _1_2);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
347
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
348 /* initialize 10 indices for next loop (see i2-i3 loop) */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
349 move16 (); move16 (); move16 (); move16 (); move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
350 move16 (); move16 (); move16 (); move16 (); move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
351
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
352 for (i9 = ipos[9]; i9 < L_CODE; i9 += step)
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
353 {
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
354 s = L_mult (rr[i9][i9], _1_16);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
355 s = L_mac (s, rr[i0][i9], _1_8);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
356 s = L_mac (s, rr[i1][i9], _1_8);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
357 s = L_mac (s, rr[i2][i9], _1_8);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
358 s = L_mac (s, rr[i3][i9], _1_8);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
359 s = L_mac (s, rr[i4][i9], _1_8);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
360 s = L_mac (s, rr[i5][i9], _1_8);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
361 s = L_mac (s, rr[i6][i9], _1_8);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
362 s = L_mac (s, rr[i7][i9], _1_8);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
363 rrv[i9] = round (s); move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
364 }
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
365
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
366 /* Default value */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
367 sq = -1; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
368 alp = 1; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
369 ps = 0; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
370 ia = ipos[8]; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
371 ib = ipos[9]; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
372
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
373 /* initialize 10 indices for i8 loop (see i2-i3 loop) */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
374 move16 (); move16 (); move16 (); move16 (); move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
375 move16 (); move16 (); move16 (); move16 (); move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
376
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
377 for (i8 = ipos[8]; i8 < L_CODE; i8 += step)
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
378 {
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
379 ps1 = add (ps0, dn[i8]);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
380
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
381 alp1 = L_mac (alp0, rr[i8][i8], _1_128);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
382 alp1 = L_mac (alp1, rr[i0][i8], _1_64);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
383 alp1 = L_mac (alp1, rr[i1][i8], _1_64);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
384 alp1 = L_mac (alp1, rr[i2][i8], _1_64);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
385 alp1 = L_mac (alp1, rr[i3][i8], _1_64);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
386 alp1 = L_mac (alp1, rr[i4][i8], _1_64);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
387 alp1 = L_mac (alp1, rr[i5][i8], _1_64);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
388 alp1 = L_mac (alp1, rr[i6][i8], _1_64);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
389 alp1 = L_mac (alp1, rr[i7][i8], _1_64);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
390
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
391 /* initialize 3 indices for i9 inner loop (see i2-i3 loop) */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
392 move16 (); move16 (); move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
393
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
394 for (i9 = ipos[9]; i9 < L_CODE; i9 += step)
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
395 {
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
396 ps2 = add (ps1, dn[i9]);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
397
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
398 alp2 = L_mac (alp1, rrv[i9], _1_8);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
399 alp2 = L_mac (alp2, rr[i8][i9], _1_64);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
400
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
401 sq2 = mult (ps2, ps2);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
402
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
403 alp_16 = round (alp2);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
404
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
405 s = L_msu (L_mult (alp, sq2), sq, alp_16);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
406
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
407 test ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
408 if (s > 0)
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
409 {
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
410 sq = sq2; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
411 ps = ps2; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
412 alp = alp_16; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
413 ia = i8; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
414 ib = i9; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
415 }
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
416 }
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
417 }
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
418 }/* end gsmefrFlag */
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
419
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
420 /*---------------------------------------------------------------- *
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
421 * test and memorise if this combination is better than the last one.*
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
422 *----------------------------------------------------------------*/
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
423
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
424 s = L_msu (L_mult (alpk, sq), psk, alp);
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
425
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
426 test ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
427 if (s > 0)
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
428 {
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
429 psk = sq; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
430 alpk = alp; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
431 codvec[0] = i0; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
432 codvec[1] = i1; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
433 codvec[2] = i2; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
434 codvec[3] = i3; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
435 codvec[4] = i4; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
436 codvec[5] = i5; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
437 codvec[6] = i6; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
438 codvec[7] = i7; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
439
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
440 test();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
441 if (gsmefrFlag != 0)
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
442 {
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
443 codvec[8] = ia; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
444 codvec[9] = ib; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
445 }
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
446 }
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
447 /*----------------------------------------------------------------*
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
448 * Cyclic permutation of i1,i2,i3,i4,i5,i6,i7,(i8 and i9). *
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
449 *----------------------------------------------------------------*/
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
450
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
451 pos = ipos[1]; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
452 for (j = 1, k = 2; k < nbPulse; j++, k++)
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
453 {
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
454 ipos[j] = ipos[k]; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
455 }
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
456 ipos[sub(nbPulse,1)] = pos; move16 ();
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
457 } /* end 1..nbTracks loop*/
ebd064c52fe3 libtwamr: integrate s10_8pf.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
458 }