diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 67161ee5..dded7f15 100755 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -21,6 +21,23 @@ android:largeScreens="true" android:xlargeScreens="true" /> + + + + + + + + + + + + + + + + + @@ -90,22 +107,7 @@ --> - - - - - - - - - - - - - - - - + - @@ -277,58 +251,6 @@ - - - - diff --git a/camera2libs/core_dex2jar.jar b/camera2libs/core_dex2jar.jar deleted file mode 100644 index 3ab45a60..00000000 Binary files a/camera2libs/core_dex2jar.jar and /dev/null differ diff --git a/camera2libs/framework2_dex2jar.jar b/camera2libs/framework2_dex2jar.jar new file mode 100755 index 00000000..0fcd6f3b Binary files /dev/null and b/camera2libs/framework2_dex2jar.jar differ diff --git a/camera2libs/framework_dex2jar.jar b/camera2libs/framework_dex2jar.jar old mode 100644 new mode 100755 index a1fe2c43..be23a9f2 Binary files a/camera2libs/framework_dex2jar.jar and b/camera2libs/framework_dex2jar.jar differ diff --git a/jni/almashot/armeabi-v7a/libalmalib_eval.a b/jni/almashot/armeabi-v7a/libalmalib_eval.a index 3e715d9a..23b799bf 100644 Binary files a/jni/almashot/armeabi-v7a/libalmalib_eval.a and b/jni/almashot/armeabi-v7a/libalmalib_eval.a differ diff --git a/jni/almashot/x86/libalmalib_eval.a b/jni/almashot/x86/libalmalib_eval.a index dfb9947c..e9b030cb 100644 Binary files a/jni/almashot/x86/libalmalib_eval.a and b/jni/almashot/x86/libalmalib_eval.a differ diff --git a/jni/dro/almashot-dro.cpp b/jni/dro/almashot-dro.cpp index 6f06331c..563207c6 100755 --- a/jni/dro/almashot-dro.cpp +++ b/jni/dro/almashot-dro.cpp @@ -147,8 +147,9 @@ extern "C" JNIEXPORT jint JNICALL Java_com_almalence_plugins_processing_simple_A jfloat max_amplify, jboolean local_mapping, jint filterStrength, - jint strongFilter, - jint pullUV + jint pullUV, + jfloat dark_noise_pass, + jfloat gamma ) { int i, x, y; @@ -188,9 +189,9 @@ extern "C" JNIEXPORT jint JNICALL Java_com_almalence_plugins_processing_simple_A float max_limit[3] = {3.0f,2.0f,2.0f}; if (local_mapping) - Dro_ComputeToneTable(hist_loc[x][y], lookup_table[x][y], 0.5, 64, 0.5f, min_limit, max_limit, max_amplify); + Dro_ComputeToneTable(hist_loc[x][y], lookup_table[x][y], gamma, 64, 0.5f, min_limit, max_limit, max_amplify); else - Dro_ComputeToneTable(hist, lookup_table[x][y], 0.5, 64, 0.5f, min_limit, max_limit, max_amplify); + Dro_ComputeToneTable(hist, lookup_table[x][y], gamma, 64, 0.5f, min_limit, max_limit, max_amplify); } @@ -200,8 +201,8 @@ extern "C" JNIEXPORT jint JNICALL Java_com_almalence_plugins_processing_simple_A local_mapping ? NULL:lookup_table[0][0], local_mapping ? lookup_table:NULL, filterStrength, - strongFilter, pullUV, 5, + dark_noise_pass, sx, sy); } @@ -253,6 +254,7 @@ extern "C" JNIEXPORT void JNICALL Java_com_almalence_plugins_capture_video_Realt jboolean force_update, jint uv_desat, jint dark_uv_desat, + jfloat dark_noise_pass, jfloat mix_factor, jfloat gamma, // default = 0.5 jfloat max_black_level, // default = 16 @@ -278,6 +280,7 @@ extern "C" JNIEXPORT void JNICALL Java_com_almalence_plugins_capture_video_Realt force_update, uv_desat, dark_uv_desat, + dark_noise_pass, mix_factor, gamma, max_black_level, diff --git a/jni/include/almashot/dro.h b/jni/include/almashot/dro.h index 92bcc86e..75df10c4 100644 --- a/jni/include/almashot/dro.h +++ b/jni/include/almashot/dro.h @@ -31,7 +31,7 @@ SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE, MISUSE OR INABILITY TO USE THE SOFTWARE OR RELATED DOCUMENTATION. - COPYRIGHT 2012, ALMALENCE, INC. + COPYRIGHT 2012-2014, ALMALENCE, INC. --------------------------------------------------------------------------- @@ -78,26 +78,23 @@ void Dro_GetHistogramNV21 // Input: // hist - pointer to histogram with 256 elements // Output: -// lookup_table[256] - filled with tone-table multipliers (in q5.10 fixed-point format) +// lookup_table - filled with tone-table multipliers (in q5.10 fixed-point format) // // Parameters: // gamma - Defines how 'bright' the output image will be. Lower values cause brighter output. // Default: 0.5 // max_black_level - threshold for black level correction. Default: 16 // black_level_atten - how much to attenuate black level. Default: 0.5 -// min_limit[3] - Minimum limit on contrast reduction. Range: [0..0.9]. Default: 0.5 +// min_limit[3] - Minimum limit on contrast reduction. Range: [0..0.9]. Default: {0.5, 0.5, 0.5} +// max_limit[3] - Maximum limit on contrast enhancement. Range: [1..10]. Default: // [0] - for shadows, [1] - for midtones, [2] - for highlights. -// max_limit[3] - Maximum limit on contrast enhancement. Range: [1..10]. -// [0] - for shadows, default: 4 - for hdr-like effects, 3 for more balanced results -// [1] - for midtones, default: 2 -// [2] - for highlights, default: 2 +// {4.0, 2.0, 2.0} - for hdr-like effects; +// {3.0, 2.0, 2.0} - for more balanced results. // global_limit - Maximum limit on total brightness amplification. Recommended: 4 -// Return: -// pointer to lookup_table. -Int32 *Dro_ComputeToneTable +void Dro_ComputeToneTable ( - Uint32 *hist, - Int32 *lookup_table, + Uint32 hist[256], + Int32 lookup_table[256], float gamma, float max_black_level, float black_level_atten, @@ -107,6 +104,39 @@ Int32 *Dro_ComputeToneTable ); +// ComputeToneTableLocal - same as ComputeToneTable, but compute 3x3 tone tables. +// Input: +// hist_loc - 3x3 histograms each with 256 elements +// Output: +// lookup_table_loc - filled with multipliers for each of 3x3 image areas +// +// Parameters: +// gamma - Defines how 'bright' the output image will be. Lower values cause brighter output. +// Default: 0.5 +// max_black_level - threshold for black level correction. Default: 16 +// black_level_atten - how much to attenuate black level. Default: 0.5 +// min_limit[3] - Minimum limit on contrast reduction. Range: [0..0.9]. Default: {0.5, 0.5, 0.5} +// max_limit[3] - Maximum limit on contrast enhancement. Range: [1..10]. Default: +// [0] - for shadows, [1] - for midtones, [2] - for highlights. +// {4.0, 2.0, 2.0} - for hdr-like effects; +// {3.0, 2.0, 2.0} - for more balanced results. +// global_limit - Maximum limit on total brightness amplification. Recommended: 4 +// mix_factor - Defines the level of inter-dependence of image areas. Range: [0..1]. +// Recommended: 0.2 +void Dro_ComputeToneTableLocal +( + Uint32 hist_loc[3][3][256], + Int32 lookup_table_loc[3][3][256], + float gamma, + float max_black_level, + float black_level_atten, + float min_limit[3], + float max_limit[3], + float global_limit, + float mix_factor +); + + // ApplyToneTableNV21 - apply lookup_table[256] to YUV. // // Input: @@ -156,35 +186,13 @@ int Dro_ApplyToneTableFilteredNV21 Int32 lookup_table[256], Int32 lookup_local[3][3][256], int filter, - int strong_filter, int uv_desat, int dark_uv_desat, + float dark_noise_pass, int sx, int sy ); -// Description: -// Detects if a new histogram is sufficiently different from the base one. -// If so - new histogram is copied into base. -// It is further detected if scene is changed. -// -// Return: -// -// 0 = no tone table update is needed -// hist_base remain untouched -// -// 1 = tone update is needed, but no scene change (slowly advance to the new table) -// hist_base updated with the new hist -// -// 2 = tone update is needed, scene change (switch to the new table immediately) -// hist_base updated with the new hist -// -int Dro_CheckToneUpdateNeeded -( - Uint32 *hist, - Uint32 *hist_base -); - // // Example: @@ -237,12 +245,13 @@ void Dro_StreamingRender int force_update, int uv_desat, int dark_uv_desat, + float dark_noise_pass, float mix_factor, float gamma, // default = 0.5 float max_black_level, // default = 16 float black_level_atten, // default = 0.5 - float min_limit[3], // default = 0.5 0.5 0.5 - float max_limit[3], // default = 3 2 2 + float min_limit[3], // default = {0.5, 0.5, 0.5} + float max_limit[3], // default = {3.0, 2.0, 2.0} unsigned int texture_out ); diff --git a/jni/include/almashot/filters.h b/jni/include/almashot/filters.h index f6425a66..cf3be46c 100644 --- a/jni/include/almashot/filters.h +++ b/jni/include/almashot/filters.h @@ -31,7 +31,7 @@ SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE, MISUSE OR INABILITY TO USE THE SOFTWARE OR RELATED DOCUMENTATION. - COPYRIGHT 2010-2012, ALMALENCE, INC. + COPYRIGHT 2010-2014, ALMALENCE, INC. --------------------------------------------------------------------------- @@ -195,6 +195,28 @@ void Filters_PostFilter int sharpen ); +void Filters_OuterMirrorFill +( + Uint8 *in, + int sx, + int sy, + int x0, + int y0, + int w, + int h +); + +void Filters_FillFilterPressure +( + Int32 Scale, + int sx, + int sy, + Uint8 *nMov, + Uint8 *mcurTbl, + int subsampMov, + int sxMov +); + void Filters_PostFilterQuick ( void *instance, @@ -203,8 +225,24 @@ void Filters_PostFilterQuick Int32 Scale, int sx, int sy, + int sharpen, + Uint8 *nMov, + Uint8 *mcurTbl, + int subsampMov, + int sxMov +); + +void Filters_PostFilterQuick_CPU +( + void *instance, + Uint8 *Y, + int sx, + int sy, int stride, - int sharpen + int sharpen, + Uint8 *mcurTbl, + int subsampMov, + int sxMov ); void Filters_PostFilterUV @@ -247,7 +285,8 @@ void Filters_ResidualQuarterCompute int sx, int sy, int sxs, - int sys + int sys, + int pressure ); void Filters_ResidualQuarterComputeUV @@ -258,7 +297,8 @@ void Filters_ResidualQuarterComputeUV int sx, int sy, int sxs, - int sys + int sys, + int stride ); // Filter lower spatial components of the frame @@ -279,7 +319,25 @@ void Filters_FilterLowSpatialUV Uint8 *inUV, int sx, int sy, - int Filter + int Filter, + int stride +); + +void Filters_FilterMoving +( + void *instance, + Uint8 *Y, + Uint8 *nMov, + Int32 Scale, +// int mtx, +// int mty, + int x_st, + int y_st, + int x_en, + int y_en, + int sx, + int sy, + int stride ); diff --git a/jni/include/almashot/superzoom.h b/jni/include/almashot/superzoom.h index 9bcbedfa..3a67928c 100644 --- a/jni/include/almashot/superzoom.h +++ b/jni/include/almashot/superzoom.h @@ -31,7 +31,7 @@ SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE, MISUSE OR INABILITY TO USE THE SOFTWARE OR RELATED DOCUMENTATION. - COPYRIGHT 2010-2012, ALMALENCE, INC. + COPYRIGHT 2010-2014, ALMALENCE, INC. --------------------------------------------------------------------------- @@ -122,11 +122,7 @@ int SuperZoom_StartStreaming int sy, int sxo, int syo, - int SensorGain, - int DeGhostGain, int DeGhostFrames, - int kelvin1, - int kelvin2, int noSres, int cameraIndex ); @@ -147,6 +143,10 @@ int SuperZoom_ResolveFrame int *h_out, int nImages, int nRefImage, + int SensorGain, + int MovObjGain, + int kelvin1, + int kelvin2, int enh_edges ); diff --git a/jni/prebuilt/armeabi-v7a/libandroid_runtime.so b/jni/prebuilt/armeabi-v7a/libandroid_runtime.so index 379a4f4c..7594cf4c 100755 Binary files a/jni/prebuilt/armeabi-v7a/libandroid_runtime.so and b/jni/prebuilt/armeabi-v7a/libandroid_runtime.so differ diff --git a/jni/sequence/almashot-sequence.cpp b/jni/sequence/almashot-sequence.cpp index 290a5107..b7ae4eba 100755 --- a/jni/sequence/almashot-sequence.cpp +++ b/jni/sequence/almashot-sequence.cpp @@ -114,54 +114,6 @@ void NV21toARGB( } } -// Decode from JPEG to NV21 using skia lib -/*int decodeFromJpeg(unsigned char *data, int len, int idx, int sx, int sy) -{ - int x, y; - Uint32 * pix; - Uint32 p1, p2; - - SkBitmap bm; - SkBitmap::Config pref = SkBitmap::kARGB_8888_Config; - - if (SkImageDecoder::DecodeMemory(data, len, &bm, pref, SkImageDecoder::kDecodePixels_Mode)) - { - pix = (Uint32 *)bm.getPixels(); - - for (y=0; y - - diff --git a/res/layout/gui_almalence_layout.xml b/res/layout/gui_almalence_layout.xml index 7f1c5e62..f51dff7c 100755 --- a/res/layout/gui_almalence_layout.xml +++ b/res/layout/gui_almalence_layout.xml @@ -363,10 +363,28 @@ + + + + - - + - - diff --git a/res/layout/gui_almalence_whatsnew.xml b/res/layout/gui_almalence_whatsnew.xml index 0eb884bc..c09e2070 100755 --- a/res/layout/gui_almalence_whatsnew.xml +++ b/res/layout/gui_almalence_whatsnew.xml @@ -6,21 +6,11 @@ android:layout_width="match_parent" android:layout_height="match_parent" > - - diff --git a/res/layout/plugin_capture_video_layout.xml b/res/layout/plugin_capture_video_layout.xml index ff860b09..2fe48e91 100755 --- a/res/layout/plugin_capture_video_layout.xml +++ b/res/layout/plugin_capture_video_layout.xml @@ -1,6 +1,6 @@ - - + + + + - - - - - - - - -