<trclass="memdesc:a80a88ec68cd0332a57886ac363bfa4d1"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Block identifier, must be BlockType::DeDuplicationTable2. <br/></td></tr>
<trclass="memdesc:a14f9ccf36df63e036d69291182cf7bbb"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Data classification (<aclass="el"href="enums_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6">DataType</a>) for sectors referenced by this table. <br/></td></tr>
<trclass="memdesc:ad1a27a46df09748a91a9010a630c422e"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Compression algorithm for this table body (<aclass="el"href="enums_8h.html#affec749ed88365143745313ae9168263">CompressionType</a>). <br/></td></tr>
<trclass="memdesc:a68f4825db4e22906af0e55a359360656"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Total number of hierarchy levels (root depth); > 0. <br/></td></tr>
<trclass="memdesc:ac8ec7921a5651b5107eda4e99b488798"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Zero-based level index of this table (0 = root, increases downward). <br/></td></tr>
<trclass="memdesc:af71423c2a8c7fa89dfd2313b456c57a2"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Absolute byte offset of the parent (previous) level table; 0 if root. <br/></td></tr>
<trclass="memdesc:aa4b1416ac0e0585f436513cacf9ebd74"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Leading negative LBA count; added to external L to build internal index. <br/></td></tr>
<trclass="memdesc:a2bfa558d9d778ae6b86d52520e278b66"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Trailing dumped sectors beyond user area (overflow range), still mapped with entries. <br/></td></tr>
<trclass="memdesc:a238a2ca31ce0f60af3e59a1cb3e2e73c"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Base internal index covered by this table (used for secondary tables; currently informational). <br/></td></tr>
<trclass="memdesc:ad9a2beb3a79bc6c239ba04fe341e0cde"><tdclass="mdescLeft"> </td><tdclass="mdescRight">2^dataShift = sectors represented per increment in blockIndex field. <br/></td></tr>
<trclass="memdesc:a8c2110cbb42bde3c0e302d3429024b04"><tdclass="mdescLeft"> </td><tdclass="mdescRight">2^tableShift = number of logical sectors per primary entry (multi-level only; 0 for single-level or secondary tables). <br/></td></tr>
<trclass="memdesc:a4e90c22109c3fff37b526a113b094a50"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Number of entries contained in (uncompressed) table payload. <br/></td></tr>
<divclass="textblock"><p>Header preceding a version 2 hierarchical deduplication table. </p>
<p>Version 2 introduces multi-level tables to efficiently address very large images by subdividing the logical address space. Tables at higher levels partition regions; leaves contain direct (block, sector) entry mappings. Navigation uses <aclass="el"href="#ac8ec7921a5651b5107eda4e99b488798">tableLevel</a> (0 = root) and <aclass="el"href="#a68f4825db4e22906af0e55a359360656">levels</a> (total depth).</p>
<p>Logical sector (LBA) mapping (actual implementation in decode_ddt_{single,multi}_level_v2):</p><oltype="1">
<li>Let L be the requested logical sector (can be negative externally). Internal index I = L + negative. Valid range: 0 <= I < blocks. (Total user-data sectors often = blocks - negative - overflow.)</li>
<li>If tableShift == 0 (single-level): entryIndex = I. Else (multi-level): itemsPerPrimaryEntry = 1 << tableShift primaryIndex = I / itemsPerPrimaryEntry secondaryIndex = I % itemsPerPrimaryEntry The primary table entry at primaryIndex yields a secondary DDT file offset (scaled by 2^blockAlignmentShift), whose table entries are then indexed by secondaryIndex.</li>
<li>Read raw DDT entry value E (64-bit).</li>
<li>If E == 0: sector_status = SectorStatusNotDumped; offset=block_offset=0. Otherwise extract: statusBits = E >> 60 baseBits = E & 0xFFFFFFFFFFFFFFF sectorOffsetWithinBlock = baseBits & ((1 << dataShift) - 1) blockIndex = baseBits >> dataShift block_offset (bytes) = blockIndex << blockAlignmentShift offset (sector units inside block) = sectorOffsetWithinBlock</li>
<li>The consumer combines block_offset, offset, and the (external) logical sector size to locate data.</li>
</ol>
<p>Field roles:</p><ul>
<li>negative: Count of leading negative LBAs supported; added to L to form internal index.</li>
<li>overflow: Count of trailing LBAs beyond the user area upper bound that are still dumped and have normal DDT entries (e.g. optical disc lead-out). Symmetrical to 'negative' on the high end.</li>
<li>start: For secondary tables, base internal index covered (written when creating new tables). Current decoding logic does not consult this field (future-proof placeholder).</li>
<li>blockAlignmentShift: log2 alignment of stored data blocks (byte granularity of block_offset).</li>
<li>dataShift: log2 of the number of addressable sectors per increment of blockIndex bitfield unit.</li>
<li>tableShift: log2 of number of logical sectors covered by a single primary-table pointer (multi-level only).</li>
</ul>
<p>Notes & current limitations:</p><ul>
<li>User area sector count = blocks - negative - overflow.</li>
<li>Valid external LBA range exposed by the image = [-negative, (blocks - negative - 1)].<ul>
<li>Both negative and overflow ranges are stored with normal DDT entries (if present), enabling complete reproduction of lead-in / lead-out or similar padding regions.</li>
<li>start is presently ignored during decoding; integrity checks against it may be added in future revisions.</li>
<li>No masking is applied to I besides array bounds; callers must ensure L is within representable range.</li>
</ul>
<p>Example (Compact Disc): Disc has 360000 user sectors. Lead-in captured as 15000 negative sectors and lead-out as 15000 overflow sectors. negative = 15000 overflow = 15000 user sectors = 360000 blocks (internal span) = negative + user + overflow = 390000 External LBA spans: -15000 .. 374999</p><ul>
<li>Negative: -15000 .. -1 (15000 sectors)</li>
<li>User: 0 .. 359999 (360000 sectors)</li>
<li>Overflow: 360000 .. 374999 (15000 sectors) Internal index I for any external L is I = L + negative. User area sector count reported to callers (ctx->imageInfo.Sectors) = blocks - negative - overflow = 360000. </li>
</ul>
<pclass="definition">Definition at line <aclass="el"href="ddt_8h_source.html#l00141">141</a> of file <aclass="el"href="ddt_8h_source.html">ddt.h</a>.</p>
<p>2^blockAlignmentShift = block alignment boundary in bytes. </p>
<pclass="definition">Definition at line <aclass="el"href="ddt_8h_source.html#l00154">154</a> of file <aclass="el"href="ddt_8h_source.html">ddt.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="ddt_8h_source.html#l00150">150</a> of file <aclass="el"href="ddt_8h_source.html">ddt.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="ddt_8h_source.html#l00161">161</a> of file <aclass="el"href="ddt_8h_source.html">ddt.h</a>.</p>
<pclass="reference">Referenced by <aclass="el"href="verify_8c_source.html#l00130">aaruf_verify_image()</a>, <aclass="el"href="ddt__v2_8c_source.html#l01096">set_ddt_multi_level_v2()</a>, <aclass="el"href="close_8c_source.html#l00077">write_cached_secondary_ddt()</a>, <aclass="el"href="close_8c_source.html#l00284">write_primary_ddt()</a>, <aclass="el"href="close_8c_source.html#l01241">write_sector_prefix_ddt()</a>, <aclass="el"href="close_8c_source.html#l01387">write_sector_suffix_ddt()</a>, and <aclass="el"href="close_8c_source.html#l00383">write_single_level_ddt()</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="ddt_8h_source.html#l00159">159</a> of file <aclass="el"href="ddt_8h_source.html">ddt.h</a>.</p>
<p>Compression algorithm for this table body (<aclass="el"href="enums_8h.html#affec749ed88365143745313ae9168263">CompressionType</a>). </p>
<pclass="definition">Definition at line <aclass="el"href="ddt_8h_source.html#l00145">145</a> of file <aclass="el"href="ddt_8h_source.html">ddt.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="ddt_8h_source.html#l00162">162</a> of file <aclass="el"href="ddt_8h_source.html">ddt.h</a>.</p>
<p>2^dataShift = sectors represented per increment in blockIndex field. </p>
<pclass="definition">Definition at line <aclass="el"href="ddt_8h_source.html#l00155">155</a> of file <aclass="el"href="ddt_8h_source.html">ddt.h</a>.</p>
<p>Number of entries contained in (uncompressed) table payload. </p>
<pclass="definition">Definition at line <aclass="el"href="ddt_8h_source.html#l00158">158</a> of file <aclass="el"href="ddt_8h_source.html">ddt.h</a>.</p>
<p>Block identifier, must be BlockType::DeDuplicationTable2. </p>
<pclass="definition">Definition at line <aclass="el"href="ddt_8h_source.html#l00143">143</a> of file <aclass="el"href="ddt_8h_source.html">ddt.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="ddt_8h_source.html#l00160">160</a> of file <aclass="el"href="ddt_8h_source.html">ddt.h</a>.</p>
<p>Total number of hierarchy levels (root depth); > 0. </p>
<pclass="definition">Definition at line <aclass="el"href="ddt_8h_source.html#l00146">146</a> of file <aclass="el"href="ddt_8h_source.html">ddt.h</a>.</p>
<pclass="reference">Referenced by <aclass="el"href="create_8c_source.html#l00279">aaruf_create()</a>, <aclass="el"href="ddt__v2_8c_source.html#l01096">set_ddt_multi_level_v2()</a>, <aclass="el"href="close_8c_source.html#l00077">write_cached_secondary_ddt()</a>, <aclass="el"href="close_8c_source.html#l01241">write_sector_prefix_ddt()</a>, <aclass="el"href="close_8c_source.html#l01387">write_sector_suffix_ddt()</a>, <aclass="el"href="close_8c_source.html#l00383">write_single_level_ddt()</a>, and <aclass="el"href="close_8c_source.html#l00623">write_tape_ddt()</a>.</p>
<p>Leading negative LBA count; added to external L to build internal index. </p>
<pclass="definition">Definition at line <aclass="el"href="ddt_8h_source.html#l00149">149</a> of file <aclass="el"href="ddt_8h_source.html">ddt.h</a>.</p>
<p>Trailing dumped sectors beyond user area (overflow range), still mapped with entries. </p>
<pclass="definition">Definition at line <aclass="el"href="ddt_8h_source.html#l00151">151</a> of file <aclass="el"href="ddt_8h_source.html">ddt.h</a>.</p>
<p>Absolute byte offset of the parent (previous) level table; 0 if root. </p>
<pclass="definition">Definition at line <aclass="el"href="ddt_8h_source.html#l00148">148</a> of file <aclass="el"href="ddt_8h_source.html">ddt.h</a>.</p>
<pclass="reference">Referenced by <aclass="el"href="create_8c_source.html#l00279">aaruf_create()</a>, <aclass="el"href="ddt__v2_8c_source.html#l01096">set_ddt_multi_level_v2()</a>, <aclass="el"href="close_8c_source.html#l00077">write_cached_secondary_ddt()</a>, <aclass="el"href="close_8c_source.html#l00383">write_single_level_ddt()</a>, and <aclass="el"href="close_8c_source.html#l00623">write_tape_ddt()</a>.</p>
<p>Base internal index covered by this table (used for secondary tables; currently informational). </p>
<pclass="definition">Definition at line <aclass="el"href="ddt_8h_source.html#l00153">153</a> of file <aclass="el"href="ddt_8h_source.html">ddt.h</a>.</p>
<pclass="reference">Referenced by <aclass="el"href="create_8c_source.html#l00279">aaruf_create()</a>, <aclass="el"href="ddt__v2_8c_source.html#l01096">set_ddt_multi_level_v2()</a>, <aclass="el"href="close_8c_source.html#l00077">write_cached_secondary_ddt()</a>, <aclass="el"href="close_8c_source.html#l01241">write_sector_prefix_ddt()</a>, <aclass="el"href="close_8c_source.html#l01387">write_sector_suffix_ddt()</a>, and <aclass="el"href="close_8c_source.html#l00623">write_tape_ddt()</a>.</p>
<p>Zero-based level index of this table (0 = root, increases downward). </p>
<pclass="definition">Definition at line <aclass="el"href="ddt_8h_source.html#l00147">147</a> of file <aclass="el"href="ddt_8h_source.html">ddt.h</a>.</p>
<pclass="reference">Referenced by <aclass="el"href="create_8c_source.html#l00279">aaruf_create()</a>, <aclass="el"href="ddt__v2_8c_source.html#l01096">set_ddt_multi_level_v2()</a>, <aclass="el"href="close_8c_source.html#l00077">write_cached_secondary_ddt()</a>, <aclass="el"href="close_8c_source.html#l01241">write_sector_prefix_ddt()</a>, <aclass="el"href="close_8c_source.html#l01387">write_sector_suffix_ddt()</a>, <aclass="el"href="close_8c_source.html#l00383">write_single_level_ddt()</a>, and <aclass="el"href="close_8c_source.html#l00623">write_tape_ddt()</a>.</p>
<p>2^tableShift = number of logical sectors per primary entry (multi-level only; 0 for single-level or secondary tables). </p>
<pclass="definition">Definition at line <aclass="el"href="ddt_8h_source.html#l00156">156</a> of file <aclass="el"href="ddt_8h_source.html">ddt.h</a>.</p>
<p>Data classification (<aclass="el"href="enums_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6">DataType</a>) for sectors referenced by this table. </p>
<pclass="definition">Definition at line <aclass="el"href="ddt_8h_source.html#l00144">144</a> of file <aclass="el"href="ddt_8h_source.html">ddt.h</a>.</p>
<liclass="footer">Generated by <ahref="https://www.doxygen.org/index.html"><imgclass="footer"src="doxygen.svg"width="104"height="31"alt="doxygen"/></a> 1.14.0 </li>