yading@10
|
1 /*
|
yading@10
|
2 * Format Conversion Utils for MIPS
|
yading@10
|
3 *
|
yading@10
|
4 * Copyright (c) 2012
|
yading@10
|
5 * MIPS Technologies, Inc., California.
|
yading@10
|
6 *
|
yading@10
|
7 * Redistribution and use in source and binary forms, with or without
|
yading@10
|
8 * modification, are permitted provided that the following conditions
|
yading@10
|
9 * are met:
|
yading@10
|
10 * 1. Redistributions of source code must retain the above copyright
|
yading@10
|
11 * notice, this list of conditions and the following disclaimer.
|
yading@10
|
12 * 2. Redistributions in binary form must reproduce the above copyright
|
yading@10
|
13 * notice, this list of conditions and the following disclaimer in the
|
yading@10
|
14 * documentation and/or other materials provided with the distribution.
|
yading@10
|
15 * 3. Neither the name of the MIPS Technologies, Inc., nor the names of is
|
yading@10
|
16 * contributors may be used to endorse or promote products derived from
|
yading@10
|
17 * this software without specific prior written permission.
|
yading@10
|
18 *
|
yading@10
|
19 * THIS SOFTWARE IS PROVIDED BY THE MIPS TECHNOLOGIES, INC. ``AS IS'' AND
|
yading@10
|
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
yading@10
|
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
yading@10
|
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE MIPS TECHNOLOGIES, INC. BE LIABLE
|
yading@10
|
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
yading@10
|
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
yading@10
|
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
yading@10
|
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
yading@10
|
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
yading@10
|
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
yading@10
|
29 * SUCH DAMAGE.
|
yading@10
|
30 *
|
yading@10
|
31 * Author: Zoran Lukic (zoranl@mips.com)
|
yading@10
|
32 * Author: Nedeljko Babic (nbabic@mips.com)
|
yading@10
|
33 *
|
yading@10
|
34 * This file is part of FFmpeg.
|
yading@10
|
35 *
|
yading@10
|
36 * FFmpeg is free software; you can redistribute it and/or
|
yading@10
|
37 * modify it under the terms of the GNU Lesser General Public
|
yading@10
|
38 * License as published by the Free Software Foundation; either
|
yading@10
|
39 * version 2.1 of the License, or (at your option) any later version.
|
yading@10
|
40 *
|
yading@10
|
41 * FFmpeg is distributed in the hope that it will be useful,
|
yading@10
|
42 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
yading@10
|
43 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
yading@10
|
44 * Lesser General Public License for more details.
|
yading@10
|
45 *
|
yading@10
|
46 * You should have received a copy of the GNU Lesser General Public
|
yading@10
|
47 * License along with FFmpeg; if not, write to the Free Software
|
yading@10
|
48 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
yading@10
|
49 */
|
yading@10
|
50 #include "config.h"
|
yading@10
|
51 #include "libavcodec/avcodec.h"
|
yading@10
|
52 #include "libavcodec/fmtconvert.h"
|
yading@10
|
53
|
yading@10
|
54 #if HAVE_INLINE_ASM
|
yading@10
|
55 #if HAVE_MIPSDSPR1
|
yading@10
|
56 static void float_to_int16_mips(int16_t *dst, const float *src, long len)
|
yading@10
|
57 {
|
yading@10
|
58 const float *src_end = src + len;
|
yading@10
|
59 int ret0, ret1, ret2, ret3, ret4, ret5, ret6, ret7;
|
yading@10
|
60 float src0, src1, src2, src3, src4, src5, src6, src7;
|
yading@10
|
61
|
yading@10
|
62 /*
|
yading@10
|
63 * loop is 8 times unrolled in assembler in order to achieve better performance
|
yading@10
|
64 */
|
yading@10
|
65 __asm__ volatile(
|
yading@10
|
66 "beq %[len], $zero, fti16_end%= \n\t"
|
yading@10
|
67 "fti16_lp%=: \n\t"
|
yading@10
|
68 "lwc1 %[src0], 0(%[src]) \n\t"
|
yading@10
|
69 "lwc1 %[src1], 4(%[src]) \n\t"
|
yading@10
|
70 "lwc1 %[src2], 8(%[src]) \n\t"
|
yading@10
|
71 "lwc1 %[src3], 12(%[src]) \n\t"
|
yading@10
|
72 "cvt.w.s %[src0], %[src0] \n\t"
|
yading@10
|
73 "cvt.w.s %[src1], %[src1] \n\t"
|
yading@10
|
74 "cvt.w.s %[src2], %[src2] \n\t"
|
yading@10
|
75 "cvt.w.s %[src3], %[src3] \n\t"
|
yading@10
|
76 "mfc1 %[ret0], %[src0] \n\t"
|
yading@10
|
77 "mfc1 %[ret1], %[src1] \n\t"
|
yading@10
|
78 "mfc1 %[ret2], %[src2] \n\t"
|
yading@10
|
79 "mfc1 %[ret3], %[src3] \n\t"
|
yading@10
|
80 "lwc1 %[src4], 16(%[src]) \n\t"
|
yading@10
|
81 "lwc1 %[src5], 20(%[src]) \n\t"
|
yading@10
|
82 "lwc1 %[src6], 24(%[src]) \n\t"
|
yading@10
|
83 "lwc1 %[src7], 28(%[src]) \n\t"
|
yading@10
|
84 "cvt.w.s %[src4], %[src4] \n\t"
|
yading@10
|
85 "cvt.w.s %[src5], %[src5] \n\t"
|
yading@10
|
86 "cvt.w.s %[src6], %[src6] \n\t"
|
yading@10
|
87 "cvt.w.s %[src7], %[src7] \n\t"
|
yading@10
|
88 "addiu %[src], 32 \n\t"
|
yading@10
|
89 "shll_s.w %[ret0], %[ret0], 16 \n\t"
|
yading@10
|
90 "shll_s.w %[ret1], %[ret1], 16 \n\t"
|
yading@10
|
91 "shll_s.w %[ret2], %[ret2], 16 \n\t"
|
yading@10
|
92 "shll_s.w %[ret3], %[ret3], 16 \n\t"
|
yading@10
|
93 "srl %[ret0], %[ret0], 16 \n\t"
|
yading@10
|
94 "srl %[ret1], %[ret1], 16 \n\t"
|
yading@10
|
95 "srl %[ret2], %[ret2], 16 \n\t"
|
yading@10
|
96 "srl %[ret3], %[ret3], 16 \n\t"
|
yading@10
|
97 "sh %[ret0], 0(%[dst]) \n\t"
|
yading@10
|
98 "sh %[ret1], 2(%[dst]) \n\t"
|
yading@10
|
99 "sh %[ret2], 4(%[dst]) \n\t"
|
yading@10
|
100 "sh %[ret3], 6(%[dst]) \n\t"
|
yading@10
|
101 "mfc1 %[ret4], %[src4] \n\t"
|
yading@10
|
102 "mfc1 %[ret5], %[src5] \n\t"
|
yading@10
|
103 "mfc1 %[ret6], %[src6] \n\t"
|
yading@10
|
104 "mfc1 %[ret7], %[src7] \n\t"
|
yading@10
|
105 "shll_s.w %[ret4], %[ret4], 16 \n\t"
|
yading@10
|
106 "shll_s.w %[ret5], %[ret5], 16 \n\t"
|
yading@10
|
107 "shll_s.w %[ret6], %[ret6], 16 \n\t"
|
yading@10
|
108 "shll_s.w %[ret7], %[ret7], 16 \n\t"
|
yading@10
|
109 "srl %[ret4], %[ret4], 16 \n\t"
|
yading@10
|
110 "srl %[ret5], %[ret5], 16 \n\t"
|
yading@10
|
111 "srl %[ret6], %[ret6], 16 \n\t"
|
yading@10
|
112 "srl %[ret7], %[ret7], 16 \n\t"
|
yading@10
|
113 "sh %[ret4], 8(%[dst]) \n\t"
|
yading@10
|
114 "sh %[ret5], 10(%[dst]) \n\t"
|
yading@10
|
115 "sh %[ret6], 12(%[dst]) \n\t"
|
yading@10
|
116 "sh %[ret7], 14(%[dst]) \n\t"
|
yading@10
|
117 "addiu %[dst], 16 \n\t"
|
yading@10
|
118 "bne %[src], %[src_end], fti16_lp%= \n\t"
|
yading@10
|
119 "fti16_end%=: \n\t"
|
yading@10
|
120 : [ret0]"=&r"(ret0), [ret1]"=&r"(ret1), [ret2]"=&r"(ret2), [ret3]"=&r"(ret3),
|
yading@10
|
121 [ret4]"=&r"(ret4), [ret5]"=&r"(ret5), [ret6]"=&r"(ret6), [ret7]"=&r"(ret7),
|
yading@10
|
122 [src0]"=&f"(src0), [src1]"=&f"(src1), [src2]"=&f"(src2), [src3]"=&f"(src3),
|
yading@10
|
123 [src4]"=&f"(src4), [src5]"=&f"(src5), [src6]"=&f"(src6), [src7]"=&f"(src7),
|
yading@10
|
124 [src]"+r"(src), [dst]"+r"(dst)
|
yading@10
|
125 : [src_end]"r"(src_end), [len]"r"(len)
|
yading@10
|
126 : "memory"
|
yading@10
|
127 );
|
yading@10
|
128 }
|
yading@10
|
129
|
yading@10
|
130 static void float_to_int16_interleave_mips(int16_t *dst, const float **src, long len,
|
yading@10
|
131 int channels)
|
yading@10
|
132 {
|
yading@10
|
133 int c, ch2 = channels <<1;
|
yading@10
|
134 int ret0, ret1, ret2, ret3, ret4, ret5, ret6, ret7;
|
yading@10
|
135 float src0, src1, src2, src3, src4, src5, src6, src7;
|
yading@10
|
136 int16_t *dst_ptr0, *dst_ptr1, *dst_ptr2, *dst_ptr3;
|
yading@10
|
137 int16_t *dst_ptr4, *dst_ptr5, *dst_ptr6, *dst_ptr7;
|
yading@10
|
138 const float *src_ptr, *src_ptr2, *src_end;
|
yading@10
|
139
|
yading@10
|
140 if (channels == 2) {
|
yading@10
|
141 src_ptr = &src[0][0];
|
yading@10
|
142 src_ptr2 = &src[1][0];
|
yading@10
|
143 src_end = src_ptr + len;
|
yading@10
|
144
|
yading@10
|
145 __asm__ volatile (
|
yading@10
|
146 "fti16i2_lp%=: \n\t"
|
yading@10
|
147 "lwc1 %[src0], 0(%[src_ptr]) \n\t"
|
yading@10
|
148 "lwc1 %[src1], 0(%[src_ptr2]) \n\t"
|
yading@10
|
149 "addiu %[src_ptr], 4 \n\t"
|
yading@10
|
150 "cvt.w.s $f9, %[src0] \n\t"
|
yading@10
|
151 "cvt.w.s $f10, %[src1] \n\t"
|
yading@10
|
152 "mfc1 %[ret0], $f9 \n\t"
|
yading@10
|
153 "mfc1 %[ret1], $f10 \n\t"
|
yading@10
|
154 "shll_s.w %[ret0], %[ret0], 16 \n\t"
|
yading@10
|
155 "shll_s.w %[ret1], %[ret1], 16 \n\t"
|
yading@10
|
156 "addiu %[src_ptr2], 4 \n\t"
|
yading@10
|
157 "srl %[ret0], %[ret0], 16 \n\t"
|
yading@10
|
158 "srl %[ret1], %[ret1], 16 \n\t"
|
yading@10
|
159 "sh %[ret0], 0(%[dst]) \n\t"
|
yading@10
|
160 "sh %[ret1], 2(%[dst]) \n\t"
|
yading@10
|
161 "addiu %[dst], 4 \n\t"
|
yading@10
|
162 "bne %[src_ptr], %[src_end], fti16i2_lp%= \n\t"
|
yading@10
|
163 : [ret0]"=&r"(ret0), [ret1]"=&r"(ret1),
|
yading@10
|
164 [src0]"=&f"(src0), [src1]"=&f"(src1),
|
yading@10
|
165 [src_ptr]"+r"(src_ptr), [src_ptr2]"+r"(src_ptr2),
|
yading@10
|
166 [dst]"+r"(dst)
|
yading@10
|
167 : [src_end]"r"(src_end)
|
yading@10
|
168 : "memory"
|
yading@10
|
169 );
|
yading@10
|
170 } else {
|
yading@10
|
171 for (c = 0; c < channels; c++) {
|
yading@10
|
172 src_ptr = &src[c][0];
|
yading@10
|
173 dst_ptr0 = &dst[c];
|
yading@10
|
174 src_end = src_ptr + len;
|
yading@10
|
175 /*
|
yading@10
|
176 * loop is 8 times unrolled in assembler in order to achieve better performance
|
yading@10
|
177 */
|
yading@10
|
178 __asm__ volatile(
|
yading@10
|
179 "fti16i_lp%=: \n\t"
|
yading@10
|
180 "lwc1 %[src0], 0(%[src_ptr]) \n\t"
|
yading@10
|
181 "lwc1 %[src1], 4(%[src_ptr]) \n\t"
|
yading@10
|
182 "lwc1 %[src2], 8(%[src_ptr]) \n\t"
|
yading@10
|
183 "lwc1 %[src3], 12(%[src_ptr]) \n\t"
|
yading@10
|
184 "cvt.w.s %[src0], %[src0] \n\t"
|
yading@10
|
185 "cvt.w.s %[src1], %[src1] \n\t"
|
yading@10
|
186 "cvt.w.s %[src2], %[src2] \n\t"
|
yading@10
|
187 "cvt.w.s %[src3], %[src3] \n\t"
|
yading@10
|
188 "mfc1 %[ret0], %[src0] \n\t"
|
yading@10
|
189 "mfc1 %[ret1], %[src1] \n\t"
|
yading@10
|
190 "mfc1 %[ret2], %[src2] \n\t"
|
yading@10
|
191 "mfc1 %[ret3], %[src3] \n\t"
|
yading@10
|
192 "lwc1 %[src4], 16(%[src_ptr]) \n\t"
|
yading@10
|
193 "lwc1 %[src5], 20(%[src_ptr]) \n\t"
|
yading@10
|
194 "lwc1 %[src6], 24(%[src_ptr]) \n\t"
|
yading@10
|
195 "lwc1 %[src7], 28(%[src_ptr]) \n\t"
|
yading@10
|
196 "addu %[dst_ptr1], %[dst_ptr0], %[ch2] \n\t"
|
yading@10
|
197 "addu %[dst_ptr2], %[dst_ptr1], %[ch2] \n\t"
|
yading@10
|
198 "addu %[dst_ptr3], %[dst_ptr2], %[ch2] \n\t"
|
yading@10
|
199 "addu %[dst_ptr4], %[dst_ptr3], %[ch2] \n\t"
|
yading@10
|
200 "addu %[dst_ptr5], %[dst_ptr4], %[ch2] \n\t"
|
yading@10
|
201 "addu %[dst_ptr6], %[dst_ptr5], %[ch2] \n\t"
|
yading@10
|
202 "addu %[dst_ptr7], %[dst_ptr6], %[ch2] \n\t"
|
yading@10
|
203 "addiu %[src_ptr], 32 \n\t"
|
yading@10
|
204 "cvt.w.s %[src4], %[src4] \n\t"
|
yading@10
|
205 "cvt.w.s %[src5], %[src5] \n\t"
|
yading@10
|
206 "cvt.w.s %[src6], %[src6] \n\t"
|
yading@10
|
207 "cvt.w.s %[src7], %[src7] \n\t"
|
yading@10
|
208 "shll_s.w %[ret0], %[ret0], 16 \n\t"
|
yading@10
|
209 "shll_s.w %[ret1], %[ret1], 16 \n\t"
|
yading@10
|
210 "shll_s.w %[ret2], %[ret2], 16 \n\t"
|
yading@10
|
211 "shll_s.w %[ret3], %[ret3], 16 \n\t"
|
yading@10
|
212 "srl %[ret0], %[ret0], 16 \n\t"
|
yading@10
|
213 "srl %[ret1], %[ret1], 16 \n\t"
|
yading@10
|
214 "srl %[ret2], %[ret2], 16 \n\t"
|
yading@10
|
215 "srl %[ret3], %[ret3], 16 \n\t"
|
yading@10
|
216 "sh %[ret0], 0(%[dst_ptr0]) \n\t"
|
yading@10
|
217 "sh %[ret1], 0(%[dst_ptr1]) \n\t"
|
yading@10
|
218 "sh %[ret2], 0(%[dst_ptr2]) \n\t"
|
yading@10
|
219 "sh %[ret3], 0(%[dst_ptr3]) \n\t"
|
yading@10
|
220 "mfc1 %[ret4], %[src4] \n\t"
|
yading@10
|
221 "mfc1 %[ret5], %[src5] \n\t"
|
yading@10
|
222 "mfc1 %[ret6], %[src6] \n\t"
|
yading@10
|
223 "mfc1 %[ret7], %[src7] \n\t"
|
yading@10
|
224 "shll_s.w %[ret4], %[ret4], 16 \n\t"
|
yading@10
|
225 "shll_s.w %[ret5], %[ret5], 16 \n\t"
|
yading@10
|
226 "shll_s.w %[ret6], %[ret6], 16 \n\t"
|
yading@10
|
227 "shll_s.w %[ret7], %[ret7], 16 \n\t"
|
yading@10
|
228 "srl %[ret4], %[ret4], 16 \n\t"
|
yading@10
|
229 "srl %[ret5], %[ret5], 16 \n\t"
|
yading@10
|
230 "srl %[ret6], %[ret6], 16 \n\t"
|
yading@10
|
231 "srl %[ret7], %[ret7], 16 \n\t"
|
yading@10
|
232 "sh %[ret4], 0(%[dst_ptr4]) \n\t"
|
yading@10
|
233 "sh %[ret5], 0(%[dst_ptr5]) \n\t"
|
yading@10
|
234 "sh %[ret6], 0(%[dst_ptr6]) \n\t"
|
yading@10
|
235 "sh %[ret7], 0(%[dst_ptr7]) \n\t"
|
yading@10
|
236 "addu %[dst_ptr0], %[dst_ptr7], %[ch2] \n\t"
|
yading@10
|
237 "bne %[src_ptr], %[src_end], fti16i_lp%= \n\t"
|
yading@10
|
238 : [ret0]"=&r"(ret0), [ret1]"=&r"(ret1), [ret2]"=&r"(ret2), [ret3]"=&r"(ret3),
|
yading@10
|
239 [ret4]"=&r"(ret4), [ret5]"=&r"(ret5), [ret6]"=&r"(ret6), [ret7]"=&r"(ret7),
|
yading@10
|
240 [src0]"=&f"(src0), [src1]"=&f"(src1), [src2]"=&f"(src2), [src3]"=&f"(src3),
|
yading@10
|
241 [src4]"=&f"(src4), [src5]"=&f"(src5), [src6]"=&f"(src6), [src7]"=&f"(src7),
|
yading@10
|
242 [dst_ptr1]"=&r"(dst_ptr1), [dst_ptr2]"=&r"(dst_ptr2), [dst_ptr3]"=&r"(dst_ptr3),
|
yading@10
|
243 [dst_ptr4]"=&r"(dst_ptr4), [dst_ptr5]"=&r"(dst_ptr5), [dst_ptr6]"=&r"(dst_ptr6),
|
yading@10
|
244 [dst_ptr7]"=&r"(dst_ptr7), [dst_ptr0]"+r"(dst_ptr0), [src_ptr]"+r"(src_ptr)
|
yading@10
|
245 : [ch2]"r"(ch2), [src_end]"r"(src_end)
|
yading@10
|
246 : "memory"
|
yading@10
|
247 );
|
yading@10
|
248 }
|
yading@10
|
249 }
|
yading@10
|
250 }
|
yading@10
|
251 #endif /* HAVE_MIPSDSPR1 */
|
yading@10
|
252
|
yading@10
|
253 static void int32_to_float_fmul_scalar_mips(float *dst, const int *src,
|
yading@10
|
254 float mul, int len)
|
yading@10
|
255 {
|
yading@10
|
256 /*
|
yading@10
|
257 * variables used in inline assembler
|
yading@10
|
258 */
|
yading@10
|
259 float temp1, temp3, temp5, temp7, temp9, temp11, temp13, temp15;
|
yading@10
|
260
|
yading@10
|
261 int rpom1, rpom2, rpom11, rpom21, rpom12, rpom22, rpom13, rpom23;
|
yading@10
|
262 const int *src_end = src + len;
|
yading@10
|
263 /*
|
yading@10
|
264 * loop is 8 times unrolled in assembler in order to achieve better performance
|
yading@10
|
265 */
|
yading@10
|
266 __asm__ volatile (
|
yading@10
|
267 "i32tf_lp%=: \n\t"
|
yading@10
|
268 "lw %[rpom11], 0(%[src]) \n\t"
|
yading@10
|
269 "lw %[rpom21], 4(%[src]) \n\t"
|
yading@10
|
270 "lw %[rpom1], 8(%[src]) \n\t"
|
yading@10
|
271 "lw %[rpom2], 12(%[src]) \n\t"
|
yading@10
|
272 "mtc1 %[rpom11], %[temp1] \n\t"
|
yading@10
|
273 "mtc1 %[rpom21], %[temp3] \n\t"
|
yading@10
|
274 "mtc1 %[rpom1], %[temp5] \n\t"
|
yading@10
|
275 "mtc1 %[rpom2], %[temp7] \n\t"
|
yading@10
|
276
|
yading@10
|
277 "lw %[rpom13], 16(%[src]) \n\t"
|
yading@10
|
278 "lw %[rpom23], 20(%[src]) \n\t"
|
yading@10
|
279 "lw %[rpom12], 24(%[src]) \n\t"
|
yading@10
|
280 "lw %[rpom22], 28(%[src]) \n\t"
|
yading@10
|
281 "mtc1 %[rpom13], %[temp9] \n\t"
|
yading@10
|
282 "mtc1 %[rpom23], %[temp11] \n\t"
|
yading@10
|
283 "mtc1 %[rpom12], %[temp13] \n\t"
|
yading@10
|
284 "mtc1 %[rpom22], %[temp15] \n\t"
|
yading@10
|
285
|
yading@10
|
286 "addiu %[src], 32 \n\t"
|
yading@10
|
287 "cvt.s.w %[temp1], %[temp1] \n\t"
|
yading@10
|
288 "cvt.s.w %[temp3], %[temp3] \n\t"
|
yading@10
|
289 "cvt.s.w %[temp5], %[temp5] \n\t"
|
yading@10
|
290 "cvt.s.w %[temp7], %[temp7] \n\t"
|
yading@10
|
291
|
yading@10
|
292 "cvt.s.w %[temp9], %[temp9] \n\t"
|
yading@10
|
293 "cvt.s.w %[temp11], %[temp11] \n\t"
|
yading@10
|
294 "cvt.s.w %[temp13], %[temp13] \n\t"
|
yading@10
|
295 "cvt.s.w %[temp15], %[temp15] \n\t"
|
yading@10
|
296
|
yading@10
|
297 "mul.s %[temp1], %[temp1], %[mul] \n\t"
|
yading@10
|
298 "mul.s %[temp3], %[temp3], %[mul] \n\t"
|
yading@10
|
299 "mul.s %[temp5], %[temp5], %[mul] \n\t"
|
yading@10
|
300 "mul.s %[temp7], %[temp7], %[mul] \n\t"
|
yading@10
|
301
|
yading@10
|
302 "mul.s %[temp9], %[temp9], %[mul] \n\t"
|
yading@10
|
303 "mul.s %[temp11], %[temp11], %[mul] \n\t"
|
yading@10
|
304 "mul.s %[temp13], %[temp13], %[mul] \n\t"
|
yading@10
|
305 "mul.s %[temp15], %[temp15], %[mul] \n\t"
|
yading@10
|
306
|
yading@10
|
307 "swc1 %[temp1], 0(%[dst]) \n\t" /*dst[i] = src[i] * mul; */
|
yading@10
|
308 "swc1 %[temp3], 4(%[dst]) \n\t" /*dst[i+1] = src[i+1] * mul;*/
|
yading@10
|
309 "swc1 %[temp5], 8(%[dst]) \n\t" /*dst[i+2] = src[i+2] * mul;*/
|
yading@10
|
310 "swc1 %[temp7], 12(%[dst]) \n\t" /*dst[i+3] = src[i+3] * mul;*/
|
yading@10
|
311
|
yading@10
|
312 "swc1 %[temp9], 16(%[dst]) \n\t" /*dst[i+4] = src[i+4] * mul;*/
|
yading@10
|
313 "swc1 %[temp11], 20(%[dst]) \n\t" /*dst[i+5] = src[i+5] * mul;*/
|
yading@10
|
314 "swc1 %[temp13], 24(%[dst]) \n\t" /*dst[i+6] = src[i+6] * mul;*/
|
yading@10
|
315 "swc1 %[temp15], 28(%[dst]) \n\t" /*dst[i+7] = src[i+7] * mul;*/
|
yading@10
|
316 "addiu %[dst], 32 \n\t"
|
yading@10
|
317 "bne %[src], %[src_end], i32tf_lp%= \n\t"
|
yading@10
|
318 : [temp1]"=&f"(temp1), [temp11]"=&f"(temp11),
|
yading@10
|
319 [temp13]"=&f"(temp13), [temp15]"=&f"(temp15),
|
yading@10
|
320 [temp3]"=&f"(temp3), [temp5]"=&f"(temp5),
|
yading@10
|
321 [temp7]"=&f"(temp7), [temp9]"=&f"(temp9),
|
yading@10
|
322 [rpom1]"=&r"(rpom1), [rpom2]"=&r"(rpom2),
|
yading@10
|
323 [rpom11]"=&r"(rpom11), [rpom21]"=&r"(rpom21),
|
yading@10
|
324 [rpom12]"=&r"(rpom12), [rpom22]"=&r"(rpom22),
|
yading@10
|
325 [rpom13]"=&r"(rpom13), [rpom23]"=&r"(rpom23),
|
yading@10
|
326 [dst]"+r"(dst), [src]"+r"(src)
|
yading@10
|
327 : [mul]"f"(mul), [src_end]"r"(src_end)
|
yading@10
|
328 : "memory"
|
yading@10
|
329 );
|
yading@10
|
330 }
|
yading@10
|
331 #endif /* HAVE_INLINE_ASM */
|
yading@10
|
332
|
yading@10
|
333 av_cold void ff_fmt_convert_init_mips(FmtConvertContext *c)
|
yading@10
|
334 {
|
yading@10
|
335 #if HAVE_INLINE_ASM
|
yading@10
|
336 #if HAVE_MIPSDSPR1
|
yading@10
|
337 c->float_to_int16_interleave = float_to_int16_interleave_mips;
|
yading@10
|
338 c->float_to_int16 = float_to_int16_mips;
|
yading@10
|
339 #endif
|
yading@10
|
340 c->int32_to_float_fmul_scalar = int32_to_float_fmul_scalar_mips;
|
yading@10
|
341 #endif
|
yading@10
|
342 }
|