@Override
  public int getNextScanNumberToDecode(int scanNumber) {
    final List<Integer> scansToDecode = mDynamicValueConfig.getScansToDecode();
    if (scansToDecode == null || scansToDecode.isEmpty()) {
      return scanNumber + 1;
    }

    for (int i = 0; i < scansToDecode.size(); i++) {
      if (scansToDecode.get(i) > scanNumber) {
        return scansToDecode.get(i);
      }
    }
    return Integer.MAX_VALUE;
  }
Simple {@link ProgressiveJpegConfig} with predefined scans to decode and good-enough scan number.

<p>If no specific scans to decode are provided, every scan is allowed to be decoded.
imagepipeline/src/main/java/com/facebook/imagepipeline/decoder/SimpleProgressiveJpegConfig.java