diff options
author | jinwu <jinwu@codeaurora.org> | 2018-02-09 14:54:16 +0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2018-02-28 18:47:19 -0800 |
commit | 8045fd4cefcf34a83f791459730481f00b91091d (patch) | |
tree | 2b8acd16b3e84b08807a01f86adf72d68ed92dfd /jni | |
parent | 16988fb8cc67b0768e11313e48043575ac67e545 (diff) | |
download | android_packages_apps_Snap-8045fd4cefcf34a83f791459730481f00b91091d.tar.gz android_packages_apps_Snap-8045fd4cefcf34a83f791459730481f00b91091d.tar.bz2 android_packages_apps_Snap-8045fd4cefcf34a83f791459730481f00b91091d.zip |
Fix compiling warnings
Change-Id: I4cb217a4283c5234e62f8b895b5aa662c04fb9a2
Diffstat (limited to 'jni')
-rw-r--r-- | jni/feature_mos/src/mosaic/Blend.cpp | 21 | ||||
-rw-r--r-- | jni/feature_mos/src/mosaic/Delaunay.cpp | 2 | ||||
-rw-r--r-- | jni/feature_mos/src/mosaic/ImageUtils.cpp | 7 | ||||
-rw-r--r-- | jni/feature_mos/src/mosaic/Log.h | 2 | ||||
-rw-r--r-- | jni/feature_mos/src/mosaic/trsMatrix.cpp | 2 | ||||
-rw-r--r-- | jni/feature_mos/src/mosaic_renderer/SurfaceTextureRenderer.cpp | 3 | ||||
-rw-r--r-- | jni/feature_mos/src/mosaic_renderer/WarpRenderer.h | 6 | ||||
-rw-r--r-- | jni/feature_mos_jni.cpp | 33 | ||||
-rw-r--r-- | jni/feature_stab/db_vlvm/db_feature_detection.cpp | 3 | ||||
-rw-r--r-- | jni/feature_stab/db_vlvm/db_feature_matching.cpp | 2 | ||||
-rw-r--r-- | jni/feature_stab/db_vlvm/db_metrics.h | 1 | ||||
-rw-r--r-- | jni/feature_stab/db_vlvm/db_rob_image_homography.cpp | 1 | ||||
-rw-r--r-- | jni/feature_stab/db_vlvm/db_utilities.cpp | 2 | ||||
-rw-r--r-- | jni/feature_stab/db_vlvm/db_utilities_indexing.h | 1 | ||||
-rw-r--r-- | jni/feature_stab/src/dbreg/dbreg.cpp | 4 | ||||
-rw-r--r-- | jni/feature_stab/src/dbreg/dbstabsmooth.cpp | 10 | ||||
-rw-r--r-- | jni/image_util_jni.cpp | 7 | ||||
-rw-r--r-- | jni/mosaic_renderer_jni.cpp | 23 | ||||
-rw-r--r-- | jni/tinyplanet.cc | 1 |
19 files changed, 82 insertions, 49 deletions
diff --git a/jni/feature_mos/src/mosaic/Blend.cpp b/jni/feature_mos/src/mosaic/Blend.cpp index 8e8ca6749..3672a878e 100644 --- a/jni/feature_mos/src/mosaic/Blend.cpp +++ b/jni/feature_mos/src/mosaic/Blend.cpp @@ -142,10 +142,7 @@ int Blend::runBlend(MosaicFrame **oframes, MosaicFrame **rframes, global_rect.lft = global_rect.bot = 2e30; // min values global_rect.rgt = global_rect.top = -2e30; // max values MosaicFrame *mb = NULL; - double halfwidth = width / 2.0; - double halfheight = height / 2.0; - - double z, x0, y0, x1, y1, x2, y2, x3, y3; + double x0, y0, x1, y1, x2, y2, x3, y3; // Corners of the left-most and right-most frames respectively in the // mosaic coordinate system. @@ -380,6 +377,9 @@ int Blend::DoMergeAndBlend(MosaicFrame **frames, int nsite, int width, int height, YUVinfo &imgMos, MosaicRect &rect, MosaicRect &cropping_rect, float &progress, bool &cancelComputation) { + (void)frames; + (void)width; + (void)height; m_pMosaicYPyr = NULL; m_pMosaicUPyr = NULL; m_pMosaicVPyr = NULL; @@ -655,9 +655,6 @@ int Blend::PerformFinalBlending(YUVinfo &imgMos, MosaicRect &cropping_rect) ImageType uimg; ImageType vimg; - int cx = (int)imgMos.Y.width/2; - int cy = (int)imgMos.Y.height/2; - // 2D boolean array that contains true wherever the mosaic image data is // invalid (i.e. in the gray border). bool **b = new bool*[imgMos.Y.height]; @@ -807,7 +804,7 @@ int Blend::PerformFinalBlending(YUVinfo &imgMos, MosaicRect &cropping_rect) delete b[j]; } - delete b; + delete[] b; return BLEND_RET_OK; } @@ -826,7 +823,6 @@ void Blend::ComputeMask(CSite *csite, BlendRect &vcrect, BlendRect &brect, Mosai { PyramidShort *dptr = m_pMosaicYPyr; - int nC = m_wb.nlevsC; int l = (int) ((vcrect.lft - rect.left)); int b = (int) ((vcrect.bot - rect.top)); int r = (int) ((vcrect.rgt - rect.left)); @@ -872,7 +868,6 @@ void Blend::ComputeMask(CSite *csite, BlendRect &vcrect, BlendRect &brect, Mosai continue; // scan the neighbors to see if this is a valid position - unsigned char mask = (unsigned char) 255; SEdgeVector *ce; int ecnt; for (ce = csite->getNeighbor(), ecnt = csite->getNumNeighbors(); ecnt--; ce++) @@ -894,6 +889,7 @@ void Blend::ComputeMask(CSite *csite, BlendRect &vcrect, BlendRect &brect, Mosai void Blend::ProcessPyramidForThisFrame(CSite *csite, BlendRect &vcrect, BlendRect &brect, MosaicRect &rect, YUVinfo &imgMos, double trs[3][3], int site_idx) { + (void)csite; // Put the Region of interest (for all levels) into m_pMosaicYPyr double inv_trs[3][3]; inv33d(trs, inv_trs); @@ -1221,8 +1217,6 @@ void Blend::SelectRelevantFrames(MosaicFrame **frames, int frames_size, MosaicFrame *last = frames[frames_size-1]; MosaicFrame *mb; - double fxpos = first->trs[0][2], fypos = first->trs[1][2]; - double midX = last->width / 2.0; double midY = last->height / 2.0; double z = ProjZ(first->trs, midX, midY, 1.0); @@ -1242,7 +1236,6 @@ void Blend::SelectRelevantFrames(MosaicFrame **frames, int frames_size, currY = ProjY(mb->trs, midX, midY, z, 1.0); double deltaX = currX - prevX; double deltaY = currY - prevY; - double center2centerDist = sqrt(deltaY * deltaY + deltaX * deltaX); if (fabs(deltaX) > STRIP_SEPARATION_THRESHOLD_PXLS || fabs(deltaY) > STRIP_SEPARATION_THRESHOLD_PXLS) @@ -1329,7 +1322,7 @@ void Blend::ComputeBlendParameters(MosaicFrame **frames, int frames_size, int is double dy = prevY - firstY; // If the mosaic was captured by sweeping horizontally - if (abs(lxpos - fxpos) > abs(lypos - fypos)) + if (fabs(lxpos - fxpos) > fabs(lypos - fypos)) { m_wb.horizontal = 1; // Calculate radius position to make ends exactly the same Y offset diff --git a/jni/feature_mos/src/mosaic/Delaunay.cpp b/jni/feature_mos/src/mosaic/Delaunay.cpp index 0ce09fc51..e8015dfd6 100644 --- a/jni/feature_mos/src/mosaic/Delaunay.cpp +++ b/jni/feature_mos/src/mosaic/Delaunay.cpp @@ -492,8 +492,6 @@ int CDelaunay::incircle(SitePointer a, SitePointer b, SitePointer c, SitePointer // TRUE iff A, B, C form a counterclockwise oriented triangle int CDelaunay::ccw(SitePointer a, SitePointer b, SitePointer c) { - int result; - double ax = sa[a].X(); double bx = sa[b].X(); double cx = sa[c].X(); diff --git a/jni/feature_mos/src/mosaic/ImageUtils.cpp b/jni/feature_mos/src/mosaic/ImageUtils.cpp index 82c2673cd..0173be44d 100644 --- a/jni/feature_mos/src/mosaic/ImageUtils.cpp +++ b/jni/feature_mos/src/mosaic/ImageUtils.cpp @@ -117,8 +117,7 @@ void ImageUtils::rgb2yvu(ImageType out, ImageType in, int width, int height) ImageType ImageUtils::rgb2gray(ImageType in, int width, int height) { - int r,g,b, nr, ng, nb, val; - ImageType gray = NULL; + int r,g,b; ImageType image = in; ImageType out = ImageUtils::allocateImage(width, height, 1); ImageType outCopy = out; @@ -147,8 +146,7 @@ ImageType ImageUtils::rgb2gray(ImageType in, int width, int height) ImageType ImageUtils::rgb2gray(ImageType out, ImageType in, int width, int height) { - int r,g,b, nr, ng, nb, val; - ImageType gray = out; + int r,g,b; ImageType image = in; ImageType outCopy = out; @@ -334,6 +332,7 @@ void ImageUtils::writeBinaryPPM(ImageType image, const char *filename, int width ImageType ImageUtils::allocateImage(int width, int height, int numChannels, short int border) { + (void)border; int overallocation = 256; return (ImageType) calloc(width*height*numChannels+overallocation, sizeof(ImageTypeBase)); } diff --git a/jni/feature_mos/src/mosaic/Log.h b/jni/feature_mos/src/mosaic/Log.h index cf6f14b18..2adfeda9c 100644 --- a/jni/feature_mos/src/mosaic/Log.h +++ b/jni/feature_mos/src/mosaic/Log.h @@ -14,7 +14,7 @@ * limitations under the License. */ #ifndef LOG_H_ -#define LOG_H +#define LOG_H_ #include <android/log.h> #define LOGV(...) __android_log_print(ANDROID_LOG_SILENT, LOG_TAG, __VA_ARGS__) diff --git a/jni/feature_mos/src/mosaic/trsMatrix.cpp b/jni/feature_mos/src/mosaic/trsMatrix.cpp index 5fc6a86b3..aa5aadc6b 100644 --- a/jni/feature_mos/src/mosaic/trsMatrix.cpp +++ b/jni/feature_mos/src/mosaic/trsMatrix.cpp @@ -40,8 +40,6 @@ void mult33d(double a[3][3], double b[3][3], double c[3][3]) // return: result if successful int normProjMat33d(double m[3][3]) { - double m22; - if(m[2][2] == 0.0) { return 0; diff --git a/jni/feature_mos/src/mosaic_renderer/SurfaceTextureRenderer.cpp b/jni/feature_mos/src/mosaic_renderer/SurfaceTextureRenderer.cpp index 2a7a1c2a0..66d5915e0 100644 --- a/jni/feature_mos/src/mosaic_renderer/SurfaceTextureRenderer.cpp +++ b/jni/feature_mos/src/mosaic_renderer/SurfaceTextureRenderer.cpp @@ -31,7 +31,7 @@ const GLfloat g_vVertices[] = { }; GLushort g_iIndices2[] = { 0, 1, 2, 3 }; -const int GL_TEXTURE_EXTERNAL_OES_ENUM = 0x8D65; +//const int GL_TEXTURE_EXTERNAL_OES_ENUM = 0x8D65; const int VERTEX_STRIDE = 6 * sizeof(GLfloat); @@ -118,6 +118,7 @@ bool SurfaceTextureRenderer::InitializeGLProgram() bool SurfaceTextureRenderer::DrawTexture(GLfloat *affine) { + (void)affine; bool succeeded = false; do { bool rt = (mFrameBuffer == NULL)? diff --git a/jni/feature_mos/src/mosaic_renderer/WarpRenderer.h b/jni/feature_mos/src/mosaic_renderer/WarpRenderer.h index 2f50c6f34..8332c7e71 100644 --- a/jni/feature_mos/src/mosaic_renderer/WarpRenderer.h +++ b/jni/feature_mos/src/mosaic_renderer/WarpRenderer.h @@ -28,9 +28,9 @@ class WarpRenderer: public Renderer { const char* VertexShaderSource() const; const char* FragmentShaderSource() const; - GLuint mTexHandle; // Handle to s_texture. - GLuint mTexCoordHandle; // Handle to a_texCoord. - GLuint mTriangleVerticesHandle; // Handle to vPosition. + //GLuint mTexHandle; // Handle to s_texture. + //GLuint mTexCoordHandle; // Handle to a_texCoord. + //GLuint mTriangleVerticesHandle; // Handle to vPosition. // Attribute locations GLint mPositionLoc; diff --git a/jni/feature_mos_jni.cpp b/jni/feature_mos_jni.cpp index 0fa792a6b..cfdcba441 100644 --- a/jni/feature_mos_jni.cpp +++ b/jni/feature_mos_jni.cpp @@ -40,8 +40,6 @@ char buffer[1024]; const int MAX_FRAMES = 100; -static double mTx; - int tWidth[NR]; int tHeight[NR]; @@ -165,7 +163,6 @@ void GenerateQuarterResImagePlanar(ImageType im, int input_w, int input_h, int AddFrame(int mID, int k, float* trs1d) { - double t0, t1, time_c; double trs[3][3]; int ret_code = mosaic[mID]->addFrame(tImage[mID][k]); @@ -241,7 +238,6 @@ void YUV420toYVU24_NEW(ImageType yvu24, ImageType yuv420sp, int width, { int frameSize = width * height; - ImageType oyp = yvu24; ImageType ovp = yvu24 + frameSize; ImageType oup = yvu24 + frameSize + frameSize; @@ -277,6 +273,8 @@ void YUV420toYVU24_NEW(ImageType yvu24, ImageType yuv420sp, int width, JNIEXPORT void JNICALL Java_com_android_camera_Mosaic_allocateMosaicMemory( JNIEnv* env, jobject thiz, jint width, jint height) { + (void)env; + (void)thiz; tWidth[HR] = width; tHeight[HR] = height; tWidth[LR] = int(width / H2L_FACTOR); @@ -296,6 +294,8 @@ JNIEXPORT void JNICALL Java_com_android_camera_Mosaic_allocateMosaicMemory( JNIEXPORT void JNICALL Java_com_android_camera_Mosaic_freeMosaicMemory( JNIEnv* env, jobject thiz) { + (void)env; + (void)thiz; for(int i = 0; i < MAX_FRAMES; i++) { ImageUtils::freeImage(tImage[LR][i]); @@ -342,8 +342,6 @@ void decodeYUV444SP(unsigned char* rgb, unsigned char* yuv420sp, int width, } } -static int count = 0; - void ConvertYVUAiToPlanarYVU(unsigned char *planar, unsigned char *in, int width, int height) { @@ -364,14 +362,13 @@ void ConvertYVUAiToPlanarYVU(unsigned char *planar, unsigned char *in, int width JNIEXPORT jfloatArray JNICALL Java_com_android_camera_Mosaic_setSourceImageFromGPU( JNIEnv* env, jobject thiz) { - double t0, t1, time_c; + (void)thiz; + double t0; t0 = now_ms(); int ret_code = Mosaic::MOSAIC_RET_OK; if(frame_number_HR<MAX_FRAMES && frame_number_LR<MAX_FRAMES) { - double last_tx = mTx; - sem_wait(&gPreviewImage_semaphore); ConvertYVUAiToPlanarYVU(tImage[LR][frame_number_LR], gPreviewImage[LR], tWidth[LR], tHeight[LR]); @@ -416,7 +413,8 @@ JNIEXPORT jfloatArray JNICALL Java_com_android_camera_Mosaic_setSourceImageFromG JNIEXPORT jfloatArray JNICALL Java_com_android_camera_Mosaic_setSourceImage( JNIEnv* env, jobject thiz, jbyteArray photo_data) { - double t0, t1, time_c; + (void)thiz; + double t0; t0 = now_ms(); int ret_code = Mosaic::MOSAIC_RET_OK; @@ -430,8 +428,6 @@ JNIEXPORT jfloatArray JNICALL Java_com_android_camera_Mosaic_setSourceImage( env->ReleaseByteArrayElements(photo_data, pixels, 0); - double last_tx = mTx; - t0 = now_ms(); GenerateQuarterResImagePlanar(tImage[HR][frame_number_HR], tWidth[HR], tHeight[HR], tImage[LR][frame_number_LR]); @@ -473,18 +469,24 @@ JNIEXPORT jfloatArray JNICALL Java_com_android_camera_Mosaic_setSourceImage( JNIEXPORT void JNICALL Java_com_android_camera_Mosaic_setBlendingType( JNIEnv* env, jobject thiz, jint type) { + (void)env; + (void)thiz; blendingType = int(type); } JNIEXPORT void JNICALL Java_com_android_camera_Mosaic_setStripType( JNIEnv* env, jobject thiz, jint type) { + (void)env; + (void)thiz; stripType = int(type); } JNIEXPORT void JNICALL Java_com_android_camera_Mosaic_reset( JNIEnv* env, jobject thiz) { + (void)env; + (void)thiz; frame_number_HR = 0; frame_number_LR = 0; @@ -500,6 +502,8 @@ JNIEXPORT void JNICALL Java_com_android_camera_Mosaic_reset( JNIEXPORT jint JNICALL Java_com_android_camera_Mosaic_reportProgress( JNIEnv* env, jobject thiz, jboolean hires, jboolean cancel_computation) { + (void)env; + (void)thiz; if(bool(hires)) gCancelComputation[HR] = cancel_computation; else @@ -514,6 +518,8 @@ JNIEXPORT jint JNICALL Java_com_android_camera_Mosaic_reportProgress( JNIEXPORT jint JNICALL Java_com_android_camera_Mosaic_createMosaic( JNIEnv* env, jobject thiz, jboolean value) { + (void)env; + (void)thiz; high_res = bool(value); int ret; @@ -571,6 +577,7 @@ JNIEXPORT jint JNICALL Java_com_android_camera_Mosaic_createMosaic( JNIEXPORT jintArray JNICALL Java_com_android_camera_Mosaic_getFinalMosaic( JNIEnv* env, jobject thiz) { + (void)thiz; int y,x; int width = mosaicWidth; int height = mosaicHeight; @@ -616,7 +623,7 @@ JNIEXPORT jintArray JNICALL Java_com_android_camera_Mosaic_getFinalMosaic( JNIEXPORT jbyteArray JNICALL Java_com_android_camera_Mosaic_getFinalMosaicNV21( JNIEnv* env, jobject thiz) { - int y,x; + (void)thiz; int width; int height; diff --git a/jni/feature_stab/db_vlvm/db_feature_detection.cpp b/jni/feature_stab/db_vlvm/db_feature_detection.cpp index 28cb4a781..74b994b22 100644 --- a/jni/feature_stab/db_vlvm/db_feature_detection.cpp +++ b/jni/feature_stab/db_vlvm/db_feature_detection.cpp @@ -62,6 +62,7 @@ float** db_AllocStrengthImage_f(float **im,int w,int h) void db_FreeStrengthImage_f(float *im,float **img,int h) { + (void)h; delete [] im; delete [] img; } @@ -1333,7 +1334,9 @@ inline void db_MaxSuppressFilterChunk_5x5_Aligned16_f(float **sf,float **s,int l /*temp should point to at least 6*132 floats of 16-byte-aligned allocated memory*/ float *temp) + { + (void)temp; #ifdef DB_USE_SIMD int i,lm2; float *two[4]; diff --git a/jni/feature_stab/db_vlvm/db_feature_matching.cpp b/jni/feature_stab/db_vlvm/db_feature_matching.cpp index d278d0cf6..94ce27b35 100644 --- a/jni/feature_stab/db_vlvm/db_feature_matching.cpp +++ b/jni/feature_stab/db_vlvm/db_feature_matching.cpp @@ -627,7 +627,6 @@ inline void db_SignedSquareNormCorr21x21_PreAlign_u(short *patch,const unsigned { float den; int f2sum,fsum; - int xm_f=x_f-10; short f; int xwi; @@ -1139,6 +1138,7 @@ inline void db_SignedSquareNormCorr11x11_PreAlign_AffinePatchWarp_u(short *patch int xi,int yi,float *sum,float *recip, const double Hinv[9],int affine) { + (void)Hinv; float den; short f; int f2sum,fsum; diff --git a/jni/feature_stab/db_vlvm/db_metrics.h b/jni/feature_stab/db_vlvm/db_metrics.h index 3ef7470c4..04542e24d 100644 --- a/jni/feature_stab/db_vlvm/db_metrics.h +++ b/jni/feature_stab/db_vlvm/db_metrics.h @@ -323,6 +323,7 @@ inline void db_DerivativeCauchyInhomRotationReprojection(double Jf_dx[6],double */ inline int db_RemoveOutliers_Homography(const double H[9], double *x_i,double *xp_i, double *wp,double *im, double *im_p, double *im_r, double *im_raw,double *im_raw_p,int point_count,double scale, double thresh=DB_OUTLIER_THRESHOLD) { + (void)scale; double temp_valueE, t2; int c; int k1=0; diff --git a/jni/feature_stab/db_vlvm/db_rob_image_homography.cpp b/jni/feature_stab/db_vlvm/db_rob_image_homography.cpp index 82dec0cbe..b233d2f34 100644 --- a/jni/feature_stab/db_vlvm/db_rob_image_homography.cpp +++ b/jni/feature_stab/db_vlvm/db_rob_image_homography.cpp @@ -342,6 +342,7 @@ inline void db_RobImageHomographyJH_JR(double **JE_dx_ref,int j,double H[9]) inline void db_RobImageHomographyJH_Jt(double **JE_dx_ref,int j,int k,double H[9]) { + (void)H; JE_dx_ref[0][j]=0; JE_dx_ref[1][j]=0; JE_dx_ref[2][j]=1.0; diff --git a/jni/feature_stab/db_vlvm/db_utilities.cpp b/jni/feature_stab/db_vlvm/db_utilities.cpp index ce2093b01..32214abe8 100644 --- a/jni/feature_stab/db_vlvm/db_utilities.cpp +++ b/jni/feature_stab/db_vlvm/db_utilities.cpp @@ -69,12 +69,14 @@ unsigned char** db_AllocImage_u(int w,int h,int over_allocation) void db_FreeImage_f(float **img,int h) { + (void)h; delete [] (img[0]); delete [] img; } void db_FreeImage_u(unsigned char **img,int h) { + (void)h; delete [] (img[0]); delete [] img; } diff --git a/jni/feature_stab/db_vlvm/db_utilities_indexing.h b/jni/feature_stab/db_vlvm/db_utilities_indexing.h index ed84d3a3b..5ced93496 100644 --- a/jni/feature_stab/db_vlvm/db_utilities_indexing.h +++ b/jni/feature_stab/db_vlvm/db_utilities_indexing.h @@ -40,6 +40,7 @@ inline void db_SetupMatrixRefs(double **ar,long rows,long cols,double *a) inline void db_SymmetricExtendUpperToLower(double **A,int rows,int cols) { + (void)cols; int i,j; for(i=1;i<rows;i++) for(j=0;j<i;j++) A[i][j]=A[j][i]; } diff --git a/jni/feature_stab/src/dbreg/dbreg.cpp b/jni/feature_stab/src/dbreg/dbreg.cpp index da06aa2ab..acf2ff647 100644 --- a/jni/feature_stab/src/dbreg/dbreg.cpp +++ b/jni/feature_stab/src/dbreg/dbreg.cpp @@ -162,6 +162,7 @@ void db_FrameToReferenceRegistration::Init(int width, int height, int cd_nr_vert_blocks ) { + (void)scale; Clean(); m_reference_update_period = reference_update_period; @@ -514,6 +515,7 @@ int db_FrameToReferenceRegistration::AddFrame(const unsigned char * const * im, //void db_FrameToReferenceRegistration::ComputeInliers(double H[9],std::vector<int> &inlier_indices) void db_FrameToReferenceRegistration::ComputeInliers(double H[9]) { + (void)H; double totnummatches = m_nr_matches; int inliercount=0; @@ -530,7 +532,7 @@ void db_FrameToReferenceRegistration::ComputeInliers(double H[9]) } m_num_inlier_indices = inliercount; - double frac=inliercount/totnummatches; +// double frac=inliercount/totnummatches; } //void db_FrameToReferenceRegistration::Polish(std::vector<int> &inlier_indices) diff --git a/jni/feature_stab/src/dbreg/dbstabsmooth.cpp b/jni/feature_stab/src/dbreg/dbstabsmooth.cpp index dffff8ab1..74114f869 100644 --- a/jni/feature_stab/src/dbreg/dbstabsmooth.cpp +++ b/jni/feature_stab/src/dbreg/dbstabsmooth.cpp @@ -21,8 +21,8 @@ #define vp_copy_motion_no_id vp_copy_motion /////////////////////////////////////////////////////////////////////////////////////////////////// -static bool vpmotion_add(VP_MOTION *in1, VP_MOTION *in2, VP_MOTION *out); -static bool vpmotion_multiply(VP_MOTION *in1, double factor, VP_MOTION *out); +//static bool vpmotion_add(VP_MOTION *in1, VP_MOTION *in2, VP_MOTION *out); +//static bool vpmotion_multiply(VP_MOTION *in1, double factor, VP_MOTION *out); db_StabilizationSmoother::db_StabilizationSmoother() { @@ -136,7 +136,7 @@ bool db_StabilizationSmoother::smoothMotionAdaptive(/*VP_BIMG *bimg,*/int hsize, smoothFactor = minSmoothFactor; // Find the amount of motion that must be compensated so that no "border" pixels are seen in the stable video - for (smoothFactor = smoothFactor; smoothFactor >= minSmoothFactor; smoothFactor -= 0.01) { + for (; smoothFactor >= minSmoothFactor; smoothFactor -= 0.01) { // Compute the smoothed motion if(!smoothMotion(inmot, &tmpMotion, smoothFactor)) break; @@ -303,7 +303,7 @@ bool db_StabilizationSmoother::is_point_in_rect(double px, double py, double rx, } - +/* static bool vpmotion_add(VP_MOTION *in1, VP_MOTION *in2, VP_MOTION *out) { int i; @@ -327,4 +327,4 @@ static bool vpmotion_multiply(VP_MOTION *in1, double factor, VP_MOTION *out) return true; } - +*/ diff --git a/jni/image_util_jni.cpp b/jni/image_util_jni.cpp index 295453532..58568cf52 100644 --- a/jni/image_util_jni.cpp +++ b/jni/image_util_jni.cpp @@ -122,6 +122,7 @@ jint JNICALL Java_com_android_camera_imageprocessor_FrameProcessor_nativeRotateN JNIEnv* env, jobject thiz, jobjectArray inBuf, jint imageWidth, jint imageHeight, jint degree, jobjectArray outBuf) { + (void)thiz; uint8_t *in_buf = (uint8_t *)env->GetDirectBufferAddress(inBuf); uint8_t *out_buf = (uint8_t *)env->GetDirectBufferAddress(outBuf); rotateBufAndMerge(in_buf, imageWidth, imageHeight, degree, out_buf); @@ -132,6 +133,7 @@ jint JNICALL Java_com_android_camera_imageprocessor_FrameProcessor_nativeRotateN jint JNICALL Java_com_android_camera_imageprocessor_FrameProcessor_nativeNV21toRgb( JNIEnv* env, jobject thiz, jobjectArray yvuBuf, jobjectArray rgbBuf, jint width, jint height) { + (void)thiz; uint8_t *in_buf = (uint8_t *)env->GetDirectBufferAddress(yvuBuf); uint8_t *rgb_buf = (uint8_t *)env->GetDirectBufferAddress(rgbBuf); int ysize = width * height; @@ -161,6 +163,7 @@ jint JNICALL Java_com_android_camera_imageprocessor_FrameProcessor_nativeNV21toR jint JNICALL Java_com_android_camera_imageprocessor_PostProcessor_nativeFlipNV21( JNIEnv* env, jobject thiz, jbyteArray yvuBytes, jint stride, jint height, jint gap, jboolean isVertical) { + (void)thiz; jbyte* imageDataNV21Array = env->GetByteArrayElements(yvuBytes, NULL); uint8_t *buf = (uint8_t *)imageDataNV21Array; int ysize = stride * height; @@ -211,6 +214,7 @@ jint JNICALL Java_com_android_camera_imageprocessor_PostProcessor_nativeFlipNV21 jint JNICALL Java_com_android_camera_imageprocessor_PostProcessor_nativeNV21Split( JNIEnv* env, jobject thiz, jbyteArray srcYVU, jobjectArray yBuf, jobjectArray vuBuf, jint width, jint height, jint srcStride, jint dstStride) { + (void)thiz; uint8_t *old_buf = (uint8_t *) env->GetByteArrayElements(srcYVU, NULL); uint8_t *y_buf = (uint8_t *)env->GetDirectBufferAddress(yBuf); uint8_t *vu_buf = (uint8_t *)env->GetDirectBufferAddress(vuBuf); @@ -231,6 +235,7 @@ jint JNICALL Java_com_android_camera_imageprocessor_PostProcessor_nativeNV21Spli jint JNICALL Java_com_android_camera_imageprocessor_PostProcessor_nativeResizeImage( JNIEnv* env, jobject thiz, jbyteArray oldBuf, jbyteArray newBuf, jint oldWidth, jint oldHeight, jint oldStride, jint newWidth, jint newHeight) { + (void)thiz; uint8_t *old_buf = (uint8_t *) env->GetByteArrayElements(oldBuf, NULL); uint8_t *new_buf = (uint8_t *) env->GetByteArrayElements(newBuf, NULL); int adjustedOldWidth = oldWidth; @@ -290,4 +295,4 @@ jint JNICALL Java_com_android_camera_imageprocessor_PostProcessor_nativeResizeIm env->ReleaseByteArrayElements(newBuf, (jbyte *)new_buf, JNI_ABORT); return R; -}
\ No newline at end of file +} diff --git a/jni/mosaic_renderer_jni.cpp b/jni/mosaic_renderer_jni.cpp index 6c52b542e..c6edee529 100644 --- a/jni/mosaic_renderer_jni.cpp +++ b/jni/mosaic_renderer_jni.cpp @@ -176,10 +176,12 @@ float g_dIdent3x3[] = { const int GL_TEXTURE_EXTERNAL_OES_ENUM = 0x8D65; +/* static void printGLString(const char *name, GLenum s) { const char *v = (const char *) glGetString(s); LOGI("GL %s = %s", name, v); } +*/ void checkFramebufferStatus(const char* name) { GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); @@ -508,6 +510,8 @@ extern "C" JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void* reserved) { + (void)vm; + (void)reserved; sem_init(&gPreviewImage_semaphore, 0, 1); return JNI_VERSION_1_4; @@ -516,11 +520,15 @@ JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void* reserved) JNIEXPORT void JNICALL JNI_OnUnload(JavaVM* vm, void* reserved) { + (void)vm; + (void)reserved; sem_destroy(&gPreviewImage_semaphore); } JNIEXPORT jint JNICALL Java_com_android_camera_MosaicRenderer_init( JNIEnv * env, jobject obj, jboolean mEnableWarpedPanoPreview) { + (void)env; + (void)obj; gEnableWarpedPanoPreview = mEnableWarpedPanoPreview; gSurfTexRenderer[LR].InitializeGLProgram(); gSurfTexRenderer[HR].InitializeGLProgram(); @@ -596,6 +604,8 @@ JNIEXPORT void JNICALL Java_com_android_camera_MosaicRenderer_reset( JNIEnv * env, jobject obj, jint width, jint height, jboolean isLandscapeOrientation, jint orientation) { + (void)env; + (void)obj; gIsLandscapeOrientation = isLandscapeOrientation; gOrientation = orientation; calculateUILayoutScaling(gPreviewFBOWidth, gPreviewFBOHeight, gIsLandscapeOrientation); @@ -719,6 +729,7 @@ JNIEXPORT void JNICALL Java_com_android_camera_MosaicRenderer_reset( JNIEXPORT void JNICALL Java_com_android_camera_MosaicRenderer_preprocess( JNIEnv * env, jobject obj, jfloatArray stMatrix) { + (void)obj; jfloat *stmat = env->GetFloatArrayElements(stMatrix, 0); gSurfTexRenderer[LR].SetSTMatrix((float*) stmat); @@ -748,7 +759,9 @@ now_ms(void) JNIEXPORT void JNICALL Java_com_android_camera_MosaicRenderer_transferGPUtoCPU( JNIEnv * env, jobject obj) { - double t0, t1, time_c; + (void)env; + (void)obj; + double t0; gYVURenderer[LR].DrawTexture(); gYVURenderer[HR].DrawTexture(); @@ -786,6 +799,8 @@ JNIEXPORT void JNICALL Java_com_android_camera_MosaicRenderer_transferGPUtoCPU( JNIEXPORT void JNICALL Java_com_android_camera_MosaicRenderer_step( JNIEnv * env, jobject obj) { + (void)env; + (void)obj; if(!gWarpImage) // ViewFinder { if (gIsLandscapeOrientation) { @@ -825,6 +840,8 @@ JNIEXPORT void JNICALL Java_com_android_camera_MosaicRenderer_step( JNIEXPORT void JNICALL Java_com_android_camera_MosaicRenderer_setWarping( JNIEnv * env, jobject obj, jboolean flag) { + (void)env; + (void)obj; // TODO: Review this logic if(gWarpImage != (bool) flag) //switching from viewfinder to capture or vice-versa { @@ -859,6 +876,8 @@ JNIEXPORT void JNICALL Java_com_android_camera_MosaicRenderer_setWarping( JNIEXPORT void JNICALL Java_com_android_camera_MosaicRenderer_updateMatrix( JNIEnv * env, jobject obj) { + (void)env; + (void)obj; for(int i=0; i<16; i++) { g_dAffinetransGL[i] = g_dAffinetrans[i]; @@ -870,5 +889,7 @@ JNIEXPORT void JNICALL Java_com_android_camera_MosaicRenderer_updateMatrix( JNIEXPORT void JNICALL Java_com_android_camera_MosaicRenderer_setPreviewBackground( JNIEnv * env, jobject obj, jboolean flag) { + (void)env; + (void)obj; gPreviewBackgroundImage = (bool)flag; } diff --git a/jni/tinyplanet.cc b/jni/tinyplanet.cc index dfb31d768..b629c9fc4 100644 --- a/jni/tinyplanet.cc +++ b/jni/tinyplanet.cc @@ -132,6 +132,7 @@ void StereographicProjection(float scale, float angle, unsigned char* input_imag JNIEXPORT void JNICALL Java_com_android_camera_tinyplanet_TinyPlanetNative_process(JNIEnv* env, jobject obj, jobject bitmap_in, jint width, jint height, jobject bitmap_out, jint output_size, jfloat scale, jfloat angle) { + (void)obj; char* source = 0; char* destination = 0; AndroidBitmap_lockPixels(env, bitmap_in, (void**) &source); |