comparison libgsmefr/g_pitch.c @ 195:827661987b41

libgsmefr/g_pitch.c: perf opt
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 04 Jan 2023 03:50:34 +0000
parents d9229fdac1c7
children
comparison
equal deleted inserted replaced
194:f151d6c18b31 195:827661987b41
49 for (i = 0; i < L_subfr; i++) 49 for (i = 0; i < L_subfr; i++)
50 { 50 {
51 s = L_mac (s, y1[i], y1[i]); 51 s = L_mac (s, y1[i], y1[i]);
52 } 52 }
53 test (); 53 test ();
54 if (L_sub (s, MAX_32) != 0L) /* Test for overflow */ 54 if (s != MAX_32) /* Test for overflow */
55 { 55 {
56 s = L_add (s, 1L); /* Avoid case of all zeros */ 56 s++; /* Avoid case of all zeros */
57 exp_yy = norm_l (s); 57 exp_yy = norm_l (s);
58 yy = round (L_shl (s, exp_yy)); 58 yy = round (L_shl (s, exp_yy));
59 } 59 }
60 else 60 else
61 { 61 {
121 gain = shr (gain, i); 121 gain = shr (gain, i);
122 122
123 /* if(gain >1.2) gain = 1.2 */ 123 /* if(gain >1.2) gain = 1.2 */
124 124
125 test (); 125 test ();
126 if (sub (gain, 4915) > 0) 126 if (gain > 4915)
127 { 127 {
128 gain = 4915; move16 (); 128 gain = 4915; move16 ();
129 } 129 }
130 return (gain); 130 return (gain);
131 } 131 }