-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLZ77encoder.h
More file actions
64 lines (56 loc) · 1.95 KB
/
LZ77encoder.h
File metadata and controls
64 lines (56 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#ifndef LZ77ENCODER_H_INCLUDED
#define LZ77ENCODER_H_INCLUDED
/*Update look ahead buffer from the original file by finding the number of empty space in it
*
*Parameter
*lab look ahead buffer char array
*test original text char array
*lab_Len length of current look ahead buffer
*buf_Size buffer size
*empty empty spaces in the look ahead buffer
*test_Len length of original text file
*No Return value
*Just updates the look ahead buffer
*/
void lab_upd();
/*Update search buffer and look ahead buffer from the output tuple of the longest match found
*
*Parameter
*sb search buffer char array
*lab look ahead buffer char array
*mtch_Len length of longest match
*len summation of all prev (longest_match(l)+1) (<o,l,c()>)
*buf_Size buffer size
*test_Len length of original text file
*No Return value
*Just updates the look ahead buffer and search buffer
*/
void buf_upd();
/*Searching in search buffer to find longest match of the look-ahead buffer and generating the output tuple
*
*Parameter
*sb search buffer char array
*lab look ahead buffer char array
*len_sb length of search buffer
*len_Lab length of look ahead buffer
*ch initial character value for starting search
*offset offset of the longest match found
*length length of the longest match found
*luc last unmatched character of the longest match found
*mtch_Len length of longest match
*len summation of all prev (longest_match(l)+1) (<o,l,c()>)
*buf_Size buffer size
*test_Len length of original text file
*No Return value
*Just writes the output tuple( <offset,length,last unmatched char> ) in the compressed file
*/
void seq_sb();
/*Package function which calls the above functions in the order (lab_upd->seq_sb->buf_upd->lab_upd)
*
*Parameter
*lab_Len length of look ahead buffer for checking loop termination condition (lab_Len!=0)
*No Return value
*Calls the above function to compress the original text
*/
void encoder();
#endif