Transform
The transform module exposes a well-defined interface which need to be implemented by any Transformer
, i.e., the function producing the base and deviation used by the GD Store.
AbstractTransformer
This is the abstract type that a new transformer need to implement in order to be usable by the store. The functions transform
and invtransform
need to respect the given signatures.
GD.Transform.AbstractTransformer
— TypeAbstractTransformer
Interface to implement for creating a new transformer.
GD.Transform.transform
— Methodtransform(transformer, data)
Applies the transformer
transformation to data
and returns a split representation under the form (basis
, deviation
).
GD.Transform.invtransform
— Methodinvtransform(transformer, basis, deviation)
Reverses the transformation applied by transformer
and returns the original data
.
GD Quantization
GD Quantization is applying a lossless quantization which store the quantization error in the deviation.
GD.Transform.Quantizer
— TypeQuantizer
Transformer which creates a basis and deviation pair as follow:
- basis: keeps only the
msbsize
MSB of each byte - deviation: keeps the remaing
lsbsize
LSB of each byte
GD.Transform.transform
— Methodtransform(quantizer, data)
Cuts each element from data
into a basis containing the quantizer.msbsize
MSB of the element, and a deviation containing the quantizer.lsbsize
LSB of the element.
Returns the concatenation of the MSB of the bytes as the basis
, and the concatenation of the LSB of the bytes as the deviation.
GD.Transform.invtransform
— Methodinvtransform(quantizer, basis, deviation)
Extracts each couple (MSB, LSB) from basis
and deviation
and rebuilds the original data by combining them.
Returns the original byte array which has been transformed by transform()
.