OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 The LibYuv Project Authors. All rights reserved. | 2 * Copyright 2011 The LibYuv Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 #define UB -128 /* -min(128, round(2.018 * 64)) */ | 143 #define UB -128 /* -min(128, round(2.018 * 64)) */ |
144 #define UG 25 /* -round(-0.391 * 64) */ | 144 #define UG 25 /* -round(-0.391 * 64) */ |
145 #define VG 52 /* -round(-0.813 * 64) */ | 145 #define VG 52 /* -round(-0.813 * 64) */ |
146 #define VR -102 /* -round(1.596 * 64) */ | 146 #define VR -102 /* -round(1.596 * 64) */ |
147 | 147 |
148 // Bias values to subtract 16 from Y and 128 from U and V. | 148 // Bias values to subtract 16 from Y and 128 from U and V. |
149 #define BB (UB * 128 - YGB) | 149 #define BB (UB * 128 - YGB) |
150 #define BG (UG * 128 + VG * 128 - YGB) | 150 #define BG (UG * 128 + VG * 128 - YGB) |
151 #define BR (VR * 128 - YGB) | 151 #define BR (VR * 128 - YGB) |
152 | 152 |
| 153 YuvConstantsNEON SIMD_ALIGNED(kYuvConstantsNEON) = { |
| 154 { 128, 128, 128, 128, 102, 102, 102, 102, 0, 0, 0, 0, 0, 0, 0, 0 }, |
| 155 { 25, 25, 25, 25, 52, 52, 52, 52, 0, 0, 0, 0, 0, 0, 0, 0 }, |
| 156 { BB, BG, BR, 0, 0, 0, 0, 0 }, |
| 157 { 0x0101 * YG, 0, 0, 0 } |
| 158 }; |
| 159 |
153 static uvec8 kUVToRB = { 128, 128, 128, 128, 102, 102, 102, 102, | 160 static uvec8 kUVToRB = { 128, 128, 128, 128, 102, 102, 102, 102, |
154 0, 0, 0, 0, 0, 0, 0, 0 }; | 161 0, 0, 0, 0, 0, 0, 0, 0 }; |
155 static uvec8 kUVToG = { 25, 25, 25, 25, 52, 52, 52, 52, | 162 static uvec8 kUVToG = { 25, 25, 25, 25, 52, 52, 52, 52, |
156 0, 0, 0, 0, 0, 0, 0, 0 }; | 163 0, 0, 0, 0, 0, 0, 0, 0 }; |
157 static vec16 kUVBiasBGR = { BB, BG, BR, 0, 0, 0, 0, 0 }; | 164 static vec16 kUVBiasBGR = { BB, BG, BR, 0, 0, 0, 0, 0 }; |
158 static vec32 kYToRgb = { 0x0101 * YG, 0, 0, 0 }; | 165 static vec32 kYToRgb = { 0x0101 * YG, 0, 0, 0 }; |
159 | 166 |
160 #undef YG | 167 #undef YG |
161 #undef YGB | 168 #undef YGB |
162 #undef UB | 169 #undef UB |
(...skipping 26 matching lines...) Expand all Loading... |
189 "+r"(width) // %4 | 196 "+r"(width) // %4 |
190 : [kUVToRB]"r"(&kUVToRB), // %5 | 197 : [kUVToRB]"r"(&kUVToRB), // %5 |
191 [kUVToG]"r"(&kUVToG), // %6 | 198 [kUVToG]"r"(&kUVToG), // %6 |
192 [kUVBiasBGR]"r"(&kUVBiasBGR), | 199 [kUVBiasBGR]"r"(&kUVBiasBGR), |
193 [kYToRgb]"r"(&kYToRgb) | 200 [kYToRgb]"r"(&kYToRgb) |
194 : "cc", "memory", "q0", "q1", "q2", "q3", "q4", | 201 : "cc", "memory", "q0", "q1", "q2", "q3", "q4", |
195 "q8", "q9", "q10", "q11", "q12", "q13", "q14", "q15" | 202 "q8", "q9", "q10", "q11", "q12", "q13", "q14", "q15" |
196 ); | 203 ); |
197 } | 204 } |
198 | 205 |
199 void I422ToARGBRow_NEON(const uint8* src_y, | 206 void I422ToARGBMatrixRow_NEON(const uint8* src_y, |
200 const uint8* src_u, | 207 const uint8* src_u, |
201 const uint8* src_v, | 208 const uint8* src_v, |
202 uint8* dst_argb, | 209 uint8* dst_argb, |
203 int width) { | 210 struct YuvConstantsNEON* YuvConstants, |
| 211 int width) { |
204 asm volatile ( | 212 asm volatile ( |
205 YUV422TORGB_SETUP_REG | 213 YUV422TORGB_SETUP_REG |
206 "1: \n" | 214 "1: \n" |
207 READYUV422 | 215 READYUV422 |
208 YUV422TORGB | 216 YUV422TORGB |
209 "subs %4, %4, #8 \n" | 217 "subs %4, %4, #8 \n" |
210 "vmov.u8 d23, #255 \n" | 218 "vmov.u8 d23, #255 \n" |
211 MEMACCESS(3) | 219 MEMACCESS(3) |
212 "vst4.8 {d20, d21, d22, d23}, [%3]! \n" | 220 "vst4.8 {d20, d21, d22, d23}, [%3]! \n" |
213 "bgt 1b \n" | 221 "bgt 1b \n" |
214 : "+r"(src_y), // %0 | 222 : "+r"(src_y), // %0 |
215 "+r"(src_u), // %1 | 223 "+r"(src_u), // %1 |
216 "+r"(src_v), // %2 | 224 "+r"(src_v), // %2 |
217 "+r"(dst_argb), // %3 | 225 "+r"(dst_argb), // %3 |
218 "+r"(width) // %4 | 226 "+r"(width) // %4 |
219 : [kUVToRB]"r"(&kUVToRB), // %5 | 227 : [kUVToRB]"r"(&YuvConstants->kUVToRB), // %5 |
220 [kUVToG]"r"(&kUVToG), // %6 | 228 [kUVToG]"r"(&YuvConstants->kUVToG), // %6 |
221 [kUVBiasBGR]"r"(&kUVBiasBGR), | 229 [kUVBiasBGR]"r"(&YuvConstants->kUVBiasBGR), |
222 [kYToRgb]"r"(&kYToRgb) | 230 [kYToRgb]"r"(&YuvConstants->kYToRgb) |
223 : "cc", "memory", "q0", "q1", "q2", "q3", "q4", | 231 : "cc", "memory", "q0", "q1", "q2", "q3", "q4", |
224 "q8", "q9", "q10", "q11", "q12", "q13", "q14", "q15" | 232 "q8", "q9", "q10", "q11", "q12", "q13", "q14", "q15" |
225 ); | 233 ); |
226 } | 234 } |
227 | 235 |
228 void I411ToARGBRow_NEON(const uint8* src_y, | 236 void I411ToARGBRow_NEON(const uint8* src_y, |
229 const uint8* src_u, | 237 const uint8* src_u, |
230 const uint8* src_v, | 238 const uint8* src_v, |
231 uint8* dst_argb, | 239 uint8* dst_argb, |
232 int width) { | 240 int width) { |
(...skipping 2762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2995 "r"(6) // %5 | 3003 "r"(6) // %5 |
2996 : "cc", "memory", "q0", "q1" // Clobber List | 3004 : "cc", "memory", "q0", "q1" // Clobber List |
2997 ); | 3005 ); |
2998 } | 3006 } |
2999 #endif // defined(__ARM_NEON__) && !defined(__aarch64__) | 3007 #endif // defined(__ARM_NEON__) && !defined(__aarch64__) |
3000 | 3008 |
3001 #ifdef __cplusplus | 3009 #ifdef __cplusplus |
3002 } // extern "C" | 3010 } // extern "C" |
3003 } // namespace libyuv | 3011 } // namespace libyuv |
3004 #endif | 3012 #endif |
OLD | NEW |