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 2684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2695 src_stride = dst_stride = 0; | 2695 src_stride = dst_stride = 0; |
2696 } | 2696 } |
2697 void (*ARGBExtractAlphaRow)(const uint8 *src_argb, uint8 *dst_a, int width) = | 2697 void (*ARGBExtractAlphaRow)(const uint8 *src_argb, uint8 *dst_a, int width) = |
2698 ARGBExtractAlphaRow_C; | 2698 ARGBExtractAlphaRow_C; |
2699 #if defined(HAS_ARGBEXTRACTALPHAROW_SSE2) | 2699 #if defined(HAS_ARGBEXTRACTALPHAROW_SSE2) |
2700 if (TestCpuFlag(kCpuHasSSE2)) { | 2700 if (TestCpuFlag(kCpuHasSSE2)) { |
2701 ARGBExtractAlphaRow = IS_ALIGNED(width, 8) ? ARGBExtractAlphaRow_SSE2 | 2701 ARGBExtractAlphaRow = IS_ALIGNED(width, 8) ? ARGBExtractAlphaRow_SSE2 |
2702 : ARGBExtractAlphaRow_Any_SSE2; | 2702 : ARGBExtractAlphaRow_Any_SSE2; |
2703 } | 2703 } |
2704 #endif | 2704 #endif |
| 2705 #if defined(HAS_ARGBEXTRACTALPHAROW_AVX2) |
| 2706 if (TestCpuFlag(kCpuHasAVX2)) { |
| 2707 ARGBExtractAlphaRow = IS_ALIGNED(width, 32) ? ARGBExtractAlphaRow_AVX2 |
| 2708 : ARGBExtractAlphaRow_Any_AVX2; |
| 2709 } |
| 2710 #endif |
2705 #if defined(HAS_ARGBEXTRACTALPHAROW_NEON) | 2711 #if defined(HAS_ARGBEXTRACTALPHAROW_NEON) |
2706 if (TestCpuFlag(kCpuHasNEON)) { | 2712 if (TestCpuFlag(kCpuHasNEON)) { |
2707 ARGBExtractAlphaRow = IS_ALIGNED(width, 16) ? ARGBExtractAlphaRow_NEON | 2713 ARGBExtractAlphaRow = IS_ALIGNED(width, 16) ? ARGBExtractAlphaRow_NEON |
2708 : ARGBExtractAlphaRow_Any_NEON; | 2714 : ARGBExtractAlphaRow_Any_NEON; |
2709 } | 2715 } |
2710 #endif | 2716 #endif |
2711 | 2717 |
2712 for (int y = 0; y < height; ++y) { | 2718 for (int y = 0; y < height; ++y) { |
2713 ARGBExtractAlphaRow(src_argb, dst_a, width); | 2719 ARGBExtractAlphaRow(src_argb, dst_a, width); |
2714 src_argb += src_stride; | 2720 src_argb += src_stride; |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2963 } | 2969 } |
2964 free_aligned_buffer_64(rows); | 2970 free_aligned_buffer_64(rows); |
2965 } | 2971 } |
2966 return 0; | 2972 return 0; |
2967 } | 2973 } |
2968 | 2974 |
2969 #ifdef __cplusplus | 2975 #ifdef __cplusplus |
2970 } // extern "C" | 2976 } // extern "C" |
2971 } // namespace libyuv | 2977 } // namespace libyuv |
2972 #endif | 2978 #endif |
OLD | NEW |