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

Side by Side Diff: source/row_neon.cc

Issue 1995293002: Add ARGBExtractAlpha function (Closed) Base URL: https://chromium.googlesource.com/libyuv/libyuv@master
Patch Set: Use packuswb xmm0, xmm0 instead Created 4 years, 7 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 | « source/row_gcc.cc ('k') | source/row_neon64.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 1280 matching lines...) Expand 10 before | Expand all | Expand 10 after
1291 "vst1.8 {d0}, [%1]! \n" // store 8 pixels Y. 1291 "vst1.8 {d0}, [%1]! \n" // store 8 pixels Y.
1292 "bgt 1b \n" 1292 "bgt 1b \n"
1293 : "+r"(src_argb), // %0 1293 : "+r"(src_argb), // %0
1294 "+r"(dst_y), // %1 1294 "+r"(dst_y), // %1
1295 "+r"(width) // %2 1295 "+r"(width) // %2
1296 : 1296 :
1297 : "cc", "memory", "q0", "q1", "q2", "q12", "q13" 1297 : "cc", "memory", "q0", "q1", "q2", "q12", "q13"
1298 ); 1298 );
1299 } 1299 }
1300 1300
1301 void ARGBExtractAlphaRow_NEON(const uint8* src_argb, uint8* dst_a, int width) {
1302 asm volatile (
1303 "1: \n"
1304 MEMACCESS(0)
1305 "vld4.8 {d0, d1, d2, d3}, [%0]! \n" // load row 8 pixels
1306 "subs %2, %2, #8 \n" // 8 processed per loop
1307 MEMACCESS(1)
1308 "vst1.8 {d3}, [%1]! \n" // store 8 A's.
1309 "bgt 1b \n"
1310 : "+r"(src_argb), // %0
1311 "+r"(dst_a), // %1
1312 "+r"(width) // %2
1313 :
1314 : "cc", "memory", "d0", "d1", "d2", "d3" // Clobber List
1315 );
1316 }
1317
1301 void ARGBToYJRow_NEON(const uint8* src_argb, uint8* dst_y, int width) { 1318 void ARGBToYJRow_NEON(const uint8* src_argb, uint8* dst_y, int width) {
1302 asm volatile ( 1319 asm volatile (
1303 "vmov.u8 d24, #15 \n" // B * 0.11400 coefficient 1320 "vmov.u8 d24, #15 \n" // B * 0.11400 coefficient
1304 "vmov.u8 d25, #75 \n" // G * 0.58700 coefficient 1321 "vmov.u8 d25, #75 \n" // G * 0.58700 coefficient
1305 "vmov.u8 d26, #38 \n" // R * 0.29900 coefficient 1322 "vmov.u8 d26, #38 \n" // R * 0.29900 coefficient
1306 "1: \n" 1323 "1: \n"
1307 MEMACCESS(0) 1324 MEMACCESS(0)
1308 "vld4.8 {d0, d1, d2, d3}, [%0]! \n" // load 8 ARGB pixels. 1325 "vld4.8 {d0, d1, d2, d3}, [%0]! \n" // load 8 ARGB pixels.
1309 "subs %2, %2, #8 \n" // 8 processed per loop. 1326 "subs %2, %2, #8 \n" // 8 processed per loop.
1310 "vmull.u8 q2, d0, d24 \n" // B 1327 "vmull.u8 q2, d0, d24 \n" // B
(...skipping 1508 matching lines...) Expand 10 before | Expand all | Expand 10 after
2819 "r"(6) // %5 2836 "r"(6) // %5
2820 : "cc", "memory", "q0", "q1" // Clobber List 2837 : "cc", "memory", "q0", "q1" // Clobber List
2821 ); 2838 );
2822 } 2839 }
2823 #endif // defined(__ARM_NEON__) && !defined(__aarch64__) 2840 #endif // defined(__ARM_NEON__) && !defined(__aarch64__)
2824 2841
2825 #ifdef __cplusplus 2842 #ifdef __cplusplus
2826 } // extern "C" 2843 } // extern "C"
2827 } // namespace libyuv 2844 } // namespace libyuv
2828 #endif 2845 #endif
OLDNEW
« no previous file with comments | « source/row_gcc.cc ('k') | source/row_neon64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698