PictureInfo.cs 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. using Ryujinx.Common.Memory;
  2. using Ryujinx.Graphics.Video;
  3. namespace Ryujinx.Graphics.Nvdec.Types.Vp9
  4. {
  5. struct PictureInfo
  6. {
  7. public Array12<uint> Unknown0;
  8. public uint BitstreamSize;
  9. public uint IsEncrypted;
  10. public uint Unknown38;
  11. public uint Reserved3C;
  12. public uint BlockLayout; // Not supported on T210
  13. public uint WorkBufferSizeShr8;
  14. public FrameSize LastFrameSize;
  15. public FrameSize GoldenFrameSize;
  16. public FrameSize AltFrameSize;
  17. public FrameSize CurrentFrameSize;
  18. public FrameFlags Flags;
  19. public Array4<sbyte> RefFrameSignBias;
  20. public byte FirstLevel;
  21. public byte SharpnessLevel;
  22. public byte BaseQIndex;
  23. public byte YDcDeltaQ;
  24. public byte UvAcDeltaQ;
  25. public byte UvDcDeltaQ;
  26. public byte Lossless;
  27. public byte TxMode;
  28. public byte AllowHighPrecisionMv;
  29. public byte InterpFilter;
  30. public byte ReferenceMode;
  31. public sbyte CompFixedRef;
  32. public Array2<sbyte> CompVarRef;
  33. public byte Log2TileCols;
  34. public byte Log2TileRows;
  35. public Segmentation Seg;
  36. public LoopFilter Lf;
  37. public byte PaddingEB;
  38. public uint WorkBufferSizeShr8New; // Not supported on T210
  39. public uint SurfaceParams; // Not supported on T210
  40. public uint UnknownF4;
  41. public uint UnknownF8;
  42. public uint UnknownFC;
  43. public uint BitDepth => (SurfaceParams >> 1) & 0xf;
  44. public Vp9PictureInfo Convert()
  45. {
  46. return new Vp9PictureInfo()
  47. {
  48. IsKeyFrame = Flags.HasFlag(FrameFlags.IsKeyFrame),
  49. IntraOnly = Flags.HasFlag(FrameFlags.IntraOnly),
  50. UsePrevInFindMvRefs =
  51. !Flags.HasFlag(FrameFlags.ErrorResilientMode) &&
  52. !Flags.HasFlag(FrameFlags.FrameSizeChanged) &&
  53. !Flags.HasFlag(FrameFlags.IntraOnly) &&
  54. Flags.HasFlag(FrameFlags.LastShowFrame) &&
  55. !Flags.HasFlag(FrameFlags.LastFrameIsKeyFrame),
  56. RefFrameSignBias = RefFrameSignBias,
  57. BaseQIndex = BaseQIndex,
  58. YDcDeltaQ = YDcDeltaQ,
  59. UvDcDeltaQ = UvDcDeltaQ,
  60. UvAcDeltaQ = UvAcDeltaQ,
  61. Lossless = Lossless != 0,
  62. TransformMode = TxMode,
  63. AllowHighPrecisionMv = AllowHighPrecisionMv != 0,
  64. InterpFilter = InterpFilter,
  65. ReferenceMode = ReferenceMode,
  66. CompFixedRef = CompFixedRef,
  67. CompVarRef = CompVarRef,
  68. Log2TileCols = Log2TileCols,
  69. Log2TileRows = Log2TileRows,
  70. SegmentEnabled = Seg.Enabled != 0,
  71. SegmentMapUpdate = Seg.UpdateMap != 0,
  72. SegmentMapTemporalUpdate = Seg.TemporalUpdate != 0,
  73. SegmentAbsDelta = Seg.AbsDelta,
  74. SegmentFeatureEnable = Seg.FeatureMask,
  75. SegmentFeatureData = Seg.FeatureData,
  76. ModeRefDeltaEnabled = Lf.ModeRefDeltaEnabled != 0,
  77. RefDeltas = Lf.RefDeltas,
  78. ModeDeltas = Lf.ModeDeltas
  79. };
  80. }
  81. }
  82. }