jmunkki@kampi.hut.fi (Juri Munkki) (02/03/90)
In article <1990Jan31.034508.1304@cec1.wustl.edu> sjs@wucs1.wustl.edu (Steven J. Sadoff) writes: >In article <29559@dhw68k.cts.com> of comp.binaries.mac, Juri Munkki writes: >> 1) Start with Old=128 >> 2) Read a byte into New >> 3) Write Old-New >> 4) Old=New >> 5) Go to step 2 if there is more data > >This implementation of delta modulation is NOT FULLY REVERSIBLE. >Step #3 is flawed. It does not handle overflow >(i.e., subtraction of two 8 bit numbers can yield a 9 bit number). >If you do not want corrupted sounds, DeltaSound 1.0 should only be used >on backup copies of your sounds. I appreciate that you contacted me by mail, but you didn't tell me you posted your warning. I noticed this article by pure chance. Your description of the flaw is flawed. Always try out an example before saying that something doesn't work. I assume you thought that the case where we have 0 and 255 (or anything with a difference >127) doesn't work. Let's try out this particular case: Old=0 New=255 Old-New=-255 which is truncated into 8 bits -> 1 Now when the process is reversed, we discover that subtracting 1 from 0 leads to -1, which is again truncated into 8 bits -> 255. The algorithm works because of wrap-around. I'm usually quite careful when posting anything. In this case I tried converting stuffit-archives. Stuffit keeps a checksum on everything, so even the slightest change would have triggered an alert. Always doubt anything you see on the net: in this case it's ok that my work was doubted, but without proof, I hope most people had doubts about the warning. _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ | Juri Munkki jmunkki@hut.fi jmunkki@fingate.bitnet I Want Ne | | Helsinki University of Technology Computing Centre My Own XT | ^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^