Fix LUTInterpolator lookup table position calc
am: 0940834c8c
Change-Id: Ib80c00801473d7e60bae87b3b34a381c7f8e7e68
This commit is contained in:
@@ -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];
|
||||
}
|
||||
|
||||
@@ -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];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user