summaryrefslogtreecommitdiffstats
path: root/camera
diff options
context:
space:
mode:
authorEmilian Peev <epeev@mm-sol.com>2012-03-14 10:26:55 +0200
committerEino-Ville Talvala <etalvala@google.com>2012-03-23 12:11:09 -0700
commit3317eaa5065ed99b360993e5cc8a1d6fad8de3c2 (patch)
tree1389d71128ca5045f5f1f1b8a711b313ec9f4337 /camera
parent528583d223bc151529deae18ba6e7f102e0810ba (diff)
downloadhardware_ti_omap4-3317eaa5065ed99b360993e5cc8a1d6fad8de3c2.zip
hardware_ti_omap4-3317eaa5065ed99b360993e5cc8a1d6fad8de3c2.tar.gz
hardware_ti_omap4-3317eaa5065ed99b360993e5cc8a1d6fad8de3c2.tar.bz2
CameraHal: Speedup face detection start
- Currently when face detection gets enabled the face priority for AE and AF is getting configured as well. This configuration takes around 18 ms. on average and can delay the overall startup time. The optimization will move the algo setup away from face detection enablement and in to the FillBufferDone callback. Bug: 5488236 Change-Id: I2b0e8df9fdead7a5d761a1efbcbf57d39e27ae3c Signed-off-by: Emilian Peev <epeev@mm-sol.com>
Diffstat (limited to 'camera')
-rwxr-xr-xcamera/OMXCameraAdapter/OMXCameraAdapter.cpp12
-rw-r--r--camera/OMXCameraAdapter/OMXFD.cpp13
-rw-r--r--camera/inc/OMXCameraAdapter/OMXCameraAdapter.h1
3 files changed, 16 insertions, 10 deletions
diff --git a/camera/OMXCameraAdapter/OMXCameraAdapter.cpp b/camera/OMXCameraAdapter/OMXCameraAdapter.cpp
index eb77c07..a41327c 100755
--- a/camera/OMXCameraAdapter/OMXCameraAdapter.cpp
+++ b/camera/OMXCameraAdapter/OMXCameraAdapter.cpp
@@ -277,6 +277,7 @@ status_t OMXCameraAdapter::initialize(CameraProperties::Properties* caps)
mMeasurementEnabled = false;
mFaceDetectionRunning = false;
mFaceDetectionPaused = false;
+ mFDSwitchAlgoPriority = false;
memset(&mCameraAdapterParameters.mCameraPortParams[mCameraAdapterParameters.mImagePortIndex], 0, sizeof(OMXCameraPortParameters));
memset(&mCameraAdapterParameters.mCameraPortParams[mCameraAdapterParameters.mPrevPortIndex], 0, sizeof(OMXCameraPortParameters));
@@ -2979,6 +2980,17 @@ OMX_ERRORTYPE OMXCameraAdapter::OMXCameraAdapterFillBufferDone(OMX_IN OMX_HANDLE
notifyFaceSubscribers(fdResult);
fdResult.clear();
}
+ if ( mFDSwitchAlgoPriority ) {
+
+ //Disable region priority and enable face priority for AF
+ setAlgoPriority(REGION_PRIORITY, FOCUS_ALGO, false);
+ setAlgoPriority(FACE_PRIORITY, FOCUS_ALGO , true);
+
+ //Disable Region priority and enable Face priority
+ setAlgoPriority(REGION_PRIORITY, EXPOSURE_ALGO, false);
+ setAlgoPriority(FACE_PRIORITY, EXPOSURE_ALGO, true);
+ mFDSwitchAlgoPriority = false;
+ }
}
}
diff --git a/camera/OMXCameraAdapter/OMXFD.cpp b/camera/OMXCameraAdapter/OMXFD.cpp
index 55723b0..26bbd87 100644
--- a/camera/OMXCameraAdapter/OMXFD.cpp
+++ b/camera/OMXCameraAdapter/OMXFD.cpp
@@ -62,16 +62,9 @@ status_t OMXCameraAdapter::startFaceDetection()
goto out;
}
- if ( mFaceDetectionRunning )
- {
- //Disable region priority and enable face priority for AF
- setAlgoPriority(REGION_PRIORITY, FOCUS_ALGO, false);
- setAlgoPriority(FACE_PRIORITY, FOCUS_ALGO , true);
-
- //Disable Region priority and enable Face priority
- setAlgoPriority(REGION_PRIORITY, EXPOSURE_ALGO, false);
- setAlgoPriority(FACE_PRIORITY, EXPOSURE_ALGO, true);
- }
+ if ( mFaceDetectionRunning ) {
+ mFDSwitchAlgoPriority = true;
+ }
// Note: White balance will not be face prioritized, since
// the algorithm needs full frame statistics, and not face
diff --git a/camera/inc/OMXCameraAdapter/OMXCameraAdapter.h b/camera/inc/OMXCameraAdapter/OMXCameraAdapter.h
index 6ab5ff1..0fdc770 100644
--- a/camera/inc/OMXCameraAdapter/OMXCameraAdapter.h
+++ b/camera/inc/OMXCameraAdapter/OMXCameraAdapter.h
@@ -821,6 +821,7 @@ private:
//Face detection status
bool mFaceDetectionRunning;
bool mFaceDetectionPaused;
+ bool mFDSwitchAlgoPriority;
camera_face_t faceDetectionLastOutput [MAX_NUM_FACES_SUPPORTED];
int faceDetectionNumFacesLastOutput;