Change Apple RLE algorithm for a faster version.

This commit is contained in:
2021-10-17 01:11:43 +01:00
parent 63a3c6475b
commit 722175d2ae
3 changed files with 63 additions and 64 deletions

View File

@@ -67,13 +67,11 @@ class apple_rleFixture : public ::testing::Test
TEST_F(apple_rleFixture, apple_rle)
{
auto *outBuf = (uint8_t*)malloc(20960);
int32_t position = 0;
auto *outBuf = (uint8_t*)malloc(32768);
apple_rle_reset();
auto decoded = apple_rle_decode_buffer(outBuf, 32768, buffer, 1102);
for(int i = 0; i < 20960; i++)
outBuf[i] = (uint8_t)apple_rle_produce_byte(buffer, 1102, &position);
EXPECT_EQ(decoded, 20960);
auto crc = crc32_data(outBuf, 20960);