Skip to content

Commit 0aa3ba5

Browse files
committed
Remove useless branch
1 parent 8f5ae2d commit 0aa3ba5

File tree

1 file changed

+4
-19
lines changed

1 file changed

+4
-19
lines changed

src/ImageSharp/Formats/Jpeg/Components/Decoder/ColorConverters/JpegColorConverter.FromYCbCrVector4.cs

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public FromYCbCrVector4(int precision)
2222

2323
protected override void ConvertCoreVectorized(in ComponentValues values, Span<Vector4> result)
2424
{
25+
// TODO: Find a way to properly run & test this path on AVX2 PC-s! (Have I already mentioned that Vector<T> is terrible?)
2526
DebugGuard.IsTrue(result.Length % 8 == 0, nameof(result), "result.Length should be divisible by 8!");
2627

2728
ref Vector4Pair yBase =
@@ -74,25 +75,9 @@ protected override void ConvertCoreVectorized(in ComponentValues values, Span<Ve
7475
tmp.MultiplyInplace(1.772F);
7576
b.AddInplace(ref tmp);
7677

77-
if (SimdUtils.HasVector4)
78-
{
79-
// TODO: Find a way to properly run & test this path on AVX2 PC-s! (Have I already mentioned that Vector<T> is terrible?)
80-
r.RoundAndDownscalePreVector8(maxValue);
81-
g.RoundAndDownscalePreVector8(maxValue);
82-
b.RoundAndDownscalePreVector8(maxValue);
83-
}
84-
else if (SimdUtils.HasVector8)
85-
{
86-
r.RoundAndDownscaleVector8(maxValue);
87-
g.RoundAndDownscaleVector8(maxValue);
88-
b.RoundAndDownscaleVector8(maxValue);
89-
}
90-
else
91-
{
92-
// TODO: Run fallback scalar code here
93-
// However, no issues expected before someone implements this: https://github.com/dotnet/coreclr/issues/12007
94-
JpegThrowHelper.ThrowNotImplementedException("Your CPU architecture is too modern!");
95-
}
78+
r.RoundAndDownscalePreVector8(maxValue);
79+
g.RoundAndDownscalePreVector8(maxValue);
80+
b.RoundAndDownscalePreVector8(maxValue);
9681

9782
// Collect (r0,r1...r8) (g0,g1...g8) (b0,b1...b8) vector values in the expected (r0,g0,g1,1), (r1,g1,g2,1) ... order:
9883
ref Vector4Octet destination = ref Unsafe.Add(ref resultBase, i);

0 commit comments

Comments
 (0)