mirror of
https://github.com/crskycode/GARbro.git
synced 2026-07-08 01:30:18 +08:00
Update HuffmanDecoder.cs
Fix not so obvious errors.
This commit is contained in:
@@ -143,7 +143,7 @@ namespace GameRes.Formats.DxLib
|
|||||||
ushort BitArrayFirstBatch;
|
ushort BitArrayFirstBatch;
|
||||||
if (nodes[j].bitNumber > 9) continue;
|
if (nodes[j].bitNumber > 9) continue;
|
||||||
|
|
||||||
BitArrayFirstBatch = (ushort)(nodes[j].bitArray[0] | (nodes[j].bitNumber << 8));
|
BitArrayFirstBatch = (ushort)(nodes[j].bitArray[0] | (nodes[j].bitArray[1] << 8));
|
||||||
|
|
||||||
if ((i & bitMask[nodes[j].bitNumber - 1]) == (BitArrayFirstBatch & bitMask[nodes[j].bitNumber-1]))
|
if ((i & bitMask[nodes[j].bitNumber - 1]) == (BitArrayFirstBatch & bitMask[nodes[j].bitNumber-1]))
|
||||||
{
|
{
|
||||||
@@ -191,19 +191,20 @@ namespace GameRes.Formats.DxLib
|
|||||||
{
|
{
|
||||||
PressBitData >>= nodes[NodeIndex].bitNumber;
|
PressBitData >>= nodes[NodeIndex].bitNumber;
|
||||||
}
|
}
|
||||||
while (NodeIndex>255)
|
}
|
||||||
|
|
||||||
|
while (NodeIndex > 255)
|
||||||
|
{
|
||||||
|
if (PressBitCounter == 8)
|
||||||
{
|
{
|
||||||
if (PressBitCounter==8)
|
PressSizeCounter++;
|
||||||
{
|
PressBitData = compressedData[PressSizeCounter];
|
||||||
PressSizeCounter++;
|
PressBitCounter = 0;
|
||||||
PressBitData = compressedData[PressSizeCounter];
|
|
||||||
PressBitCounter = 0;
|
|
||||||
}
|
|
||||||
Index = PressBitData & 1;
|
|
||||||
PressBitData >>= 1;
|
|
||||||
PressBitCounter++;
|
|
||||||
NodeIndex = nodes[NodeIndex].ChildNode[Index];
|
|
||||||
}
|
}
|
||||||
|
Index = PressBitData & 1;
|
||||||
|
PressBitData >>= 1;
|
||||||
|
PressBitCounter++;
|
||||||
|
NodeIndex = nodes[NodeIndex].ChildNode[Index];
|
||||||
}
|
}
|
||||||
m_output[DestSizeCounter] = (byte)NodeIndex;
|
m_output[DestSizeCounter] = (byte)NodeIndex;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user