Results 1 to 8 of 8

Thread: ECM -- Error Code Modeler (Better Compression)

  1. #1
    Join Date
    Sep 2006
    Posts
    22,212
    Thanks
    172
    Thanked 385 Times in 241 Posts
    EP Points
    825

    Default ECM -- Error Code Modeler (Better Compression)

    CD Data Sectors

    To understand what ECM does and how it works, you must first understand the sectors in a CD and what they're made of.

    A typical data CD consists of thousands of 2352-byte sectors. Each sector looks like this (drawings not to scale):



    Only 2048 bytes in each sector are used for actual data. The rest are:

    # Sync - A special code used by the drive to tell where the sector begins
    # Address - This tells the drive which sector it's looking at
    # EDC - Error Detection Code, used to detect if the data is corrupt
    # ECC - Error Correction Code, used to correct the data if it is corrupt

    When you create BIN/CUE files from a data CD, the BIN contains all of this data - all 2352 bytes from each sector.

    The light-colored areas in the diagram (sync, address, data) are usually easy to compress. However, the dark areas (EDC, ECC) look like noise, and are nearly impossible to compress with conventional tools such as WinRAR. When you compress a BIN file in WinRAR, each sector ends up looking something like this:



    Sync, address, and data compress okay, but EDC and ECC just sit there like bricks taking up space. And they usually don't even need to be there!

    Filtering Sectors Through ECM First

    ECM selectively strips the sync, EDC and ECC codes from each sector, whenever possible. Once a BIN file has been run through ECM, the resulting sectors look like this:



    That process, in itself, doesn't reduce the BIN size very much. But notice how the only parts left are the light-colored (easy to compress) parts! Now, when you run the ECM file through WinRAR, you'll get much better results than before:



    But wait a minute, don't I need those ECC codes? Doesn't that make it less reliable?

    You get the EDC/ECC codes back when you convert from ECM back to BIN
    (which is required before burning - you can't currently burn a ECM file directly).

    When you're archiving or transmitting files in a format such as RAR, you already have error detection built in. WinRAR doesn't particularly care about the CD sector EDC/ECC codes, and just handles BIN files like any other file.

    So no, you're not losing any reliability by converting BIN files to ECM, as long as you make sure to convert them back before burning.

    What about copy protection? Don't they use bogus ECC data? Wouldn't ECM ruin that?

    ECM only eliminates EDC/ECC data for sectors where it's verifiably possible to recreate that data. If the ECC is bogus, ECM will preserve that bogus data.

    You won't lose any data by converting a file to ECM and back again. The process is completely lossless.
    So when you use ECM to compress the BIN file, then 7zip it you can save a hell of a lot of space.

    Offical site
    Download

    I've personally used this to save a lot of space on PC games. I know they aren't allowed here, but I was just trying it. With one game I cut down the ISO by 500mb+ using ECM and then compressing the ecm with 7zip -ultra. It can be quite the bandwidth saver.

    Here is the example:
    Red outline is the size of the .img.ecm uncompressed
    Silver outline is the compressed size total.



    GUI version of ECM made by Renan Lazarotto here
    Last edited by Inferno.; 22nd-May-2011 at 23:42.

  2. #2
    Join Date
    Apr 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I tried decoding an ECM file *.ecm through the 'unecm' application to convert/create/decode/decompress (I am not sure which term) a Disc Image file *.img. After unecm finishes decoding, a Disc Image of the file is created successfully and automatically which I believe would be the normal case. It worked perfectly on ePSXe PSX emulator

    After a while, I did some renaming of file names (.sub, .ccd, .ecm and .img) of various ePSXe games (working on the emulator) without testing them if they work after the renaming. I tried installing pakkISO 0.4, which I never got to use, and uninstalled it immediately because I am not a fan of programs modifying my context menu (right click) although I know they could be removed through shell or shell extensions at regedit.exe.

    Now, when I decode/convert an .ecm, a simple 'File' with no extension name is only created after the decoding (and not an img file) but I can run the file on ePSXe. When opening/running it on ePSXe, the file cannot be seen immediately as PSX ISO (*.BIN, *.ISO, *.IMG, *.CUE, *.CCD, *.MDS) until I choose 'All files' from the drop-down box.

    Finding it having roughly the same file size as the .ecm, I tried to manually add the word '.img' to see if I could successfully convert it to an img file. Windows warned me the file might be unusable after I rename the file with '.img' on end of file name but I did so otherwise, a risky test indeed and it did successfully converted to .img and it worked on my ePSXe.

    All this meant every time I successfully decode an .ecm, I still have to manually rename the 'File' to an .img. Uncool! I cannot determine which event did this to my ecm: Was it my renaming of files or was it my accidental install of pakkISO?



    Other infos you might ask:
    My ECM tool is Neill Corlett's v1.0 (ecm100)
    Windows 7 Ultimate Edition 64-bit Edition
    WinRAR
    My email is [email protected], facebook chat open


    I will be open to any kind of solution. My intention in giving out my email is nothing except for the solution of the problem in question. Provide solutions please. Need utmost help urgently from you people... Thanks in advance!

  3. #3
    Join Date
    Dec 2010
    Location
    Right Behind You
    Posts
    1,072
    Thanks
    124
    Thanked 134 Times in 62 Posts
    EP Points
    230

    Default

    i believe what has happened is ECM tools has lost its association with the files try redownloading ECM tools and see if that helps anything? Also i do not believe that Pakkiso would of changed anything to your system to stop ECM tools from working
    *Computer Specs*
    Operating System: Windows 10 64-bit
    Processor: AMD FX 8350 Processor (8 CPUs), ~4.1GHz
    Memory: 16GB RAM
    Graphics Card: AMD Radeon R9 8GB GDDR5

    If You Find My Help Useful In Any Way Please Click Thanks.
    Bennieboi's Question Of The Day (now defunct)

  4. #4
    Join Date
    Jul 2008
    Posts
    3,049
    Thanks
    8
    Thanked 7 Times in 4 Posts
    Blog Entries
    1

    Default

    Oh, wow, this sounds like it could save me a lot of space. I have a ton of PC games backed up. Do I need the same tool to uncompress them as well? Also, does this work on DVD's?

  5. #5
    Join Date
    Sep 2006
    Posts
    22,212
    Thanks
    172
    Thanked 385 Times in 241 Posts
    EP Points
    825

    Default

    Quote Originally Posted by !nstaGib View Post
    Oh, wow, this sounds like it could save me a lot of space. I have a ton of PC games backed up. Do I need the same tool to uncompress them as well? Also, does this work on DVD's?
    Yes you need to use it to decompress the ISOs, and it only works on CD images.

  6. #6
    Join Date
    Jul 2008
    Posts
    3,049
    Thanks
    8
    Thanked 7 Times in 4 Posts
    Blog Entries
    1

    Default

    Quote Originally Posted by Inferno. View Post
    Yes you need to use it to decompress the ISOs, and it only works on CD images.
    Ah, ok then. That sort of limits its advantages for me
    Still, it's pretty cool, thanks for pointing this out

  7. #7
    Join Date
    Sep 2006
    Posts
    22,212
    Thanks
    172
    Thanked 385 Times in 241 Posts
    EP Points
    825

    Default

    It only saves around 30-50MB per ISO IIRC, wouldn't be worth re-archiving all your CD images unless you were going to do it anyway for another reason... Just sayin'.

  8. #8
    Join Date
    Jul 2008
    Posts
    3,049
    Thanks
    8
    Thanked 7 Times in 4 Posts
    Blog Entries
    1

    Default

    Quote Originally Posted by Inferno. View Post
    It only saves around 30-50MB per ISO IIRC, wouldn't be worth re-archiving all your CD images unless you were going to do it anyway for another reason... Just sayin'.
    Yeah, but lets say I have 20 ISO's. That's around 800mb, which is one more CD.

    If my math is right (which it probably isn't), then it's around 7% off of each cd that you're saving. That's before you archive it with Winrar.

Similar Threads

  1. Suggestion - Using ECM for ISO's
    By Winged 2.0 in forum Comments/Suggestions/Broken Links & Download Problems
    Replies: 7
    Last Post: 15th-March-2004, 21:41
  2. Does a ROM lose quality after compression?
    By Grim Reaper in forum Computer Corner
    Replies: 3
    Last Post: 23rd-September-2003, 00:03
  3. Invalid Compression
    By danielwalsh2000 in forum ROM & ISO Requests
    Replies: 1
    Last Post: 21st-July-2002, 15:33
  4. compression utility
    By gotenks_2322 in forum ROM & ISO Requests
    Replies: 1
    Last Post: 4th-June-2002, 07:44

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About Us

We are the oldest retro gaming forum on the internet. The goal of our community is the complete preservation of all retro video games. Started in 2001 as EmuParadise Forums, our community has grown over the past 18 years into one of the biggest gaming platforms on the internet.

Social