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

Side by Side Diff: source/row_win.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_gcc.cc ('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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 const ptrdiff_t offset = (uint8*)v_buf - (uint8*)u_buf; 146 const ptrdiff_t offset = (uint8*)v_buf - (uint8*)u_buf;
147 while (width > 0) { 147 while (width > 0) {
148 READYUVA422 148 READYUVA422
149 YUVTORGB(yuvconstants) 149 YUVTORGB(yuvconstants)
150 STOREARGB 150 STOREARGB
151 width -= 8; 151 width -= 8;
152 } 152 }
153 } 153 }
154 #endif 154 #endif
155 155
156 #if defined(HAS_I422ALPHATOABGRROW_SSSE3)
157 void I422AlphaToABGRRow_SSSE3(const uint8* y_buf,
158 const uint8* u_buf,
159 const uint8* v_buf,
160 const uint8* a_buf,
161 uint8* dst_abgr,
162 const struct YuvConstants* yuvconstants,
163 int width) {
164 __m128i xmm0, xmm1, xmm2, xmm4, xmm5;
165 const ptrdiff_t offset = (uint8*)v_buf - (uint8*)u_buf;
166 while (width > 0) {
167 READYUVA422
168 YUVTORGB(yuvconstants)
169 STOREABGR
170 width -= 8;
171 }
172 }
173 #endif
174
175 // 32 bit 156 // 32 bit
176 #else // defined(_M_X64) 157 #else // defined(_M_X64)
177 #ifdef HAS_ARGBTOYROW_SSSE3 158 #ifdef HAS_ARGBTOYROW_SSSE3
178 159
179 // Constants for ARGB. 160 // Constants for ARGB.
180 static const vec8 kARGBToY = { 161 static const vec8 kARGBToY = {
181 13, 65, 33, 0, 13, 65, 33, 0, 13, 65, 33, 0, 13, 65, 33, 0 162 13, 65, 33, 0, 13, 65, 33, 0, 13, 65, 33, 0, 13, 65, 33, 0
182 }; 163 };
183 164
184 // JPeg full range. 165 // JPeg full range.
(...skipping 1993 matching lines...) Expand 10 before | Expand all | Expand 10 after
2178 pop ebp 2159 pop ebp
2179 pop ebx 2160 pop ebx
2180 pop edi 2161 pop edi
2181 pop esi 2162 pop esi
2182 vzeroupper 2163 vzeroupper
2183 ret 2164 ret
2184 } 2165 }
2185 } 2166 }
2186 #endif // HAS_I422ALPHATOARGBROW_AVX2 2167 #endif // HAS_I422ALPHATOARGBROW_AVX2
2187 2168
2188 #ifdef HAS_I422ALPHATOABGRROW_AVX2
2189 // 16 pixels
2190 // 8 UV values upsampled to 16 UV, mixed with 16 Y and 16 A producing 16 ABGR.
2191 __declspec(naked)
2192 void I422AlphaToABGRRow_AVX2(const uint8* y_buf,
2193 const uint8* u_buf,
2194 const uint8* v_buf,
2195 const uint8* a_buf,
2196 uint8* dst_abgr,
2197 const struct YuvConstants* yuvconstants,
2198 int width) {
2199 __asm {
2200 push esi
2201 push edi
2202 push ebx
2203 push ebp
2204 mov eax, [esp + 16 + 4] // Y
2205 mov esi, [esp + 16 + 8] // U
2206 mov edi, [esp + 16 + 12] // V
2207 mov ebp, [esp + 16 + 16] // A
2208 mov edx, [esp + 16 + 20] // abgr
2209 mov ebx, [esp + 16 + 24] // yuvconstants
2210 mov ecx, [esp + 16 + 28] // width
2211 sub edi, esi
2212
2213 convertloop:
2214 READYUVA422_AVX2
2215 YUVTORGB_AVX2(ebx)
2216 STOREABGR_AVX2
2217
2218 sub ecx, 16
2219 jg convertloop
2220
2221 pop ebp
2222 pop ebx
2223 pop edi
2224 pop esi
2225 vzeroupper
2226 ret
2227 }
2228 }
2229 #endif // HAS_I422ALPHATOABGRROW_AVX2
2230
2231 #ifdef HAS_I444TOARGBROW_AVX2 2169 #ifdef HAS_I444TOARGBROW_AVX2
2232 // 16 pixels 2170 // 16 pixels
2233 // 16 UV values with 16 Y producing 16 ARGB (64 bytes). 2171 // 16 UV values with 16 Y producing 16 ARGB (64 bytes).
2234 __declspec(naked) 2172 __declspec(naked)
2235 void I444ToARGBRow_AVX2(const uint8* y_buf, 2173 void I444ToARGBRow_AVX2(const uint8* y_buf,
2236 const uint8* u_buf, 2174 const uint8* u_buf,
2237 const uint8* v_buf, 2175 const uint8* v_buf,
2238 uint8* dst_argb, 2176 uint8* dst_argb,
2239 const struct YuvConstants* yuvconstants, 2177 const struct YuvConstants* yuvconstants,
2240 int width) { 2178 int width) {
(...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after
3021 2959
3022 pop ebp 2960 pop ebp
3023 pop ebx 2961 pop ebx
3024 pop edi 2962 pop edi
3025 pop esi 2963 pop esi
3026 ret 2964 ret
3027 } 2965 }
3028 } 2966 }
3029 2967
3030 // 8 pixels. 2968 // 8 pixels.
3031 // 4 UV values upsampled to 8 UV, mixed with 8 Y and 8 A producing 8 ABGR.
3032 __declspec(naked)
3033 void I422AlphaToABGRRow_SSSE3(const uint8* y_buf,
3034 const uint8* u_buf,
3035 const uint8* v_buf,
3036 const uint8* a_buf,
3037 uint8* dst_abgr,
3038 const struct YuvConstants* yuvconstants,
3039 int width) {
3040 __asm {
3041 push esi
3042 push edi
3043 push ebx
3044 push ebp
3045 mov eax, [esp + 16 + 4] // Y
3046 mov esi, [esp + 16 + 8] // U
3047 mov edi, [esp + 16 + 12] // V
3048 mov ebp, [esp + 16 + 16] // A
3049 mov edx, [esp + 16 + 20] // abgr
3050 mov ebx, [esp + 16 + 24] // yuvconstants
3051 mov ecx, [esp + 16 + 28] // width
3052 sub edi, esi
3053
3054 convertloop:
3055 READYUVA422
3056 YUVTORGB(ebx)
3057 STOREABGR
3058
3059 sub ecx, 8
3060 jg convertloop
3061
3062 pop ebp
3063 pop ebx
3064 pop edi
3065 pop esi
3066 ret
3067 }
3068 }
3069
3070 // 8 pixels.
3071 // 2 UV values upsampled to 8 UV, mixed with 8 Y producing 8 ARGB (32 bytes). 2969 // 2 UV values upsampled to 8 UV, mixed with 8 Y producing 8 ARGB (32 bytes).
3072 // Similar to I420 but duplicate UV once more. 2970 // Similar to I420 but duplicate UV once more.
3073 __declspec(naked) 2971 __declspec(naked)
3074 void I411ToARGBRow_SSSE3(const uint8* y_buf, 2972 void I411ToARGBRow_SSSE3(const uint8* y_buf,
3075 const uint8* u_buf, 2973 const uint8* u_buf,
3076 const uint8* v_buf, 2974 const uint8* v_buf,
3077 uint8* dst_argb, 2975 uint8* dst_argb,
3078 const struct YuvConstants* yuvconstants, 2976 const struct YuvConstants* yuvconstants,
3079 int width) { 2977 int width) {
3080 __asm { 2978 __asm {
(...skipping 3481 matching lines...) Expand 10 before | Expand all | Expand 10 after
6562 } 6460 }
6563 #endif // HAS_ARGBLUMACOLORTABLEROW_SSSE3 6461 #endif // HAS_ARGBLUMACOLORTABLEROW_SSSE3
6564 6462
6565 #endif // defined(_M_X64) 6463 #endif // defined(_M_X64)
6566 #endif // !defined(LIBYUV_DISABLE_X86) && (defined(_M_IX86) || defined(_M_X64)) 6464 #endif // !defined(LIBYUV_DISABLE_X86) && (defined(_M_IX86) || defined(_M_X64))
6567 6465
6568 #ifdef __cplusplus 6466 #ifdef __cplusplus
6569 } // extern "C" 6467 } // extern "C"
6570 } // namespace libyuv 6468 } // namespace libyuv
6571 #endif 6469 #endif
OLDNEW
« no previous file with comments | « source/row_gcc.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698