aboutsummaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorMax Horn2009-01-22 06:41:57 +0000
committerMax Horn2009-01-22 06:41:57 +0000
commitd5d7175691ea3cde7aa941886e3197763c1398c6 (patch)
treef7f9d8600db4ba9d4988931936b10cfd078511d8 /graphics
parent0034aa3b9c7a1f0123df9e809a6a5d0d58bd9bd1 (diff)
downloadscummvm-rg350-d5d7175691ea3cde7aa941886e3197763c1398c6.tar.gz
scummvm-rg350-d5d7175691ea3cde7aa941886e3197763c1398c6.tar.bz2
scummvm-rg350-d5d7175691ea3cde7aa941886e3197763c1398c6.zip
Speed up HQ2x/HQ3x C versions by reordering tests in diffYUV: most likeliest to be taken now is first, least likely is last
svn-id: r35996
Diffstat (limited to 'graphics')
-rw-r--r--graphics/scaler/intern.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/graphics/scaler/intern.h b/graphics/scaler/intern.h
index 6fc0d6919b..5955aa1bac 100644
--- a/graphics/scaler/intern.h
+++ b/graphics/scaler/intern.h
@@ -115,11 +115,6 @@ static inline bool diffYUV(int yuv1, int yuv2) {
int diff;
int mask;
- diff = ((yuv1 & Ymask) - (yuv2 & Ymask));
- mask = diff >> 31; // -1 if value < 0, 0 otherwise
- diff = (diff ^ mask) - mask; //-1: ~value + 1; 0: value
- if (diff > trY) return true;
-
diff = ((yuv1 & Umask) - (yuv2 & Umask));
mask = diff >> 31; // -1 if value < 0, 0 otherwise
diff = (diff ^ mask) - mask; //-1: ~value + 1; 0: value
@@ -130,6 +125,11 @@ static inline bool diffYUV(int yuv1, int yuv2) {
diff = (diff ^ mask) - mask; //-1: ~value + 1; 0: value
if (diff > trV) return true;
+ diff = ((yuv1 & Ymask) - (yuv2 & Ymask));
+ mask = diff >> 31; // -1 if value < 0, 0 otherwise
+ diff = (diff ^ mask) - mask; //-1: ~value + 1; 0: value
+ if (diff > trY) return true;
+
return false;
/*
return