| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 The LibYuv Project Authors. All rights reserved. | 2 * Copyright 2012 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 ANY31(I422ToUYVYRow_Any_SSE2, I422ToUYVYRow_SSE2, 1, 1, 4, 15) | 77 ANY31(I422ToUYVYRow_Any_SSE2, I422ToUYVYRow_SSE2, 1, 1, 4, 15) |
| 78 #endif | 78 #endif |
| 79 #ifdef HAS_I422TOYUY2ROW_NEON | 79 #ifdef HAS_I422TOYUY2ROW_NEON |
| 80 ANY31(I422ToYUY2Row_Any_NEON, I422ToYUY2Row_NEON, 1, 1, 4, 15) | 80 ANY31(I422ToYUY2Row_Any_NEON, I422ToYUY2Row_NEON, 1, 1, 4, 15) |
| 81 #endif | 81 #endif |
| 82 #ifdef HAS_I422TOUYVYROW_NEON | 82 #ifdef HAS_I422TOUYVYROW_NEON |
| 83 ANY31(I422ToUYVYRow_Any_NEON, I422ToUYVYRow_NEON, 1, 1, 4, 15) | 83 ANY31(I422ToUYVYRow_Any_NEON, I422ToUYVYRow_NEON, 1, 1, 4, 15) |
| 84 #endif | 84 #endif |
| 85 #undef ANY31 | 85 #undef ANY31 |
| 86 | 86 |
| 87 // Note that odd width replication includes 444 due to implementation |
| 88 // on arm that subsamples 444 to 422 internally. |
| 87 // Any 3 planes to 1 with yuvconstants | 89 // Any 3 planes to 1 with yuvconstants |
| 88 #define ANY31C(NAMEANY, ANY_SIMD, UVSHIFT, DUVSHIFT, BPP, MASK) \ | 90 #define ANY31C(NAMEANY, ANY_SIMD, UVSHIFT, DUVSHIFT, BPP, MASK) \ |
| 89 void NAMEANY(const uint8* y_buf, const uint8* u_buf, const uint8* v_buf, \ | 91 void NAMEANY(const uint8* y_buf, const uint8* u_buf, const uint8* v_buf, \ |
| 90 uint8* dst_ptr, const struct YuvConstants* yuvconstants, \ | 92 uint8* dst_ptr, const struct YuvConstants* yuvconstants, \ |
| 91 int width) { \ | 93 int width) { \ |
| 92 SIMD_ALIGNED(uint8 temp[64 * 4]); \ | 94 SIMD_ALIGNED(uint8 temp[64 * 4]); \ |
| 93 memset(temp, 0, 64 * 3); /* for YUY2 and msan */ \ | 95 memset(temp, 0, 64 * 3); /* for YUY2 and msan */ \ |
| 94 int r = width & MASK; \ | 96 int r = width & MASK; \ |
| 95 int n = width & ~MASK; \ | 97 int n = width & ~MASK; \ |
| 96 if (n > 0) { \ | 98 if (n > 0) { \ |
| 97 ANY_SIMD(y_buf, u_buf, v_buf, dst_ptr, yuvconstants, n); \ | 99 ANY_SIMD(y_buf, u_buf, v_buf, dst_ptr, yuvconstants, n); \ |
| 98 } \ | 100 } \ |
| 99 memcpy(temp, y_buf + n, r); \ | 101 memcpy(temp, y_buf + n, r); \ |
| 100 memcpy(temp + 64, u_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \ | 102 memcpy(temp + 64, u_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \ |
| 101 memcpy(temp + 128, v_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \ | 103 memcpy(temp + 128, v_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \ |
| 104 if (width & 1) { \ |
| 105 temp[64 + SS(r, UVSHIFT)] = temp[64 + SS(r, UVSHIFT) - 1]; \ |
| 106 temp[128 + SS(r, UVSHIFT)] = temp[128 + SS(r, UVSHIFT) - 1]; \ |
| 107 } \ |
| 102 ANY_SIMD(temp, temp + 64, temp + 128, temp + 192, \ | 108 ANY_SIMD(temp, temp + 64, temp + 128, temp + 192, \ |
| 103 yuvconstants, MASK + 1); \ | 109 yuvconstants, MASK + 1); \ |
| 104 memcpy(dst_ptr + (n >> DUVSHIFT) * BPP, temp + 192, \ | 110 memcpy(dst_ptr + (n >> DUVSHIFT) * BPP, temp + 192, \ |
| 105 SS(r, DUVSHIFT) * BPP); \ | 111 SS(r, DUVSHIFT) * BPP); \ |
| 106 } | 112 } |
| 107 | 113 |
| 108 #ifdef HAS_I422TOARGBROW_SSSE3 | 114 #ifdef HAS_I422TOARGBROW_SSSE3 |
| 109 ANY31C(I422ToARGBRow_Any_SSSE3, I422ToARGBRow_SSSE3, 1, 0, 4, 7) | 115 ANY31C(I422ToARGBRow_Any_SSSE3, I422ToARGBRow_SSSE3, 1, 0, 4, 7) |
| 110 ANY31C(I422ToABGRRow_Any_SSSE3, I422ToABGRRow_SSSE3, 1, 0, 4, 7) | 116 ANY31C(I422ToABGRRow_Any_SSSE3, I422ToABGRRow_SSSE3, 1, 0, 4, 7) |
| 111 #endif | 117 #endif |
| (...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 811 #endif | 817 #endif |
| 812 #ifdef HAS_UYVYTOUVROW_NEON | 818 #ifdef HAS_UYVYTOUVROW_NEON |
| 813 ANY12S(UYVYToUVRow_Any_NEON, UYVYToUVRow_NEON, 1, 4, 15) | 819 ANY12S(UYVYToUVRow_Any_NEON, UYVYToUVRow_NEON, 1, 4, 15) |
| 814 #endif | 820 #endif |
| 815 #undef ANY12S | 821 #undef ANY12S |
| 816 | 822 |
| 817 #ifdef __cplusplus | 823 #ifdef __cplusplus |
| 818 } // extern "C" | 824 } // extern "C" |
| 819 } // namespace libyuv | 825 } // namespace libyuv |
| 820 #endif | 826 #endif |
| OLD | NEW |