Git Product home page Git Product logo

shafa-cd's Introduction

GitHub top language

What is Shafa?

Shafa is a free and open-source program made for Lossless files' compression written in C (2020/21).
It is OS independent and some modules are multithread executed if running on Windows or POSIX-compliant (allowing pthreads).

Uses two algorithms for compression:

  • RLE
  • Shannon Fano with blocks of length 1 (K=1).

For RLE's decompression a .freq file is needed along with the .rle file.
For Shannon Fano's decompression a .cod file is needed along with .shaf.
(All these files are generated by the program)

Modules:

  • F ( RLE compression and Frequencies calculation )
  • T ( Codes calculation using Shannon-Fano's algorithm )
  • C ( Shannon-Fano compression )
  • D ( RLE and Shannon-Fano decompression )

SETUP - *NIX

gcc -o shafa $(find ./src -name '*.c' -or -name '*.h') -O3 -Wno-format -pthread

SETUP - WINDOWS

gcc -o shafa src/*.c src/*.h src/*/*.c src/*/*.h src/*/*/*.c src/*/*/*.h -O3 -Wno-format

How to execute?

Open terminal where the created executable shafa is located and type the following:

Windows:

  • shafa.exe <file> <options>

*NIX:

  • ./shafa <file> <options>

CLI Options:

-m <module>      :  Executes respective module (Can be executed more than one module if possible)
-b <K/m/M>       :  Blocks size for compression (default: K)
-c <r/f>         :  Forces execution (r -> RLE's compress | f -> Original file's frequencies)
-d <s/r>         :  Only executes a specific decompression (s -> Shannon-Fano's algorithm | r -> RLE's algorithm)
--no-multithread :  Disables multithread 

Blocks Size:

  • K = 640 KiB
  • m = 8 MiB
  • M = 64 MiB

Note: Multithread was only implemented in modules C and D (the ones that cost the most)

shafa-cd's People

Contributors

fytex avatar beasrodrigues24 avatar shiiva03 avatar joaoca93166 avatar arct204 avatar leonardo1924 avatar alexmartins01 avatar franl08 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.