aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Nvdec.Vp9
diff options
context:
space:
mode:
authorBerkan Diler <b.diler@gmx.de>2022-02-17 21:38:50 +0100
committerGitHub <noreply@github.com>2022-02-17 21:38:50 +0100
commit9ca040c0ff66e8ad928b6fb109401a5b4b53a74d (patch)
treed8dd00bf459a2c894ff393c09afd60e96b57bcc4 /Ryujinx.Graphics.Nvdec.Vp9
parent7e9011673b1593aa2b318e312e0b31379e2e57e4 (diff)
Use ReadOnlySpan<byte> compiler optimization for static data (#3130)
Diffstat (limited to 'Ryujinx.Graphics.Nvdec.Vp9')
-rw-r--r--Ryujinx.Graphics.Nvdec.Vp9/Decoder.cs2
-rw-r--r--Ryujinx.Graphics.Nvdec.Vp9/ReconIntra.cs3
-rw-r--r--Ryujinx.Graphics.Nvdec.Vp9/Types/Mv.cs2
3 files changed, 4 insertions, 3 deletions
diff --git a/Ryujinx.Graphics.Nvdec.Vp9/Decoder.cs b/Ryujinx.Graphics.Nvdec.Vp9/Decoder.cs
index f82ca761..acebd8ab 100644
--- a/Ryujinx.Graphics.Nvdec.Vp9/Decoder.cs
+++ b/Ryujinx.Graphics.Nvdec.Vp9/Decoder.cs
@@ -15,7 +15,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9
public ISurface CreateSurface(int width, int height) => new Surface(width, height);
- private static readonly byte[] LiteralToFilter = new byte[]
+ private static ReadOnlySpan<byte> LiteralToFilter => new byte[]
{
Constants.EightTapSmooth,
Constants.EightTap,
diff --git a/Ryujinx.Graphics.Nvdec.Vp9/ReconIntra.cs b/Ryujinx.Graphics.Nvdec.Vp9/ReconIntra.cs
index 0e1ddfb3..e346c01d 100644
--- a/Ryujinx.Graphics.Nvdec.Vp9/ReconIntra.cs
+++ b/Ryujinx.Graphics.Nvdec.Vp9/ReconIntra.cs
@@ -1,5 +1,6 @@
using Ryujinx.Graphics.Nvdec.Vp9.Common;
using Ryujinx.Graphics.Nvdec.Vp9.Types;
+using System;
using static Ryujinx.Graphics.Nvdec.Vp9.Dsp.IntraPred;
namespace Ryujinx.Graphics.Nvdec.Vp9
@@ -24,7 +25,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9
private const int NeedAbove = 1 << 2;
private const int NeedAboveRight = 1 << 3;
- private static readonly byte[] ExtendModes = new byte[]
+ private static ReadOnlySpan<byte> ExtendModes => new byte[]
{
NeedAbove | NeedLeft, // DC
NeedAbove, // V
diff --git a/Ryujinx.Graphics.Nvdec.Vp9/Types/Mv.cs b/Ryujinx.Graphics.Nvdec.Vp9/Types/Mv.cs
index c1f99ade..815bbb32 100644
--- a/Ryujinx.Graphics.Nvdec.Vp9/Types/Mv.cs
+++ b/Ryujinx.Graphics.Nvdec.Vp9/Types/Mv.cs
@@ -10,7 +10,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
public short Row;
public short Col;
- private static readonly byte[] LogInBase2 = new byte[]
+ private static ReadOnlySpan<byte> LogInBase2 => new byte[]
{
0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,