pcsx2 icon indicating copy to clipboard operation
pcsx2 copied to clipboard

[Feature Request]: ZStandard CHD support

Open Jarvik7 opened this issue 4 months ago • 2 comments

Description

Add ZStandard compression to CHD support. This is already supported in libchdr and has been recently added to MAME, redream, etc.

Reason

This gives a compression ratio between deflate and lzma, but drastically faster decompression time than either. Obviously this should improve the playing experience, especially on lower powered systems.

Examples

MAME, redream, chdman, RomVault, etc.

Jarvik7 avatar Feb 17 '24 22:02 Jarvik7

Is there a situation where the lzma decompression is too slow? Do you have a usecase where this is a problem?

refractionpcsx2 avatar Feb 17 '24 22:02 refractionpcsx2

Is there a situation where the lzma decompression is too slow? Do you have a usecase where this is a problem?

Thanks for your quick reply. I think it's basically the same discussion as happened on ppsspp github. https://github.com/hrydgard/ppsspp/pull/18824

Basically on low powered hardware or games with streaming assets it can be an issue. Even on typical systems a faster algorithm should reduce load times though. In any case it's already in libchdr so it's just a matter of hooking it up and letting users decide where they sit on the filesize<->performance spectrum.

Jarvik7 avatar Feb 17 '24 22:02 Jarvik7

I assume this can be done by updating libchdr to the latest version?

TellowKrinkle avatar Feb 17 '24 23:02 TellowKrinkle

I assume this can be done by updating libchdr to the latest version?

Looking at the ppsspp commit I linked above (link fixed), it seems like a relatively minor code change.

Jarvik7 avatar Feb 17 '24 23:02 Jarvik7

The code change looks to just include zstd, which we already include, so it may be as Tellow says.

refractionpcsx2 avatar Feb 18 '24 00:02 refractionpcsx2

Any system that is capable of running PS2 games is unlikely to struggle to decompress LZMA in time, especially since it's threaded. But that said, this is basically free.

~~Probably should add it to my libchdr fork and swap over to that, it has a bunch of other improvements too.~~ Edit: Turns out I've already done that.. 🤣

stenzek avatar Feb 18 '24 06:02 stenzek