Command encoded data compression
A method implemented in a computer system may include reading a first set of data byte values, providing a reproducible first array that includes at least one of each data byte value in the first set, identifying in the first array a first contiguous pathway that defines a set of data byte values matching the first set, and creating a second set of command byte values representing the first contiguous pathway. The method may further include providing a reproducible second array that includes at least one of each command byte value in the second set, identifying in the second array a second contiguous pathway that defines a set of command byte values matching the second set, and creating a third set of command byte values representing the second contiguous pathway.
1. A method, implemented in a computer system, the method comprising:
reading a first set of data byte values;
providing a reproducible first array that includes at least one of each data byte value in the first set;
identifying in the first array a first contiguous pathway that defines a set of data byte values matching the first set;
creating a second set of command byte values representing the first contiguous pathway;
providing a reproducible second array that includes at least one of each command byte value in the second set;
identifying in the second array a second contiguous pathway that defines a set of command byte values matching the second set; and
creating a third set of command byte values representing the second contiguous pathway.
2. The method of claim 1 , wherein
reading a first set of data byte values includes reading a first set of data bytes each having a first number of possible values;
providing a reproducible first array and providing a reproducible second array includes providing a first array and second array having approximately the same size; and
creating a second set of command byte values includes creating a second set of command bytes each having a second number of possible values less than the first number of possible values.
3. The method of claim 2 , wherein
reading a first set of data byte values includes reading a first set of data bytes each having 256 possible values; and
creating a second set of command byte values includes creating a second set of command
bytes each having 36 possible values.
4. The method of claim 1 , wherein identifying at least one of the first and second contiguous pathways includes comparing command byte value representations of multiple candidate pathways and selecting a pathway based on criteria including size of representation.
5. The method of claim 1 , wherein identifying at least one of the first and second contiguous pathways includes comparing multiple candidate pathways and selecting a pathway based on criteria including size of pathway.
6. The method of claim 1 , wherein providing at least one of the first and second reproducible arrays includes providing multiple reproducible alternate versions of the array.
7. The method of claim 1 , wherein representing at least one of the first and second contiguous pathways includes providing array coordinates indicating a starting location of the pathway.
8. The method of claim 1 , further comprising
reading the third set of command byte values;
recreating the second set of command byte values by interpreting the command byte values in the third set to retrace the pathway through the reproducible second array; and
recreating the first set of data byte values by interpreting the command byte values in the second set to retrace the pathway through the reproducible first array.
9. The method of claim 1 , wherein providing a reproducible first array includes providing a first array having at least one of every possible data byte value.
10. The method of claim 1 , wherein providing a reproducible first array includes providing a first array having a distribution of data byte values substantially corresponding to a distribution of data byte values in the first set of data byte values.
11. The method of claim 1 , wherein at least one reproducible array includes a plurality of nodes, and at least one node is associated with more than one byte value.
12. The method of claim 1 , further comprising causing the third set of command byte values to be transferred from a first location to a second location.
13. A computer system for manipulating data, comprising:
a processor;
a memory; and
a data manipulation program including a plurality of instructions stored in the memory that are executed by the processor to:
read a first set of input byte values;
match a chosen first portion of the first set of input byte values to a chosen first pattern found in a first reproducible array of byte values;
represent the first pattern using corresponding first command byte values indicating one or more commands to recreate the first pattern; and
create a second set of byte values including the command byte values that represent the first pattern;
wherein the first portion and first pattern are chosen from respective multiple candidate portions and patterns based on preselected criteria biased toward candidate portions having a greater size and candidate patterns having a smaller corresponding set of command byte values.
14. The system of claim 13 , wherein the plurality of instructions stored in the memory are further executed by the processor to:
read the second set of byte values;
match a chosen second portion of the second set of byte values to a chosen second pattern found in a second reproducible array of byte values;
represent the second pattern using corresponding second command byte values indicating one or more commands to recreate the second pattern; and
create a third set of output byte values including the command byte values that represent the second pattern;
wherein the second portion and second pattern are chosen from respective multiple candidate portions and patterns based on preselected criteria biased toward candidate portions having a greater size and candidate patterns having a smaller corresponding set of command byte values.
15. The system of claim 14 ,
wherein each input byte has a predetermined first number of possible values, each command byte has a predetermined second number of values, and the first number is greater than the second number; and
wherein the first reproducible array and the second reproducible array are approximately the same size.
16. The method of claim 14 , further comprising causing the second set of command byte values to be transferred from a first location to a second location.
17. The method of claim 14 , wherein at least one reproducible array includes a plurality of nodes, and at least one node is associated with more than one byte value.
18. A computer program product for manipulating data, the computer program product comprising a computer-readable storage medium having computer-readable program code embodied therewith, the computer readable program code configured to:
losslessly translate between a first set of bytes and a plurality of pathways in a reproducible array of byte values; and
losslessly translate between the plurality of pathways in the reproducible array of byte values and a second set of bytes;
wherein each byte in the first set has a first number of possible values, each byte in the second set has a second number of possible values, and the first number is less than or equal to the second number.
19. The computer program product of claim 18 , wherein translating between the plurality of pathways and the second set of bytes includes:
dividing the second set of bytes into portions;
for each portion, finding a plurality of matching pathways in the reproducible array of byte values, assigning a corresponding sequence of commands to recreate each matching pathway, and choosing one of the matching pathways based on preselected criteria including a length of the corresponding sequence of commands.
20. The computer program product of claim 18 , wherein translating between the first set of bytes and the plurality of pathways includes:
providing the reproducible array;
reading values of the first set of bytes;
translating the values into commands;
carrying out the commands to recreate the plurality of pathways in the reproducible array.
21. The computer program product of claim 20 , wherein translating between the plurality of pathways and the second set of bytes includes:
sequentially traversing the plurality of pathways in the reproducible array, and
reading byte values encountered on each pathway.