-
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
Refactor searching for end of inline (EI) JPEG image streams #5631
Refactor searching for end of inline (EI) JPEG image streams #5631
Conversation
Okay, I found it at http://www.w3.org/Graphics/JPEG/itu-t81.pdf#page=95&zoom=auto,-89,622 see "F.1.2.3 Byte stuffing". Looks like JPEG encoding takes care of it by itself. Let me think if EOI can potentially appear in other tags, e.g. looking at "B.2.2 Frame header syntax" there is 'Lf' field present, so we can skip the bytes and avoid false-EOI inside SOF body. |
Looks like "Table B.1 – Marker code assignments" has everything we need. Can we use length field for all tags that are not marked with (*) and not reserved to skip bytes? |
Since JPEG uses two byte markers, it seemed nice/easy to just use the After carefully reading through the relevant parts of the marker spec, I hope I've managed to produce a good implement of the searching for /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/dbd34b02f4b4dd5/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/f272c826fa7eff1/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/dbd34b02f4b4dd5/output.txt Total script time: 17.31 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/f272c826fa7eff1/output.txt Total script time: 23.35 mins
|
Yep, that's what I was looking for. However reading by 16-bit is throwing me off a bit. Can you modify the outer loop to read by bytes and to whitelist tags with length instead of blacklisting know to be without length? Something like this will explicitly specify which marker really have length field and reduce amount of skip(-1) calls:
|
…Stream and ChunkedStream
This patch changes searching for EI image streams to rely on the EOI (end-of-image) marker for DCTDecode filters (i.e. JPEG images).
Thanks for the feedback! How does it look now? I also added a special-case for the Edit: In practice, the fill byte case (i.e. sequences of |
/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/84110b7dec5a8c2/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/d4b81b63f8c2666/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/84110b7dec5a8c2/output.txt Total script time: 17.50 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/d4b81b63f8c2666/output.txt Total script time: 23.04 mins
|
…i-marker Refactor searching for end of inline (EI) JPEG image streams
Looks good, thank you! |
…find-eoi-marker Refactor searching for end of inline (EI) JPEG image streams
This patch changes searching for EI image streams to rely on the EOI (end-of-image) marker for DCTDecode filters (i.e. JPEG images).
Note: This code was initially included in PR #5383, but removed from it based on this comment from @yurydelendik: #5383 (comment).
It should be quite easy to, if necessary, ignore that particular marker sequence, but unfortunately I've been unable to find any information about it.