Commit 6a6b67e7 authored by Frank Barchard's avatar Frank Barchard

Add H422ToARGB armv7 neon version.

Patch provided by zhongwei.yao@linaro.org

R=fbarchard@chromium.org, fbarchard@google.com
BUG=libyuv:488

Review URL: https://codereview.chromium.org/1344393002 .
parent ef09d53f
......@@ -303,10 +303,11 @@ extern "C" {
#define HAS_I422TOARGB1555ROW_NEON
#define HAS_I422TOARGB4444ROW_NEON
#define HAS_I422TOARGBROW_NEON
// TODO(fbarchard): Implement NEON version
// TODO(fbarchard): Implement aarch64 neon version
#ifndef __aarch64__
#define HAS_I422TOARGBMATRIXROW_NEON
#define HAS_J422TOARGBROW_NEON
#define HAS_H422TOARGBROW_NEON
#endif
// #define HAS_I422TOABGRMATRIXROW_NEON
#define HAS_I422TOBGRAROW_NEON
......@@ -609,6 +610,11 @@ void J422ToARGBRow_NEON(const uint8* src_y,
const uint8* src_v,
uint8* dst_argb,
int width);
void H422ToARGBRow_NEON(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
uint8* dst_argb,
int width);
void NV12ToARGBRow_NEON(const uint8* src_y,
const uint8* src_uv,
uint8* dst_argb,
......@@ -1680,6 +1686,11 @@ void J422ToARGBRow_Any_NEON(const uint8* src_y,
const uint8* src_v,
uint8* dst_argb,
int width);
void H422ToARGBRow_Any_NEON(const uint8* src_y,
const uint8* src_u,
const uint8* src_v,
uint8* dst_argb,
int width);
void NV12ToARGBRow_Any_NEON(const uint8* src_y,
const uint8* src_uv,
uint8* dst_argb,
......
......@@ -120,6 +120,7 @@ ANY31(I422ToARGB4444Row_Any_NEON, I422ToARGB4444Row_NEON, 1, 0, 2, 7)
ANY31(I422ToARGB1555Row_Any_NEON, I422ToARGB1555Row_NEON, 1, 0, 2, 7)
ANY31(I422ToRGB565Row_Any_NEON, I422ToRGB565Row_NEON, 1, 0, 2, 7)
ANY31(J422ToARGBRow_Any_NEON, J422ToARGBRow_NEON, 1, 0, 4, 7)
ANY31(H422ToARGBRow_Any_NEON, H422ToARGBRow_NEON, 1, 0, 4, 7)
#endif
#ifdef HAS_I422TOYUY2ROW_NEON
ANY31(I422ToYUY2Row_Any_NEON, I422ToYUY2Row_NEON, 1, 1, 4, 15)
......
......@@ -2278,6 +2278,7 @@ extern struct YuvConstants kYuvJConstants;
extern struct YuvConstants kYuvHConstants;
extern struct YuvConstantsNEON kYuvConstantsNEON;
extern struct YuvConstantsNEON kYuvJConstantsNEON;
extern struct YuvConstantsNEON kYuvHConstantsNEON;
#define ANYYUV(NAMEANY, ANY_SIMD, YUVCONSTANTS) \
void NAMEANY(const uint8* y_buf, \
......@@ -2291,7 +2292,7 @@ extern struct YuvConstantsNEON kYuvJConstantsNEON;
#ifdef HAS_I422TOARGBMATRIXROW_NEON
ANYYUV(I422ToARGBRow_NEON, I422ToARGBMatrixRow_NEON, kYuvConstantsNEON)
ANYYUV(J422ToARGBRow_NEON, I422ToARGBMatrixRow_NEON, kYuvJConstantsNEON)
//ANYYUV(H422ToARGBRow_NEON, I422ToARGBMatrixRow_NEON, kYuvHConstantsNEON)
ANYYUV(H422ToARGBRow_NEON, I422ToARGBMatrixRow_NEON, kYuvHConstantsNEON)
#endif
#ifdef HAS_I422TOARGBMATRIXROW_SSSE3
......
......@@ -211,6 +211,44 @@ YuvConstantsNEON SIMD_ALIGNED(kYuvJConstantsNEON) = {
#undef BGJ
#undef BRJ
// BT.709 YUV to RGB reference
// * R = Y - V * -1.28033
// * G = Y - U * 0.21482 - V * 0.38059
// * B = Y - U * -2.12798
// Y contribution to R,G,B. Scale and bias.
// TODO(fbarchard): Consider moving constants into a common header.
#define YGH 16320 /* round(1.000 * 64 * 256 * 256 / 257) */
#define YGBH 32 /* 64 / 2 */
// U and V contributions to R,G,B.
#define UBH -128 /* max(-128, round(-2.12798 * 64)) */
#define UGH 14 /* round(0.21482 * 64) */
#define VGH 24 /* round(0.38059 * 64) */
#define VRH -82 /* round(-1.28033 * 64) */
// Bias values to round, and subtract 128 from U and V.
#define BBH (UBH * 128 + YGBH)
#define BGH (UGH * 128 + VGH * 128 + YGBH)
#define BRH (VRH * 128 + YGBH)
// BT.709 constants for YUV to RGB.
YuvConstantsNEON SIMD_ALIGNED(kYuvHConstantsNEON) = {
{ -UBH, -UBH, -UBH, -UBH, -VRH, -VRH, -VRH, -VRH, 0, 0, 0, 0, 0, 0, 0, 0 },
{ UGH, UGH, UGH, UGH, VGH, VGH, VGH, VGH, 0, 0, 0, 0, 0, 0, 0, 0 },
{ BBH, BGH, BRH, 0, 0, 0, 0, 0 },
{ 0x0101 * YGH, 0, 0, 0 }
};
#undef YGH
#undef YGBH
#undef UBH
#undef UGH
#undef VGH
#undef VRH
#undef BBH
#undef BGH
#undef BRH
void I444ToARGBRow_NEON(const uint8* src_y,
const uint8* src_u,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment