SkJpegCodec: Add Multi-Picture Format (MPF) Support

Add support for the CIPA DC-x007-2009 Multi-Picture Format. Jpeg
images taken on iPhones make extensive use of this standard to include
multiple images (e.g, depth and gain maps), in addition to the base
image.

This information is stored in the APP2 segment in a structure that
lists the offsets and sizes of all images. Add a the function
SkJpegParseMultiPicture that will parse this segment and retrieve this
information.

Note that the offsets that are specified are relative to the APP2
segment in which they are specified. The location of the APP2 segment
inside the Jpeg's SkStream is not available using libjpeg (libjpeg
will extract the APP2 segment if requested, but does not compute or
save where it found it). To fix this, we use SkJpegSegmentScan to
find the location of the APP2 segment in the Jpeg's SkStream.

Add the function SkJpegMultiPictureStreams to extract an SkStream
for all of the separate images. Add the function SkJpegSegmentScan::
getSubsetStream to retrieve an SkStream for a subset of the Jpeg's
SkStream. This is inefficiently implemented and could be made much
more efficient.

Add tests, and a test image that has two auxiliary images.

Bug: skia: 14031
Change-Id: I411a6984d85e0e759fac5a3d48590f0d2a1f159e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/625921
Commit-Queue: Christopher Cameron <ccameron@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
9 files changed