Skip to content

Latest commit

 

History

72 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ECM

Error Code Modeler - Lossless compression for CD image files

License: GPL v2 C Standard Build System

Overview

ECM reduces the size of CD image files (BIN, CDI, NRG, CCD, and other raw sector formats) by eliminating redundant Error Correction/Detection Codes (ECC/EDC) from each sector.

The encoder automatically detects sector types and strips predictable data. The decoder regenerates every sector exactly as it was stored: full 2352-byte raw sectors, or 2336-byte Mode 2 sectors for images that never had sync and header bytes. Compression is completely lossless, typically shrinking game discs by 10-15%.

Note: "Cooked" ISO files (2048 bytes/sector) contain no ECC/EDC data and will see no size reduction.

Quick start

ecm game.bin          # game.bin -> game.bin.ecm
unecm game.bin.ecm    # game.bin.ecm -> game.bin

Documentation

The documentation is organized by what you need, following Diátaxis:

Tutorials — learning by doing

How-to guides — steps for a specific task

Reference — precise, complete information

Explanation — background and design

Features

  • Lossless - Bit-perfect roundtrip compression/decompression
  • Automatic detection - Identifies Mode 1 and Mode 2 Form 1/2 sectors at any byte offset, including MODE2/2336 images and raw dumps with subchannel data
  • Streaming support - Works with stdin/stdout for pipeline integration
  • CUE generation - Optional CUE sheet creation on decode
  • Cross-platform - Linux, macOS, Windows

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Ensure tests pass (meson test -C build, or just test)
  4. Ensure code is formatted (just fmt)
  5. Submit a pull request

Build requirements and commands are in Install ECM.

License

This project is licensed under the GNU General Public License v2.0 - see the LICENSE file for details.

Authors

See AUTHORS.md for full attribution.

See Also

  • ECM Tools - Original implementation by Neill Corlett
  • cdrdao - CD burning with DAO support

About

Error Code Modeler: lossless compression for raw CD images (BIN, CDI, NRG, CCD) by stripping redundant ECC/EDC sector data. Modern C23 rewrite with streaming stdin/stdout, CUE sheet generation, and Linux/macOS/Windows builds.

Topics

Resources

Stars

25 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages