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 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
603 src_stride_y1 == width && | 603 src_stride_y1 == width && |
604 alpha_stride == width && | 604 alpha_stride == width && |
605 dst_stride_y == width) { | 605 dst_stride_y == width) { |
606 width *= height; | 606 width *= height; |
607 height = 1; | 607 height = 1; |
608 src_stride_y0 = src_stride_y1 = alpha_stride = dst_stride_y = 0; | 608 src_stride_y0 = src_stride_y1 = alpha_stride = dst_stride_y = 0; |
609 } | 609 } |
610 | 610 |
611 #if defined(HAS_BLENDPLANEROW_SSSE3) | 611 #if defined(HAS_BLENDPLANEROW_SSSE3) |
612 if (TestCpuFlag(kCpuHasSSSE3)) { | 612 if (TestCpuFlag(kCpuHasSSSE3)) { |
613 // TODO(fbarchard): Implement any versions for odd width. | 613 BlendPlaneRow = BlendPlaneRow_Any_SSSE3; |
614 // BlendPlaneRow = BlendPlaneRow_Any_SSSE3; | |
615 if (IS_ALIGNED(width, 8)) { | 614 if (IS_ALIGNED(width, 8)) { |
616 BlendPlaneRow = BlendPlaneRow_SSSE3; | 615 BlendPlaneRow = BlendPlaneRow_SSSE3; |
617 } | 616 } |
618 } | 617 } |
619 #endif | 618 #endif |
620 #if defined(HAS_BLENDPLANEROW_AVX2) | 619 #if defined(HAS_BLENDPLANEROW_AVX2) |
621 if (TestCpuFlag(kCpuHasAVX2)) { | 620 if (TestCpuFlag(kCpuHasAVX2)) { |
622 // BlendPlaneRow = BlendPlaneRow_Any_AVX2; | 621 BlendPlaneRow = BlendPlaneRow_Any_AVX2; |
623 if (IS_ALIGNED(width, 16)) { | 622 if (IS_ALIGNED(width, 32)) { |
624 BlendPlaneRow = BlendPlaneRow_AVX2; | 623 BlendPlaneRow = BlendPlaneRow_AVX2; |
625 } | 624 } |
626 } | 625 } |
627 #endif | 626 #endif |
628 | 627 |
629 for (y = 0; y < height; ++y) { | 628 for (y = 0; y < height; ++y) { |
630 BlendPlaneRow(src_y0, src_y1, alpha, dst_y, width); | 629 BlendPlaneRow(src_y0, src_y1, alpha, dst_y, width); |
631 src_y0 += src_stride_y0; | 630 src_y0 += src_stride_y0; |
632 src_y1 += src_stride_y1; | 631 src_y1 += src_stride_y1; |
633 alpha += alpha_stride; | 632 alpha += alpha_stride; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
671 | 670 |
672 // Blend Y plane. | 671 // Blend Y plane. |
673 BlendPlane(src_y0, src_stride_y0, | 672 BlendPlane(src_y0, src_stride_y0, |
674 src_y1, src_stride_y1, | 673 src_y1, src_stride_y1, |
675 alpha, alpha_stride, | 674 alpha, alpha_stride, |
676 dst_y, dst_stride_y, | 675 dst_y, dst_stride_y, |
677 width, height); | 676 width, height); |
678 | 677 |
679 #if defined(HAS_BLENDPLANEROW_SSSE3) | 678 #if defined(HAS_BLENDPLANEROW_SSSE3) |
680 if (TestCpuFlag(kCpuHasSSSE3)) { | 679 if (TestCpuFlag(kCpuHasSSSE3)) { |
681 // TODO(fbarchard): Implement any versions for odd width. | 680 BlendPlaneRow = BlendPlaneRow_Any_SSSE3; |
682 // BlendPlaneRow = BlendPlaneRow_Any_SSSE3; | 681 if (IS_ALIGNED(width, 8)) { |
683 if (IS_ALIGNED(halfwidth, 8)) { | |
684 BlendPlaneRow = BlendPlaneRow_SSSE3; | 682 BlendPlaneRow = BlendPlaneRow_SSSE3; |
685 } | 683 } |
686 } | 684 } |
687 #endif | 685 #endif |
688 #if defined(HAS_BLENDPLANEROW_AVX2) | 686 #if defined(HAS_BLENDPLANEROW_AVX2) |
689 if (TestCpuFlag(kCpuHasAVX2)) { | 687 if (TestCpuFlag(kCpuHasAVX2)) { |
690 // BlendPlaneRow = BlendPlaneRow_Any_AVX2; | 688 BlendPlaneRow = BlendPlaneRow_Any_AVX2; |
691 if (IS_ALIGNED(halfwidth, 16)) { | 689 if (IS_ALIGNED(width, 32)) { |
Diony Rosa
2015/12/08 20:06:53
You're also using BlendPlaneRow on the chroma chan
fbarchard
2015/12/08 20:09:47
Done.
| |
692 BlendPlaneRow = BlendPlaneRow_AVX2; | 690 BlendPlaneRow = BlendPlaneRow_AVX2; |
693 } | 691 } |
694 } | 692 } |
695 #endif | 693 #endif |
696 #if defined(HAS_SCALEROWDOWN2_NEON) | 694 #if defined(HAS_SCALEROWDOWN2_NEON) |
697 if (TestCpuFlag(kCpuHasNEON)) { | 695 if (TestCpuFlag(kCpuHasNEON)) { |
698 ScaleRowDown2 = ScaleRowDown2Box_Any_NEON; | 696 ScaleRowDown2 = ScaleRowDown2Box_Any_NEON; |
699 if (IS_ALIGNED(halfwidth, 16)) { | 697 if (IS_ALIGNED(halfwidth, 16)) { |
700 ScaleRowDown2 = ScaleRowDown2Box_NEON; | 698 ScaleRowDown2 = ScaleRowDown2Box_NEON; |
701 } | 699 } |
(...skipping 1925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2627 } | 2625 } |
2628 free_aligned_buffer_64(rows); | 2626 free_aligned_buffer_64(rows); |
2629 } | 2627 } |
2630 return 0; | 2628 return 0; |
2631 } | 2629 } |
2632 | 2630 |
2633 #ifdef __cplusplus | 2631 #ifdef __cplusplus |
2634 } // extern "C" | 2632 } // extern "C" |
2635 } // namespace libyuv | 2633 } // namespace libyuv |
2636 #endif | 2634 #endif |
OLD | NEW |