From d6b867ba89f87201ca4afe00d4342758751f7d49 Mon Sep 17 00:00:00 2001 From: Zaggy1024 Date: Tue, 18 Apr 2023 22:54:56 -0500 Subject: [PATCH] LibVideo/VP9: Force inlining of `inverse_transform_2d()` and the IDCT Clang was reluctant to inline these for some reason. However, inlining them seems to be quite beneficial, reducing decoding time in an intra- heavy video by about 21% (~12.7s -> ~10.0s). --- Userland/Libraries/LibVideo/VP9/Decoder.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibVideo/VP9/Decoder.cpp b/Userland/Libraries/LibVideo/VP9/Decoder.cpp index b8f3fa4ad1..8eebf99000 100644 --- a/Userland/Libraries/LibVideo/VP9/Decoder.cpp +++ b/Userland/Libraries/LibVideo/VP9/Decoder.cpp @@ -1399,7 +1399,7 @@ inline DecoderErrorOr Decoder::inverse_discrete_cosine_transform_array_per } template -inline DecoderErrorOr Decoder::inverse_discrete_cosine_transform(Span data) +ALWAYS_INLINE DecoderErrorOr Decoder::inverse_discrete_cosine_transform(Span data) { static_assert(log2_of_block_size >= 2 && log2_of_block_size <= 5, "Block size out of range."); @@ -1790,7 +1790,7 @@ inline DecoderErrorOr Decoder::inverse_asymmetric_discrete_sine_transform( } template -DecoderErrorOr Decoder::inverse_transform_2d(BlockContext const& block_context, Span dequantized, TransformSet transform_set) +ALWAYS_INLINE DecoderErrorOr Decoder::inverse_transform_2d(BlockContext const& block_context, Span dequantized, TransformSet transform_set) { static_assert(log2_of_block_size >= 2 && log2_of_block_size <= 5);