Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BZZ pipelining #9

Open
cole-miller opened this issue Mar 21, 2022 · 1 comment
Open

BZZ pipelining #9

cole-miller opened this issue Mar 21, 2022 · 1 comment

Comments

@cole-miller
Copy link
Contributor

BZZ decoding of a block divides into two stages:

  1. arithmetic decoding with the Z'-Coder
  2. inverse Burrows-Wheeler transform

Neither stage is really parallelizable on its own, and the first stage has to be completed before the second stage can begin. But with several threads available one could do some pipelining, where stage 2 of an earlier block is overlapped with stage 1 of a later block. This potentially improves throughput. The same idea should also be applicable to BZZ encoding.

Some reasons this might not be fruitful to implement:

  • unclear whether BZZ blobs in realistic documents are big enough to benefit (and note that bulk BZZ compression outside the context of a DjVu document is not an application anyone cares about)
  • there's a tradeoff where larger blocks gives better compression but also cuts into the benefit from pipelining
  • if one stage takes much longer than the other (might be true of BZZ encoding), the gain from pipelining tends to zero
  • negative consequences for latency (?)
  • need multiple scratch buffers and output buffers, so memory use increases

Still, I'd like to experiment with this. Note that the low-level interface of sndjvu_codec::bzz::dec already has everything needed to implement pipelining.

@cole-miller
Copy link
Contributor Author

Status: still want to experiment with this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant