mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2025-12-06 16:56:55 +08:00
Unaligned version of ABGRToARGB for SSSE3
BUG=196 TESTED=libyuv_unittest --gtest_filter=*ABGRToARGB* Review URL: https://webrtc-codereview.appspot.com/1166006 git-svn-id: http://libyuv.googlecode.com/svn/trunk@595 16f28f9a-4ce2-e073-06de-1de4eb20be90
This commit is contained in:
parent
51398e0be5
commit
304a611d80
@ -1,6 +1,6 @@
|
||||
Name: libyuv
|
||||
URL: http://code.google.com/p/libyuv/
|
||||
Version: 594
|
||||
Version: 595
|
||||
License: BSD
|
||||
License File: LICENSE
|
||||
|
||||
|
||||
@ -635,6 +635,8 @@ void ARGBSetRows_C(uint8* dst, uint32 v32, int width, int dst_stride,
|
||||
|
||||
void BGRAToARGBRow_SSSE3(const uint8* src_bgra, uint8* dst_argb, int pix);
|
||||
void ABGRToARGBRow_SSSE3(const uint8* src_abgr, uint8* dst_argb, int pix);
|
||||
void ABGRToARGBRow_Unaligned_SSSE3(const uint8* src_abgr, uint8* dst_argb,
|
||||
int pix);
|
||||
void RGBAToARGBRow_SSSE3(const uint8* src_rgba, uint8* dst_argb, int pix);
|
||||
void RGB24ToARGBRow_SSSE3(const uint8* src_rgb24, uint8* dst_argb, int pix);
|
||||
void RAWToARGBRow_SSSE3(const uint8* src_raw, uint8* dst_argb, int pix);
|
||||
|
||||
@ -11,6 +11,6 @@
|
||||
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
|
||||
#define INCLUDE_LIBYUV_VERSION_H_
|
||||
|
||||
#define LIBYUV_VERSION 594
|
||||
#define LIBYUV_VERSION 595
|
||||
|
||||
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
|
||||
|
||||
@ -350,9 +350,13 @@ int ABGRToARGB(const uint8* src_abgr, int src_stride_abgr,
|
||||
void (*ABGRToARGBRow)(const uint8* src_abgr, uint8* dst_argb, int pix) =
|
||||
ABGRToARGBRow_C;
|
||||
#if defined(HAS_ABGRTOARGBROW_SSSE3)
|
||||
if (TestCpuFlag(kCpuHasSSSE3) && IS_ALIGNED(width, 4) &&
|
||||
IS_ALIGNED(src_abgr, 16) && IS_ALIGNED(src_stride_abgr, 16) &&
|
||||
IS_ALIGNED(dst_argb, 16) && IS_ALIGNED(dst_stride_argb, 16)) {
|
||||
if (TestCpuFlag(kCpuHasSSSE3) && IS_ALIGNED(width, 4)) {
|
||||
// TODO(fbarchard): Port to posix.
|
||||
#if defined(_M_IX86)
|
||||
ABGRToARGBRow = ABGRToARGBRow_Unaligned_SSSE3;
|
||||
#endif
|
||||
if (IS_ALIGNED(src_abgr, 16) && IS_ALIGNED(src_stride_abgr, 16) &&
|
||||
IS_ALIGNED(dst_argb, 16) && IS_ALIGNED(dst_stride_argb, 16))
|
||||
ABGRToARGBRow = ABGRToARGBRow_SSSE3;
|
||||
}
|
||||
#elif defined(HAS_ABGRTOARGBROW_NEON)
|
||||
|
||||
@ -251,6 +251,28 @@ void BGRAToARGBRow_SSSE3(const uint8* src_bgra, uint8* dst_argb, int pix) {
|
||||
}
|
||||
}
|
||||
|
||||
__declspec(naked) __declspec(align(16))
|
||||
void ABGRToARGBRow_Unaligned_SSSE3(const uint8* src_abgr, uint8* dst_argb,
|
||||
int pix) {
|
||||
__asm {
|
||||
mov eax, [esp + 4] // src_abgr
|
||||
mov edx, [esp + 8] // dst_argb
|
||||
mov ecx, [esp + 12] // pix
|
||||
movdqa xmm5, kShuffleMaskABGRToARGB
|
||||
sub edx, eax
|
||||
|
||||
align 16
|
||||
convertloop:
|
||||
movdqu xmm0, [eax]
|
||||
pshufb xmm0, xmm5
|
||||
sub ecx, 4
|
||||
movdqu [eax + edx], xmm0
|
||||
lea eax, [eax + 16]
|
||||
jg convertloop
|
||||
ret
|
||||
}
|
||||
}
|
||||
|
||||
__declspec(naked) __declspec(align(16))
|
||||
void ABGRToARGBRow_SSSE3(const uint8* src_abgr, uint8* dst_argb, int pix) {
|
||||
__asm {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user