Browse Source
Merge pull request #2413 from gfoidl/smash_bug
Fixed wrong division hack
pull/2419/head
Brian Popow
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
1 deletions
-
src/ImageSharp/Formats/Webp/Lossless/LosslessUtils.cs
|
|
|
@ -1456,7 +1456,7 @@ internal static unsafe class LosslessUtils |
|
|
|
} |
|
|
|
|
|
|
|
[MethodImpl(InliningOptions.ShortMethod)] |
|
|
|
private static int AddSubtractComponentHalf(int a, int b) => (int)Clip255((uint)(a + ((a - b) >> 1))); // >> 1 is bit-hack for / 2
|
|
|
|
private static int AddSubtractComponentHalf(int a, int b) => (int)Clip255((uint)(a + ((a - b) / 2))); |
|
|
|
|
|
|
|
[MethodImpl(InliningOptions.ShortMethod)] |
|
|
|
private static int AddSubtractComponentFull(int a, int b, int c) => (int)Clip255((uint)(a + b - c)); |
|
|
|
|