Jump to content
LaunchBox Community Forums

.chd compression baffles me


Lahrs

Recommended Posts

This isn't a question on to how to make a .chd file but what is actually going on with it. For example, I have a Dreamcast ROM of NBA Hangtime, the cue/bin file size is roughly 1.1GB. I turned it into a .chd file, and it's down to 247mb. I run it through Flycast, and it runs just as well, loads up just as fast, and plays exactly like the cue/bin file but at 1/4 the HD space. It seems as long as the emulators themselves can play a .chd file, there is every reason to convert them. Am I missing something? How does a file reduce its size to 1/4 without losing anything? Amazing, but baffling.

Link to comment
Share on other sites

Not sure how this will help, and assuming you don't want to get down into weeds of the actual compression algorithm used to create the chd file (hint: there are different versions supported by chdman, the MAME utility originally used, mostly likely, to create the chd files). Think of chd as another type of compression format like zip, 7z, rar, etc. A utility like chdman is used to create the file, then the end user program like MAME, and the other emulators that now support CHD, decompress the CHD file 'on the fly' directly into memory so the emulator can use it. Does any of this help?

Link to comment
Share on other sites

To be fair, I don't even understand how zip files work, so I believe that will be my next Google search. It is all 1's and 0's and if you shrink them down, they have to go somewhere. That is just my thought process at the moment, and I need to read up and get informed.

I do appreciate your reply. While the compression still wracks my brain, I do believe I understand the on-the-fly decompression into memory, and I assume that is why the game still plays at full speed.

Link to comment
Share on other sites

49 minutes ago, Lahrs said:

the cue/bin file size is roughly 1.1GB. I turned it into a .chd file, and it's down to 247mb.

Prt of tht is tht its now cmpressd.  (how's that for a visual? lol) 

Another factor is when converting .bin(s) to .chd, all the empty 'sections' are stripped out.  They're basically just blank placeholders that serve no purpose to the actual game.

Link to comment
Share on other sites

Posted (edited)

I've spent the last few hours digging into file compression... and playing games. I have a better understand now, and I still find it impressive, though less baffling. If I'm understanding correctly, your "Prt of tht is tht its now cmpressd." would need a small set of instructions so the computer, emulator, etc. would know how to rebuild all the missing A's and the O in 'now' should not be there, but with another set of instructions on how to rebuild all the missing O's. I think I'm close, though surface level.

That was a very helpful visual.

Edited by Lahrs
  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...