2 * Copyright (c) 2011 Janne Grunau <janne-libav@jannau.net>
4 * This file is part of Libav.
6 * Libav is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * Libav is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with Libav; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 .macro rv34_inv_transform
24 vld1.16 {q14-q15}, [r0,:128]
26 vshll.s16 q12, d29, #3
27 vshll.s16 q13, d29, #4
30 vmull.s16 q10, d28, d0
31 vmlal.s16 q10, d30, d0
32 vmull.s16 q11, d28, d0
33 vmlsl.s16 q11, d30, d0
34 vsubw.s16 q12, q12, d29 @ z2 = block[i+4*1]*7
35 vaddw.s16 q13, q13, d29 @ z3 = block[i+4*1]*17
38 vadd.s32 q13, q13, q9 @ z3 = 17*block[i+4*1] + 7*block[i+4*3]
39 vsub.s32 q12, q12, q1 @ z2 = 7*block[i+4*1] - 17*block[i+4*3]
40 vadd.s32 q1, q10, q13 @ z0 + z3
41 vadd.s32 q2, q11, q12 @ z1 + z2
42 vsub.s32 q8, q10, q13 @ z0 - z3
43 vsub.s32 q3, q11, q12 @ z1 - z2
53 vmul.s32 q13, q11, d0[0]
59 vmul.s32 q14, q10, d0[0]
61 vsub.s32 q12, q12, q11
63 vadd.s32 q2, q13, q12 @ z1 + z2
64 vadd.s32 q1, q14, q9 @ z0 + z3
65 vsub.s32 q3, q13, q12 @ z1 - z2
66 vsub.s32 q15, q14, q9 @ z0 - z3
69 /* void rv34_inv_transform_noround_neon(DCTELEM *block); */
70 function ff_rv34_inv_transform_noround_neon, export=1
79 vadd.s32 q13, q13, q15
80 vshrn.s32 d0, q10, #11 @ (z0 + z3)*3 >> 11
81 vshrn.s32 d1, q11, #11 @ (z1 + z2)*3 >> 11
82 vshrn.s32 d2, q12, #11 @ (z1 - z2)*3 >> 11
83 vshrn.s32 d3, q13, #11 @ (z0 - z3)*3 >> 11
84 vst4.16 {d0[0], d1[0], d2[0], d3[0]}, [r0,:64]!
85 vst4.16 {d0[1], d1[1], d2[1], d3[1]}, [r0,:64]!
86 vst4.16 {d0[2], d1[2], d2[2], d3[2]}, [r0,:64]!
87 vst4.16 {d0[3], d1[3], d2[3], d3[3]}, [r0,:64]!
92 /* void rv34_inv_transform_dc_noround_c(DCTELEM *block) */
93 function ff_rv34_inv_transform_noround_dc_neon, export=1
94 vld1.16 {d28[]}, [r0,:16] @ block[0]
96 vorr.s16 d4, #256 @ 13^2 * 3
100 vst1.64 {q0}, [r0,:128]!
101 vst1.64 {q0}, [r0,:128]!