aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Nvdec.Vp9/Dsp
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/Dsp
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/Dsp')
-rw-r--r--Ryujinx.Graphics.Nvdec.Vp9/Dsp/Convolve.cs9
1 files changed, 2 insertions, 7 deletions
diff --git a/Ryujinx.Graphics.Nvdec.Vp9/Dsp/Convolve.cs b/Ryujinx.Graphics.Nvdec.Vp9/Dsp/Convolve.cs
index b74c33dc..1a2969af 100644
--- a/Ryujinx.Graphics.Nvdec.Vp9/Dsp/Convolve.cs
+++ b/Ryujinx.Graphics.Nvdec.Vp9/Dsp/Convolve.cs
@@ -389,11 +389,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
ConvolveAvgVert(src, srcStride, dst, dstStride, filter, y0Q4, yStepQ4, w, h);
}
- [StructLayout(LayoutKind.Sequential, Size = 64 * 135)]
- struct Temp
- {
- }
-
+ [SkipLocalsInit]
public static unsafe void Convolve8(
byte* src,
int srcStride,
@@ -422,8 +418,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
// When calling in frame scaling function, the smallest scaling factor is x1/4
// ==> yStepQ4 = 64. Since w and h are at most 16, the temp buffer is still
// big enough.
- Temp tempStruct;
- byte* temp = (byte*)Unsafe.AsPointer(ref tempStruct); // Avoid zero initialization.
+ byte* temp = stackalloc byte[64 * 135];
int intermediateHeight = (((h - 1) * yStepQ4 + y0Q4) >> SubpelBits) + SubpelTaps;
Debug.Assert(w <= 64);