diff options
| author | Berkan Diler <b.diler@gmx.de> | 2022-02-17 21:38:50 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-17 21:38:50 +0100 |
| commit | 9ca040c0ff66e8ad928b6fb109401a5b4b53a74d (patch) | |
| tree | d8dd00bf459a2c894ff393c09afd60e96b57bcc4 /Ryujinx.Graphics.Nvdec.FFmpeg/H264 | |
| parent | 7e9011673b1593aa2b318e312e0b31379e2e57e4 (diff) | |
Use ReadOnlySpan<byte> compiler optimization for static data (#3130)
Diffstat (limited to 'Ryujinx.Graphics.Nvdec.FFmpeg/H264')
| -rw-r--r-- | Ryujinx.Graphics.Nvdec.FFmpeg/H264/SpsAndPpsReconstruction.cs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Ryujinx.Graphics.Nvdec.FFmpeg/H264/SpsAndPpsReconstruction.cs b/Ryujinx.Graphics.Nvdec.FFmpeg/H264/SpsAndPpsReconstruction.cs index 5c16ef3d..57fb65d5 100644 --- a/Ryujinx.Graphics.Nvdec.FFmpeg/H264/SpsAndPpsReconstruction.cs +++ b/Ryujinx.Graphics.Nvdec.FFmpeg/H264/SpsAndPpsReconstruction.cs @@ -118,7 +118,7 @@ namespace Ryujinx.Graphics.Nvdec.FFmpeg.H264 } // ZigZag LUTs from libavcodec. - private static readonly byte[] ZigZagDirect = new byte[] + private static ReadOnlySpan<byte> ZigZagDirect => new byte[] { 0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, @@ -130,7 +130,7 @@ namespace Ryujinx.Graphics.Nvdec.FFmpeg.H264 53, 60, 61, 54, 47, 55, 62, 63 }; - private static readonly byte[] ZigZagScan = new byte[] + private static ReadOnlySpan<byte> ZigZagScan => new byte[] { 0 + 0 * 4, 1 + 0 * 4, 0 + 1 * 4, 0 + 2 * 4, 1 + 1 * 4, 2 + 0 * 4, 3 + 0 * 4, 2 + 1 * 4, @@ -140,7 +140,7 @@ namespace Ryujinx.Graphics.Nvdec.FFmpeg.H264 private static void WriteScalingList(ref H264BitStreamWriter writer, IArray<byte> list) { - byte[] scan = list.Length == 16 ? ZigZagScan : ZigZagDirect; + ReadOnlySpan<byte> scan = list.Length == 16 ? ZigZagScan : ZigZagDirect; int lastScale = 8; |
