-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Jbig2 optimizations #4434
Jbig2 optimizations #4434
Conversation
This might depend on PR #4431. |
This PR doesn't really depend on #4431 but I pushed a micro optimization to the ArithmeticDecoder that would then benefit both JBIG2 and JPX |
The #4431 was merged, could you rebase your changes? |
Thanks. Done. |
@@ -105,7 +105,7 @@ var Jbig2Image = (function Jbig2ImageClosure() { | |||
offset = 340; | |||
break; | |||
default: | |||
v = v * 2 + bit; | |||
v = (v << 1) | bit; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shall stay unsigned. Please add a note of danger this getting this singed, or use ((v << 1) | bit) >>> 0
/botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @yurydelendik received. Current queue size: 1 Live output at: http://107.22.172.223:8877/f4a400360ffc4a4/output.txt |
From: Bot.io (Linux)ReceivedCommand cmd_test from @yurydelendik received. Current queue size: 3 Live output at: http://107.21.233.14:8877/9ccf874ff811d88/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/f4a400360ffc4a4/output.txt Total script time: 37.23 mins
|
Moved the switch(combinationOperator) outside the width and height loops Check bitmap[i][j] before applying the switch(combinationOperator)
ltp can only become truthy if predition is true.
…ner loop There is no need to slow down the inner loop with a test for ltp as it can only change if prediction is true in which case it only changes in the outer loop.
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/9ccf874ff811d88/output.txt Total script time: 25.95 mins
|
/botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @yurydelendik received. Current queue size: 0 Live output at: http://107.22.172.223:8877/c81c088bb963f73/output.txt |
From: Bot.io (Linux)ReceivedCommand cmd_test from @yurydelendik received. Current queue size: 0 Live output at: http://107.21.233.14:8877/ab322fd5543cc52/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/ab322fd5543cc52/output.txt Total script time: 25.80 mins
|
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/c81c088bb963f73/output.txt Total script time: 37.14 mins
|
Thank you for the patch |
~13% speed improvement in JBIG2 decoding.
Measured 10x the decoding time of ten 33M pixels JBIG2 images:
Average decoding time went from ~1440ms to ~1270ms in Opera, and ~1240ms to ~1060ms in Aurora