fab-jul/torchac

A question about symbol range

Cyprus-hy opened this issue · 2 comments

Thanks for your work. But I have a question, that is whether the symbol must in [0, Lp-2]. For example, I have 3 symbols: 100, 200, 300, and I also know their frequency, can I use torchac to compress them? If I must transform [100, 200, 300] to [0, 1, 2] before compressing, then how can I tranform them back to [100, 200, 300] after decompressing? It really makes me confused. Hope for your reply!

So let's say you have have the following distribution

P(100) = p1
P(200) = p2
P(300) = p3

Now, you would transform this to a CDF that is:

[0, p1, p1+p2, p1+p2+p3]

And if you have for example

data = [100, 100, 300, 200]

you would specify the following symbols:

[0, 0, 2, 1]

so the index.

With "Lp-2" we just mean that the biggest symbol here is 2, since we start counting from 0.

Thanks for your work. I have a question.Can this implementation be used to encode 16bit image data? If you want to encode 16bit image data does it need to be rewritten? It should now only apply to 8bit image data.