mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2025-12-06 16:56:55 +08:00
Attribute aligned 32 for YUV conversion structure on Intel
Fix for unaligned memory exception. R=braveyao@chromium.org BUG=libyuv:616 Review URL: https://codereview.chromium.org/2152553002 .
This commit is contained in:
parent
a7a6d8cc2e
commit
1aa4ddd21c
@ -1,6 +1,6 @@
|
||||
Name: libyuv
|
||||
URL: http://code.google.com/p/libyuv/
|
||||
Version: 1606
|
||||
Version: 1607
|
||||
License: BSD
|
||||
License File: LICENSE
|
||||
|
||||
|
||||
@ -374,7 +374,7 @@ extern "C" {
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__CLR_VER) && !defined(__clang__)
|
||||
#define SIMD_ALIGNED(var) __declspec(align(16)) var
|
||||
#define SIMD_ALIGNED32(var) __declspec(align(64)) var
|
||||
#define SIMD_ALIGNED32(var) __declspec(align(32)) var
|
||||
typedef __declspec(align(16)) int16 vec16[8];
|
||||
typedef __declspec(align(16)) int32 vec32[4];
|
||||
typedef __declspec(align(16)) int8 vec8[16];
|
||||
@ -390,7 +390,7 @@ typedef __declspec(align(32)) uint8 ulvec8[32];
|
||||
#elif !defined(__pnacl__) && (defined(__GNUC__) || defined(__clang__))
|
||||
// Caveat GCC 4.2 to 4.7 have a known issue using vectors with const.
|
||||
#define SIMD_ALIGNED(var) var __attribute__((aligned(16)))
|
||||
#define SIMD_ALIGNED32(var) var __attribute__((aligned(64)))
|
||||
#define SIMD_ALIGNED32(var) var __attribute__((aligned(32)))
|
||||
typedef int16 __attribute__((vector_size(16))) vec16;
|
||||
typedef int32 __attribute__((vector_size(16))) vec32;
|
||||
typedef int8 __attribute__((vector_size(16))) vec8;
|
||||
@ -422,7 +422,7 @@ typedef uint8 ulvec8[32];
|
||||
|
||||
#if defined(__aarch64__)
|
||||
// This struct is for Arm64 color conversion.
|
||||
struct YuvConstants {
|
||||
struct uvConstants {
|
||||
uvec16 kUVToRB;
|
||||
uvec16 kUVToRB2;
|
||||
uvec16 kUVToG;
|
||||
|
||||
@ -11,6 +11,6 @@
|
||||
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
|
||||
#define INCLUDE_LIBYUV_VERSION_H_
|
||||
|
||||
#define LIBYUV_VERSION 1606
|
||||
#define LIBYUV_VERSION 1607
|
||||
|
||||
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
|
||||
|
||||
@ -1019,7 +1019,7 @@ const YuvConstants SIMD_ALIGNED(kYvuI601Constants) = {
|
||||
{ 0x0101 * YG, 0, 0, 0 }
|
||||
};
|
||||
#else
|
||||
const YuvConstants SIMD_ALIGNED(kYuvI601Constants) = {
|
||||
const YuvConstants SIMD_ALIGNED32(kYuvI601Constants) = {
|
||||
{ UB, 0, UB, 0, UB, 0, UB, 0, UB, 0, UB, 0, UB, 0, UB, 0,
|
||||
UB, 0, UB, 0, UB, 0, UB, 0, UB, 0, UB, 0, UB, 0, UB, 0 },
|
||||
{ UG, VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, VG,
|
||||
@ -1031,7 +1031,7 @@ const YuvConstants SIMD_ALIGNED(kYuvI601Constants) = {
|
||||
{ BR, BR, BR, BR, BR, BR, BR, BR, BR, BR, BR, BR, BR, BR, BR, BR },
|
||||
{ YG, YG, YG, YG, YG, YG, YG, YG, YG, YG, YG, YG, YG, YG, YG, YG }
|
||||
};
|
||||
const YuvConstants SIMD_ALIGNED(kYvuI601Constants) = {
|
||||
const YuvConstants SIMD_ALIGNED32(kYvuI601Constants) = {
|
||||
{ VR, 0, VR, 0, VR, 0, VR, 0, VR, 0, VR, 0, VR, 0, VR, 0,
|
||||
VR, 0, VR, 0, VR, 0, VR, 0, VR, 0, VR, 0, VR, 0, VR, 0 },
|
||||
{ VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, VG, UG,
|
||||
@ -1106,7 +1106,7 @@ const YuvConstants SIMD_ALIGNED(kYvuJPEGConstants) = {
|
||||
{ 0x0101 * YG, 0, 0, 0 }
|
||||
};
|
||||
#else
|
||||
const YuvConstants SIMD_ALIGNED(kYuvJPEGConstants) = {
|
||||
const YuvConstants SIMD_ALIGNED32(kYuvJPEGConstants) = {
|
||||
{ UB, 0, UB, 0, UB, 0, UB, 0, UB, 0, UB, 0, UB, 0, UB, 0,
|
||||
UB, 0, UB, 0, UB, 0, UB, 0, UB, 0, UB, 0, UB, 0, UB, 0 },
|
||||
{ UG, VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, VG,
|
||||
@ -1118,7 +1118,7 @@ const YuvConstants SIMD_ALIGNED(kYuvJPEGConstants) = {
|
||||
{ BR, BR, BR, BR, BR, BR, BR, BR, BR, BR, BR, BR, BR, BR, BR, BR },
|
||||
{ YG, YG, YG, YG, YG, YG, YG, YG, YG, YG, YG, YG, YG, YG, YG, YG }
|
||||
};
|
||||
const YuvConstants SIMD_ALIGNED(kYvuJPEGConstants) = {
|
||||
const YuvConstants SIMD_ALIGNED32(kYvuJPEGConstants) = {
|
||||
{ VR, 0, VR, 0, VR, 0, VR, 0, VR, 0, VR, 0, VR, 0, VR, 0,
|
||||
VR, 0, VR, 0, VR, 0, VR, 0, VR, 0, VR, 0, VR, 0, VR, 0 },
|
||||
{ VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, VG, UG,
|
||||
@ -1194,7 +1194,7 @@ const YuvConstants SIMD_ALIGNED(kYvuH709Constants) = {
|
||||
{ 0x0101 * YG, 0, 0, 0 }
|
||||
};
|
||||
#else
|
||||
const YuvConstants SIMD_ALIGNED(kYuvH709Constants) = {
|
||||
const YuvConstants SIMD_ALIGNED32(kYuvH709Constants) = {
|
||||
{ UB, 0, UB, 0, UB, 0, UB, 0, UB, 0, UB, 0, UB, 0, UB, 0,
|
||||
UB, 0, UB, 0, UB, 0, UB, 0, UB, 0, UB, 0, UB, 0, UB, 0 },
|
||||
{ UG, VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, VG,
|
||||
@ -1206,7 +1206,7 @@ const YuvConstants SIMD_ALIGNED(kYuvH709Constants) = {
|
||||
{ BR, BR, BR, BR, BR, BR, BR, BR, BR, BR, BR, BR, BR, BR, BR, BR },
|
||||
{ YG, YG, YG, YG, YG, YG, YG, YG, YG, YG, YG, YG, YG, YG, YG, YG }
|
||||
};
|
||||
const YuvConstants SIMD_ALIGNED(kYvuH709Constants) = {
|
||||
const YuvConstants SIMD_ALIGNED32(kYvuH709Constants) = {
|
||||
{ VR, 0, VR, 0, VR, 0, VR, 0, VR, 0, VR, 0, VR, 0, VR, 0,
|
||||
VR, 0, VR, 0, VR, 0, VR, 0, VR, 0, VR, 0, VR, 0, VR, 0 },
|
||||
{ VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, VG, UG,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user