aboutsummaryrefslogtreecommitdiff
path: root/src/dsp/yuv.h
diff options
context:
space:
mode:
authorVikas Arora <vikasa@google.com>2014-07-25 13:53:32 -0700
committerVikas Arora <vikasa@google.com>2014-07-25 13:53:32 -0700
commit33f74dabbc7920a65ed435d7417987589febdc16 (patch)
treeb4a6d3345d23e0c12ea82ab354b75c83c7309516 /src/dsp/yuv.h
parent40d327484446eb6adea41a817b2fb218d00a7649 (diff)
downloadwebp-33f74dabbc7920a65ed435d7417987589febdc16.tar.gz
Sync-patch with libwebp ver 0.4.1-rc1.
Sync-patch with libwebp ver 0.4.1-rc1 (change#I5346984d2). - NEON assembly optimizations: - ~25% faster lossy decode / encode (-m 4) - ~10% faster lossless decode - ~5-10% faster lossless encode (-m 3/4) - Arch64 (arm64) & MIPS support/optimizations. Change-Id: I855b65cec8fad5ec567c276b698e7714dc4bffd2
Diffstat (limited to 'src/dsp/yuv.h')
-rw-r--r--src/dsp/yuv.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/dsp/yuv.h b/src/dsp/yuv.h
index dd778f9c..8a47edd8 100644
--- a/src/dsp/yuv.h
+++ b/src/dsp/yuv.h
@@ -245,6 +245,10 @@ void VP8YUVInit(void);
#if defined(WEBP_USE_SSE2)
+// When the following is defined, tables are initialized statically, adding ~12k
+// to the binary size. Otherwise, they are initialized at run-time (small cost).
+#define WEBP_YUV_USE_SSE2_TABLES
+
#if defined(FANCY_UPSAMPLING)
// Process 32 pixels and store the result (24b or 32b per pixel) in *dst.
void VP8YuvToRgba32(const uint8_t* y, const uint8_t* u, const uint8_t* v,
@@ -298,12 +302,12 @@ static WEBP_INLINE int VP8RGBToY(int r, int g, int b, int rounding) {
return (luma + rounding) >> YUV_FIX; // no need to clip
}
-static WEBP_INLINE int VP8_RGB_TO_U(int r, int g, int b, int rounding) {
+static WEBP_INLINE int VP8RGBToU(int r, int g, int b, int rounding) {
const int u = -11058 * r - 21710 * g + 32768 * b;
return VP8ClipUV(u, rounding);
}
-static WEBP_INLINE int VP8_RGB_TO_V(int r, int g, int b, int rounding) {
+static WEBP_INLINE int VP8RGBToV(int r, int g, int b, int rounding) {
const int v = 32768 * r - 27439 * g - 5329 * b;
return VP8ClipUV(v, rounding);
}