fab-jul/imgcomp-cvpr

Decoding of Bitstream.

wensihan opened this issue · 4 comments

Hello, there are some questions about the decoding of Bitstream.
1、How can we get the distribution of each location in the adaptive arithmetic decoding phase, by computing the distribution of each location one by one as an auto-regressive model through the context model?
2、 And what kind of information should be encoded into the bitstream?
Looking forward to your reply.

Hi, we updated the code to support arithmetic encoding to a bitstream. Please check out the updated val.py:L161-L175 and bit_counter.py, as well as the updated README.

Basically, you iterate over the volume of symbols in cubes, always feeding a cube of known symbols to the probability classifier to get the next symbol. I hope the paper and the code together help understanding this.

Regarding 2: The bulk of the stream will be used for encoding symbols. Additionally, you need to store the first symbol, and shape of the symbols. The rest can be inferred from the model, which is the same for all images and thus not counted (i.e., it is considered part of the algorithm)

Oh, thank you very much for your support of this part~ I will learn the code in detail to better understand the paper. Thanks for you again~

Hello, I find that there is no need of storing the first symbol. I remove the use of first_sym in the bit_counter.py, and the result is right as well with the real bpp getting a little higher. For which I think it is owing to the ignorance of coding the first symbol in the code.

That’s true, the surrounding padding symbols act as a prior. I just found it prettier with the symbol :)