camera: add Morpho DNR support
-- Use to Morpho DNR (Digital Noise Reduction) for low-ligth conditions (under
50lux).
-- Remove logspam
Bug: 7131846
Bug: 7138612
Change-Id: Ie8b66ddb0307ec5f779d60033eae766ed12b13ed
Signed-off-by: Iliyan Malchev <malchev@google.com>
diff --git a/camera/QCameraHWI.cpp b/camera/QCameraHWI.cpp
index cc88f8a..eec8adb 100755
--- a/camera/QCameraHWI.cpp
+++ b/camera/QCameraHWI.cpp
@@ -24,6 +24,8 @@
#include <cutils/properties.h>
#include <fcntl.h>
#include <sys/mman.h>
+#include <string.h>
+#include <dlfcn.h>
#include "QCameraHAL.h"
#include "QCameraHWI.h"
@@ -282,6 +284,13 @@
return;
}
mCameraState = CAMERA_STATE_READY;
+ libdnr = dlopen("libmorpho_noise_reduction.so", RTLD_NOW);
+ if (libdnr) {
+ ALOGD("Open MM camera DL libmorpho_noise_reduction loaded at %p & %p ", libdnr);
+ *(void **)&LINK_morpho_DNR_ProcessFrame = dlsym(libdnr, "LINK_mm_camera_morpho_noise_reduction");
+ }
+ else
+ ALOGE("failed to open libmorpho_noise_reduction");
ALOGI("QCameraHardwareInterface: X");
}
@@ -332,6 +341,11 @@
QCameraStream_Snapshot::deleteInstance (mStreamSnap);
mStreamSnap = NULL;
}
+ if (libdnr != NULL) {
+ dlclose(libdnr);
+ libdnr = NULL;
+ ALOGD("closed libmorpho_noise_reduction.so");
+ }
if (mStreamLiveSnap){
QCameraStream_Snapshot::deleteInstance (mStreamLiveSnap);
@@ -1389,7 +1403,7 @@
status_t QCameraHardwareInterface::autoFocusMoveEvent(cam_ctrl_status_t *status, app_notify_cb_t *app_cb)
{
- ALOGI("autoFocusMoveEvent: E");
+ ALOGV("autoFocusMoveEvent: E");
int ret = NO_ERROR;
isp3a_af_mode_t afMode = getAutoFocusMode(mParameters);
@@ -1412,7 +1426,7 @@
ALOGE("%s:Unknown AF Move Status received (%d) received",__func__,*status);
}
}
- ALOGI("autoFocusMoveEvent: X");
+ ALOGV("autoFocusMoveEvent: X");
return ret;
}
@@ -1473,7 +1487,7 @@
app_cb->argm_notify.ext2 = 0;
app_cb->argm_notify.cookie = mCallbackCookie;
- ALOGD("Auto foucs state =%d", *status);
+ ALOGV("Auto focus state =%d", *status);
if(*status==CAM_CTRL_SUCCESS) {
app_cb->argm_notify.ext1 = true;
}
diff --git a/camera/QCameraHWI.h b/camera/QCameraHWI.h
index c689b70..2bc8abc 100644
--- a/camera/QCameraHWI.h
+++ b/camera/QCameraHWI.h
@@ -45,6 +45,7 @@
#include "QCameraStream.h"
#include "QCamera_Intf.h"
+#include "hdr/include/morpho_noise_reduction_ext.h"
//Error codes
#define NOT_FOUND -1
#define MAX_ZOOM_RATIOS 62
@@ -800,6 +801,8 @@
camera_size_type* mVideoSizes;
const camera_size_type * mPictureSizesPtr;
HAL_camera_state_type_t mCameraState;
+ void *libdnr;
+ int (*LINK_morpho_DNR_ProcessFrame)(unsigned char* yuvImage, int width, int height, int y_level, int c_level);
/* Temporary - can be removed after Honeycomb*/
#ifdef USE_ION
diff --git a/camera/QCameraHWI_Still.cpp b/camera/QCameraHWI_Still.cpp
old mode 100755
new mode 100644
index 580f368..7acd8fd
--- a/camera/QCameraHWI_Still.cpp
+++ b/camera/QCameraHWI_Still.cpp
@@ -1832,6 +1832,7 @@
int buf_index = 0;
common_crop_t crop;
int rc = NO_ERROR;
+ int cur_lux_idx = 0;
camera_notify_callback notifyCb;
camera_data_callback dataCb, jpgDataCb;
@@ -1910,7 +1911,34 @@
return BAD_VALUE;
}
memcpy(frame, recvd_frame, sizeof(mm_camera_ch_data_buf_t));
+ rc = cam_config_get_parm(mCameraId, MM_CAMERA_PARM_LUX_IDX, &cur_lux_idx);
+ if (cur_lux_idx > 370) {
+ static int input_width = 0, input_height = 0;
+ static int ret = 0;
+ unsigned char *dnr_buffer;
+ input_width = mPictureWidth;
+ input_height = mPictureHeight;
+
+ ALOGV("%s: received frame %d * %d", __func__, input_width, input_height);
+ {
+ dnr_buffer = (uint8_t *)malloc(input_width*input_height*3/2);
+ if (dnr_buffer == NULL)
+ ALOGV("dnr_buffer alloc fail");
+ ALOGV("dnr_buffer allocated size : %d", input_width*input_height*3/2);
+ memcpy(dnr_buffer, (uint8_t *)frame->snapshot.main.frame->buffer, input_width*input_height*3/2);
+ ALOGV("dnr_buffer memcpy completed.");
+ }
+ ALOGV("[DNR] DNR Processing Start.... %d * %d\n", mPictureWidth, mPictureHeight);
+ ret = NO_ERROR;
+ if (mHalCamCtrl->LINK_morpho_DNR_ProcessFrame)
+ ret = (int)mHalCamCtrl->LINK_morpho_DNR_ProcessFrame(dnr_buffer, mPictureWidth, mPictureHeight, 1, 1); //bright->normal->dark
+ ALOGV("[DNR] DNR Processing result.... ret = %d\n", ret);
+ memcpy((uint8_t *)recvd_frame->snapshot.main.frame->buffer, (uint8_t *)dnr_buffer, mPictureWidth*mPictureHeight*3/2);
+ ALOGV("[DNR] DNR Processing END....\n");
+ if(dnr_buffer)
+ free(dnr_buffer);
+ }
//mStopCallbackLock.lock();
// only in ZSL mode and Wavelet Denoise is enabled, we will send frame to deamon to do WDN
diff --git a/camera/QCamera_Intf.h b/camera/QCamera_Intf.h
index d7514e2..13ecc63 100644
--- a/camera/QCamera_Intf.h
+++ b/camera/QCamera_Intf.h
@@ -470,6 +470,7 @@
#ifdef FAST_AF
MM_CAMERA_PARM_CAF_TYPE,
#endif
+ MM_CAMERA_PARM_LUX_IDX,
MM_CAMERA_PARM_MAX
} mm_camera_parm_type_t;
@@ -619,6 +620,7 @@
#ifdef FAST_AF
CAMERA_SET_PARM_CAF_TYPE,
#endif
+ CAMERA_GET_PARM_LUX_IDX,
CAMERA_CTRL_PARM_MAX
} cam_ctrl_type;
diff --git a/camera/hdr/include/morpho_api.h b/camera/hdr/include/morpho_api.h
new file mode 100644
index 0000000..565e29f
--- /dev/null
+++ b/camera/hdr/include/morpho_api.h
@@ -0,0 +1,23 @@
+/**
+ * @file morpho_api.h
+ * @brief APIÖè`Ì}N
+ * @version 1.0.0
+ * @date Tue Sep 21 17:37:35 2010
+ *
+ * Copyright (C) 2006-2012 Morpho, Inc.
+ */
+
+#ifndef MORPHO_API_H
+#define MORPHO_API_H
+
+/**
+ * APIÖðè`·éÆ«Égp.
+ * WindowsÅDLLð쬷éÛÉ«·¦é±ÆÅØèÖ¦Â\
+ */
+#if defined(MORPHO_DLL) && defined(_WIN32)
+#define MORPHO_API(type) __declspec(dllexport) extern type
+#else
+#define MORPHO_API(type) extern type
+#endif
+
+#endif /* #ifndef MORPHO_API_H */
diff --git a/camera/hdr/include/morpho_easy_hdr.h b/camera/hdr/include/morpho_easy_hdr.h
new file mode 100644
index 0000000..a941762
--- /dev/null
+++ b/camera/hdr/include/morpho_easy_hdr.h
@@ -0,0 +1,769 @@
+/*******************************************************************
+ * morpho_easy_hdr.h
+ * [CP932/CRLF] { »û®©®»èp }
+ *------------------------------------------------------------------
+ * Copyright (C) 2010-2012 Morpho,Inc.
+ *******************************************************************/
+
+#ifndef MORPHO_EASY_HDR_H
+#define MORPHO_EASY_HDR_H
+
+/*******************************************************************/
+
+#include "morpho_api.h"
+#include "morpho_error.h"
+#include "morpho_image_data.h"
+#include "morpho_rect_int.h"
+
+/*******************************************************************/
+
+#define MORPHO_EASY_HDR_VER "Morpho EasyHDR Ver.2.0.1 2012/07/18"
+
+/*-----------------------------------------------------------------*/
+
+/* (input-limitaion) */
+
+#define MORPHO_EASY_HDR_MIN_IMAGE_WIDTH 100
+#define MORPHO_EASY_HDR_MAX_IMAGE_WIDTH 8192
+#define MORPHO_EASY_HDR_MIN_IMAGE_HEIGHT 100
+#define MORPHO_EASY_HDR_MAX_IMAGE_HEIGHT 8192
+#define MORPHO_EASY_HDR_MIN_NIMAGES 2
+#define MORPHO_EASY_HDR_MAX_NIMAGES 10
+
+/*-----------------------------------------------------------------*/
+
+/* (parameter) */
+
+#define MORPHO_EASY_HDR_DISABLED 0
+#define MORPHO_EASY_HDR_ENABLED 1
+
+#define MORPHO_EASY_HDR_IMAGE_ALIGNMENT_DEFAULT MORPHO_EASY_HDR_ENABLED
+
+#define MORPHO_EASY_HDR_GHOST_REMOVAL_DEFAULT MORPHO_EASY_HDR_ENABLED
+
+#define MORPHO_EASY_HDR_AUTO_SCALING_DEFAULT MORPHO_EASY_HDR_ENABLED
+
+#define MORPHO_EASY_HDR_FACE_DETECTION_DEFAULT MORPHO_EASY_HDR_ENABLED
+
+#define MORPHO_EASY_HDR_FAIL_SOFT_MERGING_DEFAULT MORPHO_EASY_HDR_ENABLED
+
+#define MORPHO_EASY_HDR_GHOST_DETECTION_SENSITIVITY_LEVEL_MIN 0
+#define MORPHO_EASY_HDR_GHOST_DETECTION_SENSITIVITY_LEVEL_MAX 10
+#define MORPHO_EASY_HDR_GHOST_DETECTION_SENSITIVITY_LEVEL_DEFAULT 7
+
+#define MORPHO_EASY_HDR_MERGE_SMOOTHNESS_LEVEL_MIN 0
+#define MORPHO_EASY_HDR_MERGE_SMOOTHNESS_LEVEL_MAX 10
+#define MORPHO_EASY_HDR_MERGE_SMOOTHNESS_LEVEL_DEFAULT 6
+
+#define MORPHO_EASY_HDR_MERGE_PARAM_MIN 0
+#define MORPHO_EASY_HDR_MERGE_PARAM_MAX 255
+#define MORPHO_EASY_HDR_MERGE_PARAM1_DEFAULT 0
+#define MORPHO_EASY_HDR_MERGE_PARAM2_DEFAULT 128
+#define MORPHO_EASY_HDR_MERGE_PARAM3_DEFAULT 0
+#define MORPHO_EASY_HDR_MERGE_PARAM4_DEFAULT 255
+
+#define MORPHO_EASY_HDR_RELIABLE_RECT_RATE_THRESHOLD_MIN 0
+#define MORPHO_EASY_HDR_RELIABLE_RECT_RATE_THRESHOLD_MAX 100
+#define MORPHO_EASY_HDR_RELIABLE_RECT_RATE_THRESHOLD_DEFAULT 80
+
+#define MORPHO_EASY_HDR_GHOST_RATE_THRESHOLD_MIN 0
+#define MORPHO_EASY_HDR_GHOST_RATE_THRESHOLD_MAX 100
+#define MORPHO_EASY_HDR_GHOST_RATE_THRESHOLD_DEFAULT 90
+
+#define MORPHO_EASY_HDR_CC_OFFSET_MIN 0
+#define MORPHO_EASY_HDR_CC_OFFSET_MAX 255
+#define MORPHO_EASY_HDR_CC_Y_OFFSET_DEFAULT 0
+#define MORPHO_EASY_HDR_CC_C_OFFSET_DEFAULT 0
+
+#define MORPHO_EASY_HDR_CC_GAIN_MIN 100
+#define MORPHO_EASY_HDR_CC_GAIN_MAX 2000
+#define MORPHO_EASY_HDR_CC_Y_GAIN_DEFAULT 1000
+#define MORPHO_EASY_HDR_CC_C_GAIN_DEFAULT 1000
+
+#define MORPHO_EASY_HDR_CC_GAMMA_MIN 100
+#define MORPHO_EASY_HDR_CC_GAMMA_MAX 2000
+#define MORPHO_EASY_HDR_CC_Y_GAMMA_DEFAULT 1000
+#define MORPHO_EASY_HDR_CC_C_GAMMA_DEFAULT 1000
+
+/*-----------------------------------------------------------------*/
+
+/* (merge-status) */
+
+#define MORPHO_EASY_HDR_OK 0x00000000
+#define MORPHO_EASY_HDR_ERROR_IMAGE_ALIGNMENT_FAILURE 0x00000001
+#define MORPHO_EASY_HDR_ERROR_EXP_ESTIMATION_FAILURE 0x00000002
+#define MORPHO_EASY_HDR_ERROR_MOSTLY_GHOST 0x00000004
+#define MORPHO_EASY_HDR_ERROR_INTERNAL 0x80000000
+
+/*******************************************************************/
+
+typedef struct _morpho_EasyHDR morpho_EasyHDR;
+typedef struct _morpho_EasyHDR_Callback morpho_EasyHDR_Callback;
+
+/*-----------------------------------------------------------------*/
+
+/** EasyHDR */
+struct _morpho_EasyHDR
+{
+ void *p; /**< à\¢ÌÖÌ|C^ */
+};
+
+/** EasyHDR Callback (for multi-thread processing) */
+struct _morpho_EasyHDR_Callback
+{
+ void *p; /**< R[obNÖÌæêøƵÄn³êél */
+
+ void * (* thread_create )(void *p, int index, void *(*start_routine)(void *arg), void *arg);
+ int (* thread_destroy)(void *p, void *thread);
+ int (* thread_join )(void *p, void *thread, void **value_ptr);
+
+ void * (* mutex_create )(void *p);
+ int (* mutex_destroy)(void *p, void *mutex);
+ int (* mutex_lock )(void *p, void *mutex);
+ int (* mutex_trylock)(void *p, void *mutex);
+ int (* mutex_unlock )(void *p, void *mutex);
+
+ void * (* cond_create )(void *p);
+ int (* cond_destroy )(void *p, void *cond);
+ int (* cond_wait )(void *p, void *cond, void *lock);
+ int (* cond_signal )(void *p, void *cond);
+ int (* cond_broadcast)(void *p, void *cond);
+};
+
+/*******************************************************************/
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/*-----------------------------------------------------------------*/
+
+/**
+ * o[W¶ñðæ¾
+ *
+ * @return o[W¶ñ(MORPHO_EASY_HDR_VER)
+ */
+MORPHO_API(char const *)
+morpho_EasyHDR_getVersion(void);
+
+/*-----------------------------------------------------------------*/
+
+/**
+ * KvÈTCYðæ¾
+ *
+ * @param[in] max_width üÍæÌÅå
+ * @param[in] max_height üÍæÌÅå³
+ * @param[in] format ætH[}bg¶ñ
+ *
+ * @return KvÈTCY(byte)
+ */
+MORPHO_API(int)
+morpho_EasyHDR_getBufferSize(
+ int max_width,
+ int max_height,
+ char const *format);
+
+/**
+ * ú»
+ *
+ * gpXbhÉ0ȺÌlðÝèµ½êA
+ * ªÀsðs¤B
+ *
+ * gpXbhÉ1ÈãÌlðÝèµ½êA
+ * êÀsðs¤B
+ *
+ * gpXbhÉ2ÈãÌlðÝèµ½êA
+ * }`XbhÉæéÀñÀs(êÀs)ðs¤B
+ * callback ÉKØÈlðÝè·éKv èB
+ *
+ * yÀsóÔÌJÚz
+ * ?_UNKNOWN ¨ 0_INITIALIZED
+ *
+ * @param[in,out] p EasyHDR CX^X
+ * @param[out] buffer EasyHDRÉèÄéÖÌ|C^
+ * @param[in] buffer_size EasyHDRÉèÄéÌTCY
+ * @param[in] nthreads gpXbh (RA)
+ * @param[in] callback R[obNÖQ
+ *
+ * @return G[R[h (see morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_EasyHDR_initialize(
+ morpho_EasyHDR *p,
+ void *buffer,
+ int buffer_size,
+ int nthreads,
+ morpho_EasyHDR_Callback const *callback);
+
+/**
+ * N[Abv
+ * initialize() ÀsãÉÀsÂ\
+ *
+ * @param[in,out] p EasyHDR CX^X
+ *
+ * @return G[R[h (see morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_EasyHDR_finalize(
+ morpho_EasyHDR *p);
+
+/*-----------------------------------------------------------------*/
+
+/**
+ * ¬ÌJnEÀs
+ * setImageFormat() ÀsãÉÀsÂ\
+ *
+ * yÀsóÔÌJÚ (êÀs)z
+ * 0_INITIALIZED ¨ (1_PROCESSING) ¨ 0_INITIALIZED (®¹)
+ * ¨ 2_SUSPENDED (suspend()ÄÑoµ)
+ *
+ * yÀsóÔÌJÚ (ªÀs)z
+ * 0_INITIALIZED ¨ 3_PAUSED ()
+ * ¨ 0_INITIALIZED (®¹)
+ *
+ * @param[in,out] p EasyHDR CX^X
+ * @param[out] output_image Êæ (u1ÚvÌüÍæðwèÂ\)
+ * @param[in,out] input_images üÍæQ (GWÉæÁÄ«·¦çêé)
+ * @param[in] nimages üÍæÌ
+ *
+ * @return G[R[h (see morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_EasyHDR_merge(
+ morpho_EasyHDR *p,
+ morpho_ImageData *output_image,
+ morpho_ImageData *input_images[],
+ int nimages);
+
+/*-----------------------------------------------------------------*/
+
+/**
+ * ¬Ìp±Às
+ *
+ * merge() ÀsãÉÀsÂ\
+ *
+ * ªÀs(initialize() Å nthreads É 0 ðw赽ƫ)ÌÝLø
+ *
+ * yÀsóÔÌJÚ (ªÀs)z
+ * 3_PAUSED ¨ 3_PAUSED ()
+ * ¨ 0_INITIALIZED (®¹)
+ *
+ * @param[in,out] p EasyHDR CX^X
+ *
+ * @return G[R[h (see morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_EasyHDR_process(
+ morpho_EasyHDR *p);
+
+/*-----------------------------------------------------------------*/
+
+/**
+ * ¬Ìf (ÊReLXg©çÌÄÑoµÉæé)
+ * merge() ÀsÉÀsÂ\
+ *
+ * yÀsóÔÌJÚ (êÀs)z
+ * 1_PROCESSING ¨ 2_SUSPENDED
+ *
+ * @param[in,out] p EasyHDR CX^X
+ *
+ * @return G[R[h (see morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_EasyHDR_suspend(
+ morpho_EasyHDR *p);
+
+/**
+ * ¬ÌÄJ
+ * suspend() ÀsãÉÀsÂ\
+ *
+ * yÀsóÔÌJÚ (êÀs)z
+ * 2_SUSPENDED ¨ (1_PROCESSING) ¨ 0_INITIALIZED (®¹)
+ * ¨ 2_SUSPENDED (suspend()ÄÑoµ)
+ *
+ * @param[in,out] p EasyHDR CX^X
+ *
+ * @return G[R[h (see morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_EasyHDR_resume(
+ morpho_EasyHDR *p);
+
+/*-----------------------------------------------------------------*/
+
+/**
+ * ætH[}bgÌÝè
+ * initialize() ÀsãÉÀsÂ\
+ *
+ * @param[in,out] p EasyHDR CX^X
+ * @param[in] format ætH[}bgð çí·¶ñ
+ *
+ * @return G[R[h (see morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_EasyHDR_setImageFormat(
+ morpho_EasyHDR *p,
+ char const *format);
+
+/**
+ * ætH[}bgÌæ¾
+ * setImageFormat() ÀsãÉÀsÂ\
+ *
+ * @param[in,out] p EasyHDR CX^X
+ * @param[out] buffer ætH[}bgð çí·¶ñªi[³êéobt@
+ * @param[in] buffer_size obt@ÌTCY(I[¶ÜÞ)
+ *
+ * @return G[R[h (see morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_EasyHDR_getImageFormat(
+ morpho_EasyHDR *p,
+ char *buffer,
+ int buffer_size);
+
+/*-----------------------------------------------------------------*/
+
+/**
+ * Êuí¹(èÔêâ³)ÌL³ÌÝè
+ * initialize() ÀsãÉÀsÂ\
+ *
+ * value:
+ * MOR_EASY_HDR_ENABLED : Êuí¹ è
+ * MOR_EASY_HDR_DISABLED : Êuí¹Èµ
+ *
+ * @param[in,out] p EasyHDR CX^X
+ * @param[in] value Ýèl
+ *
+ * @return G[R[h (see morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_EasyHDR_setImageAlignmentStatus(
+ morpho_EasyHDR *p,
+ int value);
+
+/**
+ * Êuí¹(èÔêâ³)ÌL³Ìæ¾
+ * initialize() ÀsãÉÀsÂ\
+ *
+ * @param[in,out] p EasyHDR CX^X
+ * @param[out] value Ýèli[æ
+ *
+ * @return G[R[h (see morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_EasyHDR_getImageAlignmentStatus(
+ morpho_EasyHDR *p,
+ int *value);
+
+/*-----------------------------------------------------------------*/
+
+/**
+ * S[Xg(íÊÌÔêâ³)ÌL³ÌÝè
+ * initialize() ÀsãÉÀsÂ\
+ *
+ * value:
+ * MOR_EASY_HDR_ENABLED : S[Xg è
+ * MOR_EASY_HDR_DISABLED : S[Xgȵ
+ *
+ * @param[in,out] p EasyHDR CX^X
+ * @param[in] value Ýèl
+ *
+ * @return G[R[h (see morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_EasyHDR_setGhostRemovalStatus(
+ morpho_EasyHDR *p,
+ int value);
+
+/**
+ * S[Xg(íÊÌÔêâ³)ÌL³Ìæ¾
+ * initialize() ÀsãÉÀsÂ\
+ *
+ * @param[in,out] p EasyHDR CX^X
+ * @param[out] value Ýèli[æ
+ *
+ * @return G[R[h (see morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_EasyHDR_getGhostRemovalStatus(
+ morpho_EasyHDR *p,
+ int *value);
+
+/*-----------------------------------------------------------------*/
+
+/**
+ * ©®gå(NbsO)ÌL³ÌÝè
+ * initialize() ÀsãÉÀsÂ\
+ *
+ * value:
+ * MOR_EASY_HDR_ENABLED : ©®gå è
+ * MOR_EASY_HDR_DISABLED : ©®gåȵ
+ *
+ * @param[in,out] p EasyHDR CX^X
+ * @param[in] value Ýèl
+ *
+ * @return G[R[h (see morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_EasyHDR_setAutoScalingStatus(
+ morpho_EasyHDR *p,
+ int value);
+
+/**
+ * ©®gå(NbsO)ÌL³Ìæ¾
+ * initialize() ÀsãÉÀsÂ\
+ *
+ * @param[in,out] p EasyHDR CX^X
+ * @param[out] value Ýèli[æ
+ *
+ * @return G[R[h (see morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_EasyHDR_getAutoScalingStatus(
+ morpho_EasyHDR *p,
+ int *value);
+
+/*-----------------------------------------------------------------*/
+
+/**
+ * çoâ³ÌL³ÌÝè
+ * initialize() ÀsãÉÀsÂ\
+ *
+ * value:
+ * MOR_EASY_HDR_ENABLED : çoâ³ è
+ * MOR_EASY_HDR_DISABLED : çoâ³Èµ
+ *
+ * @param[in,out] p EasyHDR CX^X
+ * @param[in] value Ýèl
+ *
+ * @return G[R[h (see morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_EasyHDR_setFaceDetectionStatus(
+ morpho_EasyHDR *p,
+ int value);
+
+/**
+ * çoâ³ÌL³Ìæ¾
+ * initialize() ÀsãÉÀsÂ\
+ *
+ * @param[in,out] p EasyHDR CX^X
+ * @param[out] value Ýèli[æ
+ *
+ * @return G[R[h (see morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_EasyHDR_getFaceDetectionStatus(
+ morpho_EasyHDR *p,
+ int *value);
+
+/*-----------------------------------------------------------------*/
+
+/**
+ * Fail-soft-merging ÌL³ÌÝè
+ * initialize() ÀsãÉÀsÂ\
+ *
+ * value:
+ * MOR_EASY_HDR_ENABLED : Fail-soft-merging è
+ * MOR_EASY_HDR_DISABLED : Fail-soft-merging ȵ
+ *
+ * @param[in,out] p EasyHDR CX^X
+ * @param[in] value Ýèl
+ *
+ * @return G[R[h (see morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_EasyHDR_setFailSoftMergingStatus(
+ morpho_EasyHDR *p,
+ int value);
+
+/**
+ * Fail-soft-merging ÌL³Ìæ¾
+ * initialize() ÀsãÉÀsÂ\
+ *
+ * @param[in,out] p EasyHDR CX^X
+ * @param[out] value Ýèli[æ
+ *
+ * @return G[R[h (see morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_EasyHDR_getFailSoftMergingStatus(
+ morpho_EasyHDR *p,
+ int *value);
+
+/*-----------------------------------------------------------------*/
+
+/**
+ * S[Xg»è´xxÌÝè
+ * initialize() ÀsãÉÀsÂ\
+ *
+ * @param[in,out] p EasyHDR CX^X
+ * @param[in] value Ýèl
+ *
+ * @return G[R[h (see morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_EasyHDR_setGhostDetectionSensitivityLevel(
+ morpho_EasyHDR *p,
+ int value);
+
+/**
+ * S[Xg»è´xxÌæ¾
+ * initialize() ÀsãÉÀsÂ\
+ *
+ * @param[in,out] p EasyHDR CX^X
+ * @param[out] value Ýèli[æ
+ *
+ * @return G[R[h (see morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_EasyHDR_getGhostDetectionSensitivityLevel(
+ morpho_EasyHDR *p,
+ int *value);
+
+/*-----------------------------------------------------------------*/
+
+/**
+ * ¬Èß穳ÌÝè
+ * initialize() ÀsãÉÀsÂ\
+ *
+ * @param[in,out] p EasyHDR CX^X
+ * @param[in] value Ýèl
+ *
+ * @return G[R[h (see morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_EasyHDR_setMergeSmoothnessLevel(
+ morpho_EasyHDR *p,
+ int value);
+
+/**
+ * ¬Èß穳Ìæ¾
+ * initialize() ÀsãÉÀsÂ\
+ *
+ * @param[in,out] p EasyHDR CX^X
+ * @param[out] value Ýèli[æ
+ *
+ * @return G[R[h (see morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_EasyHDR_getMergeSmoothnessLevel(
+ morpho_EasyHDR *p,
+ int *value);
+
+/*-----------------------------------------------------------------*/
+
+/**
+ * ¬p[^ÌÝè
+ * initialize() ÀsãÉÀsÂ\
+ *
+ * @param[in,out] p EasyHDR CX^X
+ * @param[in] value1 Ýèl
+ * @param[in] value2 Ýèl
+ * @param[in] value3 Ýèl
+ * @param[in] value4 Ýèl
+ *
+ * @return G[R[h (see morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_EasyHDR_setMergeParameters(
+ morpho_EasyHDR *p,
+ int value1,
+ int value2,
+ int value3,
+ int value4);
+
+/**
+ * ¬p[^Ìæ¾
+ * initialize() ÀsãÉÀsÂ\
+ *
+ * @param[in,out] p EasyHDR CX^X
+ * @param[out] value1 Ýèli[æ
+ * @param[out] value2 Ýèli[æ
+ * @param[out] value3 Ýèli[æ
+ * @param[out] value4 Ýèli[æ
+ *
+ * @return G[R[h (see morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_EasyHDR_getMergeParameters(
+ morpho_EasyHDR *p,
+ int *value1,
+ int *value2,
+ int *value3,
+ int *value4);
+
+/*-----------------------------------------------------------------*/
+
+/**
+ * LøÌæèlÌÝè
+ * initialize() ÀsãÉÀsÂ\
+ *
+ * @param[in,out] p EasyHDR CX^X
+ * @param[in] rate Ýèl ( rate % é`)
+ *
+ * @return G[R[h (see morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_EasyHDR_setReliableRectRateThreshold(
+ morpho_EasyHDR *p,
+ int rate);
+
+/**
+ * LøÌæèlÌæ¾
+ * initialize() ÀsãÉÀsÂ\
+ *
+ * @param[in,out] p EasyHDR CX^X
+ * @param[out] rate Ýèli[æ
+ *
+ * @return G[R[h (see morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_EasyHDR_getReliableRectRateThreshold(
+ morpho_EasyHDR *p,
+ int *rate);
+
+/**
+ * LøÌæÌæ¾
+ * initialize() ÀsãÉÀsÂ\
+ * (LøÈlªZbg³êéÌÍ merge() ã)
+ *
+ * @param[in,out] p EasyHDR CX^X
+ * @param[out] rect Ýèli[æ
+ *
+ * @return G[R[h (see morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_EasyHDR_getReliableRect(
+ morpho_EasyHDR *p,
+ morpho_RectInt *rect);
+
+/*-----------------------------------------------------------------*/
+
+/**
+ * S[XgèlÌÝè
+ * initialize() ÀsãÉÀsÂ\
+ *
+ * @param[in,out] p EasyHDR CX^X
+ * @param[in] rate Ýèl
+ *
+ * @return G[R[h (see morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_EasyHDR_setGhostRateThreshold(
+ morpho_EasyHDR *p,
+ int rate);
+
+/**
+ * S[XgèlÌæ¾
+ * initialize() ÀsãÉÀsÂ\
+ *
+ * @param[in,out] p EasyHDR CX^X
+ * @param[out] rate Ýèli[æ
+ *
+ * @return G[R[h (see morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_EasyHDR_getGhostRateThreshold(
+ morpho_EasyHDR *p,
+ int *rate);
+
+/*-----------------------------------------------------------------*/
+
+/**
+ * Fâ³p[^ÌÝè
+ * initialize() ÀsãÉÀsÂ\
+ *
+ * @param[in,out] p EasyHDR CX^X
+ * @param[in] y_offset Ýèl
+ * @param[in] y_gain Ýèl
+ * @param[in] y_gamma Ýèl
+ * @param[in] c_offset Ýèl
+ * @param[in] c_gain Ýèl
+ * @param[in] c_gamma Ýèl
+ *
+ * @return G[R[h (see morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_EasyHDR_setColorCorrectionParameters(
+ morpho_EasyHDR *p,
+ int y_offset,
+ int y_gain,
+ int y_gamma,
+ int c_offset,
+ int c_gain,
+ int c_gamma);
+
+/**
+ * Fâ³p[^Ìæ¾
+ * initialize() ÀsãÉÀsÂ\
+ *
+ * @param[in,out] p EasyHDR CX^X
+ * @param[out] y_offset Ýèli[æ
+ * @param[out] y_gain Ýèli[æ
+ * @param[out] y_gamma Ýèli[æ
+ * @param[out] c_offset Ýèli[æ
+ * @param[out] c_gain Ýèli[æ
+ * @param[out] c_gamma Ýèli[æ
+ *
+ * @return G[R[h (see morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_EasyHDR_getColorCorrectionParameters(
+ morpho_EasyHDR *p,
+ int *y_offset,
+ int *y_gain,
+ int *y_gamma,
+ int *c_offset,
+ int *c_gain,
+ int *c_gamma);
+
+/*-----------------------------------------------------------------*/
+
+/**
+ * ¬Xe[^XÌæ¾
+ * initialize() ÀsãÉÀsÂ\
+ *
+ * Xe[^XR[h
+ * MORPHO_EASY_HDR_OK
+ * MORPHO_EASY_HDR_ERROR_*
+ *
+ * @param[in,out] p EasyHDR CX^X
+ *
+ * @return Xe[^XR[h (MORPHO_EASMORPHO_EASY_HDR_ERROR_
+ */
+MORPHO_API(int)
+morpho_EasyHDR_getMergeStatus(
+ morpho_EasyHDR *p);
+
+/*-----------------------------------------------------------------*/
+
+/**
+ * TlCÌì¬ (oÍæÌk¬)
+ * morpho_EasyHDR_setImageFormat() ÀsãÉÀsÂ\
+ *
+ * @param[in,out] p EasyHDR CX^X
+ * @param[out] thumbnail_image oÍæ
+ * @param[in] output_image üÍæ
+ *
+ * @return G[R[h (see morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_EasyHDR_makeThumbnail(
+ morpho_EasyHDR *p,
+ morpho_ImageData *thumbnail_image,
+ morpho_ImageData const *output_image);
+
+/*-----------------------------------------------------------------*/
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+/*******************************************************************/
+
+#endif /* !MORPHO_EASY_HDR_H */
+
+/*******************************************************************/
+/* [EOF] */
diff --git a/camera/hdr/include/morpho_easy_hdr_ext.h b/camera/hdr/include/morpho_easy_hdr_ext.h
new file mode 100644
index 0000000..2a4bd7c
--- /dev/null
+++ b/camera/hdr/include/morpho_easy_hdr_ext.h
@@ -0,0 +1,19 @@
+#ifndef MORPHO_EASY_HDR_EXT_H
+#define MORPHO_EASY_HDR_EXT_H
+
+#include "morpho_easy_hdr.h"
+/*
+return == 0 : OK
+return != 0 : NG (Please print the return value to check Error types)
+*/
+MORPHO_API(int)
+LINK_mm_camera_HDR(
+ unsigned char* yuvInput01,
+ unsigned char* yuvInput02,
+ unsigned char* yuvInput03,
+ unsigned char* pHDROutImage,
+ int width,
+ int height,
+ int indoor);
+
+#endif //MORPHO_EASY_HDR_EXT_H
diff --git a/camera/hdr/include/morpho_error.h b/camera/hdr/include/morpho_error.h
new file mode 100644
index 0000000..148216f
--- /dev/null
+++ b/camera/hdr/include/morpho_error.h
@@ -0,0 +1,29 @@
+/**
+ * @file morpho_error.h
+ * @brief G[R[hÌè`
+ * @version 1.0.0
+ * @date 2008-06-09
+ *
+ * Copyright (C) 2006-2012 Morpho, Inc.
+ */
+
+#ifndef MORPHO_ERROR_H
+#define MORPHO_ERROR_H
+
+/** G[R[h .*/
+#define MORPHO_OK (0x00000000) /**< ¬÷ */
+#define MORPHO_DOPROCESS (0x00000001) /**< */
+#define MORPHO_CANCELED (0x00000002) /**< LZ³ê½ */
+#define MORPHO_SUSPENDED (0x00000008) /**< f³ê½ */
+
+#define MORPHO_ERROR_GENERAL_ERROR (0x80000000) /**< êÊIÈG[. */
+#define MORPHO_ERROR_PARAM (0x80000001) /**< øªs³. */
+#define MORPHO_ERROR_STATE (0x80000002) /**< àóÔâÖÄoªs³. */
+#define MORPHO_ERROR_MALLOC (0x80000004) /**< AP[VG[. */
+#define MORPHO_ERROR_IO (0x80000008) /**< üoÍG[. */
+#define MORPHO_ERROR_UNSUPPORTED (0x80000010) /**< @\ðT|[gµÄ¢È¢. */
+#define MORPHO_ERROR_NOTFOUND (0x80000020) /**< õÎÛª©Â©çÈ¢ */
+#define MORPHO_ERROR_INTERNAL (0x80000040) /**< àG[. */
+#define MORPHO_ERROR_UNKNOWN (0xC0000000) /**< ãLÈOÌG[. */
+
+#endif /* #ifndef MORPHO_ERROR_H */
diff --git a/camera/hdr/include/morpho_get_image_size.h b/camera/hdr/include/morpho_get_image_size.h
new file mode 100644
index 0000000..b0f538f
--- /dev/null
+++ b/camera/hdr/include/morpho_get_image_size.h
@@ -0,0 +1,89 @@
+/**
+ * @file morpho_get_image_size.h
+ * @brief æÉKvÈTCYðæ¾·éÖ
+ * @version 1.0.0
+ * @date 2008-07-01
+ *
+ * Copyright (C) 2006-2012 Morpho, Inc.
+ */
+
+#ifndef MORPHO_GET_IMAGE_SIZE_H
+#define MORPHO_GET_IMAGE_SIZE_H
+
+#include "morpho_api.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * ƳÆtH[}bg¼©çAæði[·éÌÉKvÈTCYð¾é.
+ *
+ * @param width
+ * @param height ³
+ * @param p_format ætH[}bg¶ñ
+ * @return æÉKvÈTCY
+ */
+#define morpho_getImageSize mor_noise_reduction_IF_getImageSize
+
+MORPHO_API(int)
+morpho_getImageSize(int width, int height, const char *p_format);
+
+/**
+ * Yæf[^TCYðæ¾.
+ *
+ * @param width
+ * @param height ³
+ * @param p_format ætH[}bg¶ñ
+ * @return Yæf[^TCY
+ */
+#define morpho_getImageSizeY mor_noise_reduction_IF_getImageSizeY
+
+MORPHO_API(int)
+morpho_getImageSizeY(int width, int height, const char *p_format);
+
+/**
+ * Uæf[^TCYðæ¾.
+ *
+ * @param width
+ * @param height ³
+ * @param p_format ætH[}bg¶ñ
+ * @return Uæf[^TCY
+ */
+#define morpho_getImageSizeU mor_noise_reduction_IF_getImageSizeU
+
+MORPHO_API(int)
+morpho_getImageSizeU(int width, int height, const char *p_format);
+
+/**
+ * Væf[^TCYðæ¾.
+ *
+ * @param width
+ * @param height ³
+ * @param p_format ætH[}bg¶ñ
+ * @return Væf[^TCY
+ */
+#define morpho_getImageSizeV mor_noise_reduction_IF_getImageSizeV
+
+MORPHO_API(int)
+morpho_getImageSizeV(int width, int height, const char *p_format);
+
+/**
+ * UVæf[^TCYðæ¾.
+ *
+ * @param width
+ * @param height ³
+ * @param p_format ætH[}bg¶ñ
+ * @return UVæf[^TCY
+ */
+#define morpho_getImageSizeUV mor_noise_reduction_IF_getImageSizeUV
+
+MORPHO_API(int)
+morpho_getImageSizeUV(int width, int height, const char *p_format);
+
+
+#ifdef __cplusplus
+} /* extern "C" { */
+#endif
+
+#endif /* MORPHO_GET_IMAGE_SIZE_H */
diff --git a/camera/hdr/include/morpho_hdr_checker.h b/camera/hdr/include/morpho_hdr_checker.h
new file mode 100644
index 0000000..662cfc1
--- /dev/null
+++ b/camera/hdr/include/morpho_hdr_checker.h
@@ -0,0 +1,155 @@
+/*******************************************************************
+ * morpho_hdr_checker.h
+ * [CP932/CRLF] { »û®©®»èp }
+ *------------------------------------------------------------------
+ * Copyright (C) 2011-2012 Morpho,Inc.
+ *******************************************************************/
+
+#ifndef MORPHO_HDR_CHECKER_H
+#define MORPHO_HDR_CHECKER_H
+
+/*******************************************************************/
+
+#include "morpho_api.h"
+#include "morpho_error.h"
+#include "morpho_image_data.h"
+
+/*******************************************************************/
+
+#define MORPHO_HDR_CHECKER_VER "Morpho DR Checker Ver.1.1.0 2012/1/17"
+
+/*-----------------------------------------------------------------*/
+
+#define MORPHO_HDR_CHECKER_MIN_IMAGE_WIDTH 2
+#define MORPHO_HDR_CHECKER_MAX_IMAGE_WIDTH 8192
+#define MORPHO_HDR_CHECKER_MIN_IMAGE_HEIGHT 2
+#define MORPHO_HDR_CHECKER_MAX_IMAGE_HEIGHT 8192
+
+/*******************************************************************/
+
+typedef struct _morpho_HDRChecker morpho_HDRChecker;
+
+/* HDRwW]¿í */
+struct _morpho_HDRChecker
+{
+ void *p; /**< à\¢ÌÖÌ|C^ */
+};
+
+/* òÑEÂÔê»èÌq´x */
+typedef enum {
+ MORPHO_HDR_CHECKER_SENSITIVITY_SENSITIVE,
+ MORPHO_HDR_CHECKER_SENSITIVITY_NORMAL,
+ MORPHO_HDR_CHECKER_SENSITIVITY_INSENSITIVE,
+} MORPHO_HDR_CHECKER_SENSITIVITY;
+
+/*******************************************************************/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * o[W¶ñðæ¾
+ *
+ * @return o[W¶ñ(MORPHO_EASY_HDR_VER)
+ */
+MORPHO_API(const char*)
+morpho_HDRChecker_getVersion(void);
+
+/**
+ * KvÈTCYðæ¾
+ *
+ * @param[in] width üÍæÌ
+ * @param[in] height üÍæ̳
+ * @param[in] format üÍæÌtH[}bg
+ * @return KvÈTCY(byte)
+ */
+MORPHO_API(int)
+morpho_HDRChecker_getBufferSize(
+ int width,
+ int height,
+ const char *format);
+
+/**
+ * ú»
+ *
+ * @param[in,out] p HDRCheckerCX^X
+ * @param[in] buffer HDRCheckerÉèÄéÖÌ|C^
+ * @param[in] buffer_size HDRCheckerÉèÄéÌTCY
+ * @param[in] width üÍæÌ
+ * @param[in] height üÍæ̳
+ * @param[in] format üÍæÌtH[}bg
+ * @return G[R[h (see morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_HDRChecker_initialize(
+ morpho_HDRChecker * const p,
+ void * const buffer,
+ const int buffer_size,
+ const int width,
+ const int height,
+ const char *format);
+
+/**
+ * N[Abv
+ * initialize()ÀsãÉÀsÂ\
+ *
+ * @param[in,out] p HDRCheckerCX^X
+ * @return G[R[h (see morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_HDRChecker_finalize(
+ morpho_HDRChecker *p);
+
+/*-----------------------------------------------------------------*/
+
+/**
+ * HDRwWvZÌq´«ÌÝè
+ * initialize()ÀsãÉÀsÂ\
+ *
+ * @param[in,out] p HDRCheckerCX^X
+ * @param[in] sensitivity q´«(MORPHO_HDR_CHECKER_SENSITIVIYñÌÅwè)
+ * @return G[R[h (see morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_HDRChecker_setSensitivity(
+ morpho_HDRChecker * const p,
+ MORPHO_HDR_CHECKER_SENSITIVITY sensitivity);
+
+/**
+ * HDRwWvZÌq´«Ìæ¾
+ * initialize()ÀsãÉÀsÂ\
+ *
+ * @param[in,out] p HDRCheckerCX^X
+ * @param[out] sensitivity q´«ÖÌ|C^
+ * @return G[R[h (see morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_HDRChecker_getSensitivity(
+ morpho_HDRChecker * const p,
+ MORPHO_HDR_CHECKER_SENSITIVITY *sensitivity);
+
+/**
+ * HDRwWÌ]¿
+ * initialize()ÀsãÉÀsÂ\
+ *
+ * @param[in,out] p HDRCheckerCX^X
+ * @param[out] result ]¿Êði[·ézñ(vf4Ìzñ)
+ * vfªñ[ÌêÉηéºLÌIoÌæªKvÆ»è
+ * {+2, +1, -1, -2}ÌÉ»èʪi[³êé
+ * @param[in] input_image üÍæ
+ * @return G[R[h (see morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_HDRChecker_evaluate(
+ morpho_HDRChecker * const p,
+ int * const result,
+ const morpho_ImageData * const input_image);
+
+/*-----------------------------------------------------------------*/
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* MORPHO_HDR_CHECKER_H */
diff --git a/camera/hdr/include/morpho_image_data.h b/camera/hdr/include/morpho_image_data.h
new file mode 100644
index 0000000..2fc05aa
--- /dev/null
+++ b/camera/hdr/include/morpho_image_data.h
@@ -0,0 +1,43 @@
+/**
+ * @file morpho_image_data.h
+ * @brief æf[^Ì\¢Ìè`
+ * @version 1.0.0
+ * @date 2008-06-09
+ *
+ * Copyright (C) 2006-2012 Morpho, Inc.
+ */
+
+#ifndef MORPHO_IMAGE_DATA_H
+#define MORPHO_IMAGE_DATA_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct{
+ void * y; /**< YæÌæª|C^ */
+ void * u; /**< UæÌæª|C^ */
+ void * v; /**< VæÌæª|C^ */
+} morpho_ImageYuvPlanar;
+
+typedef struct{
+ void * y; /**< YæÌæª|C^ */
+ void * uv; /**< UVæÌæª|C^ */
+} morpho_ImageYuvSemiPlanar;
+
+/** æf[^. */
+typedef struct {
+ int width; /**< */
+ int height; /**< ³ */
+ union{
+ void * p; /**< æf[^Ìæª|C^ */
+ morpho_ImageYuvPlanar planar;
+ morpho_ImageYuvSemiPlanar semi_planar;
+ } dat;
+} morpho_ImageData;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* #ifndef MORPHO_IMAGE_DATA_H */
diff --git a/camera/hdr/include/morpho_image_data_ex.h b/camera/hdr/include/morpho_image_data_ex.h
new file mode 100644
index 0000000..ef33f35
--- /dev/null
+++ b/camera/hdr/include/morpho_image_data_ex.h
@@ -0,0 +1,51 @@
+/**
+ * @file morpho_image_data_ex.h
+ * @brief 画像データの構造体定義
+ * @version 1.0.0
+ * @date 2010-03-30
+ *
+ * Copyright (C) 2010-2011 Morpho, Inc.
+ */
+
+#ifndef MORPHO_IMAGE_DATA_EX_H
+#define MORPHO_IMAGE_DATA_EX_H
+
+#include "morpho_image_data.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct{
+ int y;
+ int u;
+ int v;
+} morpho_ImageYuvPlanarPitch;
+
+typedef struct{
+ int y;
+ int uv;
+} morpho_ImageYuvSemiPlanarPitch;
+
+/** 画像データ. */
+typedef struct {
+ int width; /**< 幅 */
+ int height; /**< 高さ */
+ union{
+ void *p; /**< 画像データの先頭ポインタ */
+ morpho_ImageYuvPlanar planar;
+ morpho_ImageYuvSemiPlanar semi_planar;
+ } dat;
+ union{
+ int p; /**< ラインの先頭から次のライン先頭までのバイト数 */
+ morpho_ImageYuvPlanarPitch planar;
+ morpho_ImageYuvSemiPlanarPitch semi_planar;
+ } pitch;
+} morpho_ImageDataEx;
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* #ifndef MORPHO_IMAGE_DATA_EX_H */
diff --git a/camera/hdr/include/morpho_motion_data.h b/camera/hdr/include/morpho_motion_data.h
new file mode 100644
index 0000000..4db78db
--- /dev/null
+++ b/camera/hdr/include/morpho_motion_data.h
@@ -0,0 +1,27 @@
+/**
+ * @file morpho_motion_data.h
+ * @brief ®«f[^Ì\¢Ìè`
+ * @version 1.0.0
+ * @date 2008-06-09
+ *
+ * Copyright (C) 2006-2012 Morpho, Inc.
+ */
+
+#ifndef MORPHO_MOTION_DATA_H
+#define MORPHO_MOTION_DATA_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** ®«f[^. */
+typedef struct {
+ int v[6]; /**< ®«f[^ */
+ int fcode; /**< ¬÷:0 / ¸s:0ÈOi¸sµ½´öj */
+} morpho_MotionData;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* #ifndef MORPHO_MOTION_DATA_H */
diff --git a/camera/hdr/include/morpho_noise_reduction.h b/camera/hdr/include/morpho_noise_reduction.h
new file mode 100644
index 0000000..886c2c1
--- /dev/null
+++ b/camera/hdr/include/morpho_noise_reduction.h
@@ -0,0 +1,204 @@
+//====================================================================
+// morpho_noise_reduction.h
+// [SJIS/CRLF] { »û®©®»èp }
+//
+// Copyright(c) 2006-2012 Morpho,Inc.
+//====================================================================
+
+#ifndef MORPHO_NOISE_REDUCTION_H
+# define MORPHO_NOISE_REDUCTION_H
+
+//--------------------------------------------------------------------
+
+# include "morpho_api.h"
+# include "morpho_error.h"
+# include "morpho_image_data.h"
+# include "morpho_motion_data.h"
+# include "morpho_rect_int.h"
+
+//--------------------------------------------------------------------
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+//====================================================================
+
+/** o[W¶ñ */
+# define MORPHO_NOISE_REDUCTION_VERSION "Morpho Noise Reduction Ver.0.9.0 2012/08/09"
+
+//--------------------------------------------------------------------
+/** mCYí */
+typedef struct
+{
+ void *p; /**< à\¢ÌÖÌ|C^ */
+} morpho_NoiseReduction;
+
+//--------------------------------------------------------------------
+
+/**
+ * o[W¶ñðæ¾
+ *
+ * @return o[W¶ñ(MORPHO_IMAGE_STABILIZER_VERSION)
+ */
+MORPHO_API(const char *)
+morpho_NoiseReduction_getVersion(void);
+
+/**
+ * mCYÉKvÈTCYðæ¾
+ * wèÅ«étH[}bgÍTRMðQÆB
+ *
+ * @param[in] width üÍæÌ
+ * @param[in] height üÍæ̳
+ * @param[in] format ætH[}bg¶ñ
+ * @return KvÈTCY(byte)
+ */
+MORPHO_API(int)
+morpho_NoiseReduction_getBufferSize(
+ int width,
+ int height,
+ const char *format);
+
+/**
+ * mCYíÌú»
+ *
+ * @param[out] reducer mCYí
+ * @param[out] buffer mCYíÉèÄéÖÌ|C^
+ * @param[in] buffer_size mCYíÉèÄéÌTCY.
+ * @return G[R[h(morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_NoiseReduction_initialize(
+ morpho_NoiseReduction *reducer,
+ void *buffer,
+ int buffer_size);
+
+/**
+ * mCYíÌN[Abv
+ *
+ * @param[in,out] reducer mCYí
+ * @return G[R[h(morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_NoiseReduction_finalize(
+ morpho_NoiseReduction *reducer);
+
+/**
+ * mCY: Jn
+ * oÍæ(output_image)Í1ÚÌüÍæƯ¶ÅàÇ¢
+ *
+ * @param[in,out] reducer mCYí
+ * @param[out] output_image oÍæ
+ * @return G[R[h(morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_NoiseReduction_start(
+ morpho_NoiseReduction *reducer,
+ morpho_ImageData *output_image);
+
+/**
+ * mCY: mCY
+ *
+ * @param[in,out] reducer mCYí
+ * @param[out] input_image oÍæ
+ * @return G[R[h(morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_NoiseReduction_reduceNoise(
+ morpho_NoiseReduction *reducer,
+ morpho_ImageData *input_image);
+
+/**
+ * ætH[}bgðæ¾
+ * initialize()ÀsãÉæ¾Â\
+ * obt@TCYÍ32ÈãÆ·é±Æ
+ *
+ * @param[in,out] reducer mCYí
+ * @param[out] format ætH[}bg¶ñªi[³êé
+ * @param[in] buffer_size obt@TCY
+ * @return G[R[h(morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_NoiseReduction_getImageFormat(
+ morpho_NoiseReduction *reducer,
+ char *format,
+ const int buffer_size);
+
+/**
+ * PxmCYxxðæ¾
+ * initialize()ÀsãÉæ¾Â\
+ *
+ * @param[in,out] reducer mCYí
+ * @param[out] level PxmCYxxªi[³êé
+ * @return G[R[h(morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_NoiseReduction_getLumaNoiseReductionLevel(
+ morpho_NoiseReduction *reducer,
+ int *level);
+
+/**
+ * N}mCYxxðæ¾
+ * initialize()ÀsãÉæ¾Â\
+ *
+ * @param[in,out] reducer mCYí
+ * @param[out] level N}mCYxxªi[³êé
+ * @return G[R[h(morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_NoiseReduction_getChromaNoiseReductionLevel(
+ morpho_NoiseReduction *reducer,
+ int *level);
+
+/**
+ * ætH[}bgðÝè
+ * initialize()Àsã©Âstart()ÀsOÉÝèÂ\
+ * wèÅ«étH[}bgÍTRMðQÆB
+ *
+ * @param[in,out] reducer mCYí
+ * @param[in] format ætH[}bg¶ñ
+ * @return G[R[h(morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_NoiseReduction_setImageFormat(
+ morpho_NoiseReduction *reducer,
+ const char *format);
+
+/**
+ * PxmCYxxðÝè
+ * initialize()Àsã©Âstart()ÀsOÉÝèÂ\
+ *
+ * @param[in,out] reducer mCYí
+ * @param[in] level PxmCYxx(0-7)
+ * @return G[R[h(morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_NoiseReduction_setLumaNoiseReductionLevel(
+ morpho_NoiseReduction *reducer,
+ int level);
+
+/**
+ * N}mCYxxðÝè
+ * initialize()Àsã©Âstart()ÀsOÉÝèÂ\
+ *
+ * @param[in,out] reducer mCYí
+ * @param[in] level N}mCYxx(0-7)
+ * @return G[R[h(morpho_error.h)
+ */
+MORPHO_API(int)
+morpho_NoiseReduction_setChromaNoiseReductionLevel(
+ morpho_NoiseReduction *reducer,
+ int level);
+
+//====================================================================
+
+# ifdef __cplusplus
+} // extern "C"
+# endif
+
+//--------------------------------------------------------------------
+
+#endif // !MORPHO_IMAGE_STABILIZER3_H
+
+//====================================================================
+// [EOF]
diff --git a/camera/hdr/include/morpho_noise_reduction_ext.h b/camera/hdr/include/morpho_noise_reduction_ext.h
new file mode 100644
index 0000000..4f15934
--- /dev/null
+++ b/camera/hdr/include/morpho_noise_reduction_ext.h
@@ -0,0 +1,17 @@
+#ifndef MORPHO_NR_EXT_H
+#define MORPHO_NR_EXT_H
+
+#include "morpho_noise_reduction.h"
+/*
+return == 0 : OK
+return != 0 : NG (Please print the return value to check Error types)
+*/
+MORPHO_API(int)
+LINK_mm_camera_morpho_noise_reduction(
+ unsigned char* yuvImage,
+ int width,
+ int height,
+ int y_level,
+ int c_level);
+
+#endif //MORPHO_NR_EXT_H
diff --git a/camera/hdr/include/morpho_rect_int.h b/camera/hdr/include/morpho_rect_int.h
new file mode 100644
index 0000000..b3534a4
--- /dev/null
+++ b/camera/hdr/include/morpho_rect_int.h
@@ -0,0 +1,37 @@
+/**
+ * @file morpho_rect_int.h
+ * @brief é`f[^Ì\¢Ìè`
+ * @version 1.0.0
+ * @date 2008-06-09
+ *
+ * Copyright (C) 2006-2012 Morpho, Inc.
+ */
+
+#ifndef MORPHO_RECT_INT_H
+#define MORPHO_RECT_INT_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** é`f[^. */
+typedef struct {
+ int sx; /**< left */
+ int sy; /**< top */
+ int ex; /**< right */
+ int ey; /**< bottom */
+} morpho_RectInt;
+
+/** é`Ìæ rect ̶ãÀW (l,t) ÆEºÀW (r,b) ðÝè·é. */
+#define morpho_RectInt_setRect(rect,l,t,r,b) do { \
+ (rect)->sx=(l);\
+ (rect)->sy=(t);\
+ (rect)->ex=(r);\
+ (rect)->ey=(b);\
+ } while(0)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* #ifndef MORPHO_RECT_INT_H */
diff --git a/camera/mm-camera-interface/mm_camera.c b/camera/mm-camera-interface/mm_camera.c
index 5ba4996..12203e0 100644
--- a/camera/mm-camera-interface/mm_camera.c
+++ b/camera/mm-camera-interface/mm_camera.c
@@ -643,6 +643,10 @@
case MM_CAMERA_PARM_VFE_OUTPUT_ENABLE:
*((int *)parm->p_value) = my_obj->properties.vfe_output_enable;
break;
+ case MM_CAMERA_PARM_LUX_IDX:
+ CDBG("%s: MM_CAMERA_PARM_LUX_IDX\n", __func__);
+ return mm_camera_send_native_ctrl_cmd(my_obj, CAMERA_GET_PARM_LUX_IDX,
+ sizeof(int), (void *)parm->p_value);
case MM_CAMERA_PARM_MAX_NUM_FACES_DECT:
return mm_camera_send_native_ctrl_cmd(my_obj, CAMERA_GET_MAX_NUM_FACES_DECT,
sizeof(int), (void *)parm->p_value);