class TrackSelectionUtil {

  @VisibleForTesting
  /* package */ static int[] getBitratesUsingPastInfo(
      List<? extends MediaChunk> queue,
      Format[] formats,
      long maxDurationUs,
      @Nullable int[] bitrates) {
    if (bitrates == null) {
      bitrates = new int[formats.length];
      Arrays.fill(bitrates, Format.NO_VALUE);
    }
    if (maxDurationUs == 0) {
      return bitrates;
    }
    int queueAverageBitrate = getAverageQueueBitrate(queue, maxDurationUs);
    if (queueAverageBitrate == Format.NO_VALUE) {
      return bitrates;
    }
    int queueFormatBitrate = queue.get(queue.size() - 1).trackFormat.bitrate;
    if (queueFormatBitrate != Format.NO_VALUE) {
      float queueBitrateRatio = ((float) queueAverageBitrate) / queueFormatBitrate;
      estimateBitrates(
          bitrates, formats, new int[] {queueFormatBitrate}, new float[] {queueBitrateRatio});
    }
    return bitrates;
  }

  private  TrackSelectionUtil();

}