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

Side by Side Diff: source/row_gcc.cc

Issue 1422263002: refactor I420AlphaToABGR to use I420AlphaToARGB internally (Closed) Base URL: https://chromium.googlesource.com/libyuv/libyuv@master
Patch Set: Created 5 years, 1 month 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_common.cc ('k') | source/row_win.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 // VERSION 2 1 // VERSION 2
2 /* 2 /*
3 * Copyright 2011 The LibYuv Project Authors. All rights reserved. 3 * Copyright 2011 The LibYuv Project Authors. All rights reserved.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license 5 * Use of this source code is governed by a BSD-style license
6 * that can be found in the LICENSE file in the root of the source 6 * that can be found in the LICENSE file in the root of the source
7 * tree. An additional intellectual property rights grant can be found 7 * tree. An additional intellectual property rights grant can be found
8 * in the file PATENTS. All contributing project authors may 8 * in the file PATENTS. All contributing project authors may
9 * be found in the AUTHORS file in the root of the source tree. 9 * be found in the AUTHORS file in the root of the source tree.
10 */ 10 */
(...skipping 1748 matching lines...) Expand 10 before | Expand all | Expand 10 after
1759 [width]"+m"(width) // %[width] 1759 [width]"+m"(width) // %[width]
1760 #else 1760 #else
1761 [width]"+rm"(width) // %[width] 1761 [width]"+rm"(width) // %[width]
1762 #endif 1762 #endif
1763 : [yuvconstants]"r"(yuvconstants) // %[yuvconstants] 1763 : [yuvconstants]"r"(yuvconstants) // %[yuvconstants]
1764 : "memory", "cc", NACL_R14 1764 : "memory", "cc", NACL_R14
1765 "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5" 1765 "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5"
1766 ); 1766 );
1767 } 1767 }
1768 1768
1769 void OMITFP I422AlphaToABGRRow_SSSE3(const uint8* y_buf,
1770 const uint8* u_buf,
1771 const uint8* v_buf,
1772 const uint8* a_buf,
1773 uint8* dst_abgr,
1774 const struct YuvConstants* yuvconstants,
1775 int width) {
1776 asm volatile (
1777 "sub %[u_buf],%[v_buf] \n"
1778 LABELALIGN
1779 "1: \n"
1780 READYUVA422
1781 YUVTORGB(yuvconstants)
1782 STOREABGR
1783 "subl $0x8,%[width] \n"
1784 "jg 1b \n"
1785 : [y_buf]"+r"(y_buf), // %[y_buf]
1786 [u_buf]"+r"(u_buf), // %[u_buf]
1787 [v_buf]"+r"(v_buf), // %[v_buf]
1788 [a_buf]"+r"(a_buf), // %[a_buf]
1789 [dst_abgr]"+r"(dst_abgr), // %[dst_abgr]
1790 #if defined(__i386__) && defined(__pic__)
1791 [width]"+m"(width) // %[width]
1792 #else
1793 [width]"+rm"(width) // %[width]
1794 #endif
1795 : [yuvconstants]"r"(yuvconstants) // %[yuvconstants]
1796 : "memory", "cc", NACL_R14
1797 "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5"
1798 );
1799 }
1800
1801 void OMITFP I411ToARGBRow_SSSE3(const uint8* y_buf, 1769 void OMITFP I411ToARGBRow_SSSE3(const uint8* y_buf,
1802 const uint8* u_buf, 1770 const uint8* u_buf,
1803 const uint8* v_buf, 1771 const uint8* v_buf,
1804 uint8* dst_argb, 1772 uint8* dst_argb,
1805 const struct YuvConstants* yuvconstants, 1773 const struct YuvConstants* yuvconstants,
1806 int width) { 1774 int width) {
1807 asm volatile ( 1775 asm volatile (
1808 "sub %[u_buf],%[v_buf] \n" 1776 "sub %[u_buf],%[v_buf] \n"
1809 "pcmpeqb %%xmm5,%%xmm5 \n" 1777 "pcmpeqb %%xmm5,%%xmm5 \n"
1810 LABELALIGN 1778 LABELALIGN
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
2222 #else 2190 #else
2223 [width]"+rm"(width) // %[width] 2191 [width]"+rm"(width) // %[width]
2224 #endif 2192 #endif
2225 : [yuvconstants]"r"(yuvconstants) // %[yuvconstants] 2193 : [yuvconstants]"r"(yuvconstants) // %[yuvconstants]
2226 : "memory", "cc", NACL_R14 2194 : "memory", "cc", NACL_R14
2227 "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5" 2195 "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5"
2228 ); 2196 );
2229 } 2197 }
2230 #endif // HAS_I422ALPHATOARGBROW_AVX2 2198 #endif // HAS_I422ALPHATOARGBROW_AVX2
2231 2199
2232 #if defined(HAS_I422ALPHATOABGRROW_AVX2)
2233 // 16 pixels
2234 // 8 UV values upsampled to 16 UV, mixed with 16 Y and 16 A producing 16 ABGR.
2235 void OMITFP I422AlphaToABGRRow_AVX2(const uint8* y_buf,
2236 const uint8* u_buf,
2237 const uint8* v_buf,
2238 const uint8* a_buf,
2239 uint8* dst_abgr,
2240 const struct YuvConstants* yuvconstants,
2241 int width) {
2242 asm volatile (
2243 "sub %[u_buf],%[v_buf] \n"
2244 LABELALIGN
2245 "1: \n"
2246 READYUVA422_AVX2
2247 YUVTORGB_AVX2(yuvconstants)
2248 STOREABGR_AVX2
2249 "subl $0x10,%[width] \n"
2250 "jg 1b \n"
2251 "vzeroupper \n"
2252 : [y_buf]"+r"(y_buf), // %[y_buf]
2253 [u_buf]"+r"(u_buf), // %[u_buf]
2254 [v_buf]"+r"(v_buf), // %[v_buf]
2255 [a_buf]"+r"(a_buf), // %[a_buf]
2256 [dst_abgr]"+r"(dst_abgr), // %[dst_abgr]
2257 #if defined(__i386__) && defined(__pic__)
2258 [width]"+m"(width) // %[width]
2259 #else
2260 [width]"+rm"(width) // %[width]
2261 #endif
2262 : [yuvconstants]"r"(yuvconstants) // %[yuvconstants]
2263 : "memory", "cc", NACL_R14
2264 "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5"
2265 );
2266 }
2267 #endif // HAS_I422ALPHATOABGRROW_AVX2
2268
2269 #if defined(HAS_I422TOABGRROW_AVX2) 2200 #if defined(HAS_I422TOABGRROW_AVX2)
2270 // 16 pixels 2201 // 16 pixels
2271 // 8 UV values upsampled to 16 UV, mixed with 16 Y producing 16 ABGR (64 bytes). 2202 // 8 UV values upsampled to 16 UV, mixed with 16 Y producing 16 ABGR (64 bytes).
2272 void OMITFP I422ToABGRRow_AVX2(const uint8* y_buf, 2203 void OMITFP I422ToABGRRow_AVX2(const uint8* y_buf,
2273 const uint8* u_buf, 2204 const uint8* u_buf,
2274 const uint8* v_buf, 2205 const uint8* v_buf,
2275 uint8* dst_abgr, 2206 uint8* dst_abgr,
2276 const struct YuvConstants* yuvconstants, 2207 const struct YuvConstants* yuvconstants,
2277 int width) { 2208 int width) {
2278 asm volatile ( 2209 asm volatile (
(...skipping 3280 matching lines...) Expand 10 before | Expand all | Expand 10 after
5559 ); 5490 );
5560 } 5491 }
5561 #endif // HAS_ARGBLUMACOLORTABLEROW_SSSE3 5492 #endif // HAS_ARGBLUMACOLORTABLEROW_SSSE3
5562 5493
5563 #endif // defined(__x86_64__) || defined(__i386__) 5494 #endif // defined(__x86_64__) || defined(__i386__)
5564 5495
5565 #ifdef __cplusplus 5496 #ifdef __cplusplus
5566 } // extern "C" 5497 } // extern "C"
5567 } // namespace libyuv 5498 } // namespace libyuv
5568 #endif 5499 #endif
OLDNEW
« no previous file with comments | « source/row_common.cc ('k') | source/row_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698