-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit adds initial support for the FEC (forward error correction) used by AVB hashtree descriptors. AVB FEC uses standard Reed-Solomon in the RS(255, 253) + GF(256) + 0x11d configuration, but does not read data sequentially. Instead, it uses an interleaving pattern where each RS block covers bytes that span nearly the entire file. Due to the interleaving file access pattern, we're forced to use mmap or read the entire file into memory. Using seek = read when dealing with a large input file results in a ~500x increase in processing time. Reading one byte at a time non-sequentially is about the worst possible access pattern for seek + read. All of the processing is done multithreaded. Although the AOSP libfec implementation is also multithreaded, this implementation runs at ~5x the speed of AOSP libfec. Unfortunately, while the implementation is extremely fast, it required using `unsafe` blocks. Multiple threads need to write to disjoint, non-contiguous indices in a buffer, but there's no way to prove to the compiler that this is safe, so we're stuck with using raw pointers. Issue: #145 Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
- Loading branch information
1 parent
8f49f49
commit dc372cd
Showing
10 changed files
with
1,067 additions
and
31 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.