|
|
@ -27,7 +27,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder.ColorConverters |
|
|
ref Vector<float> kBase = |
|
|
ref Vector<float> kBase = |
|
|
ref Unsafe.As<float, Vector<float>>(ref MemoryMarshal.GetReference(values.Component3)); |
|
|
ref Unsafe.As<float, Vector<float>>(ref MemoryMarshal.GetReference(values.Component3)); |
|
|
|
|
|
|
|
|
var scale = new Vector<float>(1 / this.MaximumValue); |
|
|
var scale = new Vector<float>(1 / (this.MaximumValue * this.MaximumValue)); |
|
|
|
|
|
|
|
|
nint n = values.Component0.Length / Vector<float>.Count; |
|
|
nint n = values.Component0.Length / Vector<float>.Count; |
|
|
for (nint i = 0; i < n; i++) |
|
|
for (nint i = 0; i < n; i++) |
|
|
@ -35,11 +35,12 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder.ColorConverters |
|
|
ref Vector<float> c = ref Unsafe.Add(ref cBase, i); |
|
|
ref Vector<float> c = ref Unsafe.Add(ref cBase, i); |
|
|
ref Vector<float> m = ref Unsafe.Add(ref mBase, i); |
|
|
ref Vector<float> m = ref Unsafe.Add(ref mBase, i); |
|
|
ref Vector<float> y = ref Unsafe.Add(ref yBase, i); |
|
|
ref Vector<float> y = ref Unsafe.Add(ref yBase, i); |
|
|
Vector<float> k = Unsafe.Add(ref kBase, i) * scale; |
|
|
Vector<float> k = Unsafe.Add(ref kBase, i); |
|
|
|
|
|
|
|
|
c = c * k * scale; |
|
|
k *= scale; |
|
|
m = m * k * scale; |
|
|
c *= k; |
|
|
y = y * k * scale; |
|
|
m *= k; |
|
|
|
|
|
y *= k; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|