mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-07-23 08:47:10 +02:00
parent
417df486b1
commit
361d0c5632
622 changed files with 3080 additions and 2652 deletions
|
@ -7,4 +7,4 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
public PredictionMode Mode;
|
||||
public Array2<Mv> Mv; // First, second inter predictor motion vectors
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
||||
namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
||||
{
|
||||
public enum BitstreamProfile
|
||||
{
|
||||
|
@ -8,4 +8,4 @@
|
|||
Profile3,
|
||||
MaxProfiles
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
||||
namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
||||
{
|
||||
internal enum BlockSize
|
||||
{
|
||||
|
@ -18,4 +18,4 @@
|
|||
BlockSizes,
|
||||
BlockInvalid = BlockSizes
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,4 +7,4 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
public ArrayPtr<byte> Buf;
|
||||
public int Stride;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using Ryujinx.Common.Memory;
|
||||
using Ryujinx.Common.Memory;
|
||||
|
||||
namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
||||
{
|
||||
|
@ -15,4 +15,4 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
// Frame buffers allocated internally by the codec.
|
||||
public InternalFrameBufferList IntFrameBuffers;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,4 +5,4 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
KeyFrame = 0,
|
||||
InterFrame = 1,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,4 +37,4 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
ModeDeltas[1] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,4 +7,4 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
public Array64<LoopFilterThresh> Lfthr;
|
||||
public Array8<Array4<Array2<byte>>> Lvl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,4 +21,4 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
public ushort Int4X4Uv;
|
||||
public Array64<byte> LflY;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,4 +12,4 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
public Array16<byte> HevThr;
|
||||
#pragma warning restore CS0649
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using Ryujinx.Common.Memory;
|
||||
using Ryujinx.Common.Memory;
|
||||
using Ryujinx.Graphics.Nvdec.Vp9.Common;
|
||||
using Ryujinx.Graphics.Video;
|
||||
|
||||
|
@ -55,7 +55,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
|
||||
public Ptr<InternalErrorInfo> ErrorInfo;
|
||||
|
||||
public int GetPredContextSegId()
|
||||
public readonly int GetPredContextSegId()
|
||||
{
|
||||
sbyte aboveSip = !AboveMi.IsNull ? AboveMi.Value.SegIdPredicted : (sbyte)0;
|
||||
sbyte leftSip = !LeftMi.IsNull ? LeftMi.Value.SegIdPredicted : (sbyte)0;
|
||||
|
@ -63,14 +63,14 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
return aboveSip + leftSip;
|
||||
}
|
||||
|
||||
public int GetSkipContext()
|
||||
public readonly int GetSkipContext()
|
||||
{
|
||||
int aboveSkip = !AboveMi.IsNull ? AboveMi.Value.Skip : 0;
|
||||
int leftSkip = !LeftMi.IsNull ? LeftMi.Value.Skip : 0;
|
||||
return aboveSkip + leftSkip;
|
||||
}
|
||||
|
||||
public int GetPredContextSwitchableInterp()
|
||||
public readonly int GetPredContextSwitchableInterp()
|
||||
{
|
||||
// Note:
|
||||
// The mode info data structure has a one element border above and to the
|
||||
|
@ -104,7 +104,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
// 1 - intra/inter, inter/intra
|
||||
// 2 - intra/--, --/intra
|
||||
// 3 - intra/intra
|
||||
public int GetIntraInterContext()
|
||||
public readonly int GetIntraInterContext()
|
||||
{
|
||||
if (!AboveMi.IsNull && !LeftMi.IsNull)
|
||||
{
|
||||
|
@ -127,7 +127,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
// The mode info data structure has a one element border above and to the
|
||||
// left of the entries corresponding to real blocks.
|
||||
// The prediction flags in these dummy entries are initialized to 0.
|
||||
public int GetTxSizeContext()
|
||||
public readonly int GetTxSizeContext()
|
||||
{
|
||||
int maxTxSize = (int)Luts.MaxTxSizeLookup[(int)Mi[0].Value.SbType];
|
||||
int aboveCtx = !AboveMi.IsNull && AboveMi.Value.Skip == 0 ? (int)AboveMi.Value.TxSize : maxTxSize;
|
||||
|
@ -190,4 +190,4 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,4 +19,4 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
// Log2 of N4W, N4H
|
||||
public byte N4Wl, N4Hl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using Ryujinx.Common.Memory;
|
||||
using Ryujinx.Common.Memory;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
||||
|
@ -32,7 +32,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
return SbType < BlockSize.Block8X8 ? Bmi[block].Mode : Mode;
|
||||
}
|
||||
|
||||
public TxSize GetUvTxSize(ref MacroBlockDPlane pd)
|
||||
public readonly TxSize GetUvTxSize(ref MacroBlockDPlane pd)
|
||||
{
|
||||
Debug.Assert(SbType < BlockSize.Block8X8 ||
|
||||
Luts.SsSizeLookup[(int)SbType][pd.SubsamplingX][pd.SubsamplingY] != BlockSize.BlockInvalid);
|
||||
|
@ -104,4 +104,4 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
return mv;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,4 +11,4 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
BothIntra = 6,
|
||||
InvalidCase = 9,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using Ryujinx.Common.Memory;
|
||||
using Ryujinx.Common.Memory;
|
||||
using Ryujinx.Graphics.Video;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
|
@ -44,7 +44,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
9, 9, 9, 9, 9, 9, 9, 9, 9, 10
|
||||
];
|
||||
|
||||
public bool UseHp()
|
||||
public readonly bool UseHp()
|
||||
{
|
||||
const int KMvRefThresh = 64; // Threshold for use of high-precision 1/8 mv
|
||||
return Math.Abs(Row) < KMvRefThresh && Math.Abs(Col) < KMvRefThresh;
|
||||
|
@ -52,12 +52,12 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
|
||||
public static bool JointVertical(MvJointType type)
|
||||
{
|
||||
return type == MvJointType.Hzvnz || type == MvJointType.Hnzvnz;
|
||||
return type is MvJointType.Hzvnz or MvJointType.Hnzvnz;
|
||||
}
|
||||
|
||||
public static bool JointHorizontal(MvJointType type)
|
||||
{
|
||||
return type == MvJointType.Hnzvz || type == MvJointType.Hnzvnz;
|
||||
return type is MvJointType.Hnzvz or MvJointType.Hnzvnz;
|
||||
}
|
||||
|
||||
private static int ClassBase(MvClassType c)
|
||||
|
@ -110,7 +110,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
}
|
||||
}
|
||||
|
||||
public MvJointType GetJoint()
|
||||
public readonly MvJointType GetJoint()
|
||||
{
|
||||
if (Row == 0)
|
||||
{
|
||||
|
@ -120,7 +120,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
return Col == 0 ? MvJointType.Hzvnz : MvJointType.Hnzvnz;
|
||||
}
|
||||
|
||||
internal void Inc(Ptr<Vp9BackwardUpdates> counts)
|
||||
internal readonly void Inc(Ptr<Vp9BackwardUpdates> counts)
|
||||
{
|
||||
if (!counts.IsNull)
|
||||
{
|
||||
|
@ -173,10 +173,10 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
}
|
||||
}
|
||||
|
||||
public bool IsValid()
|
||||
public readonly bool IsValid()
|
||||
{
|
||||
return Row is > Constants.MvLow and < Constants.MvUpp &&
|
||||
Col is > Constants.MvLow and < Constants.MvUpp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,4 +5,4 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
public int Row;
|
||||
public int Col;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,4 +14,4 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
Class9, /* (512, 1024] integer pel */
|
||||
Class10 /* (1024,2048] integer pel */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,4 +7,4 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
Hzvnz, /* Hor zero, vert nonzero */
|
||||
Hnzvnz /* Both components nonzero */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,4 +7,4 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
public Array2<Mv> Mv;
|
||||
public Array2<sbyte> RefFrame;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,4 +9,4 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
PartitionTypes,
|
||||
PartitionInvalid = PartitionTypes,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
||||
namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
||||
{
|
||||
internal enum PlaneType
|
||||
{
|
||||
|
@ -6,4 +6,4 @@
|
|||
Uv,
|
||||
PlaneTypes
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,4 +11,4 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
Col = col;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
||||
namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
||||
{
|
||||
internal enum PredictionMode
|
||||
{
|
||||
|
@ -18,4 +18,4 @@
|
|||
NewMv,
|
||||
MbModeCount
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,4 +8,4 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
public Surface Buf;
|
||||
public ScaleFactors Sf;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
||||
namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
||||
{
|
||||
internal struct RefCntBuffer
|
||||
{
|
||||
|
@ -9,4 +9,4 @@
|
|||
public VpxCodecFrameBuffer RawFrameBuffer;
|
||||
public Surface Buf;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
||||
namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
||||
{
|
||||
internal enum ReferenceMode
|
||||
{
|
||||
|
@ -7,4 +7,4 @@
|
|||
Select,
|
||||
ReferenceModes
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using Ryujinx.Common.Memory;
|
||||
using Ryujinx.Common.Memory;
|
||||
using System.Runtime.CompilerServices;
|
||||
using static Ryujinx.Graphics.Nvdec.Vp9.Dsp.Convolve;
|
||||
using static Ryujinx.Graphics.Nvdec.Vp9.Dsp.Filter;
|
||||
|
@ -123,18 +123,18 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
public int XStepQ4;
|
||||
public int YStepQ4;
|
||||
|
||||
public int ScaleValueX(int val)
|
||||
public readonly int ScaleValueX(int val)
|
||||
{
|
||||
return IsScaled() ? ScaledX(val) : val;
|
||||
}
|
||||
|
||||
public int ScaleValueY(int val)
|
||||
public readonly int ScaleValueY(int val)
|
||||
{
|
||||
return IsScaled() ? ScaledY(val) : val;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public unsafe void InterPredict(
|
||||
public readonly unsafe void InterPredict(
|
||||
int horiz,
|
||||
int vert,
|
||||
int avg,
|
||||
|
@ -182,7 +182,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public unsafe void HighbdInterPredict(
|
||||
public readonly unsafe void HighbdInterPredict(
|
||||
int horiz,
|
||||
int vert,
|
||||
int avg,
|
||||
|
@ -231,12 +231,12 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
}
|
||||
}
|
||||
|
||||
private int ScaledX(int val)
|
||||
private readonly int ScaledX(int val)
|
||||
{
|
||||
return (int)(((long)val * XScaleFp) >> RefScaleShift);
|
||||
}
|
||||
|
||||
private int ScaledY(int val)
|
||||
private readonly int ScaledY(int val)
|
||||
{
|
||||
return (int)(((long)val * YScaleFp) >> RefScaleShift);
|
||||
}
|
||||
|
@ -258,12 +258,12 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
return res;
|
||||
}
|
||||
|
||||
public bool IsValidScale()
|
||||
public readonly bool IsValidScale()
|
||||
{
|
||||
return XScaleFp != RefInvalidScale && YScaleFp != RefInvalidScale;
|
||||
}
|
||||
|
||||
public bool IsScaled()
|
||||
public readonly bool IsScaled()
|
||||
{
|
||||
return IsValidScale() && (XScaleFp != RefNoScale || YScaleFp != RefNoScale);
|
||||
}
|
||||
|
@ -291,4 +291,4 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
YStepQ4 = ScaledY(16);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
||||
namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
||||
{
|
||||
internal enum SegLvlFeatures
|
||||
{
|
||||
|
@ -8,4 +8,4 @@
|
|||
Skip, // Optional Segment (0,0) + skip mode
|
||||
Max // Number of features supported
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using Ryujinx.Common.Memory;
|
||||
using Ryujinx.Common.Memory;
|
||||
using Ryujinx.Graphics.Video;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
|
@ -161,4 +161,4 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using Ryujinx.Common.Memory;
|
||||
using Ryujinx.Common.Memory;
|
||||
using Ryujinx.Graphics.Nvdec.Vp9.Common;
|
||||
using Ryujinx.Graphics.Video;
|
||||
using System.Diagnostics;
|
||||
|
@ -26,7 +26,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
public readonly unsafe Plane UPlane => new((nint)UBuffer.ToPointer(), UBuffer.Length);
|
||||
public readonly unsafe Plane VPlane => new((nint)VBuffer.ToPointer(), VBuffer.Length);
|
||||
|
||||
public FrameField Field => FrameField.Progressive;
|
||||
public readonly FrameField Field => FrameField.Progressive;
|
||||
|
||||
public int Width { get; private set; }
|
||||
public int Height { get; private set; }
|
||||
|
@ -43,10 +43,10 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
public int FrameSize { get; private set; }
|
||||
public int Border { get; private set; }
|
||||
|
||||
public int YCropWidth => Width;
|
||||
public int YCropHeight => Height;
|
||||
public int UvCropWidth => UvWidth;
|
||||
public int UvCropHeight => UvHeight;
|
||||
public readonly int YCropWidth => Width;
|
||||
public readonly int YCropHeight => Height;
|
||||
public readonly int UvCropWidth => UvWidth;
|
||||
public readonly int UvCropHeight => UvHeight;
|
||||
|
||||
public ArrayPtr<byte> BufferAlloc;
|
||||
public int BufferAllocSz;
|
||||
|
@ -119,7 +119,6 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
VpxGetFrameBufferCbFnT cb,
|
||||
Ptr<InternalFrameBufferList> cbPriv)
|
||||
{
|
||||
int byteAlign = byteAlignment == 0 ? 1 : byteAlignment; // TODO: Is it safe to ignore the alignment?
|
||||
int alignedWidth = (width + 7) & ~7;
|
||||
int alignedHeight = (height + 7) & ~7;
|
||||
int yStride = (alignedWidth + (2 * border) + 31) & ~31;
|
||||
|
@ -135,8 +134,6 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
|
||||
ulong frameSize = (ulong)(1 + (useHighbitdepth ? 1 : 0)) * (yplaneSize + (2 * uvplaneSize));
|
||||
|
||||
ArrayPtr<byte> buf = ArrayPtr<byte>.Null;
|
||||
|
||||
// frame_size is stored in buffer_alloc_sz, which is an int. If it won't
|
||||
// fit, fail early.
|
||||
if (frameSize > int.MaxValue)
|
||||
|
@ -211,7 +208,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
SubsamplingX = ssX;
|
||||
SubsamplingY = ssY;
|
||||
|
||||
buf = BufferAlloc;
|
||||
ArrayPtr<byte> buf = BufferAlloc;
|
||||
if (useHighbitdepth)
|
||||
{
|
||||
// Store uint16 addresses when using 16bit framebuffers
|
||||
|
@ -231,7 +228,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
return 0;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
public readonly void Dispose()
|
||||
{
|
||||
Marshal.FreeHGlobal(_pointer);
|
||||
}
|
||||
|
|
|
@ -83,4 +83,4 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
Debug.Assert(minLog2TileCols <= maxLog2TileCols);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
||||
namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
||||
{
|
||||
public enum TxMode
|
||||
{
|
||||
|
@ -9,4 +9,4 @@
|
|||
TxModeSelect, // Transform specified for each block
|
||||
TxModes
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
||||
namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
||||
{
|
||||
public enum TxSize
|
||||
{
|
||||
|
@ -8,4 +8,4 @@
|
|||
Tx32X32, // 32x32 transform
|
||||
TxSizes
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
||||
namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
||||
{
|
||||
internal enum TxType
|
||||
{
|
||||
|
@ -8,4 +8,4 @@
|
|||
AdstAdst, // ADST in both directions
|
||||
TxTypes
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using Ryujinx.Common.Memory;
|
||||
using Ryujinx.Common.Memory;
|
||||
using Ryujinx.Graphics.Nvdec.Vp9.Common;
|
||||
using Ryujinx.Graphics.Nvdec.Vp9.Dsp;
|
||||
using Ryujinx.Graphics.Video;
|
||||
|
@ -148,7 +148,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
public ArrayPtr<sbyte> AboveSegContext;
|
||||
public ArrayPtr<sbyte> AboveContext;
|
||||
|
||||
public bool FrameIsIntraOnly()
|
||||
public readonly bool FrameIsIntraOnly()
|
||||
{
|
||||
return FrameType == FrameType.KeyFrame || IntraOnly;
|
||||
}
|
||||
|
@ -166,12 +166,12 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
return false;
|
||||
}
|
||||
|
||||
public ref Surface GetFrameNewBuffer()
|
||||
public readonly ref Surface GetFrameNewBuffer()
|
||||
{
|
||||
return ref BufferPool.Value.FrameBufs[NewFbIdx].Buf;
|
||||
}
|
||||
|
||||
public int GetFreeFb()
|
||||
public readonly int GetFreeFb()
|
||||
{
|
||||
ref Array12<RefCntBuffer> frameBufs = ref BufferPool.Value.FrameBufs;
|
||||
|
||||
|
@ -233,7 +233,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
allocator.Allocate<TileWorkerData>((tileCols * tileRows) + (maxThreads > 1 ? maxThreads : 0));
|
||||
}
|
||||
|
||||
public void FreeTileWorkerData(MemoryAllocator allocator)
|
||||
public readonly void FreeTileWorkerData(MemoryAllocator allocator)
|
||||
{
|
||||
allocator.Free(TileWorkerData);
|
||||
}
|
||||
|
@ -357,7 +357,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
}
|
||||
}
|
||||
|
||||
private void SetPartitionProbs(ref MacroBlockD xd)
|
||||
private readonly void SetPartitionProbs(ref MacroBlockD xd)
|
||||
{
|
||||
xd.PartitionProbs = FrameIsIntraOnly()
|
||||
? new ArrayPtr<Array3<byte>>(ref Fc.Value.KfPartitionProb[0], 16)
|
||||
|
@ -429,7 +429,6 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
{
|
||||
ref Vp9EntropyProbs fc = ref Fc.Value;
|
||||
|
||||
|
||||
if (ReferenceMode == ReferenceMode.Select)
|
||||
{
|
||||
for (int i = 0; i < Constants.CompInterContexts; ++i)
|
||||
|
@ -490,7 +489,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
}
|
||||
}
|
||||
|
||||
public void InitMvProbs()
|
||||
public readonly void InitMvProbs()
|
||||
{
|
||||
Fc.Value.Joints[0] = 32;
|
||||
Fc.Value.Joints[1] = 64;
|
||||
|
@ -684,11 +683,10 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
|
||||
public void SetupTileInfo(ref ReadBitBuffer rb)
|
||||
{
|
||||
int minLog2TileCols = 0, maxLog2TileCols = 0, maxOnes;
|
||||
TileInfo.GetTileNBits(MiCols, out minLog2TileCols, out maxLog2TileCols);
|
||||
TileInfo.GetTileNBits(MiCols, out int minLog2TileCols, out int maxLog2TileCols);
|
||||
|
||||
// columns
|
||||
maxOnes = maxLog2TileCols - minLog2TileCols;
|
||||
int maxOnes = maxLog2TileCols - minLog2TileCols;
|
||||
Log2TileCols = minLog2TileCols;
|
||||
while (maxOnes-- != 0 && rb.ReadBit() != 0)
|
||||
{
|
||||
|
@ -725,7 +723,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
if (ColorSpace != VpxColorSpace.Srgb)
|
||||
{
|
||||
ColorRange = (VpxColorRange)rb.ReadBit();
|
||||
if (Profile == BitstreamProfile.Profile1 || Profile == BitstreamProfile.Profile3)
|
||||
if (Profile is BitstreamProfile.Profile1 or BitstreamProfile.Profile3)
|
||||
{
|
||||
SubsamplingX = rb.ReadBit();
|
||||
SubsamplingY = rb.ReadBit();
|
||||
|
@ -748,7 +746,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
else
|
||||
{
|
||||
ColorRange = VpxColorRange.Full;
|
||||
if (Profile == BitstreamProfile.Profile1 || Profile == BitstreamProfile.Profile3)
|
||||
if (Profile is BitstreamProfile.Profile1 or BitstreamProfile.Profile3)
|
||||
{
|
||||
// Note if colorspace is SRGB then 4:4:4 chroma sampling is assumed.
|
||||
// 4:2:2 or 4:4:0 chroma sampling is not allowed.
|
||||
|
@ -988,7 +986,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
}
|
||||
}
|
||||
|
||||
public void DefaultCoefProbs()
|
||||
public readonly void DefaultCoefProbs()
|
||||
{
|
||||
Entropy.CopyProbs(ref Fc.Value.CoefProbs[(int)TxSize.Tx4X4], Entropy.DefaultCoefProbs4X4);
|
||||
Entropy.CopyProbs(ref Fc.Value.CoefProbs[(int)TxSize.Tx8X8], Entropy.DefaultCoefProbs8X8);
|
||||
|
@ -996,4 +994,4 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
Entropy.CopyProbs(ref Fc.Value.CoefProbs[(int)TxSize.Tx32X32], Entropy.DefaultCoefProbs32X32);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using Ryujinx.Common.Memory;
|
||||
using Ryujinx.Common.Memory;
|
||||
using Ryujinx.Graphics.Nvdec.Vp9.Common;
|
||||
using Ryujinx.Graphics.Video;
|
||||
using System.Diagnostics;
|
||||
|
@ -279,9 +279,8 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
ArrayPtr<byte> dataStart = data;
|
||||
CodecErr res;
|
||||
Array8<uint> frameSizes = new();
|
||||
int frameCount = 0;
|
||||
|
||||
res = Decoder.ParseSuperframeIndex(data, (ulong)data.Length, ref frameSizes, out frameCount);
|
||||
res = Decoder.ParseSuperframeIndex(data, (ulong)data.Length, ref frameSizes, out int frameCount);
|
||||
if (res != CodecErr.Ok)
|
||||
{
|
||||
return res;
|
||||
|
@ -407,4 +406,4 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
return CodecErr.Ok;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using Ryujinx.Common.Memory;
|
||||
using Ryujinx.Common.Memory;
|
||||
|
||||
namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
||||
{
|
||||
|
@ -7,4 +7,4 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
|||
public ArrayPtr<byte> Data;
|
||||
public Ptr<InternalFrameBuffer> Priv;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
||||
namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
||||
{
|
||||
internal enum VpxColorRange
|
||||
{
|
||||
|
@ -8,4 +8,4 @@
|
|||
// YUV/RGB [0..255]
|
||||
Full
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
||||
namespace Ryujinx.Graphics.Nvdec.Vp9.Types
|
||||
{
|
||||
internal enum VpxColorSpace
|
||||
{
|
||||
|
@ -26,4 +26,4 @@
|
|||
// sRGB
|
||||
Srgb
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue