User Tools

Site Tools


notes:discrete:fall2022:projects:rle1

This is an old revision of the document!


BACKGROUND

Version 2 of our RLE algorithm.

This time we will be encoding and decoding similar data focusing on more than one byte.


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

Please reference the image below to find the hexadecimal value of the ASCII symbols:

*Our task is to ask questions on Discord or in class and document our findings on this wiki page collaboratively, regarding the functionality of this project.

*For anybody interested in editing the wiki page, here is the dokuwiki user guide: https://www.dokuwiki.org/wiki:syntax#basic_text_formatting -Ash

CUSTOMIZATION: variable stride

The stride parameter indicates

PROGRAM

Encode program will take two arguments:

./encode INFILE  STRIDE
 argv[0] argv[1] argv[2]

./encode sample0.txt 2

For ENCODE, the second argument no longer indicates the destination file name, the destination file name is provided by byte 12 of the header ( the name of the original file), and appending .lre at the end.

For ENCODE, the second argument is now a STRIDE indicator, with a min of 0 and max of 255. No default stride, if no stride is indicated, display error. Store stride on byte 10 of the header.

Decode program will take only one argument, the encoded .lre file:

./decode INFILE 
 argv[0] argv[1]

./decode sample0.txt.rle

The decoder should be able to read the header and find out the original filename. Decode will output a file with the name of the original file, without the ``.rle``.

OUTPUT SPECIFICATIONS

VERIFICATION

notes/discrete/fall2022/projects/rle1.1664465743.txt.gz · Last modified: 2022/09/29 15:35 by abarbcal