Faster JBIG2 decoding

This PR doubles the JBIG2 image decoding speed, and so the total rendering times of #2909 and #3816 are reduced by 30-40% (Firefox Nightly, Linux).

The innermost loop of the decoding procedure is fetching the pixel values of 16 neighbor pixels (whose positions are defined by the template). These neighbor pixel values then serve as the context label for decoding the next pixel.
Most of these neighbor pixels are also the neighbor of the next pixel to be processed, and so most of the next context label can be constructed from the previous one (using shift and mask), which is the focus of this PR.