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 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
826 por xmm2, xmm3 // 12 bytes from 3 for 2 | 826 por xmm2, xmm3 // 12 bytes from 3 for 2 |
827 movdqu [edx + 16], xmm1 // store 1 | 827 movdqu [edx + 16], xmm1 // store 1 |
828 movdqu [edx + 32], xmm2 // store 2 | 828 movdqu [edx + 32], xmm2 // store 2 |
829 lea edx, [edx + 48] | 829 lea edx, [edx + 48] |
830 sub ecx, 16 | 830 sub ecx, 16 |
831 jg convertloop | 831 jg convertloop |
832 ret | 832 ret |
833 } | 833 } |
834 } | 834 } |
835 | 835 |
836 // 4 pixels | |
837 __declspec(naked) | 836 __declspec(naked) |
838 void ARGBToRGB565Row_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix) { | 837 void ARGBToRGB565Row_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix) { |
839 __asm { | 838 __asm { |
840 mov eax, [esp + 4] // src_argb | 839 mov eax, [esp + 4] // src_argb |
841 mov edx, [esp + 8] // dst_rgb | 840 mov edx, [esp + 8] // dst_rgb |
842 mov ecx, [esp + 12] // pix | 841 mov ecx, [esp + 12] // pix |
843 pcmpeqb xmm3, xmm3 // generate mask 0x0000001f | 842 pcmpeqb xmm3, xmm3 // generate mask 0x0000001f |
844 psrld xmm3, 27 | 843 psrld xmm3, 27 |
845 pcmpeqb xmm4, xmm4 // generate mask 0x000007e0 | 844 pcmpeqb xmm4, xmm4 // generate mask 0x000007e0 |
846 psrld xmm4, 26 | 845 psrld xmm4, 26 |
(...skipping 17 matching lines...) Expand all Loading... |
864 packssdw xmm0, xmm0 | 863 packssdw xmm0, xmm0 |
865 lea eax, [eax + 16] | 864 lea eax, [eax + 16] |
866 movq qword ptr [edx], xmm0 // store 4 pixels of RGB565 | 865 movq qword ptr [edx], xmm0 // store 4 pixels of RGB565 |
867 lea edx, [edx + 8] | 866 lea edx, [edx + 8] |
868 sub ecx, 4 | 867 sub ecx, 4 |
869 jg convertloop | 868 jg convertloop |
870 ret | 869 ret |
871 } | 870 } |
872 } | 871 } |
873 | 872 |
874 // 8 pixels | |
875 __declspec(naked) | 873 __declspec(naked) |
876 void ARGBToRGB565DitherRow_SSE2(const uint8* src_argb, uint8* dst_rgb, | 874 void ARGBToRGB565DitherRow_SSE2(const uint8* src_argb, uint8* dst_rgb, |
877 const uint32 dither4, int pix) { | 875 const uint32 dither4, int pix) { |
878 __asm { | 876 __asm { |
879 | 877 |
880 mov eax, [esp + 4] // src_argb | 878 mov eax, [esp + 4] // src_argb |
881 mov edx, [esp + 8] // dst_rgb | 879 mov edx, [esp + 8] // dst_rgb |
882 movd xmm6, [esp + 12] // dither4 | 880 movd xmm6, [esp + 12] // dither4 |
883 mov ecx, [esp + 16] // pix | 881 mov ecx, [esp + 16] // pix |
884 punpcklbw xmm6, xmm6 // make dither 16 bytes | 882 punpcklbw xmm6, xmm6 // make dither 16 bytes |
(...skipping 5753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6638 } | 6636 } |
6639 #endif // HAS_ARGBLUMACOLORTABLEROW_SSSE3 | 6637 #endif // HAS_ARGBLUMACOLORTABLEROW_SSSE3 |
6640 | 6638 |
6641 #endif // defined(_M_X64) | 6639 #endif // defined(_M_X64) |
6642 #endif // !defined(LIBYUV_DISABLE_X86) && (defined(_M_IX86) || defined(_M_X64)) | 6640 #endif // !defined(LIBYUV_DISABLE_X86) && (defined(_M_IX86) || defined(_M_X64)) |
6643 | 6641 |
6644 #ifdef __cplusplus | 6642 #ifdef __cplusplus |
6645 } // extern "C" | 6643 } // extern "C" |
6646 } // namespace libyuv | 6644 } // namespace libyuv |
6647 #endif | 6645 #endif |
OLD | NEW |