This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
notes:discrete:fall2022:projects:rle0 [2022/09/06 19:58] – [SPECIFICATIONS] decoder spec's and additional information to encoder specs hcordell | notes:discrete:fall2022:projects:rle0 [2022/09/07 22:57] (current) – [PROGRAM] abarbcal | ||
---|---|---|---|
Line 18: | Line 18: | ||
The RLE algorithm will encode this data by replacing the repeated characters with a count number and a single value. | The RLE algorithm will encode this data by replacing the repeated characters with a count number and a single value. | ||
- | < | + | < |
There are 4 a's (0x61), 2 b' | There are 4 a's (0x61), 2 b' | ||
Line 33: | Line 33: | ||
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: | ||
{{ : | {{ : | ||
+ | |||
+ | NOTE: Use chars as they will give a hex-byte value as opposed to any kind of string or integer values that they may be converted to from other data types. | ||
=====SPECIFICATIONS===== | =====SPECIFICATIONS===== | ||
Line 47: | Line 49: | ||
The decoder should be able to take the output of the encoder and give back the file initially inputted to the encoder. The decoder should make use of the header to find the filename alongside the contents of the file to decode the file. | The decoder should be able to take the output of the encoder and give back the file initially inputted to the encoder. The decoder should make use of the header to find the filename alongside the contents of the file to decode the file. | ||
+ | Furthermore, | ||
**NOTE:** The encoder and decoder are two separate programs. | **NOTE:** The encoder and decoder are two separate programs. | ||
Line 60: | Line 63: | ||
} | } | ||
</ | </ | ||
+ | |||
+ | *The in_file should be taken from the user as argv[1]. | ||
+ | |||
+ | *The out_file should also be taken from the user as argv[2]. | ||
====DATA HEADER SPECIFICATIONS==== | ====DATA HEADER SPECIFICATIONS==== | ||
Header Format: | Header Format: | ||
Line 97: | Line 104: | ||
Encoder will output a file with a name equivalent to the second argument. | Encoder will output a file with a name equivalent to the second argument. | ||
- | Decode program will take one argument: | + | Decode program will take two arguments: |
<cli> | <cli> | ||
- | ./decode INFILE | + | ./decode INFILE |
- | | + | |
- | ./decode sample0.txt.rle | + | ./decode sample0.txt.rle |
</ | </ | ||
+ | The decoder should be able to read the header and find out the filename if a second argument is not given. If a second argument is given it will use the second argument instead of taking the filename from the header. | ||
Decode will output a file of similar name without the .rle extension after running your decoder. | Decode will output a file of similar name without the .rle extension after running your decoder. | ||
=====OUTPUT SPECIFICATIONS===== | =====OUTPUT SPECIFICATIONS===== | ||
Line 136: | Line 144: | ||
**NOTE:** This is not the full make check output, this is pending a full successful make check so if one is achieved feel free to delete this. | **NOTE:** This is not the full make check output, this is pending a full successful make check so if one is achieved feel free to delete this. | ||
+ | Verification adds the in/ to the input file name argument, as well as the out/ for the output file name argument. | ||
<cli> | <cli> | ||
USERNAME@lab46: | USERNAME@lab46: | ||
Line 145: | Line 153: | ||
in/ | in/ | ||
in/ | in/ | ||
+ | in/ | ||
+ | |||
+ | ================================================= | ||
+ | = PHASE 1: Decode -> Raw data verification test = | ||
+ | ================================================= | ||
+ | in/ | ||
+ | in/ | ||
+ | in/ | ||
+ | in/ | ||
+ | |||
+ | ================================================ | ||
+ | = PHASE 2: Raw -> Encode -> Decode -> Raw test = | ||
+ | ================================================ | ||
+ | in/ | ||
+ | in/ | ||
+ | in/ | ||
+ | in/ | ||
+ | |||
+ | ============================================= | ||
+ | = PHASE 3: Decode -> Raw -> Encode Raw test = | ||
+ | ============================================= | ||
+ | in/ | ||
+ | in/ | ||
+ | in/ | ||
+ | in/ | ||
</ | </ |