3 ms·
So from what I understand, it predicts the next pixel by looking at the two previous pixels and counting what has appeared in that context earlier in the image.
by vintermann 1y ago
So from what I understand, it predicts the next pixel by looking at the two previous pixels and counting what has appeared in that context earlier in the image. I'm not 100% sure, but I think it processes the pixels line by line.
It then encodes with arithmetic encoding. Along with the palette, I think that does most of the heavy lifting in the compression, an adaptive model looking at just two pixels of context shouldn't make especially good predictions. PNG (sort of) looks at 4, the three above and the one to the left.