16#ifndef RANS_INTERNAL_PACK_ELIASDELTA_H_
17#define RANS_INTERNAL_PACK_ELIASDELTA_H_
33 using namespace utils;
41 eliasDeltaCode = eliasDeltaCode << highestPow2 |
bitExtract(
data, 0, highestPow2);
42 uint32_t packedSize = nLeadingZeros + nLeadingZeros + 1 + highestPow2;
44 return pack(
dst, eliasDeltaCode, packedSize);
49template <
typename dst_T>
53 using namespace utils;
54 static_assert(
sizeof(dst_T) <=
sizeof(
uint32_t));
56 constexpr size_t PackingBufferBits = toBits<packing_type>();
58 auto unpackedData = unpack<packing_type>(srcPos - rBitOffset, rBitOffset);
61 unpackedData <<= PackingBufferBits - rBitOffset;
62 const uint32_t nLeadingZeros = __builtin_clzl(unpackedData);
63 uint32_t eliasDeltaBits = 2 * nLeadingZeros + 1;
64 const uint32_t highestPow2 =
bitExtract(unpackedData, PackingBufferBits - eliasDeltaBits, nLeadingZeros + 1) - 1;
65 eliasDeltaBits += highestPow2;
66 dst_T decodedValue =
static_cast<dst_T
>(pow2(highestPow2) +
bitExtract(unpackedData, PackingBufferBits - eliasDeltaBits, highestPow2));
68 srcPos -= eliasDeltaBits;
Pointer type helper class for bitwise Packing.
configStandalone Light OpenGL display display_light Apply smoothing to points Enable Z buffer Highlight links Highlight seeds Highlight sector tracks Highlight final tracks Show individual Show related Highlight grid Show only individual collision Color clusters belonging to track objects Set line Enable drawing TPC data Enable drawing TOF data Enable drawing magnetic field Set field line step count Invert colors configStandalone Heavy OpenGL display display_heavy Show tracks with ITS contribution Show tracks with TOF contribution Enable propagation of loopers Show clusters at nominal x of pad row for early transformed data Split CE tracks when they cross the central Mark clusters Mark adjacent clusters Hide rejected tracks Apply filter on tracks to be displayed Separate increase X h configStandalone Camera window renderer OpenGL display display_camera Orient the camera such that the y axis is always upwards Full Screen MultiSample Anti Downsampling Anti Enable Vertical Sync Target frame or if the backend cannot limit to the refresh Use OpenGL indirect draws to reduce number of draw calls Display h configStandalone Vulkan display display_vulkan Have uniform buffers in host accessible device memory h internal
common helper classes and functions
helper functionalities useful for packing operations
dst_T eliasDeltaDecode(BitPtr &srcPos, size_t rBitOffset=EliasDeltaDecodeMaxBits)
BitPtr eliasDeltaEncode(BitPtr dst, uint32_t data)
constexpr size_t EliasDeltaDecodeMaxBits
constexpr T log2UIntNZ(T x) noexcept
uint64_t bitExtract(uint64_t data, uint32_t start, uint32_t length) noexcept
Common utility functions.