Fix type error in back reference length.

This commit is contained in:
Sylvain Glaize 2024-02-22 19:36:09 +01:00
parent d1980114e9
commit 82f4d5e2f1

View File

@ -28,9 +28,9 @@ public:
{ {
if (getBit())// Back reference if (getBit())// Back reference
{ {
data_type length = getInterlacedEliasGamma() + 1; int length = getInterlacedEliasGamma() + 1;
if (length == 255 || (dsk2rom_tweak && length == 0)) if (length == 262143 || (dsk2rom_tweak && length == 131072))
{ {
break; break;
} }
@ -86,7 +86,7 @@ public:
} }
std::cout << std::endl; std::cout << std::endl;
std::cout << "Output size: " << output.size() << std::endl; std::cout << "Output size: " << std::dec << static_cast<int>(output.size()) << std::endl;
} }
private: private:
@ -119,9 +119,9 @@ private:
return bit; return bit;
} }
data_type getInterlacedEliasGamma() int getInterlacedEliasGamma()
{ {
data_type value = 1; int value = 1;
while (getBit()) while (getBit())
{ {
value = (value << 1) | getBit(); value = (value << 1) | getBit();