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

Side by Side Diff: source/convert_from.cc

Issue 2430313005: Add MSA optimized I422ToARGBRow_MSA and I422ToRGBARow_MSA functions (Closed)
Patch Set: Created 4 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
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 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 #endif 452 #endif
453 #if defined(HAS_I422TORGBAROW_DSPR2) 453 #if defined(HAS_I422TORGBAROW_DSPR2)
454 if (TestCpuFlag(kCpuHasDSPR2) && IS_ALIGNED(width, 4) && 454 if (TestCpuFlag(kCpuHasDSPR2) && IS_ALIGNED(width, 4) &&
455 IS_ALIGNED(src_y, 4) && IS_ALIGNED(src_stride_y, 4) && 455 IS_ALIGNED(src_y, 4) && IS_ALIGNED(src_stride_y, 4) &&
456 IS_ALIGNED(src_u, 2) && IS_ALIGNED(src_stride_u, 2) && 456 IS_ALIGNED(src_u, 2) && IS_ALIGNED(src_stride_u, 2) &&
457 IS_ALIGNED(src_v, 2) && IS_ALIGNED(src_stride_v, 2) && 457 IS_ALIGNED(src_v, 2) && IS_ALIGNED(src_stride_v, 2) &&
458 IS_ALIGNED(dst_rgba, 4) && IS_ALIGNED(dst_stride_rgba, 4)) { 458 IS_ALIGNED(dst_rgba, 4) && IS_ALIGNED(dst_stride_rgba, 4)) {
459 I422ToRGBARow = I422ToRGBARow_DSPR2; 459 I422ToRGBARow = I422ToRGBARow_DSPR2;
460 } 460 }
461 #endif 461 #endif
462 #if defined(HAS_I422TORGBAROW_MSA)
463 if (TestCpuFlag(kCpuHasMSA)) {
464 I422ToRGBARow = I422ToRGBARow_Any_MSA;
465 if (IS_ALIGNED(width, 8)) {
466 I422ToRGBARow = I422ToRGBARow_MSA;
467 }
468 }
469 #endif
462 470
463 for (y = 0; y < height; ++y) { 471 for (y = 0; y < height; ++y) {
464 I422ToRGBARow(src_y, src_u, src_v, dst_rgba, yuvconstants, width); 472 I422ToRGBARow(src_y, src_u, src_v, dst_rgba, yuvconstants, width);
465 dst_rgba += dst_stride_rgba; 473 dst_rgba += dst_stride_rgba;
466 src_y += src_stride_y; 474 src_y += src_stride_y;
467 if (y & 1) { 475 if (y & 1) {
468 src_u += src_stride_u; 476 src_u += src_stride_u;
469 src_v += src_stride_v; 477 src_v += src_stride_v;
470 } 478 }
471 } 479 }
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 } 849 }
842 #endif 850 #endif
843 #if defined(HAS_I422TOARGBROW_DSPR2) 851 #if defined(HAS_I422TOARGBROW_DSPR2)
844 if (TestCpuFlag(kCpuHasDSPR2) && IS_ALIGNED(width, 4) && 852 if (TestCpuFlag(kCpuHasDSPR2) && IS_ALIGNED(width, 4) &&
845 IS_ALIGNED(src_y, 4) && IS_ALIGNED(src_stride_y, 4) && 853 IS_ALIGNED(src_y, 4) && IS_ALIGNED(src_stride_y, 4) &&
846 IS_ALIGNED(src_u, 2) && IS_ALIGNED(src_stride_u, 2) && 854 IS_ALIGNED(src_u, 2) && IS_ALIGNED(src_stride_u, 2) &&
847 IS_ALIGNED(src_v, 2) && IS_ALIGNED(src_stride_v, 2)) { 855 IS_ALIGNED(src_v, 2) && IS_ALIGNED(src_stride_v, 2)) {
848 I422ToARGBRow = I422ToARGBRow_DSPR2; 856 I422ToARGBRow = I422ToARGBRow_DSPR2;
849 } 857 }
850 #endif 858 #endif
859 #if defined(HAS_I422TOARGBROW_MSA)
860 if (TestCpuFlag(kCpuHasMSA)) {
861 I422ToARGBRow = I422ToARGBRow_Any_MSA;
862 if (IS_ALIGNED(width, 8)) {
863 I422ToARGBRow = I422ToARGBRow_MSA;
864 }
865 }
866 #endif
851 #if defined(HAS_ARGBTORGB565DITHERROW_SSE2) 867 #if defined(HAS_ARGBTORGB565DITHERROW_SSE2)
852 if (TestCpuFlag(kCpuHasSSE2)) { 868 if (TestCpuFlag(kCpuHasSSE2)) {
853 ARGBToRGB565DitherRow = ARGBToRGB565DitherRow_Any_SSE2; 869 ARGBToRGB565DitherRow = ARGBToRGB565DitherRow_Any_SSE2;
854 if (IS_ALIGNED(width, 4)) { 870 if (IS_ALIGNED(width, 4)) {
855 ARGBToRGB565DitherRow = ARGBToRGB565DitherRow_SSE2; 871 ARGBToRGB565DitherRow = ARGBToRGB565DitherRow_SSE2;
856 } 872 }
857 } 873 }
858 #endif 874 #endif
859 #if defined(HAS_ARGBTORGB565DITHERROW_AVX2) 875 #if defined(HAS_ARGBTORGB565DITHERROW_AVX2)
860 if (TestCpuFlag(kCpuHasAVX2)) { 876 if (TestCpuFlag(kCpuHasAVX2)) {
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
1095 default: 1111 default:
1096 return -1; // unknown fourcc - return failure code. 1112 return -1; // unknown fourcc - return failure code.
1097 } 1113 }
1098 return r; 1114 return r;
1099 } 1115 }
1100 1116
1101 #ifdef __cplusplus 1117 #ifdef __cplusplus
1102 } // extern "C" 1118 } // extern "C"
1103 } // namespace libyuv 1119 } // namespace libyuv
1104 #endif 1120 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698