|
|
|
@ -847,7 +847,7 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossless |
|
|
|
/// </summary>
|
|
|
|
private static int PrefixEncodeBitsNoLut(int distance, ref int extraBits) |
|
|
|
{ |
|
|
|
int highestBit = WebpCommonUtils.BitsLog2Floor((uint)--distance); |
|
|
|
int highestBit = Numerics.Log2((uint)--distance); |
|
|
|
int secondHighestBit = (distance >> (highestBit - 1)) & 1; |
|
|
|
extraBits = highestBit - 1; |
|
|
|
int code = (2 * highestBit) + secondHighestBit; |
|
|
|
@ -856,7 +856,7 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossless |
|
|
|
|
|
|
|
private static int PrefixEncodeNoLut(int distance, ref int extraBits, ref int extraBitsValue) |
|
|
|
{ |
|
|
|
int highestBit = WebpCommonUtils.BitsLog2Floor((uint)--distance); |
|
|
|
int highestBit = Numerics.Log2((uint)--distance); |
|
|
|
int secondHighestBit = (distance >> (highestBit - 1)) & 1; |
|
|
|
extraBits = highestBit - 1; |
|
|
|
extraBitsValue = distance & ((1 << extraBits) - 1); |
|
|
|
|