jpegrecoverymap: sampleMap optimizations

Instead of computing weights for each pixel, it is computed for
mapScaleFactor x mapScaleFactor once and reused

This optimization works only when mapScaleFactor is an integer.
Though mapScaleFactor is of type size_t currently, it is possible
that it may change to a float later. Once it is confirmed that
mapScaleFactor will always be an integer, sampleMap() can be
cleaned up to remove support for handling float mapScaleFactor.

Bug: 261877699
Test: push files from tests/data to /sdcard/Documents and then \
 atest libjpegdecoder_test libjpegencoder_test libjpegrecoverymap_test

Change-Id: Ic1541cccfe05d8115153c05e84a540d9604a76c2
4 files changed