summaryrefslogtreecommitdiffstats
path: root/camera/Encoder_libjpeg.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Camera: Implement build without neonDaniel Levin2015-02-031-32/+38
| | | | | | | | | | | | - Added macro ARCH_ARM_HAVE_NEON in armv7-a-neon arch - Implemented software conversion NV12 -> NV21 and NV12 -> YV12 - Made non aligned frame conversion YUYV -> NV12 and UYVY -> NV12 to be generic in neonless build Change-Id: I118dcb394999f937e83fd07882a090034cb1de89 Signed-off-by: Daniel Levin <dendy@ti.com>
* Prevent duplicate DateTime tags in EXIF.Daniel Levin2012-07-251-1/+9
| | | | | | bug:5766177 Change-Id: Ib60030374ffca8e27c814503621cc545f9132360 Signed-off-by: Daniel Levin <dendy@ti.com>
* CameraHAL: Moved Camera HAL sources out of namespace androidDaniel Levin2012-07-251-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | C++ namespace android:: is reserved for base Google Android types to avoid current and further conflicts with 3rd party code. Having TI Camera HAL under namespace android:: violates this rule, adding potential conflicts. This patch moves libtiutils and Camera HAL code out of namespace android:: to custom local namespaces. Putting camera code under namespace android and 'using namespace android' is not allowed anymore. All C++ Android types should have android:: namespace prefix explicitly. Next namespaces added: - Ti:: - placeholder for all custom code - Ti::Utils:: - common utility helper library - Ti::Camera:: - Camera HAL code Also added Ti::status_t as typedef for android::status_t. Change-Id: Ie8cc00d6d6bd4e8a8ddf089421010c370ee40ebe Signed-off-by: Daniel Levin <dendy@ti.com>
* CameraHAL: Portability changesDaniel Levin2012-07-251-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | 1. Moved common definitions to Global.h header: - CAMHAL_LOG* macros (also added CAMHAL_LOGI and CAMHAL_LOGW) - CAMHAL_ASSERT* macros - CAMHAL_UNUSED macro 2. Renamed NV12_resize.c to NV12_resize.cpp 3. Added common math functions into UtilsGlobal.h header: - min(a, b) - returns min of a and b - max(a, b) - returns max of a and b - bound(min, a, max) - return nearest value to a in scope [min..max] - floor(a) - round a to lower integer - round(a) - round a to nearest integer 4. Portability: - Fixed LOG* macros to use appropriate CAMHAL_LOG* wrappers. - Reworked the Android.mk to include proper directories depending on current pastry. Change-Id: I6fbd1ee02d8af2195b91cc357ddcf554fe77f495 Signed-off-by: Daniel Levin <dendy@ti.com>
* CameraHAL: Extends pixel format YUV422i-uyvy for video snapshot.Saravanan Solaiyappan2012-07-251-8/+68
| | | | | | | | | | | | | [Comment] Ducati camera always gives CbYCrY(uyvy) pixel format for YUV422I. But CameraParameters class only supports YUV422-yuyv (YCbYCr). This patch adds the YUV422-uyvy pixel format and updates the jpeg encoder for video snapshot capture. This also adds the support for jpeg encoding from YUV422i-yuyv pixel format. This will be used in V4L/USB camera capture. Change-Id: I564bd00d1a12efba1490190926efa30441298181 Signed-off-by: Solaiyappan Saravanan <saravanan.s@ti.com>
* CameraHal: Add more Exif data for video snapshotTyler Luu2012-07-251-1/+9
| | | | | | | | | | | | Fixes b/5582076. Requires changes to Ducati and external/jhead. 1. Add API to get and set ancillary data metadata so we can use the values to fill in Exif data. 2. Add support for additional tags. Change-Id: I537e683839c59e92a4a20ff62653b6d46e303f53 Signed-off-by: Tyler Luu <tluu@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com>
* CameraHal: Various fixes for issues seen during monkey testsEmilian Peev2012-07-251-11/+11
| | | | | | | | | | - 'mParams' in 'OMXCameraAdapter' should not be used for storing/retrieving internal adapter states or data. This object is continuously updated during every 'setParameters()' call and any references related to it can be invalided. Change-Id: I96a590b56fc9567b0c5dfd56cc0d9d8dc78bcab1 Signed-off-by: Emilian Peev <epeev@mm-sol.com>
* CameraHAL: Fixed crash while resizing NV12 frameDaniel Levin2012-07-251-0/+2
| | | | | | | | | | | When doing video snapshot NV12 frame is resizing for thumbnail using external NV12_resize library. Missing initialization of structConvImage.uOffset field was causing random crashes accessing source frame data in VT_resizeFrame_Video_opt2_lp() function. Signed-off-by: Daniel Levin <dendy@ti.com> Change-Id: I4fda98ba1c24cf54c7d90bffe074105a292096f6
* CameraHAL: Fixed inserting EXIF thumbnailDaniel Levin2012-07-251-1/+1
| | | | | | | | | ReplaceThumbnailFromBuffer() will return 1 on success and 0 on failure. Signed-off-by: Daniel Levin <dendy@ti.com> Change-Id: Ib082f5f8128aff5b7aced149b21574e93bc95713
* CameraHAL: Fixed memory corruption while JPEG encodingDaniel Levin2012-07-251-1/+1
| | | | | | | | | | In case image frame width is greater than stride/2 the right_crop offset gets negative and conversion to YUV will write outside of allocated memory. Signed-off-by: Daniel Levin <dendy@ti.com> Change-Id: I87532ea02ade3636a752954d09f4a9cbdea5ffc3
* CameraHAL: Improved debug loggingDaniel Levin2012-07-251-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 0. Renamed DEBUG_LOG macro to CAMERAHAL_DEBUG and moved it from CameraHal.h into Android.mk. To enable debug logging next variable should be put into $AFS/buildspec.mk: TI_CAMERAHAL_DEBUG_ENABLED := 1 To enable verbose debug logging next variable should be put into $AFS/buildspec.mk: TI_CAMERAHAL_VERBOSE_DEBUG_ENABLED := 1 1. CAMHAL_LOG*A and CAMHAL_LOG*B macros have been united into single CAMHAL_LOG* macro that accepts both variants. 2. Rewritten LOG_FUNCTION_NAME/LOG_FUNCTION_NAME_EXIT macros. Now they do operate on internal FunctionLogger class instance that does function enter/exit logging in constructor/destructor. If LOG_FUNCTION_NAME is used then LOG_FUNCTION_NAME_EXIT can be skipped in source code, in this case destructor will correctly print function exit entry. 3. Added optional printing message timestamps. To enable timestamp printing next variable should be put into $AFS/buildspec.mk: TI_CAMERAHAL_DEBUG_TIMESTAMPS := 1 4. Moved LOG_TAG macro definition from all CameraHAL sources to Android.mk. 5. Added printing message thread ids. 6. Added printing per thread call stack indentation to visualize call hierarchy. 7. Added CAMHAL_ASSERT(condition) and CAMHAL_ASSERT_X(condition,description) macros to assert conditions at runtime and abort process on failure. 8. Added CAMHAL_UNUSED(x) to mark unused variables which are not mistakes. 9. Added next variables to enable debug logging for MessageQueue, that should be put into $AFS/buildspec.mk: TI_UTILS_MESSAGE_QUEUE_DEBUG_ENABLED := 1 TI_UTILS_MESSAGE_QUEUE_DEBUG_FUNCTION_NAMES := 1 Signed-off-by: Daniel Levin <dendy@ti.com> Change-Id: I8ebea607199de621860ada6dfcab9164ba85674a
* CameraHAL: Enable LDCNSF for Video snapshotMilen Mitkov2011-11-301-4/+7
| | | | | | | | | Enables LDCNSF for Video snapshot, also adds start_offset and right_crop fields to the JPEG encoder wrapper, because the image with LDCNSF has artifacts on top and right. Change-Id: I1011252e3f8068083f9d057b7763b7f79c59a75d Signed-off-by: Milen Mitkov <mmitkov@mm-sol.com>
* videosnapshot memory corruption fixes.Akwasi Boateng2011-11-111-1/+2
| | | | | | | | | | | | 1. Fixes memory corruption of dst buffer in nv21_to_yuv() convertion 2. Free malloced row_tmp buffer 3. Free params string in Appcallback Change-Id: I2179f1158f6e72cca0f7e5c815b1cb576bfa925e Signed-off-by: Akwasi Boateng <akwasi.boateng@ti.com> related-to-bug: 5601247
* CameraHal: Fixes for #testVideoSnapshotTyler Luu2011-10-151-2/+59
| | | | | | | | | | | | | 1. Add raw notify callback for video snapshot 2. Add new state for video capture + AF 3. We were not populating focal length correctly for jhead. Need to send focal length as a rational in this format "xx/yy" 4. Need to send GPSProcessingMethod as an UNDEFINED ASCII to jhead b/5448171 Change-Id: Ie6be9ad821d1fa106d9c857681f2fa6427d4f283 Signed-off-by: Tyler Luu <tluu@ti.com>
* omap4xxx: camera: cancel and flush for SW JPEG encoderTyler Luu2011-10-071-2/+5
| | | | | | | | | | | | | | | | Fixes b/5378650 1. Add method to externally cancel Encoder class while in the middle of encoding. 2. Add queue in AppCallbackNotifier to track all the encoding sessions. When stopping AppCallbackNotifier if any encoding sessions are still ongoing, cancel and wait for the threads to return. Previously, it was possible for Encoder threads to still be running when the preview and images buffers were freed. Change-Id: Ib123d1644dfa7058a6f50f0001b4d05359853827 Signed-off-by: Tyler Luu <tluu@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com>
* omap4xxx: camera: EXIF thumbnail for video snapshotTyler Luu2011-10-071-13/+126
| | | | | | | | | | | | | | | | | Fixes b/5370657 1) Extend NV12 resizer to take stride insteadof hardcoding stride 2) Change Encoder class interface to support encoding a thumbnail and main jpeg image. Encoder will resize/encodethumbnail in parallel while encoding the main jpeg. Only NV21/NV12 resizing is supported. Thumbnail is created withpost view frame. 3) Add interface in Encoder class to replace thumbnail with jhead. 4) Height and width fields of EXIF are not proper. Fixed. Change-Id: I5d0063357e4e9e327d22805c2dddf8f630d22e7b Signed-off-by: Raji Reddy Kandi<rajireddy.k@samsung.com> Signed-off-by: Tyler Luu <tluu@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com>
* CameraHal: Optimize uyvy to yuv44 conversionTyler Luu2011-09-141-15/+52
| | | | | | | | | Slightly optmizing the color format conversion from uyvy to yuv44. Now converting 16 pixels at one time instead 2. Change-Id: I88c216c95603f84a39bd30ed1964a977e2af85ec Signed-off-by: Tyler Luu <tluu@ti.com>
* CameraHal: Add Exif support to video snapshotTyler Luu2011-09-121-0/+93
| | | | | | | | Use jhead library to insert Exif to jpeg stream returned from libjpeg. Change-Id: Ia6398180b7ef3c1b3ddcb35e489527289565fef5 Signed-off-by: Tyler Luu <tluu@ti.com>
* CameraHal: Initial support for video snapshotTyler Luu2011-09-021-0/+158
Adds support for capturing an image while recording in video mode. Sets up Ducati to return a YUV422I buffer and encode is performed in AppCallbackNotifier with Encoder_libjpeg class. Change-Id: Ia351fc99dab63a12add8c6c960b186bbe5be275a Signed-off-by: Tyler Luu <tluu@ti.com>