Commit Graph

12 Commits

Author SHA1 Message Date
a81a0fe09a Merge pull request #23 from RomTholos/fix/flac-error-handling
fix: FLAC error handling — decode corruption, encode crash, unchecked…
2026-03-29 18:01:20 +01:00
Kevin Bortis
26e8d92810 fix: FLAC error handling — decode corruption, encode crash, unchecked returns 2026-03-29 15:47:27 +02:00
Kevin Bortis
120174e4cd Add multi-threaded zstd compression support
Switch zstd encoder from simple API (ZSTD_compress) to advanced API
(ZSTD_CCtx + ZSTD_compress2) with configurable worker threads via
ZSTD_c_nbWorkers. Consumer controls threading through threads=N
option string parameter. Default is 1 (single-threaded, bit-identical
output to previous behavior).

- Enable ZSTD_MULTITHREAD compile definition and link pthreads
- Add num_threads field to options struct and context
- Parse threads=N in option string (clamped >= 1)
- Rewrite aaruf_zstd_encode_buffer() with num_threads parameter
- Update all call sites (write.c, close.c)
2026-03-29 12:56:19 +02:00
Kevin Bortis
6be36b6bda Add Zstandard compression support
Implements zstd as an alternative to LZMA for data block and
subchannel compression using the allocated compression IDs 4
(kCompressionZstd) and 5 (kCompressionZstdCst).

Adds zstd v1.5.7 as a bundled submodule with a static library
build including x86_64 assembly fast path for decompression.

Write path selects zstd or LZMA based on the zstd option.
Subchannel blocks use zstd+CST instead of LZMA+CST when enabled.
LZMA properties header is only written for LZMA-based compression
types, preventing format corruption in zstd-compressed images.

Activated via options string: "zstd=true;zstd_level=19".
Default remains LZMA for backwards compatibility.

Tested: SHA-256 verified lossless roundtrips across 9 disc systems
(Dreamcast, Saturn, Mega CD, PC Engine CD, Neo Geo CD, PS1, PS2 CD,
PS2 DVD) and PS1 SBI subchannel preservation with zstd+CST.
2026-03-19 08:45:07 +01:00
d4f83cf9e4 Update copyright year to 2026. 2025-12-23 08:15:35 +00:00
b4df385b79 Add AARU_EXPORT and AARU_CALL macros to function implementations for consistency 2025-10-11 03:30:19 +01:00
4403cf267f Refactor variable declarations and expressions for improved readability and consistency across multiple source files 2025-10-01 02:54:51 +01:00
a1b3b5db92 Refactor variable declarations for improved clarity and consistency in multiple source files 2025-10-01 02:39:37 +01:00
a7434322ea Add const qualifiers to function parameters and local variables for improved type safety 2025-10-01 02:34:42 +01:00
dda0ee89e8 Refactor variable names for consistency and readability across multiple files 2025-09-30 15:11:27 +01:00
9382243369 Add detailed documentation for various processing functions in AaruFormat 2025-09-30 13:08:45 +01:00
9a5a994702 Move source files to categorizing subfolders. 2025-08-02 16:52:12 +01:00