1  |  Name
2  |  Description
3  |  Format
 
3.1   |  Compressor
 
3.2  |  Decompressor
4  |  Source Code
 
4.1   |  Compressor
 
4.2  |  Decompressor
5  |  Profiling
 
5.1   |  Terminal Output
 
5.2   |  KCachegrind Output
6  |  References
LZ77-A
LZ77-A is my version of the LZ77 compression algorithm published by Abraham Lempel and Jacob Ziv in 1977.
The LZ77-A format definition is as follows.
1. Check if character at input pointer address is equal to character at previous pointer address.
2. If they are the same, then make value of output pointer address equal to '1', pointer address + 1 equal to '1', and pointer address + 2 equal to value in input pointer address + 1.
3. Increase output pointer address by 3 and increase input pointer adress by 2.
4. Else if they are not the same, then make value of output pointer address equal to '0', pointer address + 1 equal to '0', and pointer address + 2 equal to value in input pointer address.
5. Increase output pointer address by 3, and increase input pointer address by 1.
1. Set variable "repeat" to equal value of pointer address + 1.
2. If that value is not equal to 0, then print out value at pointer address - 1 and repeat until it equals value of "repeat".
3. Else if the value is equal to 0, then print out value at pointer address plus 2.
The LZ77-A source code is written in the C++ language.
The LZ77-A source code is written in the C++ language.
for
(int
i=0
; i < length; i++) { if
(*p1 == *(p1-1
)) {0
) = '1'
;1
) = '1'
;2
) = *(p1+1
); 3
; 2
;else
{0
) = '0'
;1
) = '0'
;2
) = *p1; 3
;The LZ77-A source code is written in the C++ language.
for
(int
i=1
; i < length; i += 3
) {int
repeat = atoi(&buffer[i+1
]);if
(repeat != 0
) {for
(int
j=0
; j < repeat; j++) {1
];2
];Here are some examples of profiling using Valgrind profiling tools.
Here is some terminal output using Valgrind profiling.
Here is some profiling output using the KCachegrind GUI tool included with Valgrind.
The following references were used.
https://developer.mantidproject.org/ProfilingWithValgrind.html
http://kcachegrind.sourceforge.net/html/Usage.html