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

Request: Reduced memory use during partial decoding #55

Open
chafey opened this issue Jan 13, 2021 · 0 comments
Open

Request: Reduced memory use during partial decoding #55

chafey opened this issue Jan 13, 2021 · 0 comments

Comments

@chafey
Copy link
Contributor

chafey commented Jan 13, 2021

It would be nice to reduce memory consumption by discarding HTJ2K bits once they are decoded. Right now partial decoding requires keeping the original bits around which consumes additional memory. For example, suppose you have a 512x512 image encoded with 2 resolution levels (128x128 base, 256x256 coefficients, 512x512 coefficients). If I want to progressive download and display each resolution level, it would go like this:

  1. Download HTJ2K bitstream up to 128x128 base level, decode, display. In memory I have part of the encoded bitstream up to 128x128 + 128x128 decoded bits
  2. Download 256x256 level encoded bits, append to previous 128x128 encoded bits, decode, display. In memory I now have part of the encoded bitstream up to 256x256 + a 256x256 decoded bits
  3. Download 512x512 level encoded bits, append to previous 256x256 encoded bits, decode, display. In memory I now have the fully encoded bitstream + 512x512 decoded bits. I can now discard the 512x512 encoded bits since I have the full resolution image.

Memory use could be reduced if the decoder would allow taking in the decoded bits instead of the corresponding encoded bit stream.

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