Giter Site home page Giter Site logo

rle-project's Introduction

Command Line RLE Compressor/Decompressor

Run length encoder/decoder written in C.

Description

This compressor uses positive- and negative-run RLE to lossleslly encode files.

  • Positive counts represent the run length of repeated characters (i.e. aaaa encodes to 4a).
  • Negative counts represent the run length of non-repeating characters (i.e. abcd encodes to -4abcd). These negative counts minimize the number of bytes needed to encode a long non-repeating run (only 1 byte needed per 127 characters instead of the 1 byte needed for each character if only positive runs were used).

All counts are represented in encoded files as signed, 8-bit integers (-128 to 127).

Note: Compressed files will be saved with a .rle extention. foo.txt compresses to foo.txt.rle. Decompressed files will be saved with the original filename. If a .rle extention is found, it will be removed, potentially overwriting a file with the same name. All files will be written to the same folder as the source file.

Information entropy and optimal size after compression is calculated using Shannon's Theorem.

Usage

  1. make
  2. ./RLE MODE FILENAME: Mode is 1 (for compression) or 2 (for decompression)

Testing

  • Tested on Mac
  • Tested on Linux
  • Tested on Windows

Potential Improvements

  • Dynamic realloc for decoding (instead of precomputing worst case)
  • #define and use constants

rle-project's People

Contributors

adityashah98 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

vehar

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.