code: private void generateHuffmanOptimisationSeeds() {
          final int[][] huffmanCodeLengths = this.huffmanCodeLengths;
          final int[] mtfSymbolFrequencies = this.mtfSymbolFrequencies;
          final int mtfAlphabetSize = this.mtfAlphabetSize;
  
          final int totalTables = huffmanCodeLengths.length;
  
          int remainingLength = mtfLength;
          int lowCostEnd = -1;
  
          for (int i = 0; i < totalTables; i++) {
  
              final int targetCumulativeFrequency = remainingLength / (totalTables - i);
              final int lowCostStart = lowCostEnd + 1;
              int actualCumulativeFrequency = 0;
  
              while (actualCumulativeFrequency < targetCumulativeFrequency && lowCostEnd < mtfAlphabetSize - 1) {
                  actualCumulativeFrequency += mtfSymbolFrequencies[++lowCostEnd];
              }
  
              if (lowCostEnd > lowCostStart && i != 0 && i != totalTables - 1 && (totalTables - i & 1) == 0) {
                  actualCumulativeFrequency -= mtfSymbolFrequencies[lowCostEnd--];
              }
  
              final int[] tableCodeLengths = huffmanCodeLengths[i];
              for (int j = 0; j < mtfAlphabetSize; j++) {
                  if (j < lowCostStart || j > lowCostEnd) {
                      tableCodeLengths[j] = HUFFMAN_HIGH_SYMBOL_COST;
                  }
              }
  
              remainingLength -= actualCumulativeFrequency;
          }
      }
docs: Generate initial Huffman code length tables, giving each table a different low cost section
  of the alphabet that is roughly equal in overall cumulative frequency. Note that the initial
  tables are invalid for actual Huffman code generation, and only serve as the seed for later
  iterative optimisation in {@link #optimiseSelectorsAndHuffmanTables(boolean)}.