Fabian Lange 0a42edf82f Optimize JPG.js receiveAndExtend for 1 bit case.
Profiling showed that receiveAndExtend is frequently called with the length of
one bit. This happens for example in decodeBaseline.
For a single bit, the loop and shift in receive, as well as the shifts in
receiveAndExtend are overhead.
This shortcut manually calculates the shifts by either returning 1 or -1 from
receiveAndExtend by reading the bit and deciding on the return value.
While it comes with an overhead for each non-one length, the speedup is at about
10% in the hot parse/decode path.
2014-06-05 12:24:53 +02:00
..
2014-04-15 17:10:23 +02:00
2014-05-19 16:19:54 -05:00
2014-04-11 00:41:08 +02:00
2014-05-23 14:11:47 -05:00
2014-05-10 18:03:54 +02:00
2014-05-29 20:38:50 -05:00
2014-04-11 00:41:18 +02:00
2014-05-29 20:38:50 -05:00
2014-06-04 11:30:53 -05:00
2014-05-19 16:19:54 -05:00