diff options
author | Jason Sams <jsams@google.com> | 2013-02-22 18:10:04 -0800 |
---|---|---|
committer | Jason Sams <jsams@google.com> | 2013-02-22 18:11:19 -0800 |
commit | b6d2d2a6bc1cee3e04b7e632a96134bdb56f38ee (patch) | |
tree | 5d740cea1f27c64257785ab8864e549cfd01c9ce /cpu_ref/rsCpuIntrinsicBlur.cpp | |
parent | c5c744ab52b06f7621cbcc8952d4a5eba3d7254c (diff) | |
download | android_frameworks_rs-b6d2d2a6bc1cee3e04b7e632a96134bdb56f38ee.tar.gz android_frameworks_rs-b6d2d2a6bc1cee3e04b7e632a96134bdb56f38ee.tar.bz2 android_frameworks_rs-b6d2d2a6bc1cee3e04b7e632a96134bdb56f38ee.zip |
Fix corner cases with small blurs.
Change-Id: I7d1d42c3903ca3defd1737bd6e2557e2f5998fe5
Diffstat (limited to 'cpu_ref/rsCpuIntrinsicBlur.cpp')
-rw-r--r-- | cpu_ref/rsCpuIntrinsicBlur.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/cpu_ref/rsCpuIntrinsicBlur.cpp b/cpu_ref/rsCpuIntrinsicBlur.cpp index 1a28aabc..58565f18 100644 --- a/cpu_ref/rsCpuIntrinsicBlur.cpp +++ b/cpu_ref/rsCpuIntrinsicBlur.cpp @@ -204,10 +204,11 @@ static void OneVFU1(float *out, x1++; out++; ptrIn++; + len--; } #if defined(ARCH_ARM_HAVE_NEON) - { + if (x2 > x1) { int t = (x2 - x1) >> 2; t &= ~1; if(t) { @@ -219,7 +220,7 @@ static void OneVFU1(float *out, } #endif - while(len) { + while(len > 0) { const uchar *pi = ptrIn; float blurredPixel = 0; const float* gp = gPtr; @@ -367,10 +368,12 @@ void RsdCpuScriptIntrinsicBlur::kernelU1(const RsForEachStubParamStruct *p, if ((x1 + cp->mIradius) < x2) { uint32_t len = x2 - (x1 + cp->mIradius); len &= ~3; - rsdIntrinsicBlurHFU1_K(out, ((float *)buf) - cp->mIradius, cp->mFp, - cp->mIradius * 2 + 1, x1, x1 + len); - out += len; - x1 += len; + if (len > 0) { + rsdIntrinsicBlurHFU1_K(out, ((float *)buf) - cp->mIradius, cp->mFp, + cp->mIradius * 2 + 1, x1, x1 + len); + out += len; + x1 += len; + } } #endif while(x2 > x1) { |