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

Side by Side Diff: source/row_common.cc

Issue 1687713002: add avx2 wrappers for functions that can call I422ToARGBRow_AVX2 (Closed) Base URL: https://chromium.googlesource.com/libyuv/libyuv@master
Patch Set: version number bump Created 4 years, 10 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 | « libyuv.gyp ('k') | 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 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 2477 matching lines...) Expand 10 before | Expand all | Expand 10 after
2488 void I422ToRGB565Row_AVX2(const uint8* src_y, 2488 void I422ToRGB565Row_AVX2(const uint8* src_y,
2489 const uint8* src_u, 2489 const uint8* src_u,
2490 const uint8* src_v, 2490 const uint8* src_v,
2491 uint8* dst_rgb565, 2491 uint8* dst_rgb565,
2492 const struct YuvConstants* yuvconstants, 2492 const struct YuvConstants* yuvconstants,
2493 int width) { 2493 int width) {
2494 SIMD_ALIGNED32(uint8 row[MAXTWIDTH * 4]); 2494 SIMD_ALIGNED32(uint8 row[MAXTWIDTH * 4]);
2495 while (width > 0) { 2495 while (width > 0) {
2496 int twidth = width > MAXTWIDTH ? MAXTWIDTH : width; 2496 int twidth = width > MAXTWIDTH ? MAXTWIDTH : width;
2497 I422ToARGBRow_AVX2(src_y, src_u, src_v, row, yuvconstants, twidth); 2497 I422ToARGBRow_AVX2(src_y, src_u, src_v, row, yuvconstants, twidth);
2498 #if defined(HAS_ARGBTORGB565ROW_AVX2)
2498 ARGBToRGB565Row_AVX2(row, dst_rgb565, twidth); 2499 ARGBToRGB565Row_AVX2(row, dst_rgb565, twidth);
2500 #else
2501 ARGBToRGB565Row_SSE2(row, dst_rgb565, twidth);
2502 #endif
2499 src_y += twidth; 2503 src_y += twidth;
2500 src_u += twidth / 2; 2504 src_u += twidth / 2;
2501 src_v += twidth / 2; 2505 src_v += twidth / 2;
2502 dst_rgb565 += twidth * 2; 2506 dst_rgb565 += twidth * 2;
2503 width -= twidth; 2507 width -= twidth;
2504 } 2508 }
2505 } 2509 }
2506 #endif 2510 #endif
2507 2511
2508 #if defined(HAS_I422TOARGB1555ROW_AVX2) 2512 #if defined(HAS_I422TOARGB1555ROW_AVX2)
2509 void I422ToARGB1555Row_AVX2(const uint8* src_y, 2513 void I422ToARGB1555Row_AVX2(const uint8* src_y,
2510 const uint8* src_u, 2514 const uint8* src_u,
2511 const uint8* src_v, 2515 const uint8* src_v,
2512 uint8* dst_argb1555, 2516 uint8* dst_argb1555,
2513 const struct YuvConstants* yuvconstants, 2517 const struct YuvConstants* yuvconstants,
2514 int width) { 2518 int width) {
2515 // Row buffer for intermediate ARGB pixels. 2519 // Row buffer for intermediate ARGB pixels.
2516 SIMD_ALIGNED32(uint8 row[MAXTWIDTH * 4]); 2520 SIMD_ALIGNED32(uint8 row[MAXTWIDTH * 4]);
2517 while (width > 0) { 2521 while (width > 0) {
2518 int twidth = width > MAXTWIDTH ? MAXTWIDTH : width; 2522 int twidth = width > MAXTWIDTH ? MAXTWIDTH : width;
2519 I422ToARGBRow_AVX2(src_y, src_u, src_v, row, yuvconstants, twidth); 2523 I422ToARGBRow_AVX2(src_y, src_u, src_v, row, yuvconstants, twidth);
2524 #if defined(HAS_ARGBTOARGB1555ROW_AVX2)
2520 ARGBToARGB1555Row_AVX2(row, dst_argb1555, twidth); 2525 ARGBToARGB1555Row_AVX2(row, dst_argb1555, twidth);
2526 #else
2527 ARGBToARGB1555Row_SSE2(row, dst_argb1555, twidth);
2528 #endif
2521 src_y += twidth; 2529 src_y += twidth;
2522 src_u += twidth / 2; 2530 src_u += twidth / 2;
2523 src_v += twidth / 2; 2531 src_v += twidth / 2;
2524 dst_argb1555 += twidth * 2; 2532 dst_argb1555 += twidth * 2;
2525 width -= twidth; 2533 width -= twidth;
2526 } 2534 }
2527 } 2535 }
2528 #endif 2536 #endif
2529 2537
2530 #if defined(HAS_I422TOARGB4444ROW_AVX2) 2538 #if defined(HAS_I422TOARGB4444ROW_AVX2)
2531 void I422ToARGB4444Row_AVX2(const uint8* src_y, 2539 void I422ToARGB4444Row_AVX2(const uint8* src_y,
2532 const uint8* src_u, 2540 const uint8* src_u,
2533 const uint8* src_v, 2541 const uint8* src_v,
2534 uint8* dst_argb4444, 2542 uint8* dst_argb4444,
2535 const struct YuvConstants* yuvconstants, 2543 const struct YuvConstants* yuvconstants,
2536 int width) { 2544 int width) {
2537 // Row buffer for intermediate ARGB pixels. 2545 // Row buffer for intermediate ARGB pixels.
2538 SIMD_ALIGNED32(uint8 row[MAXTWIDTH * 4]); 2546 SIMD_ALIGNED32(uint8 row[MAXTWIDTH * 4]);
2539 while (width > 0) { 2547 while (width > 0) {
2540 int twidth = width > MAXTWIDTH ? MAXTWIDTH : width; 2548 int twidth = width > MAXTWIDTH ? MAXTWIDTH : width;
2541 I422ToARGBRow_AVX2(src_y, src_u, src_v, row, yuvconstants, twidth); 2549 I422ToARGBRow_AVX2(src_y, src_u, src_v, row, yuvconstants, twidth);
2550 #if defined(HAS_ARGBTOARGB4444ROW_AVX2)
2542 ARGBToARGB4444Row_AVX2(row, dst_argb4444, twidth); 2551 ARGBToARGB4444Row_AVX2(row, dst_argb4444, twidth);
2552 #else
2553 ARGBToARGB4444Row_SSE2(row, dst_argb4444, twidth);
2554 #endif
2543 src_y += twidth; 2555 src_y += twidth;
2544 src_u += twidth / 2; 2556 src_u += twidth / 2;
2545 src_v += twidth / 2; 2557 src_v += twidth / 2;
2546 dst_argb4444 += twidth * 2; 2558 dst_argb4444 += twidth * 2;
2547 width -= twidth; 2559 width -= twidth;
2548 } 2560 }
2549 } 2561 }
2550 #endif 2562 #endif
2551 2563
2552 #if defined(HAS_I422TORGB24ROW_AVX2) 2564 #if defined(HAS_I422TORGB24ROW_AVX2)
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
2589 dst_rgb565 += twidth * 2; 2601 dst_rgb565 += twidth * 2;
2590 width -= twidth; 2602 width -= twidth;
2591 } 2603 }
2592 } 2604 }
2593 #endif 2605 #endif
2594 2606
2595 #ifdef __cplusplus 2607 #ifdef __cplusplus
2596 } // extern "C" 2608 } // extern "C"
2597 } // namespace libyuv 2609 } // namespace libyuv
2598 #endif 2610 #endif
OLDNEW
« no previous file with comments | « libyuv.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698