From 10e775dbc1f76075b65ceac4a726609c7f237fbd Mon Sep 17 00:00:00 2001 From: TSR Berry <20988865+TSRBerry@users.noreply.github.com> Date: Mon, 6 Feb 2023 18:54:20 +0100 Subject: [PATCH] Remove duplicate BitUtils methods --- .../ReadBitBuffer.cs | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/src/Ryujinx.Graphics.Nvdec.Vp9/ReadBitBuffer.cs b/src/Ryujinx.Graphics.Nvdec.Vp9/ReadBitBuffer.cs index f0333802b..a4e07a1c0 100644 --- a/src/Ryujinx.Graphics.Nvdec.Vp9/ReadBitBuffer.cs +++ b/src/Ryujinx.Graphics.Nvdec.Vp9/ReadBitBuffer.cs @@ -1,7 +1,6 @@ -using Ryujinx.Graphics.Nvdec.Vp9.Types; +using Ryujinx.Graphics.Nvdec.Vp9.Common; +using Ryujinx.Graphics.Nvdec.Vp9.Types; using System; -using System.Diagnostics; -using System.Numerics; namespace Ryujinx.Graphics.Nvdec.Vp9 { @@ -11,20 +10,9 @@ namespace Ryujinx.Graphics.Nvdec.Vp9 public ulong BitOffset; public object ErrorHandlerData; - private static int GetMsb(uint n) - { - Debug.Assert(n != 0); - return 31 ^ BitOperations.LeadingZeroCount(n); - } - - private static int GetUnsignedBits(uint numValues) - { - return numValues > 0 ? GetMsb(numValues) + 1 : 0; - } - public int DecodeUnsignedMax(int max) { - int data = ReadLiteral(GetUnsignedBits((uint)max)); + int data = ReadLiteral(BitUtils.GetUnsignedBits((uint)max)); return data > max ? max : data; }