We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi there is already one "alternative", but w.r.t. 8bit CPUs it can be changed like this:
unsigned char prob = upkr_probs[context_index]; int bit = (upkr_state & 255) < prob ? 1 : 0; if ( bit ) prob = -prob; upkr_state -= ((upkr_state >> 8)+(bit ^ 1))*prob; prob -= (prob + 8)>>4; if ( bit ) prob = -prob;
The difference is the use of char which removes the need for 256-prob.
char
256-prob
Another alternative:
int prob = upkr_probs[context_index]; int bit = (upkr_state & 255) < prob ? 1 : 0; if ( bit ) { upkr_state = (upkr_state >> 8)*prob+(upkr_state & 0xff); prob += (256 + 8 - prob) >> 4; } else { upkr_state -= ((upkr_state >> 8) + 1)*prob; prob -= (prob+8)>>4; }
Maybe add this also to c_unpacker folder.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi
there is already one "alternative", but w.r.t. 8bit CPUs it can be changed like this:
The difference is the use of
char
which removes the need for256-prob
.Another alternative:
Maybe add this also to c_unpacker folder.
The text was updated successfully, but these errors were encountered: