| 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 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 670 | 670 |
| 671 // Blend Y plane. | 671 // Blend Y plane. |
| 672 BlendPlane(src_y0, src_stride_y0, | 672 BlendPlane(src_y0, src_stride_y0, |
| 673 src_y1, src_stride_y1, | 673 src_y1, src_stride_y1, |
| 674 alpha, alpha_stride, | 674 alpha, alpha_stride, |
| 675 dst_y, dst_stride_y, | 675 dst_y, dst_stride_y, |
| 676 width, height); | 676 width, height); |
| 677 | 677 |
| 678 #if defined(HAS_BLENDPLANEROW_SSSE3) | 678 #if defined(HAS_BLENDPLANEROW_SSSE3) |
| 679 if (TestCpuFlag(kCpuHasSSSE3)) { | 679 if (TestCpuFlag(kCpuHasSSSE3)) { |
| 680 BlendPlaneRow = BlendPlaneRow_Any_SSSE3; | 680 BlendPlaneRow = BlendPlaneRow_Any_SSSE3; |
| 681 if (IS_ALIGNED(halfwidth, 8)) { | 681 if (IS_ALIGNED(halfwidth, 8)) { |
| 682 BlendPlaneRow = BlendPlaneRow_SSSE3; | 682 BlendPlaneRow = BlendPlaneRow_SSSE3; |
| 683 } | 683 } |
| 684 } | 684 } |
| 685 #endif | 685 #endif |
| 686 #if defined(HAS_BLENDPLANEROW_AVX2) | 686 #if defined(HAS_BLENDPLANEROW_AVX2) |
| 687 if (TestCpuFlag(kCpuHasAVX2)) { | 687 if (TestCpuFlag(kCpuHasAVX2)) { |
| 688 BlendPlaneRow = BlendPlaneRow_Any_AVX2; | 688 BlendPlaneRow = BlendPlaneRow_Any_AVX2; |
| 689 if (IS_ALIGNED(halfwidth, 32)) { | 689 if (IS_ALIGNED(halfwidth, 32)) { |
| 690 BlendPlaneRow = BlendPlaneRow_AVX2; | 690 BlendPlaneRow = BlendPlaneRow_AVX2; |
| 691 } | 691 } |
| 692 } | 692 } |
| 693 #endif | 693 #endif |
| 694 if (!IS_ALIGNED(width, 2)) { |
| 695 ScaleRowDown2 = ScaleRowDown2Box_Odd_C; |
| 696 } |
| 694 #if defined(HAS_SCALEROWDOWN2_NEON) | 697 #if defined(HAS_SCALEROWDOWN2_NEON) |
| 695 if (TestCpuFlag(kCpuHasNEON)) { | 698 if (TestCpuFlag(kCpuHasNEON)) { |
| 696 ScaleRowDown2 = ScaleRowDown2Box_Any_NEON; | 699 ScaleRowDown2 = ScaleRowDown2Box_Odd_NEON; |
| 697 if (IS_ALIGNED(halfwidth, 16)) { | 700 if (IS_ALIGNED(width, 2)) { |
| 698 ScaleRowDown2 = ScaleRowDown2Box_NEON; | 701 ScaleRowDown2 = ScaleRowDown2Box_Any_NEON; |
| 702 if (IS_ALIGNED(halfwidth, 16)) { |
| 703 ScaleRowDown2 = ScaleRowDown2Box_NEON; |
| 704 } |
| 699 } | 705 } |
| 700 } | 706 } |
| 701 #endif | 707 #endif |
| 702 #if defined(HAS_SCALEROWDOWN2_SSSE3) | 708 #if defined(HAS_SCALEROWDOWN2_SSSE3) |
| 703 if (TestCpuFlag(kCpuHasSSSE3)) { | 709 if (TestCpuFlag(kCpuHasSSSE3)) { |
| 704 ScaleRowDown2 = ScaleRowDown2Box_Any_SSSE3; | 710 ScaleRowDown2 = ScaleRowDown2Box_Odd_SSSE3; |
| 705 if (IS_ALIGNED(halfwidth, 16)) { | 711 if (IS_ALIGNED(width, 2)) { |
| 706 ScaleRowDown2 = ScaleRowDown2Box_SSSE3; | 712 ScaleRowDown2 = ScaleRowDown2Box_Any_SSSE3; |
| 713 if (IS_ALIGNED(halfwidth, 16)) { |
| 714 ScaleRowDown2 = ScaleRowDown2Box_SSSE3; |
| 715 } |
| 707 } | 716 } |
| 708 } | 717 } |
| 709 #endif | 718 #endif |
| 710 #if defined(HAS_SCALEROWDOWN2_AVX2) | 719 #if defined(HAS_SCALEROWDOWN2_AVX2) |
| 711 if (TestCpuFlag(kCpuHasAVX2)) { | 720 if (TestCpuFlag(kCpuHasAVX2)) { |
| 712 ScaleRowDown2 = ScaleRowDown2Box_Any_AVX2; | 721 ScaleRowDown2 = ScaleRowDown2Box_Odd_AVX2; |
| 713 if (IS_ALIGNED(halfwidth, 32)) { | 722 if (IS_ALIGNED(width, 2)) { |
| 714 ScaleRowDown2 = ScaleRowDown2Box_AVX2; | 723 ScaleRowDown2 = ScaleRowDown2Box_Any_AVX2; |
| 724 if (IS_ALIGNED(halfwidth, 32)) { |
| 725 ScaleRowDown2 = ScaleRowDown2Box_AVX2; |
| 726 } |
| 715 } | 727 } |
| 716 } | 728 } |
| 717 #endif | 729 #endif |
| 718 | 730 |
| 719 // Row buffer for intermediate alpha pixels. | 731 // Row buffer for intermediate alpha pixels. |
| 720 align_buffer_64(halfalpha, halfwidth); | 732 align_buffer_64(halfalpha, halfwidth); |
| 721 for (y = 0; y < height; y += 2) { | 733 for (y = 0; y < height; y += 2) { |
| 722 // last row of odd height image use 1 row of alpha instead of 2. | 734 // last row of odd height image use 1 row of alpha instead of 2. |
| 723 if (y == (height - 1)) { | 735 if (y == (height - 1)) { |
| 724 alpha_stride = 0; | 736 alpha_stride = 0; |
| (...skipping 1876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2601 } | 2613 } |
| 2602 free_aligned_buffer_64(rows); | 2614 free_aligned_buffer_64(rows); |
| 2603 } | 2615 } |
| 2604 return 0; | 2616 return 0; |
| 2605 } | 2617 } |
| 2606 | 2618 |
| 2607 #ifdef __cplusplus | 2619 #ifdef __cplusplus |
| 2608 } // extern "C" | 2620 } // extern "C" |
| 2609 } // namespace libyuv | 2621 } // namespace libyuv |
| 2610 #endif | 2622 #endif |
| OLD | NEW |