color matrix bugs
bug 10427746
Change-Id: Ie652fe5180702a2eceb3a7077bc1821ba21c1ee4
diff --git a/cpu_ref/rsCpuIntrinsicColorMatrix.cpp b/cpu_ref/rsCpuIntrinsicColorMatrix.cpp
index dd93800..f652a82 100644
--- a/cpu_ref/rsCpuIntrinsicColorMatrix.cpp
+++ b/cpu_ref/rsCpuIntrinsicColorMatrix.cpp
@@ -651,10 +651,10 @@
f = convert_float4(((const uchar4 *)py)[0]);
break;
case 1:
- f.xy = convert_float2(((const float2 *)py)[0]);
+ f.xy = convert_float2(((const uchar2 *)py)[0]);
break;
case 0:
- f.x = (float)(((const float *)py)[0]);
+ f.x = (float)(((const uchar *)py)[0]);
break;
}
}
@@ -715,8 +715,8 @@
uint32_t xstart, uint32_t xend,
uint32_t instep, uint32_t outstep) {
RsdCpuScriptIntrinsicColorMatrix *cp = (RsdCpuScriptIntrinsicColorMatrix *)p->usr;
- uchar4 *out = (uchar4 *)p->out;
- uchar4 *in = (uchar4 *)p->in;
+ uchar *out = (uchar *)p->out;
+ uchar *in = (uchar *)p->in;
uint32_t x1 = xstart;
uint32_t x2 = xend;
@@ -725,7 +725,6 @@
bool floatIn = !!cp->mLastKey.u.inType;
bool floatOut = !!cp->mLastKey.u.outType;
-
if(x2 > x1) {
int32_t len = (x2 - x1) >> 2;
if((cp->mOptKernel != NULL) && (len > 0)) {
@@ -737,7 +736,9 @@
}
while(x1 != x2) {
- One(p, out++, in++, cp->fp, vsin, vsout, floatIn, floatOut);
+ One(p, out, in, cp->fp, vsin, vsout, floatIn, floatOut);
+ out += outstep;
+ in += instep;
x1++;
}
}