Intel IPP provides highly optimized building block functions?for image processing, signal processing, vector math and small matrix computation. Several IPP domains contain the hand-tuned functions for Intel(R) Atom??processor by taking advantage of Intel? Streaming SIMD Extensions (Intel? SSE) instructions.? The IPP?static non-threaded Linux* libraries now support Android* OS, and can be used with Android applications.
This article gives an introduction on how to add Intel IPP functions into Android NDK applications. Intel IPP provides processor-specific optimization, and only can be linked with?native Android C/C++ code.? To use Intel IPP with your application, you need to include Intel IPP functions in your source code, and you also need to add IPP libraries into the building command line.
Using Intel IPP
1. Adding Intel IPP functions in source
In source files, include the Intel IPP header files (ipp.h)
Call Intel IPP functions in your C/C++ source.
2. Including Intel IPP libraries into the Android NDK building files
Copy Intel IPP libraries and headers to your project folder.
Add the IPP libraries to android building script file ?jni/Android.mk?: Declare each IPP library as the?prebuilt library module. For example, if the application uses two Intel IPP libraries "libipps.a" and "libippcore.a", add the following into the file:
include $(CLEAR_VARS)LOCAL_MODULE := ippsLOCAL_SRC_FILES := ../ipp/lib/ia32/libipps.ainclude $(PREBUILT_STATIC_LIBRARY) ? include $(CLEAR_VARS)LOCAL_MODULE := ippcoreLOCAL_SRC_FILES := ../ipp/lib/ia32/libippcore.ainclude $(PREBUILT_STATIC_LIBRARY)? ?
include $(CLEAR_VARS)LOCAL_MODULE := ippsLOCAL_SRC_FILES := ../ipp/lib/ia32/libipps.ainclude $(PREBUILT_STATIC_LIBRARY)
?
include $(CLEAR_VARS)LOCAL_MODULE := ippcoreLOCAL_SRC_FILES := ../ipp/lib/ia32/libippcore.ainclude $(PREBUILT_STATIC_LIBRARY)?
Add the header path and IPP libraries into the modules calling IPP functions:
?? include $(CLEAR_VARS)LOCAL_MODULE???? := IppAddLOCAL_SRC_FILES? := IppAdd.c LOCAL_STATIC_LIBRARIES := ipps ippcoreLOCAL_C_INCLUDES := ./ipp/includeinclude $(BUILT_SHARED_LIBRARY)
Building one sample code
A?simple?example is included bellow that shows?Intel IPP usage in the native Android code. The code?uses?Intel IPP ippsAdd_32f() function to add data for two arrays.?
To review Intel IPP usage in the code:
Learn IPP usage in the source files:?The "jni/IppAdd.c" file provides the implementation of one?native function NativeIppAdd(). The function call Intel IPP ippsAdd_32f() function.??The "src/com/example/testippadd/ArrayAddActivity.java"?file call the native "NativeIppAdd()" function through?JNI.
Check "jni/Andriod.mk"?file. This file adds the required IPP libraries into the?building script. The sample?uses ippsAdd_32f() function, which is belong to Intel IPP?signal processing domain. The function depends on "libipps.a"?and "libippcore.a"?libraries.? The "Andriod.mk"?file creates two prebuilt libraries for them.?
You can build the sample code either?using the SDK and NDK command tools or?using Eclipse* IDE
??? Build the sample?from?a command line
???? Build the sample by Eclipse* IDE
SummaryThis article provide?the introduction on?IPP?usage with the native Android* applications. Check more information on Intel IPP functions?in the IPP manual.
Source: http://software.intel.com/en-us/articles/building-android-ndk-applications-with-intel-ipp
Patriots Day boston marathon turbotax leonhard euler Marfa Texas Chi Cheng adam scott
No comments:
Post a Comment