Compression algorithm help

This is a discussion on Compression algorithm help within the C Programming forums, part of the General Programming Boards category; z827.c write a simple compression algorithm that takes a standard 8-bit ASCII text file and converts it to a compacted ...

  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
    333
    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.
    http://www.malcolmmclean.site11.com/www

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, 10:23 AM
  2. Ziv-Lempel data compression algorithm
    By ataman in forum C++ Programming
    Replies: 1
    Last Post: 05-11-2008, 04:41 PM
  3. Simple compression algorithm?
    By cyberfish in forum Tech Board
    Replies: 8
    Last Post: 05-02-2008, 10:10 AM
  4. efficient compression algorithm pls
    By gooddevil in forum C Programming
    Replies: 7
    Last Post: 05-08-2004, 04: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, 04:20 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21