diff options
Diffstat (limited to 'java/tests')
6 files changed, 23 insertions, 20 deletions
diff --git a/java/tests/HelloComputeNDK/libhellocomputendk/Android.mk b/java/tests/HelloComputeNDK/libhellocomputendk/Android.mk index 9a012a1f..0c4addb5 100644 --- a/java/tests/HelloComputeNDK/libhellocomputendk/Android.mk +++ b/java/tests/HelloComputeNDK/libhellocomputendk/Android.mk @@ -33,5 +33,12 @@ LOCAL_LDFLAGS := -Wl,-Bsymbolic LOCAL_SHARED_LIBRARIES := libdl liblog libjnigraphics LOCAL_STATIC_LIBRARIES := libRScpp_static -include external/stlport/libstlport.mk +ifeq ($(my_32_64_bit_suffix),32) +LOCAL_SDK_VERSION := 8 +else +LOCAL_SDK_VERSION := 21 +endif + +LOCAL_NDK_STL_VARIANT := stlport_static + include $(BUILD_SHARED_LIBRARY) diff --git a/java/tests/ImageProcessing/src/com/android/rs/image/resize.rs b/java/tests/ImageProcessing/src/com/android/rs/image/resize.rs index 101d282d..84855111 100644 --- a/java/tests/ImageProcessing/src/com/android/rs/image/resize.rs +++ b/java/tests/ImageProcessing/src/com/android/rs/image/resize.rs @@ -41,11 +41,11 @@ static float4 cubicInterpolate (float4 p0,float4 p1,float4 p2,float4 p3 , float } uchar4 __attribute__((kernel)) bicubic(uint32_t x, uint32_t y) { - float xf = x * scale; - float yf = y * scale; + float xf = (x + 0.5f) * scale - 0.5f; + float yf = (y + 0.5f) * scale - 0.5f; - int startx = (int) floor(xf - 2); - int starty = (int) floor(yf - 2); + int startx = (int) floor(xf - 1); + int starty = (int) floor(yf - 1); xf = xf - floor(xf); yf = yf - floor(yf); int maxx = gWidthIn - 1; diff --git a/java/tests/ImageProcessing2/src/com/android/rs/image/resize.rs b/java/tests/ImageProcessing2/src/com/android/rs/image/resize.rs index ec283bea..84855111 100644 --- a/java/tests/ImageProcessing2/src/com/android/rs/image/resize.rs +++ b/java/tests/ImageProcessing2/src/com/android/rs/image/resize.rs @@ -41,11 +41,11 @@ static float4 cubicInterpolate (float4 p0,float4 p1,float4 p2,float4 p3 , float } uchar4 __attribute__((kernel)) bicubic(uint32_t x, uint32_t y) { - float xf = x * scale; - float yf = y * scale; + float xf = (x + 0.5f) * scale - 0.5f; + float yf = (y + 0.5f) * scale - 0.5f; - int startx = (int) floor(xf - 2); - int starty = (int) floor(yf - 2); + int startx = (int) floor(xf - 1); + int starty = (int) floor(yf - 1); xf = xf - floor(xf); yf = yf - floor(yf); int maxx = gWidthIn - 1; @@ -86,7 +86,7 @@ uchar4 __attribute__((kernel)) bicubic(uint32_t x, uint32_t y) { float4 p3 = cubicInterpolate(p30, p31, p32, p33, xf); float4 p = cubicInterpolate(p0, p1, p2, p3, yf); - p = clamp(p, 0.f, 255.f); + p = clamp(p + 0.5f, 0.f, 255.f); return convert_uchar4(p); } diff --git a/java/tests/ImageProcessing_jb/src/com/android/rs/image/Blur25G.java b/java/tests/ImageProcessing_jb/src/com/android/rs/image/Blur25G.java index 46c0250d..f8ee220e 100644 --- a/java/tests/ImageProcessing_jb/src/com/android/rs/image/Blur25G.java +++ b/java/tests/ImageProcessing_jb/src/com/android/rs/image/Blur25G.java @@ -80,10 +80,10 @@ public class Blur25G extends TestBase { public void runTest() { mIntrinsic.forEach(mScratchPixelsAllocation2); + mScript.forEach_toU8_4(mScratchPixelsAllocation2, mOutPixelsAllocation); } public void updateBitmap(Bitmap b) { - mScript.forEach_toU8_4(mScratchPixelsAllocation2, mOutPixelsAllocation); mOutPixelsAllocation.copyTo(b); } diff --git a/java/tests/ImageProcessing_jb/src/com/android/rs/image/resize.rs b/java/tests/ImageProcessing_jb/src/com/android/rs/image/resize.rs index ec283bea..84855111 100644 --- a/java/tests/ImageProcessing_jb/src/com/android/rs/image/resize.rs +++ b/java/tests/ImageProcessing_jb/src/com/android/rs/image/resize.rs @@ -41,11 +41,11 @@ static float4 cubicInterpolate (float4 p0,float4 p1,float4 p2,float4 p3 , float } uchar4 __attribute__((kernel)) bicubic(uint32_t x, uint32_t y) { - float xf = x * scale; - float yf = y * scale; + float xf = (x + 0.5f) * scale - 0.5f; + float yf = (y + 0.5f) * scale - 0.5f; - int startx = (int) floor(xf - 2); - int starty = (int) floor(yf - 2); + int startx = (int) floor(xf - 1); + int starty = (int) floor(yf - 1); xf = xf - floor(xf); yf = yf - floor(yf); int maxx = gWidthIn - 1; @@ -86,7 +86,7 @@ uchar4 __attribute__((kernel)) bicubic(uint32_t x, uint32_t y) { float4 p3 = cubicInterpolate(p30, p31, p32, p33, xf); float4 p = cubicInterpolate(p0, p1, p2, p3, yf); - p = clamp(p, 0.f, 255.f); + p = clamp(p + 0.5f, 0.f, 255.f); return convert_uchar4(p); } diff --git a/java/tests/RsTest_11/Android.mk b/java/tests/RsTest_11/Android.mk index 52d326ba..13c80658 100644 --- a/java/tests/RsTest_11/Android.mk +++ b/java/tests/RsTest_11/Android.mk @@ -14,8 +14,6 @@ # limitations under the License. # -ifneq ($(TARGET_SIMULATOR),true) - LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) @@ -27,5 +25,3 @@ LOCAL_PACKAGE_NAME := RSTest_v11 LOCAL_SDK_VERSION := 11 include $(BUILD_PACKAGE) - -endif |