Implement VP9 loop filtering

This commit is contained in:
gdkchan
2023-02-04 19:44:30 -03:00
committed by KeatonTheBot
parent d135385cab
commit b69b432b4c
79 changed files with 11301 additions and 3006 deletions
@@ -10,7 +10,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Common
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static byte ClipPixel(int val)
{
return (byte)((val > 255) ? 255 : (val < 0) ? 0 : val);
return (byte)(val > 255 ? 255 : val < 0 ? 0 : val);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -56,4 +56,4 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Common
return numValues > 0 ? GetMsb(numValues) + 1 : 0;
}
}
}
}
@@ -51,6 +51,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Common
{
Marshal.FreeHGlobal(item.Pointer);
}
item.Pointer = ptr;
item.Length = lengthInBytes;
break;
@@ -58,7 +59,11 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Common
}
}
return new ArrayPtr<T>(ptr, length);
ArrayPtr<T> allocation = new ArrayPtr<T>(ptr, length);
allocation.AsSpan().Fill(default);
return allocation;
}
public unsafe void Free<T>(ArrayPtr<T> arr) where T : unmanaged
@@ -20,4 +20,4 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Common
new Span<T>(ptr, length).Fill(value);
}
}
}
}