mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2025-12-07 17:26:49 +08:00
fix for yuv to rgb on arm64.
fill in aarch64 yuv constants to match how the code expects them. TBR=harryjin@google.com BUG=libyuv:502 Review URL: https://codereview.chromium.org/1396253004 .
This commit is contained in:
parent
2e4466e282
commit
4abd096548
@ -1,6 +1,6 @@
|
||||
Name: libyuv
|
||||
URL: http://code.google.com/p/libyuv/
|
||||
Version: 1506
|
||||
Version: 1507
|
||||
License: BSD
|
||||
License File: LICENSE
|
||||
|
||||
|
||||
@ -417,18 +417,25 @@ typedef uint32 ulvec32[8];
|
||||
typedef uint8 ulvec8[32];
|
||||
#endif
|
||||
|
||||
#if defined(__arm__) || defined(__aarch64__)
|
||||
|
||||
// This struct is for Arm color conversion.
|
||||
#if defined(__aarch64__)
|
||||
// This struct is for Arm64 color conversion.
|
||||
struct YuvConstants {
|
||||
uvec16 kUVToRB;
|
||||
uvec16 kUVToRB2;
|
||||
uvec16 kUVToG;
|
||||
uvec16 kUVToG2;
|
||||
vec16 kUVBiasBGR;
|
||||
vec32 kYToRgb;
|
||||
};
|
||||
#elif defined(__arm__)
|
||||
// This struct is for ArmV7 color conversion.
|
||||
struct YuvConstants {
|
||||
uvec8 kUVToRB;
|
||||
uvec8 kUVToG;
|
||||
vec16 kUVBiasBGR;
|
||||
vec32 kYToRgb;
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
// This struct is for Intel color conversion.
|
||||
struct YuvConstants {
|
||||
lvec8 kUVToB;
|
||||
|
||||
@ -11,6 +11,6 @@
|
||||
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
|
||||
#define INCLUDE_LIBYUV_VERSION_H_
|
||||
|
||||
#define LIBYUV_VERSION 1506
|
||||
#define LIBYUV_VERSION 1507
|
||||
|
||||
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
|
||||
|
||||
@ -1017,13 +1017,17 @@ void J400ToARGBRow_C(const uint8* src_y, uint8* dst_argb, int width) {
|
||||
// BT.601 constants for YUV to RGB.
|
||||
// TODO(fbarchard): Unify these structures to be platform independent.
|
||||
// TODO(fbarchard): Generate SIMD structures from float matrix.
|
||||
|
||||
// BT601 constants for YUV to RGB.
|
||||
#if defined(__aarch64__)
|
||||
const YuvConstants SIMD_ALIGNED(kYuvIConstants) = {
|
||||
{ -UB, 0, -UB, 0, -UB, 0, -UB, 0, -VR, 0, -VR, 0, -VR, 0, -VR, 0 },
|
||||
{ UG, 0, UG, 0, UG, 0, UG, 0, VG, 0, VG, 0, VG, 0, VG, 0 },
|
||||
{ -UB, -VR, -UB, -VR, -UB, -VR, -UB, -VR },
|
||||
{ -UB, -VR, -UB, -VR, -UB, -VR, -UB, -VR },
|
||||
{ UG, VG, UG, VG, UG, VG, UG, VG },
|
||||
{ UG, VG, UG, VG, UG, VG, UG, VG },
|
||||
{ BB, BG, BR, 0, 0, 0, 0, 0 },
|
||||
{ 0x0101 * YG, 0, 0, 0 }
|
||||
};
|
||||
};
|
||||
|
||||
#elif defined(__arm__)
|
||||
const YuvConstants SIMD_ALIGNED(kYuvIConstants) = {
|
||||
@ -1072,8 +1076,8 @@ static __inline void YuvPixel(uint8 y, uint8 u, uint8 v,
|
||||
#if defined(__aarch64__)
|
||||
int UB = -yuvconstants->kUVToRB[0];
|
||||
int UG = yuvconstants->kUVToG[0];
|
||||
int VG = yuvconstants->kUVToG[8];
|
||||
int VR = -yuvconstants->kUVToRB[8];
|
||||
int VG = yuvconstants->kUVToG[1];
|
||||
int VR = -yuvconstants->kUVToRB[1];
|
||||
int BB = yuvconstants->kUVBiasBGR[0];
|
||||
int BG = yuvconstants->kUVBiasBGR[1];
|
||||
int BR = yuvconstants->kUVBiasBGR[2];
|
||||
@ -1126,11 +1130,13 @@ static __inline void YuvPixel(uint8 y, uint8 u, uint8 v,
|
||||
// JPEG constants for YUV to RGB.
|
||||
#if defined(__aarch64__)
|
||||
const YuvConstants SIMD_ALIGNED(kYuvJConstants) = {
|
||||
{ -UBJ, 0, -UBJ, 0, -UBJ, 0, -UBJ, 0, -VRJ, 0, -VRJ, 0, -VRJ, 0, -VRJ, 0 },
|
||||
{ UGJ, 0, UGJ, 0, UGJ, 0, UGJ, 0, VGJ, 0, VGJ, 0, VGJ, 0, VGJ, 0 },
|
||||
{ -UBJ, -VRJ, -UBJ, -VRJ, -UBJ, -VRJ, -UBJ, -VRJ },
|
||||
{ -UBJ, -VRJ, -UBJ, -VRJ, -UBJ, -VRJ, -UBJ, -VRJ },
|
||||
{ UGJ, VGJ, UGJ, VGJ, UGJ, VGJ, UGJ, VGJ },
|
||||
{ UGJ, VGJ, UGJ, VGJ, UGJ, VGJ, UGJ, VGJ },
|
||||
{ BBJ, BGJ, BRJ, 0, 0, 0, 0, 0 },
|
||||
{ 0x0101 * YGJ, 0, 0, 0 }
|
||||
};
|
||||
};
|
||||
|
||||
#elif defined(__arm__)
|
||||
const YuvConstants SIMD_ALIGNED(kYuvJConstants) = {
|
||||
@ -1194,11 +1200,13 @@ const YuvConstants SIMD_ALIGNED(kYuvJConstants) = {
|
||||
// BT.709 constants for YUV to RGB.
|
||||
#if defined(__aarch64__)
|
||||
const YuvConstants SIMD_ALIGNED(kYuvHConstants) = {
|
||||
{ -UBH, 0, -UBH, 0, -UBH, 0, -UBH, 0, -VRH, 0, -VRH, 0, -VRH, 0, -VRH, 0 },
|
||||
{ UGH, 0, UGH, 0, UGH, 0, UGH, 0, VGH, 0, VGH, 0, VGH, 0, VGH, 0 },
|
||||
{ -UBH, -VRH, -UBH, -VRH, -UBH, -VRH, -UBH, -VRH },
|
||||
{ -UBH, -VRH, -UBH, -VRH, -UBH, -VRH, -UBH, -VRH },
|
||||
{ UGH, VGH, UGH, VGH, UGH, VGH, UGH, VGH },
|
||||
{ UGH, VGH, UGH, VGH, UGH, VGH, UGH, VGH },
|
||||
{ BBH, BGH, BRH, 0, 0, 0, 0, 0 },
|
||||
{ 0x0101 * YGH, 0, 0, 0 }
|
||||
};
|
||||
};
|
||||
|
||||
#elif defined(__arm__)
|
||||
const YuvConstants SIMD_ALIGNED(kYuvHConstants) = {
|
||||
|
||||
@ -96,8 +96,8 @@ extern "C" {
|
||||
"ld1r {v25.8h}, [%[kUVBiasBGR]], #2 \n" \
|
||||
"ld1r {v26.8h}, [%[kUVBiasBGR]] \n" \
|
||||
"ld1r {v31.4s}, [%[kYToRgb]] \n" \
|
||||
"ld1 {v27.8h, v28.8h}, [%[kUVToRB]] \n" \
|
||||
"ld1 {v29.8h, v30.8h}, [%[kUVToG]] \n"
|
||||
"ld2 {v27.8h, v28.8h}, [%[kUVToRB]] \n" \
|
||||
"ld2 {v29.8h, v30.8h}, [%[kUVToG]] \n"
|
||||
|
||||
#define YUVTORGB(vR, vG, vB) \
|
||||
"uxtl v0.8h, v0.8b \n" /* Extract Y */ \
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user