| 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 970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 981 #define UB -128 /* max(-128, round(-2.018 * 64)) */ | 981 #define UB -128 /* max(-128, round(-2.018 * 64)) */ |
| 982 #define UG 25 /* round(0.391 * 64) */ | 982 #define UG 25 /* round(0.391 * 64) */ |
| 983 #define VG 52 /* round(0.813 * 64) */ | 983 #define VG 52 /* round(0.813 * 64) */ |
| 984 #define VR -102 /* round(-1.596 * 64) */ | 984 #define VR -102 /* round(-1.596 * 64) */ |
| 985 | 985 |
| 986 // Bias values to subtract 16 from Y and 128 from U and V. | 986 // Bias values to subtract 16 from Y and 128 from U and V. |
| 987 #define BB (UB * 128 + YGB) | 987 #define BB (UB * 128 + YGB) |
| 988 #define BG (UG * 128 + VG * 128 + YGB) | 988 #define BG (UG * 128 + VG * 128 + YGB) |
| 989 #define BR (VR * 128 + YGB) | 989 #define BR (VR * 128 + YGB) |
| 990 | 990 |
| 991 #if defined(__aarch64__) | 991 #if defined(__aarch64__) // 64 bit arm |
| 992 const YuvConstants SIMD_ALIGNED(kYuvI601Constants) = { | 992 const YuvConstants SIMD_ALIGNED(kYuvI601Constants) = { |
| 993 { -UB, -VR, -UB, -VR, -UB, -VR, -UB, -VR }, | 993 { -UB, -VR, -UB, -VR, -UB, -VR, -UB, -VR }, |
| 994 { -UB, -VR, -UB, -VR, -UB, -VR, -UB, -VR }, | 994 { -UB, -VR, -UB, -VR, -UB, -VR, -UB, -VR }, |
| 995 { UG, VG, UG, VG, UG, VG, UG, VG }, | 995 { UG, VG, UG, VG, UG, VG, UG, VG }, |
| 996 { UG, VG, UG, VG, UG, VG, UG, VG }, | 996 { UG, VG, UG, VG, UG, VG, UG, VG }, |
| 997 { BB, BG, BR, 0, 0, 0, 0, 0 }, | 997 { BB, BG, BR, 0, 0, 0, 0, 0 }, |
| 998 { 0x0101 * YG, 0, 0, 0 } | 998 { 0x0101 * YG, 0, 0, 0 } |
| 999 }; | 999 }; |
| 1000 const YuvConstants SIMD_ALIGNED(kYvuI601Constants) = { | 1000 const YuvConstants SIMD_ALIGNED(kYvuI601Constants) = { |
| 1001 { -VR, -UB, -VR, -UB, -VR, -UB, -VR, -UB }, | 1001 { -VR, -UB, -VR, -UB, -VR, -UB, -VR, -UB }, |
| 1002 { -VR, -UB, -VR, -UB, -VR, -UB, -VR, -UB }, | 1002 { -VR, -UB, -VR, -UB, -VR, -UB, -VR, -UB }, |
| 1003 { VG, UG, VG, UG, VG, UG, VG, UG }, | 1003 { VG, UG, VG, UG, VG, UG, VG, UG }, |
| 1004 { VG, UG, VG, UG, VG, UG, VG, UG }, | 1004 { VG, UG, VG, UG, VG, UG, VG, UG }, |
| 1005 { BR, BG, BB, 0, 0, 0, 0, 0 }, | 1005 { BR, BG, BB, 0, 0, 0, 0, 0 }, |
| 1006 { 0x0101 * YG, 0, 0, 0 } | 1006 { 0x0101 * YG, 0, 0, 0 } |
| 1007 }; | 1007 }; |
| 1008 #elif defined(__arm__) | 1008 #elif defined(__arm__) // 32 bit arm |
| 1009 const YuvConstants SIMD_ALIGNED(kYuvI601Constants) = { | 1009 const YuvConstants SIMD_ALIGNED(kYuvI601Constants) = { |
| 1010 { -UB, -UB, -UB, -UB, -VR, -VR, -VR, -VR, 0, 0, 0, 0, 0, 0, 0, 0 }, | 1010 { -UB, -UB, -UB, -UB, -VR, -VR, -VR, -VR, 0, 0, 0, 0, 0, 0, 0, 0 }, |
| 1011 { UG, UG, UG, UG, VG, VG, VG, VG, 0, 0, 0, 0, 0, 0, 0, 0 }, | 1011 { UG, UG, UG, UG, VG, VG, VG, VG, 0, 0, 0, 0, 0, 0, 0, 0 }, |
| 1012 { BB, BG, BR, 0, 0, 0, 0, 0 }, | 1012 { BB, BG, BR, 0, 0, 0, 0, 0 }, |
| 1013 { 0x0101 * YG, 0, 0, 0 } | 1013 { 0x0101 * YG, 0, 0, 0 } |
| 1014 }; | 1014 }; |
| 1015 const YuvConstants SIMD_ALIGNED(kYvuI601Constants) = { | 1015 const YuvConstants SIMD_ALIGNED(kYvuI601Constants) = { |
| 1016 { -VR, -VR, -VR, -VR, -UB, -UB, -UB, -UB, 0, 0, 0, 0, 0, 0, 0, 0 }, | 1016 { -VR, -VR, -VR, -VR, -UB, -UB, -UB, -UB, 0, 0, 0, 0, 0, 0, 0, 0 }, |
| 1017 { VG, VG, VG, VG, UG, UG, UG, UG, 0, 0, 0, 0, 0, 0, 0, 0 }, | 1017 { VG, VG, VG, VG, UG, UG, UG, UG, 0, 0, 0, 0, 0, 0, 0, 0 }, |
| 1018 { BR, BG, BB, 0, 0, 0, 0, 0 }, | 1018 { BR, BG, BB, 0, 0, 0, 0, 0 }, |
| (...skipping 1599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2618 dst_rgb565 += twidth * 2; | 2618 dst_rgb565 += twidth * 2; |
| 2619 width -= twidth; | 2619 width -= twidth; |
| 2620 } | 2620 } |
| 2621 } | 2621 } |
| 2622 #endif | 2622 #endif |
| 2623 | 2623 |
| 2624 #ifdef __cplusplus | 2624 #ifdef __cplusplus |
| 2625 } // extern "C" | 2625 } // extern "C" |
| 2626 } // namespace libyuv | 2626 } // namespace libyuv |
| 2627 #endif | 2627 #endif |
| OLD | NEW |