mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2026-01-01 03:12:16 +08:00
Port ARGBMirror AVX2 code to gcc/NaCL.
BUG=269 TESTED=try bots R=harryjin@google.com Review URL: https://webrtc-codereview.appspot.com/24329004 git-svn-id: http://libyuv.googlecode.com/svn/trunk@1173 16f28f9a-4ce2-e073-06de-1de4eb20be90
This commit is contained in:
parent
9dd083a512
commit
db7a7f61ff
@ -1,6 +1,6 @@
|
||||
Name: libyuv
|
||||
URL: http://code.google.com/p/libyuv/
|
||||
Version: 1171
|
||||
Version: 1172
|
||||
License: BSD
|
||||
License File: LICENSE
|
||||
|
||||
|
||||
@ -200,6 +200,7 @@ extern "C" {
|
||||
#define HAS_SPLITUVROW_AVX2
|
||||
#define HAS_MERGEUVROW_AVX2
|
||||
#define HAS_MIRRORROW_AVX2
|
||||
#define HAS_ARGBMIRRORROW_AVX2
|
||||
|
||||
// Effects:
|
||||
#define HAS_ARGBADDROW_AVX2
|
||||
@ -212,7 +213,6 @@ extern "C" {
|
||||
// The following are require VS2012.
|
||||
// TODO(fbarchard): Port to gcc.
|
||||
#if !defined(LIBYUV_DISABLE_X86) && defined(VISUALC_HAS_AVX2)
|
||||
#define HAS_ARGBMIRRORROW_AVX2
|
||||
#define HAS_ARGBTOUVROW_AVX2
|
||||
#define HAS_ARGBTOYJROW_AVX2
|
||||
#define HAS_ARGBTOYROW_AVX2
|
||||
|
||||
@ -11,6 +11,6 @@
|
||||
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
|
||||
#define INCLUDE_LIBYUV_VERSION_H_
|
||||
|
||||
#define LIBYUV_VERSION 1171
|
||||
#define LIBYUV_VERSION 1172
|
||||
|
||||
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
|
||||
|
||||
@ -2339,6 +2339,38 @@ void ARGBMirrorRow_SSSE3(const uint8* src, uint8* dst, int width) {
|
||||
}
|
||||
#endif // HAS_ARGBMIRRORROW_SSSE3
|
||||
|
||||
#ifdef HAS_ARGBMIRRORROW_AVX2
|
||||
// Shuffle table for reversing the bytes.
|
||||
static const ulvec32 kARGBShuffleMirror_AVX2 = {
|
||||
7u, 6u, 5u, 4u, 3u, 2u, 1u, 0u
|
||||
};
|
||||
void ARGBMirrorRow_AVX2(const uint8* src, uint8* dst, int width) {
|
||||
intptr_t temp_width = (intptr_t)(width);
|
||||
asm volatile (
|
||||
"vmovdqa %3,%%ymm5 \n"
|
||||
LABELALIGN
|
||||
"1: \n"
|
||||
VMEMOPREG(vpermd,-0x20,0,2,4,ymm5,ymm0) // vpermd -0x20(%0,%2,4),ymm5,ymm0
|
||||
"sub $0x20,%2 \n"
|
||||
"vmovdqu %%ymm0," MEMACCESS(1) " \n"
|
||||
"lea " MEMLEA(0x20,1) ",%1 \n"
|
||||
"jg 1b \n"
|
||||
"vzeroupper \n"
|
||||
: "+r"(src), // %0
|
||||
"+r"(dst), // %1
|
||||
"+r"(temp_width) // %2
|
||||
: "m"(kARGBShuffleMirror_AVX2) // %3
|
||||
: "memory", "cc"
|
||||
#if defined(__native_client__) && defined(__x86_64__)
|
||||
, "r14"
|
||||
#endif
|
||||
#if defined(__SSE2__)
|
||||
, "xmm0", "xmm5"
|
||||
#endif
|
||||
);
|
||||
}
|
||||
#endif // HAS_ARGBMIRRORROW_AVX2
|
||||
|
||||
#ifdef HAS_SPLITUVROW_AVX2
|
||||
void SplitUVRow_AVX2(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int pix) {
|
||||
asm volatile (
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user