aacsbr_mips.h 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496
  1. /*
  2. * Copyright (c) 2012
  3. * MIPS Technologies, Inc., California.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions
  7. * are met:
  8. * 1. Redistributions of source code must retain the above copyright
  9. * notice, this list of conditions and the following disclaimer.
  10. * 2. Redistributions in binary form must reproduce the above copyright
  11. * notice, this list of conditions and the following disclaimer in the
  12. * documentation and/or other materials provided with the distribution.
  13. * 3. Neither the name of the MIPS Technologies, Inc., nor the names of its
  14. * contributors may be used to endorse or promote products derived from
  15. * this software without specific prior written permission.
  16. *
  17. * THIS SOFTWARE IS PROVIDED BY THE MIPS TECHNOLOGIES, INC. ``AS IS'' AND
  18. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  19. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  20. * ARE DISCLAIMED. IN NO EVENT SHALL THE MIPS TECHNOLOGIES, INC. BE LIABLE
  21. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  22. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  23. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  24. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  25. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  26. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  27. * SUCH DAMAGE.
  28. *
  29. * Authors: Djordje Pesut (djordje@mips.com)
  30. * Mirjana Vulin (mvulin@mips.com)
  31. *
  32. * This file is part of FFmpeg.
  33. *
  34. * FFmpeg is free software; you can redistribute it and/or
  35. * modify it under the terms of the GNU Lesser General Public
  36. * License as published by the Free Software Foundation; either
  37. * version 2.1 of the License, or (at your option) any later version.
  38. *
  39. * FFmpeg is distributed in the hope that it will be useful,
  40. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  41. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  42. * Lesser General Public License for more details.
  43. *
  44. * You should have received a copy of the GNU Lesser General Public
  45. * License along with FFmpeg; if not, write to the Free Software
  46. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  47. */
  48. /**
  49. * @file
  50. * Reference: libavcodec/aacsbr.c
  51. */
  52. #ifndef AVCODEC_MIPS_AACSBR_MIPS_H
  53. #define AVCODEC_MIPS_AACSBR_MIPS_H
  54. #include "libavcodec/aac.h"
  55. #include "libavcodec/sbr.h"
  56. #include "libavutil/mips/asmdefs.h"
  57. #if HAVE_INLINE_ASM
  58. static void sbr_qmf_analysis_mips(AVFloatDSPContext *fdsp, FFTContext *mdct,
  59. SBRDSPContext *sbrdsp, const float *in, float *x,
  60. float z[320], float W[2][32][32][2], int buf_idx)
  61. {
  62. int i;
  63. float *w0;
  64. float *w1;
  65. int temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7;
  66. w0 = x;
  67. w1 = x + 1024;
  68. for(i = 0; i < 36; i++)
  69. {
  70. /* loop unrolled 8 times */
  71. __asm__ volatile(
  72. "lw %[temp0], 0(%[w1]) \n\t"
  73. "lw %[temp1], 4(%[w1]) \n\t"
  74. "lw %[temp2], 8(%[w1]) \n\t"
  75. "lw %[temp3], 12(%[w1]) \n\t"
  76. "lw %[temp4], 16(%[w1]) \n\t"
  77. "lw %[temp5], 20(%[w1]) \n\t"
  78. "lw %[temp6], 24(%[w1]) \n\t"
  79. "lw %[temp7], 28(%[w1]) \n\t"
  80. "sw %[temp0], 0(%[w0]) \n\t"
  81. "sw %[temp1], 4(%[w0]) \n\t"
  82. "sw %[temp2], 8(%[w0]) \n\t"
  83. "sw %[temp3], 12(%[w0]) \n\t"
  84. "sw %[temp4], 16(%[w0]) \n\t"
  85. "sw %[temp5], 20(%[w0]) \n\t"
  86. "sw %[temp6], 24(%[w0]) \n\t"
  87. "sw %[temp7], 28(%[w0]) \n\t"
  88. PTR_ADDIU " %[w0], %[w0], 32 \n\t"
  89. PTR_ADDIU " %[w1], %[w1], 32 \n\t"
  90. : [w0]"+r"(w0), [w1]"+r"(w1),
  91. [temp0]"=&r"(temp0), [temp1]"=&r"(temp1),
  92. [temp2]"=&r"(temp2), [temp3]"=&r"(temp3),
  93. [temp4]"=&r"(temp4), [temp5]"=&r"(temp5),
  94. [temp6]"=&r"(temp6), [temp7]"=&r"(temp7)
  95. :
  96. : "memory"
  97. );
  98. }
  99. w0 = x + 288;
  100. w1 = (float*)in;
  101. for(i = 0; i < 128; i++)
  102. {
  103. /* loop unrolled 8 times */
  104. __asm__ volatile(
  105. "lw %[temp0], 0(%[w1]) \n\t"
  106. "lw %[temp1], 4(%[w1]) \n\t"
  107. "lw %[temp2], 8(%[w1]) \n\t"
  108. "lw %[temp3], 12(%[w1]) \n\t"
  109. "lw %[temp4], 16(%[w1]) \n\t"
  110. "lw %[temp5], 20(%[w1]) \n\t"
  111. "lw %[temp6], 24(%[w1]) \n\t"
  112. "lw %[temp7], 28(%[w1]) \n\t"
  113. "sw %[temp0], 0(%[w0]) \n\t"
  114. "sw %[temp1], 4(%[w0]) \n\t"
  115. "sw %[temp2], 8(%[w0]) \n\t"
  116. "sw %[temp3], 12(%[w0]) \n\t"
  117. "sw %[temp4], 16(%[w0]) \n\t"
  118. "sw %[temp5], 20(%[w0]) \n\t"
  119. "sw %[temp6], 24(%[w0]) \n\t"
  120. "sw %[temp7], 28(%[w0]) \n\t"
  121. PTR_ADDIU " %[w0], %[w0], 32 \n\t"
  122. PTR_ADDIU " %[w1], %[w1], 32 \n\t"
  123. : [w0]"+r"(w0), [w1]"+r"(w1),
  124. [temp0]"=&r"(temp0), [temp1]"=&r"(temp1),
  125. [temp2]"=&r"(temp2), [temp3]"=&r"(temp3),
  126. [temp4]"=&r"(temp4), [temp5]"=&r"(temp5),
  127. [temp6]"=&r"(temp6), [temp7]"=&r"(temp7)
  128. :
  129. : "memory"
  130. );
  131. }
  132. for (i = 0; i < 32; i++) { // numTimeSlots*RATE = 16*2 as 960 sample frames
  133. // are not supported
  134. fdsp->vector_fmul_reverse(z, sbr_qmf_window_ds, x, 320);
  135. sbrdsp->sum64x5(z);
  136. sbrdsp->qmf_pre_shuffle(z);
  137. mdct->imdct_half(mdct, z, z+64);
  138. sbrdsp->qmf_post_shuffle(W[buf_idx][i], z);
  139. x += 32;
  140. }
  141. }
  142. #if HAVE_MIPSFPU
  143. #if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
  144. static void sbr_qmf_synthesis_mips(FFTContext *mdct,
  145. SBRDSPContext *sbrdsp, AVFloatDSPContext *fdsp,
  146. float *out, float X[2][38][64],
  147. float mdct_buf[2][64],
  148. float *v0, int *v_off, const unsigned int div)
  149. {
  150. int i, n;
  151. const float *sbr_qmf_window = div ? sbr_qmf_window_ds : sbr_qmf_window_us;
  152. const int step = 128 >> div;
  153. float *v;
  154. float temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7, temp8, temp9, temp10, temp11, temp12, temp13;
  155. float temp14, temp15, temp16, temp17, temp18, temp19;
  156. float *vv0, *s0, *dst;
  157. dst = out;
  158. for (i = 0; i < 32; i++) {
  159. if (*v_off < step) {
  160. int saved_samples = (1280 - 128) >> div;
  161. memcpy(&v0[SBR_SYNTHESIS_BUF_SIZE - saved_samples], v0, saved_samples * sizeof(float));
  162. *v_off = SBR_SYNTHESIS_BUF_SIZE - saved_samples - step;
  163. } else {
  164. *v_off -= step;
  165. }
  166. v = v0 + *v_off;
  167. if (div) {
  168. for (n = 0; n < 32; n++) {
  169. X[0][i][ n] = -X[0][i][n];
  170. X[0][i][32+n] = X[1][i][31-n];
  171. }
  172. mdct->imdct_half(mdct, mdct_buf[0], X[0][i]);
  173. sbrdsp->qmf_deint_neg(v, mdct_buf[0]);
  174. } else {
  175. sbrdsp->neg_odd_64(X[1][i]);
  176. mdct->imdct_half(mdct, mdct_buf[0], X[0][i]);
  177. mdct->imdct_half(mdct, mdct_buf[1], X[1][i]);
  178. sbrdsp->qmf_deint_bfly(v, mdct_buf[1], mdct_buf[0]);
  179. }
  180. if(div == 0)
  181. {
  182. float *v0_end;
  183. vv0 = v;
  184. v0_end = v + 60;
  185. s0 = (float*)sbr_qmf_window;
  186. /* 10 calls of function vector_fmul_add merged into one loop
  187. and loop unrolled 4 times */
  188. __asm__ volatile(
  189. ".set push \n\t"
  190. ".set noreorder \n\t"
  191. "lwc1 %[temp4], 0(%[v0]) \n\t"
  192. "lwc1 %[temp5], 0(%[s0]) \n\t"
  193. "lwc1 %[temp6], 4(%[v0]) \n\t"
  194. "lwc1 %[temp7], 4(%[s0]) \n\t"
  195. "lwc1 %[temp8], 8(%[v0]) \n\t"
  196. "lwc1 %[temp9], 8(%[s0]) \n\t"
  197. "lwc1 %[temp10], 12(%[v0]) \n\t"
  198. "lwc1 %[temp11], 12(%[s0]) \n\t"
  199. "lwc1 %[temp12], 768(%[v0]) \n\t"
  200. "lwc1 %[temp13], 256(%[s0]) \n\t"
  201. "lwc1 %[temp14], 772(%[v0]) \n\t"
  202. "lwc1 %[temp15], 260(%[s0]) \n\t"
  203. "lwc1 %[temp16], 776(%[v0]) \n\t"
  204. "lwc1 %[temp17], 264(%[s0]) \n\t"
  205. "lwc1 %[temp18], 780(%[v0]) \n\t"
  206. "lwc1 %[temp19], 268(%[s0]) \n\t"
  207. "1: \n\t"
  208. "mul.s %[temp0], %[temp4], %[temp5] \n\t"
  209. "lwc1 %[temp4], 1024(%[v0]) \n\t"
  210. "mul.s %[temp1], %[temp6], %[temp7] \n\t"
  211. "lwc1 %[temp5], 512(%[s0]) \n\t"
  212. "mul.s %[temp2], %[temp8], %[temp9] \n\t"
  213. "lwc1 %[temp6], 1028(%[v0]) \n\t"
  214. "mul.s %[temp3], %[temp10], %[temp11] \n\t"
  215. "lwc1 %[temp7], 516(%[s0]) \n\t"
  216. "madd.s %[temp0], %[temp0], %[temp12], %[temp13] \n\t"
  217. "lwc1 %[temp8], 1032(%[v0]) \n\t"
  218. "madd.s %[temp1], %[temp1], %[temp14], %[temp15] \n\t"
  219. "lwc1 %[temp9], 520(%[s0]) \n\t"
  220. "madd.s %[temp2], %[temp2], %[temp16], %[temp17] \n\t"
  221. "lwc1 %[temp10], 1036(%[v0]) \n\t"
  222. "madd.s %[temp3], %[temp3], %[temp18], %[temp19] \n\t"
  223. "lwc1 %[temp11], 524(%[s0]) \n\t"
  224. "lwc1 %[temp12], 1792(%[v0]) \n\t"
  225. "lwc1 %[temp13], 768(%[s0]) \n\t"
  226. "lwc1 %[temp14], 1796(%[v0]) \n\t"
  227. "lwc1 %[temp15], 772(%[s0]) \n\t"
  228. "lwc1 %[temp16], 1800(%[v0]) \n\t"
  229. "lwc1 %[temp17], 776(%[s0]) \n\t"
  230. "lwc1 %[temp18], 1804(%[v0]) \n\t"
  231. "lwc1 %[temp19], 780(%[s0]) \n\t"
  232. "madd.s %[temp0], %[temp0], %[temp4], %[temp5] \n\t"
  233. "lwc1 %[temp4], 2048(%[v0]) \n\t"
  234. "madd.s %[temp1], %[temp1], %[temp6], %[temp7] \n\t"
  235. "lwc1 %[temp5], 1024(%[s0]) \n\t"
  236. "madd.s %[temp2], %[temp2], %[temp8], %[temp9] \n\t"
  237. "lwc1 %[temp6], 2052(%[v0]) \n\t"
  238. "madd.s %[temp3], %[temp3], %[temp10], %[temp11] \n\t"
  239. "lwc1 %[temp7], 1028(%[s0]) \n\t"
  240. "madd.s %[temp0], %[temp0], %[temp12], %[temp13] \n\t"
  241. "lwc1 %[temp8], 2056(%[v0]) \n\t"
  242. "madd.s %[temp1], %[temp1], %[temp14], %[temp15] \n\t"
  243. "lwc1 %[temp9], 1032(%[s0]) \n\t"
  244. "madd.s %[temp2], %[temp2], %[temp16], %[temp17] \n\t"
  245. "lwc1 %[temp10], 2060(%[v0]) \n\t"
  246. "madd.s %[temp3], %[temp3], %[temp18], %[temp19] \n\t"
  247. "lwc1 %[temp11], 1036(%[s0]) \n\t"
  248. "lwc1 %[temp12], 2816(%[v0]) \n\t"
  249. "lwc1 %[temp13], 1280(%[s0]) \n\t"
  250. "lwc1 %[temp14], 2820(%[v0]) \n\t"
  251. "lwc1 %[temp15], 1284(%[s0]) \n\t"
  252. "lwc1 %[temp16], 2824(%[v0]) \n\t"
  253. "lwc1 %[temp17], 1288(%[s0]) \n\t"
  254. "lwc1 %[temp18], 2828(%[v0]) \n\t"
  255. "lwc1 %[temp19], 1292(%[s0]) \n\t"
  256. "madd.s %[temp0], %[temp0], %[temp4], %[temp5] \n\t"
  257. "lwc1 %[temp4], 3072(%[v0]) \n\t"
  258. "madd.s %[temp1], %[temp1], %[temp6], %[temp7] \n\t"
  259. "lwc1 %[temp5], 1536(%[s0]) \n\t"
  260. "madd.s %[temp2], %[temp2], %[temp8], %[temp9] \n\t"
  261. "lwc1 %[temp6], 3076(%[v0]) \n\t"
  262. "madd.s %[temp3], %[temp3], %[temp10], %[temp11] \n\t"
  263. "lwc1 %[temp7], 1540(%[s0]) \n\t"
  264. "madd.s %[temp0], %[temp0], %[temp12], %[temp13] \n\t"
  265. "lwc1 %[temp8], 3080(%[v0]) \n\t"
  266. "madd.s %[temp1], %[temp1], %[temp14], %[temp15] \n\t"
  267. "lwc1 %[temp9], 1544(%[s0]) \n\t"
  268. "madd.s %[temp2], %[temp2], %[temp16], %[temp17] \n\t"
  269. "lwc1 %[temp10], 3084(%[v0]) \n\t"
  270. "madd.s %[temp3], %[temp3], %[temp18], %[temp19] \n\t"
  271. "lwc1 %[temp11], 1548(%[s0]) \n\t"
  272. "lwc1 %[temp12], 3840(%[v0]) \n\t"
  273. "lwc1 %[temp13], 1792(%[s0]) \n\t"
  274. "lwc1 %[temp14], 3844(%[v0]) \n\t"
  275. "lwc1 %[temp15], 1796(%[s0]) \n\t"
  276. "lwc1 %[temp16], 3848(%[v0]) \n\t"
  277. "lwc1 %[temp17], 1800(%[s0]) \n\t"
  278. "lwc1 %[temp18], 3852(%[v0]) \n\t"
  279. "lwc1 %[temp19], 1804(%[s0]) \n\t"
  280. "madd.s %[temp0], %[temp0], %[temp4], %[temp5] \n\t"
  281. "lwc1 %[temp4], 4096(%[v0]) \n\t"
  282. "madd.s %[temp1], %[temp1], %[temp6], %[temp7] \n\t"
  283. "lwc1 %[temp5], 2048(%[s0]) \n\t"
  284. "madd.s %[temp2], %[temp2], %[temp8], %[temp9] \n\t"
  285. "lwc1 %[temp6], 4100(%[v0]) \n\t"
  286. "madd.s %[temp3], %[temp3], %[temp10], %[temp11] \n\t"
  287. "lwc1 %[temp7], 2052(%[s0]) \n\t"
  288. "madd.s %[temp0], %[temp0], %[temp12], %[temp13] \n\t"
  289. "lwc1 %[temp8], 4104(%[v0]) \n\t"
  290. PTR_ADDIU "%[dst], %[dst], 16 \n\t"
  291. "madd.s %[temp1], %[temp1], %[temp14], %[temp15] \n\t"
  292. "lwc1 %[temp9], 2056(%[s0]) \n\t"
  293. PTR_ADDIU " %[s0], %[s0], 16 \n\t"
  294. "madd.s %[temp2], %[temp2], %[temp16], %[temp17] \n\t"
  295. "lwc1 %[temp10], 4108(%[v0]) \n\t"
  296. PTR_ADDIU " %[v0], %[v0], 16 \n\t"
  297. "madd.s %[temp3], %[temp3], %[temp18], %[temp19] \n\t"
  298. "lwc1 %[temp11], 2044(%[s0]) \n\t"
  299. "lwc1 %[temp12], 4848(%[v0]) \n\t"
  300. "lwc1 %[temp13], 2288(%[s0]) \n\t"
  301. "lwc1 %[temp14], 4852(%[v0]) \n\t"
  302. "lwc1 %[temp15], 2292(%[s0]) \n\t"
  303. "lwc1 %[temp16], 4856(%[v0]) \n\t"
  304. "lwc1 %[temp17], 2296(%[s0]) \n\t"
  305. "lwc1 %[temp18], 4860(%[v0]) \n\t"
  306. "lwc1 %[temp19], 2300(%[s0]) \n\t"
  307. "madd.s %[temp0], %[temp0], %[temp4], %[temp5] \n\t"
  308. "lwc1 %[temp4], 0(%[v0]) \n\t"
  309. "madd.s %[temp1], %[temp1], %[temp6], %[temp7] \n\t"
  310. "lwc1 %[temp5], 0(%[s0]) \n\t"
  311. "madd.s %[temp2], %[temp2], %[temp8], %[temp9] \n\t"
  312. "lwc1 %[temp6], 4(%[v0]) \n\t"
  313. "madd.s %[temp3], %[temp3], %[temp10], %[temp11] \n\t"
  314. "lwc1 %[temp7], 4(%[s0]) \n\t"
  315. "madd.s %[temp0], %[temp0], %[temp12], %[temp13] \n\t"
  316. "lwc1 %[temp8], 8(%[v0]) \n\t"
  317. "madd.s %[temp1], %[temp1], %[temp14], %[temp15] \n\t"
  318. "lwc1 %[temp9], 8(%[s0]) \n\t"
  319. "madd.s %[temp2], %[temp2], %[temp16], %[temp17] \n\t"
  320. "lwc1 %[temp10], 12(%[v0]) \n\t"
  321. "madd.s %[temp3], %[temp3], %[temp18], %[temp19] \n\t"
  322. "lwc1 %[temp11], 12(%[s0]) \n\t"
  323. "lwc1 %[temp12], 768(%[v0]) \n\t"
  324. "lwc1 %[temp13], 256(%[s0]) \n\t"
  325. "lwc1 %[temp14], 772(%[v0]) \n\t"
  326. "lwc1 %[temp15], 260(%[s0]) \n\t"
  327. "lwc1 %[temp16], 776(%[v0]) \n\t"
  328. "lwc1 %[temp17], 264(%[s0]) \n\t"
  329. "lwc1 %[temp18], 780(%[v0]) \n\t"
  330. "lwc1 %[temp19], 268(%[s0]) \n\t"
  331. "swc1 %[temp0], -16(%[dst]) \n\t"
  332. "swc1 %[temp1], -12(%[dst]) \n\t"
  333. "swc1 %[temp2], -8(%[dst]) \n\t"
  334. "bne %[v0], %[v0_end], 1b \n\t"
  335. " swc1 %[temp3], -4(%[dst]) \n\t"
  336. "mul.s %[temp0], %[temp4], %[temp5] \n\t"
  337. "lwc1 %[temp4], 1024(%[v0]) \n\t"
  338. "mul.s %[temp1], %[temp6], %[temp7] \n\t"
  339. "lwc1 %[temp5], 512(%[s0]) \n\t"
  340. "mul.s %[temp2], %[temp8], %[temp9] \n\t"
  341. "lwc1 %[temp6], 1028(%[v0]) \n\t"
  342. "mul.s %[temp3], %[temp10], %[temp11] \n\t"
  343. "lwc1 %[temp7], 516(%[s0]) \n\t"
  344. "madd.s %[temp0], %[temp0], %[temp12], %[temp13] \n\t"
  345. "lwc1 %[temp8], 1032(%[v0]) \n\t"
  346. "madd.s %[temp1], %[temp1], %[temp14], %[temp15] \n\t"
  347. "lwc1 %[temp9], 520(%[s0]) \n\t"
  348. "madd.s %[temp2], %[temp2], %[temp16], %[temp17] \n\t"
  349. "lwc1 %[temp10], 1036(%[v0]) \n\t"
  350. "madd.s %[temp3], %[temp3], %[temp18], %[temp19] \n\t"
  351. "lwc1 %[temp11], 524(%[s0]) \n\t"
  352. "lwc1 %[temp12], 1792(%[v0]) \n\t"
  353. "lwc1 %[temp13], 768(%[s0]) \n\t"
  354. "lwc1 %[temp14], 1796(%[v0]) \n\t"
  355. "lwc1 %[temp15], 772(%[s0]) \n\t"
  356. "lwc1 %[temp16], 1800(%[v0]) \n\t"
  357. "lwc1 %[temp17], 776(%[s0]) \n\t"
  358. "lwc1 %[temp18], 1804(%[v0]) \n\t"
  359. "lwc1 %[temp19], 780(%[s0]) \n\t"
  360. "madd.s %[temp0], %[temp0], %[temp4], %[temp5] \n\t"
  361. "lwc1 %[temp4], 2048(%[v0]) \n\t"
  362. "madd.s %[temp1], %[temp1], %[temp6], %[temp7] \n\t"
  363. "lwc1 %[temp5], 1024(%[s0]) \n\t"
  364. "madd.s %[temp2], %[temp2], %[temp8], %[temp9] \n\t"
  365. "lwc1 %[temp6], 2052(%[v0]) \n\t"
  366. "madd.s %[temp3], %[temp3], %[temp10], %[temp11] \n\t"
  367. "lwc1 %[temp7], 1028(%[s0]) \n\t"
  368. "madd.s %[temp0], %[temp0], %[temp12], %[temp13] \n\t"
  369. "lwc1 %[temp8], 2056(%[v0]) \n\t"
  370. "madd.s %[temp1], %[temp1], %[temp14], %[temp15] \n\t"
  371. "lwc1 %[temp9], 1032(%[s0]) \n\t"
  372. "madd.s %[temp2], %[temp2], %[temp16], %[temp17] \n\t"
  373. "lwc1 %[temp10], 2060(%[v0]) \n\t"
  374. "madd.s %[temp3], %[temp3], %[temp18], %[temp19] \n\t"
  375. "lwc1 %[temp11], 1036(%[s0]) \n\t"
  376. "lwc1 %[temp12], 2816(%[v0]) \n\t"
  377. "lwc1 %[temp13], 1280(%[s0]) \n\t"
  378. "lwc1 %[temp14], 2820(%[v0]) \n\t"
  379. "lwc1 %[temp15], 1284(%[s0]) \n\t"
  380. "lwc1 %[temp16], 2824(%[v0]) \n\t"
  381. "lwc1 %[temp17], 1288(%[s0]) \n\t"
  382. "lwc1 %[temp18], 2828(%[v0]) \n\t"
  383. "lwc1 %[temp19], 1292(%[s0]) \n\t"
  384. "madd.s %[temp0], %[temp0], %[temp4], %[temp5] \n\t"
  385. "lwc1 %[temp4], 3072(%[v0]) \n\t"
  386. "madd.s %[temp1], %[temp1], %[temp6], %[temp7] \n\t"
  387. "lwc1 %[temp5], 1536(%[s0]) \n\t"
  388. "madd.s %[temp2], %[temp2], %[temp8], %[temp9] \n\t"
  389. "lwc1 %[temp6], 3076(%[v0]) \n\t"
  390. "madd.s %[temp3], %[temp3], %[temp10], %[temp11] \n\t"
  391. "lwc1 %[temp7], 1540(%[s0]) \n\t"
  392. "madd.s %[temp0], %[temp0], %[temp12], %[temp13] \n\t"
  393. "lwc1 %[temp8], 3080(%[v0]) \n\t"
  394. "madd.s %[temp1], %[temp1], %[temp14], %[temp15] \n\t"
  395. "lwc1 %[temp9], 1544(%[s0]) \n\t"
  396. "madd.s %[temp2], %[temp2], %[temp16], %[temp17] \n\t"
  397. "lwc1 %[temp10], 3084(%[v0]) \n\t"
  398. "madd.s %[temp3], %[temp3], %[temp18], %[temp19] \n\t"
  399. "lwc1 %[temp11], 1548(%[s0]) \n\t"
  400. "lwc1 %[temp12], 3840(%[v0]) \n\t"
  401. "lwc1 %[temp13], 1792(%[s0]) \n\t"
  402. "lwc1 %[temp14], 3844(%[v0]) \n\t"
  403. "lwc1 %[temp15], 1796(%[s0]) \n\t"
  404. "lwc1 %[temp16], 3848(%[v0]) \n\t"
  405. "lwc1 %[temp17], 1800(%[s0]) \n\t"
  406. "lwc1 %[temp18], 3852(%[v0]) \n\t"
  407. "lwc1 %[temp19], 1804(%[s0]) \n\t"
  408. "madd.s %[temp0], %[temp0], %[temp4], %[temp5] \n\t"
  409. "lwc1 %[temp4], 4096(%[v0]) \n\t"
  410. "madd.s %[temp1], %[temp1], %[temp6], %[temp7] \n\t"
  411. "lwc1 %[temp5], 2048(%[s0]) \n\t"
  412. "madd.s %[temp2], %[temp2], %[temp8], %[temp9] \n\t"
  413. "lwc1 %[temp6], 4100(%[v0]) \n\t"
  414. "madd.s %[temp3], %[temp3], %[temp10], %[temp11] \n\t"
  415. "lwc1 %[temp7], 2052(%[s0]) \n\t"
  416. "madd.s %[temp0], %[temp0], %[temp12], %[temp13] \n\t"
  417. "lwc1 %[temp8], 4104(%[v0]) \n\t"
  418. "madd.s %[temp1], %[temp1], %[temp14], %[temp15] \n\t"
  419. "lwc1 %[temp9], 2056(%[s0]) \n\t"
  420. "madd.s %[temp2], %[temp2], %[temp16], %[temp17] \n\t"
  421. "lwc1 %[temp10], 4108(%[v0]) \n\t"
  422. "madd.s %[temp3], %[temp3], %[temp18], %[temp19] \n\t"
  423. "lwc1 %[temp11], 2060(%[s0]) \n\t"
  424. "lwc1 %[temp12], 4864(%[v0]) \n\t"
  425. "lwc1 %[temp13], 2304(%[s0]) \n\t"
  426. "lwc1 %[temp14], 4868(%[v0]) \n\t"
  427. "lwc1 %[temp15], 2308(%[s0]) \n\t"
  428. "madd.s %[temp0], %[temp0], %[temp4], %[temp5] \n\t"
  429. "lwc1 %[temp16], 4872(%[v0]) \n\t"
  430. "madd.s %[temp1], %[temp1], %[temp6], %[temp7] \n\t"
  431. "lwc1 %[temp17], 2312(%[s0]) \n\t"
  432. "madd.s %[temp2], %[temp2], %[temp8], %[temp9] \n\t"
  433. "lwc1 %[temp18], 4876(%[v0]) \n\t"
  434. "madd.s %[temp3], %[temp3], %[temp10], %[temp11] \n\t"
  435. "lwc1 %[temp19], 2316(%[s0]) \n\t"
  436. "madd.s %[temp0], %[temp0], %[temp12], %[temp13] \n\t"
  437. PTR_ADDIU "%[dst], %[dst], 16 \n\t"
  438. "madd.s %[temp1], %[temp1], %[temp14], %[temp15] \n\t"
  439. "madd.s %[temp2], %[temp2], %[temp16], %[temp17] \n\t"
  440. "madd.s %[temp3], %[temp3], %[temp18], %[temp19] \n\t"
  441. "swc1 %[temp0], -16(%[dst]) \n\t"
  442. "swc1 %[temp1], -12(%[dst]) \n\t"
  443. "swc1 %[temp2], -8(%[dst]) \n\t"
  444. "swc1 %[temp3], -4(%[dst]) \n\t"
  445. ".set pop \n\t"
  446. : [dst]"+r"(dst), [v0]"+r"(vv0), [s0]"+r"(s0),
  447. [temp0]"=&f"(temp0), [temp1]"=&f"(temp1), [temp2]"=&f"(temp2),
  448. [temp3]"=&f"(temp3), [temp4]"=&f"(temp4), [temp5]"=&f"(temp5),
  449. [temp6]"=&f"(temp6), [temp7]"=&f"(temp7), [temp8]"=&f"(temp8),
  450. [temp9]"=&f"(temp9), [temp10]"=&f"(temp10), [temp11]"=&f"(temp11),
  451. [temp12]"=&f"(temp12), [temp13]"=&f"(temp13), [temp14]"=&f"(temp14),
  452. [temp15]"=&f"(temp15), [temp16]"=&f"(temp16), [temp17]"=&f"(temp17),
  453. [temp18]"=&f"(temp18), [temp19]"=&f"(temp19)
  454. : [v0_end]"r"(v0_end)
  455. : "memory"
  456. );
  457. }
  458. else
  459. {
  460. fdsp->vector_fmul (out, v , sbr_qmf_window , 64 >> div);
  461. fdsp->vector_fmul_add(out, v + ( 192 >> div), sbr_qmf_window + ( 64 >> div), out , 64 >> div);
  462. fdsp->vector_fmul_add(out, v + ( 256 >> div), sbr_qmf_window + (128 >> div), out , 64 >> div);
  463. fdsp->vector_fmul_add(out, v + ( 448 >> div), sbr_qmf_window + (192 >> div), out , 64 >> div);
  464. fdsp->vector_fmul_add(out, v + ( 512 >> div), sbr_qmf_window + (256 >> div), out , 64 >> div);
  465. fdsp->vector_fmul_add(out, v + ( 704 >> div), sbr_qmf_window + (320 >> div), out , 64 >> div);
  466. fdsp->vector_fmul_add(out, v + ( 768 >> div), sbr_qmf_window + (384 >> div), out , 64 >> div);
  467. fdsp->vector_fmul_add(out, v + ( 960 >> div), sbr_qmf_window + (448 >> div), out , 64 >> div);
  468. fdsp->vector_fmul_add(out, v + (1024 >> div), sbr_qmf_window + (512 >> div), out , 64 >> div);
  469. fdsp->vector_fmul_add(out, v + (1216 >> div), sbr_qmf_window + (576 >> div), out , 64 >> div);
  470. out += 64 >> div;
  471. }
  472. }
  473. }
  474. #define sbr_qmf_analysis sbr_qmf_analysis_mips
  475. #define sbr_qmf_synthesis sbr_qmf_synthesis_mips
  476. #endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
  477. #endif /* HAVE_MIPSFPU */
  478. #endif /* HAVE_INLINE_ASM */
  479. #endif /* AVCODEC_MIPS_AACSBR_MIPS_H */