Implement VP9 loop filtering
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user