aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.Nvdec.Vp9/Types/Mv.cs
diff options
context:
space:
mode:
authorTSRBerry <20988865+TSRBerry@users.noreply.github.com>2023-06-28 09:26:39 +0200
committerGitHub <noreply@github.com>2023-06-28 09:26:39 +0200
commit6aa8d71588af4615019cd91b8a31f69dbfaa815d (patch)
tree4b60ed9aeb846ca3bf50f1e9dac97ddfdbc269de /src/Ryujinx.Graphics.Nvdec.Vp9/Types/Mv.cs
parent9becbd7d728fc2002c176dfd9d1d1aae86f86b12 (diff)
[Ryujinx.Graphics.Nvdec.Vp9] Address dotnet-format issues (#5371)
* dotnet format style --severity info Some changes were manually reverted. * dotnet format analyzers --serverity info Some changes have been minimally adapted. * Restore a few unused methods and variables * Silence dotnet format IDE0060 warnings * Address or silence dotnet format IDE1006 warnings * Address most dotnet format whitespace warnings * Apply dotnet format whitespace formatting A few of them have been manually reverted and the corresponding warning was silenced * Add comments to disabled warnings * Simplify properties and array initialization, Use const when possible, Remove trailing commas * Address IDE0251 warnings * Address a few disabled IDE0060 warnings * Silence IDE0060 in .editorconfig * Revert "Simplify properties and array initialization, Use const when possible, Remove trailing commas" This reverts commit 9462e4136c0a2100dc28b20cf9542e06790aa67e. * dotnet format whitespace after rebase * Fix empty lines before return Co-authored-by: Ac_K <Acoustik666@gmail.com> * Add trailing commas, remove redundant code and remove static modifier from Surface.HighBd * Fix naming rule violations * Fix naming rule violations * Fix empty line before return * Fix comment style Co-authored-by: Ac_K <Acoustik666@gmail.com> * Remove comment alignment * Address review feedback * Separate comments by 2 spaces and fix other formatting issues * Make HighBd an auto-property * Replace if-chain with if-else-chain * Fix new naming rule violations --------- Co-authored-by: Ac_K <Acoustik666@gmail.com>
Diffstat (limited to 'src/Ryujinx.Graphics.Nvdec.Vp9/Types/Mv.cs')
-rw-r--r--src/Ryujinx.Graphics.Nvdec.Vp9/Types/Mv.cs22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/Ryujinx.Graphics.Nvdec.Vp9/Types/Mv.cs b/src/Ryujinx.Graphics.Nvdec.Vp9/Types/Mv.cs
index 815bbb32..c78a80d0 100644
--- a/src/Ryujinx.Graphics.Nvdec.Vp9/Types/Mv.cs
+++ b/src/Ryujinx.Graphics.Nvdec.Vp9/Types/Mv.cs
@@ -51,13 +51,13 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10,
};
- public bool UseMvHp()
+ public readonly bool UseMvHp()
{
- const int kMvRefThresh = 64; // Threshold for use of high-precision 1/8 mv
- return Math.Abs(Row) < kMvRefThresh && Math.Abs(Col) < kMvRefThresh;
+ const int KMvRefThresh = 64; // Threshold for use of high-precision 1/8 mv
+ return Math.Abs(Row) < KMvRefThresh && Math.Abs(Col) < KMvRefThresh;
}
public static bool MvJointVertical(MvJointType type)
@@ -110,7 +110,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
else
{
int i;
- int b = c + Constants.Class0Bits - 1; // Number of bits
+ int b = c + Constants.Class0Bits - 1; // Number of bits
for (i = 0; i < b; ++i)
{
counts.Bits[comp][i][((d >> i) & 1)] += (uint)incr;
@@ -121,19 +121,17 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
}
}
- private MvJointType GetMvJoint()
+ private readonly MvJointType GetMvJoint()
{
if (Row == 0)
{
return Col == 0 ? MvJointType.MvJointZero : MvJointType.MvJointHnzvz;
}
- else
- {
- return Col == 0 ? MvJointType.MvJointHzvnz : MvJointType.MvJointHnzvnz;
- }
+
+ return Col == 0 ? MvJointType.MvJointHzvnz : MvJointType.MvJointHnzvnz;
}
- internal void IncMv(Ptr<Vp9BackwardUpdates> counts)
+ internal readonly void IncMv(Ptr<Vp9BackwardUpdates> counts)
{
if (!counts.IsNull)
{
@@ -158,7 +156,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
Row = (short)Math.Clamp(Row, minRow, maxRow);
}
- private const int MvBorder = (16 << 3); // Allow 16 pels in 1/8th pel units
+ private const int MvBorder = (16 << 3); // Allow 16 pels in 1/8th pel units
public void ClampMvRef(ref MacroBlockD xd)
{