Set DDTv2 as 64-bit and remove concept of multiple sizes of DDTs.

This commit is contained in:
2025-10-10 02:39:57 +01:00
parent 421d5ada72
commit 17e1c0f2bd
15 changed files with 107 additions and 150 deletions

View File

@@ -182,10 +182,10 @@ typedef struct aaruformat_context
TapeDdtHashEntry *tape_ddt; ///< Hash table root for tape DDT entries
uint32_t *sector_prefix_ddt; ///< Legacy CD sector prefix DDT (deprecated by *2).
uint32_t *sector_suffix_ddt; ///< Legacy CD sector suffix DDT.
uint32_t *sector_prefix_ddt2; ///< CD sector prefix DDT V2.
uint32_t *sector_suffix_ddt2; ///< CD sector suffix DDT V2.
uint32_t *user_data_ddt2; ///< DDT entries (big variant) primary/secondary current.
uint32_t *cached_secondary_ddt2; ///< Cached secondary table (big entries) or NULL.
uint64_t *sector_prefix_ddt2; ///< CD sector prefix DDT V2.
uint64_t *sector_suffix_ddt2; ///< CD sector suffix DDT V2.
uint64_t *user_data_ddt2; ///< DDT entries (big variant) primary/secondary current.
uint64_t *cached_secondary_ddt2; ///< Cached secondary table (big entries) or NULL.
DdtHeader2 user_data_ddt_header; ///< Active user data DDT v2 header (primary table meta).
uint64_t cached_ddt_offset; ///< File offset of currently cached secondary DDT (0=none).
uint64_t cached_ddt_position; ///< Position index of cached secondary DDT.

View File

@@ -220,15 +220,6 @@ typedef enum
AudioMedia = 3 ///< Media that can only store data when modulated to audio.
} XmlMediaType;
/**
* \enum DdtSizeType
* \brief Size type for Deduplication Data Table (DDT) entries.
*/
typedef enum
{
BigDdtSizeType = 1 ///< Large sized DDT entries.
} DdtSizeType;
/**
* \enum SectorStatus
* \brief Acquisition / content status for one or more sectors.

View File

@@ -113,7 +113,6 @@ typedef struct DdtHeader
* - blockAlignmentShift: log2 alignment of stored data blocks (byte granularity of block_offset).
* - dataShift: log2 of the number of addressable sectors per increment of blockIndex bitfield unit.
* - tableShift: log2 of number of logical sectors covered by a single primary-table pointer (multi-level only).
* - sizeType: Selects entry width (small=16b, big=32b) impacting available bits for blockIndex+offset.
*
* Notes & current limitations:
* - User area sector count = blocks - negative - overflow.
@@ -156,7 +155,6 @@ typedef struct DdtHeader2
uint8_t dataShift; ///< 2^dataShift = sectors represented per increment in blockIndex field.
uint8_t tableShift; ///< 2^tableShift = number of logical sectors per primary entry (multi-level only; 0 for
///< single-level or secondary tables).
uint8_t sizeType; ///< Entry size variant (\ref DdtSizeType) controlling width of E.
uint64_t entries; ///< Number of entries contained in (uncompressed) table payload.
uint64_t cmpLength; ///< Compressed payload size in bytes.
uint64_t length; ///< Uncompressed payload size in bytes.