Browse Source
Apply suggestions from code review
Co-authored-by: Günther Foidl <gue@korporal.at>
pull/2409/head
Stefan Nikolei
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
7 additions and
7 deletions
-
src/ImageSharp/Common/Helpers/SimdUtils.HwIntrinsics.cs
-
src/ImageSharp/Formats/Jpeg/Components/ColorConverters/JpegColorConverter.GrayScaleArm.cs
|
|
|
@ -566,9 +566,9 @@ internal static partial class SimdUtils |
|
|
|
/// <returns>The <see cref="Vector256{T}"/>.</returns>
|
|
|
|
[MethodImpl(InliningOptions.AlwaysInline)] |
|
|
|
public static Vector128<float> MultiplyAdd( |
|
|
|
in Vector128<float> va, |
|
|
|
in Vector128<float> vm0, |
|
|
|
in Vector128<float> vm1) |
|
|
|
Vector128<float> va, |
|
|
|
Vector128<float> vm0, |
|
|
|
Vector128<float> vm1) |
|
|
|
{ |
|
|
|
if (Fma.IsSupported) |
|
|
|
{ |
|
|
|
|
|
|
|
@ -27,8 +27,8 @@ internal abstract partial class JpegColorConverterBase |
|
|
|
// Used for the color conversion
|
|
|
|
var scale = Vector128.Create(1 / this.MaximumValue); |
|
|
|
|
|
|
|
nint n = values.Component0.Length / Vector128<float>.Count; |
|
|
|
for (nint i = 0; i < n; i++) |
|
|
|
nuint n = (uint)values.Component0.Length / (uint)Vector128<float>.Count; |
|
|
|
for (nuint i = 0; i < n; i++) |
|
|
|
{ |
|
|
|
ref Vector128<float> c0 = ref Unsafe.Add(ref c0Base, i); |
|
|
|
c0 = AdvSimd.Multiply(c0, scale); |
|
|
|
@ -53,8 +53,8 @@ internal abstract partial class JpegColorConverterBase |
|
|
|
var f0587 = Vector128.Create(0.587f); |
|
|
|
var f0114 = Vector128.Create(0.114f); |
|
|
|
|
|
|
|
nint n = values.Component0.Length / Vector128<float>.Count; |
|
|
|
for (nint i = 0; i < n; i++) |
|
|
|
nuint n = (uint)values.Component0.Length / (uint)Vector128<float>.Count; |
|
|
|
for (nuint i = 0; i < n; i++) |
|
|
|
{ |
|
|
|
ref Vector128<float> r = ref Unsafe.Add(ref srcRed, i); |
|
|
|
ref Vector128<float> g = ref Unsafe.Add(ref srcGreen, i); |
|
|
|
|