summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlexei Podtelezhnikov <apodtele@gmail.com>2022-11-23 04:12:08 +0000
committerAlexei Podtelezhnikov <apodtele@gmail.com>2022-11-23 04:12:08 +0000
commit6e4012550cd8130bd17a92671489097662642948 (patch)
treeb0604032c061ddabf797b87cabb7ef0b7513d43d /src
parentaca4ec5907e0bfb5bbeb01370257a121f3f47a0f (diff)
downloadfreetype2-unclamp.tar.gz
* src/base/ftlcdfil.c (FT_SHIFTCLAMP): Cancel clamping. unclamp
Without clamping, we might get garbage output for unnormalized weights. So what? Garbage in, garbage out - but filtering becomes noticeably faster.
Diffstat (limited to 'src')
-rw-r--r--src/base/ftlcdfil.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/base/ftlcdfil.c b/src/base/ftlcdfil.c
index e72f6d668..f3072f2ca 100644
--- a/src/base/ftlcdfil.c
+++ b/src/base/ftlcdfil.c
@@ -28,7 +28,12 @@
/* define USE_LEGACY to implement the legacy filter */
#define USE_LEGACY
+#if 1
+#define FT_SHIFTCLAMP( x ) (FT_Byte)( x >> 8 )
+#else
#define FT_SHIFTCLAMP( x ) ( x >>= 8, (FT_Byte)( x > 255 ? 255 : x ) )
+#endif
+
/* add padding according to filter weights */