Skip to content

Commit ae98d42

Browse files
committed
added proper effort and distance
1 parent d12910e commit ae98d42

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

JxlCoder.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'JxlCoder'
3-
s.version = '1.1.0'
3+
s.version = '1.1.1'
44
s.summary = 'JXL coder for iOS and MacOS'
55
s.description = 'Provides support for JXL files in iOS and MacOS'
66
s.homepage = 'https://github.com/awxkee/jxl-coder-swift'

Sources/jxlc/JxlInternalCoder.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ static inline float JXLGetDistance(const int quality)
4646
if (quality == 0)
4747
return(1.0f);
4848
if (quality >= 30)
49-
return(0.1f+(float) (100-std::min(100.0f, (float)quality))*0.09f);
50-
return(6.24f+(float) pow(2.5f,(30.0-(float)quality)/5.0)/6.25f);
49+
return std::clamp((0.1f+(float) (100-std::min(100.0f, (float)quality))*0.09f), 0.0f, 15.0f);
50+
return std::clamp((6.24f+(float) pow(2.5f,(30.0-(float)quality)/5.0)/6.25f), 0.0f, 15.0f);
5151
}
5252

5353
@implementation JxlInternalCoder

0 commit comments

Comments
 (0)