EntropyProbs.cs 4.8 KB

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