Fix some errors in errorCalculator.rs.

Bug: http://b/26987366

This code was accidentally casting a uchar4 to a single integer, which
the latest llvm-rs-cc will flag as an error. The comparison was also
incorrectly using a single integer comparison, instead of looking at all
4 uchar vector components.

(cherry picked from commit 74be0c9b43)

Change-Id: Ic3727e234ffc87571ccacab19b2a4efb27ac0f20
This commit is contained in:
Stephen Hines
2016-03-09 16:42:40 -08:00
parent 0a96dae887
commit 1eeceefb04

View File

@@ -14,10 +14,14 @@ void countInterestingRegions(const int32_t *v_in, int32_t *v_out) {
for (int x = 0; x < HEIGHT; x += REGION_SIZE) {
bool interestingRegion = false;
int regionColor = (int) rsGetElementAt_uchar4(ideal, x, y);
uchar4 regionColor = rsGetElementAt_uchar4(ideal, x, y);
for (int i = 0; i < REGION_SIZE && !interestingRegion; i++) {
for (int j = 0; j < REGION_SIZE && !interestingRegion; j++) {
interestingRegion |= ((int) rsGetElementAt_uchar4(ideal, x + j, y + i)) != regionColor;
uchar4 testVal = rsGetElementAt_uchar4(ideal, x + j, y + i);
interestingRegion |= (testVal.r != regionColor.r);
interestingRegion |= (testVal.g != regionColor.g);
interestingRegion |= (testVal.b != regionColor.b);
interestingRegion |= (testVal.a != regionColor.a);
}
}
if (interestingRegion) {