diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2020-07-12 00:07:01 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-12 05:07:01 +0200 |
| commit | 4d02a2d2c0451b4de1f6de3bbce54c457cacebe2 (patch) | |
| tree | 120fe4fb8cfa1ac1c6ef4c97d92be47e955e8c0f /Ryujinx.Graphics.Nvdec.Vp9/Constants.cs | |
| parent | 38b26cf4242999fa7d8c550993ac0940cd03d55f (diff) | |
New NVDEC and VIC implementation (#1384)
* Initial NVDEC and VIC implementation
* Update FFmpeg.AutoGen to 4.3.0
* Add nvdec dependencies for Windows
* Unify some VP9 structures
* Rename VP9 structure fields
* Improvements to Video API
* XML docs for Common.Memory
* Remove now unused or redundant overloads from MemoryAccessor
* NVDEC UV surface read/write scalar paths
* Add FIXME comments about hacky things/stuff that will need to be fixed in the future
* Cleaned up VP9 memory allocation
* Remove some debug logs
* Rename some VP9 structs
* Remove unused struct
* No need to compile Ryujinx.Graphics.Host1x with unsafe anymore
* Name AsyncWorkQueue threads to make debugging easier
* Make Vp9PictureInfo a ref struct
* LayoutConverter no longer needs the depth argument (broken by rebase)
* Pooling of VP9 buffers, plus fix a memory leak on VP9
* Really wish VS could rename projects properly...
* Address feedback
* Remove using
* Catch OperationCanceledException
* Add licensing informations
* Add THIRDPARTY.md to release too
Co-authored-by: Thog <me@thog.eu>
Diffstat (limited to 'Ryujinx.Graphics.Nvdec.Vp9/Constants.cs')
| -rw-r--r-- | Ryujinx.Graphics.Nvdec.Vp9/Constants.cs | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Nvdec.Vp9/Constants.cs b/Ryujinx.Graphics.Nvdec.Vp9/Constants.cs new file mode 100644 index 00000000..407e6f42 --- /dev/null +++ b/Ryujinx.Graphics.Nvdec.Vp9/Constants.cs @@ -0,0 +1,71 @@ +using Ryujinx.Graphics.Nvdec.Vp9.Types; + +namespace Ryujinx.Graphics.Nvdec.Vp9 +{ + internal static class Constants + { + public const int Vp9InterpExtend = 4; + + public const int MaxMbPlane = 3; + + public const int None = -1; + public const int IntraFrame = 0; + public const int LastFrame = 1; + public const int GoldenFrame = 2; + public const int AltRefFrame = 3; + public const int MaxRefFrames = 4; + + public const int MiSizeLog2 = 3; + public const int MiBlockSizeLog2 = 6 - MiSizeLog2; // 64 = 2^6 + + public const int MiSize = 1 << MiSizeLog2; // pixels per mi-unit + public const int MiBlockSize = 1 << MiBlockSizeLog2; // mi-units per max block + public const int MiMask = MiBlockSize - 1; + + public const int PartitionPloffset = 4; // number of probability models per block size + + /* Segment Feature Masks */ + public const int MaxMvRefCandidates = 2; + + public const int CompInterContexts = 5; + public const int RefContexts = 5; + + public const int EightTap = 0; + public const int EightTapSmooth = 1; + public const int EightTapSharp = 2; + public const int SwitchableFilters = 3; /* Number of switchable filters */ + public const int Bilinear = 3; + public const int Switchable = 4; /* should be the last one */ + + // Frame + public const int RefsPerFrame = 3; + + public const int NumPingPongBuffers = 2; + + public const int Class0Bits = 1; /* bits at integer precision for class 0 */ + public const int Class0Size = 1 << Class0Bits; + + public const int MvInUseBits = 14; + public const int MvUpp = (1 << MvInUseBits) - 1; + public const int MvLow = -(1 << MvInUseBits); + + // Coefficient token alphabet + public const int ZeroToken = 0; // 0 Extra Bits 0+0 + public const int OneToken = 1; // 1 Extra Bits 0+1 + public const int TwoToken = 2; // 2 Extra Bits 0+1 + + public const int PivotNode = 2; + + public const int Cat1MinVal = 5; + public const int Cat2MinVal = 7; + public const int Cat3MinVal = 11; + public const int Cat4MinVal = 19; + public const int Cat5MinVal = 35; + public const int Cat6MinVal = 67; + + public const int EobModelToken = 3; + + public const int SegmentAbsData = 1; + public const int MaxSegments = 8; + } +} |
