mirror of
https://github.com/Ryubing/Ryujinx.git
synced 2025-11-17 08:10:54 -05: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:
@@ -21,48 +21,47 @@ namespace Ryujinx.Graphics.Nvdec.Vp9
|
||||
ref VpxCodecFrameBuffer fb)
|
||||
{
|
||||
int i;
|
||||
Ptr<InternalFrameBufferList> intFbList = cbPriv;
|
||||
if (intFbList.IsNull)
|
||||
if (cbPriv.IsNull)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Find a free frame buffer.
|
||||
for (i = 0; i < intFbList.Value.IntFb.Length; ++i)
|
||||
for (i = 0; i < cbPriv.Value.IntFb.Length; ++i)
|
||||
{
|
||||
if (!intFbList.Value.IntFb[i].InUse)
|
||||
if (!cbPriv.Value.IntFb[i].InUse)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i == intFbList.Value.IntFb.Length)
|
||||
if (i == cbPriv.Value.IntFb.Length)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((ulong)intFbList.Value.IntFb[i].Data.Length < minSize)
|
||||
if ((ulong)cbPriv.Value.IntFb[i].Data.Length < minSize)
|
||||
{
|
||||
if (!intFbList.Value.IntFb[i].Data.IsNull)
|
||||
if (!cbPriv.Value.IntFb[i].Data.IsNull)
|
||||
{
|
||||
allocator.Free(intFbList.Value.IntFb[i].Data);
|
||||
allocator.Free(cbPriv.Value.IntFb[i].Data);
|
||||
}
|
||||
|
||||
// The data must be zeroed to fix a valgrind error from the C loop filter
|
||||
// due to access uninitialized memory in frame border. It could be
|
||||
// skipped if border were totally removed.
|
||||
intFbList.Value.IntFb[i].Data = allocator.Allocate<byte>((int)minSize);
|
||||
if (intFbList.Value.IntFb[i].Data.IsNull)
|
||||
cbPriv.Value.IntFb[i].Data = allocator.Allocate<byte>((int)minSize);
|
||||
if (cbPriv.Value.IntFb[i].Data.IsNull)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
fb.Data = intFbList.Value.IntFb[i].Data;
|
||||
intFbList.Value.IntFb[i].InUse = true;
|
||||
fb.Data = cbPriv.Value.IntFb[i].Data;
|
||||
cbPriv.Value.IntFb[i].InUse = true;
|
||||
|
||||
// Set the frame buffer's private data to point at the internal frame buffer.
|
||||
fb.Priv = new Ptr<InternalFrameBuffer>(ref intFbList.Value.IntFb[i]);
|
||||
fb.Priv = new Ptr<InternalFrameBuffer>(ref cbPriv.Value.IntFb[i]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -76,4 +75,4 @@ namespace Ryujinx.Graphics.Nvdec.Vp9
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user