mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2026-05-10 23:35:47 +00:00
misc: chore: VP9 project cleanup
Target-typed new, remove var usage, use collection expressions, rename many fields & properties to match C# standard
This commit is contained in:
@@ -34,17 +34,17 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
return (ushort)((a + b + 1) >> 1);
|
||||
}
|
||||
|
||||
public static unsafe void D207Predictor8x8(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void D207Predictor8X8(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
D207Predictor(dst, stride, 8, above, left);
|
||||
}
|
||||
|
||||
public static unsafe void D207Predictor16x16(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void D207Predictor16X16(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
D207Predictor(dst, stride, 16, above, left);
|
||||
}
|
||||
|
||||
public static unsafe void D207Predictor32x32(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void D207Predictor32X32(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
D207Predictor(dst, stride, 32, above, left);
|
||||
}
|
||||
@@ -85,17 +85,17 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
}
|
||||
|
||||
public static unsafe void D63Predictor8x8(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void D63Predictor8X8(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
D63Predictor(dst, stride, 8, above, left);
|
||||
}
|
||||
|
||||
public static unsafe void D63Predictor16x16(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void D63Predictor16X16(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
D63Predictor(dst, stride, 16, above, left);
|
||||
}
|
||||
|
||||
public static unsafe void D63Predictor32x32(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void D63Predictor32X32(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
D63Predictor(dst, stride, 32, above, left);
|
||||
}
|
||||
@@ -117,17 +117,17 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
}
|
||||
|
||||
public static unsafe void D45Predictor8x8(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void D45Predictor8X8(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
D45Predictor(dst, stride, 8, above, left);
|
||||
}
|
||||
|
||||
public static unsafe void D45Predictor16x16(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void D45Predictor16X16(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
D45Predictor(dst, stride, 16, above, left);
|
||||
}
|
||||
|
||||
public static unsafe void D45Predictor32x32(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void D45Predictor32X32(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
D45Predictor(dst, stride, 32, above, left);
|
||||
}
|
||||
@@ -152,17 +152,17 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
}
|
||||
|
||||
public static unsafe void D117Predictor8x8(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void D117Predictor8X8(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
D117Predictor(dst, stride, 8, above, left);
|
||||
}
|
||||
|
||||
public static unsafe void D117Predictor16x16(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void D117Predictor16X16(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
D117Predictor(dst, stride, 16, above, left);
|
||||
}
|
||||
|
||||
public static unsafe void D117Predictor32x32(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void D117Predictor32X32(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
D117Predictor(dst, stride, 32, above, left);
|
||||
}
|
||||
@@ -205,17 +205,17 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
}
|
||||
|
||||
public static unsafe void D135Predictor8x8(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void D135Predictor8X8(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
D135Predictor(dst, stride, 8, above, left);
|
||||
}
|
||||
|
||||
public static unsafe void D135Predictor16x16(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void D135Predictor16X16(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
D135Predictor(dst, stride, 16, above, left);
|
||||
}
|
||||
|
||||
public static unsafe void D135Predictor32x32(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void D135Predictor32X32(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
D135Predictor(dst, stride, 32, above, left);
|
||||
}
|
||||
@@ -245,17 +245,17 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
}
|
||||
|
||||
public static unsafe void D153Predictor8x8(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void D153Predictor8X8(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
D153Predictor(dst, stride, 8, above, left);
|
||||
}
|
||||
|
||||
public static unsafe void D153Predictor16x16(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void D153Predictor16X16(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
D153Predictor(dst, stride, 16, above, left);
|
||||
}
|
||||
|
||||
public static unsafe void D153Predictor32x32(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void D153Predictor32X32(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
D153Predictor(dst, stride, 32, above, left);
|
||||
}
|
||||
@@ -297,22 +297,22 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
}
|
||||
|
||||
public static unsafe void VPredictor4x4(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void VPredictor4X4(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
VPredictor(dst, stride, 4, above, left);
|
||||
}
|
||||
|
||||
public static unsafe void VPredictor8x8(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void VPredictor8X8(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
VPredictor(dst, stride, 8, above, left);
|
||||
}
|
||||
|
||||
public static unsafe void VPredictor16x16(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void VPredictor16X16(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
VPredictor(dst, stride, 16, above, left);
|
||||
}
|
||||
|
||||
public static unsafe void VPredictor32x32(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void VPredictor32X32(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
VPredictor(dst, stride, 32, above, left);
|
||||
}
|
||||
@@ -326,22 +326,22 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
}
|
||||
|
||||
public static unsafe void HPredictor4x4(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void HPredictor4X4(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
HPredictor(dst, stride, 4, above, left);
|
||||
}
|
||||
|
||||
public static unsafe void HPredictor8x8(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void HPredictor8X8(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
HPredictor(dst, stride, 8, above, left);
|
||||
}
|
||||
|
||||
public static unsafe void HPredictor16x16(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void HPredictor16X16(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
HPredictor(dst, stride, 16, above, left);
|
||||
}
|
||||
|
||||
public static unsafe void HPredictor32x32(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void HPredictor32X32(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
HPredictor(dst, stride, 32, above, left);
|
||||
}
|
||||
@@ -355,22 +355,22 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
}
|
||||
|
||||
public static unsafe void TmPredictor4x4(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void TmPredictor4X4(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
TmPredictor(dst, stride, 4, above, left);
|
||||
}
|
||||
|
||||
public static unsafe void TmPredictor8x8(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void TmPredictor8X8(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
TmPredictor(dst, stride, 8, above, left);
|
||||
}
|
||||
|
||||
public static unsafe void TmPredictor16x16(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void TmPredictor16X16(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
TmPredictor(dst, stride, 16, above, left);
|
||||
}
|
||||
|
||||
public static unsafe void TmPredictor32x32(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void TmPredictor32X32(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
TmPredictor(dst, stride, 32, above, left);
|
||||
}
|
||||
@@ -390,22 +390,22 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
}
|
||||
|
||||
public static unsafe void Dc128Predictor4x4(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void Dc128Predictor4X4(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
Dc128Predictor(dst, stride, 4, above, left);
|
||||
}
|
||||
|
||||
public static unsafe void Dc128Predictor8x8(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void Dc128Predictor8X8(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
Dc128Predictor(dst, stride, 8, above, left);
|
||||
}
|
||||
|
||||
public static unsafe void Dc128Predictor16x16(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void Dc128Predictor16X16(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
Dc128Predictor(dst, stride, 16, above, left);
|
||||
}
|
||||
|
||||
public static unsafe void Dc128Predictor32x32(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void Dc128Predictor32X32(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
Dc128Predictor(dst, stride, 32, above, left);
|
||||
}
|
||||
@@ -419,36 +419,36 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
}
|
||||
|
||||
public static unsafe void DcLeftPredictor4x4(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void DcLeftPredictor4X4(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
DcLeftPredictor(dst, stride, 4, above, left);
|
||||
}
|
||||
|
||||
public static unsafe void DcLeftPredictor8x8(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void DcLeftPredictor8X8(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
DcLeftPredictor(dst, stride, 8, above, left);
|
||||
}
|
||||
|
||||
public static unsafe void DcLeftPredictor16x16(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void DcLeftPredictor16X16(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
DcLeftPredictor(dst, stride, 16, above, left);
|
||||
}
|
||||
|
||||
public static unsafe void DcLeftPredictor32x32(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void DcLeftPredictor32X32(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
DcLeftPredictor(dst, stride, 32, above, left);
|
||||
}
|
||||
|
||||
private static unsafe void DcLeftPredictor(byte* dst, int stride, int bs, byte* above, byte* left)
|
||||
{
|
||||
int expectedDc, sum = 0;
|
||||
int sum = 0;
|
||||
|
||||
for (int i = 0; i < bs; i++)
|
||||
{
|
||||
sum += left[i];
|
||||
}
|
||||
|
||||
expectedDc = (sum + (bs >> 1)) / bs;
|
||||
int expectedDc = (sum + (bs >> 1)) / bs;
|
||||
|
||||
for (int r = 0; r < bs; r++)
|
||||
{
|
||||
@@ -457,36 +457,36 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
}
|
||||
|
||||
public static unsafe void DcTopPredictor4x4(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void DcTopPredictor4X4(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
DcTopPredictor(dst, stride, 4, above, left);
|
||||
}
|
||||
|
||||
public static unsafe void DcTopPredictor8x8(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void DcTopPredictor8X8(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
DcTopPredictor(dst, stride, 8, above, left);
|
||||
}
|
||||
|
||||
public static unsafe void DcTopPredictor16x16(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void DcTopPredictor16X16(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
DcTopPredictor(dst, stride, 16, above, left);
|
||||
}
|
||||
|
||||
public static unsafe void DcTopPredictor32x32(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void DcTopPredictor32X32(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
DcTopPredictor(dst, stride, 32, above, left);
|
||||
}
|
||||
|
||||
private static unsafe void DcTopPredictor(byte* dst, int stride, int bs, byte* above, byte* left)
|
||||
{
|
||||
int expectedDc, sum = 0;
|
||||
int sum = 0;
|
||||
|
||||
for (int i = 0; i < bs; i++)
|
||||
{
|
||||
sum += above[i];
|
||||
}
|
||||
|
||||
expectedDc = (sum + (bs >> 1)) / bs;
|
||||
int expectedDc = (sum + (bs >> 1)) / bs;
|
||||
|
||||
for (int r = 0; r < bs; r++)
|
||||
{
|
||||
@@ -495,29 +495,29 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
}
|
||||
|
||||
public static unsafe void DcPredictor4x4(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void DcPredictor4X4(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
DcPredictor(dst, stride, 4, above, left);
|
||||
}
|
||||
|
||||
public static unsafe void DcPredictor8x8(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void DcPredictor8X8(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
DcPredictor(dst, stride, 8, above, left);
|
||||
}
|
||||
|
||||
public static unsafe void DcPredictor16x16(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void DcPredictor16X16(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
DcPredictor(dst, stride, 16, above, left);
|
||||
}
|
||||
|
||||
public static unsafe void DcPredictor32x32(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void DcPredictor32X32(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
DcPredictor(dst, stride, 32, above, left);
|
||||
}
|
||||
|
||||
private static unsafe void DcPredictor(byte* dst, int stride, int bs, byte* above, byte* left)
|
||||
{
|
||||
int expectedDc, sum = 0;
|
||||
int sum = 0;
|
||||
int count = 2 * bs;
|
||||
|
||||
for (int i = 0; i < bs; i++)
|
||||
@@ -526,7 +526,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
sum += left[i];
|
||||
}
|
||||
|
||||
expectedDc = (sum + (count >> 1)) / count;
|
||||
int expectedDc = (sum + (count >> 1)) / count;
|
||||
|
||||
for (int r = 0; r < bs; r++)
|
||||
{
|
||||
@@ -535,31 +535,31 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
}
|
||||
|
||||
public static unsafe void HePredictor4x4(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void HePredictor4X4(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
byte h = above[-1];
|
||||
byte I = left[0];
|
||||
byte i = left[0];
|
||||
byte j = left[1];
|
||||
byte k = left[2];
|
||||
byte l = left[3];
|
||||
|
||||
MemoryUtil.Fill(dst + (stride * 0), Avg3(h, I, j), 4);
|
||||
MemoryUtil.Fill(dst + (stride * 1), Avg3(I, j, k), 4);
|
||||
MemoryUtil.Fill(dst + (stride * 0), Avg3(h, i, j), 4);
|
||||
MemoryUtil.Fill(dst + (stride * 1), Avg3(i, j, k), 4);
|
||||
MemoryUtil.Fill(dst + (stride * 2), Avg3(j, k, l), 4);
|
||||
MemoryUtil.Fill(dst + (stride * 3), Avg3(k, l, l), 4);
|
||||
}
|
||||
|
||||
public static unsafe void VePredictor4x4(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void VePredictor4X4(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
byte h = above[-1];
|
||||
byte I = above[0];
|
||||
byte i = above[0];
|
||||
byte j = above[1];
|
||||
byte k = above[2];
|
||||
byte l = above[3];
|
||||
byte m = above[4];
|
||||
|
||||
dst[0] = Avg3(h, I, j);
|
||||
dst[1] = Avg3(I, j, k);
|
||||
dst[0] = Avg3(h, i, j);
|
||||
dst[1] = Avg3(i, j, k);
|
||||
dst[2] = Avg3(j, k, l);
|
||||
dst[3] = Avg3(k, l, m);
|
||||
MemoryUtil.Copy(dst + (stride * 1), dst, 4);
|
||||
@@ -567,23 +567,23 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
MemoryUtil.Copy(dst + (stride * 3), dst, 4);
|
||||
}
|
||||
|
||||
public static unsafe void D207Predictor4x4(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void D207Predictor4X4(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
byte I = left[0];
|
||||
byte i = left[0];
|
||||
byte j = left[1];
|
||||
byte k = left[2];
|
||||
byte l = left[3];
|
||||
Dst(dst, stride, 0, 0) = Avg2(I, j);
|
||||
Dst(dst, stride, 0, 0) = Avg2(i, j);
|
||||
Dst(dst, stride, 2, 0) = Dst(dst, stride, 0, 1) = Avg2(j, k);
|
||||
Dst(dst, stride, 2, 1) = Dst(dst, stride, 0, 2) = Avg2(k, l);
|
||||
Dst(dst, stride, 1, 0) = Avg3(I, j, k);
|
||||
Dst(dst, stride, 1, 0) = Avg3(i, j, k);
|
||||
Dst(dst, stride, 3, 0) = Dst(dst, stride, 1, 1) = Avg3(j, k, l);
|
||||
Dst(dst, stride, 3, 1) = Dst(dst, stride, 1, 2) = Avg3(k, l, l);
|
||||
Dst(dst, stride, 3, 2) = Dst(dst, stride, 2, 2) = Dst(dst, stride, 0, 3) =
|
||||
Dst(dst, stride, 1, 3) = Dst(dst, stride, 2, 3) = Dst(dst, stride, 3, 3) = l;
|
||||
}
|
||||
|
||||
public static unsafe void D63Predictor4x4(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void D63Predictor4X4(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
byte a = above[0];
|
||||
byte b = above[1];
|
||||
@@ -605,7 +605,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
Dst(dst, stride, 3, 3) = Avg3(e, f, g); // Differs from vp8
|
||||
}
|
||||
|
||||
public static unsafe void D63EPredictor4x4(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void D63EPredictor4X4(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
byte a = above[0];
|
||||
byte b = above[1];
|
||||
@@ -628,7 +628,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
Dst(dst, stride, 3, 3) = Avg3(f, g, h);
|
||||
}
|
||||
|
||||
public static unsafe void D45Predictor4x4(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void D45Predictor4X4(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
byte a = above[0];
|
||||
byte b = above[1];
|
||||
@@ -648,7 +648,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
Dst(dst, stride, 3, 3) = h; // differs from vp8
|
||||
}
|
||||
|
||||
public static unsafe void D45EPredictor4x4(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void D45EPredictor4X4(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
byte a = above[0];
|
||||
byte b = above[1];
|
||||
@@ -668,9 +668,9 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
Dst(dst, stride, 3, 3) = Avg3(g, h, h);
|
||||
}
|
||||
|
||||
public static unsafe void D117Predictor4x4(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void D117Predictor4X4(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
byte I = left[0];
|
||||
byte i = left[0];
|
||||
byte j = left[1];
|
||||
byte k = left[2];
|
||||
byte x = above[-1];
|
||||
@@ -683,17 +683,17 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
Dst(dst, stride, 2, 0) = Dst(dst, stride, 3, 2) = Avg2(b, c);
|
||||
Dst(dst, stride, 3, 0) = Avg2(c, d);
|
||||
|
||||
Dst(dst, stride, 0, 3) = Avg3(k, j, I);
|
||||
Dst(dst, stride, 0, 2) = Avg3(j, I, x);
|
||||
Dst(dst, stride, 0, 1) = Dst(dst, stride, 1, 3) = Avg3(I, x, a);
|
||||
Dst(dst, stride, 0, 3) = Avg3(k, j, i);
|
||||
Dst(dst, stride, 0, 2) = Avg3(j, i, x);
|
||||
Dst(dst, stride, 0, 1) = Dst(dst, stride, 1, 3) = Avg3(i, x, a);
|
||||
Dst(dst, stride, 1, 1) = Dst(dst, stride, 2, 3) = Avg3(x, a, b);
|
||||
Dst(dst, stride, 2, 1) = Dst(dst, stride, 3, 3) = Avg3(a, b, c);
|
||||
Dst(dst, stride, 3, 1) = Avg3(b, c, d);
|
||||
}
|
||||
|
||||
public static unsafe void D135Predictor4x4(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void D135Predictor4X4(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
byte I = left[0];
|
||||
byte i = left[0];
|
||||
byte j = left[1];
|
||||
byte k = left[2];
|
||||
byte l = left[3];
|
||||
@@ -703,18 +703,18 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
byte c = above[2];
|
||||
byte d = above[3];
|
||||
Dst(dst, stride, 0, 3) = Avg3(j, k, l);
|
||||
Dst(dst, stride, 1, 3) = Dst(dst, stride, 0, 2) = Avg3(I, j, k);
|
||||
Dst(dst, stride, 2, 3) = Dst(dst, stride, 1, 2) = Dst(dst, stride, 0, 1) = Avg3(x, I, j);
|
||||
Dst(dst, stride, 1, 3) = Dst(dst, stride, 0, 2) = Avg3(i, j, k);
|
||||
Dst(dst, stride, 2, 3) = Dst(dst, stride, 1, 2) = Dst(dst, stride, 0, 1) = Avg3(x, i, j);
|
||||
Dst(dst, stride, 3, 3) =
|
||||
Dst(dst, stride, 2, 2) = Dst(dst, stride, 1, 1) = Dst(dst, stride, 0, 0) = Avg3(a, x, I);
|
||||
Dst(dst, stride, 2, 2) = Dst(dst, stride, 1, 1) = Dst(dst, stride, 0, 0) = Avg3(a, x, i);
|
||||
Dst(dst, stride, 3, 2) = Dst(dst, stride, 2, 1) = Dst(dst, stride, 1, 0) = Avg3(b, a, x);
|
||||
Dst(dst, stride, 3, 1) = Dst(dst, stride, 2, 0) = Avg3(c, b, a);
|
||||
Dst(dst, stride, 3, 0) = Avg3(d, c, b);
|
||||
}
|
||||
|
||||
public static unsafe void D153Predictor4x4(byte* dst, int stride, byte* above, byte* left)
|
||||
public static unsafe void D153Predictor4X4(byte* dst, int stride, byte* above, byte* left)
|
||||
{
|
||||
byte I = left[0];
|
||||
byte i = left[0];
|
||||
byte j = left[1];
|
||||
byte k = left[2];
|
||||
byte l = left[3];
|
||||
@@ -722,30 +722,30 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
byte a = above[0];
|
||||
byte b = above[1];
|
||||
byte c = above[2];
|
||||
Dst(dst, stride, 0, 0) = Dst(dst, stride, 2, 1) = Avg2(I, x);
|
||||
Dst(dst, stride, 0, 1) = Dst(dst, stride, 2, 2) = Avg2(j, I);
|
||||
Dst(dst, stride, 0, 0) = Dst(dst, stride, 2, 1) = Avg2(i, x);
|
||||
Dst(dst, stride, 0, 1) = Dst(dst, stride, 2, 2) = Avg2(j, i);
|
||||
Dst(dst, stride, 0, 2) = Dst(dst, stride, 2, 3) = Avg2(k, j);
|
||||
Dst(dst, stride, 0, 3) = Avg2(l, k);
|
||||
|
||||
Dst(dst, stride, 3, 0) = Avg3(a, b, c);
|
||||
Dst(dst, stride, 2, 0) = Avg3(x, a, b);
|
||||
Dst(dst, stride, 1, 0) = Dst(dst, stride, 3, 1) = Avg3(I, x, a);
|
||||
Dst(dst, stride, 1, 1) = Dst(dst, stride, 3, 2) = Avg3(j, I, x);
|
||||
Dst(dst, stride, 1, 2) = Dst(dst, stride, 3, 3) = Avg3(k, j, I);
|
||||
Dst(dst, stride, 1, 0) = Dst(dst, stride, 3, 1) = Avg3(i, x, a);
|
||||
Dst(dst, stride, 1, 1) = Dst(dst, stride, 3, 2) = Avg3(j, i, x);
|
||||
Dst(dst, stride, 1, 2) = Dst(dst, stride, 3, 3) = Avg3(k, j, i);
|
||||
Dst(dst, stride, 1, 3) = Avg3(l, k, j);
|
||||
}
|
||||
|
||||
public static unsafe void HighbdD207Predictor8x8(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdD207Predictor8X8(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
HighbdD207Predictor(dst, stride, 8, above, left, bd);
|
||||
}
|
||||
|
||||
public static unsafe void HighbdD207Predictor16x16(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdD207Predictor16X16(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
HighbdD207Predictor(dst, stride, 16, above, left, bd);
|
||||
}
|
||||
|
||||
public static unsafe void HighbdD207Predictor32x32(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdD207Predictor32X32(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
HighbdD207Predictor(dst, stride, 32, above, left, bd);
|
||||
}
|
||||
@@ -787,17 +787,17 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
}
|
||||
|
||||
public static unsafe void HighbdD63Predictor8x8(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdD63Predictor8X8(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
HighbdD63Predictor(dst, stride, 8, above, left, bd);
|
||||
}
|
||||
|
||||
public static unsafe void HighbdD63Predictor16x16(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdD63Predictor16X16(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
HighbdD63Predictor(dst, stride, 16, above, left, bd);
|
||||
}
|
||||
|
||||
public static unsafe void HighbdD63Predictor32x32(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdD63Predictor32X32(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
HighbdD63Predictor(dst, stride, 32, above, left, bd);
|
||||
}
|
||||
@@ -820,17 +820,17 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
}
|
||||
|
||||
public static unsafe void HighbdD45Predictor8x8(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdD45Predictor8X8(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
HighbdD45Predictor(dst, stride, 8, above, left, bd);
|
||||
}
|
||||
|
||||
public static unsafe void HighbdD45Predictor16x16(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdD45Predictor16X16(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
HighbdD45Predictor(dst, stride, 16, above, left, bd);
|
||||
}
|
||||
|
||||
public static unsafe void HighbdD45Predictor32x32(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdD45Predictor32X32(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
HighbdD45Predictor(dst, stride, 32, above, left, bd);
|
||||
}
|
||||
@@ -856,17 +856,17 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
}
|
||||
|
||||
public static unsafe void HighbdD117Predictor8x8(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdD117Predictor8X8(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
HighbdD117Predictor(dst, stride, 8, above, left, bd);
|
||||
}
|
||||
|
||||
public static unsafe void HighbdD117Predictor16x16(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdD117Predictor16X16(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
HighbdD117Predictor(dst, stride, 16, above, left, bd);
|
||||
}
|
||||
|
||||
public static unsafe void HighbdD117Predictor32x32(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdD117Predictor32X32(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
HighbdD117Predictor(dst, stride, 32, above, left, bd);
|
||||
}
|
||||
@@ -910,17 +910,17 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
}
|
||||
|
||||
public static unsafe void HighbdD135Predictor8x8(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdD135Predictor8X8(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
HighbdD135Predictor(dst, stride, 8, above, left, bd);
|
||||
}
|
||||
|
||||
public static unsafe void HighbdD135Predictor16x16(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdD135Predictor16X16(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
HighbdD135Predictor(dst, stride, 16, above, left, bd);
|
||||
}
|
||||
|
||||
public static unsafe void HighbdD135Predictor32x32(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdD135Predictor32X32(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
HighbdD135Predictor(dst, stride, 32, above, left, bd);
|
||||
}
|
||||
@@ -951,17 +951,17 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
}
|
||||
|
||||
public static unsafe void HighbdD153Predictor8x8(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdD153Predictor8X8(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
HighbdD153Predictor(dst, stride, 8, above, left, bd);
|
||||
}
|
||||
|
||||
public static unsafe void HighbdD153Predictor16x16(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdD153Predictor16X16(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
HighbdD153Predictor(dst, stride, 16, above, left, bd);
|
||||
}
|
||||
|
||||
public static unsafe void HighbdD153Predictor32x32(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdD153Predictor32X32(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
HighbdD153Predictor(dst, stride, 32, above, left, bd);
|
||||
}
|
||||
@@ -1004,22 +1004,22 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
}
|
||||
|
||||
public static unsafe void HighbdVPredictor4x4(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdVPredictor4X4(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
HighbdVPredictor(dst, stride, 4, above, left, bd);
|
||||
}
|
||||
|
||||
public static unsafe void HighbdVPredictor8x8(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdVPredictor8X8(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
HighbdVPredictor(dst, stride, 8, above, left, bd);
|
||||
}
|
||||
|
||||
public static unsafe void HighbdVPredictor16x16(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdVPredictor16X16(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
HighbdVPredictor(dst, stride, 16, above, left, bd);
|
||||
}
|
||||
|
||||
public static unsafe void HighbdVPredictor32x32(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdVPredictor32X32(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
HighbdVPredictor(dst, stride, 32, above, left, bd);
|
||||
}
|
||||
@@ -1034,22 +1034,22 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
}
|
||||
|
||||
public static unsafe void HighbdHPredictor4x4(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdHPredictor4X4(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
HighbdHPredictor(dst, stride, 4, above, left, bd);
|
||||
}
|
||||
|
||||
public static unsafe void HighbdHPredictor8x8(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdHPredictor8X8(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
HighbdHPredictor(dst, stride, 8, above, left, bd);
|
||||
}
|
||||
|
||||
public static unsafe void HighbdHPredictor16x16(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdHPredictor16X16(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
HighbdHPredictor(dst, stride, 16, above, left, bd);
|
||||
}
|
||||
|
||||
public static unsafe void HighbdHPredictor32x32(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdHPredictor32X32(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
HighbdHPredictor(dst, stride, 32, above, left, bd);
|
||||
}
|
||||
@@ -1064,22 +1064,22 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
}
|
||||
|
||||
public static unsafe void HighbdTmPredictor4x4(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdTmPredictor4X4(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
HighbdTmPredictor(dst, stride, 4, above, left, bd);
|
||||
}
|
||||
|
||||
public static unsafe void HighbdTmPredictor8x8(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdTmPredictor8X8(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
HighbdTmPredictor(dst, stride, 8, above, left, bd);
|
||||
}
|
||||
|
||||
public static unsafe void HighbdTmPredictor16x16(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdTmPredictor16X16(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
HighbdTmPredictor(dst, stride, 16, above, left, bd);
|
||||
}
|
||||
|
||||
public static unsafe void HighbdTmPredictor32x32(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdTmPredictor32X32(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
HighbdTmPredictor(dst, stride, 32, above, left, bd);
|
||||
}
|
||||
@@ -1100,23 +1100,23 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
}
|
||||
|
||||
public static unsafe void HighbdDc128Predictor4x4(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdDc128Predictor4X4(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
HighbdDc128Predictor(dst, stride, 4, above, left, bd);
|
||||
}
|
||||
|
||||
public static unsafe void HighbdDc128Predictor8x8(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdDc128Predictor8X8(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
HighbdDc128Predictor(dst, stride, 8, above, left, bd);
|
||||
}
|
||||
|
||||
public static unsafe void HighbdDc128Predictor16x16(ushort* dst, int stride, ushort* above, ushort* left,
|
||||
public static unsafe void HighbdDc128Predictor16X16(ushort* dst, int stride, ushort* above, ushort* left,
|
||||
int bd)
|
||||
{
|
||||
HighbdDc128Predictor(dst, stride, 16, above, left, bd);
|
||||
}
|
||||
|
||||
public static unsafe void HighbdDc128Predictor32x32(ushort* dst, int stride, ushort* above, ushort* left,
|
||||
public static unsafe void HighbdDc128Predictor32X32(ushort* dst, int stride, ushort* above, ushort* left,
|
||||
int bd)
|
||||
{
|
||||
HighbdDc128Predictor(dst, stride, 32, above, left, bd);
|
||||
@@ -1132,23 +1132,23 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
}
|
||||
|
||||
public static unsafe void HighbdDcLeftPredictor4x4(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdDcLeftPredictor4X4(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
HighbdDcLeftPredictor(dst, stride, 4, above, left, bd);
|
||||
}
|
||||
|
||||
public static unsafe void HighbdDcLeftPredictor8x8(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdDcLeftPredictor8X8(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
HighbdDcLeftPredictor(dst, stride, 8, above, left, bd);
|
||||
}
|
||||
|
||||
public static unsafe void HighbdDcLeftPredictor16x16(ushort* dst, int stride, ushort* above, ushort* left,
|
||||
public static unsafe void HighbdDcLeftPredictor16X16(ushort* dst, int stride, ushort* above, ushort* left,
|
||||
int bd)
|
||||
{
|
||||
HighbdDcLeftPredictor(dst, stride, 16, above, left, bd);
|
||||
}
|
||||
|
||||
public static unsafe void HighbdDcLeftPredictor32x32(ushort* dst, int stride, ushort* above, ushort* left,
|
||||
public static unsafe void HighbdDcLeftPredictor32X32(ushort* dst, int stride, ushort* above, ushort* left,
|
||||
int bd)
|
||||
{
|
||||
HighbdDcLeftPredictor(dst, stride, 32, above, left, bd);
|
||||
@@ -1157,14 +1157,14 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
private static unsafe void HighbdDcLeftPredictor(ushort* dst, int stride, int bs, ushort* above, ushort* left,
|
||||
int bd)
|
||||
{
|
||||
int expectedDc, sum = 0;
|
||||
int sum = 0;
|
||||
|
||||
for (int i = 0; i < bs; i++)
|
||||
{
|
||||
sum += left[i];
|
||||
}
|
||||
|
||||
expectedDc = (sum + (bs >> 1)) / bs;
|
||||
int expectedDc = (sum + (bs >> 1)) / bs;
|
||||
|
||||
for (int r = 0; r < bs; r++)
|
||||
{
|
||||
@@ -1173,23 +1173,23 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
}
|
||||
|
||||
public static unsafe void HighbdDcTopPredictor4x4(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdDcTopPredictor4X4(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
HighbdDcTopPredictor(dst, stride, 4, above, left, bd);
|
||||
}
|
||||
|
||||
public static unsafe void HighbdDcTopPredictor8x8(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdDcTopPredictor8X8(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
HighbdDcTopPredictor(dst, stride, 8, above, left, bd);
|
||||
}
|
||||
|
||||
public static unsafe void HighbdDcTopPredictor16x16(ushort* dst, int stride, ushort* above, ushort* left,
|
||||
public static unsafe void HighbdDcTopPredictor16X16(ushort* dst, int stride, ushort* above, ushort* left,
|
||||
int bd)
|
||||
{
|
||||
HighbdDcTopPredictor(dst, stride, 16, above, left, bd);
|
||||
}
|
||||
|
||||
public static unsafe void HighbdDcTopPredictor32x32(ushort* dst, int stride, ushort* above, ushort* left,
|
||||
public static unsafe void HighbdDcTopPredictor32X32(ushort* dst, int stride, ushort* above, ushort* left,
|
||||
int bd)
|
||||
{
|
||||
HighbdDcTopPredictor(dst, stride, 32, above, left, bd);
|
||||
@@ -1198,14 +1198,14 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
private static unsafe void HighbdDcTopPredictor(ushort* dst, int stride, int bs, ushort* above, ushort* left,
|
||||
int bd)
|
||||
{
|
||||
int expectedDc, sum = 0;
|
||||
int sum = 0;
|
||||
|
||||
for (int i = 0; i < bs; i++)
|
||||
{
|
||||
sum += above[i];
|
||||
}
|
||||
|
||||
expectedDc = (sum + (bs >> 1)) / bs;
|
||||
int expectedDc = (sum + (bs >> 1)) / bs;
|
||||
|
||||
for (int r = 0; r < bs; r++)
|
||||
{
|
||||
@@ -1214,22 +1214,22 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
}
|
||||
|
||||
public static unsafe void HighbdDcPredictor4x4(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdDcPredictor4X4(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
HighbdDcPredictor(dst, stride, 4, above, left, bd);
|
||||
}
|
||||
|
||||
public static unsafe void HighbdDcPredictor8x8(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdDcPredictor8X8(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
HighbdDcPredictor(dst, stride, 8, above, left, bd);
|
||||
}
|
||||
|
||||
public static unsafe void HighbdDcPredictor16x16(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdDcPredictor16X16(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
HighbdDcPredictor(dst, stride, 16, above, left, bd);
|
||||
}
|
||||
|
||||
public static unsafe void HighbdDcPredictor32x32(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdDcPredictor32X32(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
HighbdDcPredictor(dst, stride, 32, above, left, bd);
|
||||
}
|
||||
@@ -1237,7 +1237,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
private static unsafe void HighbdDcPredictor(ushort* dst, int stride, int bs, ushort* above, ushort* left,
|
||||
int bd)
|
||||
{
|
||||
int expectedDc, sum = 0;
|
||||
int sum = 0;
|
||||
int count = 2 * bs;
|
||||
|
||||
for (int i = 0; i < bs; i++)
|
||||
@@ -1246,7 +1246,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
sum += left[i];
|
||||
}
|
||||
|
||||
expectedDc = (sum + (count >> 1)) / count;
|
||||
int expectedDc = (sum + (count >> 1)) / count;
|
||||
|
||||
for (int r = 0; r < bs; r++)
|
||||
{
|
||||
@@ -1255,23 +1255,23 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
}
|
||||
|
||||
public static unsafe void HighbdD207Predictor4x4(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdD207Predictor4X4(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
ushort I = left[0];
|
||||
ushort i = left[0];
|
||||
ushort j = left[1];
|
||||
ushort k = left[2];
|
||||
ushort l = left[3];
|
||||
Dst(dst, stride, 0, 0) = Avg2(I, j);
|
||||
Dst(dst, stride, 0, 0) = Avg2(i, j);
|
||||
Dst(dst, stride, 2, 0) = Dst(dst, stride, 0, 1) = Avg2(j, k);
|
||||
Dst(dst, stride, 2, 1) = Dst(dst, stride, 0, 2) = Avg2(k, l);
|
||||
Dst(dst, stride, 1, 0) = Avg3(I, j, k);
|
||||
Dst(dst, stride, 1, 0) = Avg3(i, j, k);
|
||||
Dst(dst, stride, 3, 0) = Dst(dst, stride, 1, 1) = Avg3(j, k, l);
|
||||
Dst(dst, stride, 3, 1) = Dst(dst, stride, 1, 2) = Avg3(k, l, l);
|
||||
Dst(dst, stride, 3, 2) = Dst(dst, stride, 2, 2) = Dst(dst, stride, 0, 3) =
|
||||
Dst(dst, stride, 1, 3) = Dst(dst, stride, 2, 3) = Dst(dst, stride, 3, 3) = l;
|
||||
}
|
||||
|
||||
public static unsafe void HighbdD63Predictor4x4(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdD63Predictor4X4(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
ushort a = above[0];
|
||||
ushort b = above[1];
|
||||
@@ -1293,7 +1293,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
Dst(dst, stride, 3, 3) = Avg3(e, f, g); // Differs from vp8
|
||||
}
|
||||
|
||||
public static unsafe void HighbdD45Predictor4x4(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdD45Predictor4X4(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
ushort a = above[0];
|
||||
ushort b = above[1];
|
||||
@@ -1313,9 +1313,9 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
Dst(dst, stride, 3, 3) = h; // Differs from vp8
|
||||
}
|
||||
|
||||
public static unsafe void HighbdD117Predictor4x4(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdD117Predictor4X4(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
ushort I = left[0];
|
||||
ushort i = left[0];
|
||||
ushort j = left[1];
|
||||
ushort k = left[2];
|
||||
ushort x = above[-1];
|
||||
@@ -1328,17 +1328,17 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
Dst(dst, stride, 2, 0) = Dst(dst, stride, 3, 2) = Avg2(b, c);
|
||||
Dst(dst, stride, 3, 0) = Avg2(c, d);
|
||||
|
||||
Dst(dst, stride, 0, 3) = Avg3(k, j, I);
|
||||
Dst(dst, stride, 0, 2) = Avg3(j, I, x);
|
||||
Dst(dst, stride, 0, 1) = Dst(dst, stride, 1, 3) = Avg3(I, x, a);
|
||||
Dst(dst, stride, 0, 3) = Avg3(k, j, i);
|
||||
Dst(dst, stride, 0, 2) = Avg3(j, i, x);
|
||||
Dst(dst, stride, 0, 1) = Dst(dst, stride, 1, 3) = Avg3(i, x, a);
|
||||
Dst(dst, stride, 1, 1) = Dst(dst, stride, 2, 3) = Avg3(x, a, b);
|
||||
Dst(dst, stride, 2, 1) = Dst(dst, stride, 3, 3) = Avg3(a, b, c);
|
||||
Dst(dst, stride, 3, 1) = Avg3(b, c, d);
|
||||
}
|
||||
|
||||
public static unsafe void HighbdD135Predictor4x4(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdD135Predictor4X4(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
ushort I = left[0];
|
||||
ushort i = left[0];
|
||||
ushort j = left[1];
|
||||
ushort k = left[2];
|
||||
ushort l = left[3];
|
||||
@@ -1348,18 +1348,18 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
ushort c = above[2];
|
||||
ushort d = above[3];
|
||||
Dst(dst, stride, 0, 3) = Avg3(j, k, l);
|
||||
Dst(dst, stride, 1, 3) = Dst(dst, stride, 0, 2) = Avg3(I, j, k);
|
||||
Dst(dst, stride, 2, 3) = Dst(dst, stride, 1, 2) = Dst(dst, stride, 0, 1) = Avg3(x, I, j);
|
||||
Dst(dst, stride, 1, 3) = Dst(dst, stride, 0, 2) = Avg3(i, j, k);
|
||||
Dst(dst, stride, 2, 3) = Dst(dst, stride, 1, 2) = Dst(dst, stride, 0, 1) = Avg3(x, i, j);
|
||||
Dst(dst, stride, 3, 3) =
|
||||
Dst(dst, stride, 2, 2) = Dst(dst, stride, 1, 1) = Dst(dst, stride, 0, 0) = Avg3(a, x, I);
|
||||
Dst(dst, stride, 2, 2) = Dst(dst, stride, 1, 1) = Dst(dst, stride, 0, 0) = Avg3(a, x, i);
|
||||
Dst(dst, stride, 3, 2) = Dst(dst, stride, 2, 1) = Dst(dst, stride, 1, 0) = Avg3(b, a, x);
|
||||
Dst(dst, stride, 3, 1) = Dst(dst, stride, 2, 0) = Avg3(c, b, a);
|
||||
Dst(dst, stride, 3, 0) = Avg3(d, c, b);
|
||||
}
|
||||
|
||||
public static unsafe void HighbdD153Predictor4x4(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
public static unsafe void HighbdD153Predictor4X4(ushort* dst, int stride, ushort* above, ushort* left, int bd)
|
||||
{
|
||||
ushort I = left[0];
|
||||
ushort i = left[0];
|
||||
ushort j = left[1];
|
||||
ushort k = left[2];
|
||||
ushort l = left[3];
|
||||
@@ -1368,17 +1368,17 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
ushort b = above[1];
|
||||
ushort c = above[2];
|
||||
|
||||
Dst(dst, stride, 0, 0) = Dst(dst, stride, 2, 1) = Avg2(I, x);
|
||||
Dst(dst, stride, 0, 1) = Dst(dst, stride, 2, 2) = Avg2(j, I);
|
||||
Dst(dst, stride, 0, 0) = Dst(dst, stride, 2, 1) = Avg2(i, x);
|
||||
Dst(dst, stride, 0, 1) = Dst(dst, stride, 2, 2) = Avg2(j, i);
|
||||
Dst(dst, stride, 0, 2) = Dst(dst, stride, 2, 3) = Avg2(k, j);
|
||||
Dst(dst, stride, 0, 3) = Avg2(l, k);
|
||||
|
||||
Dst(dst, stride, 3, 0) = Avg3(a, b, c);
|
||||
Dst(dst, stride, 2, 0) = Avg3(x, a, b);
|
||||
Dst(dst, stride, 1, 0) = Dst(dst, stride, 3, 1) = Avg3(I, x, a);
|
||||
Dst(dst, stride, 1, 1) = Dst(dst, stride, 3, 2) = Avg3(j, I, x);
|
||||
Dst(dst, stride, 1, 2) = Dst(dst, stride, 3, 3) = Avg3(k, j, I);
|
||||
Dst(dst, stride, 1, 0) = Dst(dst, stride, 3, 1) = Avg3(i, x, a);
|
||||
Dst(dst, stride, 1, 1) = Dst(dst, stride, 3, 2) = Avg3(j, i, x);
|
||||
Dst(dst, stride, 1, 2) = Dst(dst, stride, 3, 3) = Avg3(k, j, i);
|
||||
Dst(dst, stride, 1, 3) = Avg3(l, k, j);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
|
||||
[SkipLocalsInit]
|
||||
public static void Iwht4x416Add(ReadOnlySpan<int> input, Span<byte> dest, int stride)
|
||||
public static void Iwht4X416Add(ReadOnlySpan<int> input, Span<byte> dest, int stride)
|
||||
{
|
||||
/* 4-point reversible, orthonormal inverse Walsh-Hadamard in 3.5 adds,
|
||||
0.5 shifts per pixel. */
|
||||
@@ -143,7 +143,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
|
||||
[SkipLocalsInit]
|
||||
public static void Iwht4x41Add(ReadOnlySpan<int> input, Span<byte> dest, int stride)
|
||||
public static void Iwht4X41Add(ReadOnlySpan<int> input, Span<byte> dest, int stride)
|
||||
{
|
||||
long a1, e1;
|
||||
Span<int> tmp = stackalloc int[4];
|
||||
@@ -233,7 +233,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
|
||||
[SkipLocalsInit]
|
||||
public static void Idct4x416Add(ReadOnlySpan<int> input, Span<byte> dest, int stride)
|
||||
public static void Idct4X416Add(ReadOnlySpan<int> input, Span<byte> dest, int stride)
|
||||
{
|
||||
Span<int> output = stackalloc int[4 * 4];
|
||||
Span<int> outptr = output;
|
||||
@@ -265,7 +265,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
}
|
||||
|
||||
public static void Idct4x41Add(ReadOnlySpan<int> input, Span<byte> dest, int stride)
|
||||
public static void Idct4X41Add(ReadOnlySpan<int> input, Span<byte> dest, int stride)
|
||||
{
|
||||
long a1;
|
||||
int output = WrapLow(DctConstRoundShift((short)input[0] * CosPi1664));
|
||||
@@ -419,7 +419,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
|
||||
[SkipLocalsInit]
|
||||
public static void Idct8x864Add(ReadOnlySpan<int> input, Span<byte> dest, int stride)
|
||||
public static void Idct8X864Add(ReadOnlySpan<int> input, Span<byte> dest, int stride)
|
||||
{
|
||||
Span<int> output = stackalloc int[8 * 8];
|
||||
Span<int> outptr = output;
|
||||
@@ -452,7 +452,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
|
||||
[SkipLocalsInit]
|
||||
public static void Idct8x812Add(ReadOnlySpan<int> input, Span<byte> dest, int stride)
|
||||
public static void Idct8X812Add(ReadOnlySpan<int> input, Span<byte> dest, int stride)
|
||||
{
|
||||
Span<int> output = stackalloc int[8 * 8];
|
||||
Span<int> outptr = output;
|
||||
@@ -487,7 +487,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
}
|
||||
|
||||
public static void Idct8x81Add(ReadOnlySpan<int> input, Span<byte> dest, int stride)
|
||||
public static void Idct8X81Add(ReadOnlySpan<int> input, Span<byte> dest, int stride)
|
||||
{
|
||||
long a1;
|
||||
int output = WrapLow(DctConstRoundShift((short)input[0] * CosPi1664));
|
||||
@@ -843,7 +843,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
|
||||
[SkipLocalsInit]
|
||||
public static void Idct16x16256Add(ReadOnlySpan<int> input, Span<byte> dest, int stride)
|
||||
public static void Idct16X16256Add(ReadOnlySpan<int> input, Span<byte> dest, int stride)
|
||||
{
|
||||
Span<int> output = stackalloc int[16 * 16];
|
||||
Span<int> outptr = output;
|
||||
@@ -876,7 +876,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
|
||||
[SkipLocalsInit]
|
||||
public static void Idct16x1638Add(ReadOnlySpan<int> input, Span<byte> dest, int stride)
|
||||
public static void Idct16X1638Add(ReadOnlySpan<int> input, Span<byte> dest, int stride)
|
||||
{
|
||||
Span<int> output = stackalloc int[16 * 16];
|
||||
Span<int> outptr = output;
|
||||
@@ -912,7 +912,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
|
||||
[SkipLocalsInit]
|
||||
public static void Idct16x1610Add(ReadOnlySpan<int> input, Span<byte> dest, int stride)
|
||||
public static void Idct16X1610Add(ReadOnlySpan<int> input, Span<byte> dest, int stride)
|
||||
{
|
||||
Span<int> output = stackalloc int[16 * 16];
|
||||
Span<int> outptr = output;
|
||||
@@ -947,7 +947,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
}
|
||||
|
||||
public static void Idct16x161Add(ReadOnlySpan<int> input, Span<byte> dest, int stride)
|
||||
public static void Idct16X161Add(ReadOnlySpan<int> input, Span<byte> dest, int stride)
|
||||
{
|
||||
long a1;
|
||||
int output = WrapLow(DctConstRoundShift((short)input[0] * CosPi1664));
|
||||
@@ -1336,7 +1336,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
|
||||
[SkipLocalsInit]
|
||||
public static void Idct32x321024Add(ReadOnlySpan<int> input, Span<byte> dest, int stride)
|
||||
public static void Idct32X321024Add(ReadOnlySpan<int> input, Span<byte> dest, int stride)
|
||||
{
|
||||
Span<int> output = stackalloc int[32 * 32];
|
||||
Span<int> outptr = output;
|
||||
@@ -1383,7 +1383,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
|
||||
[SkipLocalsInit]
|
||||
public static void Idct32x32135Add(ReadOnlySpan<int> input, Span<byte> dest, int stride)
|
||||
public static void Idct32X32135Add(ReadOnlySpan<int> input, Span<byte> dest, int stride)
|
||||
{
|
||||
Span<int> output = stackalloc int[32 * 32];
|
||||
Span<int> outptr = output;
|
||||
@@ -1419,7 +1419,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
|
||||
[SkipLocalsInit]
|
||||
public static void Idct32x3234Add(ReadOnlySpan<int> input, Span<byte> dest, int stride)
|
||||
public static void Idct32X3234Add(ReadOnlySpan<int> input, Span<byte> dest, int stride)
|
||||
{
|
||||
Span<int> output = stackalloc int[32 * 32];
|
||||
Span<int> outptr = output;
|
||||
@@ -1454,7 +1454,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
}
|
||||
|
||||
public static void Idct32x321Add(ReadOnlySpan<int> input, Span<byte> dest, int stride)
|
||||
public static void Idct32X321Add(ReadOnlySpan<int> input, Span<byte> dest, int stride)
|
||||
{
|
||||
long a1;
|
||||
int output = WrapLow(DctConstRoundShift((short)input[0] * CosPi1664));
|
||||
@@ -1474,7 +1474,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
|
||||
[SkipLocalsInit]
|
||||
public static void HighbdIwht4x416Add(ReadOnlySpan<int> input, Span<ushort> dest, int stride, int bd)
|
||||
public static void HighbdIwht4X416Add(ReadOnlySpan<int> input, Span<ushort> dest, int stride, int bd)
|
||||
{
|
||||
/* 4-point reversible, orthonormal inverse Walsh-Hadamard in 3.5 adds,
|
||||
0.5 shifts per pixel. */
|
||||
@@ -1530,7 +1530,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
|
||||
[SkipLocalsInit]
|
||||
public static void HighbdIwht4x41Add(ReadOnlySpan<int> input, Span<ushort> dest, int stride, int bd)
|
||||
public static void HighbdIwht4X41Add(ReadOnlySpan<int> input, Span<ushort> dest, int stride, int bd)
|
||||
{
|
||||
long a1, e1;
|
||||
Span<int> tmp = stackalloc int[4];
|
||||
@@ -1633,7 +1633,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
|
||||
[SkipLocalsInit]
|
||||
public static void HighbdIdct4x416Add(ReadOnlySpan<int> input, Span<ushort> dest, int stride, int bd)
|
||||
public static void HighbdIdct4X416Add(ReadOnlySpan<int> input, Span<ushort> dest, int stride, int bd)
|
||||
{
|
||||
Span<int> output = stackalloc int[4 * 4];
|
||||
Span<int> outptr = output;
|
||||
@@ -1665,7 +1665,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
}
|
||||
|
||||
public static void HighbdIdct4x41Add(ReadOnlySpan<int> input, Span<ushort> dest, int stride, int bd)
|
||||
public static void HighbdIdct4X41Add(ReadOnlySpan<int> input, Span<ushort> dest, int stride, int bd)
|
||||
{
|
||||
long a1;
|
||||
int output = HighbdWrapLow(DctConstRoundShift(input[0] * (long)CosPi1664), bd);
|
||||
@@ -1824,7 +1824,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
|
||||
[SkipLocalsInit]
|
||||
public static void HighbdIdct8x864Add(ReadOnlySpan<int> input, Span<ushort> dest, int stride, int bd)
|
||||
public static void HighbdIdct8X864Add(ReadOnlySpan<int> input, Span<ushort> dest, int stride, int bd)
|
||||
{
|
||||
Span<int> output = stackalloc int[8 * 8];
|
||||
Span<int> outptr = output;
|
||||
@@ -1857,7 +1857,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
|
||||
[SkipLocalsInit]
|
||||
public static void HighbdIdct8x812Add(ReadOnlySpan<int> input, Span<ushort> dest, int stride, int bd)
|
||||
public static void HighbdIdct8X812Add(ReadOnlySpan<int> input, Span<ushort> dest, int stride, int bd)
|
||||
{
|
||||
Span<int> output = stackalloc int[8 * 8];
|
||||
Span<int> outptr = output;
|
||||
@@ -1892,7 +1892,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
}
|
||||
|
||||
public static void VpxHighbdidct8x81AddC(ReadOnlySpan<int> input, Span<ushort> dest, int stride, int bd)
|
||||
public static void VpxHighbdidct8X81AddC(ReadOnlySpan<int> input, Span<ushort> dest, int stride, int bd)
|
||||
{
|
||||
long a1;
|
||||
int output = HighbdWrapLow(DctConstRoundShift(input[0] * (long)CosPi1664), bd);
|
||||
@@ -2261,7 +2261,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
|
||||
[SkipLocalsInit]
|
||||
public static void HighbdIdct16x16256Add(ReadOnlySpan<int> input, Span<ushort> dest, int stride, int bd)
|
||||
public static void HighbdIdct16X16256Add(ReadOnlySpan<int> input, Span<ushort> dest, int stride, int bd)
|
||||
{
|
||||
Span<int> output = stackalloc int[16 * 16];
|
||||
Span<int> outptr = output;
|
||||
@@ -2294,7 +2294,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
|
||||
[SkipLocalsInit]
|
||||
public static void HighbdIdct16x1638Add(ReadOnlySpan<int> input, Span<ushort> dest, int stride, int bd)
|
||||
public static void HighbdIdct16X1638Add(ReadOnlySpan<int> input, Span<ushort> dest, int stride, int bd)
|
||||
{
|
||||
Span<int> output = stackalloc int[16 * 16];
|
||||
Span<int> outptr = output;
|
||||
@@ -2331,7 +2331,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
|
||||
[SkipLocalsInit]
|
||||
public static void HighbdIdct16x1610Add(ReadOnlySpan<int> input, Span<ushort> dest, int stride, int bd)
|
||||
public static void HighbdIdct16X1610Add(ReadOnlySpan<int> input, Span<ushort> dest, int stride, int bd)
|
||||
{
|
||||
Span<int> output = stackalloc int[16 * 16];
|
||||
Span<int> outptr = output;
|
||||
@@ -2366,7 +2366,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
}
|
||||
|
||||
public static void HighbdIdct16x161Add(ReadOnlySpan<int> input, Span<ushort> dest, int stride, int bd)
|
||||
public static void HighbdIdct16X161Add(ReadOnlySpan<int> input, Span<ushort> dest, int stride, int bd)
|
||||
{
|
||||
long a1;
|
||||
int output = HighbdWrapLow(DctConstRoundShift(input[0] * (long)CosPi1664), bd);
|
||||
@@ -2762,7 +2762,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
|
||||
[SkipLocalsInit]
|
||||
public static void HighbdIdct32x321024Add(ReadOnlySpan<int> input, Span<ushort> dest, int stride, int bd)
|
||||
public static void HighbdIdct32X321024Add(ReadOnlySpan<int> input, Span<ushort> dest, int stride, int bd)
|
||||
{
|
||||
Span<int> output = stackalloc int[32 * 32];
|
||||
Span<int> outptr = output;
|
||||
@@ -2809,7 +2809,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
|
||||
[SkipLocalsInit]
|
||||
public static void HighbdIdct32x32135Add(ReadOnlySpan<int> input, Span<ushort> dest, int stride, int bd)
|
||||
public static void HighbdIdct32X32135Add(ReadOnlySpan<int> input, Span<ushort> dest, int stride, int bd)
|
||||
{
|
||||
Span<int> output = stackalloc int[32 * 32];
|
||||
Span<int> outptr = output;
|
||||
@@ -2846,7 +2846,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
|
||||
[SkipLocalsInit]
|
||||
public static void HighbdIdct32x3234Add(ReadOnlySpan<int> input, Span<ushort> dest, int stride, int bd)
|
||||
public static void HighbdIdct32X3234Add(ReadOnlySpan<int> input, Span<ushort> dest, int stride, int bd)
|
||||
{
|
||||
Span<int> output = stackalloc int[32 * 32];
|
||||
Span<int> outptr = output;
|
||||
@@ -2881,7 +2881,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
}
|
||||
|
||||
public static void HighbdIdct32x321Add(ReadOnlySpan<int> input, Span<ushort> dest, int stride, int bd)
|
||||
public static void HighbdIdct32X321Add(ReadOnlySpan<int> input, Span<ushort> dest, int stride, int bd)
|
||||
{
|
||||
int a1;
|
||||
int output = HighbdWrapLow(DctConstRoundShift(input[0] * (long)CosPi1664), bd);
|
||||
|
||||
@@ -1553,7 +1553,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
}
|
||||
|
||||
private static unsafe void Transpose8x16(
|
||||
private static unsafe void Transpose8X16(
|
||||
ArrayPtr<byte> in0,
|
||||
ArrayPtr<byte> in1,
|
||||
int inP,
|
||||
@@ -1633,15 +1633,15 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
int inP,
|
||||
ReadOnlySpan<ArrayPtr<byte>> dst,
|
||||
int outP,
|
||||
int num8x8ToTranspose)
|
||||
int num8X8ToTranspose)
|
||||
{
|
||||
int idx8x8 = 0;
|
||||
int idx8X8 = 0;
|
||||
Vector128<byte> x0, x1, x2, x3, x4, x5, x6, x7;
|
||||
|
||||
do
|
||||
{
|
||||
ArrayPtr<byte> input = src[idx8x8];
|
||||
ArrayPtr<byte> output = dst[idx8x8];
|
||||
ArrayPtr<byte> input = src[idx8X8];
|
||||
ArrayPtr<byte> output = dst[idx8X8];
|
||||
|
||||
x0 = Sse2.LoadScalarVector128((long*)(input.ToPointer() + (0 * inP)))
|
||||
.AsByte(); // 00 01 02 03 04 05 06 07
|
||||
@@ -1697,7 +1697,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
|
||||
Sse2.StoreScalar((long*)(output.ToPointer() + (6 * outP)), x7.AsInt64()); // 06 16 26 36 46 56 66 76
|
||||
Sse2.StoreHigh((double*)(output.ToPointer() + (7 * outP)), x7.AsDouble()); // 07 17 27 37 47 57 67 77
|
||||
} while (++idx8x8 < num8x8ToTranspose);
|
||||
} while (++idx8X8 < num8X8ToTranspose);
|
||||
}
|
||||
|
||||
public static unsafe void LpfVertical4Dual(
|
||||
@@ -1716,7 +1716,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
Span<ArrayPtr<byte>> dst = stackalloc ArrayPtr<byte>[2];
|
||||
|
||||
// Transpose 8x16
|
||||
Transpose8x16(s.Slice(-4), s.Slice(-4 + (pitch * 8)), pitch, tDst, 16);
|
||||
Transpose8X16(s.Slice(-4), s.Slice(-4 + (pitch * 8)), pitch, tDst, 16);
|
||||
|
||||
// Loop filtering
|
||||
LpfHorizontal4Dual(tDst.Slice(4 * 16), 16, blimit0, limit0, thresh0, blimit1, limit1, thresh1);
|
||||
@@ -1770,7 +1770,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
Span<ArrayPtr<byte>> dst = stackalloc ArrayPtr<byte>[2];
|
||||
|
||||
// Transpose 8x16
|
||||
Transpose8x16(s.Slice(-4), s.Slice(-4 + (pitch * 8)), pitch, tDst, 16);
|
||||
Transpose8X16(s.Slice(-4), s.Slice(-4 + (pitch * 8)), pitch, tDst, 16);
|
||||
|
||||
// Loop filtering
|
||||
LpfHorizontal8Dual(tDst.Slice(4 * 16), 16, blimit0, limit0, thresh0, blimit1, limit1, thresh1);
|
||||
@@ -1823,15 +1823,15 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
ArrayPtr<byte> tDst = new((byte*)tDstStorage, 256);
|
||||
|
||||
// Transpose 16x16
|
||||
Transpose8x16(s.Slice(-8), s.Slice(-8 + (8 * pitch)), pitch, tDst, 16);
|
||||
Transpose8x16(s, s.Slice(8 * pitch), pitch, tDst.Slice(8 * 16), 16);
|
||||
Transpose8X16(s.Slice(-8), s.Slice(-8 + (8 * pitch)), pitch, tDst, 16);
|
||||
Transpose8X16(s, s.Slice(8 * pitch), pitch, tDst.Slice(8 * 16), 16);
|
||||
|
||||
// Loop filtering
|
||||
LpfHorizontal16Dual(tDst.Slice(8 * 16), 16, blimit, limit, thresh);
|
||||
|
||||
// Transpose back
|
||||
Transpose8x16(tDst, tDst.Slice(8 * 16), 16, s.Slice(-8), pitch);
|
||||
Transpose8x16(tDst.Slice(8), tDst.Slice(8 + (8 * 16)), 16, s.Slice(-8 + (8 * pitch)), pitch);
|
||||
Transpose8X16(tDst, tDst.Slice(8 * 16), 16, s.Slice(-8), pitch);
|
||||
Transpose8X16(tDst.Slice(8), tDst.Slice(8 + (8 * 16)), 16, s.Slice(-8 + (8 * pitch)), pitch);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -26,10 +26,10 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
|
||||
// MODE_MV_MAX_UPDATE_FACTOR (128) * count / MODE_MV_COUNT_SAT;
|
||||
private static readonly uint[] CountToUpdateFactor =
|
||||
{
|
||||
private static readonly uint[] _countToUpdateFactor =
|
||||
[
|
||||
0, 6, 12, 19, 25, 32, 38, 44, 51, 57, 64, 70, 76, 83, 89, 96, 102, 108, 115, 121, 128
|
||||
};
|
||||
];
|
||||
|
||||
private const int ModeMvCountSat = 20;
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
|
||||
uint count = Math.Min(den, ModeMvCountSat);
|
||||
uint factor = CountToUpdateFactor[(int)count];
|
||||
uint factor = _countToUpdateFactor[(int)count];
|
||||
byte prob = GetProb(ct0, den);
|
||||
return WeightedProb(preProb, prob, (int)factor);
|
||||
}
|
||||
|
||||
@@ -7,8 +7,8 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
{
|
||||
internal struct Reader
|
||||
{
|
||||
private static readonly byte[] Norm =
|
||||
{
|
||||
private static readonly byte[] _norm =
|
||||
[
|
||||
0, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2,
|
||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
@@ -17,7 +17,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||
};
|
||||
];
|
||||
|
||||
private const int BdValueSize = sizeof(ulong) * 8;
|
||||
|
||||
@@ -144,7 +144,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
}
|
||||
|
||||
{
|
||||
int shift = Norm[range];
|
||||
int shift = _norm[range];
|
||||
range <<= shift;
|
||||
value <<= shift;
|
||||
count -= shift;
|
||||
@@ -203,7 +203,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
range = range - split;
|
||||
value = value - bigsplit;
|
||||
{
|
||||
int shift = Norm[range];
|
||||
int shift = _norm[range];
|
||||
range <<= shift;
|
||||
value <<= shift;
|
||||
count -= shift;
|
||||
@@ -213,7 +213,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
|
||||
range = split;
|
||||
{
|
||||
int shift = Norm[range];
|
||||
int shift = _norm[range];
|
||||
range <<= shift;
|
||||
value <<= shift;
|
||||
count -= shift;
|
||||
@@ -235,10 +235,10 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
|
||||
private int DecodeUniform()
|
||||
{
|
||||
const int l = 8;
|
||||
const int m = (1 << l) - 191;
|
||||
int v = ReadLiteral(l - 1);
|
||||
return v < m ? v : (v << 1) - m + ReadBit();
|
||||
const int L = 8;
|
||||
const int M = (1 << L) - 191;
|
||||
int v = ReadLiteral(L - 1);
|
||||
return v < M ? v : (v << 1) - M + ReadBit();
|
||||
}
|
||||
|
||||
public int DecodeTermSubexp()
|
||||
@@ -264,7 +264,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Dsp
|
||||
public TxMode ReadTxMode()
|
||||
{
|
||||
TxMode txMode = (TxMode)ReadLiteral(2);
|
||||
if (txMode == TxMode.Allow32x32)
|
||||
if (txMode == TxMode.Allow32X32)
|
||||
{
|
||||
txMode += ReadBit();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user