Commit d95d2169 authored by Frank Barchard's avatar Frank Barchard

rename yuv matrix constants to be more clear about what they are

R=harryjin@google.com
BUG=none

Review URL: https://codereview.chromium.org/1429693006 .
parent c629cb3a
Name: libyuv Name: libyuv
URL: http://code.google.com/p/libyuv/ URL: http://code.google.com/p/libyuv/
Version: 1529 Version: 1530
License: BSD License: BSD
License File: LICENSE License File: LICENSE
......
...@@ -447,14 +447,14 @@ struct YuvConstants { ...@@ -447,14 +447,14 @@ struct YuvConstants {
#endif #endif
// Conversion matrix for YUV to RGB // Conversion matrix for YUV to RGB
extern const struct YuvConstants kYuvIConstants; // BT.601 extern const struct YuvConstants kYuvI601Constants; // BT.601
extern const struct YuvConstants kYuvJConstants; // JPeg color space extern const struct YuvConstants kYuvJPEGConstants; // JPeg color space
extern const struct YuvConstants kYuvHConstants; // BT.709 extern const struct YuvConstants kYuvH709Constants; // BT.709
// Conversion matrix for YVU to BGR. // Conversion matrix for YVU to BGR
extern const struct YuvConstants kYvuIConstants; // BT.601 extern const struct YuvConstants kYvuI601Constants; // BT.601
extern const struct YuvConstants kYvuJConstants; // JPeg color space extern const struct YuvConstants kYvuJPEGConstants; // JPeg color space
extern const struct YuvConstants kYvuHConstants; // BT.709 extern const struct YuvConstants kYvuH709Constants; // BT.709
#if defined(__APPLE__) || defined(__x86_64__) || defined(__llvm__) #if defined(__APPLE__) || defined(__x86_64__) || defined(__llvm__)
#define OMITFP #define OMITFP
......
...@@ -11,6 +11,6 @@ ...@@ -11,6 +11,6 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT #ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
#define INCLUDE_LIBYUV_VERSION_H_ #define INCLUDE_LIBYUV_VERSION_H_
#define LIBYUV_VERSION 1529 #define LIBYUV_VERSION 1530
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
...@@ -125,7 +125,7 @@ int I420ToARGB(const uint8* src_y, int src_stride_y, ...@@ -125,7 +125,7 @@ int I420ToARGB(const uint8* src_y, int src_stride_y,
src_u, src_stride_u, src_u, src_stride_u,
src_v, src_stride_v, src_v, src_stride_v,
dst_argb, dst_stride_argb, dst_argb, dst_stride_argb,
&kYuvIConstants, &kYuvI601Constants,
width, height); width, height);
} }
...@@ -140,7 +140,7 @@ int I420ToABGR(const uint8* src_y, int src_stride_y, ...@@ -140,7 +140,7 @@ int I420ToABGR(const uint8* src_y, int src_stride_y,
src_v, src_stride_v, // Swap U and V src_v, src_stride_v, // Swap U and V
src_u, src_stride_u, src_u, src_stride_u,
dst_abgr, dst_stride_abgr, dst_abgr, dst_stride_abgr,
&kYvuIConstants, // Use Yvu matrix &kYvuI601Constants, // Use Yvu matrix
width, height); width, height);
} }
...@@ -155,7 +155,7 @@ int J420ToARGB(const uint8* src_y, int src_stride_y, ...@@ -155,7 +155,7 @@ int J420ToARGB(const uint8* src_y, int src_stride_y,
src_u, src_stride_u, src_u, src_stride_u,
src_v, src_stride_v, src_v, src_stride_v,
dst_argb, dst_stride_argb, dst_argb, dst_stride_argb,
&kYuvJConstants, &kYuvJPEGConstants,
width, height); width, height);
} }
...@@ -170,7 +170,7 @@ int J420ToABGR(const uint8* src_y, int src_stride_y, ...@@ -170,7 +170,7 @@ int J420ToABGR(const uint8* src_y, int src_stride_y,
src_v, src_stride_v, // Swap U and V src_v, src_stride_v, // Swap U and V
src_u, src_stride_u, src_u, src_stride_u,
dst_abgr, dst_stride_abgr, dst_abgr, dst_stride_abgr,
&kYvuJConstants, // Use Yvu matrix &kYvuJPEGConstants, // Use Yvu matrix
width, height); width, height);
} }
...@@ -185,7 +185,7 @@ int H420ToARGB(const uint8* src_y, int src_stride_y, ...@@ -185,7 +185,7 @@ int H420ToARGB(const uint8* src_y, int src_stride_y,
src_u, src_stride_u, src_u, src_stride_u,
src_v, src_stride_v, src_v, src_stride_v,
dst_argb, dst_stride_argb, dst_argb, dst_stride_argb,
&kYuvHConstants, &kYuvH709Constants,
width, height); width, height);
} }
...@@ -200,7 +200,7 @@ int H420ToABGR(const uint8* src_y, int src_stride_y, ...@@ -200,7 +200,7 @@ int H420ToABGR(const uint8* src_y, int src_stride_y,
src_v, src_stride_v, // Swap U and V src_v, src_stride_v, // Swap U and V
src_u, src_stride_u, src_u, src_stride_u,
dst_abgr, dst_stride_abgr, dst_abgr, dst_stride_abgr,
&kYvuHConstants, // Use Yvu matrix &kYvuH709Constants, // Use Yvu matrix
width, height); width, height);
} }
...@@ -293,7 +293,7 @@ int I422ToARGB(const uint8* src_y, int src_stride_y, ...@@ -293,7 +293,7 @@ int I422ToARGB(const uint8* src_y, int src_stride_y,
src_u, src_stride_u, src_u, src_stride_u,
src_v, src_stride_v, src_v, src_stride_v,
dst_argb, dst_stride_argb, dst_argb, dst_stride_argb,
&kYuvIConstants, &kYuvI601Constants,
width, height); width, height);
} }
...@@ -308,7 +308,7 @@ int I422ToABGR(const uint8* src_y, int src_stride_y, ...@@ -308,7 +308,7 @@ int I422ToABGR(const uint8* src_y, int src_stride_y,
src_v, src_stride_v, // Swap U and V src_v, src_stride_v, // Swap U and V
src_u, src_stride_u, src_u, src_stride_u,
dst_abgr, dst_stride_abgr, dst_abgr, dst_stride_abgr,
&kYvuIConstants, // Use Yvu matrix &kYvuI601Constants, // Use Yvu matrix
width, height); width, height);
} }
...@@ -323,7 +323,7 @@ int J422ToARGB(const uint8* src_y, int src_stride_y, ...@@ -323,7 +323,7 @@ int J422ToARGB(const uint8* src_y, int src_stride_y,
src_u, src_stride_u, src_u, src_stride_u,
src_v, src_stride_v, src_v, src_stride_v,
dst_argb, dst_stride_argb, dst_argb, dst_stride_argb,
&kYuvJConstants, &kYuvJPEGConstants,
width, height); width, height);
} }
...@@ -338,7 +338,7 @@ int J422ToABGR(const uint8* src_y, int src_stride_y, ...@@ -338,7 +338,7 @@ int J422ToABGR(const uint8* src_y, int src_stride_y,
src_v, src_stride_v, // Swap U and V src_v, src_stride_v, // Swap U and V
src_u, src_stride_u, src_u, src_stride_u,
dst_abgr, dst_stride_abgr, dst_abgr, dst_stride_abgr,
&kYvuJConstants, // Use Yvu matrix &kYvuJPEGConstants, // Use Yvu matrix
width, height); width, height);
} }
...@@ -353,7 +353,7 @@ int H422ToARGB(const uint8* src_y, int src_stride_y, ...@@ -353,7 +353,7 @@ int H422ToARGB(const uint8* src_y, int src_stride_y,
src_u, src_stride_u, src_u, src_stride_u,
src_v, src_stride_v, src_v, src_stride_v,
dst_argb, dst_stride_argb, dst_argb, dst_stride_argb,
&kYuvHConstants, &kYuvH709Constants,
width, height); width, height);
} }
...@@ -368,7 +368,7 @@ int H422ToABGR(const uint8* src_y, int src_stride_y, ...@@ -368,7 +368,7 @@ int H422ToABGR(const uint8* src_y, int src_stride_y,
src_v, src_stride_v, // Swap U and V src_v, src_stride_v, // Swap U and V
src_u, src_stride_u, src_u, src_stride_u,
dst_abgr, dst_stride_abgr, dst_abgr, dst_stride_abgr,
&kYvuHConstants, // Use Yvu matrix &kYvuH709Constants, // Use Yvu matrix
width, height); width, height);
} }
...@@ -452,7 +452,7 @@ int I444ToARGB(const uint8* src_y, int src_stride_y, ...@@ -452,7 +452,7 @@ int I444ToARGB(const uint8* src_y, int src_stride_y,
src_u, src_stride_u, src_u, src_stride_u,
src_v, src_stride_v, src_v, src_stride_v,
dst_argb, dst_stride_argb, dst_argb, dst_stride_argb,
&kYuvIConstants, &kYuvI601Constants,
width, height); width, height);
} }
...@@ -467,7 +467,7 @@ int I444ToABGR(const uint8* src_y, int src_stride_y, ...@@ -467,7 +467,7 @@ int I444ToABGR(const uint8* src_y, int src_stride_y,
src_v, src_stride_v, // Swap U and V src_v, src_stride_v, // Swap U and V
src_u, src_stride_u, src_u, src_stride_u,
dst_abgr, dst_stride_abgr, dst_abgr, dst_stride_abgr,
&kYvuIConstants, // Use Yvu matrix &kYvuI601Constants, // Use Yvu matrix
width, height); width, height);
} }
...@@ -482,7 +482,7 @@ int J444ToARGB(const uint8* src_y, int src_stride_y, ...@@ -482,7 +482,7 @@ int J444ToARGB(const uint8* src_y, int src_stride_y,
src_u, src_stride_u, src_u, src_stride_u,
src_v, src_stride_v, src_v, src_stride_v,
dst_argb, dst_stride_argb, dst_argb, dst_stride_argb,
&kYuvJConstants, &kYuvJPEGConstants,
width, height); width, height);
} }
...@@ -546,7 +546,7 @@ int I411ToARGB(const uint8* src_y, int src_stride_y, ...@@ -546,7 +546,7 @@ int I411ToARGB(const uint8* src_y, int src_stride_y,
#endif #endif
for (y = 0; y < height; ++y) { for (y = 0; y < height; ++y) {
I411ToARGBRow(src_y, src_u, src_v, dst_argb, &kYuvIConstants, width); I411ToARGBRow(src_y, src_u, src_v, dst_argb, &kYuvI601Constants, width);
dst_argb += dst_stride_argb; dst_argb += dst_stride_argb;
src_y += src_stride_y; src_y += src_stride_y;
src_u += src_stride_u; src_u += src_stride_u;
...@@ -671,7 +671,7 @@ int I420AlphaToARGB(const uint8* src_y, int src_stride_y, ...@@ -671,7 +671,7 @@ int I420AlphaToARGB(const uint8* src_y, int src_stride_y,
src_v, src_stride_v, src_v, src_stride_v,
src_a, src_stride_a, src_a, src_stride_a,
dst_argb, dst_stride_argb, dst_argb, dst_stride_argb,
&kYuvIConstants, &kYuvI601Constants,
width, height, attenuate); width, height, attenuate);
} }
...@@ -688,7 +688,7 @@ int I420AlphaToABGR(const uint8* src_y, int src_stride_y, ...@@ -688,7 +688,7 @@ int I420AlphaToABGR(const uint8* src_y, int src_stride_y,
src_u, src_stride_u, src_u, src_stride_u,
src_a, src_stride_a, src_a, src_stride_a,
dst_abgr, dst_stride_abgr, dst_abgr, dst_stride_abgr,
&kYvuIConstants, // Use Yvu matrix &kYvuI601Constants, // Use Yvu matrix
width, height, attenuate); width, height, attenuate);
} }
...@@ -1200,7 +1200,7 @@ int NV12ToARGB(const uint8* src_y, int src_stride_y, ...@@ -1200,7 +1200,7 @@ int NV12ToARGB(const uint8* src_y, int src_stride_y,
#endif #endif
for (y = 0; y < height; ++y) { for (y = 0; y < height; ++y) {
NV12ToARGBRow(src_y, src_uv, dst_argb, &kYuvIConstants, width); NV12ToARGBRow(src_y, src_uv, dst_argb, &kYuvI601Constants, width);
dst_argb += dst_stride_argb; dst_argb += dst_stride_argb;
src_y += src_stride_y; src_y += src_stride_y;
if (y & 1) { if (y & 1) {
...@@ -1258,7 +1258,7 @@ int NV21ToARGB(const uint8* src_y, int src_stride_y, ...@@ -1258,7 +1258,7 @@ int NV21ToARGB(const uint8* src_y, int src_stride_y,
#endif #endif
for (y = 0; y < height; ++y) { for (y = 0; y < height; ++y) {
NV21ToARGBRow(src_y, src_uv, dst_argb, &kYuvIConstants, width); NV21ToARGBRow(src_y, src_uv, dst_argb, &kYuvI601Constants, width);
dst_argb += dst_stride_argb; dst_argb += dst_stride_argb;
src_y += src_stride_y; src_y += src_stride_y;
if (y & 1) { if (y & 1) {
...@@ -1316,15 +1316,15 @@ int M420ToARGB(const uint8* src_m420, int src_stride_m420, ...@@ -1316,15 +1316,15 @@ int M420ToARGB(const uint8* src_m420, int src_stride_m420,
for (y = 0; y < height - 1; y += 2) { for (y = 0; y < height - 1; y += 2) {
NV12ToARGBRow(src_m420, src_m420 + src_stride_m420 * 2, dst_argb, NV12ToARGBRow(src_m420, src_m420 + src_stride_m420 * 2, dst_argb,
&kYuvIConstants, width); &kYuvI601Constants, width);
NV12ToARGBRow(src_m420 + src_stride_m420, src_m420 + src_stride_m420 * 2, NV12ToARGBRow(src_m420 + src_stride_m420, src_m420 + src_stride_m420 * 2,
dst_argb + dst_stride_argb, &kYuvIConstants, width); dst_argb + dst_stride_argb, &kYuvI601Constants, width);
dst_argb += dst_stride_argb * 2; dst_argb += dst_stride_argb * 2;
src_m420 += src_stride_m420 * 3; src_m420 += src_stride_m420 * 3;
} }
if (height & 1) { if (height & 1) {
NV12ToARGBRow(src_m420, src_m420 + src_stride_m420 * 2, dst_argb, NV12ToARGBRow(src_m420, src_m420 + src_stride_m420 * 2, dst_argb,
&kYuvIConstants, width); &kYuvI601Constants, width);
} }
return 0; return 0;
} }
...@@ -1382,7 +1382,7 @@ int YUY2ToARGB(const uint8* src_yuy2, int src_stride_yuy2, ...@@ -1382,7 +1382,7 @@ int YUY2ToARGB(const uint8* src_yuy2, int src_stride_yuy2,
} }
#endif #endif
for (y = 0; y < height; ++y) { for (y = 0; y < height; ++y) {
YUY2ToARGBRow(src_yuy2, dst_argb, &kYuvIConstants, width); YUY2ToARGBRow(src_yuy2, dst_argb, &kYuvI601Constants, width);
src_yuy2 += src_stride_yuy2; src_yuy2 += src_stride_yuy2;
dst_argb += dst_stride_argb; dst_argb += dst_stride_argb;
} }
...@@ -1442,7 +1442,7 @@ int UYVYToARGB(const uint8* src_uyvy, int src_stride_uyvy, ...@@ -1442,7 +1442,7 @@ int UYVYToARGB(const uint8* src_uyvy, int src_stride_uyvy,
} }
#endif #endif
for (y = 0; y < height; ++y) { for (y = 0; y < height; ++y) {
UYVYToARGBRow(src_uyvy, dst_argb, &kYuvIConstants, width); UYVYToARGBRow(src_uyvy, dst_argb, &kYuvI601Constants, width);
src_uyvy += src_stride_uyvy; src_uyvy += src_stride_uyvy;
dst_argb += dst_stride_argb; dst_argb += dst_stride_argb;
} }
......
...@@ -531,7 +531,7 @@ int I420ToRGBA(const uint8* src_y, int src_stride_y, ...@@ -531,7 +531,7 @@ int I420ToRGBA(const uint8* src_y, int src_stride_y,
src_u, src_stride_u, src_u, src_stride_u,
src_v, src_stride_v, src_v, src_stride_v,
dst_rgba, dst_stride_rgba, dst_rgba, dst_stride_rgba,
&kYuvIConstants, &kYuvI601Constants,
width, height); width, height);
} }
...@@ -546,7 +546,7 @@ int I420ToBGRA(const uint8* src_y, int src_stride_y, ...@@ -546,7 +546,7 @@ int I420ToBGRA(const uint8* src_y, int src_stride_y,
src_v, src_stride_v, // Swap U and V src_v, src_stride_v, // Swap U and V
src_u, src_stride_u, src_u, src_stride_u,
dst_bgra, dst_stride_bgra, dst_bgra, dst_stride_bgra,
&kYvuIConstants, // Use Yvu matrix &kYvuI601Constants, // Use Yvu matrix
width, height); width, height);
} }
...@@ -622,7 +622,7 @@ int I420ToRGB24(const uint8* src_y, int src_stride_y, ...@@ -622,7 +622,7 @@ int I420ToRGB24(const uint8* src_y, int src_stride_y,
src_u, src_stride_u, src_u, src_stride_u,
src_v, src_stride_v, src_v, src_stride_v,
dst_rgb24, dst_stride_rgb24, dst_rgb24, dst_stride_rgb24,
&kYuvIConstants, &kYuvI601Constants,
width, height); width, height);
} }
...@@ -637,7 +637,7 @@ int I420ToRAW(const uint8* src_y, int src_stride_y, ...@@ -637,7 +637,7 @@ int I420ToRAW(const uint8* src_y, int src_stride_y,
src_v, src_stride_v, // Swap U and V src_v, src_stride_v, // Swap U and V
src_u, src_stride_u, src_u, src_stride_u,
dst_raw, dst_stride_raw, dst_raw, dst_stride_raw,
&kYvuIConstants, // Use Yvu matrix &kYvuI601Constants, // Use Yvu matrix
width, height); width, height);
} }
...@@ -691,7 +691,7 @@ int I420ToARGB1555(const uint8* src_y, int src_stride_y, ...@@ -691,7 +691,7 @@ int I420ToARGB1555(const uint8* src_y, int src_stride_y,
#endif #endif
for (y = 0; y < height; ++y) { for (y = 0; y < height; ++y) {
I422ToARGB1555Row(src_y, src_u, src_v, dst_argb1555, &kYuvIConstants, I422ToARGB1555Row(src_y, src_u, src_v, dst_argb1555, &kYuvI601Constants,
width); width);
dst_argb1555 += dst_stride_argb1555; dst_argb1555 += dst_stride_argb1555;
src_y += src_stride_y; src_y += src_stride_y;
...@@ -754,7 +754,7 @@ int I420ToARGB4444(const uint8* src_y, int src_stride_y, ...@@ -754,7 +754,7 @@ int I420ToARGB4444(const uint8* src_y, int src_stride_y,
#endif #endif
for (y = 0; y < height; ++y) { for (y = 0; y < height; ++y) {
I422ToARGB4444Row(src_y, src_u, src_v, dst_argb4444, &kYuvIConstants, I422ToARGB4444Row(src_y, src_u, src_v, dst_argb4444, &kYuvI601Constants,
width); width);
dst_argb4444 += dst_stride_argb4444; dst_argb4444 += dst_stride_argb4444;
src_y += src_stride_y; src_y += src_stride_y;
...@@ -816,7 +816,7 @@ int I420ToRGB565(const uint8* src_y, int src_stride_y, ...@@ -816,7 +816,7 @@ int I420ToRGB565(const uint8* src_y, int src_stride_y,
#endif #endif
for (y = 0; y < height; ++y) { for (y = 0; y < height; ++y) {
I422ToRGB565Row(src_y, src_u, src_v, dst_rgb565, &kYuvIConstants, width); I422ToRGB565Row(src_y, src_u, src_v, dst_rgb565, &kYuvI601Constants, width);
dst_rgb565 += dst_stride_rgb565; dst_rgb565 += dst_stride_rgb565;
src_y += src_stride_y; src_y += src_stride_y;
if (y & 1) { if (y & 1) {
...@@ -924,7 +924,7 @@ int I420ToRGB565Dither(const uint8* src_y, int src_stride_y, ...@@ -924,7 +924,7 @@ int I420ToRGB565Dither(const uint8* src_y, int src_stride_y,
// Allocate a row of argb. // Allocate a row of argb.
align_buffer_64(row_argb, width * 4); align_buffer_64(row_argb, width * 4);
for (y = 0; y < height; ++y) { for (y = 0; y < height; ++y) {
I422ToARGBRow(src_y, src_u, src_v, row_argb, &kYuvIConstants, width); I422ToARGBRow(src_y, src_u, src_v, row_argb, &kYuvI601Constants, width);
ARGBToRGB565DitherRow(row_argb, dst_rgb565, ARGBToRGB565DitherRow(row_argb, dst_rgb565,
*(uint32*)(dither4x4 + ((y & 3) << 2)), width); *(uint32*)(dither4x4 + ((y & 3) << 2)), width);
dst_rgb565 += dst_stride_rgb565; dst_rgb565 += dst_stride_rgb565;
......
...@@ -843,7 +843,7 @@ int I422ToRGBA(const uint8* src_y, int src_stride_y, ...@@ -843,7 +843,7 @@ int I422ToRGBA(const uint8* src_y, int src_stride_y,
src_u, src_stride_u, src_u, src_stride_u,
src_v, src_stride_v, src_v, src_stride_v,
dst_rgba, dst_stride_rgba, dst_rgba, dst_stride_rgba,
&kYuvIConstants, &kYuvI601Constants,
width, height); width, height);
} }
...@@ -858,7 +858,7 @@ int I422ToBGRA(const uint8* src_y, int src_stride_y, ...@@ -858,7 +858,7 @@ int I422ToBGRA(const uint8* src_y, int src_stride_y,
src_v, src_stride_v, // Swap U and V src_v, src_stride_v, // Swap U and V
src_u, src_stride_u, src_u, src_stride_u,
dst_bgra, dst_stride_bgra, dst_bgra, dst_stride_bgra,
&kYvuIConstants, // Use Yvu matrix &kYvuI601Constants, // Use Yvu matrix
width, height); width, height);
} }
...@@ -910,7 +910,7 @@ int NV12ToRGB565(const uint8* src_y, int src_stride_y, ...@@ -910,7 +910,7 @@ int NV12ToRGB565(const uint8* src_y, int src_stride_y,
#endif #endif
for (y = 0; y < height; ++y) { for (y = 0; y < height; ++y) {
NV12ToRGB565Row(src_y, src_uv, dst_rgb565, &kYuvIConstants, width); NV12ToRGB565Row(src_y, src_uv, dst_rgb565, &kYuvI601Constants, width);
dst_rgb565 += dst_stride_rgb565; dst_rgb565 += dst_stride_rgb565;
src_y += src_stride_y; src_y += src_stride_y;
if (y & 1) { if (y & 1) {
......
...@@ -1033,7 +1033,7 @@ void J400ToARGBRow_C(const uint8* src_y, uint8* dst_argb, int width) { ...@@ -1033,7 +1033,7 @@ void J400ToARGBRow_C(const uint8* src_y, uint8* dst_argb, int width) {
#define BR (VR * 128 + YGB) #define BR (VR * 128 + YGB)
#if defined(__aarch64__) #if defined(__aarch64__)
const YuvConstants SIMD_ALIGNED(kYuvIConstants) = { const YuvConstants SIMD_ALIGNED(kYuvI601Constants) = {
{ -UB, -VR, -UB, -VR, -UB, -VR, -UB, -VR }, { -UB, -VR, -UB, -VR, -UB, -VR, -UB, -VR },
{ -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 },
...@@ -1041,7 +1041,7 @@ const YuvConstants SIMD_ALIGNED(kYuvIConstants) = { ...@@ -1041,7 +1041,7 @@ const YuvConstants SIMD_ALIGNED(kYuvIConstants) = {
{ BB, BG, BR, 0, 0, 0, 0, 0 }, { BB, BG, BR, 0, 0, 0, 0, 0 },
{ 0x0101 * YG, 0, 0, 0 } { 0x0101 * YG, 0, 0, 0 }
}; };
const YuvConstants SIMD_ALIGNED(kYvuIConstants) = { const YuvConstants SIMD_ALIGNED(kYvuI601Constants) = {
{ -VR, -UB, -VR, -UB, -VR, -UB, -VR, -UB }, { -VR, -UB, -VR, -UB, -VR, -UB, -VR, -UB },
{ -VR, -UB, -VR, -UB, -VR, -UB, -VR, -UB }, { -VR, -UB, -VR, -UB, -VR, -UB, -VR, -UB },
{ VG, UG, VG, UG, VG, UG, VG, UG }, { VG, UG, VG, UG, VG, UG, VG, UG },
...@@ -1050,20 +1050,20 @@ const YuvConstants SIMD_ALIGNED(kYvuIConstants) = { ...@@ -1050,20 +1050,20 @@ const YuvConstants SIMD_ALIGNED(kYvuIConstants) = {
{ 0x0101 * YG, 0, 0, 0 } { 0x0101 * YG, 0, 0, 0 }
}; };
#elif defined(__arm__) #elif defined(__arm__)
const YuvConstants SIMD_ALIGNED(kYuvIConstants) = { const YuvConstants SIMD_ALIGNED(kYuvI601Constants) = {
{ -UB, -UB, -UB, -UB, -VR, -VR, -VR, -VR, 0, 0, 0, 0, 0, 0, 0, 0 }, { -UB, -UB, -UB, -UB, -VR, -VR, -VR, -VR, 0, 0, 0, 0, 0, 0, 0, 0 },
{ UG, UG, UG, UG, VG, VG, VG, VG, 0, 0, 0, 0, 0, 0, 0, 0 }, { UG, UG, UG, UG, VG, VG, VG, VG, 0, 0, 0, 0, 0, 0, 0, 0 },
{ BB, BG, BR, 0, 0, 0, 0, 0 }, { BB, BG, BR, 0, 0, 0, 0, 0 },
{ 0x0101 * YG, 0, 0, 0 } { 0x0101 * YG, 0, 0, 0 }
}; };
const YuvConstants SIMD_ALIGNED(kYvuIConstants) = { const YuvConstants SIMD_ALIGNED(kYvuI601Constants) = {
{ -VR, -VR, -VR, -VR, -UB, -UB, -UB, -UB, 0, 0, 0, 0, 0, 0, 0, 0 }, { -VR, -VR, -VR, -VR, -UB, -UB, -UB, -UB, 0, 0, 0, 0, 0, 0, 0, 0 },
{ VG, VG, VG, VG, UG, UG, UG, UG, 0, 0, 0, 0, 0, 0, 0, 0 }, { VG, VG, VG, VG, UG, UG, UG, UG, 0, 0, 0, 0, 0, 0, 0, 0 },
{ BR, BG, BB, 0, 0, 0, 0, 0 }, { BR, BG, BB, 0, 0, 0, 0, 0 },
{ 0x0101 * YG, 0, 0, 0 } { 0x0101 * YG, 0, 0, 0 }
}; };
#else #else
const YuvConstants SIMD_ALIGNED(kYuvIConstants) = { const YuvConstants SIMD_ALIGNED(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,
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, { UG, VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, VG,
...@@ -1075,7 +1075,7 @@ const YuvConstants SIMD_ALIGNED(kYuvIConstants) = { ...@@ -1075,7 +1075,7 @@ const YuvConstants SIMD_ALIGNED(kYuvIConstants) = {
{ BR, BR, BR, BR, BR, BR, BR, BR, BR, BR, BR, BR, BR, BR, BR, BR }, { 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 } { YG, YG, YG, YG, YG, YG, YG, YG, YG, YG, YG, YG, YG, YG, YG, YG }
}; };
const YuvConstants SIMD_ALIGNED(kYvuIConstants) = { const YuvConstants SIMD_ALIGNED(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,
VR, 0, VR, 0, VR, 0, VR, 0, VR, 0, VR, 0, VR, 0, UB, 0 }, VR, 0, VR, 0, VR, 0, VR, 0, VR, 0, VR, 0, VR, 0, UB, 0 },
{ VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, { VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, VG, UG,
...@@ -1120,7 +1120,7 @@ const YuvConstants SIMD_ALIGNED(kYvuIConstants) = { ...@@ -1120,7 +1120,7 @@ const YuvConstants SIMD_ALIGNED(kYvuIConstants) = {
#define BR (VR * 128 + YGB) #define BR (VR * 128 + YGB)
#if defined(__aarch64__) #if defined(__aarch64__)
const YuvConstants SIMD_ALIGNED(kYuvJConstants) = { const YuvConstants SIMD_ALIGNED(kYuvJPEGConstants) = {
{ -UB, -VR, -UB, -VR, -UB, -VR, -UB, -VR }, { -UB, -VR, -UB, -VR, -UB, -VR, -UB, -VR },
{ -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 },
...@@ -1128,7 +1128,7 @@ const YuvConstants SIMD_ALIGNED(kYuvJConstants) = { ...@@ -1128,7 +1128,7 @@ const YuvConstants SIMD_ALIGNED(kYuvJConstants) = {
{ BB, BG, BR, 0, 0, 0, 0, 0 }, { BB, BG, BR, 0, 0, 0, 0, 0 },
{ 0x0101 * YG, 0, 0, 0 } { 0x0101 * YG, 0, 0, 0 }
}; };
const YuvConstants SIMD_ALIGNED(kYvuJConstants) = { const YuvConstants SIMD_ALIGNED(kYvuJPEGConstants) = {
{ -VR, -UB, -VR, -UB, -VR, -UB, -VR, -UB }, { -VR, -UB, -VR, -UB, -VR, -UB, -VR, -UB },
{ -VR, -UB, -VR, -UB, -VR, -UB, -VR, -UB }, { -VR, -UB, -VR, -UB, -VR, -UB, -VR, -UB },
{ VG, UG, VG, UG, VG, UG, VG, UG }, { VG, UG, VG, UG, VG, UG, VG, UG },
...@@ -1137,20 +1137,20 @@ const YuvConstants SIMD_ALIGNED(kYvuJConstants) = { ...@@ -1137,20 +1137,20 @@ const YuvConstants SIMD_ALIGNED(kYvuJConstants) = {
{ 0x0101 * YG, 0, 0, 0 } { 0x0101 * YG, 0, 0, 0 }
}; };
#elif defined(__arm__) #elif defined(__arm__)
const YuvConstants SIMD_ALIGNED(kYuvJConstants) = { const YuvConstants SIMD_ALIGNED(kYuvJPEGConstants) = {
{ -UB, -UB, -UB, -UB, -VR, -VR, -VR, -VR, 0, 0, 0, 0, 0, 0, 0, 0 }, { -UB, -UB, -UB, -UB, -VR, -VR, -VR, -VR, 0, 0, 0, 0, 0, 0, 0, 0 },
{ UG, UG, UG, UG, VG, VG, VG, VG, 0, 0, 0, 0, 0, 0, 0, 0 }, { UG, UG, UG, UG, VG, VG, VG, VG, 0, 0, 0, 0, 0, 0, 0, 0 },
{ BB, BG, BR, 0, 0, 0, 0, 0 }, { BB, BG, BR, 0, 0, 0, 0, 0 },
{ 0x0101 * YG, 0, 0, 0 } { 0x0101 * YG, 0, 0, 0 }
}; };
const YuvConstants SIMD_ALIGNED(kYvuJConstants) = { const YuvConstants SIMD_ALIGNED(kYvuJPEGConstants) = {
{ -VR, -VR, -VR, -VR, -UB, -UB, -UB, -UB, 0, 0, 0, 0, 0, 0, 0, 0 }, { -VR, -VR, -VR, -VR, -UB, -UB, -UB, -UB, 0, 0, 0, 0, 0, 0, 0, 0 },
{ VG, VG, VG, VG, UG, UG, UG, UG, 0, 0, 0, 0, 0, 0, 0, 0 }, { VG, VG, VG, VG, UG, UG, UG, UG, 0, 0, 0, 0, 0, 0, 0, 0 },
{ BR, BG, BB, 0, 0, 0, 0, 0 }, { BR, BG, BB, 0, 0, 0, 0, 0 },
{ 0x0101 * YG, 0, 0, 0 } { 0x0101 * YG, 0, 0, 0 }
}; };
#else #else
const YuvConstants SIMD_ALIGNED(kYuvJConstants) = { const YuvConstants SIMD_ALIGNED(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,
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, { UG, VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, VG,
...@@ -1162,7 +1162,7 @@ const YuvConstants SIMD_ALIGNED(kYuvJConstants) = { ...@@ -1162,7 +1162,7 @@ const YuvConstants SIMD_ALIGNED(kYuvJConstants) = {
{ BR, BR, BR, BR, BR, BR, BR, BR, BR, BR, BR, BR, BR, BR, BR, BR }, { 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 } { YG, YG, YG, YG, YG, YG, YG, YG, YG, YG, YG, YG, YG, YG, YG, YG }
}; };
const YuvConstants SIMD_ALIGNED(kYvuJConstants) = { const YuvConstants SIMD_ALIGNED(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,
VR, 0, VR, 0, VR, 0, VR, 0, VR, 0, VR, 0, VR, 0, UB, 0 }, VR, 0, VR, 0, VR, 0, VR, 0, VR, 0, VR, 0, VR, 0, UB, 0 },
{ VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, { VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, VG, UG,
...@@ -1208,7 +1208,7 @@ const YuvConstants SIMD_ALIGNED(kYvuJConstants) = { ...@@ -1208,7 +1208,7 @@ const YuvConstants SIMD_ALIGNED(kYvuJConstants) = {
#define BR (VR * 128 + YGB) #define BR (VR * 128 + YGB)
#if defined(__aarch64__) #if defined(__aarch64__)
const YuvConstants SIMD_ALIGNED(kYuvHConstants) = { const YuvConstants SIMD_ALIGNED(kYuvH709Constants) = {
{ -UB, -VR, -UB, -VR, -UB, -VR, -UB, -VR }, { -UB, -VR, -UB, -VR, -UB, -VR, -UB, -VR },
{ -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 },
...@@ -1216,7 +1216,7 @@ const YuvConstants SIMD_ALIGNED(kYuvHConstants) = { ...@@ -1216,7 +1216,7 @@ const YuvConstants SIMD_ALIGNED(kYuvHConstants) = {
{ BB, BG, BR, 0, 0, 0, 0, 0 }, { BB, BG, BR, 0, 0, 0, 0, 0 },
{ 0x0101 * YG, 0, 0, 0 } { 0x0101 * YG, 0, 0, 0 }
}; };
const YuvConstants SIMD_ALIGNED(kYvuHConstants) = { const YuvConstants SIMD_ALIGNED(kYvuH709Constants) = {
{ -VR, -UB, -VR, -UB, -VR, -UB, -VR, -UB }, { -VR, -UB, -VR, -UB, -VR, -UB, -VR, -UB },
{ -VR, -UB, -VR, -UB, -VR, -UB, -VR, -UB }, { -VR, -UB, -VR, -UB, -VR, -UB, -VR, -UB },
{ VG, UG, VG, UG, VG, UG, VG, UG }, { VG, UG, VG, UG, VG, UG, VG, UG },
...@@ -1225,20 +1225,20 @@ const YuvConstants SIMD_ALIGNED(kYvuHConstants) = { ...@@ -1225,20 +1225,20 @@ const YuvConstants SIMD_ALIGNED(kYvuHConstants) = {
{ 0x0101 * YG, 0, 0, 0 } { 0x0101 * YG, 0, 0, 0 }
}; };
#elif defined(__arm__) #elif defined(__arm__)
const YuvConstants SIMD_ALIGNED(kYuvHConstants) = { const YuvConstants SIMD_ALIGNED(kYuvH709Constants) = {
{ -UB, -UB, -UB, -UB, -VR, -VR, -VR, -VR, 0, 0, 0, 0, 0, 0, 0, 0 }, { -UB, -UB, -UB, -UB, -VR, -VR, -VR, -VR, 0, 0, 0, 0, 0, 0, 0, 0 },
{ UG, UG, UG, UG, VG, VG, VG, VG, 0, 0, 0, 0, 0, 0, 0, 0 }, { UG, UG, UG, UG, VG, VG, VG, VG, 0, 0, 0, 0, 0, 0, 0, 0 },
{ BB, BG, BR, 0, 0, 0, 0, 0 }, { BB, BG, BR, 0, 0, 0, 0, 0 },
{ 0x0101 * YG, 0, 0, 0 } { 0x0101 * YG, 0, 0, 0 }
}; };
const YuvConstants SIMD_ALIGNED(kYvuHConstants) = { const YuvConstants SIMD_ALIGNED(kYvuH709Constants) = {
{ -VR, -VR, -VR, -VR, -UB, -UB, -UB, -UB, 0, 0, 0, 0, 0, 0, 0, 0 }, { -VR, -VR, -VR, -VR, -UB, -UB, -UB, -UB, 0, 0, 0, 0, 0, 0, 0, 0 },
{ VG, VG, VG, VG, UG, UG, UG, UG, 0, 0, 0, 0, 0, 0, 0, 0 }, { VG, VG, VG, VG, UG, UG, UG, UG, 0, 0, 0, 0, 0, 0, 0, 0 },
{ BR, BG, BB, 0, 0, 0, 0, 0 }, { BR, BG, BB, 0, 0, 0, 0, 0 },
{ 0x0101 * YG, 0, 0, 0 } { 0x0101 * YG, 0, 0, 0 }
}; };
#else #else
const YuvConstants SIMD_ALIGNED(kYuvHConstants) = { const YuvConstants SIMD_ALIGNED(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,
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, { UG, VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, VG,
...@@ -1250,7 +1250,7 @@ const YuvConstants SIMD_ALIGNED(kYuvHConstants) = { ...@@ -1250,7 +1250,7 @@ const YuvConstants SIMD_ALIGNED(kYuvHConstants) = {
{ BR, BR, BR, BR, BR, BR, BR, BR, BR, BR, BR, BR, BR, BR, BR, BR }, { 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 } { YG, YG, YG, YG, YG, YG, YG, YG, YG, YG, YG, YG, YG, YG, YG, YG }
}; };
const YuvConstants SIMD_ALIGNED(kYvuHConstants) = { const YuvConstants SIMD_ALIGNED(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,
VR, 0, VR, 0, VR, 0, VR, 0, VR, 0, VR, 0, VR, 0, UB, 0 }, VR, 0, VR, 0, VR, 0, VR, 0, VR, 0, VR, 0, VR, 0, UB, 0 },
{ VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, { VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, VG, UG, VG, UG,
......
...@@ -428,10 +428,10 @@ void I400ToARGBRow_NEON(const uint8* src_y, ...@@ -428,10 +428,10 @@ void I400ToARGBRow_NEON(const uint8* src_y,
: "+r"(src_y), // %0 : "+r"(src_y), // %0
"+r"(dst_argb), // %1 "+r"(dst_argb), // %1
"+r"(width) // %2 "+r"(width) // %2
: [kUVToRB]"r"(&kYuvIConstants.kUVToRB), : [kUVToRB]"r"(&kYuvI601Constants.kUVToRB),
[kUVToG]"r"(&kYuvIConstants.kUVToG), [kUVToG]"r"(&kYuvI601Constants.kUVToG),
[kUVBiasBGR]"r"(&kYuvIConstants.kUVBiasBGR), [kUVBiasBGR]"r"(&kYuvI601Constants.kUVBiasBGR),
[kYToRgb]"r"(&kYuvIConstants.kYToRgb) [kYToRgb]"r"(&kYuvI601Constants.kYToRgb)
: "cc", "memory", "q0", "q1", "q2", "q3", "q4", : "cc", "memory", "q0", "q1", "q2", "q3", "q4",
"q8", "q9", "q10", "q11", "q12", "q13", "q14", "q15" "q8", "q9", "q10", "q11", "q12", "q13", "q14", "q15"
); );
......
...@@ -439,10 +439,10 @@ void I400ToARGBRow_NEON(const uint8* src_y, ...@@ -439,10 +439,10 @@ void I400ToARGBRow_NEON(const uint8* src_y,
: "+r"(src_y), // %0 : "+r"(src_y), // %0
"+r"(dst_argb), // %1 "+r"(dst_argb), // %1
"+r"(width64) // %2 "+r"(width64) // %2
: [kUVToRB]"r"(&kYuvIConstants.kUVToRB), : [kUVToRB]"r"(&kYuvI601Constants.kUVToRB),
[kUVToG]"r"(&kYuvIConstants.kUVToG), [kUVToG]"r"(&kYuvI601Constants.kUVToG),
[kUVBiasBGR]"r"(&kYuvIConstants.kUVBiasBGR), [kUVBiasBGR]"r"(&kYuvI601Constants.kUVBiasBGR),
[kYToRgb]"r"(&kYuvIConstants.kYToRgb) [kYToRgb]"r"(&kYuvI601Constants.kYToRgb)
: "cc", "memory", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v20", : "cc", "memory", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v20",
"v21", "v22", "v23", "v24", "v25", "v26", "v27", "v28", "v29", "v30" "v21", "v22", "v23", "v24", "v25", "v26", "v27", "v28", "v29", "v30"
); );
......
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