You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BBF is designed as a Footer-indexed binary format. This allows for rapid append-only creation and immediate random access to any page without scanning the entire file.
33
34
35
+
### Zero-Copy Architecture
36
+
The `bbfmux` reference implementation utilizes **Memory Mapping (mmap/MapViewOfFile)**. Instead of reading file data into intermediate buffers, the tool maps the container directly into the process address space. This allows the CPU to access image data at the speed of your NVMe drive's hardware limit.
37
+
38
+
### High-Speed Parallel Verification
39
+
Integrity checks now utilize **Parallel XXH3**. On multi-core systems, the verifier splits the asset table into chunks and validates multiple pages simultaneously. This makes BBF verification up to **10x faster** than ZIP/RAR CRC checks.
40
+
41
+
### 4KB Alignment
42
+
Every asset in a BBF file starts on a **4096-byte boundary**. This alignment is critical for modern hardware, allowing for DirectStorage transfers directly from disk to GPU memory, bypassing CPU bottlenecks entirely.
43
+
44
+
34
45
### Binary Layout
35
46
1.**Header (13 bytes)**: Magic `BBF1`, versioning, and initial padding.
36
47
2.**Page Data**: The raw image payloads (AVIF, PNG, etc.), each padded to **4096-byte boundaries**.
@@ -68,9 +79,6 @@ BBF is designed as a Footer-indexed binary format. This allows for rapid append-
68
79
[7] - PDF supports "Linearization" (Fast Web View), allowing the header and first pages to be read before the rest of the file is downloaded.<br/>
69
80
</font>
70
81
71
-
### 4KB Alignment & DirectStorage
72
-
Every asset in a BBF file starts on a 4KB boundary. This alignment is critical for modern NVMe-based systems. It allows developers to utilize `mmap` or **DirectStorage** to transfer image data directly from disk to GPU memory, bypassing the CPU-bottlenecked "copy and decompress" cycles found in Zip-based formats.
73
-
74
82
---
75
83
76
84
## Features
@@ -156,5 +164,65 @@ bbfmux input.bbf --info
156
164
157
165
---
158
166
167
+
## Advanced CLI Features
168
+
169
+
### Custom Page Ordering (`--order`)
170
+
You can precisely control the reading order using a text file or inline arguments.
171
+
***Positive Integers**: Fixed 1-based index (e.g., `cover.png:1`).
172
+
***Negative Integers**: Fixed position from the end (e.g., `credits.png:-1` is always the last page).
173
+
***Unspecified**: Sorted alphabetically between the fixed pages.
174
+
175
+
```bash
176
+
# Using an order file
177
+
bbfmux ./images/ --order=pages.txt out.bbf
178
+
179
+
# pages.txt example:
180
+
cover.png:1
181
+
page1.png:2
182
+
page2.png:3
183
+
credits.png:-1
184
+
```
185
+
186
+
### Batch Section Import (`--sections`)
187
+
Sections define Chapters or Volumes. You can target a page by its index or filename.
# sectionexample.txt example (Name:Target[:Parent]):
196
+
"Volume 1":"001.png"
197
+
"Chapter 1":"001.png":"Volume 1"
198
+
"Chapter 2":"050.png":"Volume 1"
199
+
```
200
+
201
+
### Targeted Verification
202
+
BBF allows for verification of data to detect bit-rot.
203
+
```bash
204
+
# Verify everything (All assets and Directory structure)
205
+
bbfmux input.bbf --verify
206
+
207
+
# Verify only the directory hash (Instant)
208
+
bbfmux input.bbf --verify -1
209
+
210
+
# Verify a specific asset by index
211
+
bbfmux input.bbf --verify 42
212
+
```
213
+
214
+
### Range-Key Extraction
215
+
The `--rangekey` option allows you to extract a range of sections. The extractor starts at the specified `--section` and stops when it finds a section whose title matches the `rangekey`.
0 commit comments