Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused compression methods. #32442

Merged
merged 1 commit into from
Sep 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 0 additions & 86 deletions searchlib/src/vespa/searchlib/bitcompression/compression.h
Original file line number Diff line number Diff line change
Expand Up @@ -302,45 +302,6 @@ class CodingTables
ctx ## valI, EC); \
} while (0)

#define UC64BE_DECODEDEXPGOLOMB_NS(prefix, k, EC) \
do { \
if ((prefix ## Val & TOP_BIT64) == 0) { \
length = 1; \
prefix ## Val <<= 1; \
val64 = 0; \
UC64BE_READBITS_NS(prefix, EC); \
} else { \
if ((prefix ## Val & TOP_2_BITS64) != TOP_2_BITS64) { \
length = 2; \
prefix ## Val <<= 2; \
val64 = 1; \
UC64BE_READBITS_NS(prefix, EC); \
} else { \
length = 2; \
prefix ## Val <<= 2; \
UC64BE_READBITS_NS(prefix, EC); \
UC64BE_DECODEEXPGOLOMB_NS(prefix, k, EC); \
val64 += 2; \
} \
} \
} while (0)

#define UC64BE_DECODED0EXPGOLOMB_NS(prefix, k, EC) \
do { \
if ((prefix ## Val & TOP_BIT64) == 0) { \
length = 1; \
prefix ## Val <<= 1; \
val64 = 0; \
UC64BE_READBITS_NS(prefix, EC); \
} else { \
length = 1; \
prefix ## Val <<= 1; \
UC64BE_READBITS_NS(prefix, EC); \
UC64BE_DECODEEXPGOLOMB_NS(prefix, k, EC); \
val64 += 1; \
} \
} while (0)

#define UC64LE_READBITS(val, valI, preRead, cacheInt, EC) \
do { \
if (__builtin_expect(length <= preRead, true)) { \
Expand Down Expand Up @@ -1008,53 +969,6 @@ class EncodeContext64 : public EncodeContext64EBase<bigEndian>
return k + asmlog2((x >> k) + 1) * 2 + 1;
}

void
encodeDExpGolomb(uint64_t x, uint32_t k)
{
if (x == 0) {
writeBits(0, 1);
return;
}
if (x == 1) {
writeBits(bigEndian ? 2 : 1, 2);
return;
}
writeBits(3, 2);
encodeExpGolomb(x - 2, k);
}

static uint32_t
encodeDExpGolombSpace(uint64_t x, uint32_t k)
{
if (x == 0) {
return 1;
}
if (x == 1) {
return 2;
}
return 2 + encodeExpGolombSpace(x, k);
}

void
encodeD0ExpGolomb(uint64_t x, uint32_t k)
{
if (x == 0) {
writeBits(0, 1);
return;
}
writeBits(1, 1);
encodeExpGolomb(x - 1, k);
}

static uint32_t
encodeD0ExpGolombSpace(uint64_t x, uint32_t k)
{
if (x == 0) {
return 1;
}
return 1 + encodeExpGolombSpace(x, k);
}

static uint64_t
convertToUnsigned(int64_t val)
{
Expand Down