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

Side by Side Diff: source/row_common.cc

Issue 1364813002: yuy2 avx2 initial change (Closed) Base URL: https://chromium.googlesource.com/libyuv/libyuv@master
Patch Set: avx2 yuy2/uyvy to argb Created 5 years, 3 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 | « include/libyuv/version.h ('k') | source/row_gcc.cc » ('j') | 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 2589 matching lines...) Expand 10 before | Expand all | Expand 10 after
2600 NV12ToARGBRow_AVX2(src_y, src_uv, row, yuvconstants, twidth); 2600 NV12ToARGBRow_AVX2(src_y, src_uv, row, yuvconstants, twidth);
2601 ARGBToRGB565Row_AVX2(row, dst_rgb565, twidth); 2601 ARGBToRGB565Row_AVX2(row, dst_rgb565, twidth);
2602 src_y += twidth; 2602 src_y += twidth;
2603 src_uv += twidth; 2603 src_uv += twidth;
2604 dst_rgb565 += twidth * 2; 2604 dst_rgb565 += twidth * 2;
2605 width -= twidth; 2605 width -= twidth;
2606 } 2606 }
2607 } 2607 }
2608 #endif 2608 #endif
2609 2609
2610 #if defined(HAS_YUY2TOARGBROW_AVX2)
2611 void YUY2ToARGBRow_AVX2(const uint8* src_yuy2,
2612 uint8* dst_argb,
2613 struct YuvConstants* yuvconstants,
2614 int width) {
2615 // Row buffers for intermediate YUV pixels.
2616 SIMD_ALIGNED32(uint8 row_y[MAXTWIDTH]);
2617 SIMD_ALIGNED32(uint8 row_u[MAXTWIDTH / 2]);
2618 SIMD_ALIGNED32(uint8 row_v[MAXTWIDTH / 2]);
2619 while (width > 0) {
2620 int twidth = width > MAXTWIDTH ? MAXTWIDTH : width;
2621 YUY2ToUV422Row_AVX2(src_yuy2, row_u, row_v, twidth);
2622 YUY2ToYRow_AVX2(src_yuy2, row_y, twidth);
2623 I422ToARGBRow_AVX2(row_y, row_u, row_v, dst_argb, yuvconstants, twidth);
2624 src_yuy2 += twidth * 2;
2625 dst_argb += twidth * 4;
2626 width -= twidth;
2627 }
2628 }
2629 #endif
2630
2631 #if defined(HAS_UYVYTOARGBROW_AVX2)
2632 void UYVYToARGBRow_AVX2(const uint8* src_uyvy,
2633 uint8* dst_argb,
2634 struct YuvConstants* yuvconstants,
2635 int width) {
2636 // Row buffers for intermediate YUV pixels.
2637 SIMD_ALIGNED32(uint8 row_y[MAXTWIDTH]);
2638 SIMD_ALIGNED32(uint8 row_u[MAXTWIDTH / 2]);
2639 SIMD_ALIGNED32(uint8 row_v[MAXTWIDTH / 2]);
2640 while (width > 0) {
2641 int twidth = width > MAXTWIDTH ? MAXTWIDTH : width;
2642 UYVYToUV422Row_AVX2(src_uyvy, row_u, row_v, twidth);
2643 UYVYToYRow_AVX2(src_uyvy, row_y, twidth);
2644 I422ToARGBRow_AVX2(row_y, row_u, row_v, dst_argb, yuvconstants, twidth);
2645 src_uyvy += twidth * 2;
2646 dst_argb += twidth * 4;
2647 width -= twidth;
2648 }
2649 }
2650 #endif // !defined(LIBYUV_DISABLE_X86)
2651
2652 #ifdef __cplusplus 2610 #ifdef __cplusplus
2653 } // extern "C" 2611 } // extern "C"
2654 } // namespace libyuv 2612 } // namespace libyuv
2655 #endif 2613 #endif
OLDNEW
« no previous file with comments | « include/libyuv/version.h ('k') | source/row_gcc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698