aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Nvdec.Vp9/DecodeFrame.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2020-11-18 15:28:40 -0300
committerGitHub <noreply@github.com>2020-11-18 19:28:40 +0100
commiteafee34feebd432151809df402f3f696e4d93d08 (patch)
tree6c4fe83e41ae3b7eceeb2762d950800cbcc4c7c9 /Ryujinx.Graphics.Nvdec.Vp9/DecodeFrame.cs
parent7c3b559830f0cd466ea7bc01743cca26ae48989a (diff)
Improvements with new .NET 5 functions or bugfixes (#1714)
* Improvements with new .NET 5 functions or bugfixes * This no longer needs to be unsafe
Diffstat (limited to 'Ryujinx.Graphics.Nvdec.Vp9/DecodeFrame.cs')
-rw-r--r--Ryujinx.Graphics.Nvdec.Vp9/DecodeFrame.cs9
1 files changed, 2 insertions, 7 deletions
diff --git a/Ryujinx.Graphics.Nvdec.Vp9/DecodeFrame.cs b/Ryujinx.Graphics.Nvdec.Vp9/DecodeFrame.cs
index 012b0c60..9e267376 100644
--- a/Ryujinx.Graphics.Nvdec.Vp9/DecodeFrame.cs
+++ b/Ryujinx.Graphics.Nvdec.Vp9/DecodeFrame.cs
@@ -374,11 +374,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9
} while (--bH != 0);
}
- [StructLayout(LayoutKind.Sequential, Size = 80 * 2 * 80 * 2)]
- struct McBufHigh
- {
- }
-
+ [SkipLocalsInit]
private static unsafe void ExtendAndPredict(
byte* bufPtr1,
int preBufStride,
@@ -402,8 +398,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9
int xs,
int ys)
{
- McBufHigh mcBufHighStruct;
- ushort* mcBufHigh = (ushort*)Unsafe.AsPointer(ref mcBufHighStruct); // Avoid zero initialization.
+ ushort* mcBufHigh = stackalloc ushort[80 * 2 * 80 * 2];
if (xd.CurBuf.HighBd)
{
HighBuildMcBorder(bufPtr1, preBufStride, mcBufHigh, bW, x0, y0, bW, bH, frameWidth, frameHeight);