Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(483)

Unified Diff: third_party/libwebp/dsp/upsampling_mips_dsp_r2.c

Issue 2149863002: libwebp: update to v0.5.1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/libwebp/dsp/rescaler_sse2.c ('k') | third_party/libwebp/dsp/yuv_mips32.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/libwebp/dsp/upsampling_mips_dsp_r2.c
diff --git a/third_party/libwebp/dsp/upsampling_mips_dsp_r2.c b/third_party/libwebp/dsp/upsampling_mips_dsp_r2.c
index d4ccbe0adaad8f2da5db53b44acc55c29d648a3b..ed2eb748255e97dd3bf93391f6a03797e403e5cd 100644
--- a/third_party/libwebp/dsp/upsampling_mips_dsp_r2.c
+++ b/third_party/libwebp/dsp/upsampling_mips_dsp_r2.c
@@ -14,9 +14,7 @@
#include "./dsp.h"
-// Code is disabled for now, in favor of the plain-C version
-// TODO(djordje.pesut): adapt the code to reflect the C-version.
-#if 0 // defined(WEBP_USE_MIPS_DSP_R2)
+#if defined(WEBP_USE_MIPS_DSP_R2)
#include <assert.h>
#include "./yuv.h"
@@ -24,21 +22,21 @@
#if !defined(WEBP_YUV_USE_TABLE)
#define YUV_TO_RGB(Y, U, V, R, G, B) do { \
- const int t1 = kYScale * Y; \
- const int t2 = kVToG * V; \
- R = kVToR * V; \
- G = kUToG * U; \
- B = kUToB * U; \
+ const int t1 = MultHi(Y, 19077); \
+ const int t2 = MultHi(V, 13320); \
+ R = MultHi(V, 26149); \
+ G = MultHi(U, 6419); \
+ B = MultHi(U, 33050); \
R = t1 + R; \
G = t1 - G; \
B = t1 + B; \
- R = R + kRCst; \
- G = G - t2 + kGCst; \
- B = B + kBCst; \
+ R = R - 14234; \
+ G = G - t2 + 8708; \
+ B = B - 17685; \
__asm__ volatile ( \
- "shll_s.w %[" #R "], %[" #R "], 9 \n\t" \
- "shll_s.w %[" #G "], %[" #G "], 9 \n\t" \
- "shll_s.w %[" #B "], %[" #B "], 9 \n\t" \
+ "shll_s.w %[" #R "], %[" #R "], 17 \n\t" \
+ "shll_s.w %[" #G "], %[" #G "], 17 \n\t" \
+ "shll_s.w %[" #B "], %[" #B "], 17 \n\t" \
"precrqu_s.qb.ph %[" #R "], %[" #R "], $zero \n\t" \
"precrqu_s.qb.ph %[" #G "], %[" #G "], $zero \n\t" \
"precrqu_s.qb.ph %[" #B "], %[" #B "], $zero \n\t" \
@@ -279,6 +277,6 @@ WEBP_DSP_INIT_STUB(WebPInitYUV444ConvertersMIPSdspR2)
#endif // WEBP_USE_MIPS_DSP_R2
-#if 1 // !(defined(FANCY_UPSAMPLING) && defined(WEBP_USE_MIPS_DSP_R2))
+#if !(defined(FANCY_UPSAMPLING) && defined(WEBP_USE_MIPS_DSP_R2))
WEBP_DSP_INIT_STUB(WebPInitUpsamplersMIPSdspR2)
#endif
« no previous file with comments | « third_party/libwebp/dsp/rescaler_sse2.c ('k') | third_party/libwebp/dsp/yuv_mips32.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698