Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(375)

Side by Side Diff: source/row_any.cc

Issue 1418983003: bug fix for odd width 16/24 bit to i420 (Closed) Base URL: https://chromium.googlesource.com/libyuv/libyuv@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 memset(temp, 0, 128); /* for msan */ \ 668 memset(temp, 0, 128); /* for msan */ \
669 int r = width & MASK; \ 669 int r = width & MASK; \
670 int n = width & ~MASK; \ 670 int n = width & ~MASK; \
671 if (n > 0) { \ 671 if (n > 0) { \
672 ANY_SIMD(src_ptr, dst_u, dst_v, n); \ 672 ANY_SIMD(src_ptr, dst_u, dst_v, n); \
673 } \ 673 } \
674 memcpy(temp, src_ptr + (n >> UVSHIFT) * BPP, SS(r, UVSHIFT) * BPP); \ 674 memcpy(temp, src_ptr + (n >> UVSHIFT) * BPP, SS(r, UVSHIFT) * BPP); \
675 /* repeat last 4 bytes for 422 subsampler */ \ 675 /* repeat last 4 bytes for 422 subsampler */ \
676 if ((width & 1) && BPP == 4 && DUVSHIFT == 1) { \ 676 if ((width & 1) && BPP == 4 && DUVSHIFT == 1) { \
677 memcpy(temp + SS(r, UVSHIFT) * BPP, \ 677 memcpy(temp + SS(r, UVSHIFT) * BPP, \
678 temp + SS(r, UVSHIFT) * BPP - BPP, 4); \ 678 temp + SS(r, UVSHIFT) * BPP - BPP, BPP); \
679 } \ 679 } \
680 /* repeat last 4 - 12 bytes for 411 subsampler */ \ 680 /* repeat last 4 - 12 bytes for 411 subsampler */ \
681 if (((width & 3) == 1) && BPP == 4 && DUVSHIFT == 2) { \ 681 if (((width & 3) == 1) && BPP == 4 && DUVSHIFT == 2) { \
682 memcpy(temp + SS(r, UVSHIFT) * BPP, \ 682 memcpy(temp + SS(r, UVSHIFT) * BPP, \
683 temp + SS(r, UVSHIFT) * BPP - BPP, 4); \ 683 temp + SS(r, UVSHIFT) * BPP - BPP, BPP); \
684 memcpy(temp + SS(r, UVSHIFT) * BPP + 4, \ 684 memcpy(temp + SS(r, UVSHIFT) * BPP + BPP, \
685 temp + SS(r, UVSHIFT) * BPP - BPP, 8); \ 685 temp + SS(r, UVSHIFT) * BPP - BPP, BPP * 2); \
686 } \ 686 } \
687 if (((width & 3) == 2) && BPP == 4 && DUVSHIFT == 2) { \ 687 if (((width & 3) == 2) && BPP == 4 && DUVSHIFT == 2) { \
688 memcpy(temp + SS(r, UVSHIFT) * BPP, \ 688 memcpy(temp + SS(r, UVSHIFT) * BPP, \
689 temp + SS(r, UVSHIFT) * BPP - BPP * 2, 8); \ 689 temp + SS(r, UVSHIFT) * BPP - BPP * 2, BPP * 2); \
690 } \ 690 } \
691 if (((width & 3) == 3) && BPP == 4 && DUVSHIFT == 2) { \ 691 if (((width & 3) == 3) && BPP == 4 && DUVSHIFT == 2) { \
692 memcpy(temp + SS(r, UVSHIFT) * BPP, \ 692 memcpy(temp + SS(r, UVSHIFT) * BPP, \
693 temp + SS(r, UVSHIFT) * BPP - BPP, 4); \ 693 temp + SS(r, UVSHIFT) * BPP - BPP, BPP); \
694 } \ 694 } \
695 ANY_SIMD(temp, temp + 128, temp + 256, MASK + 1); \ 695 ANY_SIMD(temp, temp + 128, temp + 256, MASK + 1); \
696 memcpy(dst_u + (n >> DUVSHIFT), temp + 128, SS(r, DUVSHIFT)); \ 696 memcpy(dst_u + (n >> DUVSHIFT), temp + 128, SS(r, DUVSHIFT)); \
697 memcpy(dst_v + (n >> DUVSHIFT), temp + 256, SS(r, DUVSHIFT)); \ 697 memcpy(dst_v + (n >> DUVSHIFT), temp + 256, SS(r, DUVSHIFT)); \
698 } 698 }
699 699
700 #ifdef HAS_SPLITUVROW_SSE2 700 #ifdef HAS_SPLITUVROW_SSE2
701 ANY12(SplitUVRow_Any_SSE2, SplitUVRow_SSE2, 0, 2, 0, 15) 701 ANY12(SplitUVRow_Any_SSE2, SplitUVRow_SSE2, 0, 2, 0, 15)
702 #endif 702 #endif
703 #ifdef HAS_SPLITUVROW_AVX2 703 #ifdef HAS_SPLITUVROW_AVX2
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 SIMD_ALIGNED(uint8 temp[128 * 4]); \ 740 SIMD_ALIGNED(uint8 temp[128 * 4]); \
741 memset(temp, 0, 128 * 2); /* for msan */ \ 741 memset(temp, 0, 128 * 2); /* for msan */ \
742 int r = width & MASK; \ 742 int r = width & MASK; \
743 int n = width & ~MASK; \ 743 int n = width & ~MASK; \
744 if (n > 0) { \ 744 if (n > 0) { \
745 ANY_SIMD(src_ptr, src_stride_ptr, dst_u, dst_v, n); \ 745 ANY_SIMD(src_ptr, src_stride_ptr, dst_u, dst_v, n); \
746 } \ 746 } \
747 memcpy(temp, src_ptr + (n >> UVSHIFT) * BPP, SS(r, UVSHIFT) * BPP); \ 747 memcpy(temp, src_ptr + (n >> UVSHIFT) * BPP, SS(r, UVSHIFT) * BPP); \
748 memcpy(temp + 128, src_ptr + src_stride_ptr + (n >> UVSHIFT) * BPP, \ 748 memcpy(temp + 128, src_ptr + src_stride_ptr + (n >> UVSHIFT) * BPP, \
749 SS(r, UVSHIFT) * BPP); \ 749 SS(r, UVSHIFT) * BPP); \
750 if ((width & 1) && BPP == 4) { /* repeat last 4 bytes for subsampler */ \ 750 if ((width & 1) && UVSHIFT == 0) { /* repeat last pixel for subsample */\
751 memcpy(temp + SS(r, UVSHIFT) * BPP, \ 751 memcpy(temp + SS(r, UVSHIFT) * BPP, \
752 temp + SS(r, UVSHIFT) * BPP - BPP, 4); \ 752 temp + SS(r, UVSHIFT) * BPP - BPP, BPP); \
753 memcpy(temp + 128 + SS(r, UVSHIFT) * BPP, \ 753 memcpy(temp + 128 + SS(r, UVSHIFT) * BPP, \
754 temp + 128 + SS(r, UVSHIFT) * BPP - BPP, 4); \ 754 temp + 128 + SS(r, UVSHIFT) * BPP - BPP, BPP); \
755 } \ 755 } \
756 ANY_SIMD(temp, 128, temp + 256, temp + 384, MASK + 1); \ 756 ANY_SIMD(temp, 128, temp + 256, temp + 384, MASK + 1); \
757 memcpy(dst_u + (n >> 1), temp + 256, SS(r, 1)); \ 757 memcpy(dst_u + (n >> 1), temp + 256, SS(r, 1)); \
758 memcpy(dst_v + (n >> 1), temp + 384, SS(r, 1)); \ 758 memcpy(dst_v + (n >> 1), temp + 384, SS(r, 1)); \
759 } 759 }
760 760
761 #ifdef HAS_ARGBTOUVROW_AVX2 761 #ifdef HAS_ARGBTOUVROW_AVX2
762 ANY12S(ARGBToUVRow_Any_AVX2, ARGBToUVRow_AVX2, 0, 4, 31) 762 ANY12S(ARGBToUVRow_Any_AVX2, ARGBToUVRow_AVX2, 0, 4, 31)
763 #endif 763 #endif
764 #ifdef HAS_ARGBTOUVROW_SSSE3 764 #ifdef HAS_ARGBTOUVROW_SSSE3
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 #endif 811 #endif
812 #ifdef HAS_UYVYTOUVROW_NEON 812 #ifdef HAS_UYVYTOUVROW_NEON
813 ANY12S(UYVYToUVRow_Any_NEON, UYVYToUVRow_NEON, 1, 4, 15) 813 ANY12S(UYVYToUVRow_Any_NEON, UYVYToUVRow_NEON, 1, 4, 15)
814 #endif 814 #endif
815 #undef ANY12S 815 #undef ANY12S
816 816
817 #ifdef __cplusplus 817 #ifdef __cplusplus
818 } // extern "C" 818 } // extern "C"
819 } // namespace libyuv 819 } // namespace libyuv
820 #endif 820 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698