On 07/05/2012 06:51 AM, Orit Wasserman wrote: > Signed-off-by: Orit Wasserman <[email protected]> > --- > docs/xbzrle.txt | 136 > +++++++++++++++++++++++++++++++++++++++++++++++++++++++ > 1 files changed, 136 insertions(+), 0 deletions(-) > create mode 100644 docs/xbzrle.txt >
> +
> +Example
> +old buffer:
> +1001 zeros
> +05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 00 00 6b 00 6d
> +3074 zeros
This _still_ doesn't add up to 4096:
1001 + 20 + 3074 = 4095
> +
> +new buffer:
> +1001 zeros
> +01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 00 00 67 00 69
> +3704 zeros
Still a transposition error.
Also, this still has the flaw that it is too weak of an example - the
only unchanged bytes happen to also be zero bytes to begin with; it
would be much nicer if the example included at least one non-zero byte
that did not change between old and new.
> +
> +encoded buffer:
> +
> +encoded length 24
> +e9 07 0f 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 03 01 67 01 01 69
^^
That says you have a zrun of 3 bytes, but the example only shows a zrun
of 2 bytes.
It feels like I'm pulling teeth to get a good example. If you will just
squash in the following (hand-written) diff below, you will then have
4096 bytes in both old and new buffers, and your encoded buffer listing
a zrun of 3 will be correct, plus you will be demonstrating a non-zero
byte that remained unchanged.
@@ ???,??? @@
Example
old buffer:
1001 zeros
-05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 00 00 6b 00 6d
+05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 68 00 00 6b 00 6d
3074 zeros
new buffer:
1001 zeros
-01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 00 00 67 00 69
-3704 zeros
+01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 68 00 00 67 00 69
+3074 zeros
encoded buffer:
--
Eric Blake [email protected] +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
