Skip to content

Bitpack

Bitpack Manual

Overview

The bitpack codec takes a single numeric input. The numeric input is interpreted as unsigned integers of the given element width (either 1, 2, 4, or 8). The input is transformed so that each element is encoded using nbBits, which is the number of bits needed to encode the largest element in the input.

Inputs

A single numeric input.

Outputs

A single serial output.

Use Cases

The bitpack codec is especially useful when handling numeric data which has small values that are represented with a larger numeric width than needed. Bitpack may be useful in lieu of fieldLZ or huffman as the final codec in a pipeline if the input is non-repetitive or uniformly distributed.

openzl.ext.graphs.Bitpack

Bases: Graph

Bitpacks ints into the smallest number of bits possible

Inputs: ints: TypeMask.Serial | TypeMask.Numeric

Source code in build-openzl/py/site-packages/openzl/ext/graphs.pyi
class Bitpack(Graph):
    """
    Bitpacks ints into the smallest number of bits possible

    Inputs:
    ints: TypeMask.Serial | TypeMask.Numeric
    """

    def __init__(self) -> None: ...

    def __call__(self, arg: ext.Compressor, /) -> ext.GraphID: ...

    def parameterize(self, compressor: ext.Compressor) -> ext.GraphID: ...

    def set_destination(self, edge: ext.Edge) -> None: ...

    def set_multi_input_destination(self, edges: Sequence[ext.Edge]) -> None: ...

    @property
    def base_graph(self) -> ext.GraphID: ...

base_graph property

__call__(arg)

Source code in build-openzl/py/site-packages/openzl/ext/graphs.pyi
def __call__(self, arg: ext.Compressor, /) -> ext.GraphID: ...

__init__()

Source code in build-openzl/py/site-packages/openzl/ext/graphs.pyi
def __init__(self) -> None: ...

parameterize(compressor)

Source code in build-openzl/py/site-packages/openzl/ext/graphs.pyi
def parameterize(self, compressor: ext.Compressor) -> ext.GraphID: ...

set_destination(edge)

Source code in build-openzl/py/site-packages/openzl/ext/graphs.pyi
def set_destination(self, edge: ext.Edge) -> None: ...

set_multi_input_destination(edges)

Source code in build-openzl/py/site-packages/openzl/ext/graphs.pyi
def set_multi_input_destination(self, edges: Sequence[ext.Edge]) -> None: ...