59 static void ff_acelp_interpolatef_mips(
float *
out,
const float *
in,
60 const float *filter_coeffs,
int precision,
61 int frac_pos,
int filter_length,
int length)
64 int prec = precision * 4;
65 int fc_offset = precision - frac_pos;
66 float in_val_p, in_val_m, fc_val_p, fc_val_m;
68 for (n = 0; n <
length; n++) {
73 const float *p_in_p = &in[
n];
74 const float *p_in_m = &in[n-1];
75 const float *p_filter_coeffs_p = &filter_coeffs[frac_pos];
76 const float *p_filter_coeffs_m = filter_coeffs + fc_offset;
79 for (i = 0; i < filter_length;i++) {
81 "lwc1 %[in_val_p], 0(%[p_in_p]) \n\t"
82 "lwc1 %[fc_val_p], 0(%[p_filter_coeffs_p]) \n\t"
83 "lwc1 %[in_val_m], 0(%[p_in_m]) \n\t"
84 "lwc1 %[fc_val_m], 0(%[p_filter_coeffs_m]) \n\t"
85 "addiu %[p_in_p], %[p_in_p], 4 \n\t"
86 "madd.s %[v],%[v], %[in_val_p],%[fc_val_p] \n\t"
87 "addiu %[p_in_m], %[p_in_m], -4 \n\t"
88 "addu %[p_filter_coeffs_p], %[p_filter_coeffs_p], %[prec] \n\t"
89 "addu %[p_filter_coeffs_m], %[p_filter_coeffs_m], %[prec] \n\t"
90 "madd.s %[v],%[v],%[in_val_m], %[fc_val_m] \n\t"
92 : [
v]
"=&f" (
v),[p_in_p]
"+r" (p_in_p), [p_in_m]
"+r" (p_in_m),
93 [p_filter_coeffs_p]
"+r" (p_filter_coeffs_p),
94 [in_val_p]
"=&f" (in_val_p), [in_val_m]
"=&f" (in_val_m),
95 [fc_val_p]
"=&f" (fc_val_p), [fc_val_m]
"=&f" (fc_val_m),
96 [p_filter_coeffs_m]
"+r" (p_filter_coeffs_m)
105 static void ff_acelp_apply_order_2_transfer_function_mips(
float *out,
const float *in,
106 const float zero_coeffs[2],
107 const float pole_coeffs[2],
108 float gain,
float mem[2],
int n)
115 "lwc1 $f0, 0(%[mem]) \n\t"
116 "blez %[n], ff_acelp_apply_order_2_transfer_function_end%= \n\t"
117 "lwc1 $f1, 4(%[mem]) \n\t"
118 "lwc1 $f2, 0(%[pole_coeffs]) \n\t"
119 "lwc1 $f3, 4(%[pole_coeffs]) \n\t"
120 "lwc1 $f4, 0(%[zero_coeffs]) \n\t"
121 "lwc1 $f5, 4(%[zero_coeffs]) \n\t"
123 "ff_acelp_apply_order_2_transfer_function_madd%=: \n\t"
125 "lwc1 $f6, 0(%[in]) \n\t"
126 "mul.s $f9, $f3, $f1 \n\t"
127 "mul.s $f7, $f2, $f0 \n\t"
128 "msub.s $f7, $f7, %[gain], $f6 \n\t"
129 "sub.s $f7, $f7, $f9 \n\t"
130 "madd.s $f8, $f7, $f4, $f0 \n\t"
131 "madd.s $f8, $f8, $f5, $f1 \n\t"
132 "lwc1 $f11, 4(%[in]) \n\t"
133 "mul.s $f12, $f3, $f0 \n\t"
134 "mul.s $f13, $f2, $f7 \n\t"
135 "msub.s $f13, $f13, %[gain], $f11 \n\t"
136 "sub.s $f13, $f13, $f12 \n\t"
137 "madd.s $f14, $f13, $f4, $f7 \n\t"
138 "madd.s $f14, $f14, $f5, $f0 \n\t"
139 "swc1 $f8, 0(%[out]) \n\t"
140 "lwc1 $f6, 8(%[in]) \n\t"
141 "mul.s $f9, $f3, $f7 \n\t"
142 "mul.s $f15, $f2, $f13 \n\t"
143 "msub.s $f15, $f15, %[gain], $f6 \n\t"
144 "sub.s $f15, $f15, $f9 \n\t"
145 "madd.s $f8, $f15, $f4, $f13 \n\t"
146 "madd.s $f8, $f8, $f5, $f7 \n\t"
147 "swc1 $f14, 4(%[out]) \n\t"
148 "lwc1 $f11, 12(%[in]) \n\t"
149 "mul.s $f12, $f3, $f13 \n\t"
150 "mul.s $f16, $f2, $f15 \n\t"
151 "msub.s $f16, $f16, %[gain], $f11 \n\t"
152 "sub.s $f16, $f16, $f12 \n\t"
153 "madd.s $f14, $f16, $f4, $f15 \n\t"
154 "madd.s $f14, $f14, $f5, $f13 \n\t"
155 "swc1 $f8, 8(%[out]) \n\t"
156 "lwc1 $f6, 16(%[in]) \n\t"
157 "mul.s $f9, $f3, $f15 \n\t"
158 "mul.s $f7, $f2, $f16 \n\t"
159 "msub.s $f7, $f7, %[gain], $f6 \n\t"
160 "sub.s $f7, $f7, $f9 \n\t"
161 "madd.s $f8, $f7, $f4, $f16 \n\t"
162 "madd.s $f8, $f8, $f5, $f15 \n\t"
163 "swc1 $f14, 12(%[out]) \n\t"
164 "lwc1 $f11, 20(%[in]) \n\t"
165 "mul.s $f12, $f3, $f16 \n\t"
166 "mul.s $f13, $f2, $f7 \n\t"
167 "msub.s $f13, $f13, %[gain], $f11 \n\t"
168 "sub.s $f13, $f13, $f12 \n\t"
169 "madd.s $f14, $f13, $f4, $f7 \n\t"
170 "madd.s $f14, $f14, $f5, $f16 \n\t"
171 "swc1 $f8, 16(%[out]) \n\t"
172 "lwc1 $f6, 24(%[in]) \n\t"
173 "mul.s $f9, $f3, $f7 \n\t"
174 "mul.s $f15, $f2, $f13 \n\t"
175 "msub.s $f15, $f15, %[gain], $f6 \n\t"
176 "sub.s $f1, $f15, $f9 \n\t"
177 "madd.s $f8, $f1, $f4, $f13 \n\t"
178 "madd.s $f8, $f8, $f5, $f7 \n\t"
179 "swc1 $f14, 20(%[out]) \n\t"
180 "lwc1 $f11, 28(%[in]) \n\t"
181 "mul.s $f12, $f3, $f13 \n\t"
182 "mul.s $f16, $f2, $f1 \n\t"
183 "msub.s $f16, $f16, %[gain], $f11 \n\t"
184 "sub.s $f0, $f16, $f12 \n\t"
185 "madd.s $f14, $f0, $f4, $f1 \n\t"
186 "madd.s $f14, $f14, $f5, $f13 \n\t"
187 "swc1 $f8, 24(%[out]) \n\t"
188 "addiu %[out], 32 \n\t"
189 "addiu %[in], 32 \n\t"
190 "addiu %[n], -8 \n\t"
191 "swc1 $f14, -4(%[out]) \n\t"
192 "bnez %[n], ff_acelp_apply_order_2_transfer_function_madd%= \n\t"
193 "swc1 $f1, 4(%[mem]) \n\t"
194 "swc1 $f0, 0(%[mem]) \n\t"
196 "ff_acelp_apply_order_2_transfer_function_end%=: \n\t"
199 [in]
"+r" (in), [gain]
"+f" (gain),
200 [n]
"+r" (n), [
mem]
"+r" (
mem)
201 : [zero_coeffs]
"r" (zero_coeffs),
202 [pole_coeffs]
"r" (pole_coeffs)
203 :
"$f0",
"$f1",
"$f2",
"$f3",
"$f4",
"$f5",
204 "$f6",
"$f7",
"$f8",
"$f9",
"$f10",
"$f11",
205 "$f12",
"$f13",
"$f14",
"$f15",
"$f16",
"memory"