From e51f5008c3a53f203d0d9f21957146f95a6bf17b Mon Sep 17 00:00:00 2001 From: Brian Popow Date: Sun, 31 Oct 2021 16:51:37 +0100 Subject: [PATCH] Add AggressiveInlining to LevelCosts --- src/ImageSharp/Formats/Webp/Lossy/Vp8Residual.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ImageSharp/Formats/Webp/Lossy/Vp8Residual.cs b/src/ImageSharp/Formats/Webp/Lossy/Vp8Residual.cs index 2962ebbabc..4eeeedd376 100644 --- a/src/ImageSharp/Formats/Webp/Lossy/Vp8Residual.cs +++ b/src/ImageSharp/Formats/Webp/Lossy/Vp8Residual.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. using System; +using System.Runtime.CompilerServices; namespace SixLabors.ImageSharp.Formats.Webp.Lossy { @@ -151,6 +152,7 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossy return cost; } + [MethodImpl(InliningOptions.ShortMethod)] private static int LevelCost(Span table, int level) => WebpLookupTables.Vp8LevelFixedCosts[level] + table[level > WebpConstants.MaxVariableLevel ? WebpConstants.MaxVariableLevel : level];