BackwardUpdates.cs 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. using Ryujinx.Common.Memory;
  2. using Ryujinx.Graphics.Video;
  3. namespace Ryujinx.Graphics.Nvdec.Types.Vp9
  4. {
  5. struct BackwardUpdates
  6. {
  7. public Array7<Array3<Array2<uint>>> InterModeCounts;
  8. public Array4<Array10<uint>> YModeCounts;
  9. public Array10<Array10<uint>> UvModeCounts;
  10. public Array16<Array4<uint>> PartitionCounts;
  11. public Array4<Array3<uint>> SwitchableInterpsCount;
  12. public Array4<Array2<uint>> IntraInterCount;
  13. public Array5<Array2<uint>> CompInterCount;
  14. public Array5<Array2<Array2<uint>>> SingleRefCount;
  15. public Array5<Array2<uint>> CompRefCount;
  16. public Array2<Array4<uint>> Tx32x32;
  17. public Array2<Array3<uint>> Tx16x16;
  18. public Array2<Array2<uint>> Tx8x8;
  19. public Array3<Array2<uint>> MbSkipCount;
  20. public Array4<uint> Joints;
  21. public Array2<Array2<uint>> Sign;
  22. public Array2<Array11<uint>> Classes;
  23. public Array2<Array2<uint>> Class0;
  24. public Array2<Array10<Array2<uint>>> Bits;
  25. public Array2<Array2<Array4<uint>>> Class0Fp;
  26. public Array2<Array4<uint>> Fp;
  27. public Array2<Array2<uint>> Class0Hp;
  28. public Array2<Array2<uint>> Hp;
  29. public Array4<Array2<Array2<Array6<Array6<Array4<uint>>>>>> CoefCounts;
  30. public Array4<Array2<Array2<Array6<Array6<uint>>>>> EobCounts;
  31. public BackwardUpdates(ref Vp9BackwardUpdates counts)
  32. {
  33. InterModeCounts = new Array7<Array3<Array2<uint>>>();
  34. for (int i = 0; i < 7; i++)
  35. {
  36. InterModeCounts[i][0][0] = counts.InterMode[i][2];
  37. InterModeCounts[i][0][1] = counts.InterMode[i][0] + counts.InterMode[i][1] + counts.InterMode[i][3];
  38. InterModeCounts[i][1][0] = counts.InterMode[i][0];
  39. InterModeCounts[i][1][1] = counts.InterMode[i][1] + counts.InterMode[i][3];
  40. InterModeCounts[i][2][0] = counts.InterMode[i][1];
  41. InterModeCounts[i][2][1] = counts.InterMode[i][3];
  42. }
  43. YModeCounts = counts.YMode;
  44. UvModeCounts = counts.UvMode;
  45. PartitionCounts = counts.Partition;
  46. SwitchableInterpsCount = counts.SwitchableInterp;
  47. IntraInterCount = counts.IntraInter;
  48. CompInterCount = counts.CompInter;
  49. SingleRefCount = counts.SingleRef;
  50. CompRefCount = counts.CompRef;
  51. Tx32x32 = counts.Tx32x32;
  52. Tx16x16 = counts.Tx16x16;
  53. Tx8x8 = counts.Tx8x8;
  54. MbSkipCount = counts.Skip;
  55. Joints = counts.Joints;
  56. Sign = counts.Sign;
  57. Classes = counts.Classes;
  58. Class0 = counts.Class0;
  59. Bits = counts.Bits;
  60. Class0Fp = counts.Class0Fp;
  61. Fp = counts.Fp;
  62. Class0Hp = counts.Class0Hp;
  63. Hp = counts.Hp;
  64. CoefCounts = counts.Coef;
  65. EobCounts = counts.EobBranch;
  66. }
  67. }
  68. }