This article is rated Start-class on Wikipedia's
content assessment scale. It is of interest to the following WikiProjects: | |||||||||||
|
The contents of the Delta copying page were merged into Delta encoding on 29 April 2015. For the contribution history and old versions of the redirected page, please see its history; for the discussion at that location, see its talk page. |
I think the C code is not correct
The following Java code performs a simple form of delta encoding and decoding:
public class Delta {
public static int[] deltaEncode(int[] buffer) {
int original, delta = 0;
for (int i = 0; i < buffer.length; ++i) {
original = bufferi;
bufferi -= delta;
delta = original;
}
return buffer;
}
public static int[] deltaDecode(int[] buffer) {
int delta = 0;
for (int i = 0; i < buffer.length; ++i) {
bufferi += delta;
delta = bufferi;
}
return buffer;
}
public static void main(String[] args) {
int[] buffer = { 2, 4, 6, 9, 7 };
buffer = deltaEncode(buffer);
for (int c : buffer) {
System.out.print(c + " ");
}
System.out.println();
buffer = deltaDecode(buffer);
for (int c : buffer) {
System.out.print(c + " ");
}
}
}
Could this article be expanded to a more general view of delta encoding as encoding only the differences between things? A mention of diff and similar might be quite good. porges 09:38, Apr 7, 2005 (UTC)
Error control has different meaning in this article - it's used to find differences from other version of the same file without transfering it, not to detect corrupted data. This is the way how rsync/ zsync use it. Please, don't change this meaning! 217.26.163.26 07:06, 4 May 2005 (UTC)
The article currently states
OK, that is a pretty formula, but what does it mean? (What does the "\" mean in this context?)
I'm guessing it means something like
Is that all it means ? Is it OK if I replace the mysterious formula with this English-language description? -- DavidCary 03:19, 6 October 2005 (UTC)
If I read the formula correctly, it means the same as , which I can read easier in English: the symmetric delta of two versions is the elements of each version without the elements common to both.
I'm guessing that directed delta could be defined by , and would read: the elements of second version without the elements of the first.
I don't feel that the formula adds much to the article. -- Eruionnyron 19:10, 9 October 2005 (UTC)
This article is crappy. I'll rewrite it, but having a new list of sources would be quite helpful. If anyone wants to chip in I'd be very pleased.
"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."
Varint encoding benefits a LOT from delta encoding, as it can use from 1 to 4 bytes to represent each integer, and a delta-encoded stream will increase the number of small values @nobre November 7, 2011 — Preceding unsigned comment added by 200.251.63.3 ( talk) 15:55, 7 November 2011 (UTC)
apparently Apache Subversion uses a variant of delta encoding with "revision N is stored as a delta against N-f(N), where f(N) is the greatest power of two that divides N". Some discussion here http://svn.apache.org/repos/asf/subversion/trunk/notes/skip-deltas . I guess this should go into Delta encoding#Variants section. 76.119.30.87 ( talk) 00:21, 11 February 2015 (UTC)
This article is rated Start-class on Wikipedia's
content assessment scale. It is of interest to the following WikiProjects: | |||||||||||
|
The contents of the Delta copying page were merged into Delta encoding on 29 April 2015. For the contribution history and old versions of the redirected page, please see its history; for the discussion at that location, see its talk page. |
I think the C code is not correct
The following Java code performs a simple form of delta encoding and decoding:
public class Delta {
public static int[] deltaEncode(int[] buffer) {
int original, delta = 0;
for (int i = 0; i < buffer.length; ++i) {
original = bufferi;
bufferi -= delta;
delta = original;
}
return buffer;
}
public static int[] deltaDecode(int[] buffer) {
int delta = 0;
for (int i = 0; i < buffer.length; ++i) {
bufferi += delta;
delta = bufferi;
}
return buffer;
}
public static void main(String[] args) {
int[] buffer = { 2, 4, 6, 9, 7 };
buffer = deltaEncode(buffer);
for (int c : buffer) {
System.out.print(c + " ");
}
System.out.println();
buffer = deltaDecode(buffer);
for (int c : buffer) {
System.out.print(c + " ");
}
}
}
Could this article be expanded to a more general view of delta encoding as encoding only the differences between things? A mention of diff and similar might be quite good. porges 09:38, Apr 7, 2005 (UTC)
Error control has different meaning in this article - it's used to find differences from other version of the same file without transfering it, not to detect corrupted data. This is the way how rsync/ zsync use it. Please, don't change this meaning! 217.26.163.26 07:06, 4 May 2005 (UTC)
The article currently states
OK, that is a pretty formula, but what does it mean? (What does the "\" mean in this context?)
I'm guessing it means something like
Is that all it means ? Is it OK if I replace the mysterious formula with this English-language description? -- DavidCary 03:19, 6 October 2005 (UTC)
If I read the formula correctly, it means the same as , which I can read easier in English: the symmetric delta of two versions is the elements of each version without the elements common to both.
I'm guessing that directed delta could be defined by , and would read: the elements of second version without the elements of the first.
I don't feel that the formula adds much to the article. -- Eruionnyron 19:10, 9 October 2005 (UTC)
This article is crappy. I'll rewrite it, but having a new list of sources would be quite helpful. If anyone wants to chip in I'd be very pleased.
"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."
Varint encoding benefits a LOT from delta encoding, as it can use from 1 to 4 bytes to represent each integer, and a delta-encoded stream will increase the number of small values @nobre November 7, 2011 — Preceding unsigned comment added by 200.251.63.3 ( talk) 15:55, 7 November 2011 (UTC)
apparently Apache Subversion uses a variant of delta encoding with "revision N is stored as a delta against N-f(N), where f(N) is the greatest power of two that divides N". Some discussion here http://svn.apache.org/repos/asf/subversion/trunk/notes/skip-deltas . I guess this should go into Delta encoding#Variants section. 76.119.30.87 ( talk) 00:21, 11 February 2015 (UTC)