This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
notes:discrete:fall2022:projects:rle2 [2022/10/29 03:13] – [SPECIFICATIONS] abarbcal | notes:discrete:fall2022:projects:rle2 [2022/11/03 02:53] (current) – [PROGRAM] dkienenb | ||
---|---|---|---|
Line 1: | Line 1: | ||
=====BACKGROUND===== | =====BACKGROUND===== | ||
+ | Version 3 of our RLE algorithm. | ||
+ | |||
+ | This time we will be focusing on conditional encoding and decoding of runs of similar data greater than one. | ||
+ | \\ | ||
+ | \\ | ||
+ | \\ | ||
+ | Run Length Encoding (RLE) Data Compression Algorithm | ||
+ | |||
+ | Run-length encoding (RLE) algorithm is a lossless compression of runs of data, where repeated sequences of data are stored as a representation of a single data value and its count (how many times it repeats consecutively). RLE encoding is commonly used in JPEG, TIFF, and PDF files, to name a few examples. | ||
=====SPECIFICATIONS===== | =====SPECIFICATIONS===== | ||
+ | If a control byte is present inside your data but does not include encoded data with it, you will have to make modifications to your encode/ | ||
+ | |||
+ | =====REFERENCES===== | ||
+ | STRIDES and CONTROL BYTES for given files: \\ | ||
+ | **sample0.txt: | ||
+ | **sample1.txt: | ||
+ | **sample2.bmp: | ||
+ | **sample3.wav: | ||
+ | **sample5.txt: | ||
Please reference the image below to find the hexadecimal value of the ASCII symbols: | Please reference the image below to find the hexadecimal value of the ASCII symbols: | ||
Line 15: | Line 33: | ||
=====PROGRAM===== | =====PROGRAM===== | ||
===Arguments=== | ===Arguments=== | ||
- | Encode: Input-file Outpath Stride | + | < |
- | Decode: Infile Outpath\\ | + | ./encode INFILE |
+ | | ||
+ | |||
+ | ./encode sample0.txt some/ | ||
+ | </ | ||
+ | |||
+ | |||
+ | < | ||
+ | ./decode INFILE | ||
+ | | ||
+ | |||
+ | ./decode sample0.txt some/ | ||
+ | </ | ||
+ | |||
+ | **NOTE** | ||
+ | |||
+ | **NOTE** To convert a string argument into a usable decimal, set your desired variable equal to //atoi()// and put the string argument you wish to convert in the function. This works with unsigned chars as well as ints. If you atoi to an unsigned char, it is easy to put it into the header array with a simple assignment. | ||
===Explanation=== | ===Explanation=== | ||
Input-file-> | Input-file-> | ||
- | Outpath-> | + | |
+ | Outpath-> | ||
Stride-> | Stride-> | ||
+ | |||
Control-> | Control-> | ||
=====DATA HEADER SPECIFICATIONS===== | =====DATA HEADER SPECIFICATIONS===== | ||
Line 45: | Line 82: | ||
=====VERIFICATION===== | =====VERIFICATION===== | ||
+ | Eval script is inside, however, it doesn' | ||
+ | |||
Derive a set of tests that all submissions should perform to ascertain correctness (state the tests, the inputs, and the expected outputs). In conjunction with conforming output specifications, | Derive a set of tests that all submissions should perform to ascertain correctness (state the tests, the inputs, and the expected outputs). In conjunction with conforming output specifications, | ||