FreeCalypso > hg > gsm-codec-lib
comparison libgsmefr/enc_lag6.c @ 194:f151d6c18b31
libgsmefr/enc_lag6.c: perf opt
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 04 Jan 2023 03:36:39 +0000 |
parents | e109d8752d60 |
children |
comparison
equal
deleted
inserted
replaced
193:cf39a90f5196 | 194:f151d6c18b31 |
---|---|
59 if (pit_flag == 0) /* if 1st or 3rd subframe */ | 59 if (pit_flag == 0) /* if 1st or 3rd subframe */ |
60 { | 60 { |
61 /* encode pitch delay (with fraction) */ | 61 /* encode pitch delay (with fraction) */ |
62 | 62 |
63 test (); | 63 test (); |
64 if (sub (T0, 94) <= 0) | 64 if (T0 <= 94) |
65 { | 65 { |
66 /* index = T0*6 - 105 + *T0_frac */ | 66 /* index = T0*6 - 105 + *T0_frac */ |
67 i = add (add (T0, T0), T0); | 67 i = add (add (T0, T0), T0); |
68 index = add (sub (add (i, i), 105), *T0_frac); | 68 index = add (sub (add (i, i), 105), *T0_frac); |
69 } else | 69 } else |
74 | 74 |
75 /* find T0_min and T0_max for second (or fourth) subframe */ | 75 /* find T0_min and T0_max for second (or fourth) subframe */ |
76 | 76 |
77 *T0_min = sub (T0, 5); move16 (); | 77 *T0_min = sub (T0, 5); move16 (); |
78 test (); | 78 test (); |
79 if (sub (*T0_min, pit_min) < 0) | 79 if (*T0_min < pit_min) |
80 { | 80 { |
81 *T0_min = pit_min; move16 (); | 81 *T0_min = pit_min; move16 (); |
82 } | 82 } |
83 *T0_max = add (*T0_min, 9); | 83 *T0_max = add (*T0_min, 9); |
84 test (); | 84 test (); |
85 if (sub (*T0_max, pit_max) > 0) | 85 if (*T0_max > pit_max) |
86 { | 86 { |
87 *T0_max = pit_max; move16 (); | 87 *T0_max = pit_max; move16 (); |
88 *T0_min = sub (*T0_max, 9); move16 (); | 88 *T0_min = sub (*T0_max, 9); move16 (); |
89 } | 89 } |
90 } else | 90 } else |