Merge "VideoCapabilities: account for block size for getAchievableRates" into nyc-dev

am: 3c6736b078

* commit '3c6736b0785d3cf6c7a8cd687b9c63f9c7dea542':
  VideoCapabilities: account for block size for getAchievableRates

Change-Id: I642dedb99221e99e0e06d43fa74a1545c0519237
This commit is contained in:
Lajos Molnar
2016-04-30 00:40:47 +00:00
committed by android-build-merger

View File

@@ -1247,7 +1247,8 @@ public final class MediaCodecInfo {
private Range<Double> estimateFrameRatesFor(int width, int height) {
Size size = findClosestSize(width, height);
Range<Long> range = mMeasuredFrameRates.get(size);
Double ratio = (double)(size.getWidth() * size.getHeight()) / (width * height);
Double ratio = getBlockCount(size.getWidth(), size.getHeight())
/ (double)Math.max(getBlockCount(width, height), 1);
return Range.create(range.getLower() * ratio, range.getUpper() * ratio);
}