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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 "vqadd.s16 q8, q0, q13 \n" /* B */ \ | 127 "vqadd.s16 q8, q0, q13 \n" /* B */ \ |
128 "vqadd.s16 q9, q0, q14 \n" /* R */ \ | 128 "vqadd.s16 q9, q0, q14 \n" /* R */ \ |
129 "vqadd.s16 q0, q0, q4 \n" /* G */ \ | 129 "vqadd.s16 q0, q0, q4 \n" /* G */ \ |
130 "vqadd.s16 q8, q8, q1 \n" /* B */ \ | 130 "vqadd.s16 q8, q8, q1 \n" /* B */ \ |
131 "vqadd.s16 q9, q9, q10 \n" /* R */ \ | 131 "vqadd.s16 q9, q9, q10 \n" /* R */ \ |
132 "vqsub.s16 q0, q0, q3 \n" /* G */ \ | 132 "vqsub.s16 q0, q0, q3 \n" /* G */ \ |
133 "vqshrun.s16 d20, q8, #6 \n" /* B */ \ | 133 "vqshrun.s16 d20, q8, #6 \n" /* B */ \ |
134 "vqshrun.s16 d22, q9, #6 \n" /* R */ \ | 134 "vqshrun.s16 d22, q9, #6 \n" /* R */ \ |
135 "vqshrun.s16 d21, q0, #6 \n" /* G */ | 135 "vqshrun.s16 d21, q0, #6 \n" /* G */ |
136 | 136 |
137 | |
138 // BT.601 YUV to RGB reference | 137 // BT.601 YUV to RGB reference |
139 // R = (Y - 16) * 1.164 - V * -1.596 | 138 // R = (Y - 16) * 1.164 - V * -1.596 |
140 // G = (Y - 16) * 1.164 - U * 0.391 - V * 0.813 | 139 // G = (Y - 16) * 1.164 - U * 0.391 - V * 0.813 |
141 // B = (Y - 16) * 1.164 - U * -2.018 | 140 // B = (Y - 16) * 1.164 - U * -2.018 |
142 | 141 |
143 // Y contribution to R,G,B. Scale and bias. | 142 // Y contribution to R,G,B. Scale and bias. |
144 // TODO(fbarchard): Consider moving constants into a common header. | 143 // TODO(fbarchard): Consider moving constants into a common header. |
145 #define YG 18997 /* round(1.164 * 64 * 256 * 256 / 257) */ | 144 #define YG 18997 /* round(1.164 * 64 * 256 * 256 / 257) */ |
146 #define YGB -1160 /* 1.164 * 64 * -16 + 64 / 2 */ | 145 #define YGB -1160 /* 1.164 * 64 * -16 + 64 / 2 */ |
147 | 146 |
(...skipping 2854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3002 "r"(6) // %5 | 3001 "r"(6) // %5 |
3003 : "cc", "memory", "q0", "q1" // Clobber List | 3002 : "cc", "memory", "q0", "q1" // Clobber List |
3004 ); | 3003 ); |
3005 } | 3004 } |
3006 #endif // defined(__ARM_NEON__) && !defined(__aarch64__) | 3005 #endif // defined(__ARM_NEON__) && !defined(__aarch64__) |
3007 | 3006 |
3008 #ifdef __cplusplus | 3007 #ifdef __cplusplus |
3009 } // extern "C" | 3008 } // extern "C" |
3010 } // namespace libyuv | 3009 } // namespace libyuv |
3011 #endif | 3010 #endif |
OLD | NEW |