annotate arm/aac.h @ 10928:03d778b06643 libavcodec

Fix accumulated indention errors.
author michael
date Mon, 18 Jan 2010 23:34:37 +0000
parents a69d6f292f95
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10881
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
1 /*
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
2 * Copyright (c) 2010 Mans Rullgard <mans@mansr.com>
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
3 *
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
4 * This file is part of FFmpeg.
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
5 *
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
6 * FFmpeg is free software; you can redistribute it and/or
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
7 * modify it under the terms of the GNU Lesser General Public
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
8 * License as published by the Free Software Foundation; either
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
9 * version 2.1 of the License, or (at your option) any later version.
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
10 *
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
11 * FFmpeg is distributed in the hope that it will be useful,
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
14 * Lesser General Public License for more details.
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
15 *
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
16 * You should have received a copy of the GNU Lesser General Public
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
17 * License along with FFmpeg; if not, write to the Free Software
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
19 */
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
20
10900
a69d6f292f95 Add missing guards and includes to arm/aac.h
mru
parents: 10881
diff changeset
21 #ifndef AVCODEC_ARM_AAC_H
a69d6f292f95 Add missing guards and includes to arm/aac.h
mru
parents: 10881
diff changeset
22 #define AVCODEC_ARM_AAC_H
a69d6f292f95 Add missing guards and includes to arm/aac.h
mru
parents: 10881
diff changeset
23
a69d6f292f95 Add missing guards and includes to arm/aac.h
mru
parents: 10881
diff changeset
24 #include "config.h"
a69d6f292f95 Add missing guards and includes to arm/aac.h
mru
parents: 10881
diff changeset
25
10881
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
26 #if HAVE_NEON && HAVE_INLINE_ASM
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
27
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
28 #define VMUL2 VMUL2
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
29 static inline float *VMUL2(float *dst, const float *v, unsigned idx,
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
30 const float *scale)
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
31 {
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
32 unsigned v0, v1;
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
33 __asm__ volatile ("ubfx %0, %4, #0, #4 \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
34 "ubfx %1, %4, #4, #4 \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
35 "ldr %0, [%3, %0, lsl #2] \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
36 "ldr %1, [%3, %1, lsl #2] \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
37 "vld1.32 {d1[]}, [%5,:32] \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
38 "vmov d0, %0, %1 \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
39 "vmul.f32 d0, d0, d1 \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
40 "vst1.32 {d0}, [%2,:64]! \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
41 : "=&r"(v0), "=&r"(v1), "+r"(dst)
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
42 : "r"(v), "r"(idx), "r"(scale)
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
43 : "d0", "d1");
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
44 return dst;
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
45 }
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
46
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
47 #define VMUL4 VMUL4
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
48 static inline float *VMUL4(float *dst, const float *v, unsigned idx,
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
49 const float *scale)
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
50 {
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
51 unsigned v0, v1, v2, v3;
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
52 __asm__ volatile ("ubfx %0, %6, #0, #2 \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
53 "ubfx %1, %6, #2, #2 \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
54 "ldr %0, [%5, %0, lsl #2] \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
55 "ubfx %2, %6, #4, #2 \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
56 "ldr %1, [%5, %1, lsl #2] \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
57 "ubfx %3, %6, #6, #2 \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
58 "ldr %2, [%5, %2, lsl #2] \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
59 "vmov d0, %0, %1 \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
60 "ldr %3, [%5, %3, lsl #2] \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
61 "vld1.32 {d2[],d3[]},[%7,:32] \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
62 "vmov d1, %2, %3 \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
63 "vmul.f32 q0, q0, q1 \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
64 "vst1.32 {q0}, [%4,:128]! \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
65 : "=&r"(v0), "=&r"(v1), "=&r"(v2), "=&r"(v3), "+r"(dst)
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
66 : "r"(v), "r"(idx), "r"(scale)
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
67 : "d0", "d1", "d2", "d3");
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
68 return dst;
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
69 }
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
70
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
71 #define VMUL2S VMUL2S
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
72 static inline float *VMUL2S(float *dst, const float *v, unsigned idx,
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
73 unsigned sign, const float *scale)
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
74 {
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
75 unsigned v0, v1, v2, v3;
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
76 __asm__ volatile ("ubfx %0, %6, #0, #4 \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
77 "ubfx %1, %6, #4, #4 \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
78 "ldr %0, [%5, %0, lsl #2] \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
79 "lsl %2, %8, #30 \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
80 "ldr %1, [%5, %1, lsl #2] \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
81 "lsl %3, %8, #31 \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
82 "vmov d0, %0, %1 \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
83 "bic %2, %2, #1<<30 \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
84 "vld1.32 {d1[]}, [%7,:32] \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
85 "vmov d2, %2, %3 \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
86 "veor d0, d0, d2 \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
87 "vmul.f32 d0, d0, d1 \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
88 "vst1.32 {d0}, [%4,:64]! \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
89 : "=&r"(v0), "=&r"(v1), "=&r"(v2), "=&r"(v3), "+r"(dst)
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
90 : "r"(v), "r"(idx), "r"(scale), "r"(sign)
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
91 : "d0", "d1", "d2");
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
92 return dst;
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
93 }
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
94
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
95 #define VMUL4S VMUL4S
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
96 static inline float *VMUL4S(float *dst, const float *v, unsigned idx,
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
97 unsigned sign, const float *scale)
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
98 {
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
99 unsigned v0, v1, v2, v3, nz;
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
100 __asm__ volatile ("vld1.32 {d2[],d3[]},[%9,:32] \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
101 "ubfx %0, %8, #0, #2 \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
102 "ubfx %1, %8, #2, #2 \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
103 "ldr %0, [%7, %0, lsl #2] \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
104 "ubfx %2, %8, #4, #2 \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
105 "ldr %1, [%7, %1, lsl #2] \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
106 "ubfx %3, %8, #6, #2 \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
107 "ldr %2, [%7, %2, lsl #2] \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
108 "vmov d0, %0, %1 \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
109 "ldr %3, [%7, %3, lsl #2] \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
110 "lsr %6, %8, #12 \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
111 "rbit %6, %6 \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
112 "vmov d1, %2, %3 \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
113 "lsls %6, %6, #1 \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
114 "and %0, %5, #1<<31 \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
115 "lslcs %5, %5, #1 \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
116 "lsls %6, %6, #1 \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
117 "and %1, %5, #1<<31 \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
118 "lslcs %5, %5, #1 \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
119 "lsls %6, %6, #1 \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
120 "and %2, %5, #1<<31 \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
121 "lslcs %5, %5, #1 \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
122 "vmov d4, %0, %1 \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
123 "and %3, %5, #1<<31 \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
124 "vmov d5, %2, %3 \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
125 "veor q0, q0, q2 \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
126 "vmul.f32 q0, q0, q1 \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
127 "vst1.32 {q0}, [%4,:128]! \n\t"
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
128 : "=&r"(v0), "=&r"(v1), "=&r"(v2), "=&r"(v3), "+r"(dst),
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
129 "+r"(sign), "=r"(nz)
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
130 : "r"(v), "r"(idx), "r"(scale)
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
131 : "d0", "d1", "d2", "d3", "d4", "d5");
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
132 return dst;
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
133 }
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
134
798c62217427 AAC: ARM/NEON asm for VMUL2/4 functions
mru
parents:
diff changeset
135 #endif /* HAVE_NEON && HAVE_INLINE_ASM */
10900
a69d6f292f95 Add missing guards and includes to arm/aac.h
mru
parents: 10881
diff changeset
136
a69d6f292f95 Add missing guards and includes to arm/aac.h
mru
parents: 10881
diff changeset
137 #endif /* AVCODEC_ARM_AAC_H */