-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trying to get an idea about where the algorithm is flexible #2
Comments
To illustrate my point, here is a very simple scheme:
(as an extreme example) Using a best-worse file size graph again, this very simple predictor has considerably better performance than just using zstd directly. My suggestion: You should look into using a spatial predictor, even a very simple one, in your "calculating lists" step. |
Have you already implemented this method or what's the source of your graph? |
This idea of yours is pretty good and I'm confident that it will improve the system significantly. However it will take me a long time to implement. Here is why: |
Yes, I implemented this transform to make the graph. You can probably get away without using signed integers by storing the diffs with an offset of 128:
The real range is then |
Could you upload the the implementation to your fork and make a pull request. If the system passes all tests we can use it directly. |
I wrote this as a separate c++ program, sadly. |
I'm working on it. Can't make any promises though. I've been trying to implement it for the last hour. The hole encoder and decoder is pretty bad organized and coded. It's also very hard to debug, because you never know where the error is. Could be in the encoder or the decoder. I'm graduating in several weeks from high school so I have only two weeks max to bring the code into a reasonable state. Nevertheless I highly appreciate your contributions. |
If you don't mind me poking around a bit more :)
This is mostly based off of your description, though I checked out some relevant parts of the code.
Clustering/grid
This seems to me the most interesting part. Typically, compression algorithms aim to partition the input into chunks of uncorrelated data, to use a set of parameters tailored for each individual chunck.
In this regard, this looks much more sophisticated than what's usually done, namely slicing the image up into a grid (which you also do as the next step). Would it be possible to get some sort of estimate for how much storage the clustering metadata demands? (an x times y grid, for instance, only has two numbers worth of overhead).
From what I understand, your approach is not limited to a specific algorithm for deciding on the clusters for unique decodability. This should mean that there's the option for asymmetric encoding, where the decoder is computationally inexpensive in that it just has to decode only the single layout you ended up with, while the encoder is free to try multiple different approaches.
Calculating Lists
It seems to me, you are using a very simple predictive coding approach here. The "predictor" is a single value for each chunck/cluster.
This would give you very few of the benefits the cluster decorrelation potentially gives. Zstd should be able to explot much of the redundancy of neighbouring pixels in your list, but the 2D correlation is somewhat wasted.
While I'm not sure what the geometry of your "wiggly lines", an analogue technique for scanline traversal would be to store each pixel value as the difference from the pixel above, which would otherwise be far away in the list, and out of reach for the entropy coding.
The text was updated successfully, but these errors were encountered: