Thread: Compression algorithm help

  1. #1
    Registered User
    Join Date
    Feb 2013
    Posts
    1

    Compression algorithm help

    z827.cwrite a simple compression algorithm that takes a standard 8-bit ASCII text file and converts it to a compacted 7-bit encoding. This utilizes the fact that in normal ASCII text the top bit is always zero, and thus is not necessary.



    Please go through the sample code i had written and help me with the program.

    Thank you guys in advance

  2. #2

  3. #3
    Registered User
    Join Date
    May 2012
    Posts
    505
    Quote Originally Posted by bhargav_g View Post
    z827.cwrite a simple compression algorithm that takes a standard 8-bit ASCII text file and converts it to a compacted 7-bit encoding. This utilizes the fact that in normal ASCII text the top bit is always zero, and thus is not necessary.



    Please go through the sample code i had written and help me with the program.

    Thank you guys in advance
    So you need to research the bit manipulation operators, &, | ~ and ^ (though you probably won't need exclusive or). Also << and >> to shift bits.
    The other tricky part is what to do when the input is not a multiple of 8 bytes.
    I'm the author of MiniBasic: How to write a script interpreter and Basic Algorithms
    Visit my website for lots of associated C programming resources.
    https://github.com/MalcolmMcLean


Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Working with LZW data compression algorithm
    By husslela2 in forum C Programming
    Replies: 3
    Last Post: 07-01-2010, 09:23 AM
  2. Ziv-Lempel data compression algorithm
    By ataman in forum C++ Programming
    Replies: 1
    Last Post: 05-11-2008, 03:41 PM
  3. Simple compression algorithm?
    By cyberfish in forum Tech Board
    Replies: 8
    Last Post: 05-02-2008, 09:10 AM
  4. efficient compression algorithm pls
    By gooddevil in forum C Programming
    Replies: 7
    Last Post: 05-08-2004, 03:33 AM
  5. what's the best compression algorithm made so far?
    By toaster in forum A Brief History of Cprogramming.com
    Replies: 13
    Last Post: 05-15-2002, 03:20 PM