-
Notifications
You must be signed in to change notification settings - Fork 0
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
Make pixel differences unbiased #11
Comments
Yeah, ARM64 probably would benefit too as it has a signed-bitfield extraction instruction (SBFX). |
IIUC, for e.g. the DIFF_8 opcode that has 2-bit deltas, you're proposing to change the interpretation (from 'Old' to 'New'):
|
Yeah, that's it! |
Another option would be to not leave the 8-bit space at all (phoboslab/qoi#28 (comment)), but then you would have to use wrapping adds/subs throughout, so technically it's a different encoding. |
Didn't the final QOI spec explicitly mention that Also, how does all of that relate to using two's complement in |
Thanks - indeed, I must have missed that part. Just tested the wrapping-ops encoder implementation on a few files out of the reference image set:
With this, I don't understand why this hasn't been made the reference encoder implementation. Why allow multiple encoder implementations that don't yield bitwise-identical results, while one of them seems to be faster and compress the same or sometimes better? (perhaps this might be a separate thread if anyone cares) |
In these cases, I think it's useful to differentiate between a conforming string and a canonical string in the spec. There is nothing wrong with allowing multiple conforming strings for the same input (in fact, sometimes it's even desirable). Usually the encoder is made to produce canonical strings (so that they are reproducible and can be compared) but the decoder is made to accept conforming strings (so that it's more lenient). See Postel's law |
I agree. As long as the file format is strictly followed, an encoder can make whatever tradeoffs it wants. I tried to implement the wrapping diff in the C encoder (by just replacing For better compression an encoder could chose to check first if a A very fast "encoder" could chose to just spit out |
HW implementations would benefit from it, as the circuitry needed to sign-extend is simpler than the one to account for biases. Context: phoboslab/qoi#28 (comment)
The text was updated successfully, but these errors were encountered: