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

Bytestream decoder? #9

Open
rasky opened this issue Oct 19, 2023 · 0 comments
Open

Bytestream decoder? #9

rasky opened this issue Oct 19, 2023 · 0 comments

Comments

@rasky
Copy link

rasky commented Oct 19, 2023

Would it be possible to add an option to Shrinkler to avoid having to fetch one bit at a time during decoding? I'm working on a port to a MIPS platform where bit management in general isn't very fast. In particular this hot loop:

    while (ctx->intervalsize < 0x8000) {
        ctx->intervalsize <<= 1;
        ctx->intervalvalue = (ctx->intervalvalue << 1) | shr_get_bit(ctx);
    }

in the range decoder seems to take lot of time. If it was possible to instead fetch one byte at a time, that would be great.

upkr has a similar functionality:
https://github.com/exoticorn/upkr/blob/f647449497967dc682b9cd3d47e8857f8fa886f0/c_unpacker/unpack.c#L15-L30

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