1
0
mirror of https://github.com/SerenityOS/serenity synced 2024-07-03 12:13:39 +00:00

LibGfx/JPEGLoader: Use 1 / sqrt(8) instead of rsqrt(8)

At least on arm64, rsqrt(8) has noticeably worse precision:
https://github.com/SerenityOS/serenity/issues/22739#issuecomment-1912909835
This commit is contained in:
Nico Weber 2024-01-29 13:23:49 -05:00 committed by Jelle Raaijmakers
parent 8a07aa9e9a
commit 1ed9e597a9

View File

@ -1425,7 +1425,7 @@ static void inverse_dct_8x8(i16* block_component)
static float const m5 = 2.0f * AK::cos(3.0f / 16.0f * 2.0f * AK::Pi<float>);
static float const m2 = m0 - m5;
static float const m4 = m0 + m5;
static float const s0 = AK::cos(0.0f / 16.0f * AK::Pi<float>) * AK::rsqrt(8.0f);
static float const s0 = AK::cos(0.0f / 16.0f * AK::Pi<float>) / AK::sqrt(8.0f);
static float const s1 = AK::cos(1.0f / 16.0f * AK::Pi<float>) / 2.0f;
static float const s2 = AK::cos(2.0f / 16.0f * AK::Pi<float>) / 2.0f;
static float const s3 = AK::cos(3.0f / 16.0f * AK::Pi<float>) / 2.0f;