-
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
Apply the GRAYSCALE_1BPP optimization when needsDecode
is set.
#5204
Conversation
https://bugzilla.mozilla.org/show_bug.cgi?id=835380 should be marked as fixed when this change lands. |
/botio-windows preview |
From: Bot.io (Windows)ReceivedCommand cmd_preview from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.22.172.223:8877/ba36c2d22dda203/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/ba36c2d22dda203/output.txt Total script time: 0.85 mins Published
|
/botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.22.172.223:8877/ceb229112282e6f/output.txt |
From: Bot.io (Linux)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.21.233.14:8877/8bd59bb7ffdd31b/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/ceb229112282e6f/output.txt Total script time: 19.52 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/8bd59bb7ffdd31b/output.txt Total script time: 22.75 mins
|
assert(kind === ImageKind.GRAYSCALE_1BPP); | ||
var buffer = imgData.data; | ||
for (var i = 0, ii = buffer.length; i < ii; i++) { | ||
buffer[i] = ~buffer[i]; |
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.
buffer[i] ^= 0xFF;
The scanned, black-and-white document at https://bugzilla.mozilla.org/show_bug.cgi?id=835380 doesn't benefit from the critical GRAYSCALE_1BPP optimization because the optimization is skipped if `needsDecode` is set. This change addresses that, and reduces both rendering time and memory usage for that document by almost 10x.
/botio test |
From: Bot.io (Linux)ReceivedCommand cmd_test from @yurydelendik received. Current queue size: 0 Live output at: http://107.21.233.14:8877/d58f9e39b6b6104/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @yurydelendik received. Current queue size: 1 Live output at: http://107.22.172.223:8877/43c5a9711c29b2c/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/43c5a9711c29b2c/output.txt Total script time: 19.67 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/d58f9e39b6b6104/output.txt Total script time: 22.55 mins
|
Apply the GRAYSCALE_1BPP optimization when `needsDecode` is set.
The scanned, black-and-white document at
https://bugzilla.mozilla.org/show_bug.cgi?id=835380 doesn't benefit from
the critical GRAYSCALE_1BPP optimization because the optimization is
skipped if
needsDecode
is set.This change addresses that, and reduces both rendering time and memory
usage for that document by almost 10x.