diff options
Diffstat (limited to 'Ryujinx.Graphics.Nvdec.Vp9')
| -rw-r--r-- | Ryujinx.Graphics.Nvdec.Vp9/Common/BitUtils.cs | 3 | ||||
| -rw-r--r-- | Ryujinx.Graphics.Nvdec.Vp9/DecodeFrame.cs | 9 | ||||
| -rw-r--r-- | Ryujinx.Graphics.Nvdec.Vp9/Dsp/Convolve.cs | 9 |
3 files changed, 5 insertions, 16 deletions
diff --git a/Ryujinx.Graphics.Nvdec.Vp9/Common/BitUtils.cs b/Ryujinx.Graphics.Nvdec.Vp9/Common/BitUtils.cs index a7c6d148..641188f8 100644 --- a/Ryujinx.Graphics.Nvdec.Vp9/Common/BitUtils.cs +++ b/Ryujinx.Graphics.Nvdec.Vp9/Common/BitUtils.cs @@ -7,8 +7,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Common { internal static class BitUtils { - // FIXME: Enable inlining here after AVX2 gather bug is fixed. - // [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static byte ClipPixel(int val) { return (byte)((val > 255) ? 255 : (val < 0) ? 0 : val); 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); 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); |
