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 1630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1641 lea edx, [edx + 16] | 1641 lea edx, [edx + 16] |
1642 sub ecx, 16 | 1642 sub ecx, 16 |
1643 jg convertloop | 1643 jg convertloop |
1644 | 1644 |
1645 pop edi | 1645 pop edi |
1646 ret | 1646 ret |
1647 } | 1647 } |
1648 } | 1648 } |
1649 | 1649 |
1650 __declspec(naked) | 1650 __declspec(naked) |
1651 void ARGBToUV422Row_SSSE3(const uint8* src_argb0, | |
1652 uint8* dst_u, uint8* dst_v, int width) { | |
1653 __asm { | |
1654 push edi | |
1655 mov eax, [esp + 4 + 4] // src_argb | |
1656 mov edx, [esp + 4 + 8] // dst_u | |
1657 mov edi, [esp + 4 + 12] // dst_v | |
1658 mov ecx, [esp + 4 + 16] // width | |
1659 movdqa xmm5, xmmword ptr kAddUV128 | |
1660 movdqa xmm6, xmmword ptr kARGBToV | |
1661 movdqa xmm7, xmmword ptr kARGBToU | |
1662 sub edi, edx // stride from u to v | |
1663 | |
1664 convertloop: | |
1665 /* step 1 - subsample 16x2 argb pixels to 8x1 */ | |
1666 movdqu xmm0, [eax] | |
1667 movdqu xmm1, [eax + 16] | |
1668 movdqu xmm2, [eax + 32] | |
1669 movdqu xmm3, [eax + 48] | |
1670 lea eax, [eax + 64] | |
1671 movdqa xmm4, xmm0 | |
1672 shufps xmm0, xmm1, 0x88 | |
1673 shufps xmm4, xmm1, 0xdd | |
1674 pavgb xmm0, xmm4 | |
1675 movdqa xmm4, xmm2 | |
1676 shufps xmm2, xmm3, 0x88 | |
1677 shufps xmm4, xmm3, 0xdd | |
1678 pavgb xmm2, xmm4 | |
1679 | |
1680 // step 2 - convert to U and V | |
1681 // from here down is very similar to Y code except | |
1682 // instead of 16 different pixels, its 8 pixels of U and 8 of V | |
1683 movdqa xmm1, xmm0 | |
1684 movdqa xmm3, xmm2 | |
1685 pmaddubsw xmm0, xmm7 // U | |
1686 pmaddubsw xmm2, xmm7 | |
1687 pmaddubsw xmm1, xmm6 // V | |
1688 pmaddubsw xmm3, xmm6 | |
1689 phaddw xmm0, xmm2 | |
1690 phaddw xmm1, xmm3 | |
1691 psraw xmm0, 8 | |
1692 psraw xmm1, 8 | |
1693 packsswb xmm0, xmm1 | |
1694 paddb xmm0, xmm5 // -> unsigned | |
1695 | |
1696 // step 3 - store 8 U and 8 V values | |
1697 movlps qword ptr [edx], xmm0 // U | |
1698 movhps qword ptr [edx + edi], xmm0 // V | |
1699 lea edx, [edx + 8] | |
1700 sub ecx, 16 | |
1701 jg convertloop | |
1702 | |
1703 pop edi | |
1704 ret | |
1705 } | |
1706 } | |
1707 | |
1708 __declspec(naked) | |
1709 void BGRAToUVRow_SSSE3(const uint8* src_argb0, int src_stride_argb, | 1651 void BGRAToUVRow_SSSE3(const uint8* src_argb0, int src_stride_argb, |
1710 uint8* dst_u, uint8* dst_v, int width) { | 1652 uint8* dst_u, uint8* dst_v, int width) { |
1711 __asm { | 1653 __asm { |
1712 push esi | 1654 push esi |
1713 push edi | 1655 push edi |
1714 mov eax, [esp + 8 + 4] // src_argb | 1656 mov eax, [esp + 8 + 4] // src_argb |
1715 mov esi, [esp + 8 + 8] // src_stride_argb | 1657 mov esi, [esp + 8 + 8] // src_stride_argb |
1716 mov edx, [esp + 8 + 12] // dst_u | 1658 mov edx, [esp + 8 + 12] // dst_u |
1717 mov edi, [esp + 8 + 16] // dst_v | 1659 mov edi, [esp + 8 + 16] // dst_v |
1718 mov ecx, [esp + 8 + 20] // width | 1660 mov ecx, [esp + 8 + 20] // width |
(...skipping 4504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6223 } | 6165 } |
6224 #endif // HAS_ARGBLUMACOLORTABLEROW_SSSE3 | 6166 #endif // HAS_ARGBLUMACOLORTABLEROW_SSSE3 |
6225 | 6167 |
6226 #endif // defined(_M_X64) | 6168 #endif // defined(_M_X64) |
6227 #endif // !defined(LIBYUV_DISABLE_X86) && (defined(_M_IX86) || defined(_M_X64)) | 6169 #endif // !defined(LIBYUV_DISABLE_X86) && (defined(_M_IX86) || defined(_M_X64)) |
6228 | 6170 |
6229 #ifdef __cplusplus | 6171 #ifdef __cplusplus |
6230 } // extern "C" | 6172 } // extern "C" |
6231 } // namespace libyuv | 6173 } // namespace libyuv |
6232 #endif | 6174 #endif |
OLD | NEW |