Commit Graph

45 Commits

Author SHA1 Message Date
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
3d81f50afe Rename data type enum. 2026-03-14 21:45:02 +00:00
a5b8054a14 Rename compression enum. 2026-03-14 20:39:56 +00:00
1a16c7b6e2 Add blockAlignmentShift to header in create.c 2026-01-10 14:40:27 +00:00
Rebecca Wallander
65d34b1e9a Add flux implementation 2026-01-01 13:35:43 +01:00
4ca1938087 Fix table shift set up from hexadecimal to decimal.
It should be setup in 8 million sectors.
2025-12-31 12:02:22 +00:00
df026fafb6 Set blockAlignmentShift in header to match parsed options 2025-12-30 20:20:49 +00:00
344ce95619 Update parse_options function to return table_shift_found flag 2025-12-30 01:41:41 +00:00
d4f83cf9e4 Update copyright year to 2026. 2025-12-23 08:15:35 +00:00
03c091fdee Add dirty flags so structures only get rewritten on resume if they are changed. 2025-12-12 12:22:39 +00:00
e66b263183 Add function to generate cryptographically strong random bytes for the GUID on image creation. 2025-10-11 13:24:45 +01:00
b4df385b79 Add AARU_EXPORT and AARU_CALL macros to function implementations for consistency 2025-10-11 03:30:19 +01:00
61850a9520 Update DDT entry documentation to indicate 64-bit values 2025-10-11 01:34:22 +01:00
2e11b05547 Update application name handling to support UTF-8 in version 2 and remove ICU dependency 2025-10-11 01:26:17 +01:00
3d97bcd6d2 Add user sectors information to image metadata in create.c 2025-10-10 18:32:28 +01:00
ffe9311a74 Fix some places where the DDT was still being used with 32-bit values. 2025-10-10 11:45:18 +01:00
17e1c0f2bd Set DDTv2 as 64-bit and remove concept of multiple sizes of DDTs. 2025-10-10 02:39:57 +01:00
b884cfe8ea Rename field names for consistency across the codebase 2025-10-09 02:33:35 +01:00
5e346e6fd5 Rename XmlMediaType to MetadataMediaType for clarity and consistency 2025-10-09 02:26:09 +01:00
5be6727ec2 Refactor image info structure to use fixed-size arrays and improve UTF-16 to UTF-8 conversion 2025-10-09 02:24:09 +01:00
fafca45dae Remove concept of 16-bit DDTs. 2025-10-09 01:47:39 +01:00
7529b1f9df Refactor DDT initialization for improved memory management and alignment handling 2025-10-08 19:44:38 +01:00
97bc659571 Improve cache initialization to prevent division by zero in blockHeaderCache 2025-10-08 19:43:21 +01:00
ea63297348 Add cleanup function for failed image creation to improve memory management 2025-10-08 19:42:57 +01:00
2ec5aabd00 Add support for tape DDT management with hash table implementation 2025-10-07 18:03:19 +01:00
80113a9aae Allow single level DDT to be located anywhere on file. 2025-10-07 00:32:00 +01:00
82980a8b0b Add support for block compression with LZMA and FLAC in writing process 2025-10-06 15:41:45 +01:00
506b153930 Add support for on-the-fly BLAKE3 checksum calculation 2025-10-03 04:01:30 +01:00
6ebf65d36d Add on-the-fly SpamSum calculation support 2025-10-03 03:45:20 +01:00
79ac2e380c Add SHA-256 checksum calculation support 2025-10-03 02:03:39 +01:00
1e569c68a1 Add SHA-1 checksum calculation support 2025-10-03 01:49:44 +01:00
59addd3efc Implement on-the-fly MD5 checksum calculation 2025-10-03 00:57:14 +01:00
9e128a0ab8 Add rewind tracking to aaruformatContext and initialize in create.c 2025-10-03 00:17:16 +01:00
5c7610c1c0 Use heuristics to setup table shift. 2025-10-02 04:40:16 +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
a7434322ea Add const qualifiers to function parameters and local variables for improved type safety 2025-10-01 02:34:42 +01:00
f6ed0f1856 Add hash map implementation for sector deduplication 2025-09-30 20:10:40 +01:00
d5d2bb100f Enhance documentation for various functions 2025-09-30 16:03:34 +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
c2c9d9f7d4 Initialize primary DDT and calculate data block start position 2025-09-28 18:44:33 +01:00
90ca1ee872 Initialize index entries array and update index management for DDT entries 2025-09-28 17:08:33 +01:00
bed8b75491 Enhance logging and error handling across multiple modules 2025-08-14 00:38:28 +01:00
64c58c0300 Add write functionality for sectors and implement block closing logic 2025-08-13 16:17:45 +01:00
3b012797cb Implement creating AaruFormat image and writing header. 2025-08-07 15:43:35 +01:00