Git Product home page Git Product logo

run_length_encoding_decoding's Introduction

Run_Length_Encoding_Decoding

Run-Length Encoding (RLE) is one of the oldest algorithms for data-compression available. It compresses by looking at the data for repetitions of the same character in a row and storing the amount and the respective character as target-data. Unfortunately, it only compresses within strict and special cases. Outside of these cases, it increases the data-size, even doubles the size in worst cases compared to the original, unprocessed data

In order to implement this algorithm, the following steps should be considered:

Declare the INPUT DATA:

  • Matrix width (integer)
  • Matrix height (integer)
  • Number of different characters (integer)
  • The used letters (char array)
  • Modify filepaths of input_data.txt , encoded_data.txt , decoded_data.txt

Generate random INPUT DATA to be ENCODED:

  • Create a random matrix (Matrix width * Matrix height values), that will be used as input data
  • Save the input data in a text file (input_data.txt)

ENCODE function:

  • Function looks at the data for repetitions of the same character in a row and stores the number of repetitions and the respective character
  • Write the encoded data in a text file (encoded_data.txt)

DECODE function

  • Function that extracts the characters from the encoded file (encoded_data.txt) and save them in a char array.
  • Transform an array of consecutive char digits (‘1’,’2’,’3’) in an integer number (123)
  • Write the decoded data in a text file (decoded_data.txt)

PERFORMANCE ANALYSIS

  • Check the execution time of encoding and decoding for unoptimized and optimized code
  • Check the size of input data, encoded data and decoded data

Usage

Use the Makefile in order to run both, optimized and unoptimized versions of the Run-Length Encoding algorithm.

make

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

run_length_encoding_decoding's People

Contributors

razvangls avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.