OLD | NEW |
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 2422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2433 __asm punpcklbw xmm0, xmm1 /* UV */ \ | 2433 __asm punpcklbw xmm0, xmm1 /* UV */ \ |
2434 __asm punpcklwd xmm0, xmm0 /* UVUV (upsample) */ \ | 2434 __asm punpcklwd xmm0, xmm0 /* UVUV (upsample) */ \ |
2435 __asm movq xmm4, qword ptr [eax] /* Y */ \ | 2435 __asm movq xmm4, qword ptr [eax] /* Y */ \ |
2436 __asm punpcklbw xmm4, xmm4 \ | 2436 __asm punpcklbw xmm4, xmm4 \ |
2437 __asm lea eax, [eax + 8] \ | 2437 __asm lea eax, [eax + 8] \ |
2438 __asm movq xmm5, qword ptr [ebp] /* A */ \ | 2438 __asm movq xmm5, qword ptr [ebp] /* A */ \ |
2439 __asm lea ebp, [ebp + 8] \ | 2439 __asm lea ebp, [ebp + 8] \ |
2440 } | 2440 } |
2441 | 2441 |
2442 // Read 2 UV from 411, upsample to 8 UV. | 2442 // Read 2 UV from 411, upsample to 8 UV. |
2443 #define READYUV411 __asm { \ | 2443 // drmemory fails with memory fault if pinsrw used. libyuv bug: 525 |
2444 __asm pinsrw xmm0, [esi], 0 /* U */ \ | 2444 // __asm pinsrw xmm0, [esi], 0 /* U */ |
2445 __asm pinsrw xmm1, [esi + edi], 0 /* V */ \ | 2445 // __asm pinsrw xmm1, [esi + edi], 0 /* V */ |
| 2446 #define READYUV411_EBX __asm { \ |
| 2447 __asm movzx ebx, word ptr [esi] /* U */ \ |
| 2448 __asm movd xmm0, ebx \ |
| 2449 __asm movzx ebx, word ptr [esi + edi] /* V */ \ |
| 2450 __asm movd xmm1, ebx \ |
2446 __asm lea esi, [esi + 2] \ | 2451 __asm lea esi, [esi + 2] \ |
2447 __asm punpcklbw xmm0, xmm1 /* UV */ \ | 2452 __asm punpcklbw xmm0, xmm1 /* UV */ \ |
2448 __asm punpcklwd xmm0, xmm0 /* UVUV (upsample) */ \ | 2453 __asm punpcklwd xmm0, xmm0 /* UVUV (upsample) */ \ |
2449 __asm punpckldq xmm0, xmm0 /* UVUVUVUV (upsample) */ \ | 2454 __asm punpckldq xmm0, xmm0 /* UVUVUVUV (upsample) */ \ |
2450 __asm movq xmm4, qword ptr [eax] \ | 2455 __asm movq xmm4, qword ptr [eax] \ |
2451 __asm punpcklbw xmm4, xmm4 \ | 2456 __asm punpcklbw xmm4, xmm4 \ |
2452 __asm lea eax, [eax + 8] \ | 2457 __asm lea eax, [eax + 8] \ |
2453 } | 2458 } |
2454 | 2459 |
2455 // Read 4 UV from NV12, upsample to 8 UV. | 2460 // Read 4 UV from NV12, upsample to 8 UV. |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2809 void I411ToARGBRow_SSSE3(const uint8* y_buf, | 2814 void I411ToARGBRow_SSSE3(const uint8* y_buf, |
2810 const uint8* u_buf, | 2815 const uint8* u_buf, |
2811 const uint8* v_buf, | 2816 const uint8* v_buf, |
2812 uint8* dst_argb, | 2817 uint8* dst_argb, |
2813 const struct YuvConstants* yuvconstants, | 2818 const struct YuvConstants* yuvconstants, |
2814 int width) { | 2819 int width) { |
2815 __asm { | 2820 __asm { |
2816 push esi | 2821 push esi |
2817 push edi | 2822 push edi |
2818 push ebx | 2823 push ebx |
2819 mov eax, [esp + 12 + 4] // Y | 2824 push ebp |
2820 mov esi, [esp + 12 + 8] // U | 2825 mov eax, [esp + 16 + 4] // Y |
2821 mov edi, [esp + 12 + 12] // V | 2826 mov esi, [esp + 16 + 8] // U |
2822 mov edx, [esp + 12 + 16] // abgr | 2827 mov edi, [esp + 16 + 12] // V |
2823 mov ebx, [esp + 12 + 20] // yuvconstants | 2828 mov edx, [esp + 16 + 16] // abgr |
2824 mov ecx, [esp + 12 + 24] // width | 2829 mov ebp, [esp + 16 + 20] // yuvconstants |
| 2830 mov ecx, [esp + 16 + 24] // width |
2825 sub edi, esi | 2831 sub edi, esi |
2826 pcmpeqb xmm5, xmm5 // generate 0xffffffff for alpha | 2832 pcmpeqb xmm5, xmm5 // generate 0xffffffff for alpha |
2827 | 2833 |
2828 convertloop: | 2834 convertloop: |
2829 READYUV411 | 2835 READYUV411_EBX |
2830 YUVTORGB(ebx) | 2836 YUVTORGB(ebp) |
2831 STOREARGB | 2837 STOREARGB |
2832 | 2838 |
2833 sub ecx, 8 | 2839 sub ecx, 8 |
2834 jg convertloop | 2840 jg convertloop |
2835 | 2841 |
| 2842 pop ebp |
2836 pop ebx | 2843 pop ebx |
2837 pop edi | 2844 pop edi |
2838 pop esi | 2845 pop esi |
2839 ret | 2846 ret |
2840 } | 2847 } |
2841 } | 2848 } |
2842 | 2849 |
2843 // 8 pixels. | 2850 // 8 pixels. |
2844 // 4 UV values upsampled to 8 UV, mixed with 8 Y producing 8 ARGB (32 bytes). | 2851 // 4 UV values upsampled to 8 UV, mixed with 8 Y producing 8 ARGB (32 bytes). |
2845 __declspec(naked) | 2852 __declspec(naked) |
(...skipping 3397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6243 } | 6250 } |
6244 #endif // HAS_ARGBLUMACOLORTABLEROW_SSSE3 | 6251 #endif // HAS_ARGBLUMACOLORTABLEROW_SSSE3 |
6245 | 6252 |
6246 #endif // defined(_M_X64) | 6253 #endif // defined(_M_X64) |
6247 #endif // !defined(LIBYUV_DISABLE_X86) && (defined(_M_IX86) || defined(_M_X64)) | 6254 #endif // !defined(LIBYUV_DISABLE_X86) && (defined(_M_IX86) || defined(_M_X64)) |
6248 | 6255 |
6249 #ifdef __cplusplus | 6256 #ifdef __cplusplus |
6250 } // extern "C" | 6257 } // extern "C" |
6251 } // namespace libyuv | 6258 } // namespace libyuv |
6252 #endif | 6259 #endif |
OLD | NEW |