Thread: compression

  1. #1
    Registered User
    Join Date
    Jan 2002
    Posts
    77

    Question compression

    any idea of how to make a program that compresses files, something along the lines of winzip but not as complex.

    thanks for any help.
    Hooked On Phonics Didn't Work For Me!

  2. #2
    I lurk
    Join Date
    Aug 2002
    Posts
    1,361
    You could try a search on www.planet-source-code.com for "Encryption" or "Encryption Algorithms", that will probably give you a horde of source-code examples.

  3. #3
    Registered User
    Join Date
    Sep 2002
    Posts
    417
    If anyone wants a totally useless program I wrote that basically does exactly the opposite of compression, just ask... it can make a tiny text file a few megs... no reason to want it, I hope.

  4. #4
    Code Monkey Davros's Avatar
    Join Date
    Jun 2002
    Posts
    812
    >You could try a search on www.planet-source-code.com for "Encryption" or "Encryption Algorithms",

    Encryption has nothing to do with compression. I suggest you search for 'Huffman compression'.

  5. #5
    Registered User Diamonds's Avatar
    Join Date
    Oct 2002
    Posts
    68

    huffman

    yes, search for huffman, many college campus's websites have tutorials on how it's done.

    passed the class b/c of those websites ;0

  6. #6
    Registered User
    Join Date
    Jan 2002
    Posts
    77
    alright ill go and check it out
    Hooked On Phonics Didn't Work For Me!

  7. #7
    Registered User The Dog's Avatar
    Join Date
    May 2002
    Location
    Cape Town
    Posts
    788
    You cannot compress data. You can just store it differently, thus making it seem "compressed". All data compression schemes use some type of encoding. So compressed data is actually just encoded data.

  8. #8
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,380
    A nice site on datacompression is this one:
    www.data-compression.com/

    A collection of links to compression algorithms:
    http://www.softpanorama.org/Algorith...pression.shtml

  9. #9
    Banal internet user
    Join Date
    Aug 2002
    Posts
    1,380
    Where are the results to the last contest? When they're up, you can look at them for examples of simple compression implementation

    IMO, a beginner who tries to take on Huffman will fail, and become discouraged from learning in the future... go simple; Huffman can come later.

  10. #10
    Code Monkey Davros's Avatar
    Join Date
    Jun 2002
    Posts
    812
    >You cannot compress data. You can just store it differently, thus making it seem "compressed". All data compression schemes use some type of encoding. So compressed data is actually just encoded data.

    Urh!?

    Let me apply this to another situation.

    You cannot compress a sponge. You can just squeeze it, thus making it seem "compressed". All sponge compression schemes use some type of sqeezing. So a compressed sponged is actually just a sqeezed sponge.

    I suppose it depends on what your definition of data is, and how pinicky you want to be.

    For most real world situations, the following applies:

    Big File >> COMPRESSION >> Smaller File
    OS: Windows XP
    Compilers: MinGW (Code::Blocks), BCB 5

    BigAngryDog.com

  11. #11
    Code Monkey Davros's Avatar
    Join Date
    Jun 2002
    Posts
    812
    THIS IS MY 258th POST!

    >go simple; Huffman can come later

    You want try Range Encoding! This is were you keep pushing integers into a floating point number until it explodes, and hope to hell you can extract them at the other end.

    However, BMJ is right. As alternative to huffman, run length encoding is a much simpler form of compression. This is suitable for gifs & line art graphics, but not much else.
    OS: Windows XP
    Compilers: MinGW (Code::Blocks), BCB 5

    BigAngryDog.com

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Data Compression
    By Ezerhorden in forum C++ Programming
    Replies: 5
    Last Post: 02-11-2006, 10:19 AM
  2. compression
    By X PaYnE X in forum C Programming
    Replies: 20
    Last Post: 01-11-2005, 05:14 PM
  3. efficient compression algorithm pls
    By gooddevil in forum C Programming
    Replies: 7
    Last Post: 05-08-2004, 03:33 AM
  4. Compression utility source code
    By Blizzarddog in forum C++ Programming
    Replies: 4
    Last Post: 11-07-2003, 08:15 PM
  5. help: compression algorithms...
    By Unregistered in forum C++ Programming
    Replies: 1
    Last Post: 02-24-2002, 06:10 AM