37{
38#ifndef K6OPT
39 register int k, i;
41#endif
42
44
45#ifdef USE_FLOAT_MUL
46 float float_s[160];
47#endif
48
49
50
51
52
53
54#ifndef K6OPT
55 smax = 0;
56 for (k = 0; k <= 159; k++) {
58 if (temp > smax) smax = temp;
59 }
60#else
61 {
63 lmax = k6maxmin(s,160,
NULL);
65 }
66#endif
67
68
69 if (smax == 0) scalauto = 0;
70 else {
71 assert(smax > 0);
72 scalauto = 4 - gsm_norm( (
longword)smax << 16 );
73 }
74
75
76
77
78 if (scalauto > 0) {
79# ifndef K6OPT
80
81# ifdef USE_FLOAT_MUL
82# define SCALE(n) \
83 case n: for (k = 0; k <= 159; k++) \
84 float_s[k] = (float) \
85 (s[k] = GSM_MULT_R(s[k], 16384 >> (n-1)));\
86 break;
87# else
88# define SCALE(n) \
89 case n: for (k = 0; k <= 159; k++) \
90 s[k] = (word)GSM_MULT_R( s[k], 16384 >> (n-1) );\
91 break;
92# endif
93
94 switch (scalauto) {
99 }
100# undef SCALE
101
102# else
103 k6vsraw(s,160,scalauto);
104# endif
105 }
106# ifdef USE_FLOAT_MUL
107 else for (k = 0; k <= 159; k++) float_s[k] = (float) s[k];
108# endif
109
110
111
112#ifndef K6OPT
113 {
114# ifdef USE_FLOAT_MUL
115 register float * sp = float_s;
116 register float sl = *sp;
117
118# define STEP(k) L_ACF[k] += (longword)(sl * sp[ -(k) ]);
119# else
122
123# define STEP(k) L_ACF[k] += ((longword)sl * sp[ -(k) ]);
124# endif
125
126# define NEXTI sl = *++sp
127
128
129 for (k = 9; k--; L_ACF[k] = 0) ;
130
146
147 for (i = 8; i <= 159; i++) {
148
150
154 }
155
156 for (k = 9; k--; L_ACF[k] <<= 1) ;
157
158 }
159
160#else
161 {
162 int k;
163 for (k=0; k<9; k++) {
164 L_ACF[k] = 2*k6iprod(s,s+k,160-k);
165 }
166 }
167#endif
168
169
170 if (scalauto > 0) {
171 assert(scalauto <= 4);
172#ifndef K6OPT
173 for (k = 160; k--; *s++ <<= scalauto) ;
174# else
175 k6vsllw(s,160,scalauto);
176# endif
177 }
178}