Prepare code to allow image decoder to be reused

This change refactors ImageDecoder to prepare it for reuse
for multi-slice decoding. There is no functional change.

bug: 78475896

Test: CTS MediaMetadataRetrieverTest;
Manual test of HEIF image decoding and thumbnail extraction.

Change-Id: I8c16042020c7db3d3714d22322e6304ea4192e33
5 files changed