Fix LUTInterpolator lookup table position calc

BUG: 32830741
Test: running progress bar at 5x duration scale, no flickering
Change-Id: Ie484bdbfdf18bacc4586e36c5142e4523d08bdaa
This commit is contained in:
Doris Liu
2016-11-29 13:04:49 -08:00
parent 7efd37e953
commit 0940834c8c
2 changed files with 3 additions and 2 deletions

View File

@@ -97,7 +97,8 @@ LUTInterpolator::~LUTInterpolator() {
}
float LUTInterpolator::interpolate(float input) {
float lutpos = input * mSize;
// lut position should only be at the end of the table when input is 1f.
float lutpos = input * (mSize - 1);
if (lutpos >= (mSize - 1)) {
return mValues[mSize - 1];
}

View File

@@ -104,7 +104,7 @@ public class NativeInterpolatorFactoryHelper_Delegate {
@Override
public float getInterpolation(float input) {
float lutpos = input * mSize;
float lutpos = input * (mSize - 1);
if (lutpos >= (mSize - 1)) {
return mValues[mSize - 1];
}