EntropyProbs.cs 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. using Ryujinx.Common.Memory;
  2. using Ryujinx.Graphics.Video;
  3. namespace Ryujinx.Graphics.Nvdec.Types.Vp9
  4. {
  5. struct EntropyProbs
  6. {
  7. #pragma warning disable CS0649
  8. public Array10<Array10<Array8<byte>>> KfYModeProbE0ToE7;
  9. public Array10<Array10<byte>> KfYModeProbE8;
  10. public Array3<byte> Padding384;
  11. public Array7<byte> SegTreeProbs;
  12. public Array3<byte> SegPredProbs;
  13. public Array15<byte> Padding391;
  14. public Array10<Array8<byte>> KfUvModeProbE0ToE7;
  15. public Array10<byte> KfUvModeProbE8;
  16. public Array6<byte> Padding3FA;
  17. public Array7<Array4<byte>> InterModeProb;
  18. public Array4<byte> IntraInterProb;
  19. public Array10<Array8<byte>> UvModeProbE0ToE7;
  20. public Array2<Array1<byte>> Tx8x8Prob;
  21. public Array2<Array2<byte>> Tx16x16Prob;
  22. public Array2<Array3<byte>> Tx32x32Prob;
  23. public Array4<byte> YModeProbE8;
  24. public Array4<Array8<byte>> YModeProbE0ToE7;
  25. public Array16<Array4<byte>> KfPartitionProb;
  26. public Array16<Array4<byte>> PartitionProb;
  27. public Array10<byte> UvModeProbE8;
  28. public Array4<Array2<byte>> SwitchableInterpProb;
  29. public Array5<byte> CompInterProb;
  30. public Array4<byte> SkipProbs;
  31. public Array3<byte> Joints;
  32. public Array2<byte> Sign;
  33. public Array2<Array1<byte>> Class0;
  34. public Array2<Array3<byte>> Fp;
  35. public Array2<byte> Class0Hp;
  36. public Array2<byte> Hp;
  37. public Array2<Array10<byte>> Classes;
  38. public Array2<Array2<Array3<byte>>> Class0Fp;
  39. public Array2<Array10<byte>> Bits;
  40. public Array5<Array2<byte>> SingleRefProb;
  41. public Array5<byte> CompRefProb;
  42. public Array17<byte> Padding58F;
  43. public Array4<Array2<Array2<Array6<Array6<Array4<byte>>>>>> CoefProbs;
  44. #pragma warning restore CS0649
  45. public void Convert(ref Vp9EntropyProbs fc)
  46. {
  47. for (int i = 0; i < 10; i++)
  48. {
  49. for (int j = 0; j < 10; j++)
  50. {
  51. for (int k = 0; k < 9; k++)
  52. {
  53. fc.KfYModeProb[i][j][k] = k < 8 ? KfYModeProbE0ToE7[i][j][k] : KfYModeProbE8[i][j];
  54. }
  55. }
  56. }
  57. fc.SegTreeProb = SegTreeProbs;
  58. fc.SegPredProb = SegPredProbs;
  59. for (int i = 0; i < 7; i++)
  60. {
  61. for (int j = 0; j < 3; j++)
  62. {
  63. fc.InterModeProb[i][j] = InterModeProb[i][j];
  64. }
  65. }
  66. fc.IntraInterProb = IntraInterProb;
  67. for (int i = 0; i < 10; i++)
  68. {
  69. for (int j = 0; j < 9; j++)
  70. {
  71. fc.KfUvModeProb[i][j] = j < 8 ? KfUvModeProbE0ToE7[i][j] : KfUvModeProbE8[i];
  72. fc.UvModeProb[i][j] = j < 8 ? UvModeProbE0ToE7[i][j] : UvModeProbE8[i];
  73. }
  74. }
  75. fc.Tx8x8Prob = Tx8x8Prob;
  76. fc.Tx16x16Prob = Tx16x16Prob;
  77. fc.Tx32x32Prob = Tx32x32Prob;
  78. for (int i = 0; i < 4; i++)
  79. {
  80. for (int j = 0; j < 9; j++)
  81. {
  82. fc.YModeProb[i][j] = j < 8 ? YModeProbE0ToE7[i][j] : YModeProbE8[i];
  83. }
  84. }
  85. for (int i = 0; i < 16; i++)
  86. {
  87. for (int j = 0; j < 3; j++)
  88. {
  89. fc.KfPartitionProb[i][j] = KfPartitionProb[i][j];
  90. fc.PartitionProb[i][j] = PartitionProb[i][j];
  91. }
  92. }
  93. fc.SwitchableInterpProb = SwitchableInterpProb;
  94. fc.CompInterProb = CompInterProb;
  95. fc.SkipProb[0] = SkipProbs[0];
  96. fc.SkipProb[1] = SkipProbs[1];
  97. fc.SkipProb[2] = SkipProbs[2];
  98. fc.Joints = Joints;
  99. fc.Sign = Sign;
  100. fc.Class0 = Class0;
  101. fc.Fp = Fp;
  102. fc.Class0Hp = Class0Hp;
  103. fc.Hp = Hp;
  104. fc.Classes = Classes;
  105. fc.Class0Fp = Class0Fp;
  106. fc.Bits = Bits;
  107. fc.SingleRefProb = SingleRefProb;
  108. fc.CompRefProb = CompRefProb;
  109. for (int i = 0; i < 4; i++)
  110. {
  111. for (int j = 0; j < 2; j++)
  112. {
  113. for (int k = 0; k < 2; k++)
  114. {
  115. for (int l = 0; l < 6; l++)
  116. {
  117. for (int m = 0; m < 6; m++)
  118. {
  119. for (int n = 0; n < 3; n++)
  120. {
  121. fc.CoefProbs[i][j][k][l][m][n] = CoefProbs[i][j][k][l][m][n];
  122. }
  123. }
  124. }
  125. }
  126. }
  127. }
  128. }
  129. }
  130. }