invertedtomato / packing

Library for encoding integers in the minimal number of bits. Includes VLQ and Elias Omega encoding.
MIT License
76 stars 6 forks source link

Separate method Fibonacci #5

Closed dzmitry-lahoda closed 5 years ago

dzmitry-lahoda commented 5 years ago

https://github.com/invertedtomato/integer-compression/blob/8b0b80f1e74340b90cc9726c1bf944dbca93b24d/Library/Compression/Integers/Wave3/FibonacciCodec.cs#L76

As I understand I can encode single number via Fibonacci? Could you split it into separate class? I would like that any encoder which does not relies on range of value could be used without reliance on custom writer-reader-buffer-steam.

Same for read https://github.com/invertedtomato/integer-compression/blob/8b0b80f1e74340b90cc9726c1bf944dbca93b24d/Library/Compression/Integers/Wave3/FibonacciCodec.cs#L166

dzmitry-lahoda commented 5 years ago

Seems none of codes uses several values to improve coding, so may create spearae nuget for coding single value to increase reuse changes. I.e. i do not need bit-byte-reader-writer. I has my own.

dzmitry-lahoda commented 5 years ago

Seems method will loose performance.

invertedtomato commented 5 years ago

Thanks for checking!