4d02a2d2c0
* 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>
85 lines
3.2 KiB
C#
85 lines
3.2 KiB
C#
using Ryujinx.Common.Memory;
|
|
using Ryujinx.Graphics.Video;
|
|
|
|
namespace Ryujinx.Graphics.Nvdec.Types.Vp9
|
|
{
|
|
struct PictureInfo
|
|
{
|
|
public Array12<uint> Unknown0;
|
|
public uint BitstreamSize;
|
|
public uint IsEncrypted;
|
|
public uint Unknown38;
|
|
public uint Reserved3C;
|
|
public uint BlockLayout; // Not supported on T210
|
|
public uint WorkBufferSizeShr8;
|
|
public FrameSize LastFrameSize;
|
|
public FrameSize GoldenFrameSize;
|
|
public FrameSize AltFrameSize;
|
|
public FrameSize CurrentFrameSize;
|
|
public FrameFlags Flags;
|
|
public Array4<sbyte> RefFrameSignBias;
|
|
public byte FirstLevel;
|
|
public byte SharpnessLevel;
|
|
public byte BaseQIndex;
|
|
public byte YDcDeltaQ;
|
|
public byte UvAcDeltaQ;
|
|
public byte UvDcDeltaQ;
|
|
public byte Lossless;
|
|
public byte TxMode;
|
|
public byte AllowHighPrecisionMv;
|
|
public byte InterpFilter;
|
|
public byte ReferenceMode;
|
|
public sbyte CompFixedRef;
|
|
public Array2<sbyte> CompVarRef;
|
|
public byte Log2TileCols;
|
|
public byte Log2TileRows;
|
|
public Segmentation Seg;
|
|
public LoopFilter Lf;
|
|
public byte PaddingEB;
|
|
public uint WorkBufferSizeShr8New; // Not supported on T210
|
|
public uint SurfaceParams; // Not supported on T210
|
|
public uint UnknownF4;
|
|
public uint UnknownF8;
|
|
public uint UnknownFC;
|
|
|
|
public uint BitDepth => (SurfaceParams >> 1) & 0xf;
|
|
|
|
public Vp9PictureInfo Convert()
|
|
{
|
|
return new Vp9PictureInfo()
|
|
{
|
|
IsKeyFrame = Flags.HasFlag(FrameFlags.IsKeyFrame),
|
|
IntraOnly = Flags.HasFlag(FrameFlags.IntraOnly),
|
|
UsePrevInFindMvRefs =
|
|
!Flags.HasFlag(FrameFlags.ErrorResilientMode) &&
|
|
!Flags.HasFlag(FrameFlags.FrameSizeChanged) &&
|
|
!Flags.HasFlag(FrameFlags.IntraOnly) &&
|
|
Flags.HasFlag(FrameFlags.LastShowFrame) &&
|
|
!Flags.HasFlag(FrameFlags.LastFrameIsKeyFrame),
|
|
RefFrameSignBias = RefFrameSignBias,
|
|
BaseQIndex = BaseQIndex,
|
|
YDcDeltaQ = YDcDeltaQ,
|
|
UvDcDeltaQ = UvDcDeltaQ,
|
|
UvAcDeltaQ = UvAcDeltaQ,
|
|
Lossless = Lossless != 0,
|
|
TransformMode = TxMode,
|
|
AllowHighPrecisionMv = AllowHighPrecisionMv != 0,
|
|
InterpFilter = InterpFilter,
|
|
ReferenceMode = ReferenceMode,
|
|
CompFixedRef = CompFixedRef,
|
|
CompVarRef = CompVarRef,
|
|
Log2TileCols = Log2TileCols,
|
|
Log2TileRows = Log2TileRows,
|
|
SegmentEnabled = Seg.Enabled != 0,
|
|
SegmentMapUpdate = Seg.UpdateMap != 0,
|
|
SegmentMapTemporalUpdate = Seg.TemporalUpdate != 0,
|
|
SegmentAbsDelta = Seg.AbsDelta,
|
|
SegmentFeatureEnable = Seg.FeatureMask,
|
|
SegmentFeatureData = Seg.FeatureData,
|
|
ModeRefDeltaEnabled = Lf.ModeRefDeltaEnabled != 0,
|
|
RefDeltas = Lf.RefDeltas,
|
|
ModeDeltas = Lf.ModeDeltas
|
|
};
|
|
}
|
|
}
|
|
}
|