docs: private static void calculateThresholdForBlock(byte[] luminances,
                                                   int subWidth,
                                                   int subHeight,
                                                   int width,
                                                   int height,
                                                   int[][] blackPoints,
                                                   BitMatrix matrix) {
      int maxYOffset = height - BLOCK_SIZE;
      int maxXOffset = width - BLOCK_SIZE;
      for (int y = 0; y < subHeight; y++) {
        int yoffset = y << BLOCK_SIZE_POWER;
        if (yoffset > maxYOffset) {
          yoffset = maxYOffset;
        }
        int top = cap(y, 2, subHeight - 3);
        for (int x = 0; x < subWidth; x++) {
          int xoffset = x << BLOCK_SIZE_POWER;
          if (xoffset > maxXOffset) {
            xoffset = maxXOffset;
          }
          int left = cap(x, 2, subWidth - 3);
          int sum = 0;
          for (int z = -2; z <= 2; z++) {
            int[] blackRow = blackPoints[top + z];
            sum += blackRow[left - 2] + blackRow[left - 1] + blackRow[left] + blackRow[left + 1] + blackRow[left + 2];
          }
          int average = sum / 25;
          thresholdBlock(luminances, xoffset, yoffset, average, width, matrix);
        }
      }
    }