[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[freetype2] unclamp 6e4012550: * src/base/ftlcdfil.c (FT_SHIFTCLAMP): Ca
From: |
Werner Lemberg |
Subject: |
[freetype2] unclamp 6e4012550: * src/base/ftlcdfil.c (FT_SHIFTCLAMP): Cancel clamping. |
Date: |
Tue, 22 Nov 2022 23:12:18 -0500 (EST) |
branch: unclamp
commit 6e4012550cd8130bd17a92671489097662642948
Author: Alexei Podtelezhnikov <apodtele@gmail.com>
Commit: Alexei Podtelezhnikov <apodtele@gmail.com>
* src/base/ftlcdfil.c (FT_SHIFTCLAMP): Cancel clamping.
Without clamping, we might get garbage output for unnormalized weights.
So what? Garbage in, garbage out - but filtering becomes noticeably faster.
---
src/base/ftlcdfil.c | 5 +++++
1 file changed, 5 insertions(+)
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 */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [freetype2] unclamp 6e4012550: * src/base/ftlcdfil.c (FT_SHIFTCLAMP): Cancel clamping.,
Werner Lemberg <=