Reputation: 6633
Let's say I have an array of 100 random integers values. Instead of storing them plainly as they are, I can instead store the first, and put the distance between each consecutive integer.
How is this method called ?
I know this method seems completely worthless, but it could be useful for storing 3D model data, where consecutive vertices stored next to each other actually are very close: instead of using 32 bits, I could use a array of 8 bit integer.
Upvotes: 10
Views: 238
Reputation:
I believe you're looking for delta encoding:
Delta encoding is a way of storing or transmitting data in the form of differences between sequential data ...
Perhaps the simplest example is storing values of bytes as differences (deltas) between sequential values, rather than the values themselves. So, instead of 2, 4, 6, 9, 7, we would store 2, 2, 2, 3, −2.
Upvotes: 14