Thread: ...please try my program...

  1. #1
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708

    Exclamation ...please try my program...

    Will someone try my file-compression program? It's free! You can even call it from another program, making it easy to incorperate into GUI downloads. Anyway, please try it!
    To compress files, simply drag and drop as many as necessary onto the .exe's icon. Decompressing works the same way. The compressed files will have a ".pkt" extension and both the decompressed and compressed files recieve a "(PK)" stamp at the beginning of the filename to allow them to coexist with the originals.
    The most remarkable compressions will result from bitmaps. The exceptions are bitmaps of photographic images, since these have more random fluctuations in their byte patterns.
    Interestingly, I used the above scenario (calling from another program) to "unpack" a windows program. It originally required the download of about 130MB of graphics files. These were compressed down to about 0.75MB. My uncle downloaded the entire program from a 56K modem in under 2 minutes! This saved several hours of downloading!
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  2. #2
    Registered User toaster's Avatar
    Join Date
    Apr 2002
    Posts
    161
    what compression algorithm are you using?
    think only with code.
    write only with source.

  3. #3
    Unregistered
    Guest
    you think i believe hat crap?

  4. #4
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    The algorithm is my own and, admittedly, simple. Basically, the program starts at the first byte and checks to see if the adjacent byte is identical. The process continues on like this, gradually widening the comparing buffer till a match is found. If not, the buffer falls back to one-byte's width and the comparison starts at byte two! After the compression is complete, the size of the new buffer is double-checked with the original to guarantee the former is smaller than the latter.
    I am no math genius, so it was the most logical way to do it.

  5. #5
    Refugee face_master's Avatar
    Join Date
    Aug 2001
    Posts
    2,052
    I could only get it to work on some bitmap files that I made so heaps of the adjacent pixels were here same. I used 3 different colours all lined up and it more than halved the 14k bitmap.

  6. #6
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    A good benchmark is the WinZip program. Side by side, mine doesn't do too bad. But of course, Winzip usually outdoes me a bit! Still, like I said you can call it in other programs, a nice feature that Winzip doesn't do.
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  7. #7
    _B-L-U-E_ Betazep's Avatar
    Join Date
    Aug 2001
    Posts
    1,412
    It is a very nice application. I am impressed.
    Blue

  8. #8
    Registered User
    Join Date
    Feb 2002
    Posts
    51

    Talking

    Am I the only one that finds it ironic that your compression program is downloaded as a zip? Not trying to make fun, I think it's awesome that you wrote this. Just thought it was a little humorous.

  9. #9
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    Hey thanks for the comment, Beta But honesty comes first

    And yes, I did notice that little bootstrap irony too

    Please let me know if you have any problems with it.
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  10. #10
    Linguistic Engineer... doubleanti's Avatar
    Join Date
    Aug 2001
    Location
    CA
    Posts
    2,459
    sounds like RLE to me... try it with other data as input... eg, random data... or at least more random than what i assume you are using [blank or bytewise repeatative bitmaps]...
    hasafraggin shizigishin oppashigger...

  11. #11
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    That's just the thing. In essence the function looks at things rather flatly, and due to this, the compression is weak on photos, complex bitmaps, etc. I will experiment on some "deeper" analysis techniques soon though. I won't be satisfied till I beat Winzip! Oh, and how might I make the process run faster? I am using register variables (well, ASKING for them, that is ) and running as efficiently as possible. For instance: at first I would iterate through an entire chunk to see if it was identical with the comparing chunk. Then I tripled the speed by comparing the first and last bytes of the two FIRST. Still, when processing huge photos, several seconds are needed and then I find I couldn't make it smaller. ( note: there is an overhead of 12 bytes for each "sub-compress").
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  12. #12
    Unregistered
    Guest

    I dont

    >It originally required the download of about 130MB of graphics files. These were compressed down to about 0.75MB

    i dont believe this part

  13. #13
    Registered User Dual-Catfish's Avatar
    Join Date
    Sep 2001
    Posts
    802
    Code:
    |Packet.exe - Application Error                        |x| 
    |                                                        |
    |     The instruction at "0x00405930" refrenced memory   |
    |     at 0x02BA0000". The memory could not be "read".    |
    |                                                        |
    |     Click on OK to terminate the program	         |
    |     Click on CANCEL to debug the program	         |
    |                				         |
    | 	+---------+   +---------+	                 |     
    |  	|    Ok   |   | Cancel  |                        |
    |  	+---------+   +---------+	                 |
    +--------------------------------------------------------+
    Last edited by Dual-Catfish; 07-20-2002 at 11:09 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Issue with program that's calling a function and has a loop
    By tigerfansince84 in forum C++ Programming
    Replies: 9
    Last Post: 11-12-2008, 01:38 PM
  2. Need help with a program, theres something in it for you
    By engstudent363 in forum C Programming
    Replies: 1
    Last Post: 02-29-2008, 01:41 PM
  3. Replies: 4
    Last Post: 02-21-2008, 10:39 AM
  4. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 10:04 PM