diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..4947287f7b5ccb5d1e8b7b2d3aa5d89f322c160d --- /dev/null +++ b/LICENSE @@ -0,0 +1,177 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/OAT.xml b/OAT.xml new file mode 100644 index 0000000000000000000000000000000000000000..ede8a163f2de61e55f603c57c01ca8cba9a796a9 --- /dev/null +++ b/OAT.xml @@ -0,0 +1,121 @@ + + + + + + LICENSE + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/README.en.md b/README.en.md deleted file mode 100644 index 28d21bc261d658bf8d8ff35db0bbc7948b43c50f..0000000000000000000000000000000000000000 --- a/README.en.md +++ /dev/null @@ -1,36 +0,0 @@ -# device_soc_thead - -#### Description -{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**} - -#### Software Architecture -Software architecture description - -#### Installation - -1. xxxx -2. xxxx -3. xxxx - -#### Instructions - -1. xxxx -2. xxxx -3. xxxx - -#### Contribution - -1. Fork the repository -2. Create Feat_xxx branch -3. Commit your code -4. Create Pull Request - - -#### Gitee Feature - -1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md -2. Gitee blog [blog.gitee.com](https://blog.gitee.com) -3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) -4. The most valuable open source project [GVP](https://gitee.com/gvp) -5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) -6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/README.md b/README.md index 6c3e12b263e0812fbbcc01abfe1e5c0e8f37e5e9..151ae5953491d29c23be5d084f3609accb6953f8 100644 --- a/README.md +++ b/README.md @@ -1,39 +1,17 @@ -# device_soc_thead - -#### 介绍 -{**以下是 Gitee 平台说明,您可以替换此简介** -Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台 -无论是个人、团队、或是企业,都能够用 Gitee 实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)} - -#### 软件架构 -软件架构说明 - - -#### 安装教程 - -1. xxxx -2. xxxx -3. xxxx - -#### 使用说明 - -1. xxxx -2. xxxx -3. xxxx - -#### 参与贡献 - -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request - - -#### 特技 - -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 -5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) +# device_dayu800 + +## 简介 + +本仓用于存放阿里平头哥芯片相关内容,包含th1520 soc相关硬件的闭源库等。 + +### 代码下载说明 + +```shell +repo init -u https://gitee.com/openharmony-sig/manifest.git -b master -m devboard_dayu800.xml --no-repo-verify +repo sync -c +repo forall -c "git lfs pull" +./patch.sh +./build/prebuilts_download.sh +./build.sh --product-name dayu800 --ccache +``` + diff --git a/common/hal/usb/th1520/include/default_config.h b/common/hal/usb/th1520/include/default_config.h new file mode 100644 index 0000000000000000000000000000000000000000..3f1db40275bd2c252a3c1af079feb95be76d10c6 --- /dev/null +++ b/common/hal/usb/th1520/include/default_config.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2023 Thead CO., LIMITED. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef DEFAULT_CONFIG_H +#define DEFAULT_CONFIG_H +#ifdef __cplusplus +extern "C" { +#endif + +#define PORT_FILE_PATH "/sys/kernel/debug/usb/fcc00000.dwc3/mode" +#define UDC_NAME "fcc00000.dwc3" + +#ifdef __cplusplus +} +#endif +#endif // DEFAULT_CONFIG_H \ No newline at end of file diff --git a/th1520/hardware/BUILD.gn b/th1520/hardware/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..c719cf5bebd12b7cb4cf0a41f02fb1f277bdcdd0 --- /dev/null +++ b/th1520/hardware/BUILD.gn @@ -0,0 +1,22 @@ +# Copyright (c) 2023 Thead CO., LIMITED. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") + +group("hardware_group") { + deps = [ + "bootanimation:bootanimation", + "isp8000:isp8000", + "camera:camera", + ] +} diff --git a/th1520/hardware/bootanimation/BUILD.gn b/th1520/hardware/bootanimation/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..603c3c11852fd79968cb784484e04a1f85a43730 --- /dev/null +++ b/th1520/hardware/bootanimation/BUILD.gn @@ -0,0 +1,25 @@ +# Copyright (c) 2023 Thead CO., LIMITED. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import("//build/ohos.gni") + +ohos_prebuilt_etc("bootanimation-800x1280") { + source = "./bootanimation-800x1280.raw" + part_name = "thead_products" + install_enable = true +} + +group("bootanimation") { + deps = [ + ":bootanimation-800x1280", + ] +} diff --git a/th1520/hardware/bootanimation/bootanimation-800x1280.raw b/th1520/hardware/bootanimation/bootanimation-800x1280.raw new file mode 100644 index 0000000000000000000000000000000000000000..d9ef929ffccd1078e56ad38ac0c8d8c46b85489f Binary files /dev/null and b/th1520/hardware/bootanimation/bootanimation-800x1280.raw differ diff --git a/th1520/hardware/camera/BUILD.gn b/th1520/hardware/camera/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..979ebd2d288bb4bebfb0d274ae66a55642a66564 --- /dev/null +++ b/th1520/hardware/camera/BUILD.gn @@ -0,0 +1,46 @@ +# Copyright (c) 2023 Thead CO., LIMITED. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import("//build/ohos.gni") +isp8000_dir = rebase_path("//device/soc/thead/th1520/hardware/isp8000") + +ohos_shared_library("camera_hal") { + sources = [ + "camera_hal/camera_hal.c", + ] + include_dirs = [ + "./include", + "./include/csi_hal", + ] + + ldflags = [ + "-L${isp8000_dir}/yocto_lib64", + "-lhal_platform", + ] + + cflags = [ + "-Wno-macro-redefined", + "-std=c99", + ] + + install_enable = true + install_images = [ "vendor" ] + subsystem_name = "thead_products" + part_name = "thead_products" +} + +group("camera") { + deps = [ + ":camera_hal", + "config:camera_config", + ] +} diff --git a/th1520/hardware/camera/camera_hal/camera_hal.c b/th1520/hardware/camera/camera_hal/camera_hal.c new file mode 100644 index 0000000000000000000000000000000000000000..441a5db862940d6293db1f9ad46c22425b33bed8 --- /dev/null +++ b/th1520/hardware/camera/camera_hal/camera_hal.c @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2023 Thead CO., LIMITED. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include "camera_hal.h" + +#ifdef __cplusplus +#if __cplusplus +extern "C" { +#endif +#endif + +int CameraOpen(csi_cam_handle_t *camHandle, const char *devName) +{ + return csi_camera_open(camHandle, devName); +} + +int CameraSetMode(csi_cam_handle_t camHandle, struct csi_camera_mode_cfg *camModeCfg) +{ + return csi_camera_set_mode(camHandle, camModeCfg); +} + +int CameraQueryProperty(csi_cam_handle_t camHandle, csi_camera_property_description_s *desc) +{ + return csi_camera_query_property(camHandle, desc); +} + +int CameraSetProperty(csi_cam_handle_t camHandle, csi_camera_properties_s *properties) +{ + return csi_camera_set_property(camHandle, properties); +} + +int CameraChannelQuery(csi_cam_handle_t camHandle, csi_camera_channel_cfg_s *cfg) +{ + return csi_camera_channel_query(camHandle, cfg); +} + +int CameraChannelOpen(csi_cam_handle_t camHandle, csi_camera_channel_cfg_s *cfg) +{ + return csi_camera_channel_open(camHandle, cfg); +} + +int CameraCreateEvent(csi_cam_event_handle_t *eventHandle, csi_cam_handle_t camHandle) +{ + return csi_camera_create_event(eventHandle, camHandle); +} + +int CameraSubscribeEvent(csi_cam_event_handle_t eventHandle, csi_camera_event_subscription_s *subscribe) +{ + return csi_camera_subscribe_event(eventHandle, subscribe); +} + +int CameraChannelStart(csi_cam_handle_t camHandle, csi_camera_channel_id_e chnId) +{ + return csi_camera_channel_start(camHandle, chnId); +} + +int CameraGetEvent(csi_cam_event_handle_t eventHandle, csi_camera_event_s *event, int timeout) +{ + return csi_camera_get_event(eventHandle, event, timeout); +} + +int CameraGetFrameCount(csi_cam_handle_t camHandle, csi_camera_channel_id_e chnId) +{ + return csi_camera_get_frame_count(camHandle, chnId); +} + +int CameraGetFrame(csi_cam_handle_t camHandle, csi_camera_channel_id_e chnId, csi_frame_ex_s *frame, int timeout) +{ + return csi_camera_get_frame(camHandle, chnId, frame, timeout); +} + +int CameraFrameGetMetaUnit(csi_camera_meta_unit_s *metaUnit, csi_camera_meta_s *metaData, csi_camera_meta_id_e metaField) +{ + return csi_camera_frame_get_meta_unit(metaUnit, metaData, metaField); +} + +int CameraPutFrame(csi_frame_ex_s *frame) +{ + return csi_camera_put_frame(frame); +} + +int CameraChannelStop(csi_cam_handle_t camHandle, csi_camera_channel_id_e chnId) +{ + return csi_camera_channel_stop(camHandle, chnId); +} + +int CameraUnsubscribeEvent(csi_cam_event_handle_t eventHandle, csi_camera_event_subscription_s *subscribe) +{ + return csi_camera_unsubscribe_event(eventHandle, subscribe); +} + +int CameraDestoryEvent(csi_cam_event_handle_t eventHandle) +{ + return csi_camera_destory_event(eventHandle); +} + +int CameraChannelClose(csi_cam_handle_t camHandle, csi_camera_channel_id_e chnId) +{ + return csi_camera_channel_close(camHandle, chnId); +} + +int CameraClose(csi_cam_handle_t camHandle) +{ + return csi_camera_close(camHandle); +} + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif diff --git a/th1520/hardware/camera/config/BUILD.gn b/th1520/hardware/camera/config/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..565429320ad304d5cf4edaba951e25580cfbe9e4 --- /dev/null +++ b/th1520/hardware/camera/config/BUILD.gn @@ -0,0 +1,20 @@ +# Copyright (c) 2023 Thead CO., LIMITED. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import("//build/ohos.gni") + +group("camera_config") { + deps = [ + "common:common", + "OV5693:OV5693", + ] +} diff --git a/th1520/hardware/camera/config/OV5693/3aconfig_OV5693_2592x1944_raw10.json b/th1520/hardware/camera/config/OV5693/3aconfig_OV5693_2592x1944_raw10.json new file mode 100644 index 0000000000000000000000000000000000000000..319ba14c7eb72332da0358deb4bad2544554ec27 --- /dev/null +++ b/th1520/hardware/camera/config/OV5693/3aconfig_OV5693_2592x1944_raw10.json @@ -0,0 +1,575 @@ +{ + "root" : [ + { + "classname" : "Aev1", + "enable" : false + }, + { + "classname" : "Aev2", + "enable" : true, + "motionThreshold" : 0.5, + "faceTarget" : 68, + "faceWeight" : 1, + "faceCvg" : 5, + "motionFilter" : 0.5, + "maxSensorAgain" : 15.5, + "maxSensorDgain" : 1, + "maxIspDgain" : 2.6, + "minGain" : 1, + "maxIntegTime" : 120, + "minIntegTime" : 0.00001, + "initIntegTime" : 0.01, + "initGain" : 1, + "dampMode": 3, + "setPoint" : 120, + "roiStartX" : 8, + "roiStartY" : 8, + "roiEndX" : 24, + "roiEndY" : 24, + "roiWeight" : 0 + }, + { + "classname" : "Aehdr", + "enable" : false, + "motionThreshold" : 0.5, + "faceTarget" : 68, + "faceWeight" : 1, + "faceCvg" : 5, + "roiStartX" : 6, + "roiStartY" : 6, + "roiEndX" : 26, + "roiEndY" : 26, + "roiWeight" : 0.5, + "motionFilter" : 0.5, + "maxSensorAgain" : 15.5, + "maxSensorDgain" : 1, + "maxIspDgain" : 12, + "setPoint" : 30 + }, + { + "classname" : "AdaptiveAe", + "enable" : false, + "motionThreshold" : 0.7, + "faceTarget" : 68, + "faceWeight" : 1, + "faceCvg" : 5, + "roiStartX" : 6, + "roiStartY" : 6, + "roiEndX" : 26, + "roiEndY" : 26, + "roiWeight" : 0.5, + "motionFilter" : 0.5, + "targetFilter" : 0.5, + "wdrContrast.min" : 150, + "wdrContrast.max" : 150, + "lowlight" : { + "linear_repress" : [0.8, 0.7, 0.5, 0.5, 0.4], + "linear_gain" : [4, 8, 16, 32, 100], + "hdr_repress" : [1, 0.8, 0.8, 0.8, 0.8], + "hdr_gain" : [4, 8, 16, 32, 100] + }, + "maxSensorAgain" : 15.5, + "maxSensorDgain" : 1, + "maxIspDgain" : 1, + "setPoint" : 60 + }, + { + "classname" : "Awbv2", + "enable" : true, + "illuorder" : "A, D50, D65, D75, TL84, F12, CWF", + "indoor" : [1, 1, 1, 1, 1, 1, 1], + "outdoor" : [1, 1, 1, 1, 1, 1, 1], + "transition" : [1, 1, 1, 1, 1, 1, 1], + "awbPref" : { + "gains" : [1, 2, 4, 8, 16, 32], + "A" : [[1.0,1.0,1.0], [1.0,1.0,1.0], [1.0,1.0,1.0], [1.0,1.0,1.0], [1.0,1.0,1.0], [1.0,1.0,1.0]], + "D50" : [[1.0,1.0,1.0], [1.0,1.0,1.0], [1.0,1.0,1.0], [1.0,1.0,1.0], [1.0,1.0,1.0], [1.0,1.0,1.0]], + "D65" : [[1.0,1.0,1.0], [1.0,1.0,1.0], [1.0,1.0,1.0], [1.0,1.0,1.0], [1.0,1.0,1.0], [1.0,1.0,1.0]], + "D75" : [[1.0,1.0,1.0], [1.0,1.0,1.0], [1.0,1.0,1.0], [1.0,1.0,1.0], [1.0,1.0,1.0], [1.0,1.0,1.0]], + "TL84" : [[1.0,1.0,1.0], [1.0,1.0,1.0], [1.0,1.0,1.0], [1.0,1.0,1.0], [1.0,1.0,1.0], [1.0,1.0,1.0]], + "F12" : [[1.0,1.0,1.0], [1.0,1.0,1.0], [1.0,1.0,1.0], [1.0,1.0,1.0], [1.0,1.0,1.0], [1.0,1.0,1.0]], + "CWF" : [[1.0,1.0,1.0], [1.0,1.0,1.0], [1.0,1.0,1.0], [1.0,1.0,1.0], [1.0,1.0,1.0], [1.0,1.0,1.0]] + }, + "sceneMode" : { + "tungsten" : [2.2,1.6,1.0], + "incandescent" : [1.5,1.25,1.0], + "sunny" : [1.0,1.2,1.7], + "cloudy" : [1.0,1.6,2.8] + }, + "lsc_ratio":{ + "gains" : [1, 2, 4, 8, 16, 32], + "vignetting" : [1, 1, 1, 1, 1, 1] + }, + "avg" : 0.0 + }, + { + "classname" : "IspController", + "enable" : true + }, + { + "classname" : "AutoHdr", + "enable" : false + }, + { + "classname" : "DciHist", + "enable" : false, + "gaussMeanPos" : 64, + "gaussSigmaPos" : 128, + "gaussAmpPos" : 1.0, + "gaussMeanNeg" : 0, + "gaussSigmaNeg" : 128, + "gaussAmpNeg" : 1.0 + }, + { + "classname" : "SensorController", + "enable" : true + }, + { + "classname" : "AGamma64", + "forcecreate" : true, + "enable" : true, + "disable" : false, + "tables" : [ + { + "hdr" : false, + "enable" : [1, 1, 1, 1, 1, 1], + "gains" : [1, 2, 4, 8, 16, 32], + "curve" : [ + [93, 135, 176, 221, 267, 305, 343, 374, 398, 421, 444, 464, 484, 501, 521, 541, 558, 575, 591, 608, 624, 638, 650, 662, 675, 686, 697, 708, 719, 730, 741, 751, 761, 772, 782, 791, 801, 810, 819, 829, 837, 847, 856, 864, 873, 882, 890, 898, 907, 914, 923, 930, 939, 946, 954, 962, 969, 976, 985, 992, 999, 1006, 1014, 1023], + [93, 135, 176, 221, 267, 305, 343, 374, 398, 421, 444, 464, 484, 501, 521, 541, 558, 575, 591, 608, 624, 638, 650, 662, 675, 686, 697, 708, 719, 730, 741, 751, 761, 772, 782, 791, 801, 810, 819, 829, 837, 847, 856, 864, 873, 882, 890, 898, 907, 914, 923, 930, 939, 946, 954, 962, 969, 976, 985, 992, 999, 1006, 1014, 1023], + [93, 135, 176, 221, 267, 305, 343, 374, 398, 421, 444, 464, 484, 501, 521, 541, 558, 575, 591, 608, 624, 638, 650, 662, 675, 686, 697, 708, 719, 730, 741, 751, 761, 772, 782, 791, 801, 810, 819, 829, 837, 847, 856, 864, 873, 882, 890, 898, 907, 914, 923, 930, 939, 946, 954, 962, 969, 976, 985, 992, 999, 1006, 1014, 1023], + [93, 135, 176, 221, 267, 305, 343, 374, 398, 421, 444, 464, 484, 501, 521, 541, 558, 575, 591, 608, 624, 638, 650, 662, 675, 686, 697, 708, 719, 730, 741, 751, 761, 772, 782, 791, 801, 810, 819, 829, 837, 847, 856, 864, 873, 882, 890, 898, 907, 914, 923, 930, 939, 946, 954, 962, 969, 976, 985, 992, 999, 1006, 1014, 1023], + [93, 135, 176, 221, 267, 305, 343, 374, 398, 421, 444, 464, 484, 501, 521, 541, 558, 575, 591, 608, 624, 638, 650, 662, 675, 686, 697, 708, 719, 730, 741, 751, 761, 772, 782, 791, 801, 810, 819, 829, 837, 847, 856, 864, 873, 882, 890, 898, 907, 914, 923, 930, 939, 946, 954, 962, 969, 976, 985, 992, 999, 1006, 1014, 1023], + [18, 35, 53, 70, 86, 103, 120, 136, 153, 169, 186, 202, 219, 235, 251, 267, 283, 300, 316, 332, 348, 364, 380, 396, 412, 428, 444, 460, 476, 491, 507, 523, 539, 555, 571, 586, 602, 618, 634, 649, 665, 681, 696, 712, 728, 743, 759, 775, 790, 806, 821, 837, 853, 868, 884, 899, 914, 930, 945, 961, 977, 992, 1008, 1023] + ] + }, + { + "hdr" : true, + "enable" : [1, 1, 1, 1, 1, 1], + "gains" : [1, 2, 4, 8, 16, 32], + "curve" : [ + [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023], + [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023], + [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023], + [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023], + [73, 113, 147, 176, 203, 228, 251, 273, 295, 315, 335, 354, 372, 390, 407, 425, 441, 457, 473, 489, 504, 519, 534, 549, 563, 577, 591, 605, 619, 632, 646, 659, 672, 685, 697, 710, 722, 735, 747, 759, 771, 783, 794, 806, 818, 829, 840, 852, 863, 874, 885, 896, 907, 918, 928, 939, 950, 960, 971, 981, 991, 1002, 1012, 1023], + [73, 113, 147, 176, 203, 228, 251, 273, 295, 315, 335, 354, 372, 390, 407, 425, 441, 457, 473, 489, 504, 519, 534, 549, 563, 577, 591, 605, 619, 632, 646, 659, 672, 685, 697, 710, 722, 735, 747, 759, 771, 783, 794, 806, 818, 829, 840, 852, 863, 874, 885, 896, 907, 918, 928, 939, 950, 960, 971, 981, 991, 1002, 1012, 1023] + ] + } + ] + }, + { + "classname" : "ACproc", + "forcecreate" : false, + "enable" : false, + "disable" : true, + "tables" : [ + { + "hdr" : false, + "enable" : [1, 1, 1, 1, 1, 1], + "gains" : [1, 2, 4, 8, 16, 32], + "contrast" : [1, 1, 1, 1, 1, 1], + "brightness" : [0, 0, 0, 0, 0], + "saturation" : [1, 1, 1, 1, 1, 1], + "hue" : [0, 0, 0, 0, 0, 0], + "chromaout" : [2, 2, 2, 2, 2, 2], + "lumain" : [2, 2, 2, 2, 2, 2], + "lumaout" : [2, 2, 2, 2, 2, 2] + }, + { + "hdr" : true, + "enable" : [1, 1, 1, 1, 1, 1], + "gains" : [1, 2, 4, 8, 16, 32], + "contrast" : [1, 1, 1, 1, 1, 1], + "brightness" : [0, 0, 0, 0, 0], + "saturation" : [1, 1, 1, 1, 1, 1], + "hue" : [0, 0, 0, 0, 0, 0], + "chromaout" : [2, 2, 2, 2, 2, 2], + "lumain" : [2, 2, 2, 2, 2, 2], + "lumaout" : [2, 2, 2, 2, 2, 2] + } + ] + }, + { + "classname" : "Aee", + "forcecreate" : true, + "enable" : true, + "disable" : false, + "tables" : [ + { + "hdr" : false, + "enable" : [1, 1, 1, 1, 1, 1], + "gains" : [1, 2, 4, 8, 16, 32], + "strength" : [100, 100, 100, 100, 100, 100], + "srcStrength" : [1, 1, 1, 1, 1, 1], + "yup" : [1024, 1024, 1024, 1024, 1024, 1024], + "ydown" : [1024, 1024, 1024, 1024, 1024, 1024], + "uvgain" : [0, 0, 0, 0, 0, 0], + "edgegain" : [1000, 1000, 1000, 1000, 500, 200] + }, + { + "hdr" : true, + "enable" : [1, 1, 1, 1, 1, 1], + "gains" : [1, 2, 4, 8, 16, 32], + "strength" : [100, 100, 100, 100, 100, 100], + "srcStrength" : [1, 1, 1, 1, 1, 1], + "yup" : [5000, 5000, 5000, 5000, 5000, 5000], + "ydown" : [8000, 8000, 5000, 5000, 5000, 5000], + "uvgain" : [0, 0, 0, 0, 0, 0], + "edgegain" : [2000, 2000, 2000, 1500, 600, 200] + } + ] + }, + { + "classname" : "ACa", + "forcecreate" : true, + "enable" : true, + "disable" : false, + "tables" : [ + { + "hdr" : false, + "enableCA" : [1, 1, 1, 1, 1, 1], + "enableDCI" : [1, 1, 1, 1, 1, 1], + "gains" : [1, 2, 4, 8, 16, 32], + "curveCA" : [ + [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024], + [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024], + [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024], + [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024], + [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024], + [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024] + ], + "curveDCI" : [ + [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1023, 1023], + [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1028, 1023], + [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1028, 1023], + [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1028, 1023], + [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1028, 1023], + [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1028, 1023] + ] + }, + { + "hdr" : true, + "enableCA" : [0, 0, 1, 1, 1, 1], + "enableDCI" : [1, 1, 1, 1, 1, 1], + "gains" : [1, 2, 4, 8, 16, 32], + "curveCA" : [ + [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024], + [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024], + [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024], + [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024], + [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024], + [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024] + ], + "curveDCI" : [ + [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022], + [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022], + [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022], + [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022], + [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022], + [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022] + ] + } + ] + }, + { + "classname" : "ADmsc2", + "forcecreate" : true, + "enable" : true, + "disable" : false, + "demoire_enable" : true, + "demoire_area_thr" : 16, + "demoire_sat_shrink" : 8, + "demoire_r2" : 256, + "demoire_r1" : 0, + "demoire_t2_shift" : 2, + "demoire_t1" : 180, + "demoire_edge_r2" : 256, + "demoire_edge_r1" : 20, + "demoire_edge_t2_shift" : 4, + "demoire_edge_t1" :20, + "depurple_enable" : true, + "depurple_red_sat" : true, + "depurple_blue_sat" : true, + "depurple_sat_shrink" : 8, + "depurple_thr" : 40, + "skin_enable" : true, + "cb_thr_max_2047" : 10, + "cb_thr_min_2047" : 8, + "cr_thr_max_2047" : 10, + "cr_thr_min_2047" : 8, + "y_thr_max_2047" : 10, + "y_thr_min_2047" : 8, + "tables" : [ + { + "hdr" : false, + "gains" : [1, 2, 4, 8, 16, 32], + "enableSharpen" : [1, 1, 1, 1, 1, 1], + "enableSharpenLine" : [0, 0, 0, 0, 0, 0], + "facblack" : [70, 60, 40, 20, 20, 0], + "facwhite" : [70, 60, 60, 40, 20, 0], + "maxblack" : [100, 100, 100, 100, 100, 100], + "maxwhite" : [100, 100, 100, 100, 100, 100], + "t1" : [0, 0, 0, 0, 0, 0], + "t2" : [0, 0, 0, 0, 0, 0], + "t3" : [0, 0, 0, 0, 0, 0], + "t4" : [0, 0, 0, 0, 0, 0], + "r1" : [0, 0, 0, 0, 0, 0], + "r2" : [128, 128, 128, 128, 128, 128], + "r3" : [256, 256, 256, 256, 256, 256], + "gdenoise" : [5, 5, 5, 5, 5, 5], + "gsharpen" : [8, 8, 8, 8, 8, 8], + "sharpen_line_shift2" : [6, 6, 6, 6, 6, 6], + "sharpen_line_shift1" : [5, 5, 5, 5, 5, 5], + "sharpen_line_t1" : [1000, 1000, 1000, 1000, 1000, 1000], + "sharpen_line_strength" : [100, 100, 100, 100, 100, 100], + "sharpen_line_r2" : [200, 200, 200, 200, 200, 200], + "sharpen_line_r1" : [5, 5, 5, 5, 5, 5] + }, + { + "hdr" : true, + "gains" : [1, 2, 4, 8, 16, 32], + "enableSharpen" : [0, 0, 0, 0, 0, 0], + "enableSharpenLine" : [0, 0, 0, 0, 0, 0], + "facblack" : [200, 200, 100, 50, 20, 20], + "facwhite" : [200, 200, 150, 80, 40, 20], + "maxblack" : [200, 200, 100, 100, 100, 100], + "maxwhite" : [200, 200, 200, 200, 200, 200], + "t1" : [0, 0, 0, 0, 0, 0], + "t2" : [0, 0, 0, 0, 0, 0], + "t3" : [0, 0, 0, 0, 0, 0], + "t4" : [0, 0, 0, 0, 0, 0], + "r1" : [0, 0, 0, 0, 0, 0], + "r2" : [128, 128, 128, 128, 128, 128], + "r3" : [256, 256, 256, 256, 256, 256], + "gdenoise" : [0, 0, 0, 0, 0, 0], + "gsharpen" : [16, 16, 16, 16, 16, 16], + "sharpen_line_shift2" : [6, 6, 6, 6, 6, 6], + "sharpen_line_shift1" : [5, 5, 5, 5, 5, 5], + "sharpen_line_t1" : [1000, 1000, 1000, 1000, 1000, 1000], + "sharpen_line_strength" : [100, 100, 100, 100, 100, 100], + "sharpen_line_r2" : [200, 200, 200, 200, 200, 200], + "sharpen_line_r1" : [5, 5, 5, 5, 5, 5] + } + ] + }, + { + "classname" : "AWdr4", + "forcecreate" : true, + "enable" : false, + "disable" : true, + "backlight" : true, + "tables" : [ + { + "hdr" : false, + "enable" : [1, 1, 1, 1, 1, 1], + "gains" : [1, 2, 4, 8, 16, 32], + "backlight" : [0, 0.1, 0.2, 0.3, 0.4, 0.45], + "strength" : [128, 128, 128, 128, 128, 128], + "highStrength" : [20, 20, 20, 90, 90, 90], + "lowStrength" : [4, 8, 16, 24, 45, 64], + "globalStrength" : [0, 0, 0, 0, 0, 0], + "contrast" : [800, 800, 800, 800, 800, 800], + "flatStrength" : [0, 0, 0, 0, 0, 0], + "flatThreshold" : [0, 0, 0, 0, 0, 0] + }, + { + "hdr" : true, + "enable" : [1, 1, 1, 1, 1, 1], + "gains" : [1, 2, 4, 8, 16, 32], + "backlight" : [0, 0.1, 0.2, 0.3, 0.4, 0.45], + "strength" : [128, 128, 128, 128, 128, 128], + "highStrength" : [20, 20, 20, 90, 90, 90], + "lowStrength" : [4, 8, 16, 24, 45, 64], + "globalStrength" : [0, 0, 0, 0, 0, 0], + "contrast" : [800, 800, 800, 800, 800, 800], + "flatStrength" : [0, 0, 0, 0, 0, 0], + "flatThreshold" : [0, 0, 0, 0, 0, 0] + } + ], + "entropy_slope": 200, + "entropy_base": 700, + "entropy" : [0, 0, 0, 2, 3, 6, 11, 22, 39, 67, 111, 177, 227, 266, 321, 355, 377, 355, 221, 0], + "gamma_down" : [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 9, 16, 36, 64, 136, 256, 576, 1023], + "gamma_up" : [0, 283121, 330313, 377512, 424723, 471961, 519250, 566650, 614235, 662241, 711077, 761540, 792420, 815280, 849436, 875575, 913530, 948975, 1002792, 1048575], + "?gamma_up" : [0, 1024, 34837, 56737, 82912, 116814, 162079, 223337, 306767, 420749, 576707, 735048, 745499, 755950, 776852, 797754, 839557, 881361, 964968, 1048575], + "gamma_pre" : [0, 31514, 36815, 42173, 47646, 53350, 59514, 66602, 75530, 88145, 108135, 142869, 175428, 207095, 269144, 330303, 442139, 571475, 810472, 1048575] + }, + { + + "classname" : "A3dnrv3", + "forcecreate" : false, + "enable" : false, + "disable" : false, + "autonoiseLevel": true, + "tnr_en" : false, + "nlm_en" : true, + "tables" : [ + { + "hdr" : false, + "enable" : [0, 0, 0, 0, 0, 0, 0], + "gains" : [1, 2, 4, 8, 16, 32], + "filterLen" : [100, 150, 200, 300, 400, 500], + "filterLen2" : [10, 10, 10, 10, 10, 10], + "motionSlope" : [1, 1, 1, 1, 1, 1], + "noiseLevel" : [25, 40, 60, 80, 100, 120], + "sadweight" : [8, 8, 8, 8, 8, 8], + "motionInvFactor" : [20000, 20000, 20000, 20000, 20000, 20000], + "noisemodel_a" : [0.45071, 0.85596, 1.561850, 2.219000, 3.9409, 5.2362], + "noisemodel_b" : [0.000065, 9.7098, 140.351654, 219.965805, 284.8835, 344.9119], + "autoStrength" : [1.5, 1.5, 1.5, 1.5, 1.5, 1.5], + "motion_dilate_en" : [1, 1, 1, 1, 1, 1], + "motion_erode_en" : [1, 1, 1, 1, 1, 1], + "pregamma_en" : [1, 1, 1, 1, 1, 1], + "strength" : [120, 120, 120, 120, 120, 120], + "range_h" : [7, 7, 7, 7, 7, 7], + "range_v" : [3, 3, 3, 3, 3, 3], + "dialte_h" : [3, 3, 3, 3, 3, 3], + "preweight" : [8, 8, 8, 8, 8, 8], + "noise_thresh_factor" : [2, 2, 2, 2, 2, 2], + "moving_pixel_thresh" : [0.6, 0.6, 0.6, 0.6, 0.6, 0.6] + }, + { + "hdr" : true, + "enable" : [0, 0, 0, 0, 0, 0, 0], + "gains" : [1, 2, 4, 8, 16, 32], + "filterLen" : [100, 150, 200, 300, 400, 500], + "filterLen2" : [10, 10, 10, 10, 10, 10], + "motionSlope" : [1, 1, 1, 1, 1, 1], + "noiseLevel" : [25, 40, 60, 80, 100, 120], + "sadweight" : [8, 8, 8, 8, 8, 8], + "motionInvFactor" : [20000, 20000, 20000, 20000, 20000, 20000], + "noisemodel_a" : [0.45071, 0.85596, 1.561850, 2.219000, 3.9409, 5.2362], + "noisemodel_b" : [0.000065, 9.7098, 140.351654, 219.965805, 284.8835, 344.9119], + "autoStrength" : [1.5, 1.5, 1.5, 1.5, 1.5, 1.5], + "motion_dilate_en" : [1, 1, 1, 1, 1, 1], + "motion_erode_en" : [1, 1, 1, 1, 1, 1], + "pregamma_en" : [1, 1, 1, 1, 1, 1], + "strength" : [120, 120, 120, 120, 120, 120], + "range_h" : [7, 7, 7, 7, 7, 7], + "range_v" : [3, 3, 3, 3, 3, 3], + "dialte_h" : [3, 3, 3, 3, 3, 3], + "preweight" : [8, 8, 8, 8, 8, 8], + "noise_thresh_factor" : [2, 2, 2, 2, 2, 2], + "moving_pixel_thresh" : [0.6, 0.6, 0.6, 0.6, 0.6, 0.6] + } + ] + }, + { + "classname" : "A2dnrv5", + "forcecreate" : true, + "enable" : true, + "disable" : false, + "tables" : [ + { + "hdr" : false, + "enable" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + "gains" : [1, 2, 4, 8, 12, 16, 20, 24, 32, 40], + "strength" : [2, 2, 2, 2, 2, 2, 2, 2, 2, 2], + "sigma" : [4, 5, 6, 8, 8, 8, 11, 11, 11, 14], + "blendstatic" : [100, 100, 100, 100, 100, 90, 90, 35, 35, 40], + "blendmotion" : [100, 100, 100, 100, 100, 90, 90, 100, 100, 100] + }, + { + "hdr" : true, + "enable" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + "gains" : [1, 2, 4, 8, 12, 16, 20, 24, 32, 40], + "strength" : [1, 1, 1, 1, 1, 1, 2, 2, 2, 2], + "sigma" : [5, 5, 5, 8, 8, 8, 11, 11, 11, 14], + "blendstatic" : [100, 100, 100, 100, 100, 100, 100, 35, 35, 40], + "blendmotion" : [100, 100, 100, 100, 100, 100, 100, 100, 100, 100] + } + ] + }, + { + "classname" : "ADpf", + "forcecreate" : true, + "enable" : true, + "disable" : false, + "tables" : [ + { + "hdr" : false, + "enable" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + "gains" : [1, 2, 4, 8, 12, 16, 20, 24, 32, 40], + "gradient" : [0.1, 0.2, 0.4, 0.7, 1, 1.5, 2, 2.5, 3, 3.5], + "offset" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + "Min" : [1, 1, 1, 1, 1, 1, 1, 2, 4, 16], + "Div" : [64, 64, 64, 65, 65, 65, 65, 65, 65, 65], + "sigma_g" : [1, 1, 2, 2, 3, 3, 4, 4, 4, 4], + "sigma_rb" : [1, 1, 2, 2, 3, 3, 4, 4, 4, 4], + "curve" : [ + [4095, 4095, 3677, 3068, 2686, 2219, 1933, 1735, 1587, 1379, 1235, 1129, 979, 877, 801, 742, 695], + [4095, 4056, 2910, 2388, 2073, 1697, 1471, 1317, 1203, 1042, 933, 852, 738, 660, 603, 558, 523], + [3688, 2169, 1687, 1428, 1260, 1050, 918, 827, 758, 660, 592, 542, 470, 421, 385, 357, 335], + [2254, 1553, 1258, 1085, 968, 816, 718, 649, 597, 521, 469, 430, 374, 335, 307, 284, 267], + [1060, 883, 772, 695, 637, 555, 498, 455, 422, 373, 338, 311, 272, 245, 225, 209, 196], + [580, 524, 481, 448, 420, 378, 346, 321, 301, 270, 247, 229, 202, 183, 168, 157, 148], + [368, 346, 328, 312, 298, 276, 257, 242, 230, 209, 193, 181, 162, 147, 136, 127, 120], + [214, 206, 199, 192, 186, 175, 166, 159, 152, 141, 132, 124, 112, 103, 96, 91, 86], + [158, 152, 147, 142, 138, 130, 124, 118, 113, 105, 99, 93, 84, 78, 72, 68, 64], + [127, 124, 121, 118, 115, 110, 106, 103, 99, 93, 88, 84, 77, 72, 68, 64, 61] + ] + }, + { + "hdr" : true, + "enable" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + "gains" : [1, 2, 4, 8, 12, 16, 20, 24, 32, 40], + "gradient" : [0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2], + "offset" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + "Min" : [16, 16, 16, 16, 16, 16, 16, 16, 16, 16], + "Div" : [64, 64, 64, 64, 64, 64, 64, 64, 64, 64], + "sigma_g" : [4, 4, 4, 4, 4, 4, 4, 4, 4, 4], + "sigma_rb" : [4, 4, 4, 4, 4, 4, 4, 4, 4, 4], + "curve" : [ + [4095, 4095, 3677, 3068, 2686, 2219, 1933, 1735, 1587, 1379, 1235, 1129, 979, 877, 801, 742, 695], + [4095, 4056, 2910, 2388, 2073, 1697, 1471, 1317, 1203, 1042, 933, 852, 738, 660, 603, 558, 523], + [3688, 2169, 1687, 1428, 1260, 1050, 918, 827, 758, 660, 592, 542, 470, 421, 385, 357, 335], + [2254, 1553, 1258, 1085, 968, 816, 718, 649, 597, 521, 469, 430, 374, 335, 307, 284, 267], + [1060, 883, 772, 695, 637, 555, 498, 455, 422, 373, 338, 311, 272, 245, 225, 209, 196], + [580, 524, 481, 448, 420, 378, 346, 321, 301, 270, 247, 229, 202, 183, 168, 157, 148], + [368, 346, 328, 312, 298, 276, 257, 242, 230, 209, 193, 181, 162, 147, 136, 127, 120], + [214, 206, 199, 192, 186, 175, 166, 159, 152, 141, 132, 124, 112, 103, 96, 91, 86], + [158, 152, 147, 142, 138, 130, 124, 118, 113, 105, 99, 93, 84, 78, 72, 68, 64], + [127, 124, 121, 118, 115, 110, 106, 103, 99, 93, 88, 84, 77, 72, 68, 64, 61] + ] + } + ] + }, + { + "classname" : "ABlc", + "forcecreate" : true, + "enable" : true, + "tables" : [ + { + "hdr" : false, + "gains" : [1, 16], + "blc" : [16, 16] + }, + { + "hdr" : true, + "gains" : [1, 16], + "blc" : [256, 256] + } + ] + }, + { + "classname" : "AGe", + "forcecreate" : true, + "enable" : true, + "tables" : [ + { + "hdr" : false, + "gains" : [1, 16], + "threshold" : [0, 0], + "dummyline" : [100, 100] + }, + { + "hdr" : true, + "gains" : [1, 16], + "threshold" : [0, 0], + "dummyline" : [100, 100] + } + ] + } + ] +} diff --git a/th1520/hardware/camera/config/OV5693/BUILD.gn b/th1520/hardware/camera/config/OV5693/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..9ec8a33a64b9e7d7ab26421f5024470634c0de3b --- /dev/null +++ b/th1520/hardware/camera/config/OV5693/BUILD.gn @@ -0,0 +1,68 @@ +# Copyright (c) 2023 Thead CO., LIMITED. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import("//build/ohos.gni") + +ohos_prebuilt_etc("3aconfig_OV5693_2592x1944_raw10.json") { + source = "./3aconfig_OV5693_2592x1944_raw10.json" + module_install_dir = "usr/share/vi/config" + install_images = [ "system", "vendor" ] + subsystem_name = "thead_products" + part_name = "thead_products" + install_enable = true +} + +ohos_prebuilt_etc("OV5693_2592x1944.xml") { + source = "./OV5693_2592x1944.xml" + module_install_dir = "usr/share/vi/config" + install_images = [ "system", "vendor" ] + subsystem_name = "thead_products" + part_name = "thead_products" + install_enable = true +} + +ohos_prebuilt_etc("OV5693_640x480.xml") { + source = "./OV5693_640x480.xml" + module_install_dir = "usr/share/vi/config" + install_images = [ "system", "vendor" ] + subsystem_name = "thead_products" + part_name = "thead_products" + install_enable = true +} + +ohos_prebuilt_etc("OV5693_mipi2lane_2592x1944_raw10_30fps_init.txt") { + source = "./OV5693_mipi2lane_2592x1944_raw10_30fps_init.txt" + module_install_dir = "usr/share/vi/config" + install_images = [ "system", "vendor" ] + subsystem_name = "thead_products" + part_name = "thead_products" + install_enable = true +} + +ohos_prebuilt_etc("OV5693_mipi2lane_640x480_init.txt") { + source = "./OV5693_mipi2lane_640x480_init.txt" + module_install_dir = "usr/share/vi/config" + install_images = [ "system", "vendor" ] + subsystem_name = "thead_products" + part_name = "thead_products" + install_enable = true +} + +group("OV5693") { + deps = [ + ":3aconfig_OV5693_2592x1944_raw10.json", + ":OV5693_2592x1944.xml", + ":OV5693_640x480.xml", + ":OV5693_mipi2lane_2592x1944_raw10_30fps_init.txt", + ":OV5693_mipi2lane_640x480_init.txt", + ] +} diff --git a/th1520/hardware/camera/config/OV5693/OV5693_2592x1944.xml b/th1520/hardware/camera/config/OV5693/OV5693_2592x1944.xml new file mode 100644 index 0000000000000000000000000000000000000000..c80d4961c7cae00a6230ee482be85cb7460cf276 --- /dev/null +++ b/th1520/hardware/camera/config/OV5693/OV5693_2592x1944.xml @@ -0,0 +1,1539 @@ + + +
+ + 09-Aug-2023 + + + Mhong + + + OV5693 + + + 5M_0809-2 + + + v2.1.1 + + + + + 2592x1944 + + + 0x00000001 + + + [ 2592] + + + [ 1944] + + + + + FPS_15 + + + [ 14.9916] + + + + + FPS_10 + + + [ 9.9944] + + + + + FPS_05 + + + [ 4.9972] + + + + + +
+ + + + + + 2592x1944 + + + 2592x1944 + + + [0.312492 0.450819 0.23669] + + + [0.815104 -0.366271 -0.448833 -0.0476668 0.729734 -0.68207] + + + [-0.878803 -0.477185 -2.3613] + + + [0.70247 0.970633 1.04275 1.11559 1.17802 1.25107 1.28395 1.38702 1.45929 1.54887 1.6153 1.69581 1.77014 1.84354 1.91238 2.026] + + + [0.133982 0.100293 0.101444 0.0761765 0.0691405 0.0884445 0.127837 0.292207 0.235577 0.114445 0.0644598 0.0688544 0.093102 0.0991968 0.116879 0.10618] + + + [0.70247 0.97799 1.04519 1.11511 1.18175 1.26682 1.32506 1.40522 1.48026 1.55146 1.63904 1.70895 1.79537 1.8719 1.9433 2.026] + + + [0.0922744 0.11932 0.0933725 0.115318 0.120732 0.127925 0.136583 0.118979 0.12115 0.138151 0.237809 0.259754 0.159652 0.112307 0.0847379 0.062034] + + + [0.70247 0.882402 0.964804 1.04721 1.12961 1.21201 1.29441 1.35256 1.44091 1.54162 1.62402 1.70642 1.78883 1.87123 1.95363 2.136] + + + [0.212243 0.229116 0.216361 0.205106 0.195407 0.187587 0.211957 0.363432 0.339708 0.176562 0.179762 0.185725 0.194527 0.206871 0.222412 0.27264] + + + [0.70247 0.882402 0.964804 1.04721 1.12961 1.21201 1.29441 1.37682 1.45922 1.54162 1.6295 1.72149 1.79239 1.87123 1.94616 2.136] + + + [0.164101 0.170884 0.183639 0.194894 0.204593 0.212413 0.218406 0.222272 0.224017 0.223438 0.303776 0.357241 0.258681 0.193129 0.190412 0.12736] + + + [ 0.75247] + + + [ 2.026] + + + [ 2.086] + + + [ 1.5586] + + + D50 + + + [ 4.5676] + + + [0.75 1.28836 1.77672 2.164 2.6 3.0618] + + + [114 114 105 95 95 90] + + + [83 83 110 120 122 128] + + + [28 27 18 16 9 9] + + + [123 123 123 123 123 120] + + + [123 123 123 123 123 126] + + + [5 5 5 5 5 5] + + + [ 1] + + + [ 0.8] + + + [ 0.05] + + + + [ 0.05] + + + [ 0.05] + + + [ 0.4] + + + [ 0.5] + + + [ 0.9] + + + [ 0.5] + + + [ 50] + + + [ 1] + + + [ 0.5] + + + + + + + + A + + + Indoor + + + + [503.657 163.227 163.227 4847.5765] + + + [ 247.3246] + + + [1 1] + + + [-0.0933191 -0.035138] + + + + + + 2592x1944 + + + 2592x1944_A_70 + + + + + [1.12023 1 1 2.7421] + + + [2.16626 -0.546277 -0.622854 -0.486759 1.9778 -0.477147 -0.211107 -1.20066 2.4719] + + + [11.7581 -6.68684 -29.183] + + + AUTO + + + + [1 2 4 8] + + + [100 95 90 74] + + + + + [1 2 4 8] + + + [100 95 90 70] + + + + + A_108 + + + + + + D50 + + + Indoor + + + + [483.975 -420.36 -420.36 1475.7288] + + + [ 116.6849] + + + [1 1] + + + [-0.109807 -0.059541] + + + + + + 2592x1944 + + + 2592x1944_D50_70 + + + + + [1.68537 1 1 1.7605] + + + [2.19522 -1 -0.18179 -0.38513 1.87015 -0.431083 -0.169905 -0.528827 1.7298] + + + [-54.9235 -55.8219 -62.0013] + + + AUTO + + + + [1 2 4 8] + + + [100 95 90 74] + + + + + [1 2 4 8] + + + [100 95 90 70] + + + + + D50_108 + + + + + + D65 + + + Outdoor + + + + [591.282 -471.429 -471.429 1076.7015] + + + [ 102.4529] + + + [1 1] + + + [0.10421 0.041585] + + + + + + 2592x1944 + + + 2592x1944_D65_70 + + + + + [1.92925 1 1 1.5183] + + + [1.98436 -0.810818 -0.134082 -0.363732 1.85049 -0.470489 -0.150504 -0.426488 1.5924] + + + [-106.784 -64.0457 -63.0708] + + + AUTO + + + + [1 2 4 8] + + + [100 95 90 74] + + + + + [1 2 4 8] + + + [100 95 90 70] + + + + + D65_108 + + + + + + D75 + + + Outdoor + + + + [653.161 -491.022 -491.022 963.9464] + + + [ 99.2022] + + + [1 1] + + + [0.00201897 0.05375] + + + + + + 2592x1944 + + + 2592x1944_D75_70 + + + + + [1.98201 1 1 1.3705] + + + [2.0752 -0.76877 -0.248426 -0.42482 1.97356 -0.510355 -0.217684 -0.287183 1.5264] + + + [-126.037 -49.81 -88.2855] + + + AUTO + + + + [1 2 4 8] + + + [100 95 90 74] + + + + + [1 2 4 8] + + + [100 95 90 70] + + + + + D75_108 + + + + + + F2 (CWF) + + + Indoor + + + + [814.026 -442.932 -442.932 874.7706] + + + [ 114.3146] + + + [1 1] + + + [-0.0470103 -0.0073493] + + + + + + 2592x1944 + + + 2592x1944_F2_70 + + + + + [1.57042 1 1 2.4573] + + + [2.01005 -0.801146 -0.139835 -0.573695 1.88727 -0.179015 -0.288945 -0.652384 1.955] + + + [-43.762 -62.6082 -56.099] + + + AUTO + + + + [1 2 4 8] + + + [100 95 90 74] + + + + + [1 2 4 8] + + + [100 95 90 70] + + + + + F2_108 + + + + + + F11 (TL84) + + + Indoor + + + + [533.331 -305.654 -305.654 1037.8413] + + + [ 107.9546] + + + [1 1] + + + [0.17792 0.046229] + + + + + + 2592x1944 + + + 2592x1944_F11_70 + + + + + [1.35391 1 1 2.374] + + + [1.83705 -0.580873 -0.239021 -0.475097 1.769 -0.242107 -0.210834 -0.654591 1.9266] + + + [-70.1972 -60.0124 -98.4587] + + + AUTO + + + + [1 2 4 8] + + + [100 95 90 74] + + + + + [1 2 4 8] + + + [100 95 90 70] + + + + + F11_108 + + + + + + F12 + + + Indoor + + + + [490.666 -154.034 -154.034 1690.9832] + + + [ 142.8837] + + + [1 1] + + + [0.0382674 0.035902] + + + + + + 2592x1944 + + + 2592x1944_F12_70 + + + + + [1 1.08566 1.08566 3.6337] + + + [2.11449 -0.488607 -0.627944 -0.583834 1.99303 -0.335673 -0.358568 -1.70517 3.1867] + + + [8.42098 1.38714 -241.8493] + + + AUTO + + + + [1 2 4 8] + + + [100 95 90 74] + + + + + [1 2 4 8] + + + [100 95 90 70] + + + + + F12_108 + + + + + + + + + 2592x1944_A_70 + + + 2592x1944 + + + A + + + [ 16] + + + [ 10] + + + [ 15] + + + [ 15] + + + [207 156 155 156 155 156 155 156] + + + [156 116 117 116 117 117 116 117] + + + [ 70] + + + [4216 3641 3204 2869 2593 2378 2210 2109 2075 2119 2218 2380 2610 2913 3257 3661 4075 3982 3327 2908 2575 2273 2040 1874 1773 1736 1773 1867 2045 2285 2580 2982 3343 3908 3801 3100 2709 2344 2047 1810 1650 1549 1517 1549 1652 1817 2065 2379 2735 3191 3746 3567 2929 2542 2163 1861 1625 1465 1369 1345 1377 1470 1637 1870 2193 2572 2999 3634 3437 2810 2392 2017 1716 1480 1320 1233 1207 1234 1334 1485 1730 2039 2430 2877 3529 3314 2697 2282 1904 1600 1369 1220 1137 1114 1140 1224 1384 1616 1928 2313 2750 3437 3248 2640 2194 1829 1522 1299 1153 1078 1054 1081 1160 1312 1536 1848 2232 2687 3372 3229 2591 2161 1791 1481 1263 1123 1047 1026 1050 1129 1275 1499 1807 2188 2638 3327 3221 2592 2160 1784 1483 1263 1121 1047 1024 1049 1128 1270 1503 1807 2189 2640 3331 3237 2634 2194 1824 1516 1297 1150 1072 1051 1079 1158 1312 1534 1845 2232 2687 3373 3321 2697 2267 1895 1590 1365 1216 1135 1109 1137 1221 1378 1607 1929 2313 2772 3411 3447 2802 2385 2018 1704 1475 1317 1228 1201 1232 1328 1488 1727 2045 2430 2882 3548 3581 2939 2540 2155 1855 1622 1458 1368 1339 1371 1470 1643 1881 2205 2590 3034 3703 3791 3091 2727 2357 2037 1812 1642 1548 1514 1549 1653 1826 2074 2390 2776 3220 3828 3993 3318 2926 2598 2278 2032 1868 1770 1738 1775 1886 2057 2298 2617 3004 3407 3987 4193 3578 3181 2840 2566 2298 2138 2033 2003 2041 2144 2328 2566 2886 3250 3684 4144 4362 3979 3534 3205 2917 2707 2530 2443 2401 2445 2565 2720 2961 3259 3633 3933 4253] + + + [2824 2460 2196 2021 1887 1774 1699 1646 1629 1641 1686 1763 1874 2019 2193 2416 2721 2664 2235 2028 1857 1709 1603 1513 1462 1442 1457 1505 1582 1695 1843 2022 2216 2571 2527 2135 1926 1749 1601 1482 1397 1341 1321 1338 1388 1476 1583 1733 1900 2124 2461 2414 2046 1847 1656 1504 1387 1295 1237 1217 1236 1294 1377 1494 1652 1826 2032 2385 2323 1978 1771 1587 1434 1302 1209 1155 1136 1153 1208 1303 1422 1578 1760 1969 2327 2265 1936 1719 1531 1369 1241 1149 1096 1082 1098 1148 1236 1367 1521 1710 1924 2275 2221 1891 1680 1491 1328 1199 1108 1060 1043 1058 1108 1195 1329 1486 1667 1886 2243 2213 1879 1663 1471 1306 1174 1089 1040 1024 1040 1086 1176 1305 1465 1651 1866 2213 2202 1877 1662 1473 1306 1176 1087 1040 1025 1037 1089 1173 1304 1467 1651 1867 2220 2237 1896 1687 1497 1330 1199 1113 1060 1043 1059 1109 1200 1326 1492 1673 1893 2230 2267 1935 1724 1537 1378 1250 1153 1102 1085 1100 1153 1242 1371 1533 1715 1923 2275 2330 1984 1780 1593 1441 1316 1221 1164 1146 1164 1217 1313 1440 1593 1777 1985 2349 2412 2046 1860 1671 1523 1402 1308 1252 1234 1251 1309 1396 1520 1670 1847 2068 2426 2521 2134 1937 1774 1617 1507 1420 1358 1339 1357 1412 1500 1611 1766 1944 2157 2515 2634 2252 2061 1897 1739 1620 1542 1488 1468 1485 1537 1614 1733 1871 2057 2266 2611 2810 2396 2184 2019 1880 1764 1682 1631 1612 1625 1678 1753 1861 2010 2192 2415 2735 2959 2628 2382 2208 2070 1967 1885 1836 1820 1842 1883 1961 2061 2211 2395 2593 2881] + + + [2773 2388 2148 1973 1846 1738 1656 1601 1586 1612 1655 1730 1834 1997 2163 2395 2685 2635 2235 2015 1843 1695 1583 1494 1446 1424 1443 1497 1577 1690 1835 2030 2228 2590 2518 2115 1911 1734 1587 1472 1378 1323 1310 1329 1378 1465 1585 1734 1904 2134 2475 2406 2042 1842 1654 1498 1370 1286 1226 1206 1229 1284 1379 1492 1652 1833 2050 2398 2330 1977 1773 1587 1428 1300 1204 1148 1132 1151 1208 1300 1433 1584 1777 1987 2356 2271 1941 1726 1535 1373 1239 1148 1093 1075 1097 1147 1243 1372 1534 1718 1950 2299 2245 1910 1687 1502 1333 1199 1108 1058 1043 1058 1112 1200 1334 1499 1695 1910 2279 2232 1894 1678 1484 1312 1180 1090 1039 1024 1039 1092 1179 1318 1480 1672 1891 2259 2242 1899 1678 1485 1316 1181 1089 1041 1024 1042 1093 1183 1314 1485 1673 1888 2251 2249 1924 1705 1511 1341 1204 1115 1060 1045 1061 1114 1202 1338 1504 1696 1915 2276 2295 1962 1743 1555 1389 1253 1155 1100 1082 1100 1153 1251 1380 1548 1734 1955 2315 2356 2014 1801 1607 1452 1317 1221 1162 1143 1163 1217 1314 1442 1601 1799 2009 2387 2444 2077 1875 1685 1531 1401 1306 1247 1225 1247 1305 1400 1524 1677 1868 2086 2453 2548 2160 1966 1781 1622 1505 1414 1354 1333 1353 1408 1493 1617 1767 1956 2177 2531 2673 2270 2074 1905 1743 1619 1535 1475 1455 1472 1528 1610 1724 1876 2061 2281 2646 2813 2419 2202 2024 1885 1754 1668 1615 1597 1612 1663 1740 1851 2005 2188 2422 2740 2983 2662 2382 2215 2057 1947 1868 1817 1790 1811 1861 1938 2050 2205 2396 2596 2900] + + + [2398 2065 1861 1730 1623 1561 1496 1485 1464 1491 1537 1598 1693 1806 1961 2172 2452 2330 1944 1791 1673 1565 1481 1427 1379 1384 1396 1439 1516 1603 1728 1884 2047 2389 2186 1875 1719 1579 1479 1398 1327 1292 1283 1300 1355 1419 1522 1641 1775 1953 2271 2112 1803 1659 1527 1411 1316 1249 1212 1200 1220 1279 1354 1459 1589 1725 1896 2203 2024 1759 1616 1480 1362 1258 1184 1136 1133 1153 1206 1293 1405 1542 1686 1857 2158 1983 1724 1572 1438 1316 1207 1130 1091 1080 1099 1156 1242 1357 1502 1647 1813 2133 1943 1706 1552 1408 1278 1172 1097 1056 1044 1067 1120 1205 1326 1467 1619 1803 2074 1945 1701 1539 1392 1268 1152 1076 1035 1024 1048 1099 1187 1305 1450 1604 1774 2071 1936 1705 1542 1396 1266 1152 1076 1038 1024 1046 1098 1185 1305 1454 1606 1786 2086 1962 1717 1564 1418 1287 1172 1095 1054 1046 1062 1120 1202 1326 1465 1633 1811 2085 2006 1744 1597 1448 1323 1216 1137 1093 1083 1103 1154 1245 1363 1504 1667 1826 2144 2049 1797 1626 1500 1369 1276 1189 1146 1139 1156 1213 1301 1414 1549 1708 1879 2182 2145 1832 1689 1547 1447 1339 1270 1221 1210 1233 1287 1372 1480 1613 1766 1932 2271 2222 1895 1759 1624 1504 1420 1346 1312 1302 1316 1368 1451 1552 1676 1834 2011 2353 2353 1995 1846 1712 1598 1503 1454 1410 1401 1423 1465 1535 1632 1758 1913 2110 2437 2497 2118 1948 1812 1698 1612 1545 1510 1507 1523 1564 1641 1729 1863 2021 2229 2588 2686 2319 2087 1952 1828 1738 1680 1644 1630 1662 1704 1762 1861 1998 2188 2404 2725] + + + + + 2592x1944_D50_70 + + + 2592x1944 + + + D50 + + + [ 16] + + + [ 10] + + + [ 15] + + + [ 15] + + + [207 156 155 156 155 156 155 156] + + + [156 116 117 116 117 117 116 117] + + + [ 70] + + + [3658 3138 2819 2537 2337 2152 2014 1940 1922 1953 2032 2182 2382 2606 2898 3221 3640 3482 2915 2597 2320 2073 1894 1752 1669 1645 1674 1760 1914 2106 2383 2683 2982 3507 3314 2756 2448 2143 1898 1705 1568 1486 1460 1492 1579 1726 1929 2187 2492 2860 3351 3126 2614 2303 1987 1743 1546 1410 1328 1304 1333 1422 1568 1772 2048 2364 2702 3241 3017 2518 2168 1874 1612 1418 1276 1202 1183 1208 1292 1437 1646 1913 2247 2594 3153 2916 2419 2076 1770 1511 1318 1189 1119 1099 1124 1201 1342 1544 1816 2146 2508 3078 2868 2367 2011 1711 1451 1259 1132 1066 1043 1070 1144 1277 1480 1747 2076 2453 3009 2871 2343 1995 1682 1425 1230 1109 1042 1024 1048 1119 1251 1447 1729 2058 2425 2978 2868 2354 1994 1687 1423 1233 1109 1045 1026 1046 1121 1252 1454 1725 2050 2433 3004 2894 2373 2029 1713 1451 1265 1134 1068 1049 1075 1148 1283 1486 1758 2101 2473 3015 2934 2430 2074 1768 1510 1319 1185 1118 1096 1124 1200 1340 1543 1827 2149 2523 3091 3011 2511 2163 1856 1609 1407 1270 1197 1176 1206 1287 1430 1643 1907 2233 2604 3168 3123 2627 2284 1981 1728 1531 1394 1320 1290 1324 1411 1564 1768 2042 2368 2725 3269 3283 2770 2438 2141 1885 1701 1556 1471 1452 1480 1576 1725 1936 2214 2520 2890 3411 3458 2933 2635 2359 2090 1885 1754 1674 1647 1680 1774 1922 2130 2400 2716 3064 3564 3611 3145 2832 2564 2327 2114 1979 1898 1878 1914 1999 2156 2357 2620 2915 3288 3681 3780 3408 3112 2828 2620 2426 2296 2220 2201 2227 2330 2471 2655 2912 3212 3493 3822] + + + [2759 2387 2148 1992 1848 1745 1665 1618 1599 1613 1661 1735 1847 1981 2147 2353 2698 2619 2203 2012 1843 1699 1585 1500 1450 1429 1447 1494 1571 1680 1822 1998 2184 2544 2482 2112 1914 1740 1587 1476 1390 1335 1314 1333 1382 1469 1580 1722 1890 2102 2441 2373 2032 1830 1649 1494 1378 1286 1231 1213 1230 1285 1370 1491 1639 1815 2013 2347 2273 1960 1751 1572 1419 1289 1202 1147 1129 1146 1200 1291 1410 1569 1746 1947 2293 2234 1905 1699 1516 1356 1231 1141 1087 1072 1088 1139 1228 1354 1513 1695 1898 2231 2198 1878 1667 1478 1318 1189 1101 1055 1037 1053 1102 1188 1315 1479 1658 1875 2216 2190 1869 1649 1466 1301 1171 1087 1041 1024 1038 1085 1173 1299 1465 1650 1859 2196 2195 1872 1659 1467 1303 1174 1091 1043 1026 1041 1090 1174 1303 1468 1653 1866 2197 2224 1891 1677 1493 1326 1198 1111 1060 1044 1061 1110 1197 1325 1485 1675 1879 2222 2228 1919 1712 1527 1367 1239 1146 1095 1079 1094 1144 1236 1363 1524 1706 1911 2253 2286 1959 1755 1576 1425 1300 1206 1154 1135 1152 1203 1299 1423 1578 1756 1955 2303 2346 2022 1828 1648 1503 1382 1291 1237 1217 1236 1290 1381 1497 1645 1829 2027 2374 2452 2106 1921 1750 1598 1489 1404 1342 1323 1346 1397 1484 1597 1749 1910 2128 2471 2567 2215 2038 1875 1725 1607 1526 1475 1456 1469 1524 1601 1715 1854 2034 2239 2574 2710 2352 2151 1999 1858 1742 1664 1617 1594 1616 1657 1742 1847 1980 2154 2371 2693 2846 2542 2318 2173 2032 1924 1852 1803 1790 1799 1846 1916 2012 2166 2336 2542 2824] + + + [2685 2337 2115 1949 1813 1722 1634 1593 1582 1592 1639 1716 1823 1968 2125 2352 2666 2576 2189 1993 1824 1685 1569 1491 1437 1420 1441 1493 1570 1687 1824 2001 2192 2554 2455 2090 1898 1718 1576 1464 1379 1324 1306 1326 1378 1468 1576 1726 1887 2107 2436 2344 2014 1817 1641 1487 1370 1277 1224 1206 1226 1280 1376 1491 1643 1825 2020 2359 2269 1947 1744 1563 1413 1286 1196 1141 1126 1144 1199 1293 1418 1572 1755 1955 2294 2216 1898 1698 1512 1355 1226 1137 1086 1067 1088 1140 1231 1359 1518 1696 1912 2245 2189 1874 1663 1479 1317 1191 1101 1053 1038 1054 1104 1192 1319 1485 1674 1880 2226 2186 1870 1653 1473 1300 1171 1087 1038 1024 1041 1087 1178 1309 1471 1659 1869 2205 2202 1876 1662 1472 1307 1177 1090 1042 1028 1042 1093 1180 1311 1478 1667 1879 2219 2212 1902 1683 1499 1330 1201 1111 1062 1045 1061 1111 1202 1331 1495 1686 1895 2240 2248 1925 1715 1534 1370 1241 1148 1095 1079 1097 1146 1238 1369 1534 1713 1923 2258 2289 1972 1766 1586 1428 1301 1205 1153 1134 1153 1206 1300 1422 1586 1761 1974 2320 2356 2032 1832 1654 1511 1381 1289 1235 1215 1232 1291 1381 1505 1654 1836 2032 2393 2455 2122 1927 1759 1598 1493 1397 1338 1321 1342 1397 1487 1595 1753 1919 2135 2477 2588 2220 2051 1877 1727 1606 1522 1470 1447 1468 1519 1600 1716 1859 2033 2243 2592 2709 2360 2169 2005 1866 1746 1660 1609 1589 1607 1655 1737 1844 1982 2153 2376 2700 2859 2553 2332 2176 2023 1923 1844 1799 1789 1794 1843 1916 2013 2167 2342 2546 2815] + + + [2415 2064 1878 1752 1642 1567 1503 1473 1468 1488 1519 1584 1682 1797 1939 2129 2478 2331 1989 1823 1691 1573 1487 1426 1386 1373 1389 1431 1500 1592 1712 1872 2040 2360 2204 1899 1737 1600 1485 1400 1331 1291 1280 1295 1342 1413 1508 1634 1768 1957 2255 2110 1837 1684 1534 1422 1321 1250 1206 1193 1216 1261 1341 1444 1571 1718 1878 2183 2043 1777 1621 1476 1357 1254 1174 1131 1118 1137 1191 1274 1385 1508 1666 1836 2119 1988 1738 1577 1433 1304 1197 1126 1080 1071 1087 1135 1217 1332 1472 1622 1803 2082 1971 1720 1554 1403 1277 1166 1089 1050 1040 1055 1101 1185 1301 1440 1595 1776 2061 1967 1710 1539 1396 1260 1153 1080 1038 1024 1043 1089 1171 1286 1425 1587 1759 2055 1971 1720 1554 1398 1267 1155 1082 1039 1030 1045 1092 1170 1292 1431 1594 1769 2055 1989 1735 1566 1419 1284 1172 1099 1057 1045 1059 1110 1190 1306 1448 1606 1785 2075 2016 1751 1587 1444 1316 1203 1130 1085 1075 1092 1140 1222 1338 1477 1635 1809 2097 2044 1799 1629 1485 1362 1260 1180 1133 1123 1141 1192 1273 1387 1523 1679 1849 2154 2122 1842 1684 1544 1423 1325 1252 1204 1192 1210 1262 1345 1446 1577 1735 1909 2210 2201 1917 1760 1622 1503 1416 1344 1297 1285 1302 1350 1433 1534 1662 1810 1996 2305 2334 2007 1861 1725 1596 1507 1443 1403 1387 1407 1455 1524 1619 1750 1900 2088 2406 2453 2131 1964 1827 1714 1617 1556 1515 1507 1514 1567 1632 1733 1850 2014 2214 2520 2604 2297 2081 1965 1832 1740 1683 1649 1639 1659 1689 1765 1858 1984 2162 2344 2666] + + + + + 2592x1944_D65_70 + + + 2592x1944 + + + D65 + + + [ 16] + + + [ 10] + + + [ 15] + + + [ 15] + + + [207 156 155 156 155 156 155 156] + + + [156 116 117 116 117 117 116 117] + + + [ 70] + + + [3587 3100 2738 2491 2295 2109 1993 1911 1896 1936 2016 2162 2344 2584 2870 3207 3603 3418 2835 2538 2263 2032 1861 1722 1653 1627 1656 1743 1895 2084 2337 2645 2942 3474 3220 2685 2358 2094 1855 1675 1547 1468 1446 1478 1564 1701 1905 2161 2442 2806 3308 3037 2530 2235 1940 1702 1525 1390 1318 1301 1325 1410 1552 1748 2006 2323 2661 3173 2941 2427 2111 1821 1588 1396 1271 1198 1178 1208 1292 1428 1631 1887 2205 2556 3077 2813 2351 2024 1736 1496 1310 1187 1120 1104 1126 1206 1338 1533 1797 2114 2473 3028 2804 2301 1966 1677 1434 1249 1134 1071 1053 1078 1151 1283 1475 1737 2051 2410 2978 2757 2276 1941 1651 1404 1224 1110 1046 1033 1052 1125 1250 1447 1706 2027 2392 2942 2764 2276 1929 1644 1398 1218 1105 1045 1024 1053 1118 1246 1445 1697 2016 2386 2936 2777 2305 1962 1666 1426 1244 1124 1063 1049 1074 1146 1274 1468 1731 2047 2419 2964 2830 2342 2008 1721 1480 1300 1176 1114 1094 1123 1196 1331 1526 1787 2108 2466 3021 2928 2427 2091 1812 1571 1385 1257 1191 1166 1199 1282 1420 1620 1881 2197 2566 3097 3036 2528 2223 1932 1694 1513 1380 1305 1285 1315 1404 1546 1754 2008 2325 2686 3236 3197 2674 2366 2080 1840 1658 1532 1454 1436 1467 1554 1703 1904 2172 2479 2840 3374 3380 2817 2534 2269 2023 1837 1713 1637 1611 1648 1738 1887 2082 2344 2657 3008 3515 3553 3014 2713 2451 2236 2044 1921 1854 1827 1865 1959 2096 2298 2564 2848 3224 3643 3740 3287 2949 2701 2503 2331 2209 2147 2128 2161 2254 2397 2577 2838 3134 3447 3801] + + + [2774 2376 2146 1988 1838 1742 1668 1612 1603 1617 1663 1737 1851 1985 2155 2377 2681 2603 2209 1994 1828 1689 1579 1499 1446 1430 1445 1493 1573 1680 1822 2004 2193 2546 2473 2095 1893 1721 1575 1466 1379 1329 1310 1328 1380 1460 1576 1718 1884 2102 2425 2348 2006 1807 1632 1484 1369 1279 1228 1206 1230 1280 1368 1486 1633 1810 2004 2349 2276 1941 1737 1562 1409 1287 1196 1144 1127 1145 1202 1292 1412 1565 1748 1945 2292 2212 1897 1685 1506 1352 1230 1139 1091 1075 1093 1143 1234 1357 1516 1696 1904 2257 2190 1867 1659 1474 1315 1191 1104 1055 1043 1056 1106 1193 1322 1480 1665 1876 2214 2179 1847 1639 1455 1297 1171 1085 1039 1026 1042 1089 1176 1303 1467 1651 1862 2202 2168 1852 1640 1457 1298 1166 1083 1038 1024 1037 1089 1172 1306 1459 1653 1859 2201 2175 1863 1658 1473 1314 1188 1103 1056 1038 1056 1104 1191 1319 1481 1664 1872 2213 2207 1892 1687 1508 1353 1230 1139 1090 1074 1092 1141 1233 1361 1516 1696 1906 2251 2267 1941 1741 1562 1416 1294 1202 1149 1133 1150 1203 1298 1420 1575 1748 1960 2299 2355 1996 1815 1635 1495 1376 1290 1235 1217 1234 1291 1383 1500 1649 1828 2037 2389 2443 2091 1896 1730 1588 1478 1394 1339 1321 1342 1395 1478 1597 1741 1915 2133 2485 2574 2186 2008 1852 1702 1587 1511 1461 1442 1461 1511 1592 1704 1841 2025 2240 2579 2696 2324 2123 1960 1828 1715 1640 1591 1576 1590 1641 1722 1826 1974 2144 2372 2683 2850 2527 2277 2124 1998 1889 1820 1777 1766 1775 1826 1900 2008 2147 2334 2546 2844] + + + [2696 2340 2111 1942 1815 1712 1638 1597 1581 1595 1645 1725 1829 1971 2139 2344 2657 2583 2172 1976 1810 1676 1565 1488 1436 1422 1441 1494 1573 1687 1828 2003 2194 2556 2427 2070 1868 1703 1561 1452 1369 1320 1304 1324 1374 1459 1572 1721 1881 2100 2433 2332 1979 1794 1619 1474 1360 1271 1220 1200 1227 1278 1372 1486 1636 1816 2010 2355 2248 1925 1724 1549 1404 1282 1193 1140 1123 1144 1201 1290 1417 1568 1752 1946 2296 2192 1880 1678 1502 1348 1224 1135 1087 1073 1091 1144 1234 1360 1521 1699 1911 2243 2169 1852 1652 1468 1316 1188 1102 1056 1041 1059 1109 1197 1327 1485 1669 1877 2231 2166 1844 1638 1458 1293 1172 1086 1037 1024 1042 1091 1180 1311 1471 1657 1863 2213 2155 1843 1642 1453 1297 1169 1086 1037 1024 1040 1090 1177 1308 1469 1658 1860 2212 2178 1863 1653 1477 1316 1189 1101 1055 1040 1056 1107 1196 1323 1484 1672 1877 2220 2202 1890 1694 1510 1358 1231 1140 1090 1074 1091 1145 1235 1367 1524 1701 1918 2260 2269 1941 1743 1571 1418 1294 1203 1147 1133 1150 1206 1299 1421 1578 1760 1966 2311 2348 2012 1815 1641 1499 1381 1288 1234 1216 1235 1295 1386 1504 1652 1838 2044 2414 2452 2086 1906 1740 1588 1479 1393 1336 1322 1341 1397 1480 1602 1746 1925 2134 2489 2586 2195 2014 1861 1706 1593 1511 1459 1439 1459 1511 1596 1706 1846 2035 2248 2576 2703 2331 2127 1968 1835 1716 1642 1591 1577 1591 1644 1720 1829 1972 2148 2373 2697 2873 2540 2289 2128 1993 1906 1826 1780 1757 1782 1824 1904 2006 2151 2349 2536 2835] + + + [2438 2107 1917 1769 1661 1575 1520 1482 1482 1492 1536 1606 1703 1825 1960 2174 2473 2355 2024 1838 1700 1585 1495 1421 1388 1373 1394 1435 1507 1606 1724 1888 2058 2378 2230 1905 1742 1599 1481 1393 1325 1286 1270 1290 1337 1401 1506 1631 1775 1964 2251 2126 1845 1675 1531 1409 1317 1241 1196 1187 1206 1256 1336 1441 1559 1720 1893 2189 2056 1780 1613 1474 1351 1249 1170 1128 1115 1135 1184 1265 1375 1512 1665 1837 2134 2003 1743 1576 1431 1302 1199 1120 1080 1069 1086 1137 1217 1330 1469 1629 1805 2111 1975 1722 1550 1406 1274 1164 1090 1052 1039 1056 1102 1182 1296 1444 1597 1785 2069 1982 1710 1547 1389 1259 1151 1076 1036 1027 1044 1086 1169 1279 1424 1590 1766 2060 1964 1714 1541 1387 1257 1143 1073 1037 1024 1042 1083 1161 1280 1424 1589 1764 2060 1976 1726 1550 1407 1271 1160 1088 1049 1037 1052 1101 1179 1293 1438 1594 1781 2066 2013 1752 1579 1433 1303 1194 1119 1076 1068 1084 1127 1213 1327 1466 1625 1797 2095 2057 1789 1626 1481 1357 1248 1173 1128 1116 1135 1185 1268 1376 1514 1674 1861 2158 2135 1854 1687 1545 1421 1326 1247 1204 1187 1207 1261 1344 1449 1581 1739 1929 2242 2227 1921 1760 1624 1498 1411 1337 1292 1280 1300 1349 1428 1528 1656 1813 2001 2321 2344 2009 1848 1716 1591 1498 1435 1395 1379 1395 1446 1517 1620 1750 1906 2100 2422 2461 2134 1951 1816 1703 1600 1545 1501 1493 1512 1550 1625 1721 1848 2018 2224 2515 2616 2291 2074 1930 1814 1742 1666 1633 1630 1641 1690 1758 1849 1997 2168 2360 2675] + + + + + 2592x1944_D75_70 + + + 2592x1944 + + + D75 + + + [ 16] + + + [ 10] + + + [ 15] + + + [ 15] + + + [207 156 155 156 155 156 155 156] + + + [156 116 117 116 117 117 116 117] + + + [ 70] + + + [3447 2968 2652 2427 2225 2068 1950 1882 1861 1895 1968 2109 2268 2511 2787 3086 3549 3232 2724 2432 2171 1979 1825 1700 1631 1608 1639 1721 1841 2039 2264 2556 2835 3345 3085 2571 2262 1925 1773 1649 1532 1461 1439 1467 1551 1677 1868 2105 2379 2720 3195 2946 2455 2069 1725 1497 1490 1388 1317 1297 1326 1404 1537 1723 1967 2249 2576 3091 2825 2361 2034 1514 1453 1394 1266 1194 1185 1203 1286 1420 1608 1853 2144 2483 2975 2749 2298 1980 1672 1449 1309 1183 1122 1102 1129 1198 1327 1518 1766 2050 2395 2898 2706 2242 1935 1656 1424 1246 1130 1066 1050 1075 1146 1272 1455 1703 1995 2332 2861 2673 2231 1906 1629 1402 1221 1107 1043 1028 1052 1123 1241 1424 1676 1968 2301 2820 2707 2227 1910 1635 1399 1223 1106 1041 1024 1047 1108 1238 1432 1671 1971 2305 2835 2719 2257 1929 1663 1427 1249 1131 1066 1048 1067 1101 1239 1450 1700 1997 2333 2853 2745 2298 1993 1707 1481 1302 1182 1115 1099 1080 1094 1265 1502 1751 2045 2392 2900 2849 2377 2066 1795 1566 1385 1260 1187 1166 1180 1175 1387 1584 1832 2125 2455 2972 2934 2475 2178 1895 1679 1500 1372 1301 1281 1300 1371 1507 1707 1948 2237 2578 3066 3106 2597 2319 2049 1814 1649 1519 1448 1422 1452 1527 1666 1849 2084 2373 2696 3224 3257 2755 2485 2234 1997 1813 1696 1626 1598 1630 1708 1835 2009 2256 2544 2854 3355 3434 2946 2657 2413 2197 2019 1899 1827 1803 1830 1919 2042 2219 2450 2721 3052 3515 3609 3230 2915 2677 2460 2293 2182 2106 2092 2120 2197 2321 2493 2726 3002 3279 3620] + + + [2722 2367 2125 1975 1838 1735 1660 1614 1594 1611 1653 1718 1833 1967 2136 2355 2694 2571 2177 1980 1810 1681 1575 1492 1441 1420 1438 1485 1566 1666 1802 1986 2174 2533 2451 2077 1878 1675 1558 1462 1382 1329 1312 1329 1375 1452 1567 1711 1870 2085 2409 2343 1998 1774 1560 1405 1362 1283 1231 1210 1230 1281 1369 1479 1626 1793 1999 2333 2263 1935 1731 1440 1356 1289 1201 1149 1133 1151 1200 1289 1406 1555 1734 1932 2276 2212 1894 1689 1493 1341 1232 1141 1093 1079 1092 1144 1227 1351 1501 1679 1885 2218 2177 1861 1657 1471 1314 1189 1105 1055 1040 1059 1103 1187 1311 1467 1647 1851 2191 2176 1852 1638 1462 1296 1174 1088 1039 1025 1041 1088 1169 1295 1450 1631 1839 2172 2170 1852 1651 1458 1302 1174 1089 1042 1024 1039 1084 1172 1295 1452 1632 1839 2173 2196 1873 1665 1481 1325 1195 1112 1062 1043 1056 1084 1179 1313 1474 1653 1859 2188 2209 1902 1699 1518 1364 1240 1150 1097 1080 1077 1095 1208 1349 1505 1683 1890 2221 2265 1944 1746 1569 1422 1296 1206 1153 1134 1143 1153 1278 1409 1559 1737 1933 2285 2338 2002 1813 1642 1496 1376 1289 1234 1215 1228 1277 1363 1486 1629 1802 2006 2348 2419 2092 1897 1739 1587 1480 1393 1339 1317 1337 1384 1467 1573 1717 1891 2098 2438 2549 2188 2014 1851 1705 1594 1515 1458 1441 1454 1505 1578 1683 1823 1995 2199 2543 2682 2326 2130 1969 1839 1719 1645 1598 1578 1593 1639 1709 1806 1947 2118 2336 2661 2829 2521 2296 2146 2000 1906 1824 1779 1765 1778 1821 1887 2000 2123 2312 2509 2833] + + + [2664 2314 2092 1929 1808 1706 1632 1594 1576 1592 1641 1709 1812 1953 2116 2333 2682 2531 2148 1959 1794 1663 1562 1481 1434 1417 1436 1481 1563 1668 1808 1983 2172 2543 2415 2047 1853 1655 1549 1448 1370 1323 1303 1322 1372 1452 1569 1704 1869 2085 2411 2299 1984 1750 1548 1392 1352 1275 1223 1205 1227 1278 1366 1476 1626 1794 1995 2343 2240 1916 1717 1430 1350 1284 1194 1145 1129 1147 1200 1288 1413 1561 1736 1940 2271 2187 1874 1674 1487 1334 1227 1138 1089 1073 1095 1141 1229 1351 1505 1680 1888 2227 2159 1855 1648 1465 1316 1189 1103 1057 1041 1057 1108 1192 1317 1472 1648 1858 2200 2145 1850 1636 1458 1294 1171 1087 1039 1024 1043 1090 1171 1296 1453 1635 1839 2169 2162 1844 1647 1461 1303 1176 1090 1042 1024 1041 1087 1175 1301 1460 1640 1846 2185 2181 1867 1667 1483 1324 1198 1111 1063 1044 1055 1090 1180 1323 1476 1660 1862 2203 2210 1904 1701 1522 1364 1241 1148 1096 1082 1077 1098 1210 1354 1514 1690 1897 2237 2266 1944 1748 1572 1423 1300 1205 1155 1132 1147 1155 1284 1412 1562 1742 1944 2295 2331 2013 1818 1646 1500 1381 1291 1233 1216 1229 1279 1371 1487 1633 1808 2017 2358 2429 2095 1906 1741 1593 1480 1394 1337 1317 1339 1384 1467 1578 1721 1892 2102 2446 2544 2197 2024 1861 1711 1594 1512 1457 1441 1454 1505 1583 1687 1827 2004 2205 2548 2692 2333 2135 1981 1841 1726 1649 1596 1578 1592 1639 1712 1811 1950 2128 2342 2663 2843 2545 2316 2154 2009 1910 1833 1781 1767 1785 1824 1897 1999 2137 2315 2519 2829] + + + [2408 2099 1898 1778 1664 1581 1521 1488 1474 1489 1527 1596 1682 1805 1950 2154 2448 2313 1983 1817 1677 1572 1494 1424 1388 1376 1387 1429 1497 1587 1702 1860 2028 2356 2210 1894 1724 1549 1465 1397 1335 1293 1276 1295 1335 1407 1503 1616 1761 1949 2235 2103 1839 1628 1445 1310 1313 1250 1208 1193 1213 1260 1338 1433 1559 1705 1870 2176 2056 1776 1615 1324 1282 1258 1179 1133 1122 1141 1189 1270 1375 1501 1653 1822 2109 1987 1750 1579 1412 1289 1206 1123 1084 1072 1086 1136 1216 1326 1459 1608 1785 2081 1975 1721 1557 1407 1280 1169 1093 1049 1039 1056 1100 1179 1293 1427 1577 1761 2041 1969 1717 1543 1401 1264 1154 1076 1037 1025 1040 1087 1163 1275 1414 1567 1740 2037 1973 1721 1557 1398 1269 1157 1079 1036 1024 1040 1076 1164 1273 1417 1571 1750 2025 1988 1734 1570 1422 1287 1174 1097 1057 1040 1050 1072 1160 1296 1430 1590 1760 2047 2016 1766 1598 1448 1317 1211 1133 1085 1074 1058 1060 1180 1321 1459 1612 1787 2080 2058 1800 1637 1493 1368 1263 1180 1137 1119 1125 1118 1252 1373 1499 1656 1833 2123 2125 1852 1695 1551 1431 1331 1256 1206 1192 1204 1248 1328 1437 1561 1716 1889 2205 2218 1926 1765 1629 1507 1417 1342 1298 1278 1298 1339 1414 1509 1634 1785 1965 2278 2334 2010 1865 1726 1601 1508 1441 1402 1387 1401 1444 1508 1601 1720 1874 2060 2375 2444 2134 1967 1825 1719 1613 1558 1509 1501 1511 1555 1614 1708 1832 1985 2183 2487 2618 2304 2100 1963 1845 1751 1686 1654 1638 1656 1682 1765 1843 1968 2135 2335 2650] + + + + + 2592x1944_F11_70 + + + 2592x1944 + + + F11 + + + [ 16] + + + [ 10] + + + [ 15] + + + [ 15] + + + [207 156 155 156 155 156 155 156] + + + [156 116 117 116 117 117 116 117] + + + [ 70] + + + [3550 3067 2721 2439 2191 1987 1856 1766 1746 1781 1856 1991 2197 2444 2756 3100 3468 3386 2844 2485 2168 1921 1729 1590 1520 1497 1512 1599 1721 1922 2183 2520 2841 3331 3202 2652 2302 1987 1733 1554 1427 1355 1335 1360 1432 1554 1737 2000 2294 2706 3189 3047 2505 2142 1834 1584 1412 1295 1235 1215 1241 1303 1421 1598 1847 2168 2535 3097 2921 2380 2018 1713 1475 1310 1204 1143 1131 1148 1211 1319 1491 1719 2036 2426 2980 2846 2294 1923 1624 1395 1235 1137 1087 1071 1091 1142 1252 1404 1641 1947 2323 2897 2790 2238 1865 1566 1345 1192 1096 1054 1036 1053 1106 1199 1354 1575 1881 2271 2840 2773 2211 1835 1540 1321 1169 1081 1035 1025 1038 1087 1184 1327 1553 1845 2230 2829 2778 2207 1833 1538 1318 1169 1079 1038 1024 1038 1087 1177 1332 1553 1852 2229 2832 2780 2237 1864 1571 1337 1194 1097 1051 1040 1057 1108 1205 1352 1582 1882 2265 2842 2857 2294 1927 1624 1393 1237 1139 1091 1073 1095 1148 1247 1409 1637 1942 2329 2931 2934 2386 2019 1709 1478 1311 1207 1151 1132 1157 1217 1324 1493 1736 2050 2444 3019 3072 2509 2151 1829 1588 1415 1302 1243 1224 1244 1312 1434 1612 1856 2182 2572 3162 3229 2673 2310 1997 1733 1562 1431 1363 1341 1372 1443 1573 1760 2030 2348 2747 3274 3408 2853 2505 2201 1932 1723 1605 1527 1506 1529 1612 1749 1944 2204 2561 2924 3431 3570 3066 2706 2426 2158 1952 1809 1729 1709 1732 1823 1969 2168 2444 2776 3166 3555 3688 3406 3014 2717 2462 2277 2129 2052 2018 2054 2146 2299 2502 2793 3085 3383 3683] + + + [2773 2435 2192 2025 1871 1758 1678 1625 1601 1620 1664 1744 1852 2002 2175 2400 2701 2649 2241 2040 1853 1703 1579 1495 1440 1422 1435 1485 1560 1670 1823 2013 2212 2567 2520 2143 1928 1743 1582 1465 1378 1321 1300 1319 1369 1449 1567 1707 1879 2110 2444 2410 2051 1837 1645 1491 1364 1278 1224 1205 1219 1271 1355 1472 1619 1808 2018 2369 2320 1990 1761 1575 1410 1287 1198 1145 1126 1142 1197 1279 1396 1555 1739 1953 2310 2279 1930 1711 1511 1355 1227 1138 1090 1072 1089 1135 1221 1341 1496 1683 1908 2271 2241 1902 1673 1477 1315 1187 1102 1055 1039 1053 1099 1180 1303 1462 1649 1869 2225 2231 1883 1652 1462 1291 1168 1084 1039 1024 1036 1082 1164 1282 1446 1628 1856 2210 2222 1885 1655 1462 1296 1168 1084 1040 1024 1041 1084 1161 1289 1442 1634 1854 2204 2255 1906 1674 1478 1322 1190 1106 1060 1045 1056 1102 1185 1305 1470 1654 1874 2226 2280 1937 1720 1523 1361 1237 1149 1096 1078 1092 1144 1228 1349 1506 1694 1921 2267 2344 2002 1776 1580 1430 1302 1209 1154 1139 1152 1205 1294 1415 1570 1755 1974 2332 2403 2065 1855 1660 1507 1390 1294 1242 1220 1237 1288 1380 1493 1651 1836 2060 2418 2532 2149 1951 1768 1607 1489 1402 1345 1323 1342 1394 1476 1596 1742 1937 2152 2503 2645 2265 2072 1898 1731 1612 1525 1468 1453 1467 1517 1599 1709 1858 2051 2265 2626 2790 2412 2197 2026 1884 1750 1672 1615 1594 1613 1660 1738 1853 2002 2182 2411 2745 2963 2651 2385 2222 2070 1956 1874 1826 1805 1820 1866 1945 2048 2210 2392 2598 2917] + + + [2725 2386 2140 1977 1828 1722 1633 1587 1567 1591 1631 1712 1826 1974 2157 2370 2668 2633 2242 2028 1842 1685 1565 1482 1422 1410 1422 1471 1559 1673 1822 2023 2227 2583 2500 2141 1910 1732 1572 1451 1358 1310 1286 1309 1358 1444 1563 1716 1889 2129 2472 2407 2047 1839 1642 1484 1358 1269 1211 1195 1212 1266 1361 1473 1628 1817 2040 2393 2338 1992 1768 1572 1415 1282 1194 1137 1123 1141 1192 1281 1407 1565 1753 1973 2349 2281 1943 1716 1523 1358 1228 1137 1087 1069 1085 1136 1225 1352 1505 1700 1931 2285 2265 1914 1686 1487 1318 1192 1101 1054 1038 1053 1103 1190 1311 1480 1666 1898 2265 2243 1905 1668 1474 1304 1174 1087 1042 1024 1038 1086 1167 1297 1455 1651 1879 2245 2268 1909 1678 1471 1307 1174 1088 1038 1025 1039 1085 1172 1297 1463 1653 1880 2245 2262 1934 1699 1499 1330 1198 1109 1062 1042 1057 1104 1190 1320 1480 1675 1901 2266 2318 1972 1736 1541 1368 1241 1151 1094 1080 1095 1141 1234 1359 1521 1715 1935 2305 2375 2026 1799 1600 1437 1309 1209 1156 1133 1154 1204 1299 1419 1583 1770 1995 2371 2451 2094 1874 1674 1516 1391 1293 1237 1216 1233 1287 1377 1505 1653 1854 2075 2442 2561 2177 1972 1782 1611 1493 1398 1337 1318 1333 1390 1475 1592 1749 1944 2178 2530 2673 2289 2091 1902 1737 1605 1518 1460 1438 1457 1508 1591 1709 1860 2061 2277 2641 2829 2435 2215 2033 1882 1745 1660 1600 1584 1593 1644 1733 1842 1994 2192 2422 2755 2980 2662 2396 2217 2059 1948 1852 1809 1783 1803 1846 1922 2043 2201 2382 2604 2928] + + + [2372 2062 1872 1739 1625 1544 1478 1447 1446 1457 1495 1577 1670 1801 1960 2164 2437 2360 1992 1820 1676 1553 1470 1396 1364 1355 1372 1419 1486 1589 1709 1887 2061 2393 2228 1902 1726 1578 1461 1370 1309 1265 1256 1277 1320 1396 1493 1622 1772 1971 2281 2123 1835 1665 1522 1396 1303 1228 1191 1176 1198 1255 1328 1437 1559 1723 1903 2213 2057 1788 1611 1461 1338 1239 1159 1121 1116 1133 1179 1264 1369 1513 1673 1852 2157 2012 1736 1568 1427 1293 1188 1118 1076 1066 1086 1132 1217 1330 1463 1625 1802 2122 1983 1721 1545 1386 1259 1152 1083 1046 1039 1055 1102 1181 1294 1445 1592 1791 2089 1975 1715 1529 1387 1245 1139 1069 1032 1026 1039 1083 1160 1277 1418 1581 1766 2062 1984 1715 1538 1387 1246 1141 1074 1034 1024 1040 1085 1165 1278 1422 1580 1768 2080 2007 1728 1555 1396 1270 1159 1083 1048 1044 1055 1100 1178 1297 1436 1599 1788 2090 2028 1764 1588 1433 1306 1197 1124 1081 1070 1088 1136 1220 1329 1476 1626 1826 2125 2089 1806 1638 1488 1358 1254 1174 1136 1122 1140 1194 1277 1383 1528 1692 1879 2213 2162 1867 1696 1548 1424 1321 1246 1200 1191 1213 1266 1344 1455 1587 1753 1944 2280 2273 1945 1785 1618 1502 1405 1336 1293 1278 1292 1346 1427 1527 1662 1825 2040 2352 2377 2040 1866 1722 1593 1497 1434 1386 1378 1396 1442 1514 1613 1753 1924 2120 2443 2512 2173 1980 1821 1702 1602 1536 1495 1491 1500 1553 1623 1731 1855 2041 2249 2583 2696 2356 2122 1981 1857 1742 1678 1641 1628 1654 1694 1754 1871 2025 2207 2405 2755] + + + + + 2592x1944_F12_70 + + + 2592x1944 + + + F12 + + + [ 16] + + + [ 10] + + + [ 15] + + + [ 15] + + + [207 156 155 156 155 156 155 156] + + + [156 116 117 116 117 117 116 117] + + + [ 70] + + + [4261 3731 3287 2955 2671 2444 2264 2158 2123 2161 2263 2434 2665 2982 3312 3711 4216 4053 3382 2978 2640 2335 2088 1915 1809 1772 1809 1908 2084 2331 2648 3025 3380 3975 3822 3175 2785 2412 2105 1853 1679 1574 1541 1573 1676 1857 2101 2424 2782 3226 3792 3612 2999 2601 2223 1899 1657 1483 1383 1352 1386 1483 1661 1907 2237 2628 3051 3654 3478 2853 2443 2054 1747 1497 1329 1235 1209 1237 1335 1501 1751 2071 2474 2902 3554 3353 2762 2327 1946 1620 1379 1224 1140 1114 1141 1224 1390 1630 1957 2352 2806 3460 3312 2688 2254 1864 1544 1310 1160 1078 1050 1077 1163 1316 1550 1881 2274 2722 3418 3287 2668 2219 1835 1509 1277 1131 1050 1025 1049 1132 1282 1515 1843 2236 2693 3371 3295 2672 2223 1830 1508 1277 1128 1052 1024 1050 1131 1284 1518 1843 2240 2705 3373 3308 2709 2254 1872 1545 1311 1162 1077 1054 1084 1165 1320 1556 1884 2280 2740 3421 3387 2760 2333 1940 1617 1378 1223 1140 1113 1141 1229 1387 1629 1960 2357 2815 3485 3479 2884 2440 2061 1741 1491 1326 1234 1204 1237 1333 1500 1751 2079 2475 2922 3587 3608 3003 2603 2214 1897 1650 1475 1375 1345 1381 1482 1660 1914 2244 2639 3074 3713 3799 3183 2797 2428 2091 1856 1674 1566 1538 1573 1681 1862 2117 2439 2831 3257 3868 3991 3377 3021 2670 2345 2087 1918 1806 1772 1809 1923 2108 2350 2684 3064 3462 4029 4171 3619 3246 2923 2628 2360 2196 2088 2051 2093 2199 2379 2627 2940 3288 3715 4183 4330 3964 3600 3269 2987 2756 2588 2482 2446 2500 2606 2781 3013 3314 3657 4001 4274] + + + [2793 2419 2193 2015 1887 1776 1706 1652 1632 1648 1691 1760 1870 2005 2170 2400 2725 2618 2223 2016 1858 1717 1605 1519 1472 1447 1463 1511 1590 1691 1835 2007 2190 2563 2496 2114 1920 1749 1606 1493 1403 1346 1329 1342 1398 1479 1592 1730 1895 2102 2420 2365 2027 1832 1662 1509 1386 1298 1243 1223 1242 1291 1385 1497 1644 1814 2012 2341 2287 1958 1758 1587 1432 1305 1211 1155 1136 1152 1209 1298 1423 1575 1751 1950 2285 2223 1909 1710 1528 1367 1240 1147 1095 1079 1096 1146 1237 1363 1519 1699 1898 2246 2189 1887 1678 1494 1331 1201 1109 1059 1041 1058 1109 1196 1325 1489 1665 1872 2211 2192 1872 1664 1477 1311 1180 1094 1043 1024 1041 1092 1179 1308 1470 1656 1856 2193 2189 1874 1671 1480 1319 1184 1095 1044 1026 1044 1092 1181 1310 1475 1656 1864 2193 2212 1893 1685 1501 1337 1206 1118 1065 1046 1061 1113 1202 1333 1497 1675 1881 2214 2225 1926 1719 1541 1380 1253 1158 1103 1086 1103 1152 1247 1374 1533 1712 1913 2253 2286 1971 1773 1595 1444 1318 1222 1164 1145 1165 1220 1313 1439 1590 1767 1965 2311 2362 2038 1846 1670 1527 1404 1314 1255 1234 1251 1307 1397 1516 1664 1839 2041 2380 2461 2120 1936 1779 1623 1514 1424 1365 1345 1365 1421 1506 1620 1763 1937 2135 2471 2587 2232 2058 1899 1751 1629 1554 1496 1479 1494 1543 1626 1731 1874 2044 2243 2579 2718 2369 2169 2019 1886 1765 1691 1636 1622 1639 1681 1762 1862 1996 2172 2383 2697 2881 2565 2349 2199 2051 1959 1874 1826 1816 1830 1872 1947 2049 2183 2359 2563 2828] + + + [2746 2388 2142 1982 1841 1735 1652 1606 1592 1608 1652 1727 1836 1977 2154 2365 2731 2615 2218 2005 1839 1697 1585 1499 1448 1426 1447 1496 1576 1687 1835 2016 2205 2578 2493 2111 1914 1742 1591 1475 1383 1330 1313 1330 1385 1473 1586 1736 1901 2117 2449 2386 2028 1845 1653 1506 1380 1286 1232 1211 1232 1289 1378 1500 1656 1829 2036 2376 2310 1967 1771 1590 1432 1301 1206 1147 1132 1149 1207 1299 1429 1590 1769 1980 2323 2254 1932 1726 1540 1376 1240 1147 1091 1074 1093 1149 1240 1372 1538 1717 1933 2279 2230 1912 1696 1507 1339 1202 1110 1057 1038 1058 1111 1202 1335 1504 1693 1903 2266 2226 1902 1684 1495 1322 1189 1095 1042 1024 1041 1096 1188 1321 1486 1680 1894 2235 2234 1908 1689 1502 1326 1190 1097 1044 1025 1044 1095 1191 1322 1495 1679 1895 2248 2253 1927 1717 1523 1354 1211 1119 1064 1046 1062 1116 1209 1346 1511 1702 1911 2269 2286 1955 1749 1563 1392 1259 1157 1103 1080 1102 1153 1254 1383 1551 1733 1951 2288 2336 2007 1802 1616 1455 1322 1222 1160 1144 1157 1220 1313 1445 1603 1787 1996 2350 2399 2066 1874 1686 1537 1403 1306 1246 1226 1246 1303 1396 1523 1674 1861 2065 2424 2495 2148 1958 1790 1627 1513 1418 1354 1332 1353 1407 1499 1615 1769 1944 2149 2514 2631 2252 2077 1910 1748 1627 1533 1480 1457 1476 1529 1611 1726 1869 2051 2260 2594 2747 2387 2184 2022 1876 1752 1672 1614 1597 1607 1660 1735 1849 1987 2163 2385 2716 2907 2593 2354 2197 2045 1935 1845 1794 1779 1796 1836 1918 2029 2168 2357 2561 2857] + + + [2214 1930 1756 1650 1577 1525 1480 1470 1459 1477 1525 1572 1639 1744 1856 2029 2362 2138 1799 1683 1593 1516 1453 1411 1375 1382 1400 1435 1494 1565 1663 1779 1909 2236 2011 1743 1628 1534 1450 1384 1333 1305 1296 1321 1366 1427 1511 1604 1706 1835 2108 1923 1696 1582 1485 1400 1322 1259 1222 1219 1243 1296 1370 1463 1564 1679 1797 2031 1873 1643 1549 1444 1351 1260 1189 1144 1138 1164 1227 1310 1418 1529 1644 1760 2016 1824 1634 1516 1417 1308 1214 1137 1096 1082 1109 1168 1262 1373 1497 1616 1738 1985 1813 1615 1507 1394 1286 1178 1102 1055 1043 1073 1134 1224 1346 1476 1600 1726 1957 1815 1617 1506 1395 1273 1165 1087 1039 1025 1051 1118 1209 1339 1465 1604 1716 1951 1823 1630 1511 1390 1281 1169 1087 1037 1024 1053 1116 1207 1333 1469 1597 1724 1951 1836 1642 1522 1416 1295 1189 1108 1062 1047 1079 1136 1230 1348 1487 1608 1741 1963 1853 1659 1543 1437 1329 1223 1146 1098 1086 1113 1173 1267 1382 1509 1631 1761 1989 1895 1687 1576 1466 1375 1275 1200 1154 1142 1170 1229 1318 1427 1539 1660 1790 2045 1963 1731 1613 1517 1423 1345 1274 1232 1223 1245 1304 1383 1482 1588 1713 1832 2101 2035 1789 1672 1579 1486 1417 1358 1318 1304 1337 1378 1464 1532 1647 1753 1882 2166 2162 1854 1747 1648 1553 1482 1436 1402 1390 1419 1465 1517 1608 1702 1816 1975 2259 2285 1952 1815 1716 1639 1558 1515 1487 1481 1505 1534 1605 1672 1764 1899 2066 2362 2463 2127 1944 1824 1720 1659 1589 1560 1563 1594 1628 1676 1763 1874 2026 2211 2538] + + + + + 2592x1944_F2_70 + + + 2592x1944 + + + F2 + + + [ 16] + + + [ 10] + + + [ 15] + + + [ 15] + + + [207 156 155 156 155 156 155 156] + + + [156 116 117 116 117 117 116 117] + + + [ 70] + + + [3291 2847 2570 2312 2123 1959 1852 1780 1761 1785 1857 1979 2163 2370 2646 2952 3314 3163 2672 2367 2109 1895 1737 1619 1550 1532 1552 1627 1750 1927 2140 2445 2716 3194 3003 2513 2214 1952 1737 1581 1462 1397 1380 1402 1478 1590 1764 1997 2265 2597 3041 2844 2395 2093 1819 1609 1449 1335 1272 1249 1277 1344 1469 1638 1862 2141 2469 2924 2735 2286 1984 1717 1506 1344 1231 1168 1154 1174 1246 1359 1532 1753 2027 2358 2864 2674 2199 1897 1639 1428 1265 1156 1103 1085 1107 1168 1285 1449 1671 1947 2286 2789 2610 2149 1846 1583 1373 1213 1111 1058 1045 1061 1124 1229 1397 1621 1894 2214 2729 2593 2131 1817 1559 1347 1190 1089 1038 1027 1044 1099 1210 1368 1592 1861 2192 2694 2597 2136 1815 1557 1347 1188 1089 1038 1024 1045 1100 1204 1372 1591 1866 2205 2706 2626 2156 1848 1584 1371 1213 1110 1057 1045 1065 1122 1235 1395 1623 1890 2228 2732 2688 2205 1894 1636 1419 1262 1153 1098 1082 1105 1165 1282 1443 1677 1948 2291 2776 2746 2287 1974 1711 1499 1340 1223 1164 1148 1174 1240 1356 1533 1754 2033 2360 2871 2858 2382 2087 1815 1602 1435 1328 1266 1241 1266 1341 1464 1634 1871 2147 2488 2990 3006 2515 2214 1959 1734 1577 1457 1387 1369 1401 1467 1600 1770 2001 2282 2634 3111 3165 2668 2378 2123 1905 1722 1618 1555 1526 1555 1634 1758 1928 2166 2468 2771 3242 3323 2862 2558 2309 2098 1920 1813 1737 1722 1746 1822 1953 2138 2371 2651 2977 3399 3542 3157 2822 2574 2363 2196 2074 2011 2002 2031 2106 2233 2408 2655 2922 3207 3536] + + + [2779 2384 2154 1997 1853 1747 1670 1617 1601 1616 1661 1738 1846 1984 2178 2375 2695 2602 2220 2013 1835 1694 1579 1493 1442 1424 1441 1484 1567 1674 1818 2002 2199 2546 2498 2111 1904 1728 1580 1466 1381 1328 1310 1325 1377 1453 1565 1714 1880 2109 2434 2373 2030 1822 1643 1489 1369 1282 1231 1209 1226 1280 1367 1478 1631 1805 2011 2357 2296 1957 1752 1568 1415 1293 1203 1149 1132 1147 1202 1289 1406 1561 1740 1947 2314 2240 1913 1694 1512 1355 1229 1145 1089 1076 1090 1141 1229 1352 1502 1683 1905 2253 2201 1871 1659 1474 1313 1190 1101 1058 1038 1053 1099 1186 1310 1473 1646 1858 2216 2192 1857 1634 1457 1292 1170 1085 1036 1024 1038 1083 1166 1292 1448 1632 1844 2195 2183 1859 1644 1457 1298 1169 1084 1039 1024 1037 1083 1170 1294 1452 1636 1843 2200 2207 1879 1668 1479 1320 1193 1108 1058 1043 1056 1104 1189 1320 1472 1655 1868 2213 2251 1911 1701 1519 1366 1238 1148 1094 1080 1096 1144 1235 1353 1516 1690 1910 2250 2294 1962 1752 1575 1422 1302 1210 1155 1136 1154 1206 1297 1419 1570 1752 1960 2323 2378 2025 1827 1641 1506 1378 1293 1236 1219 1234 1290 1377 1491 1647 1818 2035 2375 2474 2110 1915 1744 1591 1484 1396 1341 1317 1343 1387 1477 1590 1736 1916 2141 2488 2610 2225 2028 1867 1713 1598 1516 1462 1447 1460 1514 1588 1698 1843 2039 2241 2583 2757 2373 2158 1984 1853 1730 1654 1605 1587 1601 1653 1729 1839 1980 2166 2381 2723 2931 2577 2334 2176 2032 1925 1849 1802 1788 1798 1851 1921 2033 2186 2362 2578 2888] + + + [2698 2356 2116 1949 1822 1707 1640 1588 1567 1591 1637 1712 1818 1971 2151 2365 2667 2602 2203 2001 1824 1679 1566 1482 1433 1419 1434 1484 1564 1675 1828 2019 2219 2577 2469 2104 1898 1718 1570 1455 1370 1318 1302 1319 1371 1455 1571 1722 1886 2120 2463 2388 2018 1824 1634 1481 1367 1278 1221 1202 1226 1280 1363 1488 1630 1822 2035 2381 2288 1967 1749 1568 1418 1289 1199 1147 1128 1146 1203 1293 1417 1570 1754 1972 2339 2252 1914 1702 1518 1358 1231 1144 1089 1074 1091 1145 1234 1359 1518 1704 1916 2278 2223 1880 1671 1480 1321 1193 1102 1056 1039 1055 1106 1194 1322 1482 1668 1890 2253 2210 1878 1654 1467 1299 1175 1086 1040 1024 1039 1087 1176 1300 1462 1646 1867 2226 2211 1878 1663 1465 1305 1177 1088 1040 1027 1040 1089 1177 1308 1470 1656 1869 2235 2232 1907 1679 1492 1329 1200 1111 1061 1045 1058 1109 1198 1328 1484 1673 1897 2246 2278 1937 1726 1530 1376 1243 1152 1097 1079 1099 1149 1239 1366 1528 1716 1931 2285 2332 1989 1774 1589 1432 1307 1213 1156 1139 1155 1209 1305 1428 1583 1766 1988 2350 2412 2049 1843 1661 1511 1386 1292 1239 1219 1235 1291 1380 1503 1655 1840 2060 2422 2510 2129 1937 1760 1602 1485 1397 1342 1320 1339 1393 1479 1594 1744 1932 2151 2510 2647 2254 2050 1879 1721 1598 1514 1460 1442 1455 1511 1590 1703 1853 2041 2262 2606 2788 2399 2173 2001 1861 1736 1654 1598 1580 1596 1648 1724 1839 1985 2165 2400 2741 2959 2609 2357 2186 2032 1919 1838 1798 1777 1790 1828 1915 2023 2174 2364 2576 2919] + + + [2386 2047 1859 1732 1619 1534 1486 1458 1451 1465 1509 1580 1681 1802 1961 2168 2512 2323 1973 1798 1659 1545 1470 1402 1363 1359 1373 1428 1492 1591 1717 1889 2063 2424 2203 1873 1713 1569 1460 1371 1309 1280 1263 1285 1330 1399 1505 1618 1781 1977 2293 2103 1813 1651 1506 1399 1303 1235 1196 1184 1207 1257 1340 1436 1567 1719 1907 2233 2026 1754 1595 1452 1338 1238 1164 1126 1115 1135 1192 1273 1380 1513 1670 1855 2163 1971 1719 1548 1414 1291 1186 1118 1075 1071 1087 1139 1220 1333 1469 1628 1805 2112 1954 1684 1520 1384 1259 1153 1079 1048 1038 1054 1102 1179 1301 1438 1588 1772 2082 1945 1672 1516 1371 1237 1135 1063 1031 1024 1037 1087 1161 1276 1416 1578 1759 2064 1947 1681 1518 1365 1246 1135 1068 1029 1025 1040 1084 1163 1283 1425 1583 1755 2059 1968 1704 1538 1389 1262 1157 1084 1047 1039 1053 1104 1184 1298 1437 1603 1778 2082 2004 1731 1565 1423 1297 1196 1120 1077 1073 1087 1134 1224 1332 1478 1638 1814 2127 2056 1773 1611 1466 1350 1240 1169 1130 1118 1141 1188 1272 1388 1523 1679 1867 2181 2126 1828 1669 1516 1408 1308 1237 1196 1183 1202 1259 1340 1453 1573 1742 1925 2258 2232 1896 1728 1594 1476 1395 1324 1280 1268 1294 1339 1415 1520 1653 1815 2012 2350 2346 1994 1831 1688 1566 1476 1413 1377 1368 1388 1433 1512 1608 1735 1908 2116 2468 2508 2122 1940 1793 1679 1585 1523 1489 1479 1497 1541 1614 1714 1850 2018 2239 2591 2726 2334 2083 1940 1801 1724 1656 1618 1620 1631 1677 1746 1856 2001 2189 2424 2804] + + + + + + + A_108 + + + [ 108] + + + [2.16626 -0.546277 -0.622854 -0.486759 1.9778 -0.477147 -0.211107 -1.20066 2.4719] + + + [11.7581 -6.68684 -29.183] + + + [1.12023 1 1 2.7421] + + + + + D50_108 + + + [ 108] + + + [2.19522 -1 -0.18179 -0.38513 1.87015 -0.431083 -0.169905 -0.528827 1.7298] + + + [-54.9235 -55.8219 -62.0013] + + + [1.68537 1 1 1.7605] + + + + + D65_108 + + + [ 108] + + + [1.98436 -0.810818 -0.134082 -0.363732 1.85049 -0.470489 -0.150504 -0.426488 1.5924] + + + [-106.784 -64.0457 -63.0708] + + + [1.92925 1 1 1.5183] + + + + + D75_108 + + + [ 108] + + + [2.0752 -0.76877 -0.248426 -0.42482 1.97356 -0.510355 -0.217684 -0.287183 1.5264] + + + [-126.037 -49.81 -88.2855] + + + [1.98201 1 1 1.3705] + + + + + F11_108 + + + [ 108] + + + [1.83705 -0.580873 -0.239021 -0.475097 1.769 -0.242107 -0.210834 -0.654591 1.9266] + + + [-70.1972 -60.0124 -98.4587] + + + [1.35391 1 1 2.374] + + + + + F12_108 + + + [ 108] + + + [2.11449 -0.488607 -0.627944 -0.583834 1.99303 -0.335673 -0.358568 -1.70517 3.1867] + + + [8.42098 1.38714 -241.8493] + + + [1 1.08566 1.08566 3.6337] + + + + + F2_108 + + + [ 108] + + + [2.01005 -0.801146 -0.139835 -0.573695 1.88727 -0.179015 -0.288945 -0.652384 1.955] + + + [-43.762 -62.6082 -56.099] + + + [1.57042 1 1 2.4573] + + + + + + [ -1] + + + + + [ 80] + + + [ 10] + + + [ 0.7] + + + [ 0.7] + + + [ 0.7] + + + [ 0.9] + + + + + 2592x1944_FPS_15 + + + + + fast + + + [ 1] + + + [ 2] + + + + + normal + + + [ 1] + + + [ 1] + + + + + slow + + + [ 2] + + + [ 1] + + + + + + + 2592x1944_FPS_10 + + + + + fast + + + [ 1] + + + [ 2] + + + + + normal + + + [ 1] + + + [ 1] + + + + + slow + + + [ 2] + + + [ 1] + + + + + + + 2592x1944_FPS_05 + + + + + fast + + + [ 1] + + + [ 1] + + + + + normal + + + [ 2] + + + [ 0.9] + + + + + slow + + + [ 4] + + + [ 0.9] + + + + + + + [ 8] + + + + + + 2592x1944 + + + 2592x1944 + + + [16 16 16 16] + + + + + + + linear + + + [256 512 768 1024 1280 1536 1792 2048 2304 2560 2816 3072 3328 3584 3840 4096] + + + [0 256 512 768 1024 1280 1536 1792 2048 2304 2560 2816 3072 3328 3584 3840 4095] + + + + + + [ -1] + + + + [-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1] + + + [-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1] + + + + + [-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1] + + + [-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1] + + + + + + + 2592x1944 + + + 2592x1944 + + + [ 6] + + + [ 29] + + + [ 6] + + + [ 29] + + + [ 0] + + + [ 0] + + + [-0.625 1.5625 -1.625] + + + [-0.3125 -0.125 0.375] + + + + + + + 2592x1944 + + + 2592x1944 + + + [ 1] + + + [1023 762 539 440 381 311 270 241 220 191 170 156 135 120 110 102 95] + + + [ 4] + + + [ 4] + + + [ 0.15] + + + [ 0] + + + [1 1 1 1] + + + + + + + 2592x1944 + + + 2592x1944 + + + + + ISP_DPCC_MODE + + + 0x0005 + + + + + ISP_DPCC_OUT_MODE + + + 0x0003 + + + + + ISP_DPCC_SET_USE + + + 0x0007 + + + + + ISP_DPCC_METHODS_SET1 + + + 0x1D1D + + + + + ISP_DPCC_METHODS_SET2 + + + 0x0707 + + + + + ISP_DPCC_METHODS_SET3 + + + 0x1F1F + + + + + ISP_DPCC_LINE_THRESH_1 + + + 0x0808 + + + + + ISP_DPCC_LINE_MAD_FAC_1 + + + 0x0404 + + + + + ISP_DPCC_PG_FAC_1 + + + 0x0403 + + + + + ISP_DPCC_RND_THRESH_1 + + + 0x0A0A + + + + + ISP_DPCC_RG_FAC_1 + + + 0x2020 + + + + + ISP_DPCC_LINE_THRESH_2 + + + 0x100C + + + + + ISP_DPCC_LINE_MAD_FAC_2 + + + 0x1810 + + + + + ISP_DPCC_PG_FAC_2 + + + 0x0403 + + + + + ISP_DPCC_RND_THRESH_2 + + + 0x0808 + + + + + ISP_DPCC_RG_FAC_2 + + + 0x0808 + + + + + ISP_DPCC_LINE_THRESH_3 + + + 0x2020 + + + + + ISP_DPCC_LINE_MAD_FAC_3 + + + 0x0404 + + + + + ISP_DPCC_PG_FAC_3 + + + 0x0403 + + + + + ISP_DPCC_RND_THRESH_3 + + + 0x0806 + + + + + ISP_DPCC_RG_FAC_3 + + + 0x0404 + + + + + ISP_DPCC_RO_LIMITS + + + 0x0A0A + + + + + ISP_DPCC_RND_OFFS + + + 0x0FFF + + + + + + + + + + on + + + +
diff --git a/th1520/hardware/camera/config/OV5693/OV5693_640x480.xml b/th1520/hardware/camera/config/OV5693/OV5693_640x480.xml new file mode 100644 index 0000000000000000000000000000000000000000..6725367fb16b69215c8394914503f70cfca0c253 --- /dev/null +++ b/th1520/hardware/camera/config/OV5693/OV5693_640x480.xml @@ -0,0 +1,1287 @@ + + +
+ + 08-Feb-2022 + + + Mcf + + + ov5693 + + + 5Mlens_480p + + + v2.1.1 + + + + + 640x480 + + + 0x00000001 + + + [ 640] + + + [ 480] + + + + + FPS_15 + + + [ 14.9916] + + + + + FPS_10 + + + [ 9.9944] + + + + + FPS_05 + + + [ 4.9972] + + + + + +
+ + + + + + 640x480 + + + 640x480 + + + [0.316211 0.450278 0.23351] + + + [-0.747965 0.0904144 0.657551 0.327436 -0.811475 0.48404] + + + [-0.800277 -0.59963 -2.3607] + + + [1.03557 1.08428 1.13299 1.18171 1.23042 1.27913 1.32326 1.36926 1.42527 1.48345 1.53323 1.58745 1.63332 1.67663 1.72844 1.8246] + + + [-0.00414674 0.0285734 0.0458083 0.0590686 0.0684166 0.0745711 0.103537 0.171416 0.0766262 0.0287319 0.0187589 -0.00721015 0.00860515 0.00149051 0.00465507 0.02029] + + + [1.03557 1.09863 1.139 1.17938 1.22525 1.28052 1.32736 1.3712 1.41647 1.4737 1.50747 1.58012 1.62599 1.68328 1.73065 1.8204] + + + [0.104147 0.08587 0.0736434 0.0614168 0.0456015 0.0519858 0.0426176 0.0399399 0.0599487 0.0792273 0.116206 0.144303 0.128488 0.121734 0.102574 0.058049] + + + [0.828809 0.890615 0.957978 1.01338 1.0697 1.12955 1.1988 1.26015 1.33667 1.40375 1.49365 1.54193 1.61013 1.68533 1.74067 1.8553] + + + [-0.0307749 -0.0139859 0.0324236 0.0781028 0.0913031 0.120986 0.12847 0.161498 0.228047 0.227677 0.120452 0.107133 0.0950322 0.089865 0.109512 0.12302] + + + [0.845777 0.891118 0.939466 1.01166 1.0779 1.13324 1.19655 1.26633 1.34355 1.39837 1.46455 1.53792 1.60233 1.67208 1.74842 1.8597] + + + [0.208678 0.202655 0.189942 0.2018 0.201007 0.181359 0.161225 0.143949 0.135979 0.126124 0.151362 0.184872 0.224283 0.209637 0.166558 0.091439] + + + [ 1.0356] + + + [ 1.82] + + + [ 1.85] + + + [ 1.474] + + + D50 + + + [ 4.5676] + + + [0.75 1.28836 1.77672 2.164 2.6 3.0618] + + + [114 114 105 95 95 90] + + + [83 83 110 120 122 128] + + + [28 27 18 16 9 9] + + + [123 123 123 123 123 120] + + + [123 123 123 123 123 126] + + + [5 5 5 5 5 5] + + + [ 1] + + + [ 0.8] + + + [ 0.05] + + + + [ 0.05] + + + [ 0.05] + + + [ 0.4] + + + [ 0.5] + + + [ 0.9] + + + [ 0.5] + + + [ 50] + + + [ 1] + + + [ 0.5] + + + + + + + + A + + + Indoor + + + + [1132.49 1537.15 1537.15 4218.7397] + + + [ 247.3246] + + + [1 1] + + + [-0.0885832 0.012733] + + + + + + 640x480 + + + 640x480_A_100 + + + + + [1.11716 1 1 2.3808] + + + [1.99853 -0.905653 -0.0821708 -0.460996 1.77912 -0.258076 -0.151399 -1.53815 2.713] + + + [-29.8061 -52.306 -95.824] + + + AUTO + + + + [1 2 4 8] + + + [100 95 90 74] + + + + + [1 2 4 8] + + + [100 95 90 70] + + + + + A_100 + + + + + + D50 + + + Outdoor + + + + [329.787 3.43476 3.43476 1629.9174] + + + [ 116.6849] + + + [1 1] + + + [0.0586363 0.0057683] + + + + + + 640x480 + + + 640x480_D50_100 + + + + + [1.64416 1 1 1.6405] + + + [2.097 -1.12811 0.0410741 -0.327961 1.77429 -0.380266 -0.0366512 -0.804392 1.8682] + + + [-40.7723 -43.9103 -61.7554] + + + AUTO + + + + [1 2 4 8] + + + [100 95 90 74] + + + + + [1 2 4 8] + + + [100 95 90 70] + + + + + D50_100 + + + + + + D65 + + + Outdoor + + + + [342.947 -200.069 -200.069 1325.0367] + + + [ 102.4529] + + + [1 1] + + + [0.115106 0.012733] + + + + + + 640x480 + + + 640x480_D65_100 + + + + + [1.92224 1 1 1.428] + + + [2.14135 -1.15688 0.0270315 -0.332497 1.83306 -0.43858 -0.0348043 -0.657467 1.7185] + + + [-47.0355 -42.0548 -56.246] + + + AUTO + + + + [1 2 4 8] + + + [100 95 90 74] + + + + + [1 2 4 8] + + + [100 95 90 70] + + + + + D65_100 + + + + + + F2 (CWF) + + + Indoor + + + + [533.138 -316.589 -316.589 1155.6585] + + + [ 114.3146] + + + [1 1] + + + [0.00647981 -0.026117] + + + + + + 640x480 + + + 640x480_F2_100 + + + + + [1.55891 1 1 2.0968] + + + [2.56944 -1.54023 0.0045255 -0.421136 1.74591 -0.223588 -0.101719 -0.718139 1.8415] + + + [-55.5346 -60.5148 -88.6402] + + + AUTO + + + + [1 2 4 8] + + + [100 95 90 74] + + + + + [1 2 4 8] + + + [100 95 90 70] + + + + + F2_100 + + + + + + F11 (TL84) + + + Indoor + + + + [395.155 -67.974 -67.974 1176.0173] + + + [ 107.9546] + + + [1 1] + + + [0.00547574 -0.011106] + + + + + + 640x480 + + + 640x480_F11_100 + + + + + [1.49049 1 1 1.9841] + + + [1.91878 -0.849702 -0.0555984 -0.407686 1.7518 -0.292535 -0.10781 -0.692012 1.8706] + + + [-55.1752 -65.3873 -90.5846] + + + AUTO + + + + [1 2 4 8] + + + [100 95 90 74] + + + + + [1 2 4 8] + + + [100 95 90 70] + + + + + F11_100 + + + + + + + + + 640x480_A_100 + + + 640x480 + + + A + + + [ 16] + + + [ 10] + + + [ 15] + + + [ 15] + + + [34 37 38 38 42 42 46 43] + + + [28 29 31 30 31 30 31 30] + + + [ 100] + + + [1267 1245 1224 1199 1181 1167 1164 1159 1168 1179 1196 1222 1255 1289 1331 1373 1416 1244 1222 1193 1172 1156 1140 1137 1132 1141 1152 1173 1196 1231 1262 1303 1349 1389 1222 1194 1167 1150 1128 1122 1110 1112 1111 1132 1149 1170 1206 1236 1279 1318 1359 1196 1174 1145 1124 1110 1092 1089 1087 1093 1108 1122 1151 1183 1214 1255 1297 1342 1183 1153 1129 1109 1091 1077 1073 1073 1076 1086 1110 1128 1162 1196 1232 1279 1316 1164 1139 1110 1092 1078 1061 1057 1052 1061 1069 1090 1112 1146 1177 1216 1259 1303 1152 1125 1099 1080 1062 1051 1045 1044 1045 1061 1075 1100 1131 1165 1198 1247 1290 1145 1115 1092 1070 1055 1042 1038 1036 1041 1049 1070 1093 1123 1156 1194 1238 1279 1137 1111 1085 1067 1052 1040 1032 1031 1033 1045 1064 1088 1114 1150 1185 1231 1267 1133 1105 1082 1066 1047 1036 1031 1024 1032 1041 1057 1081 1114 1147 1180 1225 1269 1130 1109 1082 1063 1047 1034 1030 1026 1034 1040 1059 1084 1110 1146 1184 1227 1276 1135 1109 1085 1064 1052 1039 1029 1032 1033 1046 1063 1081 1116 1146 1183 1227 1268 1139 1111 1091 1069 1056 1043 1038 1036 1039 1049 1064 1090 1119 1155 1191 1234 1277 1146 1123 1094 1081 1062 1051 1046 1043 1050 1059 1077 1099 1130 1160 1203 1242 1287 1157 1135 1107 1088 1077 1062 1057 1057 1058 1070 1089 1113 1143 1179 1214 1259 1301 1174 1145 1124 1103 1087 1076 1069 1067 1072 1085 1101 1126 1163 1192 1230 1271 1319 1184 1157 1137 1116 1098 1090 1083 1079 1091 1099 1119 1142 1173 1208 1248 1287 1334] + + + [1249 1229 1202 1183 1165 1150 1147 1139 1139 1150 1165 1180 1211 1231 1265 1298 1334 1227 1210 1181 1165 1144 1131 1121 1116 1118 1128 1141 1164 1188 1206 1242 1278 1300 1214 1183 1161 1139 1125 1108 1105 1097 1098 1107 1123 1141 1164 1189 1224 1254 1287 1179 1166 1139 1122 1103 1094 1080 1078 1077 1088 1100 1121 1138 1172 1201 1235 1267 1175 1150 1125 1105 1088 1073 1063 1061 1065 1072 1082 1107 1125 1153 1182 1216 1252 1162 1137 1111 1091 1076 1061 1052 1046 1050 1052 1072 1088 1116 1141 1172 1203 1238 1152 1123 1099 1082 1064 1054 1043 1035 1040 1046 1059 1079 1104 1133 1156 1193 1225 1144 1117 1098 1075 1062 1043 1040 1030 1032 1037 1055 1069 1097 1117 1150 1188 1214 1135 1117 1094 1072 1054 1041 1034 1028 1029 1036 1048 1066 1090 1119 1143 1184 1211 1136 1115 1089 1070 1054 1041 1030 1024 1029 1033 1047 1066 1090 1115 1140 1175 1210 1134 1112 1090 1073 1052 1040 1032 1025 1032 1034 1048 1065 1088 1112 1148 1177 1211 1142 1116 1097 1075 1057 1047 1037 1035 1030 1041 1054 1069 1094 1118 1150 1177 1217 1142 1118 1098 1079 1064 1050 1041 1038 1036 1044 1056 1075 1098 1127 1154 1190 1221 1154 1131 1109 1087 1072 1059 1051 1046 1050 1050 1068 1085 1110 1132 1164 1195 1230 1162 1139 1121 1099 1085 1067 1062 1060 1058 1068 1080 1095 1125 1150 1176 1212 1241 1177 1152 1131 1113 1100 1079 1079 1071 1071 1082 1087 1109 1134 1161 1192 1221 1262 1187 1160 1144 1122 1110 1099 1088 1086 1085 1098 1109 1127 1150 1175 1210 1237 1264] + + + [1235 1221 1194 1178 1157 1152 1140 1137 1137 1148 1169 1188 1220 1245 1279 1312 1351 1225 1198 1174 1157 1141 1128 1119 1117 1119 1132 1149 1170 1196 1224 1255 1295 1328 1202 1176 1154 1140 1121 1107 1103 1096 1099 1114 1125 1148 1174 1203 1237 1270 1303 1178 1163 1136 1116 1105 1085 1083 1076 1080 1089 1105 1124 1151 1182 1216 1253 1287 1168 1142 1123 1102 1084 1072 1065 1061 1065 1076 1091 1113 1138 1165 1201 1232 1275 1153 1130 1105 1086 1073 1062 1051 1047 1051 1059 1077 1096 1126 1150 1184 1221 1260 1139 1121 1092 1081 1064 1051 1042 1040 1041 1050 1064 1090 1117 1140 1171 1205 1248 1136 1114 1090 1072 1057 1043 1038 1033 1035 1047 1058 1078 1108 1138 1164 1205 1237 1130 1109 1087 1067 1054 1039 1031 1031 1035 1039 1055 1078 1103 1128 1163 1196 1234 1129 1108 1086 1068 1053 1039 1034 1024 1033 1036 1055 1073 1101 1128 1157 1194 1231 1131 1112 1085 1068 1051 1040 1033 1027 1033 1041 1055 1075 1102 1131 1160 1200 1233 1132 1108 1090 1070 1058 1041 1038 1032 1032 1046 1057 1077 1103 1134 1162 1202 1231 1141 1117 1095 1077 1062 1048 1043 1040 1042 1049 1065 1088 1112 1143 1171 1206 1244 1144 1124 1104 1087 1069 1057 1050 1047 1052 1061 1071 1095 1122 1147 1180 1217 1251 1158 1133 1115 1094 1080 1069 1064 1063 1062 1068 1092 1106 1137 1163 1195 1232 1261 1166 1146 1132 1104 1094 1081 1077 1072 1074 1088 1096 1122 1151 1176 1214 1242 1285 1183 1158 1136 1124 1109 1091 1083 1087 1089 1101 1116 1134 1163 1194 1223 1258 1296] + + + [1208 1197 1181 1166 1152 1150 1133 1142 1146 1161 1168 1188 1224 1236 1275 1299 1333 1201 1174 1161 1143 1128 1120 1121 1119 1127 1135 1156 1170 1199 1227 1251 1290 1320 1170 1162 1140 1125 1111 1106 1098 1099 1097 1117 1131 1150 1174 1208 1244 1269 1312 1156 1142 1121 1102 1096 1082 1080 1083 1088 1101 1112 1136 1156 1184 1218 1250 1280 1142 1123 1105 1093 1079 1071 1067 1068 1076 1085 1102 1120 1144 1173 1200 1233 1275 1140 1110 1094 1081 1065 1059 1053 1057 1060 1075 1087 1107 1130 1153 1191 1227 1249 1118 1105 1080 1067 1058 1044 1054 1040 1055 1059 1082 1100 1123 1152 1178 1208 1248 1115 1092 1076 1063 1050 1043 1038 1043 1038 1058 1070 1088 1112 1142 1166 1206 1245 1111 1093 1070 1052 1050 1041 1034 1028 1039 1049 1063 1090 1106 1136 1164 1195 1228 1107 1083 1066 1054 1039 1030 1036 1035 1038 1047 1057 1076 1105 1130 1161 1195 1230 1101 1091 1071 1051 1043 1034 1036 1024 1036 1047 1062 1079 1099 1132 1160 1193 1226 1110 1090 1071 1054 1047 1034 1031 1033 1035 1045 1061 1079 1107 1135 1166 1192 1240 1116 1087 1073 1062 1044 1038 1034 1035 1040 1049 1067 1081 1113 1135 1166 1198 1230 1125 1102 1079 1061 1054 1047 1041 1042 1046 1050 1073 1084 1114 1144 1173 1202 1239 1135 1103 1092 1070 1059 1054 1046 1046 1051 1061 1080 1092 1128 1148 1183 1213 1247 1140 1119 1103 1082 1069 1060 1056 1060 1056 1072 1086 1107 1133 1154 1193 1229 1256 1156 1135 1107 1104 1083 1074 1070 1062 1069 1083 1106 1116 1149 1169 1203 1235 1265] + + + + + 640x480_D50_100 + + + 640x480 + + + D50 + + + [ 16] + + + [ 10] + + + [ 15] + + + [ 15] + + + [32 39 38 40 40 44 45 42] + + + [28 29 30 31 30 32 30 30] + + + [ 100] + + + [1259 1230 1211 1184 1171 1160 1154 1153 1162 1174 1192 1220 1252 1279 1318 1363 1405 1232 1206 1176 1161 1146 1130 1132 1129 1135 1152 1166 1193 1219 1257 1294 1335 1372 1206 1180 1158 1137 1125 1115 1106 1107 1111 1130 1144 1170 1202 1231 1272 1312 1352 1185 1164 1133 1117 1104 1090 1091 1086 1092 1104 1124 1151 1172 1211 1248 1288 1319 1169 1148 1117 1096 1084 1074 1069 1068 1080 1088 1106 1125 1157 1190 1226 1270 1310 1154 1123 1100 1086 1069 1059 1054 1054 1061 1068 1090 1114 1141 1177 1213 1254 1295 1135 1116 1092 1072 1058 1046 1045 1043 1051 1059 1075 1107 1126 1163 1196 1239 1282 1131 1105 1082 1062 1049 1041 1036 1039 1041 1053 1072 1092 1118 1154 1190 1235 1272 1122 1103 1078 1056 1047 1038 1031 1027 1038 1046 1064 1091 1114 1145 1184 1226 1265 1117 1098 1073 1055 1039 1030 1029 1027 1034 1045 1061 1085 1108 1144 1175 1222 1259 1124 1094 1069 1058 1040 1031 1028 1024 1035 1044 1058 1083 1110 1141 1178 1220 1260 1118 1099 1076 1054 1044 1035 1029 1035 1031 1048 1061 1085 1112 1143 1179 1221 1262 1127 1098 1080 1058 1047 1036 1034 1031 1040 1047 1064 1087 1116 1147 1187 1226 1266 1135 1107 1082 1066 1051 1043 1040 1042 1044 1057 1072 1094 1122 1156 1196 1234 1270 1134 1119 1097 1075 1059 1052 1050 1050 1056 1067 1083 1108 1134 1168 1205 1249 1288 1155 1130 1108 1091 1077 1065 1060 1064 1063 1079 1095 1118 1150 1185 1218 1264 1295 1165 1143 1119 1102 1086 1078 1073 1074 1078 1091 1110 1133 1158 1194 1232 1270 1316] + + + [1242 1215 1200 1169 1154 1144 1137 1131 1134 1139 1152 1177 1200 1222 1252 1290 1313 1223 1193 1171 1155 1136 1121 1115 1108 1109 1122 1130 1153 1174 1200 1231 1269 1292 1200 1178 1151 1132 1117 1106 1096 1090 1092 1101 1114 1130 1153 1181 1213 1246 1275 1179 1160 1130 1113 1100 1086 1076 1071 1077 1081 1093 1115 1134 1163 1193 1222 1259 1168 1143 1120 1101 1083 1071 1059 1061 1061 1066 1078 1098 1119 1147 1176 1211 1246 1152 1130 1105 1090 1070 1058 1050 1044 1046 1056 1063 1083 1108 1132 1166 1200 1229 1135 1121 1097 1080 1062 1048 1040 1038 1036 1043 1057 1076 1097 1125 1149 1187 1224 1140 1114 1092 1072 1058 1046 1038 1027 1028 1034 1051 1070 1089 1111 1144 1180 1209 1132 1115 1088 1068 1053 1039 1029 1029 1030 1034 1046 1062 1086 1113 1141 1175 1206 1132 1106 1085 1068 1049 1039 1030 1024 1028 1034 1046 1065 1085 1111 1137 1173 1202 1131 1111 1086 1068 1053 1036 1030 1025 1028 1033 1046 1060 1085 1109 1138 1173 1200 1136 1111 1089 1069 1054 1045 1033 1031 1027 1038 1050 1069 1090 1115 1143 1175 1212 1135 1116 1093 1074 1059 1045 1040 1032 1036 1042 1056 1073 1093 1120 1148 1181 1210 1148 1124 1101 1082 1069 1057 1045 1044 1046 1051 1062 1082 1105 1128 1157 1194 1224 1153 1133 1111 1094 1077 1064 1057 1057 1056 1063 1076 1093 1115 1140 1170 1207 1228 1165 1143 1122 1107 1091 1076 1067 1068 1066 1077 1085 1105 1128 1153 1184 1222 1247 1174 1159 1140 1115 1102 1089 1081 1078 1083 1090 1100 1122 1139 1166 1202 1227 1253] + + + [1218 1206 1185 1167 1153 1136 1132 1127 1137 1141 1155 1179 1205 1227 1256 1302 1320 1207 1185 1163 1145 1127 1118 1111 1110 1109 1121 1136 1157 1183 1213 1240 1272 1305 1185 1165 1141 1127 1110 1098 1094 1087 1091 1104 1114 1135 1161 1186 1218 1257 1278 1165 1148 1125 1108 1094 1081 1077 1072 1075 1085 1099 1120 1138 1172 1203 1238 1270 1154 1131 1113 1092 1079 1063 1058 1057 1061 1067 1081 1102 1126 1155 1184 1218 1255 1138 1120 1094 1080 1064 1055 1047 1043 1047 1053 1070 1089 1112 1140 1175 1207 1241 1129 1110 1087 1070 1056 1044 1040 1037 1038 1045 1059 1080 1105 1134 1159 1196 1235 1124 1107 1082 1066 1050 1042 1033 1027 1029 1040 1052 1071 1097 1124 1153 1188 1225 1118 1102 1081 1061 1049 1033 1030 1025 1033 1036 1053 1071 1093 1124 1150 1186 1218 1124 1100 1078 1063 1044 1039 1029 1024 1028 1038 1052 1067 1093 1120 1146 1185 1217 1124 1100 1079 1062 1045 1034 1031 1024 1028 1037 1051 1069 1094 1118 1150 1191 1214 1125 1103 1082 1064 1053 1038 1032 1031 1034 1042 1056 1073 1100 1126 1153 1194 1222 1131 1105 1089 1069 1058 1044 1041 1038 1037 1044 1064 1081 1102 1132 1162 1199 1226 1133 1115 1097 1081 1067 1055 1047 1046 1051 1057 1069 1090 1118 1143 1168 1208 1240 1147 1124 1107 1086 1076 1064 1060 1056 1058 1068 1086 1101 1128 1147 1184 1221 1248 1156 1143 1119 1100 1089 1074 1074 1069 1074 1083 1095 1117 1139 1165 1200 1234 1266 1172 1150 1128 1115 1100 1095 1084 1080 1090 1092 1110 1125 1157 1183 1212 1248 1280] + + + [1189 1186 1161 1140 1137 1125 1119 1123 1120 1137 1140 1161 1176 1204 1231 1268 1300 1179 1165 1141 1129 1111 1107 1100 1100 1105 1115 1124 1140 1167 1185 1220 1239 1270 1170 1141 1127 1113 1097 1088 1085 1081 1084 1093 1107 1126 1145 1166 1200 1230 1258 1150 1136 1109 1095 1086 1072 1067 1069 1071 1082 1092 1113 1130 1153 1181 1212 1237 1134 1115 1096 1079 1072 1057 1057 1054 1058 1069 1080 1093 1114 1139 1167 1205 1229 1120 1104 1086 1071 1060 1049 1044 1046 1048 1058 1065 1085 1109 1130 1159 1184 1213 1116 1101 1079 1063 1054 1043 1040 1033 1041 1044 1061 1077 1095 1124 1146 1180 1209 1111 1090 1074 1056 1045 1039 1030 1035 1036 1043 1050 1069 1092 1114 1139 1174 1194 1106 1089 1069 1053 1046 1036 1028 1025 1033 1040 1053 1068 1087 1108 1136 1170 1198 1105 1089 1073 1054 1040 1032 1028 1028 1029 1037 1046 1060 1088 1109 1137 1170 1195 1101 1091 1067 1055 1044 1031 1029 1024 1029 1034 1048 1067 1087 1108 1137 1166 1195 1102 1090 1070 1057 1040 1035 1030 1030 1029 1041 1051 1068 1088 1112 1142 1171 1202 1114 1090 1078 1060 1048 1037 1032 1036 1037 1039 1056 1073 1090 1118 1140 1182 1204 1121 1099 1085 1067 1055 1050 1039 1038 1044 1050 1063 1078 1100 1126 1155 1187 1209 1130 1105 1090 1075 1063 1055 1050 1051 1049 1062 1070 1087 1111 1132 1162 1189 1222 1135 1120 1104 1088 1074 1064 1057 1058 1061 1065 1082 1095 1119 1142 1175 1206 1231 1147 1135 1113 1103 1080 1078 1069 1071 1067 1087 1098 1111 1130 1158 1188 1207 1247] + + + + + 640x480_D65_100 + + + 640x480 + + + D65 + + + [ 16] + + + [ 10] + + + [ 15] + + + [ 15] + + + [34 38 41 41 41 41 44 40] + + + [28 28 29 29 32 30 33 31] + + + [ 100] + + + [1245 1230 1202 1182 1170 1168 1155 1163 1160 1176 1197 1220 1248 1270 1323 1364 1395 1227 1204 1180 1159 1143 1136 1133 1131 1142 1153 1172 1192 1223 1258 1297 1334 1368 1211 1174 1158 1141 1121 1117 1112 1114 1114 1135 1149 1170 1200 1232 1270 1314 1350 1186 1165 1134 1116 1101 1098 1094 1092 1101 1111 1128 1153 1181 1217 1250 1293 1331 1163 1141 1120 1100 1094 1073 1079 1078 1086 1092 1110 1133 1161 1195 1235 1274 1303 1153 1127 1100 1090 1072 1066 1058 1062 1068 1080 1096 1118 1147 1175 1215 1253 1298 1135 1117 1092 1070 1062 1050 1053 1046 1056 1064 1083 1106 1132 1162 1203 1241 1280 1131 1106 1077 1062 1049 1044 1041 1041 1045 1061 1076 1097 1126 1154 1189 1241 1261 1124 1094 1079 1057 1046 1042 1030 1034 1042 1055 1066 1089 1111 1152 1188 1220 1264 1115 1097 1070 1053 1038 1036 1033 1035 1038 1047 1065 1090 1112 1141 1181 1226 1269 1114 1095 1070 1053 1045 1032 1024 1029 1039 1048 1064 1085 1110 1144 1186 1218 1259 1121 1095 1073 1052 1043 1034 1035 1029 1037 1051 1067 1083 1114 1141 1183 1223 1261 1123 1096 1080 1059 1044 1042 1033 1042 1043 1056 1070 1090 1116 1153 1186 1225 1270 1136 1108 1081 1066 1053 1047 1042 1044 1048 1059 1074 1094 1126 1156 1192 1238 1271 1141 1113 1096 1076 1061 1050 1051 1051 1060 1072 1085 1109 1131 1169 1212 1246 1282 1149 1129 1103 1083 1074 1066 1063 1066 1067 1079 1097 1119 1149 1177 1217 1256 1302 1168 1134 1122 1098 1084 1080 1068 1079 1080 1090 1110 1131 1151 1190 1232 1268 1313] + + + [1237 1219 1196 1170 1151 1142 1147 1135 1135 1141 1157 1171 1195 1222 1250 1299 1311 1223 1195 1175 1153 1139 1121 1120 1110 1114 1120 1135 1150 1179 1196 1235 1266 1300 1202 1179 1154 1137 1117 1107 1100 1096 1093 1103 1116 1135 1155 1184 1212 1250 1278 1183 1165 1137 1116 1107 1086 1083 1076 1078 1084 1097 1113 1138 1164 1200 1227 1265 1173 1149 1128 1103 1091 1070 1065 1066 1065 1070 1084 1102 1120 1151 1175 1216 1249 1167 1134 1108 1092 1070 1065 1050 1049 1053 1059 1068 1083 1111 1133 1168 1205 1237 1144 1121 1098 1080 1067 1049 1047 1039 1046 1049 1058 1077 1097 1128 1156 1191 1226 1144 1114 1096 1076 1059 1046 1038 1034 1030 1040 1055 1071 1086 1119 1146 1182 1215 1136 1112 1091 1072 1053 1044 1033 1033 1033 1040 1047 1068 1086 1112 1144 1181 1215 1137 1110 1089 1071 1053 1043 1033 1024 1031 1036 1046 1063 1088 1111 1141 1172 1212 1136 1113 1089 1069 1054 1040 1034 1033 1031 1041 1051 1064 1083 1114 1145 1178 1214 1142 1115 1093 1074 1058 1043 1039 1035 1035 1034 1052 1069 1091 1118 1147 1183 1208 1142 1116 1095 1078 1061 1052 1041 1036 1040 1048 1056 1077 1095 1124 1153 1185 1222 1150 1132 1105 1087 1072 1053 1054 1045 1050 1053 1067 1083 1104 1132 1165 1196 1224 1157 1132 1114 1095 1078 1069 1063 1057 1056 1064 1078 1091 1118 1137 1173 1206 1237 1170 1145 1126 1107 1091 1075 1068 1070 1067 1076 1087 1110 1126 1155 1183 1220 1253 1176 1156 1134 1122 1100 1095 1084 1082 1084 1090 1101 1115 1140 1164 1204 1234 1263] + + + [1217 1208 1175 1156 1145 1140 1131 1129 1130 1136 1157 1171 1199 1219 1258 1292 1312 1200 1179 1159 1145 1125 1116 1113 1106 1113 1123 1131 1155 1175 1206 1236 1269 1302 1185 1160 1137 1125 1106 1098 1094 1086 1089 1103 1117 1134 1159 1180 1220 1249 1274 1163 1149 1122 1104 1088 1081 1076 1073 1073 1085 1096 1116 1136 1169 1201 1235 1270 1150 1132 1108 1092 1077 1066 1059 1060 1063 1070 1080 1100 1123 1151 1183 1219 1252 1134 1120 1096 1076 1064 1053 1044 1044 1051 1053 1066 1088 1108 1139 1171 1201 1244 1123 1111 1086 1071 1055 1047 1040 1036 1038 1044 1059 1079 1098 1127 1159 1193 1228 1124 1101 1077 1064 1047 1040 1034 1031 1032 1043 1051 1070 1094 1122 1150 1189 1216 1117 1098 1077 1060 1043 1033 1029 1027 1030 1036 1051 1069 1090 1117 1149 1183 1219 1122 1096 1073 1060 1042 1036 1026 1024 1030 1040 1050 1066 1088 1118 1143 1182 1220 1116 1098 1071 1059 1045 1035 1029 1026 1032 1034 1051 1066 1092 1114 1148 1183 1218 1123 1100 1079 1062 1049 1039 1033 1034 1031 1042 1054 1069 1095 1121 1152 1186 1220 1127 1106 1085 1065 1056 1048 1040 1036 1042 1051 1063 1080 1101 1132 1162 1196 1225 1134 1116 1095 1079 1059 1051 1052 1047 1050 1054 1070 1090 1114 1137 1169 1202 1238 1145 1129 1101 1084 1076 1062 1059 1058 1059 1071 1084 1101 1125 1153 1185 1216 1248 1153 1137 1117 1100 1082 1081 1068 1072 1075 1081 1094 1114 1138 1166 1196 1227 1262 1166 1145 1130 1111 1102 1087 1089 1080 1089 1101 1107 1129 1158 1171 1213 1244 1273] + + + [1191 1181 1159 1136 1129 1118 1115 1108 1114 1124 1135 1140 1177 1195 1223 1242 1284 1175 1157 1141 1124 1111 1105 1094 1095 1104 1101 1115 1134 1151 1173 1212 1239 1255 1168 1142 1125 1103 1094 1084 1077 1082 1075 1090 1097 1115 1134 1162 1189 1218 1248 1145 1124 1108 1094 1083 1066 1069 1067 1066 1077 1084 1100 1120 1143 1176 1204 1227 1134 1118 1094 1079 1070 1060 1054 1054 1055 1062 1075 1089 1109 1132 1158 1195 1221 1121 1107 1080 1074 1059 1045 1042 1043 1043 1057 1060 1076 1095 1122 1152 1180 1201 1113 1098 1078 1060 1048 1043 1037 1034 1038 1039 1056 1072 1093 1111 1143 1171 1210 1109 1089 1071 1057 1045 1034 1032 1029 1031 1037 1050 1062 1081 1106 1136 1161 1200 1106 1090 1070 1052 1045 1032 1024 1027 1030 1033 1045 1062 1079 1104 1125 1162 1183 1104 1091 1065 1052 1042 1031 1028 1024 1026 1036 1042 1057 1075 1100 1131 1157 1188 1103 1088 1069 1053 1042 1027 1030 1026 1028 1033 1046 1059 1077 1100 1129 1162 1191 1106 1093 1070 1058 1042 1034 1031 1027 1032 1038 1049 1068 1084 1103 1136 1171 1194 1121 1090 1075 1063 1050 1041 1031 1033 1033 1043 1058 1064 1090 1114 1138 1168 1193 1112 1101 1087 1068 1054 1048 1044 1041 1048 1049 1057 1077 1094 1116 1149 1176 1206 1131 1110 1091 1076 1063 1053 1047 1056 1048 1060 1069 1083 1105 1129 1159 1186 1214 1138 1123 1105 1086 1073 1061 1063 1058 1060 1067 1080 1091 1115 1141 1169 1198 1220 1147 1135 1111 1101 1083 1081 1073 1068 1073 1083 1088 1109 1134 1148 1176 1211 1239] + + + + + 640x480_F11_100 + + + 640x480 + + + F11 + + + [ 16] + + + [ 10] + + + [ 15] + + + [ 15] + + + [35 38 39 41 42 41 42 42] + + + [27 28 31 32 30 30 32 30] + + + [ 100] + + + [1234 1210 1188 1170 1156 1139 1136 1138 1145 1154 1168 1188 1222 1245 1288 1317 1357 1215 1193 1165 1144 1135 1120 1120 1125 1124 1135 1151 1171 1195 1226 1264 1297 1336 1194 1166 1149 1129 1111 1103 1100 1099 1103 1109 1128 1151 1177 1207 1243 1277 1313 1170 1153 1126 1107 1092 1082 1082 1077 1088 1093 1106 1127 1155 1187 1221 1261 1294 1152 1134 1108 1095 1078 1067 1062 1062 1067 1080 1094 1113 1138 1167 1203 1242 1274 1144 1115 1094 1080 1065 1058 1054 1050 1058 1064 1082 1099 1130 1158 1192 1228 1273 1134 1109 1087 1070 1057 1044 1042 1047 1045 1055 1069 1087 1118 1147 1179 1217 1249 1122 1100 1078 1063 1044 1041 1037 1031 1042 1049 1064 1080 1112 1137 1171 1208 1242 1112 1095 1076 1057 1043 1037 1030 1033 1039 1049 1058 1077 1100 1138 1163 1200 1241 1110 1095 1071 1052 1042 1027 1024 1031 1032 1043 1059 1078 1098 1129 1159 1196 1231 1118 1087 1069 1052 1040 1031 1029 1026 1033 1041 1056 1074 1108 1125 1167 1198 1236 1116 1094 1073 1056 1040 1034 1030 1032 1035 1042 1063 1078 1098 1136 1165 1198 1236 1127 1092 1075 1060 1045 1036 1038 1033 1041 1054 1062 1081 1109 1138 1169 1208 1250 1126 1102 1086 1066 1055 1045 1042 1041 1051 1056 1072 1091 1116 1148 1177 1212 1248 1137 1112 1095 1076 1062 1056 1047 1054 1054 1070 1083 1103 1131 1156 1192 1227 1262 1143 1126 1103 1090 1072 1065 1063 1060 1069 1077 1094 1111 1137 1167 1201 1241 1278 1158 1141 1113 1096 1084 1081 1070 1073 1081 1089 1106 1129 1151 1182 1217 1243 1283] + + + [1221 1207 1183 1171 1153 1135 1135 1127 1127 1142 1149 1162 1188 1208 1238 1279 1302 1211 1190 1163 1148 1128 1119 1113 1101 1110 1113 1126 1148 1168 1189 1219 1254 1271 1184 1172 1151 1126 1115 1099 1093 1092 1088 1100 1107 1125 1152 1172 1203 1233 1268 1171 1152 1125 1109 1095 1086 1078 1072 1071 1086 1091 1108 1124 1158 1181 1213 1243 1153 1137 1116 1095 1080 1069 1058 1056 1061 1065 1073 1093 1113 1139 1169 1196 1237 1144 1123 1102 1085 1067 1060 1048 1045 1051 1050 1065 1078 1099 1124 1155 1186 1209 1134 1112 1096 1075 1062 1050 1040 1035 1040 1045 1050 1069 1091 1118 1147 1175 1207 1131 1109 1089 1070 1055 1042 1036 1028 1029 1036 1051 1062 1083 1109 1137 1167 1197 1123 1108 1085 1067 1050 1038 1031 1028 1032 1038 1041 1064 1082 1107 1127 1167 1191 1129 1101 1082 1069 1048 1035 1032 1024 1028 1033 1046 1059 1081 1106 1126 1157 1191 1124 1107 1084 1069 1054 1041 1031 1029 1028 1036 1042 1063 1080 1106 1133 1159 1192 1130 1106 1087 1069 1057 1043 1037 1031 1029 1039 1050 1066 1087 1111 1138 1164 1200 1138 1110 1096 1074 1059 1051 1037 1039 1037 1046 1055 1074 1091 1117 1141 1175 1200 1137 1120 1100 1082 1073 1055 1054 1045 1051 1051 1067 1080 1103 1126 1151 1185 1214 1153 1131 1107 1093 1082 1066 1061 1060 1058 1068 1075 1092 1114 1134 1163 1193 1224 1156 1141 1122 1107 1090 1079 1074 1068 1072 1078 1086 1107 1126 1152 1178 1205 1241 1174 1148 1135 1117 1102 1094 1090 1078 1085 1086 1109 1105 1140 1161 1188 1218 1251] + + + [1216 1198 1180 1160 1144 1131 1126 1123 1125 1133 1146 1166 1195 1215 1249 1286 1317 1202 1173 1155 1136 1123 1113 1107 1109 1106 1119 1130 1147 1173 1204 1232 1260 1296 1182 1160 1137 1124 1106 1097 1090 1089 1082 1103 1112 1126 1151 1178 1209 1244 1278 1161 1144 1120 1106 1088 1077 1077 1068 1067 1079 1091 1111 1128 1163 1189 1230 1257 1146 1131 1107 1086 1076 1062 1054 1057 1059 1062 1077 1093 1119 1145 1180 1206 1248 1135 1117 1094 1079 1064 1050 1045 1042 1045 1049 1064 1080 1104 1132 1161 1197 1231 1133 1107 1087 1070 1053 1046 1037 1037 1039 1044 1056 1069 1100 1124 1154 1184 1223 1128 1101 1078 1065 1048 1037 1034 1027 1028 1038 1049 1067 1092 1120 1140 1186 1206 1115 1102 1078 1059 1046 1036 1027 1024 1028 1034 1049 1066 1084 1111 1145 1175 1211 1117 1093 1081 1064 1047 1033 1028 1024 1030 1034 1049 1063 1086 1115 1138 1171 1206 1117 1104 1078 1062 1043 1037 1029 1029 1026 1038 1049 1068 1088 1113 1146 1180 1215 1121 1103 1078 1065 1056 1040 1038 1031 1032 1038 1055 1071 1090 1123 1144 1184 1214 1126 1110 1088 1074 1054 1046 1042 1038 1041 1050 1060 1077 1102 1128 1158 1187 1221 1137 1118 1094 1078 1069 1054 1053 1050 1051 1057 1069 1088 1109 1139 1159 1200 1233 1145 1126 1108 1089 1077 1066 1060 1057 1059 1068 1083 1099 1125 1147 1180 1210 1245 1155 1134 1119 1102 1087 1080 1076 1068 1075 1083 1095 1109 1137 1158 1194 1230 1253 1167 1152 1126 1115 1099 1088 1083 1090 1086 1094 1107 1122 1145 1176 1203 1231 1277] + + + [1196 1187 1165 1148 1134 1119 1120 1125 1127 1138 1145 1166 1185 1209 1240 1276 1295 1180 1167 1151 1130 1112 1122 1111 1108 1109 1120 1131 1142 1175 1194 1221 1245 1282 1167 1146 1128 1117 1094 1096 1089 1087 1095 1106 1111 1131 1151 1175 1206 1230 1271 1156 1129 1110 1091 1087 1078 1072 1076 1070 1091 1094 1117 1137 1160 1187 1220 1241 1127 1122 1100 1084 1070 1066 1057 1063 1065 1072 1084 1096 1121 1144 1174 1201 1236 1127 1102 1084 1076 1062 1058 1049 1047 1051 1059 1075 1088 1108 1131 1165 1191 1219 1112 1103 1080 1066 1050 1050 1040 1039 1047 1055 1061 1084 1101 1128 1152 1179 1214 1117 1086 1070 1059 1046 1038 1038 1038 1037 1048 1062 1073 1096 1117 1147 1167 1221 1105 1089 1066 1056 1045 1037 1030 1029 1039 1042 1055 1069 1092 1117 1141 1171 1201 1102 1087 1073 1049 1047 1031 1033 1024 1032 1039 1057 1067 1089 1113 1142 1175 1202 1097 1088 1062 1052 1042 1037 1033 1030 1031 1042 1053 1067 1091 1115 1138 1173 1203 1111 1083 1064 1062 1042 1036 1029 1031 1034 1042 1052 1075 1098 1114 1144 1172 1205 1105 1091 1071 1061 1044 1040 1038 1037 1040 1046 1061 1069 1094 1124 1148 1179 1207 1117 1089 1082 1062 1052 1046 1041 1041 1043 1052 1061 1084 1106 1123 1158 1178 1219 1122 1107 1086 1078 1061 1052 1051 1052 1051 1061 1074 1084 1118 1140 1161 1192 1231 1131 1120 1100 1078 1073 1061 1058 1061 1058 1068 1085 1097 1116 1147 1176 1208 1235 1139 1130 1116 1087 1079 1066 1073 1059 1074 1072 1091 1115 1137 1152 1186 1207 1247] + + + + + 640x480_F2_100 + + + 640x480 + + + F2 + + + [ 16] + + + [ 10] + + + [ 15] + + + [ 15] + + + [35 38 37 40 44 40 43 43] + + + [29 28 29 29 32 30 32 31] + + + [ 100] + + + [1238 1214 1199 1171 1160 1148 1139 1146 1144 1160 1172 1188 1223 1254 1287 1320 1364 1214 1192 1163 1146 1134 1124 1124 1113 1123 1136 1152 1169 1201 1228 1258 1299 1338 1197 1167 1147 1134 1109 1105 1099 1096 1104 1117 1130 1155 1176 1211 1244 1276 1313 1173 1150 1124 1115 1098 1085 1087 1077 1089 1098 1111 1131 1158 1190 1225 1257 1297 1160 1136 1116 1092 1082 1074 1062 1068 1072 1083 1097 1116 1146 1179 1202 1239 1284 1150 1118 1097 1078 1066 1055 1055 1049 1056 1062 1085 1101 1128 1160 1191 1227 1263 1130 1112 1081 1073 1058 1047 1045 1042 1048 1053 1072 1093 1117 1150 1181 1215 1252 1128 1096 1079 1064 1050 1040 1037 1033 1042 1049 1071 1080 1110 1140 1162 1204 1244 1115 1094 1073 1055 1043 1035 1031 1031 1033 1048 1059 1082 1101 1136 1170 1196 1239 1111 1093 1072 1053 1039 1033 1027 1024 1035 1047 1058 1073 1103 1129 1156 1196 1238 1118 1093 1067 1054 1043 1032 1028 1026 1032 1038 1060 1077 1100 1129 1165 1205 1226 1122 1090 1069 1056 1041 1035 1031 1029 1030 1046 1061 1071 1105 1134 1162 1198 1244 1118 1096 1079 1056 1046 1039 1035 1034 1038 1046 1063 1083 1106 1135 1171 1204 1242 1124 1104 1083 1066 1048 1048 1041 1045 1047 1059 1073 1089 1116 1145 1171 1219 1247 1139 1113 1088 1077 1064 1053 1053 1050 1052 1064 1080 1097 1129 1154 1184 1222 1259 1144 1125 1106 1086 1070 1063 1060 1055 1062 1076 1091 1107 1141 1169 1197 1234 1276 1159 1140 1115 1100 1085 1075 1074 1072 1074 1089 1105 1131 1144 1176 1214 1252 1291] + + + [1239 1213 1191 1168 1148 1140 1142 1126 1128 1140 1150 1166 1198 1217 1254 1286 1310 1212 1194 1165 1154 1134 1120 1107 1108 1108 1120 1130 1148 1174 1195 1228 1254 1291 1199 1172 1153 1127 1113 1102 1099 1089 1092 1101 1114 1127 1150 1177 1203 1240 1271 1174 1159 1130 1113 1101 1085 1078 1071 1073 1079 1095 1111 1131 1164 1188 1220 1254 1163 1140 1117 1100 1079 1068 1058 1060 1060 1067 1078 1098 1117 1146 1172 1205 1239 1149 1125 1106 1089 1071 1060 1047 1047 1044 1053 1064 1079 1105 1133 1158 1192 1223 1136 1116 1098 1080 1064 1048 1043 1035 1041 1042 1056 1071 1097 1123 1147 1181 1216 1135 1110 1091 1072 1059 1041 1037 1025 1033 1037 1052 1064 1090 1113 1140 1173 1199 1134 1109 1085 1070 1051 1043 1028 1027 1031 1035 1046 1064 1084 1105 1139 1169 1202 1122 1108 1082 1067 1049 1038 1033 1024 1027 1037 1046 1058 1082 1110 1127 1163 1202 1125 1110 1082 1068 1052 1036 1034 1026 1030 1032 1047 1060 1082 1105 1138 1165 1202 1132 1110 1085 1070 1058 1042 1039 1033 1028 1039 1050 1065 1087 1113 1136 1168 1203 1126 1110 1091 1074 1061 1050 1040 1036 1040 1044 1056 1070 1096 1119 1143 1181 1207 1147 1118 1098 1084 1070 1053 1049 1044 1045 1053 1063 1080 1104 1127 1154 1184 1220 1148 1127 1111 1089 1077 1068 1061 1052 1054 1062 1074 1090 1114 1137 1164 1201 1233 1158 1142 1124 1103 1091 1073 1069 1068 1072 1075 1085 1106 1123 1152 1182 1209 1241 1184 1146 1134 1113 1103 1088 1087 1078 1079 1089 1103 1115 1142 1165 1192 1223 1260] + + + [1235 1205 1182 1158 1144 1137 1131 1129 1129 1140 1155 1174 1206 1225 1256 1290 1322 1201 1185 1161 1144 1131 1114 1112 1102 1112 1120 1133 1150 1175 1210 1233 1267 1304 1193 1162 1141 1128 1105 1102 1091 1085 1094 1102 1112 1132 1156 1181 1218 1251 1282 1163 1152 1123 1109 1095 1079 1078 1072 1068 1083 1097 1114 1145 1168 1197 1232 1265 1158 1131 1111 1095 1076 1066 1061 1057 1062 1069 1082 1098 1122 1156 1182 1214 1254 1137 1122 1097 1082 1067 1053 1045 1043 1042 1052 1068 1087 1111 1137 1170 1203 1238 1137 1108 1088 1073 1058 1048 1040 1038 1042 1047 1060 1078 1105 1131 1158 1194 1226 1128 1107 1085 1065 1053 1042 1037 1032 1029 1043 1052 1067 1094 1123 1146 1182 1216 1119 1101 1081 1064 1051 1035 1030 1024 1032 1036 1051 1070 1089 1117 1146 1184 1207 1125 1105 1080 1064 1047 1037 1027 1027 1029 1039 1046 1066 1091 1119 1144 1174 1214 1121 1102 1077 1063 1051 1039 1029 1027 1028 1038 1051 1068 1094 1117 1144 1184 1214 1128 1105 1084 1069 1054 1037 1036 1038 1032 1042 1054 1073 1093 1127 1155 1185 1219 1131 1111 1089 1073 1057 1048 1042 1037 1039 1050 1061 1078 1104 1130 1156 1195 1225 1140 1116 1098 1080 1065 1054 1047 1050 1051 1056 1074 1088 1111 1140 1167 1202 1233 1144 1124 1107 1089 1079 1064 1065 1054 1060 1070 1085 1097 1126 1146 1177 1218 1248 1159 1137 1119 1103 1088 1077 1074 1072 1074 1079 1095 1111 1140 1165 1201 1231 1260 1165 1151 1133 1118 1102 1090 1086 1077 1088 1095 1113 1123 1152 1176 1209 1238 1280] + + + [1206 1181 1163 1143 1125 1124 1115 1125 1120 1143 1149 1165 1189 1212 1239 1278 1296 1178 1165 1143 1134 1114 1110 1104 1102 1107 1115 1131 1142 1172 1190 1221 1254 1270 1168 1149 1129 1116 1094 1094 1090 1084 1094 1104 1118 1128 1153 1185 1208 1231 1275 1143 1135 1103 1100 1085 1076 1072 1078 1072 1089 1097 1121 1136 1164 1187 1228 1231 1135 1120 1098 1082 1075 1063 1062 1061 1069 1080 1094 1101 1130 1145 1173 1205 1244 1124 1103 1089 1071 1060 1053 1048 1047 1056 1063 1071 1088 1114 1140 1164 1191 1226 1110 1096 1072 1069 1052 1046 1048 1041 1049 1045 1070 1082 1103 1129 1159 1184 1214 1105 1081 1071 1057 1047 1033 1035 1037 1040 1050 1061 1073 1103 1119 1143 1174 1204 1106 1084 1068 1052 1049 1036 1030 1027 1040 1044 1061 1073 1092 1125 1138 1174 1195 1104 1084 1064 1053 1046 1036 1032 1024 1029 1040 1050 1069 1087 1117 1140 1176 1205 1103 1087 1069 1052 1043 1033 1035 1028 1035 1040 1051 1068 1090 1116 1145 1166 1199 1105 1086 1068 1051 1046 1035 1030 1039 1031 1044 1054 1076 1092 1125 1136 1183 1202 1114 1087 1079 1058 1042 1035 1034 1035 1037 1046 1062 1073 1097 1124 1145 1179 1206 1114 1100 1074 1066 1050 1047 1037 1045 1046 1055 1067 1078 1099 1132 1154 1187 1216 1127 1096 1086 1076 1057 1051 1050 1049 1047 1059 1073 1091 1110 1131 1164 1196 1220 1135 1118 1097 1084 1071 1054 1052 1052 1066 1071 1084 1091 1127 1148 1170 1201 1235 1153 1127 1116 1086 1080 1076 1061 1078 1070 1087 1095 1108 1124 1161 1187 1226 1241] + + + + + + + A_100 + + + [ 100] + + + [1.99853 -0.905653 -0.0821708 -0.460996 1.77912 -0.258076 -0.151399 -1.53815 2.713] + + + [-29.8061 -52.306 -95.824] + + + [1.11716 1 1 2.3808] + + + + + D50_100 + + + [ 100] + + + [2.097 -1.12811 0.0410741 -0.327961 1.77429 -0.380266 -0.0366512 -0.804392 1.8682] + + + [-40.7723 -43.9103 -61.7554] + + + [1.64416 1 1 1.6405] + + + + + D65_100 + + + [ 100] + + + [2.14135 -1.15688 0.0270315 -0.332497 1.83306 -0.43858 -0.0348043 -0.657467 1.7185] + + + [-47.0355 -42.0548 -56.246] + + + [1.92224 1 1 1.428] + + + + + F11_100 + + + [ 100] + + + [1.91878 -0.849702 -0.0555984 -0.407686 1.7518 -0.292535 -0.10781 -0.692012 1.8706] + + + [-55.1752 -65.3873 -90.5846] + + + [1.49049 1 1 1.9841] + + + + + F2_100 + + + [ 100] + + + [2.56944 -1.54023 0.0045255 -0.421136 1.74591 -0.223588 -0.101719 -0.718139 1.8415] + + + [-55.5346 -60.5148 -88.6402] + + + [1.55891 1 1 2.0968] + + + + + + [ -1] + + + + + [ 80] + + + [ 20] + + + [ 0.7] + + + [ 0.7] + + + [ 0.7] + + + [ 0.9] + + + + + 640x480_FPS_15 + + + + + fast + + + [ 1] + + + [ 2] + + + + + normal + + + [ 1] + + + [ 1] + + + + + slow + + + [ 2] + + + [ 1] + + + + + + + 640x480_FPS_10 + + + + + fast + + + [ 1] + + + [ 2] + + + + + normal + + + [ 1] + + + [ 1] + + + + + slow + + + [ 2] + + + [ 1] + + + + + + + 640x480_FPS_05 + + + + + fast + + + [ 1] + + + [ 1] + + + + + normal + + + [ 2] + + + [ 0.9] + + + + + slow + + + [ 4] + + + [ 0.9] + + + + + + + [ 8] + + + + + + 6400x480 + + + 640x480 + + + [256 256 256 256] + + + + + + + linear + + + [256 512 768 1024 1280 1536 1792 2048 2304 2560 2816 3072 3328 3584 3840 4096] + + + [0 256 512 768 1024 1280 1536 1792 2048 2304 2560 2816 3072 3328 3584 3840 4095] + + + + + + [ -1] + + + + [-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1] + + + [-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1] + + + + + [-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1] + + + [-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1] + + + + + + + 640x480 + + + 640x480 + + + [ 5] + + + [ 22] + + + [ 5] + + + [ 22] + + + [ 0] + + + [ 0] + + + [-0.125 -0.4375 0.6875] + + + [1.0625 -2.875 1.6875] + + + + + + + 640x480 + + + 640x480 + + + [ 1] + + + [1023 841 652 551 486 405 354 319 292 254 228 209 181 162 148 137 129] + + + [ 4] + + + [ 4] + + + [ 0.15] + + + [ 0] + + + [1 1 1 1] + + + + + + + 640x480 + + + 640x480 + + + + + ISP_DPCC_MODE + + + 0x0005 + + + + + ISP_DPCC_OUT_MODE + + + 0x0003 + + + + + ISP_DPCC_SET_USE + + + 0x000F + + + + + ISP_DPCC_METHODS_SET1 + + + 0x1D1D + + + + + ISP_DPCC_METHODS_SET2 + + + 0x0707 + + + + + ISP_DPCC_METHODS_SET3 + + + 0x1F1F + + + + + ISP_DPCC_LINE_THRESH_1 + + + 0x0808 + + + + + ISP_DPCC_LINE_MAD_FAC_1 + + + 0x0404 + + + + + ISP_DPCC_PG_FAC_1 + + + 0x0404 + + + + + ISP_DPCC_RND_THRESH_1 + + + 0x0804 + + + + + ISP_DPCC_RG_FAC_1 + + + 0x0802 + + + + + ISP_DPCC_LINE_THRESH_2 + + + 0x100C + + + + + ISP_DPCC_LINE_MAD_FAC_2 + + + 0x0404 + + + + + ISP_DPCC_PG_FAC_2 + + + 0x0404 + + + + + ISP_DPCC_RND_THRESH_2 + + + 0x0808 + + + + + ISP_DPCC_RG_FAC_2 + + + 0x0808 + + + + + ISP_DPCC_LINE_THRESH_3 + + + 0x0000 + + + + + ISP_DPCC_LINE_MAD_FAC_3 + + + 0x0404 + + + + + ISP_DPCC_PG_FAC_3 + + + 0x0404 + + + + + ISP_DPCC_RND_THRESH_3 + + + 0x0804 + + + + + ISP_DPCC_RG_FAC_3 + + + 0x0400 + + + + + ISP_DPCC_RO_LIMITS + + + 0x0FFF + + + + + ISP_DPCC_RND_OFFS + + + 0x0FFF + + + + + + + + + + on + + + +
diff --git a/th1520/hardware/camera/config/OV5693/OV5693_mipi2lane_2592x1944_raw10_30fps_init.txt b/th1520/hardware/camera/config/OV5693/OV5693_mipi2lane_2592x1944_raw10_30fps_init.txt new file mode 100644 index 0000000000000000000000000000000000000000..40751701733c0326757c122d3c64651ec65518e4 --- /dev/null +++ b/th1520/hardware/camera/config/OV5693/OV5693_mipi2lane_2592x1944_raw10_30fps_init.txt @@ -0,0 +1,251 @@ +0x0103 0x01 +0x3001 0x0a +0x3002 0x80 +0x3006 0x00 +0x3011 0x21 +0x3012 0x09 +0x3013 0x10 +0x3014 0x00 +0x3015 0x08 +0x3016 0xf0 +0x3017 0xf0 +0x3018 0xf0 +0x301b 0xb4 +0x301d 0x02 +0x3021 0x00 +0x3022 0x01 +0x3028 0x44 +0x3098 0x02 +0x3099 0x19 +0x309a 0x02 +0x309b 0x01 +0x309c 0x00 +0x30a0 0xd2 +0x30a2 0x01 +0x30b2 0x00 +0x30b3 0x7d +0x30b4 0x03 +0x30b5 0x04 +0x30b6 0x01 +0x3104 0x21 +0x3106 0x00 +0x3400 0x04 +0x3401 0x00 +0x3402 0x04 +0x3403 0x00 +0x3404 0x04 +0x3405 0x00 +0x3406 0x01 +0x3500 0x00 +0x3503 0x07 +0x3504 0x00 +0x3505 0x00 +0x3506 0x00 +0x3507 0x02 +0x3508 0x00 +0x3509 0x10 +0x350a 0x00 +0x350b 0x40 +0x3601 0x0a +0x3602 0x38 +0x3612 0x80 +0x3620 0x54 +0x3621 0xc7 +0x3622 0x0f +0x3625 0x10 +0x3630 0x55 +0x3631 0xf4 +0x3632 0x00 +0x3633 0x34 +0x3634 0x02 +0x364d 0x0d +0x364f 0xdd +0x3660 0x04 +0x3662 0x10 +0x3663 0xf1 +0x3665 0x00 +0x3666 0x20 +0x3667 0x00 +0x366a 0x80 +0x3680 0xe0 +0x3681 0x00 +0x3700 0x42 +0x3701 0x14 +0x3702 0xa0 +0x3703 0xd8 +0x3704 0x78 +0x3705 0x02 +0x370a 0x00 +0x370b 0x20 +0x370c 0x0c +0x370d 0x11 +0x370e 0x00 +0x370f 0x40 +0x3710 0x00 +0x371a 0x1c +0x371b 0x05 +0x371c 0x01 +0x371e 0xa1 +0x371f 0x0c +0x3721 0x00 +0x3724 0x10 +0x3726 0x00 +0x372a 0x01 +0x3730 0x10 +0x3738 0x22 +0x3739 0xe5 +0x373a 0x50 +0x373b 0x02 +0x373c 0x41 +0x373f 0x02 +0x3740 0x42 +0x3741 0x02 +0x3742 0x18 +0x3743 0x01 +0x3744 0x02 +0x3747 0x10 +0x374c 0x04 +0x3751 0xf0 +0x3752 0x00 +0x3753 0x00 +0x3754 0xc0 +0x3755 0x00 +0x3756 0x1a +0x3758 0x00 +0x3759 0x0f +0x376b 0x44 +0x375c 0x04 +0x3774 0x10 +0x3776 0x00 +0x377f 0x08 +0x3780 0x22 +0x3781 0x0c +0x3784 0x2c +0x3785 0x1e +0x378f 0xf5 +0x3791 0xb0 +0x3795 0x00 +0x3796 0x64 +0x3797 0x11 +0x3798 0x30 +0x3799 0x41 +0x379a 0x07 +0x379b 0xb0 +0x379c 0x0c +0x37c5 0x00 +0x37c6 0x00 +0x37c7 0x00 +0x37c9 0x00 +0x37ca 0x00 +0x37cb 0x00 +0x37de 0x00 +0x37df 0x00 +0x3800 0x00 +0x3801 0x00 +0x3802 0x00 +0x3804 0x0a +0x3805 0x3f +0x3810 0x00 +0x3812 0x00 +0x3823 0x00 +0x3824 0x00 +0x3825 0x00 +0x3826 0x00 +0x3827 0x00 +0x382a 0x04 +0x3a04 0x06 +0x3a05 0x14 +0x3a06 0x00 +0x3a07 0xfe +0x3b00 0x00 +0x3b02 0x00 +0x3b03 0x00 +0x3b04 0x00 +0x3b05 0x00 +0x3e07 0x20 +0x4000 0x08 +0x4001 0x04 +0x4002 0x45 +0x4004 0x08 +0x4005 0x18 +0x4006 0x20 +0x4008 0x24 +0x4009 0x10 +0x400c 0x00 +0x400d 0x00 +0x4058 0x00 +0x404e 0x37 +0x404f 0x8f +0x4058 0x00 +0x4101 0xb2 +0x4303 0x00 +0x4304 0x08 +0x4307 0x31 +0x4311 0x04 +0x4315 0x01 +0x4511 0x05 +0x4512 0x01 +0x4806 0x00 +0x4816 0x52 +0x481f 0x30 +0x4826 0x2c +0x4831 0x64 +0x4d00 0x04 +0x4d01 0x71 +0x4d02 0xfd +0x4d03 0xf5 +0x4d04 0x0c +0x4d05 0xcc +0x4837 0x0a +0x5000 0x06 +0x5001 0x01 +0x5003 0x20 +0x5046 0x0a +0x5013 0x00 +0x5046 0x0a +0x5780 0x1c +0x5786 0x20 +0x5787 0x10 +0x5788 0x18 +0x578a 0x04 +0x578b 0x02 +0x578c 0x02 +0x578e 0x06 +0x578f 0x02 +0x5790 0x02 +0x5791 0xff +0x5842 0x01 +0x5843 0x2b +0x5844 0x01 +0x5845 0x92 +0x5846 0x01 +0x5847 0x8f +0x5848 0x01 +0x5849 0x0c +0x5e00 0x00 +0x5e10 0x0c +0x0100 0x00 + +0x3501 0x08 +0x3502 0x00 +0x3708 0xe2 +0x3709 0xc3 +0x3803 0x00 +0x3806 0x07 +0x3807 0xa3 +0x3808 0x0a +0x3809 0x20 +0x380a 0x07 +0x380b 0x98 +0x380c 0x0a +0x380d 0x80 +0x380e 0x07 +0x380f 0xc0 +0x3811 0x10 +0x3813 0x00 +0x3814 0x11 +0x3815 0x11 +0x3820 0x42 +0x3821 0x18 +0x5002 0x00 + diff --git a/th1520/hardware/camera/config/OV5693/OV5693_mipi2lane_640x480_init.txt b/th1520/hardware/camera/config/OV5693/OV5693_mipi2lane_640x480_init.txt new file mode 100644 index 0000000000000000000000000000000000000000..a06bea5e621c1002c44517f24e2626733cda0230 --- /dev/null +++ b/th1520/hardware/camera/config/OV5693/OV5693_mipi2lane_640x480_init.txt @@ -0,0 +1,253 @@ +0x3001 0x0a +0x3002 0x80 +0x3006 0x00 +0x3011 0x21 +0x3012 0x09 +0x3013 0x10 +0x3014 0x00 +0x3015 0x08 +0x3016 0xf0 +0x3017 0xf0 +0x3018 0xf0 +0x301b 0xb4 +0x301d 0x02 +0x3021 0x00 +0x3022 0x01 +0x3028 0x44 +0x3098 0x03 +0x3099 0x1e +0x309a 0x0b +0x309b 0x01 +0x309c 0x00 +0x30a0 0xd2 +0x30a2 0x01 +0x30b2 0x00 +0x30b3 0x3c +0x30b4 0x03 +0x30b5 0x04 +0x30b6 0x06 +0x3104 0x21 +0x3106 0x00 +0x3400 0x04 +0x3401 0x00 +0x3402 0x04 +0x3403 0x00 +0x3404 0x04 +0x3405 0x00 +0x3406 0x01 +0x3500 0x00 +0x3501 0x1f +0x3502 0x10 +0x3503 0x07 +0x3504 0x00 +0x3505 0x00 +0x3506 0x00 +0x3507 0x02 +0x3508 0x00 +0x3509 0x10 +0x350a 0x00 +0x350b 0xF8 +0x3600 0xbc +0x3601 0x0a +0x3602 0x38 +0x3612 0x80 +0x3620 0x44 +0x3621 0xb5 +0x3622 0x0c +0x3625 0x10 +0x3630 0x55 +0x3631 0xf4 +0x3632 0x00 +0x3633 0x34 +0x3634 0x02 +0x364d 0x0d +0x364f 0xdd +0x3660 0x04 +0x3662 0x10 +0x3663 0xf1 +0x3665 0x00 +0x3666 0x20 +0x3667 0x00 +0x366a 0x80 +0x3680 0xe0 +0x3681 0x00 +0x3700 0x42 +0x3701 0x14 +0x3702 0xa0 +0x3703 0xd8 +0x3704 0x78 +0x3705 0x02 +0x3708 0xeb +0x3709 0xc3 +0x370a 0x00 +0x370b 0x20 +0x370c 0x0c +0x370d 0x11 +0x370e 0x00 +0x370f 0x40 +0x3710 0x00 +0x371a 0x1c +0x371b 0x05 +0x371c 0x01 +0x371e 0xa1 +0x371f 0x0c +0x3721 0x00 +0x3724 0x10 +0x3726 0x00 +0x372a 0x01 +0x3730 0x10 +0x3738 0x22 +0x3739 0xe5 +0x373a 0x50 +0x373b 0x02 +0x373c 0x41 +0x373f 0x02 +0x3740 0x42 +0x3741 0x02 +0x3742 0x18 +0x3743 0x01 +0x3744 0x02 +0x3747 0x10 +0x374c 0x04 +0x3751 0xf0 +0x3752 0x00 +0x3753 0x00 +0x3754 0xc0 +0x3755 0x00 +0x3756 0x1a +0x3758 0x00 +0x3759 0x0f +0x376b 0x44 +0x375c 0x04 +0x3774 0x10 +0x3776 0x00 +0x377f 0x08 +0x3780 0x22 +0x3781 0x0c +0x3784 0x2c +0x3785 0x1e +0x378f 0xf5 +0x3791 0xb0 +0x3795 0x00 +0x3796 0x64 +0x3797 0x11 +0x3798 0x30 +0x3799 0x41 +0x379a 0x07 +0x379b 0xb0 +0x379c 0x0c +0x37c5 0x00 +0x37c6 0x00 +0x37c7 0x00 +0x37c9 0x00 +0x37ca 0x00 +0x37cb 0x00 +0x37de 0x00 +0x37df 0x00 +0x3800 0x00 +0x3801 0x00 +0x3802 0x00 +0x3803 0x04 +0x3804 0x0a +0x3805 0x3f +0x3806 0x07 +0x3807 0x9b +0x3808 0x02 +0x3809 0x80 +0x380a 0x01 +0x380b 0xe0 +0x380c 0x0a +0x380d 0x20 +0x380e 0x02 +0x380f 0x02 +0x3810 0x00 +0x3811 0x0e +0x3812 0x00 +0x3813 0x02 +0x3814 0x71 +0x3815 0x71 +0x3820 0x01 +0x3821 0x1f +0x3823 0x00 +0x3824 0x00 +0x3825 0x00 +0x3826 0x00 +0x3827 0x00 +0x382a 0x04 +0x3a04 0x06 +0x3a05 0x14 +0x3a06 0x00 +0x3a07 0xfe +0x3b00 0x00 +0x3b02 0x00 +0x3b03 0x00 +0x3b04 0x00 +0x3b05 0x00 +0x3e07 0x20 +0x4000 0x08 +0x4001 0x04 +0x4002 0x45 +0x4004 0x08 +0x4005 0x18 +0x4006 0x20 +0x4008 0x24 +0x4009 0x10 +0x400c 0x00 +0x400d 0x00 +0x4058 0x00 +0x404e 0x37 +0x404f 0x8f +0x4058 0x00 +0x4101 0xb2 +0x4303 0x00 +0x4304 0x08 +0x4307 0x30 +0x4311 0x04 +0x4315 0x01 +0x4511 0x05 +0x4512 0x01 +0x4806 0x00 +0x4816 0x52 +0x481f 0x30 +0x4826 0x2c +0x4831 0x64 +0x4d00 0x04 +0x4d01 0x71 +0x4d02 0xfd +0x4d03 0xf5 +0x4d04 0x0c +0x4d05 0xcc +0x4837 0x85 +0x5000 0x06 +0x5001 0x01 +0x5002 0x00 +0x5003 0x20 +0x5046 0x0a +0x5013 0x00 +0x5046 0x0a +0x5780 0xfc +0x5781 0x13 +0x5782 0x03 +0x5786 0x20 +0x5787 0x40 +0x5788 0x08 +0x5789 0x08 +0x578a 0x02 +0x578b 0x01 +0x578c 0x01 +0x578d 0x0c +0x578e 0x02 +0x578f 0x01 +0x5790 0x01 +0x5791 0xff +0x5842 0x01 +0x5843 0x2b +0x5844 0x01 +0x5845 0x92 +0x5846 0x01 +0x5847 0x8f +0x5848 0x01 +0x5849 0x0c +0x5e00 0x00 +0x5e10 0x0c +0x0100 0x00 diff --git a/th1520/hardware/camera/config/common/3aconfig.json b/th1520/hardware/camera/config/common/3aconfig.json new file mode 100755 index 0000000000000000000000000000000000000000..39dc72e2c05f76c0f2686cbe55ed1c64fb3f721e --- /dev/null +++ b/th1520/hardware/camera/config/common/3aconfig.json @@ -0,0 +1,541 @@ +{ + "root" : [ + { + "classname" : "Aev1", + "enable" : false + }, + { + "classname" : "Aev2", + "enable" : false, + "motionThreshold" : 0.5, + "roiWeight" : 0.6, + "motionFilter" : 0.5, + "maxSensorAgain" : 15.5, + "maxSensorDgain" : 1, + "maxIspDgain" : 2.6, + "setPoint" : 50, + "roi_start" : 8, + "roi_end" : 24, + "roi_weight" : 0.5 + }, + { + "classname" : "Aehdr", + "enable" : false, + "motionThreshold" : 0.5, + "roi_start" : 8, + "roi_end" : 24, + "roi_weight" : 0.5, + "faceWeight" : 0.6, + "motionFilter" : 0.5, + "maxSensorAgain" : 15.5, + "maxSensorDgain" : 1, + "maxIspDgain" : 12, + "setPoint" : 30 + }, + { + "classname" : "AdaptiveAe", + "enable" : true, + "motionThreshold" : 0.7, + "roi_start" : 8, + "roi_end" : 24, + "roi_weight" : 0.5, + "faceWeight" : 0.6, + "motionFilter" : 0.5, + "targetFilter" : 0.5, + "wdrContrast.min" : 10, + "wdrContrast.max" : 110, + "lowlight" : { + "linear_repress" : [1, 0.8, 0.6, 0.4, 0.4], + "linear_gain" : [4, 8, 16, 32, 100], + "hdr_repress" : [1, 0.8, 0.8, 0.8, 0.8], + "hdr_gain" : [4, 8, 16, 32, 100] + }, + "maxSensorAgain" : 15.5, + "maxSensorDgain" : 1, + "maxIspDgain" : 12, + "setPoint" : 50 + }, + { + "classname" : "Awbv2", + "enable" : true, + "illuorder" : "A, D50, D65, D75, TL84, F12, CWF", + "indoor" : [1, 1, 1, 1, 1, 1, 1], + "outdoor" : [1, 1, 1, 1, 1, 1, 1], + "transition" : [1, 1, 1, 1, 1, 1, 1], + "lsc_ratio":{ + "gains" : [1, 2, 4, 8, 16, 32], + "vignetting" : [1, 1, 1, 1, 1, 1] + }, + "avg" : 0.0 + }, + { + "classname" : "IspController", + "enable" : true + }, + { + "classname" : "AutoHdr", + "enable" : false + }, + { + "classname" : "DciHist", + "enable" : false, + "gaussMeanPos" : 64, + "gaussSigmaPos" : 128, + "gaussAmpPos" : 1.0, + "gaussMeanNeg" : 0, + "gaussSigmaNeg" : 128, + "gaussAmpNeg" : 1.0 + }, + { + "classname" : "SensorController", + "enable" : true + }, + { + "classname" : "AGamma64", + "forcecreate" : true, + "enable" : true, + "disable" : false, + "tables" : [ + { + "hdr" : false, + "enable" : [1, 1, 1, 1, 1, 1], + "gains" : [1, 2, 4, 8, 16, 32], + "curve" : [ + [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023], + [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023], + [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023], + [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023], + [73, 113, 147, 176, 203, 228, 251, 273, 295, 315, 335, 354, 372, 390, 407, 425, 441, 457, 473, 489, 504, 519, 534, 549, 563, 577, 591, 605, 619, 632, 646, 659, 672, 685, 697, 710, 722, 735, 747, 759, 771, 783, 794, 806, 818, 829, 840, 852, 863, 874, 885, 896, 907, 918, 928, 939, 950, 960, 971, 981, 991, 1002, 1012, 1023], + [18, 35, 53, 70, 86, 103, 120, 136, 153, 169, 186, 202, 219, 235, 251, 267, 283, 300, 316, 332, 348, 364, 380, 396, 412, 428, 444, 460, 476, 491, 507, 523, 539, 555, 571, 586, 602, 618, 634, 649, 665, 681, 696, 712, 728, 743, 759, 775, 790, 806, 821, 837, 853, 868, 884, 899, 915, 930, 946, 961, 977, 992, 1008, 1023] + ] + }, + { + "hdr" : true, + "enable" : [1, 1, 1, 1, 1, 1], + "gains" : [1, 2, 4, 8, 16, 32], + "curve" : [ + [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023], + [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023], + [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023], + [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023], + [73, 113, 147, 176, 203, 228, 251, 273, 295, 315, 335, 354, 372, 390, 407, 425, 441, 457, 473, 489, 504, 519, 534, 549, 563, 577, 591, 605, 619, 632, 646, 659, 672, 685, 697, 710, 722, 735, 747, 759, 771, 783, 794, 806, 818, 829, 840, 852, 863, 874, 885, 896, 907, 918, 928, 939, 950, 960, 971, 981, 991, 1002, 1012, 1023], + [73, 113, 147, 176, 203, 228, 251, 273, 295, 315, 335, 354, 372, 390, 407, 425, 441, 457, 473, 489, 504, 519, 534, 549, 563, 577, 591, 605, 619, 632, 646, 659, 672, 685, 697, 710, 722, 735, 747, 759, 771, 783, 794, 806, 818, 829, 840, 852, 863, 874, 885, 896, 907, 918, 928, 939, 950, 960, 971, 981, 991, 1002, 1012, 1023] + ] + } + ] + }, + { + "classname" : "ACproc", + "forcecreate" : true, + "enable" : true, + "disable" : false, + "tables" : [ + { + "hdr" : false, + "enable" : [1, 1, 1, 1, 1, 1], + "gains" : [1, 2, 4, 8, 16, 32], + "contrast" : [1, 1, 1, 1, 1, 1], + "brightness" : [0, 0, 0, 0, 0], + "saturation" : [1, 1, 1, 1, 1, 1], + "hue" : [0, 0, 0, 0, 0, 0], + "chromaout" : [2, 2, 2, 2, 2, 2], + "lumain" : [2, 2, 2, 2, 2, 2], + "lumaout" : [2, 2, 2, 2, 2, 2] + }, + { + "hdr" : true, + "enable" : [1, 1, 1, 1, 1, 1], + "gains" : [1, 2, 4, 8, 16, 32], + "contrast" : [1, 1, 1, 1, 1, 1], + "brightness" : [0, 0, 0, 0, 0], + "saturation" : [1, 1, 1, 1, 1, 1], + "hue" : [0, 0, 0, 0, 0, 0], + "chromaout" : [2, 2, 2, 2, 2, 2], + "lumain" : [2, 2, 2, 2, 2, 2], + "lumaout" : [2, 2, 2, 2, 2, 2] + } + ] + }, + { + "classname" : "Aee", + "forcecreate" : true, + "enable" : true, + "disable" : false, + "tables" : [ + { + "hdr" : false, + "enable" : [1, 1, 1, 1, 1, 1], + "gains" : [1, 2, 4, 8, 16, 32], + "strength" : [100, 100, 100, 100, 100, 100], + "srcStrength" : [1, 1, 1, 1, 1, 1], + "yup" : [2048, 2048, 2048, 2048, 2048, 2048], + "ydown" : [2048, 2048, 2048, 2048, 2048, 2048], + "uvgain" : [0, 0, 0, 0, 0, 0], + "edgegain" : [1000, 1000, 1000, 1000, 500, 200] + }, + { + "hdr" : true, + "enable" : [1, 1, 1, 1, 1, 1], + "gains" : [1, 2, 4, 8, 16, 32], + "strength" : [100, 100, 100, 100, 100, 100], + "srcStrength" : [1, 1, 1, 1, 1, 1], + "yup" : [5000, 5000, 5000, 5000, 5000, 5000], + "ydown" : [8000, 8000, 5000, 5000, 5000, 5000], + "uvgain" : [0, 0, 0, 0, 0, 0], + "edgegain" : [2000, 2000, 2000, 1500, 600, 200] + } + ] + }, + { + "classname" : "ACa", + "forcecreate" : true, + "enable" : true, + "disable" : false, + "tables" : [ + { + "hdr" : false, + "enableCA" : [1, 1, 1, 1, 1, 1], + "enableDCI" : [1, 1, 1, 1, 1, 1], + "gains" : [1, 2, 4, 8, 16, 32], + "curveCA" : [ + [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024], + [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024], + [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024], + [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024], + [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024], + [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024] + ], + "curveDCI" : [ + [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1023, 1023], + [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1028, 1023], + [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1028, 1023], + [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1028, 1023], + [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1028, 1023], + [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1028, 1023] + ] + }, + { + "hdr" : true, + "enableCA" : [0, 0, 1, 1, 1, 1], + "enableDCI" : [1, 1, 1, 1, 1, 1], + "gains" : [1, 2, 4, 8, 16, 32], + "curveCA" : [ + [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024], + [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024], + [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024], + [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024], + [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024], + [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024] + ], + "curveDCI" : [ + [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022], + [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022], + [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022], + [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022], + [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022], + [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022] + ] + } + ] + }, + { + "classname" : "ADmsc2", + "forcecreate" : true, + "enable" : true, + "disable" : false, + "demoire_enable" : true, + "demoire_area_thr" : 3, + "demoire_sat_shrink" : 5, + "demoire_r2" : 256, + "demoire_r1" : 0, + "demoire_t2_shift" : 2, + "demoire_t1" : 180, + "demoire_edge_r2" : 256, + "demoire_edge_r1" : 20, + "demoire_edge_t2_shift" : 4, + "demoire_edge_t1" :20, + "depurple_enable" : true, + "depurple_red_sat" : true, + "depurple_blue_sat" : true, + "depurple_sat_shrink" : 8, + "depurple_thr" : 8, + "skin_enable" : false, + "cb_thr_max_2047" : 10, + "cb_thr_min_2047" : 8, + "cr_thr_max_2047" : 10, + "cr_thr_min_2047" : 8, + "y_thr_max_2047" : 10, + "y_thr_min_2047" : 8, + "tables" : [ + { + "hdr" : false, + "gains" : [1, 2, 4, 8, 16, 32], + "enableSharpen" : [1, 1, 1, 1, 1, 1], + "enableSharpenLine" : [0, 0, 0, 0, 0, 0], + "facblack" : [10, 10, 10, 10, 10, 10], + "facwhite" : [10, 10, 10, 10, 10, 10], + "maxblack" : [20, 20, 20, 20, 20, 20], + "maxwhite" : [20, 20, 20, 20, 20, 20], + "t1" : [0, 0, 0, 0, 0, 0], + "t2" : [0, 0, 0, 0, 0, 0], + "t3" : [0, 0, 0, 0, 0, 0], + "t4" : [0, 0, 0, 0, 0, 0], + "r1" : [0, 0, 0, 0, 0, 0], + "r2" : [128, 128, 128, 128, 128, 128], + "r3" : [256, 256, 256, 256, 256, 256], + "gdenoise" : [0, 0, 0, 0, 0, 0], + "gsharpen" : [16, 16, 16, 16, 16, 16], + "sharpen_line_shift2" : [6, 6, 6, 6, 6, 6], + "sharpen_line_shift1" : [5, 5, 5, 5, 5, 5], + "sharpen_line_t1" : [1000, 1000, 1000, 1000, 1000, 1000], + "sharpen_line_strength" : [100, 100, 100, 100, 100, 100], + "sharpen_line_r2" : [200, 200, 200, 200, 200, 200], + "sharpen_line_r1" : [5, 5, 5, 5, 5, 5] + }, + { + "hdr" : true, + "gains" : [1, 2, 4, 8, 16, 32], + "enableSharpen" : [0, 0, 0, 0, 0, 0], + "enableSharpenLine" : [0, 0, 0, 0, 0, 0], + "facblack" : [200, 200, 100, 50, 20, 20], + "facwhite" : [200, 200, 150, 80, 40, 20], + "maxblack" : [200, 200, 100, 100, 100, 100], + "maxwhite" : [200, 200, 200, 200, 200, 200], + "t1" : [0, 0, 0, 0, 0, 0], + "t2" : [0, 0, 0, 0, 0, 0], + "t3" : [0, 0, 0, 0, 0, 0], + "t4" : [0, 0, 0, 0, 0, 0], + "r1" : [0, 0, 0, 0, 0, 0], + "r2" : [128, 128, 128, 128, 128, 128], + "r3" : [256, 256, 256, 256, 256, 256], + "gdenoise" : [0, 0, 0, 0, 0, 0], + "gsharpen" : [16, 16, 16, 16, 16, 16], + "sharpen_line_shift2" : [6, 6, 6, 6, 6, 6], + "sharpen_line_shift1" : [5, 5, 5, 5, 5, 5], + "sharpen_line_t1" : [1000, 1000, 1000, 1000, 1000, 1000], + "sharpen_line_strength" : [100, 100, 100, 100, 100, 100], + "sharpen_line_r2" : [200, 200, 200, 200, 200, 200], + "sharpen_line_r1" : [5, 5, 5, 5, 5, 5] + } + ] + }, + { + "classname" : "AWdr4", + "forcecreate" : true, + "enable" : false, + "disable" : true, + "backlight" : true, + "tables" : [ + { + "hdr" : false, + "enable" : [1, 1, 1, 1, 1, 1], + "gains" : [1, 2, 4, 8, 16, 32], + "backlight" : [0, 0.1, 0.2, 0.3, 0.4, 0.45], + "strength" : [128, 128, 128, 128, 128, 128], + "highStrength" : [20, 20, 20, 90, 90, 90], + "lowStrength" : [4, 8, 16, 24, 45, 64], + "globalStrength" : [0, 0, 0, 0, 0, 0], + "contrast" : [800, 800, 800, 800, 800, 800], + "flatStrength" : [0, 0, 0, 0, 0, 0], + "flatThreshold" : [0, 0, 0, 0, 0, 0] + }, + { + "hdr" : true, + "enable" : [1, 1, 1, 1, 1, 1], + "gains" : [1, 2, 4, 8, 16, 32], + "backlight" : [0, 0.1, 0.2, 0.3, 0.4, 0.45], + "strength" : [128, 128, 128, 128, 128, 128], + "highStrength" : [20, 20, 20, 90, 90, 90], + "lowStrength" : [4, 8, 16, 24, 45, 64], + "globalStrength" : [0, 0, 0, 0, 0, 0], + "contrast" : [800, 800, 800, 800, 800, 800], + "flatStrength" : [0, 0, 0, 0, 0, 0], + "flatThreshold" : [0, 0, 0, 0, 0, 0] + } + ], + "entropy_slope": 200, + "entropy_base": 700, + "entropy" : [0, 0, 0, 2, 3, 6, 11, 22, 39, 67, 111, 177, 227, 266, 321, 355, 377, 355, 221, 0], + "gamma_down" : [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 9, 16, 36, 64, 136, 256, 576, 1023], + "gamma_up" : [0, 283121, 330313, 377512, 424723, 471961, 519250, 566650, 614235, 662241, 711077, 761540, 792420, 815280, 849436, 875575, 913530, 948975, 1002792, 1048575], + "?gamma_up" : [0, 1024, 34837, 56737, 82912, 116814, 162079, 223337, 306767, 420749, 576707, 735048, 745499, 755950, 776852, 797754, 839557, 881361, 964968, 1048575], + "gamma_pre" : [0, 31514, 36815, 42173, 47646, 53350, 59514, 66602, 75530, 88145, 108135, 142869, 175428, 207095, 269144, 330303, 442139, 571475, 810472, 1048575] + }, + { + + "classname" : "A3dnrv3", + "forcecreate" : false, + "enable" : false, + "disable" : false, + "autonoiseLevel": true, + "tnr_en" : false, + "nlm_en" : true, + "tables" : [ + { + "hdr" : false, + "enable" : [0, 0, 0, 0, 0, 0, 0], + "gains" : [1, 2, 4, 8, 16, 32], + "filterLen" : [100, 150, 200, 300, 400, 500], + "filterLen2" : [10, 10, 10, 10, 10, 10], + "motionSlope" : [1, 1, 1, 1, 1, 1], + "noiseLevel" : [25, 40, 60, 80, 100, 120], + "sadweight" : [8, 8, 8, 8, 8, 8], + "motionInvFactor" : [20000, 20000, 20000, 20000, 20000, 20000], + "noisemodel_a" : [0.45071, 0.85596, 1.561850, 2.219000, 3.9409, 5.2362], + "noisemodel_b" : [0.000065, 9.7098, 140.351654, 219.965805, 284.8835, 344.9119], + "autoStrength" : [1.5, 1.5, 1.5, 1.5, 1.5, 1.5], + "motion_dilate_en" : [1, 1, 1, 1, 1, 1], + "motion_erode_en" : [1, 1, 1, 1, 1, 1], + "pregamma_en" : [1, 1, 1, 1, 1, 1], + "strength" : [120, 120, 120, 120, 120, 120], + "range_h" : [7, 7, 7, 7, 7, 7], + "range_v" : [3, 3, 3, 3, 3, 3], + "dialte_h" : [3, 3, 3, 3, 3, 3], + "preweight" : [8, 8, 8, 8, 8, 8], + "noise_thresh_factor" : [2, 2, 2, 2, 2, 2], + "moving_pixel_thresh" : [0.6, 0.6, 0.6, 0.6, 0.6, 0.6] + }, + { + "hdr" : true, + "enable" : [0, 0, 0, 0, 0, 0, 0], + "gains" : [1, 2, 4, 8, 16, 32], + "filterLen" : [100, 150, 200, 300, 400, 500], + "filterLen2" : [10, 10, 10, 10, 10, 10], + "motionSlope" : [1, 1, 1, 1, 1, 1], + "noiseLevel" : [25, 40, 60, 80, 100, 120], + "sadweight" : [8, 8, 8, 8, 8, 8], + "motionInvFactor" : [20000, 20000, 20000, 20000, 20000, 20000], + "noisemodel_a" : [0.45071, 0.85596, 1.561850, 2.219000, 3.9409, 5.2362], + "noisemodel_b" : [0.000065, 9.7098, 140.351654, 219.965805, 284.8835, 344.9119], + "autoStrength" : [1.5, 1.5, 1.5, 1.5, 1.5, 1.5], + "motion_dilate_en" : [1, 1, 1, 1, 1, 1], + "motion_erode_en" : [1, 1, 1, 1, 1, 1], + "pregamma_en" : [1, 1, 1, 1, 1, 1], + "strength" : [120, 120, 120, 120, 120, 120], + "range_h" : [7, 7, 7, 7, 7, 7], + "range_v" : [3, 3, 3, 3, 3, 3], + "dialte_h" : [3, 3, 3, 3, 3, 3], + "preweight" : [8, 8, 8, 8, 8, 8], + "noise_thresh_factor" : [2, 2, 2, 2, 2, 2], + "moving_pixel_thresh" : [0.6, 0.6, 0.6, 0.6, 0.6, 0.6] + } + ] + }, + { + "classname" : "A2dnrv5", + "forcecreate" : true, + "enable" : true, + "disable" : false, + "tables" : [ + { + "hdr" : false, + "enable" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + "gains" : [1, 2, 4, 8, 12, 16, 20, 24, 32, 40], + "strength" : [1, 1, 1, 1, 1, 1, 2, 2, 2, 2], + "sigma" : [5, 5, 5, 8, 8, 8, 11, 11, 11, 14], + "blendstatic" : [90, 90, 90, 90, 90, 90, 90, 35, 35, 40], + "blendmotion" : [100, 100, 100, 100, 100, 100, 100, 100, 100, 100] + }, + { + "hdr" : true, + "enable" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + "gains" : [1, 2, 4, 8, 12, 16, 20, 24, 32, 40], + "strength" : [1, 1, 1, 1, 1, 1, 2, 2, 2, 2], + "sigma" : [5, 5, 5, 8, 8, 8, 11, 11, 11, 14], + "blendstatic" : [90, 90, 90, 90, 90, 90, 90, 35, 35, 40], + "blendmotion" : [100, 100, 100, 100, 100, 100, 100, 100, 100, 100] + } + ] + }, + { + "classname" : "ADpf", + "forcecreate" : true, + "enable" : false, + "disable" : false, + "tables" : [ + { + "hdr" : false, + "enable" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + "gains" : [1, 2, 4, 8, 12, 16, 20, 24, 32, 40], + "gradient" : [0.1, 0.2, 0.4, 0.7, 1, 1.5, 2, 2.5, 3, 3.5], + "offset" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + "Min" : [1, 1, 1, 1, 1, 1, 1, 2, 4, 16], + "Div" : [64, 64, 64, 65, 65, 65, 65, 65, 65, 65], + "sigma_g" : [1, 1, 2, 2, 3, 3, 4, 4, 4, 4], + "sigma_rb" : [1, 1, 2, 2, 3, 3, 4, 4, 4, 4], + "curve" : [ + [4095, 4095, 3677, 3068, 2686, 2219, 1933, 1735, 1587, 1379, 1235, 1129, 979, 877, 801, 742, 695], + [4095, 4056, 2910, 2388, 2073, 1697, 1471, 1317, 1203, 1042, 933, 852, 738, 660, 603, 558, 523], + [3688, 2169, 1687, 1428, 1260, 1050, 918, 827, 758, 660, 592, 542, 470, 421, 385, 357, 335], + [2254, 1553, 1258, 1085, 968, 816, 718, 649, 597, 521, 469, 430, 374, 335, 307, 284, 267], + [1060, 883, 772, 695, 637, 555, 498, 455, 422, 373, 338, 311, 272, 245, 225, 209, 196], + [580, 524, 481, 448, 420, 378, 346, 321, 301, 270, 247, 229, 202, 183, 168, 157, 148], + [368, 346, 328, 312, 298, 276, 257, 242, 230, 209, 193, 181, 162, 147, 136, 127, 120], + [214, 206, 199, 192, 186, 175, 166, 159, 152, 141, 132, 124, 112, 103, 96, 91, 86], + [158, 152, 147, 142, 138, 130, 124, 118, 113, 105, 99, 93, 84, 78, 72, 68, 64], + [127, 124, 121, 118, 115, 110, 106, 103, 99, 93, 88, 84, 77, 72, 68, 64, 61] + ] + }, + { + "hdr" : true, + "enable" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + "gains" : [1, 2, 4, 8, 12, 16, 20, 24, 32, 40], + "gradient" : [0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2], + "offset" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + "Min" : [16, 16, 16, 16, 16, 16, 16, 16, 16, 16], + "Div" : [65, 65, 65, 65, 65, 65, 65, 65, 65, 65], + "sigma_g" : [4, 4, 4, 4, 4, 4, 4, 4, 4, 4], + "sigma_rb" : [4, 4, 4, 4, 4, 4, 4, 4, 4, 4], + "curve" : [ + [4095, 4095, 3677, 3068, 2686, 2219, 1933, 1735, 1587, 1379, 1235, 1129, 979, 877, 801, 742, 695], + [4095, 4056, 2910, 2388, 2073, 1697, 1471, 1317, 1203, 1042, 933, 852, 738, 660, 603, 558, 523], + [3688, 2169, 1687, 1428, 1260, 1050, 918, 827, 758, 660, 592, 542, 470, 421, 385, 357, 335], + [2254, 1553, 1258, 1085, 968, 816, 718, 649, 597, 521, 469, 430, 374, 335, 307, 284, 267], + [1060, 883, 772, 695, 637, 555, 498, 455, 422, 373, 338, 311, 272, 245, 225, 209, 196], + [580, 524, 481, 448, 420, 378, 346, 321, 301, 270, 247, 229, 202, 183, 168, 157, 148], + [368, 346, 328, 312, 298, 276, 257, 242, 230, 209, 193, 181, 162, 147, 136, 127, 120], + [214, 206, 199, 192, 186, 175, 166, 159, 152, 141, 132, 124, 112, 103, 96, 91, 86], + [158, 152, 147, 142, 138, 130, 124, 118, 113, 105, 99, 93, 84, 78, 72, 68, 64], + [127, 124, 121, 118, 115, 110, 106, 103, 99, 93, 88, 84, 77, 72, 68, 64, 61] + ] + } + ] + }, + { + "classname" : "ABlc", + "forcecreate" : true, + "enable" : true, + "tables" : [ + { + "hdr" : false, + "gains" : [1, 16], + "blc" : [256, 256] + }, + { + "hdr" : true, + "gains" : [1, 16], + "blc" : [256, 256] + } + ] + }, + { + "classname" : "AGe", + "forcecreate" : true, + "enable" : true, + "tables" : [ + { + "hdr" : false, + "gains" : [1, 16], + "threshold" : [0, 0], + "dummyline" : [100, 100] + }, + { + "hdr" : true, + "gains" : [1, 16], + "threshold" : [0, 0], + "dummyline" : [100, 100] + } + ] + } + ] +} diff --git a/th1520/hardware/camera/config/common/3aconfig_ry.json b/th1520/hardware/camera/config/common/3aconfig_ry.json new file mode 100755 index 0000000000000000000000000000000000000000..4d43ffafd1f398671ac62e66c629edb03654d095 --- /dev/null +++ b/th1520/hardware/camera/config/common/3aconfig_ry.json @@ -0,0 +1,526 @@ +{ + "root" : [ + { + "classname" : "Aev1", + "enable" : false + }, + { + "classname" : "Aev2", + "enable" : false, + "motionThreshold" : 0.5, + "roiWeight" : 0.6, + "motionFilter" : 0.5, + "maxSensorAgain" : 15.5, + "maxSensorDgain" : 1, + "maxIspDgain" : 2.6, + "setPoint" : 50, + "roi_start" : 8, + "roi_end" : 24, + "roi_weight" : 0.5 + }, + { + "classname" : "Aehdr", + "enable" : false, + "motionThreshold" : 0.5, + "roi_start" : 8, + "roi_end" : 24, + "roi_weight" : 0.5, + "faceWeight" : 0.6, + "motionFilter" : 0.5, + "maxSensorAgain" : 15.5, + "maxSensorDgain" : 1, + "maxIspDgain" : 12, + "setPoint" : 30 + }, + { + "classname" : "AdaptiveAe", + "enable" : false, + "motionThreshold" : 0.7, + "roi_start" : 8, + "roi_end" : 24, + "roi_weight" : 0.5, + "faceWeight" : 0.6, + "motionFilter" : 0.5, + "targetFilter" : 0.5, + "wdrContrast.min" : 10, + "wdrContrast.max" : 110, + "lowlight" : { + "linear_repress" : [1, 0.8, 0.6, 0.4, 0.4], + "linear_gain" : [4, 8, 16, 32, 100], + "hdr_repress" : [1, 0.8, 0.8, 0.8, 0.8], + "hdr_gain" : [4, 8, 16, 32, 100] + }, + "maxSensorAgain" : 15.5, + "maxSensorDgain" : 1, + "maxIspDgain" : 12, + "setPoint" : 50 + }, + { + "classname" : "Awbv2", + "enable" : false, + "illuorder" : "A, D50, D65, D75, TL84, F12, CWF", + "indoor" : [1, 1, 1, 1, 1, 1, 1], + "outdoor" : [1, 1, 1, 1, 1, 1, 1], + "transition" : [1, 1, 1, 1, 1, 1, 1], + "lsc_ratio":{ + "gains" : [1, 2, 4, 8, 16, 32], + "vignetting" : [1, 1, 1, 1, 1, 1] + }, + "avg" : 0.0 + }, + { + "classname" : "IspController", + "enable" : true + }, + { + "classname" : "AutoHdr", + "enable" : false + }, + { + "classname" : "DciHist", + "enable" : false, + "gaussMeanPos" : 64, + "gaussSigmaPos" : 128, + "gaussAmpPos" : 1.0, + "gaussMeanNeg" : 0, + "gaussSigmaNeg" : 128, + "gaussAmpNeg" : 1.0 + }, + { + "classname" : "SensorController", + "enable" : false + }, + { + "classname" : "AGamma64", + "forcecreate" : true, + "enable" : true, + "disable" : false, + "tables" : [ + { + "hdr" : false, + "enable" : [1, 1, 1, 1, 1, 1], + "gains" : [1, 2, 4, 8, 16, 32], + "curve" : [ + [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023], + [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023], + [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023], + [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023], + [73, 113, 147, 176, 203, 228, 251, 273, 295, 315, 335, 354, 372, 390, 407, 425, 441, 457, 473, 489, 504, 519, 534, 549, 563, 577, 591, 605, 619, 632, 646, 659, 672, 685, 697, 710, 722, 735, 747, 759, 771, 783, 794, 806, 818, 829, 840, 852, 863, 874, 885, 896, 907, 918, 928, 939, 950, 960, 971, 981, 991, 1002, 1012, 1023], + [18, 35, 53, 70, 86, 103, 120, 136, 153, 169, 186, 202, 219, 235, 251, 267, 283, 300, 316, 332, 348, 364, 380, 396, 412, 428, 444, 460, 476, 491, 507, 523, 539, 555, 571, 586, 602, 618, 634, 649, 665, 681, 696, 712, 728, 743, 759, 775, 790, 806, 821, 837, 853, 868, 884, 899, 915, 930, 946, 961, 977, 992, 1008, 1023] + ] + }, + { + "hdr" : true, + "enable" : [1, 1, 1, 1, 1, 1], + "gains" : [1, 2, 4, 8, 16, 32], + "curve" : [ + [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023], + [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023], + [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023], + [98, 159, 225, 274, 314, 342, 367, 391, 413, 433, 453, 471, 489, 506, 522, 538, 554, 568, 583, 597, 610, 624, 637, 649, 662, 674, 685, 697, 708, 720, 731, 741, 752, 763, 773, 783, 793, 803, 812, 822, 831, 841, 850, 859, 868, 877, 886, 894, 903, 911, 920, 928, 936, 944, 952, 960, 968, 976, 984, 991, 999, 1006, 1014, 1023], + [73, 113, 147, 176, 203, 228, 251, 273, 295, 315, 335, 354, 372, 390, 407, 425, 441, 457, 473, 489, 504, 519, 534, 549, 563, 577, 591, 605, 619, 632, 646, 659, 672, 685, 697, 710, 722, 735, 747, 759, 771, 783, 794, 806, 818, 829, 840, 852, 863, 874, 885, 896, 907, 918, 928, 939, 950, 960, 971, 981, 991, 1002, 1012, 1023], + [73, 113, 147, 176, 203, 228, 251, 273, 295, 315, 335, 354, 372, 390, 407, 425, 441, 457, 473, 489, 504, 519, 534, 549, 563, 577, 591, 605, 619, 632, 646, 659, 672, 685, 697, 710, 722, 735, 747, 759, 771, 783, 794, 806, 818, 829, 840, 852, 863, 874, 885, 896, 907, 918, 928, 939, 950, 960, 971, 981, 991, 1002, 1012, 1023] + ] + } + ] + }, + { + "classname" : "ACproc", + "forcecreate" : true, + "enable" : true, + "disable" : false, + "tables" : [ + { + "hdr" : false, + "enable" : [1, 1, 1, 1, 1, 1], + "gains" : [1, 2, 4, 8, 16, 32], + "contrast" : [1.2, 1.1, 1, 1, 1, 1], + "brightness" : [0, 0, 0, 0, 0, 0], + "saturation" : [1.2, 1.05, 0.92, 0.80, 0.75, 0.6], + "hue" : [0, 0, 0, 0, 0, 0], + "chromaout" : [2, 2, 2, 2, 2, 2], + "lumain" : [2, 2, 2, 2, 2, 2], + "lumaout" : [2, 2, 2, 2, 2, 2] + }, + { + "hdr" : true, + "enable" : [1, 1, 1, 1, 1, 1], + "gains" : [1, 2, 4, 8, 16, 32], + "contrast" : [1.0, 1.0, 1.3, 1.3, 1.5, 1.85], + "brightness" : [-12, -12, -24, -30, -16, 0], + "saturation" : [1.25, 1.0, 0.9, 0.8, 0.7, 0.6], + "hue" : [0, 0, 0, 0, 0, 0], + "chromaout" : [2, 2, 2, 2, 2, 2], + "lumain" : [2, 2, 2, 2, 2, 2], + "lumaout" : [2, 2, 2, 2, 2, 2] + } + ] + }, + { + "classname" : "Aee", + "forcecreate" : true, + "enable" : true, + "disable" : false, + "tables" : [ + { + "hdr" : false, + "enable" : [1, 1, 1, 1, 1, 1], + "gains" : [1, 2, 4, 8, 16, 32], + "strength" : [100, 100, 100, 100, 100, 100], + "srcStrength" : [1, 1, 1, 1, 1, 1], + "yup" : [2048, 2048, 2048, 2048, 2048, 2048], + "ydown" : [2048, 2048, 2048, 2048, 2048, 2048], + "uvgain" : [0, 0, 0, 0, 0, 0], + "edgegain" : [1000, 1000, 1000, 1000, 500, 200] + }, + { + "hdr" : true, + "enable" : [1, 1, 1, 1, 1, 1], + "gains" : [1, 2, 4, 8, 16, 32], + "strength" : [100, 100, 100, 100, 100, 100], + "srcStrength" : [1, 1, 1, 1, 1, 1], + "yup" : [5000, 5000, 5000, 5000, 5000, 5000], + "ydown" : [8000, 8000, 5000, 5000, 5000, 5000], + "uvgain" : [0, 0, 0, 0, 0, 0], + "edgegain" : [2000, 2000, 2000, 1500, 600, 200] + } + ] + }, + { + "classname" : "ACa", + "forcecreate" : true, + "enable" : true, + "disable" : false, + "tables" : [ + { + "hdr" : false, + "enableCA" : [1, 1, 1, 1, 1, 1], + "enableDCI" : [1, 1, 1, 1, 1, 1], + "gains" : [1, 2, 4, 8, 16, 32], + "curveCA" : [ + [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024], + [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024], + [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024], + [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024], + [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024], + [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024] + ], + "curveDCI" : [ + [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1023, 1023], + [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1028, 1023], + [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1028, 1023], + [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1028, 1023], + [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1028, 1023], + [0, 0, 0, 0, 15, 35, 56, 76, 97, 122, 143, 163, 184, 199, 219, 240, 260, 276, 296, 312, 332, 347, 368, 383, 398, 414, 429, 439, 455, 470, 480, 491, 496, 501, 511, 521, 531, 547, 557, 572, 588, 598, 613, 634, 649, 664, 680, 695, 716, 731, 751, 772, 787, 808, 828, 843, 864, 884, 905, 925, 946, 966, 987, 1007, 1028, 1023] + ] + }, + { + "hdr" : true, + "enableCA" : [0, 0, 1, 1, 1, 1], + "enableDCI" : [1, 1, 1, 1, 1, 1], + "gains" : [1, 2, 4, 8, 16, 32], + "curveCA" : [ + [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024], + [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024], + [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024], + [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024], + [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024], + [0, 0, 0, 48, 378, 600, 747, 845, 909, 950, 977, 995, 1006, 1012, 1017, 1019, 1021, 1022, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024] + ], + "curveDCI" : [ + [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022], + [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022], + [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022], + [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022], + [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022], + [0, 0, 0, 0, 0, 0, 0, 3, 6, 10, 14, 20, 27, 34, 43, 53, 64, 76, 90, 105, 121, 139, 158, 178, 199, 221, 244, 268, 292, 317, 343, 368, 394, 420, 445, 471, 495, 520, 544, 568, 592, 615, 638, 659, 681, 702, 722, 742, 762, 780, 799, 817, 834, 852, 868, 885, 901, 917, 933, 948, 963, 979, 995, 1010, 1022] + ] + } + ] + }, + { + "classname" : "ADmsc2", + "forcecreate" : true, + "enable" : true, + "disable" : false, + "demoire_enable" : true, + "demoire_area_thr" : 3, + "demoire_sat_shrink" : 5, + "demoire_r2" : 256, + "demoire_r1" : 0, + "demoire_t2_shift" : 2, + "demoire_t1" : 180, + "demoire_edge_r2" : 256, + "demoire_edge_r1" : 20, + "demoire_edge_t2_shift" : 4, + "demoire_edge_t1" :20, + "depurple_enable" : true, + "depurple_red_sat" : true, + "depurple_blue_sat" : true, + "depurple_sat_shrink" : 8, + "depurple_thr" : 8, + "skin_enable" : false, + "cb_thr_max_2047" : 10, + "cb_thr_min_2047" : 8, + "cr_thr_max_2047" : 10, + "cr_thr_min_2047" : 8, + "y_thr_max_2047" : 10, + "y_thr_min_2047" : 8, + "tables" : [ + { + "hdr" : false, + "gains" : [1, 2, 4, 8, 16, 32], + "enableSharpen" : [1, 1, 1, 1, 1, 1], + "enableSharpenLine" : [0, 0, 0, 0, 0, 0], + "facblack" : [10, 10, 10, 10, 10, 10], + "facwhite" : [10, 10, 10, 10, 10, 10], + "maxblack" : [20, 20, 20, 20, 20, 20], + "maxwhite" : [20, 20, 20, 20, 20, 20], + "t1" : [0, 0, 0, 0, 0, 0], + "t2" : [0, 0, 0, 0, 0, 0], + "t3" : [0, 0, 0, 0, 0, 0], + "t4" : [0, 0, 0, 0, 0, 0], + "r1" : [0, 0, 0, 0, 0, 0], + "r2" : [128, 128, 128, 128, 128, 128], + "r3" : [256, 256, 256, 256, 256, 256], + "gdenoise" : [0, 0, 0, 0, 0, 0], + "gsharpen" : [16, 16, 16, 16, 16, 16], + "sharpen_line_shift2" : [6, 6, 6, 6, 6, 6], + "sharpen_line_shift1" : [5, 5, 5, 5, 5, 5], + "sharpen_line_t1" : [1000, 1000, 1000, 1000, 1000, 1000], + "sharpen_line_strength" : [100, 100, 100, 100, 100, 100], + "sharpen_line_r2" : [200, 200, 200, 200, 200, 200], + "sharpen_line_r1" : [5, 5, 5, 5, 5, 5] + }, + { + "hdr" : true, + "gains" : [1, 2, 4, 8, 16, 32], + "enableSharpen" : [0, 0, 0, 0, 0, 0], + "enableSharpenLine" : [0, 0, 0, 0, 0, 0], + "facblack" : [200, 200, 100, 50, 20, 20], + "facwhite" : [200, 200, 150, 80, 40, 20], + "maxblack" : [200, 200, 100, 100, 100, 100], + "maxwhite" : [200, 200, 200, 200, 200, 200], + "t1" : [0, 0, 0, 0, 0, 0], + "t2" : [0, 0, 0, 0, 0, 0], + "t3" : [0, 0, 0, 0, 0, 0], + "t4" : [0, 0, 0, 0, 0, 0], + "r1" : [0, 0, 0, 0, 0, 0], + "r2" : [128, 128, 128, 128, 128, 128], + "r3" : [256, 256, 256, 256, 256, 256], + "gdenoise" : [0, 0, 0, 0, 0, 0], + "gsharpen" : [16, 16, 16, 16, 16, 16], + "sharpen_line_shift2" : [6, 6, 6, 6, 6, 6], + "sharpen_line_shift1" : [5, 5, 5, 5, 5, 5], + "sharpen_line_t1" : [1000, 1000, 1000, 1000, 1000, 1000], + "sharpen_line_strength" : [100, 100, 100, 100, 100, 100], + "sharpen_line_r2" : [200, 200, 200, 200, 200, 200], + "sharpen_line_r1" : [5, 5, 5, 5, 5, 5] + } + ] + }, + { + "classname" : "AWdr4", + "forcecreate" : false, + "enable" : false, + "disable" : true, + "backlight" : true, + "tables" : [ + { + "hdr" : false, + "enable" : [1, 1, 1, 1, 1, 1], + "gains" : [1, 2, 4, 8, 16, 32], + "backlight" : [0, 0.1, 0.2, 0.3, 0.4, 0.45], + "strength" : [128, 128, 128, 128, 128, 128], + "highStrength" : [20, 20, 20, 90, 90, 90], + "lowStrength" : [4, 8, 16, 24, 45, 64], + "globalStrength" : [0, 0, 0, 0, 0, 0], + "contrast" : [800, 800, 800, 800, 800, 800], + "flatStrength" : [0, 0, 0, 0, 0, 0], + "flatThreshold" : [0, 0, 0, 0, 0, 0] + }, + { + "hdr" : true, + "enable" : [1, 1, 1, 1, 1, 1], + "gains" : [1, 2, 4, 8, 16, 32], + "backlight" : [0, 0.1, 0.2, 0.3, 0.4, 0.45], + "strength" : [128, 128, 128, 128, 128, 128], + "highStrength" : [20, 20, 20, 90, 90, 90], + "lowStrength" : [4, 8, 16, 24, 45, 64], + "globalStrength" : [0, 0, 0, 0, 0, 0], + "contrast" : [800, 800, 800, 800, 800, 800], + "flatStrength" : [0, 0, 0, 0, 0, 0], + "flatThreshold" : [0, 0, 0, 0, 0, 0] + } + ], + "entropy_slope": 200, + "entropy_base": 700, + "entropy" : [0, 0, 0, 2, 3, 6, 11, 22, 39, 67, 111, 177, 227, 266, 321, 355, 377, 355, 221, 0], + "gamma_down" : [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 9, 16, 36, 64, 136, 256, 576, 1023], + "gamma_up" : [0, 283121, 330313, 377512, 424723, 471961, 519250, 566650, 614235, 662241, 711077, 761540, 792420, 815280, 849436, 875575, 913530, 948975, 1002792, 1048575], + "?gamma_up" : [0, 1024, 34837, 56737, 82912, 116814, 162079, 223337, 306767, 420749, 576707, 735048, 745499, 755950, 776852, 797754, 839557, 881361, 964968, 1048575], + "gamma_pre" : [0, 31514, 36815, 42173, 47646, 53350, 59514, 66602, 75530, 88145, 108135, 142869, 175428, 207095, 269144, 330303, 442139, 571475, 810472, 1048575] + }, + { + + "classname" : "A3dnrv3", + "forcecreate" : false, + "enable" : false, + "disable" : false, + "autonoiseLevel": true, + "tnr_en" : false, + "nlm_en" : true, + "tables" : [ + { + "hdr" : false, + "enable" : [0, 0, 0, 0, 0, 0, 0], + "gains" : [1, 2, 4, 8, 16, 32], + "filterLen" : [100, 150, 200, 300, 400, 500], + "filterLen2" : [10, 10, 10, 10, 10, 10], + "motionSlope" : [1, 1, 1, 1, 1, 1], + "noiseLevel" : [25, 40, 60, 80, 100, 120], + "sadweight" : [8, 8, 8, 8, 8, 8], + "motionInvFactor" : [20000, 20000, 20000, 20000, 20000, 20000], + "noisemodel_a" : [0.45071, 0.85596, 1.561850, 2.219000, 3.9409, 5.2362], + "noisemodel_b" : [0.000065, 9.7098, 140.351654, 219.965805, 284.8835, 344.9119], + "autoStrength" : [1.5, 1.5, 1.5, 1.5, 1.5, 1.5], + "motion_dilate_en" : [1, 1, 1, 1, 1, 1], + "motion_erode_en" : [1, 1, 1, 1, 1, 1], + "pregamma_en" : [1, 1, 1, 1, 1, 1], + "strength" : [120, 120, 120, 120, 120, 120], + "range_h" : [7, 7, 7, 7, 7, 7], + "range_v" : [3, 3, 3, 3, 3, 3], + "dialte_h" : [3, 3, 3, 3, 3, 3], + "preweight" : [8, 8, 8, 8, 8, 8], + "noise_thresh_factor" : [2, 2, 2, 2, 2, 2], + "moving_pixel_thresh" : [0.6, 0.6, 0.6, 0.6, 0.6, 0.6] + }, + { + "hdr" : true, + "enable" : [0, 0, 0, 0, 0, 0, 0], + "gains" : [1, 2, 4, 8, 16, 32], + "filterLen" : [100, 150, 200, 300, 400, 500], + "filterLen2" : [10, 10, 10, 10, 10, 10], + "motionSlope" : [1, 1, 1, 1, 1, 1], + "noiseLevel" : [25, 40, 60, 80, 100, 120], + "sadweight" : [8, 8, 8, 8, 8, 8], + "motionInvFactor" : [20000, 20000, 20000, 20000, 20000, 20000], + "noisemodel_a" : [0.45071, 0.85596, 1.561850, 2.219000, 3.9409, 5.2362], + "noisemodel_b" : [0.000065, 9.7098, 140.351654, 219.965805, 284.8835, 344.9119], + "autoStrength" : [1.5, 1.5, 1.5, 1.5, 1.5, 1.5], + "motion_dilate_en" : [1, 1, 1, 1, 1, 1], + "motion_erode_en" : [1, 1, 1, 1, 1, 1], + "pregamma_en" : [1, 1, 1, 1, 1, 1], + "strength" : [120, 120, 120, 120, 120, 120], + "range_h" : [7, 7, 7, 7, 7, 7], + "range_v" : [3, 3, 3, 3, 3, 3], + "dialte_h" : [3, 3, 3, 3, 3, 3], + "preweight" : [8, 8, 8, 8, 8, 8], + "noise_thresh_factor" : [2, 2, 2, 2, 2, 2], + "moving_pixel_thresh" : [0.6, 0.6, 0.6, 0.6, 0.6, 0.6] + } + ] + }, + { + "classname" : "A2dnrv5", + "forcecreate" : false, + "enable" : false, + "disable" : false, + "tables" : [ + { + "hdr" : false, + "enable" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + "gains" : [1, 2, 4, 8, 12, 16, 20, 24, 32, 40], + "strength" : [1, 1, 1, 1, 1, 1, 2, 2, 2, 2], + "sigma" : [5, 5, 5, 8, 8, 8, 11, 11, 11, 14], + "blendstatic" : [90, 90, 90, 90, 90, 90, 90, 35, 35, 40], + "blendmotion" : [100, 100, 100, 100, 100, 100, 100, 100, 100, 100] + }, + { + "hdr" : true, + "enable" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + "gains" : [1, 2, 4, 8, 12, 16, 20, 24, 32, 40], + "strength" : [1, 1, 1, 1, 1, 1, 2, 2, 2, 2], + "sigma" : [5, 5, 5, 8, 8, 8, 11, 11, 11, 14], + "blendstatic" : [90, 90, 90, 90, 90, 90, 90, 35, 35, 40], + "blendmotion" : [100, 100, 100, 100, 100, 100, 100, 100, 100, 100] + } + ] + }, + { + "classname" : "ADpf", + "forcecreate" : false, + "enable" : false, + "disable" : false, + "tables" : [ + { + "hdr" : false, + "enable" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + "gains" : [1, 2, 4, 8, 12, 16, 20, 24, 32, 40], + "gradient" : [0.1, 0.2, 0.4, 0.7, 1, 1.5, 2, 2.5, 3, 3.5], + "offset" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + "Min" : [1, 1, 1, 1, 1, 1, 1, 2, 4, 16], + "Div" : [64, 64, 64, 65, 65, 65, 65, 65, 65, 65], + "sigma_g" : [1, 1, 2, 2, 3, 3, 4, 4, 4, 4], + "sigma_rb" : [1, 1, 2, 2, 3, 3, 4, 4, 4, 4], + "curve" : [ + [4095, 4095, 3677, 3068, 2686, 2219, 1933, 1735, 1587, 1379, 1235, 1129, 979, 877, 801, 742, 695], + [4095, 4056, 2910, 2388, 2073, 1697, 1471, 1317, 1203, 1042, 933, 852, 738, 660, 603, 558, 523], + [3688, 2169, 1687, 1428, 1260, 1050, 918, 827, 758, 660, 592, 542, 470, 421, 385, 357, 335], + [2254, 1553, 1258, 1085, 968, 816, 718, 649, 597, 521, 469, 430, 374, 335, 307, 284, 267], + [1060, 883, 772, 695, 637, 555, 498, 455, 422, 373, 338, 311, 272, 245, 225, 209, 196], + [580, 524, 481, 448, 420, 378, 346, 321, 301, 270, 247, 229, 202, 183, 168, 157, 148], + [368, 346, 328, 312, 298, 276, 257, 242, 230, 209, 193, 181, 162, 147, 136, 127, 120], + [214, 206, 199, 192, 186, 175, 166, 159, 152, 141, 132, 124, 112, 103, 96, 91, 86], + [158, 152, 147, 142, 138, 130, 124, 118, 113, 105, 99, 93, 84, 78, 72, 68, 64], + [127, 124, 121, 118, 115, 110, 106, 103, 99, 93, 88, 84, 77, 72, 68, 64, 61] + ] + }, + { + "hdr" : true, + "enable" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + "gains" : [1, 2, 4, 8, 12, 16, 20, 24, 32, 40], + "gradient" : [0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2], + "offset" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + "Min" : [16, 16, 16, 16, 16, 16, 16, 16, 16, 16], + "Div" : [65, 65, 65, 65, 65, 65, 65, 65, 65, 65], + "sigma_g" : [4, 4, 4, 4, 4, 4, 4, 4, 4, 4], + "sigma_rb" : [4, 4, 4, 4, 4, 4, 4, 4, 4, 4], + "curve" : [ + [4095, 4095, 3677, 3068, 2686, 2219, 1933, 1735, 1587, 1379, 1235, 1129, 979, 877, 801, 742, 695], + [4095, 4056, 2910, 2388, 2073, 1697, 1471, 1317, 1203, 1042, 933, 852, 738, 660, 603, 558, 523], + [3688, 2169, 1687, 1428, 1260, 1050, 918, 827, 758, 660, 592, 542, 470, 421, 385, 357, 335], + [2254, 1553, 1258, 1085, 968, 816, 718, 649, 597, 521, 469, 430, 374, 335, 307, 284, 267], + [1060, 883, 772, 695, 637, 555, 498, 455, 422, 373, 338, 311, 272, 245, 225, 209, 196], + [580, 524, 481, 448, 420, 378, 346, 321, 301, 270, 247, 229, 202, 183, 168, 157, 148], + [368, 346, 328, 312, 298, 276, 257, 242, 230, 209, 193, 181, 162, 147, 136, 127, 120], + [214, 206, 199, 192, 186, 175, 166, 159, 152, 141, 132, 124, 112, 103, 96, 91, 86], + [158, 152, 147, 142, 138, 130, 124, 118, 113, 105, 99, 93, 84, 78, 72, 68, 64], + [127, 124, 121, 118, 115, 110, 106, 103, 99, 93, 88, 84, 77, 72, 68, 64, 61] + ] + } + ] + }, + { + "classname" : "ABlc", + "forcecreate" : false, + "enable" : false, + "tables" : [ + { + "hdr" : false, + "gains" : [1, 16], + "blc" : [256, 256] + }, + { + "hdr" : true, + "gains" : [1, 16], + "blc" : [256, 256] + } + ] + }, + { + "classname" : "ACcm", + "forcecreate" : true + } + ] +} diff --git a/th1520/hardware/camera/config/common/BUILD.gn b/th1520/hardware/camera/config/common/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..e620e13c51588076b00590e7ec58b98a72f52178 --- /dev/null +++ b/th1520/hardware/camera/config/common/BUILD.gn @@ -0,0 +1,98 @@ +# Copyright (c) 2023 Thead CO., LIMITED. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +import("//build/ohos.gni") + +ohos_prebuilt_etc("3aconfig.json") { + source = "./3aconfig.json" + module_install_dir = "usr/share/vi/config" + install_images = [ "system", "vendor" ] + subsystem_name = "thead_products" + part_name = "thead_products" + install_enable = true +} + +ohos_prebuilt_etc("3aconfig_ry.json") { + source = "./3aconfig_ry.json" + module_install_dir = "usr/share/vi/config" + install_images = [ "system", "vendor" ] + subsystem_name = "thead_products" + part_name = "thead_products" + install_enable = true +} + +ohos_prebuilt_etc("dwconfig.json") { + source = "./dwconfig.json" + module_install_dir = "usr/share/vi/config" + install_images = [ "system", "vendor" ] + subsystem_name = "thead_products" + part_name = "thead_products" + install_enable = true +} + +ohos_prebuilt_etc("mh-linux") { + source = "./mh-linux" + module_install_dir = "usr/share/vi/config" + install_images = [ "system", "vendor" ] + subsystem_name = "thead_products" + part_name = "thead_products" + install_enable = true +} + +ohos_prebuilt_etc("Sensor0_Entry.cfg") { + source = "./Sensor0_Entry.cfg" + module_install_dir = "usr/share/vi/config" + install_images = [ "system", "vendor" ] + subsystem_name = "thead_products" + part_name = "thead_products" + install_enable = true +} + +ohos_prebuilt_etc("Sensor1_Entry.cfg") { + source = "./Sensor1_Entry.cfg" + module_install_dir = "usr/share/vi/config" + install_images = [ "system", "vendor" ] + subsystem_name = "thead_products" + part_name = "thead_products" + install_enable = true +} + +ohos_prebuilt_etc("tuning-pipeline.json") { + source = "./tuning-pipeline.json" + module_install_dir = "usr/share/vi/config" + install_images = [ "system", "vendor" ] + subsystem_name = "thead_products" + part_name = "thead_products" + install_enable = true +} + +ohos_prebuilt_etc("video_property.yaml") { + source = "./video_property.yaml" + module_install_dir = "usr/share/vi/config" + install_images = [ "system", "vendor" ] + subsystem_name = "thead_products" + part_name = "thead_products" + install_enable = true +} + +group("common") { + deps = [ + ":3aconfig.json", + ":3aconfig_ry.json", + ":dwconfig.json", + ":mh-linux", + ":Sensor0_Entry.cfg", + ":Sensor1_Entry.cfg", + ":tuning-pipeline.json", + ":video_property.yaml", + ] +} diff --git a/th1520/hardware/camera/config/common/Sensor0_Entry.cfg b/th1520/hardware/camera/config/common/Sensor0_Entry.cfg new file mode 100755 index 0000000000000000000000000000000000000000..43bcdc8859b842cf3692d572e4be2b06554b388d --- /dev/null +++ b/th1520/hardware/camera/config/common/Sensor0_Entry.cfg @@ -0,0 +1,27 @@ +name="ov5693" +drv ="ov5693.drv" +mode = 0 + +[mode.0] +xml = "OV5693.xml" +dwe = "dewarp_config/sensor_dwe_1080P_config.json" + +[mode.1] +xml = "OV5693.xml" +dwe = "dewarp_config/sensor_dwe_1080P_config.json" + +[mode.2] +xml = "OV5693.xml" +dwe = "dewarp_config/sensor_dwe_1080P_config.json" + +[mode.3] +xml = "OV5693.xml" +dwe = "dewarp_config/sensor_dwe_1080P_config.json" + +[mode.4] +xml = "OV5693.xml" +dwe = "dewarp_config/sensor_dwe_1080P_config.json" + +[mode.5] +xml = "OV5693.xml" +dwe = "dewarp_config/sensor_dwe_1080P_config.json" \ No newline at end of file diff --git a/th1520/hardware/camera/config/common/Sensor1_Entry.cfg b/th1520/hardware/camera/config/common/Sensor1_Entry.cfg new file mode 100755 index 0000000000000000000000000000000000000000..3879c36902ec66b48f37ce38752343b9f90b3f2b --- /dev/null +++ b/th1520/hardware/camera/config/common/Sensor1_Entry.cfg @@ -0,0 +1,15 @@ +name="ov2775" +drv = "ov2775.drv" +mode= 0 + +[mode.0] +xml = "OV2775.xml" +dwe = "dewarp_config/sensor_dwe_1080P_config.json" + +[mode.1] +xml = "OV2775.xml" +dwe = "dewarp_config/sensor_dwe_1080P_config.json" + +[mode.2] +xml = "OV2775.xml" +dwe = "dewarp_config/sensor_dwe_1080P_config.json" diff --git a/th1520/hardware/camera/config/common/dwconfig.json b/th1520/hardware/camera/config/common/dwconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..64dd907d865b59c0f5fefba215d0a4dbb5401c2e --- /dev/null +++ b/th1520/hardware/camera/config/common/dwconfig.json @@ -0,0 +1,44 @@ +{ + "?dewarpMode" : "LENS_CORRECTION, FISHEYE_EXPAND, SPLIT_SCREEN, FISHEYE_DEWARP, PERSPECTIVE", + "dewarpMode" : "FISHEYE_DEWARP", + "scale" : + { + "factor" : 1.0, + "roix" : 0, + "roiy" : 0 + }, + "split" : + { + "horizon_line" : 8191, + "vertical_line_down" : 8191, + "vertical_line_up" : 8191 + }, + "hflip" : false, + "vflip" : false, + "rotation" : false, + "bypass" : true, + "camera_matrix" : + [ + 1129.8071142640890, + 0.0, + 983.63311572706345, + 0.0, + 1129.8071142640890, + 524.58274374673260, + 0.0, + 0.0, + 1.0 + ], + "distortion_coeff" : + [ + -0.41220463678138880, + 0.1990385218967787, + 0.0001123849616309287, + -0.00022867419316714756, + -0.050430372226447487, + 0.0, + 0.0, + 0.0 + ], + "perspective" : [ 1.0, 0, 0, 0, 1, 0, 0, 0, 1 ] +} diff --git a/th1520/hardware/camera/config/common/mh-linux b/th1520/hardware/camera/config/common/mh-linux new file mode 100644 index 0000000000000000000000000000000000000000..173ec4ee34b71b754b2b0e7181b4cb341db4454a --- /dev/null +++ b/th1520/hardware/camera/config/common/mh-linux @@ -0,0 +1,94 @@ +# Copyright (c) 2023 Thead CO., LIMITED. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +## Commands to generate dependency files +GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS) +GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS) $(CXXFLAGS) + +## Flags for position independent code +SHAREDLIBCFLAGS = -fPIC +SHAREDLIBCXXFLAGS = -fPIC +SHAREDLIBCPPFLAGS = -DPIC + +## Additional flags when building libraries and with threads +THREADSCPPFLAGS = -D_REENTRANT +LIBCPPFLAGS = + +## Compiler switch to embed a runtime search path +LD_RPATH= -Wl,-zorigin,-rpath,'$$'ORIGIN +LD_RPATH_PRE = -Wl,-rpath, + +## These are the library specific LDFLAGS +# LDFLAGSICUDT=-nodefaultlibs -nostdlib + +## Compiler switch to embed a library name +# The initial tab in the next line is to prevent icu-config from reading it. + LD_SONAME = -Wl,-soname -Wl,$(notdir $(MIDDLE_SO_TARGET)) +#SH# # We can't depend on MIDDLE_SO_TARGET being set. +#SH# LD_SONAME= + +## Shared library options +LD_SOOPTIONS= -Wl,-Bsymbolic + +## Shared object suffix +SO = so +## Non-shared intermediate object suffix +STATIC_O = ao + +## Compilation rules +%.$(STATIC_O): $(srcdir)/%.c + $(call SILENT_COMPILE,$(strip $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS)) -o $@ $<) +%.o: $(srcdir)/%.c + $(call SILENT_COMPILE,$(strip $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS)) -o $@ $<) + +%.$(STATIC_O): $(srcdir)/%.cpp + $(call SILENT_COMPILE,$(strip $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS)) -o $@ $<) +%.o: $(srcdir)/%.cpp + $(call SILENT_COMPILE,$(strip $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS)) -o $@ $<) + + +## Dependency rules +%.d: $(srcdir)/%.c + $(call ICU_MSG,(deps)) $< + @$(SHELL) -ec '$(GEN_DEPS.c) $< \ + | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \ + [ -s $@ ] || rm -f $@' + +%.d: $(srcdir)/%.cpp + $(call ICU_MSG,(deps)) $< + @$(SHELL) -ec '$(GEN_DEPS.cc) $< \ + | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \ + [ -s $@ ] || rm -f $@' + +## Versioned libraries rules + +%.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION) + $(RM) $@ && ln -s ${ + +void* create_CalibDb(); +void destroy_CalibDb(void* thisC); +int32_t install_CalibDb(void* thisC, char* filename); +int32_t uninstall_CalibDb(void* thisC); +CamCalibDbHandle_t getCalibDbHandle(void* thisC); + +#ifdef __cplusplus +} +#endif diff --git a/th1520/hardware/camera/include/cam_device/cam_dct_assert.h b/th1520/hardware/camera/include/cam_device/cam_dct_assert.h new file mode 100755 index 0000000000000000000000000000000000000000..59dc6b041badf851061e46d2a71af4341ed1c01f --- /dev/null +++ b/th1520/hardware/camera/include/cam_device/cam_dct_assert.h @@ -0,0 +1,32 @@ +/******************************************************************************\ +|* Copyright (c) 2020 by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +#ifndef _CAM_DCT_ASSERT_H_ +#define _CAM_DCT_ASSERT_H_ + +/** + * Compile time assert. Use e.g. to check the size of certain data + * types. As this is evaluated at compile time, it will neither cause + * size nor speed overhead, and thus is does not need to be inside + * the NDEBUG. + * + *****************************************************************************/ +/* we need several levels of indirection to make unique enum names working + * we need unique enum names to be able to use DCT_ASSERT_STATIC more than + * one time per compilation unit + */ +#define UNIQUE_ENUM_NAME(u) assert_static__ ## u +#define GET_ENUM_NAME(x) UNIQUE_ENUM_NAME(x) +#define DCT_ASSERT_STATIC(e) enum { GET_ENUM_NAME(__LINE__) = 1/(e) } + + +#endif // _CAM_DCT_ASSERT_H_ diff --git a/th1520/hardware/camera/include/cam_device/cam_device_buf_defs.h b/th1520/hardware/camera/include/cam_device/cam_device_buf_defs.h new file mode 100755 index 0000000000000000000000000000000000000000..a4d7f61f2b01cc6405841495a60444ea973bb41a --- /dev/null +++ b/th1520/hardware/camera/include/cam_device/cam_device_buf_defs.h @@ -0,0 +1,361 @@ +/******************************************************************************\ +|* Copyright (c) 2020 by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +#ifndef _CAMERA_DEVICE_BUF_DEFS_H_ +#define _CAMERA_DEVICE_BUF_DEFS_H_ + +#include "types.h" +#include "cam_dct_assert.h" +#include "cam_device_buf_defs_common.h" + +#define BUFF_POOL_MAX_INPUT_BUF_NUMBER 8 +#define BUFF_POOL_MAX_OUTPUT_BUF_NUMBER 16 + +#define PIC_BUFFER_ALIGN (0x400) +#define PIC_BUFFER_ALIGN_META (0x0) +#define PIC_BUFFER_MEM_SIZE_MAX (256 * 1024 * 1024) + +#define PIC_BUFFER_NUM_INPUT (1) +#define PIC_BUFFER_SIZE_INPUT (8 * 1024 * 1024) // 21MPixel@12bit => 42MByte +#define PIC_BUFFER_NUM_LARGE_IMAGE (3) +#define PIC_BUFFER_SIZE_LARGE_IMAGE (8 * 1024 * 1024) // modify by wuyi to fix alloc memory fail TBD 21MPixel@12bit => 42MByte +#define PIC_BUFFER_NUM_SMALL_IMAGE (4) +#define PIC_BUFFER_SIZE_SMALL_IMAGE (8 * 1024 * 1024) // 2MPixel@4:4:4 10bit => 8MByte + + +#ifdef ISP_DEC +#define DEC_TILE_BUFFER_SIZE (172032) // (pictureSize/(tile size))*tile status bits)/8 tilesize=> 128byte tile status bits=> 4 +#endif +DCT_ASSERT_STATIC(((PIC_BUFFER_NUM_INPUT*PIC_BUFFER_SIZE_INPUT) + (PIC_BUFFER_NUM_LARGE_IMAGE*PIC_BUFFER_SIZE_LARGE_IMAGE) + (PIC_BUFFER_NUM_SMALL_IMAGE*PIC_BUFFER_SIZE_SMALL_IMAGE)) < PIC_BUFFER_MEM_SIZE_MAX); + +#ifdef ISP_SINGLE_DOM_OVER_MP +#define PIC_BUFFER_NUM_MAIN_SENSOR (10) +#define PIC_BUFFER_SIZE_MAIN_SENSOR (16 * 1024 * 1024) // 2MPixel@4:4:4 => 6MByte +#define PIC_BUFFER_NUM_SELF1_SENSOR (0) +#define PIC_BUFFER_SIZE_SELF1_SENSOR (6 * 1024 * 1024) // 2MPixel@4:4:4 => 6MByte, no buffer for sp +#define PIC_BUFFER_NUM_SELF2_SENSOR (0) +#define PIC_BUFFER_SIZE_SELF2_SENSOR (6 * 1024 * 1024) // 2MPixel@4:4:4 => 6MByte, no buffer for sp +#define PIC_BUFFER_NUM_PP_PATH_RAW_SENSOR (0) +#define PIC_BUFFER_SIZE_PP_PATH_RAW_SENSOR (6 * 1024 * 1024) // 2MPixel@4:4:4 => 6MByte, no buffer for sp + +#define PIC_BUFFER_NUM_RDI_SENSOR (0) +#define PIC_BUFFER_SIZE_RDI_SENSOR (6 * 1024 * 1024) // 2MPixel@4:4:4 => 6MByte +#define PIC_BUFFER_NUM_META_SENSOR (6) +#define PIC_BUFFER_SIZE_META_SENSOR (1 * 1024 * 1024) // Meta max size => 1MByte +#define PIC_BUFFER_NUM_MAIN_SENSOR_IMGSTAB ( 10 ) +#define PIC_BUFFER_SIZE_MAIN_SENSOR_IMGSTAB ( 6 * 1024 * 1024 ) // ISI_RES_4416_3312 => 14MPixel@12bit => 28MByte +#define PIC_BUFFER_NUM_SELF_SENSOR_IMGSTAB ( 10 ) +#define PIC_BUFFER_SIZE_SELF_SENSOR_IMGSTAB ( 6 * 1024 * 1024 ) // ISI_RES_4416_3312 => 14MPixel@12bit => 28MByte + +DCT_ASSERT_STATIC(((PIC_BUFFER_NUM_MAIN_SENSOR*PIC_BUFFER_SIZE_MAIN_SENSOR) + (PIC_BUFFER_NUM_SELF1_SENSOR*PIC_BUFFER_SIZE_SELF1_SENSOR) + (PIC_BUFFER_NUM_RDI_SENSOR*PIC_BUFFER_SIZE_RDI_SENSOR) + (PIC_BUFFER_NUM_META_SENSOR*PIC_BUFFER_SIZE_META_SENSOR)) < PIC_BUFFER_MEM_SIZE_MAX); +#else +#define PIC_BUFFER_NUM_MAIN_SENSOR (10) +#define PIC_BUFFER_SIZE_MAIN_SENSOR (16 * 1024 * 1024) // ISI_RES_4416_3312 => 14MPixel@12bit => 28MByte +#define PIC_BUFFER_NUM_SELF1_SENSOR (8) +#define PIC_BUFFER_SIZE_SELF1_SENSOR (6 * 1024 * 1024) // 2MPixel@4:4:4 => 6MByte +#define PIC_BUFFER_NUM_SELF2_SENSOR (2) +#define PIC_BUFFER_SIZE_SELF2_SENSOR (6 * 1024 * 1024) // 2MPixel@4:4:4 => 6MByte +#define PIC_BUFFER_NUM_PP_PATH_RAW_SENSOR (2) +#define PIC_BUFFER_SIZE_PP_PATH_RAW_SENSOR (6 * 1024 * 1024) // 2MPixel@4:4:4 => 6MByte + +#define PIC_BUFFER_NUM_RDI_SENSOR (2) +#define PIC_BUFFER_SIZE_RDI_SENSOR (6 * 1024 * 1024) // 2MPixel@4:4:4 => 6MByte +#define PIC_BUFFER_NUM_META_SENSOR (6) +#define PIC_BUFFER_SIZE_META_SENSOR (1 * 1024 * 1024) // Meta max size => 1MByte +#define PIC_BUFFER_NUM_MAIN_SENSOR_IMGSTAB ( 10 ) +#define PIC_BUFFER_SIZE_MAIN_SENSOR_IMGSTAB ( 6 * 1024 * 1024 ) // ISI_RES_4416_3312 => 14MPixel@12bit => 28MByte +#define PIC_BUFFER_NUM_SELF_SENSOR_IMGSTAB ( 10 ) +#define PIC_BUFFER_SIZE_SELF_SENSOR_IMGSTAB ( 6 * 1024 * 1024 ) // ISI_RES_4416_3312 => 14MPixel@12bit => 28MByte + +DCT_ASSERT_STATIC(((PIC_BUFFER_NUM_MAIN_SENSOR*PIC_BUFFER_SIZE_MAIN_SENSOR) + (PIC_BUFFER_NUM_SELF1_SENSOR*PIC_BUFFER_SIZE_SELF1_SENSOR) + (PIC_BUFFER_NUM_RDI_SENSOR*PIC_BUFFER_SIZE_RDI_SENSOR) + (PIC_BUFFER_NUM_META_SENSOR*PIC_BUFFER_SIZE_META_SENSOR)) < PIC_BUFFER_MEM_SIZE_MAX); +#endif + + +#define PIC_BUFFER_NUM_LARGE_BUF_SENSOR_3D (10) +#define PIC_BUFFER_SIZE_LARGE_BUF_SENSOR_3D (6 * 1024 * 1024) // allocated twice! +#define PIC_BUFFER_NUM_SMALL_BUF_SENSOR_3D (5) +#define PIC_BUFFER_SIZE_SMALL_BUF_SENSOR_3D (6 * 1024 * 1024) // allocated twice! + +DCT_ASSERT_STATIC(((PIC_BUFFER_NUM_LARGE_BUF_SENSOR_3D*2*PIC_BUFFER_SIZE_LARGE_BUF_SENSOR_3D) + (PIC_BUFFER_NUM_SMALL_BUF_SENSOR_3D*2*PIC_BUFFER_SIZE_SMALL_BUF_SENSOR_3D)) < PIC_BUFFER_MEM_SIZE_MAX); + +#ifdef ISP_MI_HANDSHAKE_NANO +#define PIC_BUFFER_NUM_MAIN_MP_HANDSHK (4) // virtual sram buffer number +#endif + + +typedef enum _CAM_DEVICE_ID_ { + CAM_ISPCORE_ID_0 = 0, + CAM_ISPCORE_ID_1 = 1, + CAM_ISPCORE_ID_MAX = 2 +} CAM_DEVICE_ID; + +typedef enum __BUFF_MODE__ { + BUFF_MODE_PHYLINEAR = 0, + BUFF_MODE_USRPTR = 1, // V4l2 mode + BUFF_MODE_KERNEL = 2, + BUFF_MODE_DMAHANDSHAKE = 3, + BUFF_MODE_DIRECTLINK = 4, + BUFF_MODE_NAX = 5, + BUFF_MODE_INVALID = 6, +} BUFF_MODE; + +#define MEDIA_BUF_ALIGN(buf, align) (((buf)+((align)-1U)) & ~((align)-1U)) + + +/*Typedef HAL handle*/ +typedef void *HalHandle_t; + +/******************************************************************************* + * @brief Common SCMI buffer type + * + * This structure defines a SCMI buffer. In addition to an address pointer to + * the actual buffer, this structure also contains the size of the buffer and + * an optional (may be null) pointer to some buffer meta data. This meta data + * is defined seperately for each specific buffer type. The buffer_flags + * variable contains more information about the buffer in the form of + * (up to 32) bit flags. + * The bit flags and their meaning are defined by each SCMI system separately. + * For a list of buffer bit flags, see the respective system's documentation. + */ + +/*Be careful of machine int width bits(32/64)*/ +typedef struct _ScmiBuffer { + void *p_next; /**< Pointer used by module to chain SCMI-buffers */ + void *p_address; /**< Address of the actual buffer */ + uint32_t base_address; /**< HW address of the actual buffer */ + BufIdentity buf_id; +#ifdef ISP_MI_HANDSHAKE_NANO + uint32_t base_addr_sram_cb; /**< HW address of the Nano handshake Sram Cb address */ + uint32_t base_addr_sram_cr; /**< HW address of the Nano handshake Sram Cr address */ +#endif + + uint32_t size; /**< Size of the buffer in bytes */ + uint32_t buffer_flags; /**< Generic buffer flags */ + int64_t time_stamp; /**< Time stamp of the buffer in ticks with 27 MHz resolution */ + void *p_meta_data; /**< Optional pointer to buffer meta data */ +} ScmiBuffer; + + +/** + * + * @brief The MediaBufferPool holds elements from type MediaBuffer_t. + */ +typedef struct MediaBuffer_s { + uint8_t *pBufAddress; /**< Base address of system memory buffer(can differ from + actual buffer start address, set in ScmiBuffer). */ + uint32_t baseAddress; /**< HW address of system memory buffer. */ + +#ifdef ISP_MI_HANDSHAKE_NANO + uint32_t baseAddrCbSram; /**< HW address of sram Cb memory buffer for Nano Handshake. */ + uint32_t baseAddrCrSram; /**< HW address of sram Cr memory buffer for Nano Handshake. */ +#endif + + uint32_t baseSize; /**< Base size of buffer(can differ from actual buffer + size, set in ScmiBuffer). */ + uint32_t lockCount; /**< Counting how many times buffer is used. 0 means + buffer belongs to pool and is free. */ + void *pOwner; + uint32_t duration; /**< Used to calculate duration */ + bool_t syncPoint; /**< Indicates if buffer contains a reference frame. */ + bool_t last; /**< Media source module signals delivery of last buffer. */ + bool_t isFull; /**< Flag set to TRUE when buffer is put in queue as a full buffer */ + ScmiBuffer buf; /**< Common SCMI buffer type */ + void *pNext; /**< Common next pointer that can be used to create linked lists of media buffers. */ + void *pMetaData; /**< Pointer to optional meta data structure. */ +} MediaBuffer_t; + + + +// Pic buffers + +/*****************************************************************************/ +/** + * PicBufType_t + * + * @brief The type of image data a picture buffer holds. + * + * @note MVDU_FXQuad requires PIC_BUF_TYPE_YCbCr422 in PIC_BUF_LAYOUT_SEMIPLANAR mode. + * + *****************************************************************************/ +typedef enum PicBufType_e { + PIC_BUF_TYPE_INVALID = 0x00, + PIC_BUF_TYPE_DATA = 0x08, // just some sequential data + PIC_BUF_TYPE_RAW8 = 0x10, + PIC_BUF_TYPE_RAW16 = 0x11, // includes: 9..16bits, MSBit aligned, LSByte first! + PIC_BUF_TYPE_RAW10 = 0x12, // includes: 10bits, MSBit aligned, LSByte first! + PIC_BUF_TYPE_RAW12 = 0x13, // includes: 12bits, MSBit aligned, LSByte first! + PIC_BUF_TYPE_RAW14 = 0x14, // includes: 14bits, MSBit aligned, LSByte first! + PIC_BUF_TYPE_JPEG = 0x20, + PIC_BUF_TYPE_YCbCr444 = 0x30, + PIC_BUF_TYPE_YCbCr422 = 0x31, + PIC_BUF_TYPE_YCbCr420 = 0x32, + PIC_BUF_TYPE_YCbCr400 = 0x33, + PIC_BUF_TYPE_YCbCr32 = 0x3f, + // PIC_BUF_TYPE_YCbCr400 = 0x33, // "Black&White" + PIC_BUF_TYPE_RGB888 = 0x40, + PIC_BUF_TYPE_RGB666 = 0x41, // R, G & B are LSBit aligned! + PIC_BUF_TYPE_RGB565 = 0x42, // TODO: don't know the memory layout right now, investigate! + PIC_BUF_TYPE_RGB32 = 0x4f, + PIC_BUF_TYPE_META = 0x50, + _PIC_BUF_TYPE_DUMMY_ +} PicBufType_t; + + +/*****************************************************************************/ +/** + * PicBufLayout_t + * + * @brief The layout of the image data a picture buffer holds. + * + * @note MVDU_FXQuad requires PIC_BUF_TYPE_YCbCr422 in PIC_BUF_LAYOUT_SEMIPLANAR mode. + * + *****************************************************************************/ +typedef enum PicBufLayout_e { + PIC_BUF_LAYOUT_INVALID = 0, + + PIC_BUF_LAYOUT_COMBINED = 0x10, // PIC_BUF_TYPE_DATA: Data: D0 D1 D2... + // PIC_BUF_TYPE_RAW8: Data: D0 D1 D2... + // PIC_BUF_TYPE_RAW16/10: Data: D0L D0H D1L D1H... + // PIC_BUF_TYPE_JPEG: Data: J0 J1 J2... + // PIC_BUF_TYPE_YCbCr444: Data: Y0 Cb0 Cr0 Y1 Cb1Cr1... + // PIC_BUF_TYPE_YCbCr422: Data: Y0 Cb0 Y1 Cr0 Y2 Cb1 Y3 Cr1... + // PIC_BUF_TYPE_YCbCr32: Data: Cr0 Cb0 Y0 A0 Cr1 Cb1 Y1 A1... + // PIC_BUF_TYPE_RGB888: Data: R0 G0 B0 R1 B2 G1... + // PIC_BUF_TYPE_RGB666: Data: {00,R0[5:0]} {00,G0[5:0]} {00,B0[5:0]} {00,R1[5:0]} {00,G2[5:0]} {00,B3[5:0]}... + // PIC_BUF_TYPE_RGB565: Data: {R0[4:0],G0[5:3]} {G0[2:0],B0[4:0]} {R1[4:0],G1[5:3]} {G1[2:0],B1[4:0]}... (is this correct?) + // PIC_BUF_TYPE_RGB32: Data: B0 G0 R0 A0 B1 G1 R1 A1... + PIC_BUF_LAYOUT_BAYER_RGRGGBGB = 0x11, // 1st line: RGRG... , 2nd line GBGB... , etc. + PIC_BUF_LAYOUT_BAYER_GRGRBGBG = 0x12, // 1st line: GRGR... , 2nd line BGBG... , etc. + PIC_BUF_LAYOUT_BAYER_GBGBRGRG = 0x13, // 1st line: GBGB... , 2nd line RGRG... , etc. + PIC_BUF_LAYOUT_BAYER_BGBGGRGR = 0x14, // 1st line: BGBG... , 2nd line GRGR... , etc. + + PIC_BUF_LAYOUT_SEMIPLANAR = 0x20, // PIC_BUF_TYPE_YCbCr422: Luma: Y0 Y1 Y2 Y3... ; Chroma: Cb0 Cr0 Cb1 Cr1... + // PIC_BUF_TYPE_YCbCr420: Luma: Y0 Y1 Y2 Y3... ; Chroma: Cb0 Cr0 Cb1 Cr1... + // PIC_BUF_TYPE_YCbCr400: Luma: Y0 Y1 Y2 Y3... ; Chroma: not used + + PIC_BUF_LAYOUT_PLANAR = 0x30, // PIC_BUF_TYPE_YCbCr444: Y: Y0 Y1 Y2 Y3...; Cb: Cb0 Cb1 Cb2 Cb3...; Cr: Cr0 Cr1 Cr2 Cr3... + // PIC_BUF_TYPE_YCbCr422: Y: Y0 Y1 Y2 Y3...; Cb: Cb0 Cb1 Cb2 Cb3...; Cr: Cr0 Cr1 Cr2 Cr3... + // PIC_BUF_TYPE_YCbCr420: Y: Y0 Y1 Y2 Y3...; Cb: Cb0 Cb1 Cb2 Cb3...; Cr: Cr0 Cr1 Cr2 Cr3... + // PIC_BUF_TYPE_YCbCr400: Y: Y0 Y1 Y2 Y3...; Cb: not used; Cr: not used... + // PIC_BUF_TYPE_RGB888: R: R0 R1 R2 R3...; G: G0 G1 G2 G3...; B: B0 B1 B2 B3... + // PIC_BUF_TYPE_RGB666: R: {00,R0[5:0]}...; G: {00,G0[5:0]}...; B: {00,B0[5:0]}... + PIC_BUF_LAYOUT_META_DATA = 0x40, + _PIC_BUF_LAYOUT_DUMMY_ +} PicBufLayout_t; + +/*****************************************************************************/ +/** + * PixelDataAlignMode_t + * + * @brief The align mode of the image data a picture buffer holds. + * + * + *****************************************************************************/ + +enum { + PIC_BUF_DATA_ALIGN_MODE_INVALID = -1, + PIC_BUF_DATA_UNALIGN_MODE = 0, // pixel data not aligned. + PIC_BUF_DATA_ALIGN_128BIT_MODE = 1, // pixel data aligned with 128 bit. + PIC_BUF_DATA_ALIGN_16BIT_MODE = 2, // pixel data aligned with 16 bit. + PIC_BUF_DATA_ALIGN_MODE_MAX +}; + +/*****************************************************************************/ +/** + * PicBufPlane_t + * + * @brief Common information about a color component plane within an image buffer. + * + *****************************************************************************/ +typedef struct PicBufPlane_s { + uint8_t *pData; + uint32_t BaseAddress; + uint32_t PicWidthPixel; + uint32_t PicWidthBytes; + uint32_t PicHeightPixel; + uint8_t PixelDataAlignMode; +} PicBufPlane_t; + +/*****************************************************************************/ +/** + * PicBufMetaData_t + * + * @brief All the meta data one needs to know about an image buffer. + * + *****************************************************************************/ +typedef struct PicBufMetaData_s { + PicBufType_t Type; // type of picture data + PicBufLayout_t Layout; // kind of data layout + uint32_t Align; // min. alignment required for color component planes or sub buffer base adresses for this picture buffer + int64_t TimeStampUs; // timestamp in us + struct PicBufMetaData_s *pNext3D; // Reference to PicBufMetaData of the subsequent buffer in a 3D descriptor chain, valid only in 3D mode; set to NULL if last in chain or for 2D mode. + // Note: depending on the 3D format in use, the primary buffer holds left image data while the secondary buffer holds right or depth information. + // Certain 3D formats require further buffers, in which case the 3D chain consists of more than two descriptors. + BufIdentity buf_id; + union Data_u { // the type and layout dependent meta data + struct data_s { // DATA + uint8_t *pData; + uint32_t BaseAddress; + uint32_t DataSize; + } data; + + struct data_meta { // meta + uint8_t *pData; + uint32_t BaseAddress; + uint32_t DataSize; + } meta; + + PicBufPlane_t raw; // RAW8, RAW16 + + struct jpeg_s { // JPEG + uint8_t *pHeader; + uint32_t HeaderSize; + uint8_t *pData; + uint32_t BaseAddress; + uint32_t DataSize; + } jpeg; + + union YCbCr_u { // YCbCr444, YCbCr422, YCbCr420, YCbCr32 + PicBufPlane_t combined; + struct semiplanar_s { + PicBufPlane_t Y; + PicBufPlane_t CbCr; + } semiplanar; + struct planar_YUV_s { + PicBufPlane_t Y; + PicBufPlane_t Cb; + PicBufPlane_t Cr; + } planar; + } YCbCr; + + union RGB_u { // RGB888, RGB32 + PicBufPlane_t combined; + struct planar_RGB_s { + PicBufPlane_t R; + PicBufPlane_t G; + PicBufPlane_t B; + } planar; + } RGB; +#ifdef ISP_MI_BP + union BAYER_u { // rggb bggr + struct planar_BAYER_s { + PicBufPlane_t R; + PicBufPlane_t Gr; + PicBufPlane_t Gb; + PicBufPlane_t B; + } planar; + } BAYER; +#endif + } Data; +} PicBufMetaData_t; + +#endif // _CAMERA_DEVICE_BUF_DEFS_H_ diff --git a/th1520/hardware/camera/include/cam_device/cam_device_buf_defs_common.h b/th1520/hardware/camera/include/cam_device/cam_device_buf_defs_common.h new file mode 100755 index 0000000000000000000000000000000000000000..b8c589f5e1e0fb2e4a3cc3db6b9383b070833ebb --- /dev/null +++ b/th1520/hardware/camera/include/cam_device/cam_device_buf_defs_common.h @@ -0,0 +1,73 @@ +/******************************************************************************\ +|* Copyright (c) 2020 by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +#ifndef _CAMERA_DEVICE_BUF_DEFS_COMMON_H_ +#define _CAMERA_DEVICE_BUF_DEFS_COMMON_H_ + +enum { + CAMERA_PIX_FMT_YUV422SP = 0, + CAMERA_PIX_FMT_YUV422I, + CAMERA_PIX_FMT_YUV420SP, + CAMERA_PIX_FMT_YUV444, + CAMERA_PIX_FMT_RGB888, + CAMERA_PIX_FMT_RGB888P, + CAMERA_PIX_FMT_RAW8, + CAMERA_PIX_FMT_RAW10, + CAMERA_PIX_FMT_RAW12, + CAMERA_PIX_FMT_MAX, +}; + + +typedef enum _ISPCORE_BUFIO_ID_ { + ISPCORE_BUFIO_MP = 0, + ISPCORE_BUFIO_SP1 = 1, + ISPCORE_BUFIO_SP2 = 2, + ISPCORE_BUFIO_RDI = 3, // RAW dump interface + ISPCORE_BUFIO_META = 4, // meta sw delivery port + ISPCORE_BUFIO_WRITEMAX = 5, + ISPCORE_BUFIO_READ = 6, + ISPCORE_BUFIO_MAX = 7, +} ISPCORE_BUFIO_ID; + +typedef struct __BufIdentity__ { + uint64_t address_usr; // address in V4l2 application space + uint64_t address_daemon; // address in native stack space + uint64_t address_kernel; // address in kernel space + uint32_t address_reg; // address set to ispcore register + uint32_t buffer_idx; // buffer index + uint32_t buff_size; // biffer size + uint32_t filled; + void *ctx; // memory handle + int width; + int height; + int format; +} BufIdentity; + +typedef struct ispcore_meta_kernel_s { + unsigned int data_kernel; +} ispcore_meta_kernel_t; + +typedef struct ispcore_meta_kernel_dma_s { + unsigned int data_kernel_dma; +} ispcore_meta_kernel_dma_t; + +typedef struct ispcore_meta_user_s { + unsigned int data_user; +} ispcore_meta_user_t; + +typedef struct ispcore_meta_s { + ispcore_meta_kernel_t kernel_meta; + ispcore_meta_kernel_dma_t kernel_meta_dma; + ispcore_meta_user_t user_meta; +} ispcore_meta_t; + +#endif // _CAMERA_DEVICE_BUF_DEFS_COMMON_H_ diff --git a/th1520/hardware/camera/include/cam_device/cam_device_ispcore_defs.h b/th1520/hardware/camera/include/cam_device/cam_device_ispcore_defs.h new file mode 100755 index 0000000000000000000000000000000000000000..86db56e6126bcb0684ac9bdf9ea056fef9f7666d --- /dev/null +++ b/th1520/hardware/camera/include/cam_device/cam_device_ispcore_defs.h @@ -0,0 +1,237 @@ +/******************************************************************************\ +|* Copyright (c) 2020 by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +#ifndef _CAMERA_DEVICE_ISPCORE_DEFS_H_ +#define _CAMERA_DEVICE_ISPCORE_DEFS_H_ + +#include "types.h" + +/*****************************************************************************/ +/** + * @brief Lock types for the auto algorithms. Can be OR combined. + * + *****************************************************************************/ +typedef enum CamEngineLockType_e { + CAM_ENGINE_LOCK_NO = 0x00, + CAM_ENGINE_LOCK_AF = 0x01, + CAM_ENGINE_LOCK_AEC = 0x02, + CAM_ENGINE_LOCK_AWB = 0x04, + + CAM_ENGINE_LOCK_ALL = (CAM_ENGINE_LOCK_AF | CAM_ENGINE_LOCK_AEC | CAM_ENGINE_LOCK_AWB) +} CamEngineLockType_t; + +/*****************************************************************************/ +/** + * @brief Auto-Focus-Control search algorithm. + * + *****************************************************************************/ +typedef enum CamEngineAfSearchAlgorithm_e { + CAM_ENGINE_AUTOFOCUS_SEARCH_ALGORITHM_INVALID = 0, /**< invalid search algorithm */ + CAM_ENGINE_AUTOFOCUS_SEARCH_ALGORITHM_FULL_RANGE = 1, /**< full range */ + CAM_ENGINE_AUTOFOCUS_SEARCH_ALGORITHM_ADAPTIVE_RANGE = 2, /**< adaptive range */ + CAM_ENGINE_AUTOFOCUS_SEARCH_ALGORITHM_HILL_CLIMBING = 3, /**< hill climbing */ + CAM_ENGINE_AUTOFOCUS_SEARCH_ALGORITHM_MAX +} CamEngineAfSearchAlgorithm_t; + + +/*****************************************************************************/ +/** + * @brief Auto-Exposure-Control scene evaluation mode. + * + *****************************************************************************/ +typedef enum CamEngineAecSemMode_e { + CAM_ENGINE_AEC_SCENE_EVALUATION_INVALID = 0, /**< invalid mode (only for initialization) */ + CAM_ENGINE_AEC_SCENE_EVALUATION_DISABLED = 1, /**< scene evaluation disabled (fix setpoint) */ + CAM_ENGINE_AEC_SCENE_EVALUATION_FIX = 2, /**< scene evaluation fix (static ROI) */ + CAM_ENGINE_AEC_SCENE_EVALUATION_ADAPTIVE = 3, /**< scene evaluation adaptive (adaptive ROI) */ + CAM_ENGINE_AEC_SCENE_EVALUATION_MAX +} CamEngineAecSemMode_t; + + +/*****************************************************************************/ +/** + * @brief Auto-Exposure-Control histogram. + * + *****************************************************************************/ +#define CAM_ENGINE_AEC_HIST_NUM_BINS 16 /**< number of bins */ +typedef uint32_t CamEngineAecHistBins_t[CAM_ENGINE_AEC_HIST_NUM_BINS]; + + +/*****************************************************************************/ +/** + * @brief Auto-Exposure-Control luminance grid. + * + *****************************************************************************/ +#define CAM_ENGINE_AEC_EXP_GRID_ITEMS 25 /**< number of grid items (see @ref CamerIcMeanLuma_t) */ +typedef uint8_t CamEngineAecMeanLuma_t[CAM_ENGINE_AEC_EXP_GRID_ITEMS]; + + +/*****************************************************************************/ +/** + * @brief Auto-White-Balance mode. + * + *****************************************************************************/ +typedef enum CamEngineAwbMode_e { + CAM_ENGINE_AWB_MODE_INVALID = 0, /**< invalid mode (only for initialization) */ + CAM_ENGINE_AWB_MODE_AUTO = 1, /**< run auto mode */ + CAM_ENGINE_AWB_MODE_MANUAL = 2, /**< manual mode */ + CAM_ENGINE_AWB_MODE_TUNGSTEN = 3, + CAM_ENGINE_AWB_MODE_INCANDESCENT = 4, + CAM_ENGINE_AWB_MODE_SUNNY = 5, + CAM_ENGINE_AWB_MODE_CLOUDY = 6, + CAM_ENGINE_AWB_MODE_MAX +} CamEngineAwbMode_t; + +/******************************************************************************/ +/** + * @brief Enumeration type to configure the chrominace output range in the + * CamerIC color processing unit. + * + *****************************************************************************/ +typedef enum CamerIcCprocChrominanceRangeOut_e { + CAMERIC_CPROC_CHROM_RANGE_OUT_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_CPROC_CHROM_RANGE_OUT_BT601 = 1, /**< CbCr_out clipping range 16..240 according to ITU-R BT.601 standard */ + CAMERIC_CPROC_CHROM_RANGE_OUT_FULL_RANGE = 2, /**< full UV_out clipping range 0..255 */ + CAMERIC_CPROC_CHROM_RANGE_OUT_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcCprocChrominaceRangeOut_t; + + +/******************************************************************************/ +/** + * @brief Enumeration type to configure the luminance output range in the + * CamerIC color processing unit. + * + *****************************************************************************/ +typedef enum CamerIcCprocLuminanceRangeOut_e { + CAMERIC_CPROC_LUM_RANGE_OUT_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_CPROC_LUM_RANGE_OUT_BT601 = 1, /**< Y_out clipping range 16..235; offset of 16 is added to Y_out according to ITU-R BT.601 standard */ + CAMERIC_CPROC_LUM_RANGE_OUT_FULL_RANGE = 2, /**< Y_out clipping range 0..255; no offset is added to Y_out */ + CAMERIC_CPROC_LUM_RANGE_OUT_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcCprocLuminanceRangeOut_t; + + +/******************************************************************************/ +/** + * @brief Enumeration type to configure the luminance input range in the + * CamerIC color processing unit. + * + *****************************************************************************/ +typedef enum CamerIcCprocLuminanceRangeIn_e { + CAMERIC_CPROC_LUM_RANGE_IN_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_CPROC_LUM_RANGE_IN_BT601 = 1, /**< Y_in range 64..940 according to ITU-R BT.601 standard; offset of 64 will be subtracted from Y_in */ + CAMERIC_CPROC_LUM_RANGE_IN_FULL_RANGE = 2, /**< Y_in full range 0..1023; no offset will be subtracted from Y_in */ + CAMERIC_CPROC_LUM_RANGE_IN_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcCprocLuminanceRangeIn_t; + + +/******************************************************************************/ +/** + * @brief Structure to configure the color processing module + * + * @note This structure needs to be converted to driver structure + * + *****************************************************************************/ +typedef struct CamEngineCprocConfig_s { + CamerIcCprocChrominaceRangeOut_t ChromaOut; /**< configuration of color processing chrominance pixel clipping range at output */ + CamerIcCprocLuminanceRangeOut_t LumaOut; /**< configuration of color processing luminance input range (offset processing) */ + CamerIcCprocLuminanceRangeIn_t LumaIn; /**< configuration of color processing luminance output clipping range */ + + float contrast; /**< contrast value to initially set */ + int8_t brightness; /**< brightness value to initially set */ + float saturation; /**< saturation value to initially set */ + float hue; /**< hue value to initially set */ +} CamEngineCprocConfig_t; + + +/******************************************************************************/ +/** + * @brief Enumeration type to configure the IE working mode. + * + *****************************************************************************/ +typedef enum CamerIcIeMode_e { + CAMERIC_IE_MODE_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_IE_MODE_GRAYSCALE = 1, /**< Set a fixed chrominance of 128 (neutral grey) */ + CAMERIC_IE_MODE_NEGATIVE = 2, /**< Luminance and chrominance data is being inverted */ + CAMERIC_IE_MODE_SEPIA = 3, /**< Chrominance is changed to produce a historical like brownish image color */ + CAMERIC_IE_MODE_COLOR = 4, /**< Converting picture to grayscale while maintaining one color component. */ + CAMERIC_IE_MODE_EMBOSS = 5, /**< Edge detection, will look like an relief made of metal */ + CAMERIC_IE_MODE_SKETCH = 6, /**< Edge detection, will look like a pencil drawing */ + CAMERIC_IE_MODE_SHARPEN = 7, /**< Edge detection, will look like a sharper drawing */ + CAMERIC_IE_MODE_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcIeMode_t; + +/******************************************************************************/ +/** + * @brief Enumeration type to configure the IE working range. + * + *****************************************************************************/ +typedef enum CamerIcIeRange_e { + CAMERIC_IE_RANGE_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_IE_RANGE_BT601 = 1, /**< pixel value range accoring to BT.601 */ + CAMERIC_IE_RANGE_FULL_RANGE = 2, /**< YCbCr full range 0..255 */ + CAMERIC_IE_RANG_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcIeRange_t; + +/******************************************************************************/ +/** + * @brief Enumeration type to configure the color selection effect + * + *****************************************************************************/ +typedef enum CamerIcIeColorSelection_e { + CAMERIC_IE_COLOR_SELECTION_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_IE_COLOR_SELECTION_RGB = 1, /**< red, green and blue */ + CAMERIC_IE_COLOR_SELECTION_B = 2, /**< blue */ + CAMERIC_IE_COLOR_SELECTION_G = 3, /**< green */ + CAMERIC_IE_COLOR_SELECTION_GB = 4, /**< green and blue */ + CAMERIC_IE_COLOR_SELECTION_R = 5, /**< red */ + CAMERIC_IE_COLOR_SELECTION_RB = 6, /**< red and blue */ + CAMERIC_IE_COLOR_SELECTION_RG = 7, /**< red and green */ + CAMERIC_IE_COLOR_SELECTION_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcIeColorSelection_t; + +/******************************************************************************/ +/** + * @brief Structure to configure the Image Effects module + * + *****************************************************************************/ +typedef struct CamerIcIeConfig_s { + CamerIcIeMode_t mode; /**< working mode (see @ref CamerIcIeMode_e) */ + CamerIcIeRange_t range; /**< working range (see @ref CamerIcIeRange_e) */ + + union ModeConfig_u { + struct Sepia_s { /**< active when sepia effect */ + uint8_t TintCb; + uint8_t TintCr; + } Sepia; + + struct ColorSelection_s { /**< active when color selection effect */ + CamerIcIeColorSelection_t col_selection; + uint8_t col_threshold; + } ColorSelection; + + struct Emboss_s { /**< active when emboss effect */ + int8_t coeff[9]; + } Emboss; + + struct Sketch_s { /**< active when sketch effect */ + int8_t coeff[9]; + } Sketch; + + struct Sharpen_s { /**< active when sharpen */ + uint8_t factor; /**< sharpen factor */ + uint8_t threshold; /**< corring threshold */ + int8_t coeff[9]; /**< convolution coefficients */ + } Sharpen; + } ModeConfig; +} CamerIcIeConfig_t; + +#endif // _CAMERA_DEVICE_SENSOR_DEFS_H_ diff --git a/th1520/hardware/camera/include/cam_device/cam_device_metadata.h b/th1520/hardware/camera/include/cam_device/cam_device_metadata.h new file mode 100755 index 0000000000000000000000000000000000000000..b8bb17c53d9817e658ffbb22b273029566bb3633 --- /dev/null +++ b/th1520/hardware/camera/include/cam_device/cam_device_metadata.h @@ -0,0 +1,132 @@ +/******************************************************************************\ +|* Copyright (c) 2020 by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +#ifndef _CAMERA_DEVICE_METADATA_H_ +#define _CAMERA_DEVICE_METADATA_H_ + +#include + +typedef struct isp_rect { + int x, y, w, h; +} isp_rect; + +typedef struct isp_metadata { + struct { + bool enable; + uint8_t mode; + isp_rect rc; + uint8_t mean[25]; + uint8_t sem[25]; + } exp; + + struct { + bool enable; + uint8_t mode; + uint16_t gain_r, gain_gr, gain_gb, gain_b; + isp_rect rc; + uint32_t r, g, b; + uint32_t no_white_count; + } awb; + + struct { + bool enable; + int type; // 16, 256 + uint8_t mode; + isp_rect rc; + uint32_t mean[16]; + } hist; + + struct { + bool enable; + isp_rect rc; + uint32_t h_seg, v_seg; + uint32_t x, y; + } vsm; + + struct { + bool enable; + uint32_t thresh; + isp_rect rc[3]; + uint32_t sum_a, sum_b, sum_c; + uint32_t lum_a, lum_b, lum_c; + } afm; + + struct { + bool enable; + isp_rect rc; + uint8_t r, gr, gb, b; + uint8_t mean[4096]; + } exp2; + + int id; + bool filled; // 0-free, 1-filled +} isp_metadata; + + +#define SECTION_NAME_EXP "exp" +#define SECTION_NAME_EXP2 "exp2" +#define SECTION_NAME_HIST "hist" +#define SECTION_NAME_VSM "vsm" +#define SECTION_NAME_AFM "afm" +#define SECTION_NAME_AWB "awb" + +enum { + VIV_METADATA_EXP_MODE_LUMA = 0, + VIV_METADATA_EXP_MODE_RGB, +}; + +enum { + VIV_METADATA_HIST_MODE_NONE = 0, + VIV_METADATA_HIST_MODE_RGB, + VIV_METADATA_HIST_MODE_R, + VIV_METADATA_HIST_MODE_G, + VIV_METADATA_HIST_MODE_B, + VIV_METADATA_HIST_MODE_LUM, +}; + +enum { + VIV_METADATA_AWB_MODE_MANUAL = 0, + VIV_METADATA_AWB_MODE_AUTO = 2, +}; + +#ifdef __cplusplus +#include +#include +typedef std::unordered_map viv_metadata_tag; +static viv_metadata_tag VIV_METADATA_EXP_MODE = { + {"VIV_METADATA_EXP_MODE_LUMA", VIV_METADATA_EXP_MODE_LUMA}, + {"VIV_METADATA_EXP_MODE_RGB", VIV_METADATA_EXP_MODE_RGB}, +}; + +static viv_metadata_tag VIV_METADATA_EXP2_MODE = { +}; + +static viv_metadata_tag VIV_METADATA_AWB_MODE = { + {"VIV_METADATA_AWB_MODE_MANUAL", VIV_METADATA_AWB_MODE_MANUAL}, + {"VIV_METADATA_AWB_MODE_AUTO", VIV_METADATA_AWB_MODE_AUTO}, +}; + +static viv_metadata_tag VIV_METADATA_HIST_MODE = { + {"VIV_METADATA_HIST_MODE_NONE", VIV_METADATA_HIST_MODE_NONE}, + {"VIV_METADATA_HIST_MODE_RGB", VIV_METADATA_HIST_MODE_RGB}, + {"VIV_METADATA_HIST_MODE_R", VIV_METADATA_HIST_MODE_R}, + {"VIV_METADATA_HIST_MODE_G", VIV_METADATA_HIST_MODE_G}, + {"VIV_METADATA_HIST_MODE_B", VIV_METADATA_HIST_MODE_B}, + {"VIV_METADATA_HIST_MODE_LUM", VIV_METADATA_HIST_MODE_LUM}, +}; + +static viv_metadata_tag VIV_METADATA_VSM_MODE = { +}; + +#endif + +#endif diff --git a/th1520/hardware/camera/include/cam_device/cam_device_module_ids.h b/th1520/hardware/camera/include/cam_device/cam_device_module_ids.h new file mode 100755 index 0000000000000000000000000000000000000000..9d9399141c3a0034d1759bfa72ecfc36ad797fbd --- /dev/null +++ b/th1520/hardware/camera/include/cam_device/cam_device_module_ids.h @@ -0,0 +1,721 @@ +/******************************************************************************\ +|* Copyright (c) 2020 by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +#ifndef _CAMERA_DEVICE_MODULE_IDS_ +#define _CAMERA_DEVICE_MODULE_IDS_ + +// Cam_device API header definitions +const uint32_t ISPCORE_MODULE_GROUPID_PREFIX_MASK = 0xFFFFF000; + +typedef enum __MODULE_ID__ { + ISPCORE_MODULE_DEFAULT = 0, + ISPCORE_MODULE_AE_BEGIN = 0x00001000, + ISPCORE_MODULE_AE_PROCESS = 0x00001001, + ISPCORE_MODULE_AE_CFG_GET = 0x00001002, + ISPCORE_MODULE_AE_CFG_SET = 0x00001003, + ISPCORE_MODULE_AE_ECM_GET = 0x00001004, + ISPCORE_MODULE_AE_ECM_SET = 0x00001005, + ISPCORE_MODULE_AE_ENABLE_GET = 0x00001006, + ISPCORE_MODULE_AE_ENABLE_SET = 0x00001007, + ISPCORE_MODULE_AE_RESET = 0x00001008, + ISPCORE_MODULE_AE_END, + + ISPCORE_MODULE_AF_BEGIN = 0x00002000, + ISPCORE_MODULE_AF_PROCESS = 0x00002001, + ISPCORE_MODULE_AF_AVI_GET = 0x00002002, + ISPCORE_MODULE_AF_CFG_GET = 0x00002003, + ISPCORE_MODULE_AF_CFG_SET = 0x00002004, + ISPCORE_MODULE_AF_ENABLE_GET = 0x00002005, + ISPCORE_MODULE_AF_ENABLE_SET = 0x00002006, + ISPCORE_MODULE_AF_END, + + ISPCORE_MODULE_AVS_BEGIN = 0x00003000, + ISPCORE_MODULE_AVS_PROCESS = 0x00003001, + ISPCORE_MODULE_AVS_CFG_GET = 0x00003002, + ISPCORE_MODULE_AVS_CFG_SET = 0x00003003, + ISPCORE_MODULE_AVS_ENABLE_GET = 0x00003004, + ISPCORE_MODULE_AVS_ENABLE_SET = 0x00003005, + ISPCORE_MODULE_AVS_STATUS_GET = 0x00003006, + ISPCORE_MODULE_AVS_END, + + ISPCORE_MODULE_AWB_BEGIN = 0x00004000, + ISPCORE_MODULE_AWB_PROCESS = 0x00004001, + ISPCORE_MODULE_AWB_CFG_GET = 0x00004002, + ISPCORE_MODULE_AWB_CFG_SET = 0x00004003, + ISPCORE_MODULE_AWB_ENABLE_GET = 0x00004004, + ISPCORE_MODULE_AWB_ENABLE_SET = 0x00004005, + ISPCORE_MODULE_AWB_GAIN_SET = 0x00004006, + ISPCORE_MODULE_AWB_ILLUMPRO_GET = 0x00004007, + ISPCORE_MODULE_AWB_RESET = 0x00004008, + ISPCORE_MODULE_AWB_STATUS_GET = 0x00004009, + ISPCORE_MODULE_AWB_MEAS_WIN_SET = 0x0000400A, + ISPCORE_MODULE_AWB_END, + + ISPCORE_MODULE_BLS_BEGIN = 0x00005000, + ISPCORE_MODULE_BLS_PROCESS = 0x00005001, + ISPCORE_MODULE_BLS_CFG_GET = 0x00005002, + ISPCORE_MODULE_BLS_CFG_SET = 0x00005003, + ISPCORE_MODULE_BLS_END, + + ISPCORE_MODULE_CAC_BEGIN = 0x00006000, + ISPCORE_MODULE_CAC_PROCESS = 0x00006001, + ISPCORE_MODULE_CAC_ENABLE_GET = 0x00006002, + ISPCORE_MODULE_CAC_ENABLE_SET = 0x00006003, + ISPCORE_MODULE_CAC_END, + + ISPCORE_MODULE_CNR_BEGIN = 0x00007000, + ISPCORE_MODULE_CNR_PROCESS = 0x00007001, + ISPCORE_MODULE_CNR_CFG_GET = 0x00007002, + ISPCORE_MODULE_CNR_CFG_SET = 0x00007003, + ISPCORE_MODULE_CNR_ENABLE_GET = 0x00007004, + ISPCORE_MODULE_CNR_ENABLE_SET = 0x00007005, + ISPCORE_MODULE_CNR_END, + + ISPCORE_MODULE_CPROC_BEGIN = 0x00008000, + ISPCORE_MODULE_CPROC_PROCESS = 0x00008001, + ISPCORE_MODULE_CPROC_CFG_GET = 0x00008002, + ISPCORE_MODULE_CPROC_CFG_SET = 0x00008003, + ISPCORE_MODULE_CPROC_ENABLE_GET = 0x00008004, + ISPCORE_MODULE_CPROC_ENABLE_SET = 0x00008005, + ISPCORE_MODULE_CPROC_END, + + ISPCORE_MODULE_DEMOSAIC_BEGIN = 0x00009000, + ISPCORE_MODULE_DEMOSAIC_PROCESS = 0x00009001, + ISPCORE_MODULE_DEMOSAIC_CFG_GET = 0x00009002, + ISPCORE_MODULE_DEMOSAIC_CFG_SET = 0x00009003, + ISPCORE_MODULE_DEMOSAIC_ENABLE_GET = 0x00009004, + ISPCORE_MODULE_DEMOSAIC_ENABLE_SET = 0x00009005, + ISPCORE_MODULE_DEMOSAIC_END, + + ISPCORE_MODULE_DEVICE_BEGIN = 0x0000A000, + ISPCORE_MODULE_DEVICE_PROCESS = 0x0000A001, + ISPCORE_MODULE_DEVICE_CALIBRATIONSAVE = 0x0000A002, + ISPCORE_MODULE_DEVICE_CALIBRATIONLOADANDINIT = 0x0000A003, + ISPCORE_MODULE_DEVICE_CALIBRATIONLOAD = 0x0000A004, + ISPCORE_MODULE_DEVICE_INITENGINEOPERATION = 0x0000A005, + ISPCORE_MODULE_DEVICE_RESOLUTION_SET_SENSOR_ISP = 0x0000A006, + ISPCORE_MODULE_DEVICE_CAMERA_CONNECT = 0x0000A007, + + ISPCORE_MODULE_DEVICE_CAPTUREDMA = 0x0000A008, + ISPCORE_MODULE_DEVICE_CAPTURESENSOR = 0x0000A009, + ISPCORE_MODULE_DEVICE_INPUTINFO = 0x0000A00A, + ISPCORE_MODULE_DEVICE_INPUTSWITCH = 0x0000A00B, + ISPCORE_MODULE_DEVICE_PREVIEW = 0x0000A00C, + ISPCORE_MODULE_DEVICE_BITSTREAMID = 0x0000A00D, + ISPCORE_MODULE_DEVICE_CAMERIC_ID = 0x0000A00E, + ISPCORE_MODULE_DEVICE_INPUT_CONNECT = 0x0000A00F, + ISPCORE_MODULE_DEVICE_INPUT_DISCONNECT = 0x0000A010, + ISPCORE_MODULE_DEVICE_RESET = 0x0000A011, + ISPCORE_MODULE_DEVICE_RESOLUTION_GET = 0x0000A012, + ISPCORE_MODULE_DEVICE_RESOLUTION_SET = 0x0000A013, + ISPCORE_MODULE_DEVICE_STREAMING_START = 0x0000A014, + ISPCORE_MODULE_DEVICE_STREAMING_STOP = 0x0000A015, + ISPCORE_MODULE_DEVICE_CAMERA_DISCONNECT = 0x0000A016, + ISPCORE_MODULE_DEVICE_CAMERA_RESET = 0x0000A017, + ISPCORE_MODULE_DEVICE_PREVIEW_START = 0x0000A018, + ISPCORE_MODULE_DEVICE_PREVIEW_STOP = 0x0000A019, + ISPCORE_MODULE_DEVICE_GET_HALHANDLE = 0x0000A01A, + ISPCORE_MODULE_DEVICE_GET_METADATA = 0x0000A01B, + ISPCORE_MODULE_DEVICE_OUTPUT_IMAGE_FORMAT = 0x0000A01C, + ISPCORE_MODULE_DEVICE_STANDBY_ENABLE_SET = 0x0000A01D, + ISPCORE_MODULE_DEVICE_END, + + ISPCORE_MODULE_2DNR_BEGIN = 0x0000B000, + ISPCORE_MODULE_2DNR_PROCESS = 0x0000B001, + ISPCORE_MODULE_2DNR_CFG_GET = 0x0000B002, + ISPCORE_MODULE_2DNR_CFG_SET = 0x0000B003, + ISPCORE_MODULE_2DNR_ENABLE_GET = 0x0000B004, + ISPCORE_MODULE_2DNR_ENABLE_SET = 0x0000B005, + ISPCORE_MODULE_2DNR_RESET = 0x0000B006, + ISPCORE_MODULE_2DNR_STATUS_GET = 0x0000B007, + ISPCORE_MODULE_2DNR_TABLE_GET = 0x0000B008, + ISPCORE_MODULE_2DNR_TABLE_SET = 0x0000B009, + ISPCORE_MODULE_2DNR_END, + + ISPCORE_MODULE_3DNR_BEGIN = 0x0000C000, + ISPCORE_MODULE_3DNR_PROCESS = 0x0000C001, + ISPCORE_MODULE_3DNR_CFG_GET = 0x0000C002, + ISPCORE_MODULE_3DNR_CFG_SET = 0x0000C003, + ISPCORE_MODULE_3DNR_ENABLE_GET = 0x0000C004, + ISPCORE_MODULE_3DNR_ENABLE_SET = 0x0000C005, + ISPCORE_MODULE_3DNR_RESET = 0x0000C006, + ISPCORE_MODULE_3DNR_STATUS_GET = 0x0000C007, + ISPCORE_MODULE_3DNR_TABLE_GET = 0x0000C008, + ISPCORE_MODULE_3DNR_TABLE_SET = 0x0000C009, + ISPCORE_MODULE_3DNR_END, + + ISPCORE_MODULE_DPCC_BEGIN = 0x0000D000, + ISPCORE_MODULE_DPCC_PROCESS = 0x0000D001, + ISPCORE_MODULE_DPCC_ENABLE_GET = 0x0000D002, + ISPCORE_MODULE_DPCC_ENABLE_SET = 0x0000D003, + ISPCORE_MODULE_DPCC_END, + + ISPCORE_MODULE_DPF_BEGIN = 0x0000E000, + ISPCORE_MODULE_DPF_PROCESS = 0x0000E001, + ISPCORE_MODULE_DPF_CFG_GET = 0x0000E002, + ISPCORE_MODULE_DPF_CFG_SET = 0x0000E003, + ISPCORE_MODULE_DPF_ENABLE_GET = 0x0000E004, + ISPCORE_MODULE_DPF_ENABLE_SET = 0x0000E005, + ISPCORE_MODULE_DPF_END, + + ISPCORE_MODULE_EC_BEGIN = 0x0000F000, + ISPCORE_MODULE_EC_PROCESS = 0x0000F001, + ISPCORE_MODULE_EC_CFG_GET = 0x0000F002, + ISPCORE_MODULE_EC_CFG_SET = 0x0000F003, + ISPCORE_MODULE_EC_STATUS_GET = 0x0000F004, + ISPCORE_MODULE_EC_END, + + ISPCORE_MODULE_EE_BEGIN = 0x00010000, + ISPCORE_MODULE_EE_PROCESS = 0x00010001, + ISPCORE_MODULE_EE_CFG_GET = 0x00010002, + ISPCORE_MODULE_EE_CFG_SET = 0x00010003, + ISPCORE_MODULE_EE_ENABLE_GET = 0x00010004, + ISPCORE_MODULE_EE_ENABLE_SET = 0x00010005, + ISPCORE_MODULE_EE_RESET = 0x00010006, + ISPCORE_MODULE_EE_STATUS_GET = 0x00010007, + ISPCORE_MODULE_EE_TABLE_GET = 0x00010008, + ISPCORE_MODULE_EE_TABLE_SET = 0x00010009, + ISPCORE_MODULE_EE_END, + + ISPCORE_MODULE_FILESYSTEM_BEGIN = 0x00011000, + ISPCORE_MODULE_FILESYSTEM_PROCESS = 0x00011001, + ISPCORE_MODULE_FILESYSTEM_REMOVE = 0x00011002, + ISPCORE_MODULE_FILESYSTEM_END, + + ISPCORE_MODULE_FILTER_BEGIN = 0x00012000, + ISPCORE_MODULE_FILTER_PROCESS = 0x00012001, + ISPCORE_MODULE_FILTER_CFG_GET = 0x00012002, + ISPCORE_MODULE_FILTER_CFG_SET = 0x00012003, + ISPCORE_MODULE_FILTER_ENABLE_GET = 0x00012004, + ISPCORE_MODULE_FILTER_ENABLE_SET = 0x00012005, + ISPCORE_MODULE_FILTER_STATUS_GET = 0x00012006, + ISPCORE_MODULE_FILTER_TABLE_GET = 0x00012007, + ISPCORE_MODULE_FILTER_TABLE_SET = 0x00012008, + ISPCORE_MODULE_FILTER_END, + + ISPCORE_MODULE_GC_BEGIN = 0x00013000, + ISPCORE_MODULE_GC_PROCESS = 0x00013001, + ISPCORE_MODULE_GC_CURVE_GET = 0x00013002, + ISPCORE_MODULE_GC_CURVE_SET = 0x00013003, + ISPCORE_MODULE_GC_CFG_GET = 0x00013004, + ISPCORE_MODULE_GC_CFG_SET = 0x00013005, + ISPCORE_MODULE_GC_ENABLE_GET = 0x00013006, + ISPCORE_MODULE_GC_ENABLE_SET = 0x00013007, + ISPCORE_MODULE_GC_END, + + ISPCORE_MODULE_HDR_BEGIN = 0x00014000, + ISPCORE_MODULE_HDR_PROCESS = 0x00014001, + ISPCORE_MODULE_HDR_CFG_GET = 0x00014002, + ISPCORE_MODULE_HDR_CFG_SET = 0x00014003, + ISPCORE_MODULE_HDR_ENABLE_GET = 0x00014004, + ISPCORE_MODULE_HDR_ENABLE_SET = 0x00014005, + ISPCORE_MODULE_HDR_RESET = 0x00014006, + ISPCORE_MODULE_HDR_END, + + ISPCORE_MODULE_IE_BEGIN = 0x00015000, + ISPCORE_MODULE_IE_PROCESS = 0x00015001, + ISPCORE_MODULE_IE_CFG_GET = 0x00015002, + ISPCORE_MODULE_IE_CFG_SET = 0x00015003, + ISPCORE_MODULE_IE_ENABLE_GET = 0x00015004, + ISPCORE_MODULE_IE_ENABLE_SET = 0x00015005, + ISPCORE_MODULE_IE_END, + + ISPCORE_MODULE_LSC_BEGIN = 0x00016000, + ISPCORE_MODULE_LSC_PROCESS = 0x00016001, + ISPCORE_MODULE_LSC_CFG_GET = 0x00016002, + ISPCORE_MODULE_LSC_CFG_SET = 0x00016003, + ISPCORE_MODULE_LSC_ENABLE_GET = 0x00016004, + ISPCORE_MODULE_LSC_ENABLE_SET = 0x00016005, + ISPCORE_MODULE_LSC_STATUS_GET = 0x00016006, + ISPCORE_MODULE_LSC_END, + + ISPCORE_MODULE_REG_BEGIN = 0x00017000, + ISPCORE_MODULE_REG_PROCESS = 0x00017001, + ISPCORE_MODULE_REG_DESCRIPTION = 0x00017002, + ISPCORE_MODULE_REG_GET = 0x00017003, + ISPCORE_MODULE_REG_SET = 0x00017004, + ISPCORE_MODULE_REG_END, + + ISPCORE_MODULE_SENSOR_BEGIN = 0x00018000, + ISPCORE_MODULE_SENSOR_PROCESS = 0x00018001, + ISPCORE_MODULE_SENSOR_CAPS = 0x00018002, + ISPCORE_MODULE_SENSOR_CFG_GET = 0x00018003, + ISPCORE_MODULE_SENSOR_CFG_SET = 0x00018004, + ISPCORE_MODULE_SENSOR_NAME_GET = 0x00018005, + ISPCORE_MODULE_SENSOR_REVISION_GET = 0x00018006, + ISPCORE_MODULE_SENSOR_OPEN = 0x00018007, + ISPCORE_MODULE_SENSOR_IS_CONNECTED = 0x00018008, + ISPCORE_MODULE_SENSOR_IS_TEST_PATTERN = 0x00018009, + ISPCORE_MODULE_SENSOR_DRV_CHANGE = 0x0001800A, + ISPCORE_MODULE_SENSOR_DRV_LIST = 0x0001800B, + ISPCORE_MODULE_SENSOR_INFO = 0x0001800C, + ISPCORE_MODULE_SENSOR_RESOLUTION_LIST_GET = 0x0001800D, + ISPCORE_MODULE_SENSOR_GET_RESOLUTION_NAME = 0x0001800E, + ISPCORE_MODULE_SENSOR_REG_DESCRIPTION = 0x0001800F, + ISPCORE_MODULE_SENSOR_REG_DUMP2FILE = 0x00018010, + ISPCORE_MODULE_SENSOR_REG_GET = 0x00018011, + ISPCORE_MODULE_SENSOR_REG_SET = 0x00018012, + ISPCORE_MODULE_SENSOR_REG_TABLE = 0x00018013, + ISPCORE_MODULE_SENSOR_RESOLUTION_SET = 0x00018014, + ISPCORE_MODULE_SENSOR_TESTPATTERN_EN_SET = 0x00018015, + ISPCORE_MODULE_SENSOR_CALIB_INSTALL = 0x00018016, + ISPCORE_MODULE_SENSOR_CALIB_UNINSTALL = 0x00018017, + ISPCORE_MODULE_SENSOR_RESOLUTION_SUP_GET = 0x00018018, + ISPCORE_MODULE_SENSOR_FPS_GET = 0x00018019, + ISPCORE_MODULE_SENSOR_FPS_SET = 0x0001801A, + ISPCORE_MODULE_SENSOR_QUERY = 0x0001801B, + ISPCORE_MODULE_SENSOR_MODE_GET = 0x0001801C, + ISPCORE_MODULE_SENSOR_MODE_SET = 0x0001801D, + ISPCORE_MODULE_SENSOR_PRE_LOAD_LIB = 0x0001801E, + ISPCORE_MODULE_SENSOR_RES_W_GET = 0x0001801F, + ISPCORE_MODULE_SENSOR_RES_H_GET = 0x00018020, + ISPCORE_MODULE_SENSOR_MODE_LOCK = 0x00018021, + ISPCORE_MODULE_SENSOR_END, + + ISPCORE_MODULE_SIMP_BEGIN = 0x00019000, + ISPCORE_MODULE_SIMP_PROCESS = 0x00019001, + ISPCORE_MODULE_SIMP_CFG_GET = 0x00019002, + ISPCORE_MODULE_SIMP_CFG_SET = 0x00019003, + ISPCORE_MODULE_SIMP_ENABLE_GET = 0x00019004, + ISPCORE_MODULE_SIMP_ENABLE_SET = 0x00019005, + ISPCORE_MODULE_SIMP_END, + + ISPCORE_MODULE_WB_BEGIN = 0x0001A000, + ISPCORE_MODULE_WB_PROCESS = 0x0001A001, + ISPCORE_MODULE_WB_CFG_GET = 0x0001A002, + ISPCORE_MODULE_WB_CFG_SET = 0x0001A003, + ISPCORE_MODULE_WB_END, + + ISPCORE_MODULE_WDR_BEGIN = 0x0001B000, + ISPCORE_MODULE_WDR_PROCESS = 0x0001B001, + ISPCORE_MODULE_WDR_CFG_GET = 0x0001B002, + ISPCORE_MODULE_WDR_CFG_SET = 0x0001B003, + ISPCORE_MODULE_WDR_ENABLE_GET = 0x0001B004, + ISPCORE_MODULE_WDR_ENABLE_SET = 0x0001B005, + ISPCORE_MODULE_WDR_RESET = 0x0001B006, + ISPCORE_MODULE_WDR_STATUS_GET = 0x0001B007, + ISPCORE_MODULE_WDR_TABLE_GET = 0x0001B008, + ISPCORE_MODULE_WDR_TABLE_SET = 0x0001B009, + ISPCORE_MODULE_WDR_END, + + ISPCORE_MODULE_PIPELINE_BEGIN = 0x0001C000, + ISPCORE_MODULE_PIPELINE_WARM_UP = 0x0001C001, + ISPCORE_MODULE_PIPELINE_SMP_MODE = 0x0001C002, + ISPCORE_MODULE_PIPELINE_CFG_DWE = 0x0001C003, + ISPCORE_MODULE_PIPELINE_CFG_TESTPATTEN_EN = 0x0001C004, + ISPCORE_MODULE_PIPELINE_RESOLUTION_IS_OUT = 0x0001C005, + ISPCORE_MODULE_PIPELINE_RESOLUTION_MP_OUT = 0x0001C006, + ISPCORE_MODULE_PIPELINE_MP_OUT_IMAGE_FORMAT = 0x0001C007, + ISPCORE_MODULE_PIPELINE_QUERY = 0x0001C008, + ISPCORE_MODULE_PIPELINE_CFG_STATUS = 0x0001C009, + ISPCORE_MODULE_PIPELINE_END, + + ISPCORE_MODULE_DMSC2_BEGIN = 0x0001D000, + ISPCORE_MODULE_DMSC2_PROCESS = 0x0001D001, + ISPCORE_MODULE_DMSC2_CFG_SET = 0x0001D002, + ISPCORE_MODULE_DMSC2_CFG_GET = 0x0001D003, + ISPCORE_MODULE_DMSC2_ENABLE_SET = 0x0001D004, + ISPCORE_MODULE_DMSC2_ENABLE_GET = 0x0001D005, + ISPCORE_MODULE_DMSC2_END, + + ISPCORE_MODULE_GE_BEGIN = 0x0001E000, + ISPCORE_MODULE_GE_PROCESS = 0x0001E001, + ISPCORE_MODULE_GE_CFG_SET = 0x0001E002, + ISPCORE_MODULE_GE_CFG_GET = 0x0001E003, + ISPCORE_MODULE_GE_ENABLE_SET = 0x0001E004, + ISPCORE_MODULE_GE_ENABLE_GET = 0x0001E005, + ISPCORE_MODULE_GE_END, + + ISPCORE_MODULE_RGBGAMMA_BEGIN = 0x0001F000, + ISPCORE_MODULE_RGBGAMMA_PROCESS = 0x0001F001, + ISPCORE_MODULE_RGBGAMMA_CFG_SET = 0x0001F002, + ISPCORE_MODULE_RGBGAMMA_CFG_GET = 0x0001F003, + ISPCORE_MODULE_RGBGAMMA_ENABLE_SET = 0x0001F004, + ISPCORE_MODULE_RGBGAMMA_ENABLE_GET = 0x0001F005, + ISPCORE_MODULE_RGBGAMMA_END, + + ISPCORE_MODULE_COLORADJUST_BEGIN = 0x00020000, + ISPCORE_MODULE_COLORADJUST_PROCESS = 0x00020001, + ISPCORE_MODULE_COLORADJUST_CFG_SET = 0x00020002, + ISPCORE_MODULE_COLORADJUST_CFG_GET = 0x00020003, + ISPCORE_MODULE_COLORADJUST_ENABLE_SET = 0x00020004, + ISPCORE_MODULE_COLORADJUST_ENABLE_GET = 0x00020005, + ISPCORE_MODULE_COLORADJUST_END, + + ISPCORE_MODULE_TDNR_BEGIN = 0x00021000, + ISPCORE_MODULE_TDNR_PROCESS = 0x00021001, + ISPCORE_MODULE_TDNR_CFG_SET = 0x00021002, + ISPCORE_MODULE_TDNR_CFG_GET = 0x00021003, + ISPCORE_MODULE_TDNR_ENABLE_SET = 0x00021004, + ISPCORE_MODULE_TDNR_ENABLE_GET = 0x00021005, + ISPCORE_MODULE_TDNR_UPDATE_CURVE = 0x00021006, + ISPCORE_MODULE_TDNR_END, + + ISPCORE_MODULE_DGAIN_BEGIN = 0x00022000, + ISPCORE_MODULE_DGAIN_PROCESS = 0x00022001, + ISPCORE_MODULE_DGAIN_CFG_SET = 0x00022002, + ISPCORE_MODULE_DGAIN_CFG_GET = 0x00022003, + ISPCORE_MODULE_DGAIN_ENABLE_SET = 0x00022004, + ISPCORE_MODULE_DGAIN_ENABLE_GET = 0x00022005, + ISPCORE_MODULE_DGAIN_END, + + ISPCORE_MODULE_DCIHIST_BEGIN = 0x00023000, + ISPCORE_MODULE_DCIHIST_PROCESS = 0x00023001, + ISPCORE_MODULE_DCIHIST_CFG_SET = 0x00023002, + ISPCORE_MODULE_DCIHIST_CFG_GET = 0x00023003, + ISPCORE_MODULE_DCIHIST_ENABLE_SET = 0x00023004, + ISPCORE_MODULE_DCIHIST_ENABLE_GET = 0x00023005, + ISPCORE_MODULE_DCIHIST_STATUS_GET = 0x00023006, + ISPCORE_MODULE_DCIHIST_END, + + ISPCORE_MODULE_AEHDRAUTORATIO_BEGIN = 0x00024000, + ISPCORE_MODULE_AEHDRAUTORATIO_PROCESS = 0x00024001, + ISPCORE_MODULE_AEHDRAUTORATIO_CFG_SET = 0x00024002, + ISPCORE_MODULE_AEHDRAUTORATIO_CFG_GET = 0x00024003, + ISPCORE_MODULE_AEHDRAUTORATIO_ENABLE_SET = 0x00024004, + ISPCORE_MODULE_AEHDRAUTORATIO_ENABLE_GET = 0x00024005, + ISPCORE_MODULE_AEHDRAUTORATIO_END, + + ISPCORE_MODULE_END, +} ISPCORE_MODULE_ID; + +// Feature control words definitions +#define AE_MODE_PARAMS "mode" +#define AE_DAMP_OVER_PARAMS "damp.over" +#define AE_DAMP_UNDER_PARAMS "damp.under" +#define AE_SET_POINT_PARAMS "set.point" +#define AE_CLM_TOLERANCE_PARAMS "clm.tolerance" +#define AE_FLICKER_PERIOD_PARAMS "flicker.period" +#define AE_AFPS_PARAMS "afps" +#define AE_HIST_PARAMS_BASE64 "hist" +#define AE_LUMA_PARAMS_BASE64 "luma" +#define AE_OBJECT_REGION_PARAMS_BASE64 "object.region" +#define AE_ENABLE_PARAMS "enable" +#define AE_RESET_PARAMS "reset" + +#define AF_AVAILABEL_PARAMS "available" +#define AF_ALGORITHM_PARAMS "algorithm" +#define AF_ONESHOT_PARAMS "oneshot" +#define AF_ENABLE_PARAMS "enable" + +#define AWB_MODE_PARAMS "mode" +#define AWB_INDEX_PARAMS "index" +#define AWB_DAMPING_PARAMS "damping" +#define AWB_ENABLE_PARAMS "enable" +#define AWB_NAME_PARAMS "name" +#define AWB_ID_PARAMS "id" +#define AWB_DOOR_TYPE_PARAMS "door.type" +#define AWB_AWB_TYPE_PARAMS "awb.type" +#define AWB_AROSS_TALK_COEFF_PARAMS "cross.talk.coeff" +#define AWB_CROSS_TALK_OFFSET_PARAMS "cross.talk.offset" +#define AWB_COMPONENT_GAIN_PARAMS "component.gain" +#define AWB_GAUSS_MEAN_VALUE_PARAMS "gauss.mean.value" +#define AWB_COVARIANCE_MATRIX_PARAMS "covariance.matrix" +#define AWB_GAUSS_FACTOR_PARAMS "gauss.factor" +#define AWB_THRESHOLD_PARAMS "threshold" +#define AWB_SENSOR_GAIN_PARAMS "sensor.gain" +#define AWB_SATURATION_PARAMS "saturation" +#define AWB_SATURATION_CURVE_PARAMS "saturation.curve" +#define AWB_VIGNETTING_PARAMS "vignetting" +#define AWB_VIGNETTING_CURVE_PARAMS "vignetting.curve" +#define AWB_CC_PROFILES_PARAMS "cc.profiles" +#define AWB_NO_PARAMS "no" +#define AWB_PROFILE_NAME_PARAMS "profile.name" +#define AWB_LSC_PARAMS "lsc" +#define AWB_PROFILES_PARAMS "profiles" +#define AWB_F_RG_PROJ_INDOOR_MIN_PARAMS "f.rg.proj.indoor.min" +#define AWB_F_RG_PROJ_OUTDOOR_MIN_PARAMS "f.rg.proj.outdoor.min" +#define AWB_F_RG_PROJ_MAX_PARAMS "f.rg.proj.max" +#define AWB_F_RG_PROJ_MAX_SKY_PARAMS "f.rg.proj.max.sky" +#define AWB_RESET_PARAMS "reset" + +#define AVS_USER_PARAMS "use.params" +#define AVS_ACCELERATION_PARAMS "acceleration" +#define AVS_BASE_GAIN_PARAMS "base.gain" +#define AVS_FALL_OFF_PARAMS "fall.off" +#define AVS_NUM_ITP_POINTS_PARAMS "num.itp.points" +#define AVS_THETA_PARAMS "theta" +#define AVS_X_PARAMS "x" +#define AVS_Y_PARAMS "y" +#define AVS_ENABLE_PARAMS "enable" +#define AVS_DISPLACEMENT_PARAMS "displacement" +#define AVS_OFFSET_PARAMS "offset" + +#define BLS_RED_PARAMS "red" +#define BLS_GREEN_R_PARAMS "green.r" +#define BLS_GREEN_B_PARAMS "green.b" +#define BLS_BLUE_PARAMS "blue" + +#define CAC_ENABLE_PARAMS "enable" + +#define CITF_SIZE_PARAMS "size" +#define CITF_BIN_PARAMS "bin" + +#define CLI_NAME_PARAMS "name" +#define CLI_NUMBER_PARAMS "number" +#define CLI_DATE_PARAMS "date" +#define CLI_VERSIONS_PARAMS "versions" + +#define CNR_TC1_PARAMS "tc1" +#define CNR_TC2_PARAMS "tc2" +#define CNR_ENABLE_PARAMS "enable" + +#define CPROC_BRIGHTNESS_PARAMS "brightness" +#define CPROC_CHROMA_OUT_PARAMS "chroma.out" +#define CPROC_CONTRAST_PARAMS "contrast" +#define CPROC_HUE_PARAMS "hue" +#define CPROC_LUMA_IN_PARAMS "luma.in" +#define CPROC_LUMA_OUT_PARAMS "luma.out" +#define CPROC_SATURATION_PARAMS "saturation" +#define CPROC_ENABLE_PARAMS "enable" + +#define DEMOSAIC_MODE_PARAMS "mode" +#define DEMOSAIC_THRESHOLD_PARAMS "threshold" +#define DEMOSAIC_ENABLE_PARAMS "enable" + +#define DEVICE_CALIBRATION_FILE_PARAMS "calibration.file" +#define DEVICE_FILE_PARAMS "file" +#define DEVICE_SNAPSHOT_TYPE_PARAMS "snapshot.type" +#define DEVICE_RESOLUTION_PARAMS "resolution" +#define DEVICE_LOCK_TYPE_PARAMS "lock.type" +#define DEVICE_COUNT_PARAMS "count" +#define DEVICE_INDEX_PARAMS "index" +#define DEVICE_INPUT_TYPE_PARAMS "input.type" +#define DEVICE_SENSOR_DRIVER_PARAMS "sensor.driver" +#define DEVICE_PREVIEW_PARAMS "preview" +#define DEVICE_BITSTREAM_ID_PARAMS "bitstreamid" +#define DEVICE_CAMER_ID_PARAMS "camerid" +#define DEVICE_WIDTH_PARAMS "width" +#define DEVICE_HEIGHT_PARAMS "height" +#define DEVICE_FORMAT_PARAMS "format" +#define DEVICE_FRAME_PARAMS "frame" +#define DEVICE_FPS_PARAMS "fps" +#define DEVICE_CAMCONNECT_PREVIEW "camera.preview" +#define DEVICE_CAMCONNECT_PREVIEW_CALLBACK "camera.preview.callback" + +#define DPCC_ENABLE_PARAMS "enable" + +#define DPF_GRADIENT_PARAMS "gradient" +#define DPF_OFFSET_PARAMS "offset" +#define DPF_MIN_PARAMS "min" +#define DPF_DIV_PARAMS "div" +#define DPF_SIGMA_GREEN_PARAMS "sigma.green" +#define DPF_SIGMA_RED_BLUE_PARAMS "sigma.red.blue" +#define DPF_ENABLE_PARAMS "enable" + +#define EC_GAIN_PARAMS "gain" +#define EC_GAIN_MIN_PARAMS "gain.min" +#define EC_GAIN_MAX_PARAMS "gain.max" +#define EC_TIME_PARAMS "time" +#define EC_INTEGRATION_MIN_PARAMS "inte.min" +#define EC_INTEGRATION_MAX_PARAMS "inte.max" +#define EC_STEP_PARAMS "step" + + +#define EE_STRENGTH_PARAMS "strength" +#define EE_SHARPEN_PARAMS "sharpen" +#define EE_DEPURPLE_PARAMS "depurple" +#define EE_ENABLE_PARAMS "enable" +#define EE_AUTO_PARAMS "auto" +#define EE_CONFIG_PARAMS "config" +#define EE_TABLE_PARAMS "table" +#define EE_GAIN_PARAMS "gain" +#define EE_INTERGRATION_TIME_PARAMS "intergration.time" + +#define FILTER_DENOISE_PARAMS "denoise" +#define FILTER_SHARPEN_PARAMS "sharpen" +#define FILTER_ENABLE_PARAMS "enable" +#define FILTER_AUTO_PARAMS "auto" +#define FILTER_TABLE_PARAMS "table" +#define FILTER_GAIN_PARAMS "gain" +#define FILTER_INTERGRATION_TIME_PARAMS "intergration.time" + +#define FS_FILENAME_PARAMS "filename" + + +#define GC_CURVE_PARAMS_BASE64 "gc.curve.base64" +#define GC_CURVE_PARAMS "gc.curve" +#define GC_MODE_PARAMS "gc.mode" +#define GC_ENABLE_PARAMS "enable" + + +#define HDR_EXPOSURE_RATIO_PARAMS "exposure.ratio" +#define HDR_EXTENSION_BIT_PARAMS "extension.bit" +#define HDR_TRANSRANGE_START "transrage.start" +#define HDR_TRANSRANGE_END "transrage.end" +//#define HDR_RANGE_START_VALUE_PARAMS "range.start.value" +//#define HDR_VERY_SHORT_WEIGHT_PARAMS "very.short.weight" +#define HDR_ENABLE_PARAMS "enable" + +#define IE_MODE_PARAMS "mode" +#define IE_RANGE_PARAMS "range" +#define IE_CONFIG_PARAMS "config" +#define IE_TINT_CB_PARAMS "tint.cb" +#define IE_TINT_CR_PARAMS "tint.cr" +#define IE_SELECTION_PARAMS "selection" +#define IE_THRESHOLD_PARAMS "threshold" +#define IE_EMBOSS_PARAMS "emboss" +#define IE_COEFF_PARAMS "coeff" +#define IE_SKETCH_PARAMS "sketch" +#define IE_SHARPEN_PARAMS "sharpen" +#define IE_FACTOR_PARAMS "factor" + +#define LSC_ENABLE_PARAMS "enable" +#define LSC_CONFIG_PARAMS "config" +#define LSC_ADAPTIVE_PARAMS "adaptive" + +#define CAC_CONFIG_PARAMS "config" + +#define NR2D_GENERATION_PARAMS "generation" +#define NR2D_DENOISE_PREGAMA_STRENGTH_PARAMS "denoise.pregama.strength" +#define NR2D_DENOISE_STRENGTH_PARAMS "denoise.strength" +#define NR2D_SIGMA_PARAMS "sigma" +#define NR2D_ENABLE_PARAMS "enable" +#define NR2D_TABLE_PARAMS "table" +#define NR2D_AUTO_PARAMS "auto" +#define NR2D_GAIN_PARAMS "gain" +#define NR2D_INTERGRATION_TIME_PARAMS "intergration.time" + +#define NR3D_GENERATION_PARAMS "generation" +#define NR3D_STRENGTH_PARAMS "strength" +//#define NR3D_SPATIAL_DENOISE_PARAMS "spatial.denoise" +//#define NR3D_TEMPORAL_DENOISE_PARAMS "temporal.denoise" +#define NR3D_DELTA_FACTOR_PARAMS "delta.factor" +#define NR3D_MOTION_FACTOR_PARAMS "motion.factor" +#define NR3D_ENABLE_PARAMS "enable" +#define NR3D_TABLE_PARAMS "table" +#define NR3D_AUTO_PARAMS "auto" +#define NR3D_GAIN_PARAMS "gain" +#define NR3D_INTERGRATION_TIME_PARAMS "intergration.time" + +#define REG_MODULE_ID_PARAMS "module.id" +#define REG_COUNT_PARAMS "count" +#define REG_ADDRESS_PARAMS "address" +#define REG_PERMISSION_PARAMS "permission" +#define REG_NAME_PARAMS "name" +#define REG_HINT_PARAMS "hint" +#define REG_RESET_VALUE_PARAMS "reset.value" +#define REG_USED_BITS_PARAMS "used.bits" +#define REG_WRITABLE_BITS_PARAMS "writable.bits" +#define REG_REGISTERS_PARAMS "registers" +#define REG_VALUE_PARAMS "value" + +#define BASE64_PARAMS "base64.params" +#define BASE64_SIZE "base64.size" +#define BASE64_BIN "base64.bin" +#define SENSOR_CAPS_PARAMS_BASE64 "caps" +#define SENSOR_CONFIG_PARAMS_BASE64 "config" +#define SENSOR_NAME_GET "name.get" + +#define SENSOR_DRIVER_FILE_PARAMS "driver.file" +#define SENSOR_CALIB_FILE_PARAMS "calib.file" +#define SENSOR_VALUE_PARAMS "value" +#define SENSOR_DESCRIPTION_PARAMS "description" +#define SENSOR_RESOLUTION_LIST_PARAMS "resolution.list" +#define SENSOR_SENSOR_DRIVER_PARAMS "sensor.driver" +#define SENSOR_SENSOR_I2C_NUMBER "sensor.i2c.number" +#define SENSOR_SENSOR_DEVICEID "sensor.deviceid" +#define SENSOR_CALIBRATION_DATA_PARAMS "calibration.data" +#define SENSOR_SENSOR_NAME_PARAMS "sensor.name" +#define SENSOR_SENSOR_STATE_PARAMS "sensor.state" +#define SENSOR_SENSOR_ID_PARAMS "sensor.id" +#define SENSOR_SENSOR_GET_RESOLUTION_NAME "resolution.name" +#define SENSOR_CONNECTION_PARAMS "connection" +#define SENSOR_TEST_PATTERN_PARAMS "test.pattern" +#define SENSOR_BAYER_PATTERN_PARAMS "bayer.pattern" +#define SENSOR_BUS_WIDTH_PARAMS "bus.width" +#define SENSOR_MIPI_MODE_PARAMS "mipi.mode" +#define SENSOR_BLACK_LEVEL_CONTROL_PARAMS "black.level.control" +#define SENSOR_AUTO_GAIN_CONTROL_PARAMS "auto.gain.control" +#define SENSOR_AUTO_EXPOSURE_CONTROL_PARAMS "auto.exposure.control" +#define SENSOR_AUTO_WHITE_BALANCE_PARAMS "auto.white.balance" +#define SENSOR_DEFECT_PIXEL_CORRECTION_PARAMS "defect.pixel.correction" +#define SENSOR_ADDRESS_PARAMS "address" +#define SENSOR_DEFAULT_VALUE_PARAMS "default.value" +#define SENSOR_NAME_PARAMS "name" +#define SENSOR_FLAGS_PARAMS "flags" +#define SENSOR_FILENAME_PARAMS "filename" +#define SENSOR_REGISTERS_PARAMS "registers" +#define SENSOR_RESOLUTION_PARAMS "resolution" +#define SENSOR_ENABLE_PARAMS "enable" +#define SENSOR_REG_DUMP_FILE_NAME "reg.dump.file.name" +#define SENSOR_FPS_PARAMS "fps" +#define SENSOR_DEVICE_NAME_PARAMS "sensor.name" +#define SENSOR_HDR_PARAMS "sensor.hdr" +#define SENSOR_MODE "mode" +#define SENSOR_RES_W "resw" +#define SENSOR_RES_H "resh" +#define ISP_DEVICE_NAME_PARAMS "isp.name" +#define CSI_DEVICE_NAME_PARAMS "csi.name" +#define CSI_DEVICE_PAD_PARAMS "csi.pad" +#define CSI_FORMAT_PARAMS "csi.format" + + +#define SIMP_ENABLE_PARAMS "enable" +#define SIMP_FILE_PARAMS "file" +#define SIMP_MODE_PARAMS "mode" +#define SIMP_X_PARAMS "x" +#define SIMP_Y_PARAMS "y" +#define SIMP_CB_PARAMS "cb" +#define SIMP_CR_PARAMS "cr" + +#define WB_MATRIX_PARAMS "matrix" +#define WB_OFFSET_PARAMS "offset" +#define WB_RED_PARAMS "red" +#define WB_GREEN_PARAMS "green" +#define WB_BLUE_PARAMS "blue" +#define WB_GAINS_PARAMS "wb.gains" +#define WB_GREEN_R_PARAMS "green.r" +#define WB_GREEN_B_PARAMS "green.b" + +#define WDR_GENERATION_PARAMS "generation" +#define WDR_CURVE_PARAMS "curve" +#define WDR_D_Y_PARAMS "d.y" +#define WDR_Y_M_PARAMS "y.m" +#define WDR_STRENGTH_PARAMS "strength" +#define WDR_GAIN_MAX_PARAMS "gain.max" +#define WDR_HIGH_STRENGTH_PARAMS "high.strength" +#define WDR_LOW_STRENGTH_PARAMS "low.strength" +#define WDR_STRENGTH_GLOBAL_PARAMS "strength.global" +#define WDR_CONTRAST_PARAMS "contrast.max" +#define WDR_FLAT_STRENGTH_PARAMS "flat_strength" +#define WDR_FLAT_THRESH_PARAMS "flat_thresh" +#define WDR_ENABLE_PARAMS "enable" +#define WDR_AUTO_PARAMS "auto" +#define WDR_GAIN_PARAMS "gain" +#define WDR_INTERGRATION_TIME_PARAMS "intergration.time" +#define WDR_TABLE_PARAMS "table" + +#define DMSC2_ENABLE_PARAMS "enable" +#define DMSC2_DEMOIRE_ENABLE "demoire.enable" +#define DMSC2_SHARPEN_ENABLE "sharpen.enable" +#define DMSC2_SHARPEN_LINE_ENABLE "sharpen.line.enable" +#define DMSC2_GFILTER_ENABLE "gfilter.enable" +#define DMSC2_SKIN_ENABLE "skin.enable" +#define DMSC2_DEPURPLE_ENABLE "depurple.enable" + +#define RGBGAMMA_ENABLE_PARAMS "enable" +#define COLORADJUST_ENABLE_PARAMS "enable" +#define GE_ENABLE_PARAMS "enable" +#define GE_THRESHOLD_PARAM "ge.threshold" +#define GE_DUMMYLINE "ge.dummyLine" + +#define TDNR_ENABLE_PARAMS "enable" + +#define DGAIN_ENABLE_PARAMS "enable" +#define RECT_LEFT "left" +#define RECT_TOP "top" +#define RECT_WIDTH "width" +#define RECT_HEIGHT "height" + +#endif + diff --git a/th1520/hardware/camera/include/cam_device/cam_device_sensor_defs.h b/th1520/hardware/camera/include/cam_device/cam_device_sensor_defs.h new file mode 100755 index 0000000000000000000000000000000000000000..a915b223d31317e717cd4c4b372a6130510c1d1f --- /dev/null +++ b/th1520/hardware/camera/include/cam_device/cam_device_sensor_defs.h @@ -0,0 +1,56 @@ +/******************************************************************************\ +|* Copyright (c) 2020 by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +#ifndef _CAMERA_DEVICE_SENSOR_DEFS_H_ +#define _CAMERA_DEVICE_SENSOR_DEFS_H_ + +#include "types.h" + +typedef struct IsiResolution_s +{ + uint16_t width; + uint16_t height; +}IsiResolution_t; + +/*****************************************************************************/ +/** + * @brief This structure defines the sensor capabilities. + */ +/*****************************************************************************/ +typedef struct IsiSensorCaps_s { + uint32_t BusWidth; /**< supported bus-width */ + uint32_t Mode; /**< supported operating modes */ + uint32_t FieldSelection; /**< sample fields */ + uint32_t YCSequence; + uint32_t Conv422; + uint32_t BPat; /**< bayer pattern */ + uint32_t HPol; /**< horizontal polarity */ + uint32_t VPol; /**< vertical polarity */ + uint32_t Edge; /**< sample edge */ + IsiResolution_t Resolution; /**< supported resolutions */ + uint32_t SmiaMode; + uint32_t MipiMode; + uint32_t MipiLanes; + uint32_t enableHdr; +} IsiSensorCaps_t; + +/*****************************************************************************/ +/** + * IsiSensorConfig_t + * + * @brief Sensor configuration struct + */ +/*****************************************************************************/ +typedef IsiSensorCaps_t IsiSensorConfig_t; + + +#endif // _CAMERA_DEVICE_SENSOR_DEFS_H_ diff --git a/th1520/hardware/camera/include/cam_device/linux_compat.h b/th1520/hardware/camera/include/cam_device/linux_compat.h new file mode 100755 index 0000000000000000000000000000000000000000..2f48a39dbaf9cb9b1ceb8e7b44755b322d60c6b6 --- /dev/null +++ b/th1520/hardware/camera/include/cam_device/linux_compat.h @@ -0,0 +1,42 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +/** + * @file linux_compat.h + * + * @brief + * Linux compatibility layer. + * + *****************************************************************************/ +#ifndef LINUX_COMPAT_H_ +#define LINUX_COMPAT_H_ + +/***** macro definitions *****************************************************/ + +# ifdef __cplusplus +# include +# include +# else +# include +# include +# endif + +/***** public type definitions ***********************************************/ + +/***** public function prototypes ********************************************/ + +#endif /* LINUX_COMPAT_H_ */ + diff --git a/th1520/hardware/camera/include/cam_device/types.h b/th1520/hardware/camera/include/cam_device/types.h new file mode 100755 index 0000000000000000000000000000000000000000..457715a253e4404b23385e32be65734736333fb1 --- /dev/null +++ b/th1520/hardware/camera/include/cam_device/types.h @@ -0,0 +1,109 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +/** + * @file types.h + * + * This file defines some basic type names like the int types. + * + *****************************************************************************/ +#ifndef TYPES_H_ +#define TYPES_H_ + +#include "linux_compat.h" +#include + +#ifndef __cplusplus + /* Only C99 compilers know stdbool */ + #if (__STDC_VERSION__ >= 199901L) || defined(CONFIG_HAVE_STDBOOL) + #include + #else + #define bool unsigned int + #define true (1) + #define false (0) + #endif +#endif + + +#if defined(__GNUC__) + #if !defined(INLINE) + #define INLINE static inline + #endif +#endif + +#include + +#if defined(__cplusplus) || ((__STDC_VERSION__ >= 199901L)) + #include +#else + + /* We only check for __int8_t_defined */ + /* as this is all that gcc defines. */ + #if !defined(__int8_t_defined) + + /* In the rare cases that a system does not define + * __int8_t_defined (Android p.e.) we check for the + * include guard of the stdint header */ + #if !defined(_STDINT_H) + + typedef unsigned char uint8_t; + typedef signed char int8_t; + typedef unsigned short uint16_t; + typedef short int16_t; + typedef unsigned int uint32_t; + typedef int int32_t; + + #if !defined(_MSC_VER) + typedef signed long long int64_t; + typedef unsigned long long uint64_t; + #else + typedef signed __int64 int64_t; + typedef unsigned __int64 uint64_t; + #endif /* #if !defined(_MSC_VER) */ + + typedef unsigned int uint_least32_t; + typedef int int_least32_t; + typedef unsigned int uint_least8_t; + typedef unsigned int uint; + typedef unsigned char uchar; + + #endif /* #if !defined(_STDINT_H) */ + #endif /* #if !defined(__int8_t_defined) */ +#endif /* #if defined(__cplusplus) || ((__STDC_VERSION__ >= 199901L)) */ + +#ifndef NULL + #define NULL ((void *)0) +#endif + +/* make lint happy: */ +typedef char CHAR; +typedef char char_t; /* like suggested in Misra 6.3 (P. 29) */ + +typedef enum { + BOOL_FALSE = 0, + BOOL_TRUE = (!BOOL_FALSE) +} bool_t; + + +#define UNUSED_PARAM(unref_param) ((void) (unref_param)); +#define CAST_POINTER_TO_UINT32(pointer) ((uint32_t) (pointer)) +#define CAST_POINTER_TO_INT32(pointer) ((int32_t) (pointer)) +#define CAST_UINT32_TO_POINTER(pointerType, value) ((pointerType)(value)) +#define CAST_INT32_TO_POINTER(value) ((int32_t *)(value)) +#define N_ELEMENTS(s) (sizeof(s) / sizeof ((s)[0])) +#define ABS(a) ((a) > 0 ? (a) : -(a)) + +#endif /*TYPES_H_*/ diff --git a/th1520/hardware/camera/include/camera_hal.h b/th1520/hardware/camera/include/camera_hal.h new file mode 100644 index 0000000000000000000000000000000000000000..ab24dd8d8a9853ebe1357bda1ce6c15ec9003ffe --- /dev/null +++ b/th1520/hardware/camera/include/camera_hal.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2023 Thead CO., LIMITED. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __CAMERA_HAL_H__ +#define __CAMERA_HAL_H__ + +#include "csi_camera.h" + +#ifdef __cplusplus +#if __cplusplus +extern "C" { +#endif +#endif + +int CameraOpen(csi_cam_handle_t *camHandle, const char *devName); +int CameraSetMode(csi_cam_handle_t camHandle, struct csi_camera_mode_cfg *camModeCfg); +int CameraQueryProperty(csi_cam_handle_t camHandle, csi_camera_property_description_s *desc); +int CameraSetProperty(csi_cam_handle_t camHandle, csi_camera_properties_s *properties); +int CameraChannelQuery(csi_cam_handle_t camHandle, csi_camera_channel_cfg_s *cfg); +int CameraChannelOpen(csi_cam_handle_t camHandle, csi_camera_channel_cfg_s *cfg); +int CameraCreateEvent(csi_cam_event_handle_t *eventHandle, csi_cam_handle_t camHandle); +int CameraSubscribeEvent(csi_cam_event_handle_t eventHandle, csi_camera_event_subscription_s *subscribe); +int CameraChannelStart(csi_cam_handle_t camHandle, csi_camera_channel_id_e chnId); +int CameraGetEvent(csi_cam_event_handle_t eventHandle, csi_camera_event_s *event, int timeout); +int CameraGetFrameCount(csi_cam_handle_t camHandle, csi_camera_channel_id_e chnId); +int CameraGetFrame(csi_cam_handle_t camHandle, csi_camera_channel_id_e chnId, csi_frame_ex_s *frame, int timeout); +int CameraFrameGetMetaUnit(csi_camera_meta_unit_s *metaUnit, csi_camera_meta_s *metaData, csi_camera_meta_id_e metaField); +int CameraPutFrame(csi_frame_ex_s *frame); +int CameraChannelStop(csi_cam_handle_t camHandle, csi_camera_channel_id_e chnId); +int CameraUnsubscribeEvent(csi_cam_event_handle_t eventHandle, csi_camera_event_subscription_s *subscribe); +int CameraDestoryEvent(csi_cam_event_handle_t eventHandle); +int CameraChannelClose(csi_cam_handle_t camHandle, csi_camera_channel_id_e chnId); +int CameraClose(csi_cam_handle_t camHandle); + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif + +#endif /* end of __CAMERA_HAL_H__ */ \ No newline at end of file diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_cproc_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_cproc_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..e496650aa1465f81e6c30ae0c27290a9f36c0ae8 --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_cproc_drv_api.h @@ -0,0 +1,414 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +#ifndef __CAMERIC_ISP_CPROC_DRV_API_H__ +#define __CAMERIC_ISP_CPROC_DRV_API_H__ + +/** + * @cond cameric_cproc + * + * @file cameric_cproc_drv_api.h + * + * @brief This file contains the CamerIC CPROC driver API definitions. + * + *****************************************************************************/ +/** + * @defgroup cameric_cproc_drv_api CamerIC CPROC Driver API definitions + * @{ + * + * The CamerIC color processing module is responsible for color manipulation + * of the incoming data stream in terms of hue, brightness, contrast and + * saturation. The pixel luminance is modified to manipulate contrast and + * brightness while the chrominance values is modified for hue and saturation + * contrast. + * + * @if CAMERIC_LITE + * + * @image html cproc_lite.png "Overview of the CamerIC MI driver" width=\textwidth + * @image latex cproc_lite.png "Overview of the CamerIC MI driver" width=\textwidth + * + * @endif + * + * @if CAMERIC_FULL + * + * @image html cproc.png "Overview of the CamerIC MI driver" width=\textwidth + * @image latex cproc.png "Overview of the CamerIC MI driver" width=\textwidth + * + * @endif + * + * Color processing is done in terms of luminance and chrominance adjustment. + * + * @arg Contrast processing is done by multiplying the luminance value by the + * contrast adjustment value defined in CPROC_CONTRAST which is in the range + * of 0.0 (0x00) and 1.992 (0xFF). + * + * @arg Brightness is adjusted by adding a value defined in CPROC_BRIGHTNESS + * to the luminance value of a pixel. This 8 bit value is a signed number + * in two’s-complement. + * + * @arg Saturation manipulation in chrominance processing in terms of multiplying + * Cr and Cb with a fixed-point number between 0.0 (0x00) and 1.992 (0xFF). This + * value is to be programmed in CPROC_SATURATION. + * + * @arg Hue processing is a phase shift of the chrominance values between -90 + * (0x80) degree and +87.188 (0x7F) degree to be defined in CPROC_HUE. + * + * The color processing module can be configured to produce pixel values + * according to the BT.601 standard or in full value range. Full value range + * should be used for JPEG encoding. See register COLOR_PROC_CTRL for details + * of the possible configurations. The input pixel range is also configurable, + * because pixels coming from the YCbCr path of the ISP may have both ranges + * depending on the camera sensor used. + * + */ +#include +#include +#include +#ifdef __cplusplus +extern "C" +{ +#endif + + + + + + + + + + +/******************************************************************************/ +/** + * @brief Structure to configure the color processing module + * + *****************************************************************************/ +typedef struct CamerIcCprocConfig_s +{ + CamerIcCprocChrominaceRangeOut_t ChromaOut; /**< configuration of color processing chrominance pixel clipping range at output */ + CamerIcCprocLuminanceRangeOut_t LumaOut; /**< configuration of color processing luminance input range (offset processing) */ + CamerIcCprocLuminanceRangeIn_t LumaIn; /**< configuration of color processing luminance output clipping range */ + + uint8_t contrast; /**< contrast value to initially set */ + uint32_t brightness; /**< brightness value to initially set */ + uint8_t saturation; /**< saturation value to initially set */ + uint8_t hue; /**< hue value to initially set */ +} CamerIcCprocConfig_t; + + + +/*****************************************************************************/ +/** + * @brief This function configures the CamerIC CPROC Module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcCprocConfigure +( + CamerIcDrvHandle_t handle, + CamerIcCprocConfig_t *pConfig +); + +/*****************************************************************************/ +/** + * @brief This function return configures the CamerIC CPROC Module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcCprocGetConfigure +( + CamerIcDrvHandle_t handle, + CamerIcCprocConfig_t *pConfig +); + + +/*****************************************************************************/ +/** + * @brief This function enables the CamerIC CPROC Module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcCprocEnable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This function disables the CamerIc CPROC module (bypass the color + * prcessing module) + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcCprocDisable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This function returns the status of the CamerIC CPROC module. + * + * @param handle CamerIc driver handle + * @param pIsEnabled Pointer to value to store current state + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_NULL_POINTER pIsEnabled is a NULL pointer + * + *****************************************************************************/ +extern RESULT CamerIcCprocIsEnabled +( + CamerIcDrvHandle_t handle, + bool_t *pIsEnabled +); + + + +/*****************************************************************************/ +/** + * @brief This function sets the ranges in the CamerIc CPROC module. + * + * @param handle CamerIc driver handle + * @param ChromaOut Color processing chrominance pixel clipping + * range at output + * @param LumaOut Color processing luminance output clipping + * range + * @param LumaIn Color processing luminance input range + * (offset processing) + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcCprocSetRanges +( + CamerIcDrvHandle_t handle, + const CamerIcCprocChrominaceRangeOut_t ChromaOut, + const CamerIcCprocLuminanceRangeOut_t LumaOut, + const CamerIcCprocLuminanceRangeIn_t LumaIn +); + + + +/*****************************************************************************/ +/** + * @brief This function returns the contrast value currently configured in + * CamerIC CPROC module. + * + * @param handle CamerIc driver handle + * @param contrast pointer to store the current contrast value + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_NULL_POINTER pointer is a NULL pointer + * + *****************************************************************************/ +extern RESULT CamerIcCprocGetContrast +( + CamerIcDrvHandle_t handle, + uint8_t *contrast +); + + + +/*****************************************************************************/ +/** + * @brief This function sets the contrast value CamerIC CPROC module. + * + * @param handle CamerIc driver handle + * @param contrast contrast value to set + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_OUTOFRANGE given contrast value is out of range + * + *****************************************************************************/ +extern RESULT CamerIcCprocSetContrast +( + CamerIcDrvHandle_t handle, + const uint8_t contrast +); + + + +/*****************************************************************************/ +/** + * @brief This function returns the brightness value currently configured in + * CamerIC CPROC module. + * + * @param handle CamerIc driver handle + * @param brightness pointer to store the current brightness value + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_OUTOFRANGE given brightness value is out of range + * + *****************************************************************************/ +extern RESULT CamerIcCprocGetBrightness +( + CamerIcDrvHandle_t handle, + uint8_t *brightness +); + + + +/*****************************************************************************/ +/** + * @brief This function sets the brightness value in CamerIC CPROC module. + * + * @param handle CamerIc driver handle + * @param brightness brightness value to set + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_OUTOFRANGE given brightness value is out of range + * + *****************************************************************************/ +extern RESULT CamerIcCprocSetBrightness +( + CamerIcDrvHandle_t handle, + const uint8_t brightness +); + + + +/*****************************************************************************/ +/** + * @brief This function returns the saturation value currently configured in + * CamerIC CPROC module. + * + * @param handle CamerIc driver handle + * @param saturation pointer to store the current saturation value + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_OUTOFRANGE given brightness value is out of range + * + *****************************************************************************/ +extern RESULT CamerIcCprocGetSaturation +( + CamerIcDrvHandle_t handle, + uint8_t *saturation +); + + + +/*****************************************************************************/ +/** + * @brief This function sets the saturation value in CamerIC CPROC module. + * + * @param handle CamerIc driver handle + * @param saturation saturation value to set + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_OUTOFRANGE given saturation value is out of range + * + *****************************************************************************/ +extern RESULT CamerIcCprocSetSaturation +( + CamerIcDrvHandle_t handle, + const uint8_t saturation +); + + + +/*****************************************************************************/ +/** + * @brief This function returns the hue value currently configured in + * CamerIC CPROC module. + * + * @param handle CamerIc driver handle + * @param hue pointer to store the current hue value + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_OUTOFRANGE given brightness value is out of range + * + *****************************************************************************/ +extern RESULT CamerIcCprocGetHue +( + CamerIcDrvHandle_t handle, + uint8_t *hue +); + + + +/*****************************************************************************/ +/** + * @brief This function sets the hue value in CamerIC CPROC module. + * + * @param handle CamerIc driver handle + * @param hue hue value to set + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_OUTOFRANGE given hue value is out of range + * + *****************************************************************************/ +extern RESULT CamerIcCprocSetHue +( + CamerIcDrvHandle_t handle, + const uint8_t hue +); + + + +#ifdef __cplusplus +} +#endif + +/* @} cameric_cproc_drv_api */ + +/* @endcond */ + +#endif /* __CAMERIC_ISP_CPROC_DRV_API_H__ */ + diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..a4894ec8ccc0f061e53863975740edfdec772d8a --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_drv_api.h @@ -0,0 +1,959 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +/** + * @file cameric_drv_api.h + * + * @brief This file defines the CamerIC driver API + * + *****************************************************************************/ +/** + * @defgroup cameric_drv_api CamerIC driver API definitions + * @{ + * + * + */ + +#ifndef __CAMERIC_DRV_API_H__ +#define __CAMERIC_DRV_API_H__ + +#include + +#include +#include + +#include + +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + + + +/******************************************************************************/ +/** + * @brief Handle type of the CamerIC software driver. + * + *****************************************************************************/ +typedef struct CamerIcDrvContext_s *CamerIcDrvHandle_t; + + + +/******************************************************************************/ +/** + * @brief Enumeration type of the CamerIC drivers top-level modules. + * + *****************************************************************************/ +typedef enum CamerIcModuleIdMask_e +{ + CAMERIC_MODULE_ID_MASK_INVALID = 0x00000000UL, /**< lower border (invalid module id) */ + CAMERIC_MODULE_ID_MASK_SMIA = 0x00000001UL, /**< identifier for the SMIA module */ + CAMERIC_MODULE_ID_MASK_MIPI = 0x00000002UL, /**< identifier for the MIPI module */ + CAMERIC_MODULE_ID_MASK_ISP = 0x00000004UL, /**< identifier for the ISP module */ + CAMERIC_MODULE_ID_MASK_CPROC = 0x00000008UL, /**< identifier for the image effects module */ + CAMERIC_MODULE_ID_MASK_IE = 0x00000010UL, /**< identifier for the color processing unit */ + CAMERIC_MODULE_ID_MASK_SIMP = 0x00000020UL, /**< identifier for the super impose unit */ + CAMERIC_MODULE_ID_MASK_MI = 0x00000040UL, /**< identifier for the memory interface module */ + CAMERIC_MODULE_ID_MASK_JPE = 0x00000080UL, /**< identifier for the JPEG encoder block */ + + CAMERIC_MODULE_ID_MASK_BLS = 0x00010000UL, /**< identifier for ISP black level substraction module */ + CAMERIC_MODULE_ID_MASK_DEGAMMA = 0x00020000UL, /**< identifier for ISP degamma module */ + CAMERIC_MODULE_ID_MASK_LSC = 0x00001000UL, /**< identifier for ISP lense shade correction module */ + CAMERIC_MODULE_ID_MASK_DPCC = 0x00002000UL, /**< identifier for ISP defect pixel cluster correction module */ + CAMERIC_MODULE_ID_MASK_DPF = 0x00004000UL, /**< identifier for ISP denoising pre-filter module */ + CAMERIC_MODULE_ID_MASK_IS = 0x00008000UL, /**< identifier for ISP image stabilization module */ + CAMERIC_MODULE_ID_MASK_AWB = 0x00040000UL, /**< identifier for ISP awb measuring module */ + CAMERIC_MODULE_ID_MASK_ELAWB = 0x00080000UL, /**< identifier for ISP eliptic awb measuring module */ + //CAMERIC_MODULE_ID_MASK_IS = 0x00100000UL, /**< identifier for ISP eliptic IS measuring module */ + CAMERIC_MODULE_ID_MASK_GCMONO = 0x00200000UL, /**< identifier for ISP eliptic Gcmono module */ + CAMERIC_MODULE_ID_MASK_EXPOSURE = 0x04000000UL, /**< identifier for ISP exposure measuring module */ + CAMERIC_MODULE_ID_MASK_HIST = 0x08000000UL, /**< identifier for ISP histogram measuring module */ + CAMERIC_MODULE_ID_MASK_AFM = 0x10000000UL, /**< identifier for ISP af measuring module */ + CAMERIC_MODULE_ID_MASK_VSM = 0x20000000UL, /**< identifier for ISP video stabilization measuring module */ + + CAMERIC_MODULE_ID_MASK_LAST +} CamerIcModuleIdMask_t; + + + +/******************************************************************************/ +/** + * @brief Enumeration type for setting/configuration of the main path muxer + * (vi_mp_mux). + * + *****************************************************************************/ +typedef enum CamerIcMainPathMux_e +{ + CAMERIC_MP_MUX_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_MP_MUX_JPEG_DIRECT = 1, /**< data from DMA read port to JPEG encoder */ + CAMERIC_MP_MUX_MI = 2, /**< data from main resizer/scaler MRSZ to MI */ + CAMERIC_MP_MUX_JPEG = 3, /**< data from main resizer/scaler MRSZ to JPEG encoder */ + CAMERIC_MP_MUX_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcMainPathMux_t; + + + +/******************************************************************************/ +/** + * @brief Enumeration type for setting/configuration of the self path muxer + * (please see register definition VI_DMA_SPMUX in user manual). + * + *****************************************************************************/ +typedef enum CamerIcSelfPathMux_e +{ + CAMERIC_SP_MUX_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_SP_MUX_CAMERA = 1, /**< data from CAMERA port to self path */ + CAMERIC_SP_MUX_DMA_READ = 2, /**< data from DMA Read port to self path */ + CAMERIC_SP_MUX_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcSelfPathMux_t; + + + +/******************************************************************************/ +/** + * @brief Enumeration type for setting/configuration of the Y/C splitter + * (please see register definition VI_CHAN_MODE in user manual). + * + *****************************************************************************/ +typedef enum CamerIcYcSplitterChannelMode_e +{ + CAMERIC_YCSPLIT_CHMODE_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_YCSPLIT_CHMODE_OFF = 1, /**< disable Y/C splitter */ + CAMERIC_YCSPLIT_CHMODE_MP = 2, /**< enable mainpath */ + CAMERIC_YCSPLIT_CHMODE_SP = 3, /**< enable selfpath */ + CAMERIC_YCSPLIT_CHMODE_SP2 = 4, /**< enable selfpath2 */ + + CAMERIC_YCSPLIT_CHMODE_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcYcSplitterChannelMode_t; + +/******************************************************************************/ +/** + * @brief Enumeration type for setting/configuration of the image effects + * muxer (see register definition VI_DMA_IEMUX in user manual). + * + *****************************************************************************/ +typedef enum CamerIcImgEffectsMux_e +{ + CAMERIC_IE_MUX_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_IE_MUX_CAMERA = 1, /**< data from CAMERA port to image effects */ + CAMERIC_IE_MUX_DMA_READ = 2, /**< data from DMA Read port to image effects */ + CAMERIC_IE_MUX_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcImgEffectsMux_t; + + + +/******************************************************************************/ +/** + * @brief Enumeration type for setting/configuration of the DMA read switch + * (vi_dma_switch). + * + *****************************************************************************/ +typedef enum CamerIcDmaReadPath_e +{ + CAMERIC_DMA_READ_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_DMA_READ_SPMUX = 1, /**< data feeding in selfpath */ + CAMERIC_DMA_READ_SUPERIMPOSE = 2, /**< data feeding in superimpose module */ + CAMERIC_DMA_READ_IMAGE_EFFECTS = 3, /**< data feeding in image effects module */ + CAMERIC_DMA_READ_JPEG = 4, /**< data feeding in jpeg encoder */ + CAMERIC_DMA_READ_ISP = 5, /**< data feeding in isp */ + CAMERIC_DMA_READ_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcDmaReadPath_t; + + + +/******************************************************************************/ +/** + * @brief Enumeration type for setting/configuration of the input interface + * selector (if_select). + * + *****************************************************************************/ +typedef enum CamerIcInterfaceSelect_e +{ + CAMERIC_ITF_SELECT_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_ITF_SELECT_PARALLEL = 1, /**< selects the parallel interface */ + CAMERIC_ITF_SELECT_SMIA = 2, /**< selects the SMIA interface */ + CAMERIC_ITF_SELECT_MIPI = 3, /**< selects the MIPI interface */ + CAMERIC_ITF_SELECT_HDR = 4, /**< selects the HDR interface */ + CAMERIC_ITF_SELECT_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcInterfaceSelect_t; + + + +/******************************************************************************/ +/** + * @brief Enumeration of asynchronous command completion IDs + * (callback parameter). + * + * @note This is a list of all asynchronous command supported by CamerIC + * driver subsystem. + * + *****************************************************************************/ +typedef enum CamerIcCommandId_e +{ + CAMERIC_COMMAND_INVALID = 0x0000, /**< invalid command (only for an internal evaluation) */ + + /* CamerIc ISP module */ + CAMERIC_ISP_COMMAND_BASE = 0x0100, /**< CamerIc ISP Driver Base Command id */ + CAMERIC_ISP_COMMAND_CAPTURE_FRAMES = (CAMERIC_ISP_COMMAND_BASE + 0x0000), /**< frame capturing completed */ + CAMERIC_ISP_COMMAND_STOP_INPUT = (CAMERIC_ISP_COMMAND_BASE + 0x0001), /**< frame capturing completed */ + + /* CamerIc MI module */ + CAMERIC_MI_COMMAND_BASE = 0x0200, /**< CamerIc MI Driver Base Command id */ + CAMERIC_MI_COMMAND_DMA_TRANSFER = (CAMERIC_MI_COMMAND_BASE + 0x0000), /** by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +/** + * @file cameric_drv_common.h + * + * @brief This file contains all common definition which are used by the + * internal modules and the upper layer too. + * + *****************************************************************************/ +/** + * @defgroup cameric_drv_common CamerIC driver common API definitions + * @{ + */ +#ifndef __CAMERIC_DRV_COMMON_H__ +#define __CAMERIC_DRV_COMMON_H__ + +#ifdef __cplusplus +extern "C" +{ +#endif + + +#if 1 +/******************************************************************************/ +/** + * @brief A structure to represent a 3x3 matrix. + * + * The nine values are laid out as follows (zero based index): + * + * | 0 1 2 | \n + * | 3 4 5 | \n + * | 6 7 8 | \n + * + * @note The values are represented as float numbers. + * + *****************************************************************************/ +typedef struct CamerIc3x3FloatMatrix_s +{ + float fCoeff[9U]; /**< array of 3x3 float values */ +} CamerIc3x3FloatMatrix_t; +#endif + + + +/******************************************************************************/ +/** + * @brief A structure to represent a 5x5 matrix. + * + * The 25 values are laid out as follows (zero based index): + * + * | 00 01 02 03 04 | \n + * | 05 06 07 08 09 | \n + * | 10 11 12 13 14 | \n + * | 15 16 17 18 19 | \n + * | 20 21 22 23 24 | \n + * + * @note The 25 values are represented as float numbers. + * + *****************************************************************************/ +typedef struct CamerIc5x5FloatMatrix_s +{ + float fCoeff[25U]; /**< array of 5x5 float values */ +} CamerIc5x5FloatMatrix_t; + + + +/******************************************************************************/ +/** + * @brief A structure to represent a 3x3 matrix. + * + * The nine values are laid out as follows (zero based index): + * + * | 0 1 2 | \n + * | 3 4 5 | \n + * | 6 7 8 | \n + * + * @note The values are represented as fix point numbers. + * + *****************************************************************************/ +typedef struct CamerIc3x3Matrix_s +{ + uint32_t Coeff[9U]; /**< array of 3x3 float values */ +} CamerIc3x3Matrix_t; + + + +/******************************************************************************* + ** + * @brief A structure/tupple to represent gain values for four (R,Gr,Gb,B) + * channels. + * + * @note The gain values are represented as fix point numbers. + * + *****************************************************************************/ +typedef struct CamerIcGains_s +{ + uint16_t Red; /**< gain value for the red channel */ + uint16_t GreenR; /**< gain value for the green-red channel */ + uint16_t GreenB; /**< gain value for the green-blue channel */ + uint16_t Blue; /**< gain value for the blue channel */ +} CamerIcGains_t; + + + +/******************************************************************************/ +/** + * @brief A structure/tupple to represent offset values for three (R,G,B) + * channels. + * + * @note The offset values are represented as 2's complement integer. + * Number ranging from -2048 (0x800) to 2047 (0x7FF). + * 0 is represented as 0x000. + * + *****************************************************************************/ +typedef struct CamerIcXTalkOffset_s +{ + uint16_t Red; /**< offset value for the red channel */ + uint16_t Green; /**< offset value for the green channel */ + uint16_t Blue; /**< offset value for the blue channel */ +} CamerIcXTalkOffset_t; + + + +/******************************************************************************/ +/** + * @brief A structure to represent a general purpose window. The window is + * spanned by a horizontal and vertical offset, counting from zero, + * the width and the height. + * + * @note The windows points are represented by 16-bit unsigned integer + * numbers. + * + *****************************************************************************/ +typedef struct CamerIcWindow_s +{ + uint16_t hOffset; + uint16_t vOffset; + uint16_t width; + uint16_t height; +} CamerIcWindow_t; + + + +/*****************************************************************************/ +/** + * @brief This function initialize/configures a general purpose window. + * + * @param pWnd pointer to a window to initialize + * @param hOffset horizontal offset (starting at zero) + * @param vOffset vertical offset (starting at zero) + * @param height window height + * @param width window width + * + *****************************************************************************/ +static inline void SetCamerIcWindow +( + CamerIcWindow_t *pWnd, + const uint16_t hOffset, + const uint16_t vOffset, + const uint16_t height, + const uint16_t width +) +{ + if ( pWnd != NULL ) + { + pWnd->hOffset = hOffset; + pWnd->vOffset = vOffset; + pWnd->height = height; + pWnd->width = width; + } +} + + + +#ifdef __cplusplus +} +#endif + +/* @} cameric_drv_common */ + +#endif /* __CAMERIC_DRV_COMMON_H__ */ + diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_ie_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_ie_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..ceff56e481c17ae062e3cae43b56dd4f67e08b00 --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_ie_drv_api.h @@ -0,0 +1,294 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +#ifndef __CAMERIC_IE_DRV_API_H__ +#define __CAMERIC_IE_DRV_API_H__ + +/** + * @cond cameric_ie + * + * @file cameric_ie_drv_api.h + * + * @brief This file contains the CamerIC IE driver API definitions. + * + *****************************************************************************/ +/** + * @defgroup cameric_ie_drv_api CamerIC IE Driver API definitions + * @{ + * + * The Image Effects block modifies an image by pixel modifications. A set of + * different modifications can be applied: + * + * @arg grayscale-effect: In this mode only the luminance component of the image + * is processed. The chrominance part is set to 128. + * + * @arg negative-effect: This effect inverts the luminance and chrominance part of a + * picture. The values are inverted according to the BT.601 pixel value range + * (16...235 for luminance and 16...240 for chrominance). + * + * @arg sepia-effect: In sepia mode the two chrominance components are processed. + * The chrominance should be modified in the appropriate brown hue to create a + * historical like image color. The new chrominance parts of resulting pixels + * are calculated according to the programmed tint color value (IMG_EFF_TINT) + * and the luminance part of the original pixel. The Y component is passed through. + * + * @arg color selection-effect: Converting picture to grayscale while maintaining + * one color component above a configurable threshold value (0...255). + * + * The following effects are realized with a programmable 3x3 Laplace filter + * which uses a two line buffers. The kernel for filtering (see Table 2) is + * programmable and for the following two effects (emboss and sketch) the + * configuration registers are separately available with their default + * values (IMG_EFF_MAT_1 to IMG_EFF_MAT_5). + * + * Programmable Laplace Filter Kernel: + * + * 1.1 | 1.2 | 1.3 \n + * ----+-----+---- \n + * 2.1 | 2.2 | 2.3 \n + * ----+-----+---- \n + * 3.1 | 3.2 | 3.3 \n + * + * @arg emboss-effect: The emboss effect is created by the result of a 3x3 + * Laplace Filter with the luminance components. For emboss picture appearing + * an offset 128 is added to the result. The chrominance components are not + * processed and are set to 128. + * + * @arg sketch effect: The sketch mode is also a result of the 3x3 Laplace + * Filter with an extracting of the edges in whitely background. A fixed + * threshold value of 31 is defined. All luminance values smaller 31 are + * set to 235 to visualize the whitely background. Other luminance values + * are subtracted from 235 to visualize the edges in picture. The chrominance + * components are not processed and are set to 128. + * + * @arg The sharpen effect is applied to the Y component only. The Cb and Cr + * components are not modified by this effect. The sharpen function shall be + * realized as a coring filter which consists of a highpass filter and a + * threshold function for the highpass signal. The output signal is the sum + * of highpass and original signal as shown in Figure 2. The coefficients + * for the highpass filter are shown in Table 3. The factor (sharp_factor) + * for the highpass signal shall be programmable through a register in the + * range 0.1 to 1.5. The threshold (coring_thr) for the coring function shall + * have a range between 0 and 255. The registers for the convolution mask of + * the highpass filter shall be shared between sketch and sharpening effect. + * + * In addition a sharpening function shall be implemented, which enhances the + * perceived sharpness of images by applying a kind of coring function to the + * Y component of the image. + * + * The Image Effects module gets YCbCr 4:2:2 data via a 16 bit ([15:8]: Y, + * [7:0]: Cb/Cr) data interface from the Color Processing Module. An image + * can be modified in eight different effect modes (see chapter 1.1). + * + * The YCbCr 4:2:2 output picture is sent to the Superimpose Module via a 16 + * bit data interface. + * + * @if CAMERIC_LITE + * + * @image html ie_lite.png "Overview of the CamerIC IE driver" width=\textwidth + * @image latex ie_lite.png "Overview of the CamerIC IE driver" width=\textwidth + * + * @endif + * + * @if CAMERIC_FULL + * + * @image html ie.png "Overview of the CamerIC IE driver" width=\textwidth + * @image latex ie.png "Overview of the CamerIC IE driver" width=\textwidth + * + * @endif + * + */ +#include +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +/*****************************************************************************/ +/** + * @brief This function enables the IE Module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIeEnable +( + CamerIcDrvHandle_t handle +); + +/*****************************************************************************/ +/** + * @brief This function disables the IE module (bypass the image effects + * module). + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIeDisable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This function returns the status of the IE module. + * + * @param handle CamerIc driver handle + * @param pIsEnabled Pointer to value to store current state + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_NULL_POINTER pIsEnabled is a NULL pointer + * + *****************************************************************************/ +extern RESULT CamerIcIeIsEnabled +( + CamerIcDrvHandle_t handle, + bool_t *pIsEnabled +); + + + +/*****************************************************************************/ +/** + * @brief This function configures the IE module + * + * @param handle CamerIC driver handle + * @param pConfig pointer to image effects configuration structure + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_NOTSUPP selected working mode is not supported + * @retval RET_NULL_POINTER null pointer + * @retval RET_BUSY image effects already enabled + * + *****************************************************************************/ +extern RESULT CamerIcIeConfigure +( + CamerIcDrvHandle_t handle, + CamerIcIeConfig_t *pConfig +); + + +/*****************************************************************************/ +/** + * @brief This function sets the Cb tint value in CamerIC IE module. + * + * @param handle CamerIc driver handle + * @param tint tint value to set + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_OUTOFRANGE given brightness value is out of range + * + *****************************************************************************/ +extern RESULT CamerIcIeSetTintCb +( + CamerIcDrvHandle_t handle, + const uint8_t tint +); + + +/*****************************************************************************/ +/** + * @brief This function sets the Cr tint value in CamerIC IE module. + * + * @param handle CamerIc driver handle + * @param tint tint value to set + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_OUTOFRANGE given brightness value is out of range + * + *****************************************************************************/ +extern RESULT CamerIcIeSetTintCr +( + CamerIcDrvHandle_t handle, + const uint8_t tint +); + + +/*****************************************************************************/ +/** + * @brief This function sets color selection in CamerIC IE module. + * + * @param handle CamerIc driver handle + * @param color selected color + * @param threshold threshold + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_OUTOFRANGE given brightness value is out of range + * + *****************************************************************************/ +extern RESULT CamerIcIeSetColorSelection +( + CamerIcDrvHandle_t handle, + const CamerIcIeColorSelection_t color, + const uint8_t threshold +); + + +/*****************************************************************************/ +/** + * @brief This function sets sharpening in CamerIC IE module. + * + * @param handle CamerIc driver handle + * @param factor sharpening factor color + * @param threshold threshold + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_OUTOFRANGE given brightness value is out of range + * + *****************************************************************************/ +extern RESULT CamerIcIeSetSharpen +( + CamerIcDrvHandle_t handle, + const uint8_t factor, + const uint8_t threshold +); + + +#ifdef __cplusplus +} +#endif + +/* @} cameric_ie_drv_api */ + +/* @endcond */ + +#endif /* __CAMERIC_IE_DRV_API_H__ */ + diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_isp_2dnr_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_isp_2dnr_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..9e8e4ae13086b927e1e660dc431a132797659f6a --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_isp_2dnr_drv_api.h @@ -0,0 +1,117 @@ +/****************************************************************************** +* +* Copyright 2010, Dream Chip Technologies GmbH. All rights reserved. +* No part of this work may be reproduced, modified, distributed, transmitted, +* transcribed, or translated into any language or computer format, in any form +* or by any means without written permission of: +* Dream Chip Technologies GmbH, Steinriede 10, 30827 Garbsen / Berenbostel, +* Germany +* +*****************************************************************************/ +#ifndef __CAMERIC_ISP_2DNR_DRV_API_H__ +#define __CAMERIC_ISP_2DNR_DRV_API_H__ + +/** +* @file cameric_isp_2dnr_drv_api.h +* +* @brief This file contains the CamerIC ISP 2DNR driver API definitions. +* +*****************************************************************************/ +/** +* @cond cameric_isp_2dnr +* +* @defgroup cameric_isp_2dnr_drv_api CamerIC ISP 2DNR Driver API definitions +* @{ +* +*/ +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +#define ISP_2DNR_SIGMA_BIN 60 +typedef struct CamerIcIsp2DnrConfig_s { + bool enable; + float sigma; /**< sigma */ + uint8_t strength; /**< strength */ + uint8_t pregmaStrength; /**< pregmaStrength */ + uint16_t coeff[ISP_2DNR_SIGMA_BIN]; /**< denoise sigma Y */ +//#ifdef ISP_2DNR_V4 + + uint16_t strengthOffset, strengthMax; + uint8_t strengthSlope; +//#endif +} CamerIcIsp2DnrConfig_t; + +/*****************************************************************************/ +/** +* CamerIcIsp2DnrEnable() +* +* @brief Enable 2DNR Module +* +* @param handle CamerIc driver handle +* +* @return Return the result of the function call. +* @retval RET_SUCCESS +* @retval RET_FAILURE +* +*****************************************************************************/ +RESULT CamerIcIsp2DnrEnable +( + CamerIcDrvHandle_t handle +); + +/*****************************************************************************/ +/** +* CamerIcIsp2DnrDisable() +* +* @brief Disable 2DNR Module +* +* @param handle CamerIc driver handle +* +* @return Return the result of the function call. +* @retval RET_SUCCESS +* @retval RET_FAILURE +* +*****************************************************************************/ +RESULT CamerIcIsp2DnrDisable +( + CamerIcDrvHandle_t handle +); + + +/*****************************************************************************/ +/** +* CamerIcIsp2DnrConfig() +* +* @brief Config 2DNR Module +* +* @param handle CamerIc driver handle +* +* @return Return the result of the function call. +* @retval RET_SUCCESS +* @retval RET_FAILURE +* +*****************************************************************************/ +RESULT CamerIcIsp2DnrConfig +( + CamerIcDrvHandle_t handle, + CamerIcIsp2DnrConfig_t *p2DnrCfg +); + + + +#ifdef __cplusplus +} +#endif + +/* @} cameric_isp_2dnr_drv_api */ + +/* @endcond */ + +#endif /* __CAMERIC_ISP_2DNR_DRV_API_H__ */ + + diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_isp_3dnr_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_isp_3dnr_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..280a193836d47189e65dd36865ca733d9547631f --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_isp_3dnr_drv_api.h @@ -0,0 +1,194 @@ +#ifndef __CAMERIC_ISP_3DNR_DRV_API_H__ +#define __CAMERIC_ISP_3DNR_DRV_API_H__ + +/** +* @file cameric_isp_3dnr_drv_api.h +* +* @brief This file contains the CamerIC ISP 3DNR driver API definitions. +* +*****************************************************************************/ +/** +* @cond cameric_isp_3dnr +* +* @defgroup cameric_isp_3dnr_drv_api CamerIC ISP 3DNR Driver API definitions +* @{ +* +*/ +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + + +typedef struct CamerIcIsp3DnrConfig_s { + uint8_t strength; /**< strength */ + uint16_t motionFactor; /**< motionFactor */ + uint16_t deltaFactor; /**< deltaFactor */ +} CamerIcIsp3DnrConfig_t; + +typedef struct CamericIsp3DNRCompress_s { + uint8_t weightUpY[2]; + uint8_t weightDown[4]; + uint8_t weightUpX[8]; + +} CamericIsp3DNRCompress_t; +/*****************************************************************************/ +/** +* CamerIcIsp3DnrEnable() +* +* @brief Enable 3DNR Module +* +* @param handle CamerIc driver handle +* +* @return Return the result of the function call. +* @retval RET_SUCCESS +* @retval RET_FAILURE +* +*****************************************************************************/ +RESULT CamerIcIsp3DnrEnable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** +* CamerIcIsp3DnrDisable() +* +* @brief Disable 3DNR Module +* +* @param handle CamerIc driver handle +* +* @return Return the result of the function call. +* @retval RET_SUCCESS +* @retval RET_FAILURE +* +*****************************************************************************/ +RESULT CamerIcIsp3DnrDisable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** +* CamerIcIsp3DnrConfig() +* +* @brief Config 3DNR Module +* +* @param handle CamerIc driver handle +* +* @return Return the result of the function call. +* @retval RET_SUCCESS +* @retval RET_FAILURE +* +*****************************************************************************/ +RESULT CamerIcIsp3DnrConfig +( + CamerIcDrvHandle_t handle, + CamerIcIsp3DnrConfig_t *p3DnrCfg +); + + + +/*****************************************************************************/ +/** +* CamerIcIsp3DnrCompute() +* +* @brief Compute 3DNR Module register use last average, last last average and gain +* +* @param handle CamerIc driver handle +* +* @return Return the result of the function call. +* @retval RET_SUCCESS +* @retval RET_FAILURE +* +*****************************************************************************/ +RESULT CamerIcIsp3DnrCompute +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** +* CamerIcIsp3DnrSetSensorExpGain() +* +* @brief Update 3DNR Module's last average and last average +* +* @param handle CamerIc driver handle +* +* @return Return the result of the function call. +* @retval RET_SUCCESS +* @retval RET_FAILURE +* +*****************************************************************************/ +RESULT CamerIcIsp3DnrSetSensorExpGain +( + CamerIcDrvHandle_t handle, + float expGain +); + +/*****************************************************************************/ +/** +* CamerIcIsp3DNRSetCompress() +* +* @brief config CamerIc ISP 3DNR driver compress parm for 3dnr ddr less +context +* +* @return Return the result of the function call. +* @retval RET_SUCCESS +* @retval RET_FAILURE +* +*****************************************************************************/ + +RESULT CamerIcIsp3DNRSetCompress( + CamerIcDrvHandle_t handle, + CamericIsp3DNRCompress_t *cmp +); + +/*****************************************************************************/ +/** +* CamerIcIsp3DnrSetStrength() +* +* @brief set 3DNR Module's denoiseStrength +* +* @param handle CamerIc driver handle +* +* @return Return the result of the function call. +* @retval RET_SUCCESS +* @retval RET_FAILURE +* +*****************************************************************************/ +RESULT CamerIcIsp3DnrSetStrength( + CamerIcDrvHandle_t handle, + unsigned int denoiseStrength +); + +RESULT CamerIcIsp3DnrSetMotionFactor( + CamerIcDrvHandle_t handle, + unsigned int motionFactor +); + +RESULT CamerIcIsp3DnrSetDeltaFactor( + CamerIcDrvHandle_t handle, + unsigned int deltaFactor +); + + +#ifdef __cplusplus +} +#endif + +/* @} cameric_isp_3dnr_drv_api */ + +/* @endcond */ + +#endif /* __CAMERIC_ISP_3DNR_DRV_API_H__ */ + diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_isp_afm_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_isp_afm_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..4031964f370e2adbc7af5b5d13f637b548b1d24b --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_isp_afm_drv_api.h @@ -0,0 +1,334 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +#ifndef __CAMERIC_ISP_AFM_DRV_API_H__ +#define __CAMERIC_ISP_AFM_DRV_API_H__ + +/** + * @file cameric_isp_afm_drv_api.h + * + * @brief This file defines the CamerIC driver API for the CamerIC ISP + * auto-focus measurement module (AFM). + * + *****************************************************************************/ +/** + * @page cameric_isp_afm_drv_api_page CamerIC ISP auto-focus measurement driver API + * + * @brief An auto-focus measurment block (ISP_AFM) is implemented to support + * auto focus control. A substantial part of auto focus control will be done + * in software: + * + * @arg The search algorithm wich looks for maximum sharpness in the image + * @arg and the movement of lens + * + * will be under software control. + * + * The CamerIC auto-foucs measurement module measures the image sharpness + * in 3 windows selectable in size. + * + * @note An overlapping of these 3 windows is not allowed. + * + * @defgroup cameric_isp_afm_drv_api CamerIc ISP AFM Driver API + * @{ + * + */ +#include +#include +#include + +#include +#include + + + +#ifdef __cplusplus +extern "C" +{ +#endif + + + +/******************************************************************************/ +/** + * @struct CamerIcAfmMeasuringResult_s + * + * @brief A structure to represent a complete set of measuring values. + * + *****************************************************************************/ +typedef struct CamerIcAfmMeasuringResult_s +{ + uint32_t SharpnessA; /**< sharpness of window A */ + uint32_t SharpnessB; /**< sharpness of window B */ + uint32_t SharpnessC; /**< sharpness of window C */ + + uint32_t LuminanceA; /**< luminance of window A */ + uint32_t LuminanceB; /**< luminance of window B */ + uint32_t LuminanceC; /**< luminance of window C */ + + uint32_t PixelCntA; + uint32_t PixelCntB; + uint32_t PixelCntC; +} CamerIcAfmMeasuringResult_t; + + + +/******************************************************************************/ +/** + * @enum CamerIcIspAfmWindowId_e + * + * @brief Enumeration type to identify the Autofocus measuring window. + * + *****************************************************************************/ +typedef enum CamerIcIspAfmWindowId_e +{ + CAMERIC_ISP_AFM_WINDOW_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_ISP_AFM_WINDOW_A = 1, /**< Window A (1st window) */ + CAMERIC_ISP_AFM_WINDOW_B = 2, /**< Window B (2nd window) */ + CAMERIC_ISP_AFM_WINDOW_C = 3, /**< Window C (3rd window) */ + CAMERIC_ISP_AFM_WINDOW_MAX, /**< upper border (only for an internal evaluation) */ +} CamerIcIspAfmWindowId_t; + + + +/*****************************************************************************/ +/** + * @brief This functions registers an Event-Callback at CamerIC ISP AFM + * Module. An event callback is called if the driver needs to + * inform the application layer about an asynchronous event or + * an error situation (i.e. please also @see CamerIcEventId_e). + * + * @param handle CamerIC driver handle + * @param func Callback function + * @param pUserContext User-Context + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_BUSY already a callback registered + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_INVALID_PARM a parameter is invalid + * @retval RET_WRONG_STATE driver is in wrong state to register a + * event callback (maybe the driver is already running) + * + *****************************************************************************/ +extern RESULT CamerIcIspAfmRegisterEventCb +( + CamerIcDrvHandle_t handle, + CamerIcEventFunc_t func, + void *pUserContext +); + + + +/*****************************************************************************/ +/** + * @brief This functions deregisters/releases a registered Event-Callback + * at CamerIc ISP AFM Module. + * + * @param handle CamerIC driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to deregister the + * request callback + * + *****************************************************************************/ +extern RESULT CamerIcIspAfmDeRegisterEventCb +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This functions enables the CamerIC ISP AFM module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspAfmEnable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This functions disables the CamerIC ISP AFM module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspAfmDisable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief Get CamerIC ISP AFM module status. + * + * @param handle CamerIc driver handle. + * @param pIsEnabled + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +extern RESULT CamerIcIspAfmIsEnabled +( + CamerIcDrvHandle_t handle, + bool_t *pIsEnabled +); + + + +/*****************************************************************************/ +/** + * @brief This functions sets the threshold in the CamerIC ISP AFM module. + * + * @param handle CamerIc driver handle + * @param threshold threshold value + * + * @note S(i,j) = Gx(i,j)^2 + Gy(i,j)^2 >= threshold + * + * @return Return the result of the function call. + * @retval RET_SUCCESS Configuration successfully applied + * @retval RET_OUTOFRANGE At least one perameter of out range + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspAfmSetThreshold +( + CamerIcDrvHandle_t handle, + const uint32_t threshold +); + + + +/*****************************************************************************/ +/** + * @brief This function sets the position and size of a a given measuring + * window in the CamerIC ISP AFM module. + * + * @param handle CamerIc driver handle + * @param WdwId window identifier (@see CamerIcIspAfmWindowId_e) + * @param x start x position of measuring window + * @param y start y position of measuring window + * @param width width of measuring window + * @param height height of measuring window + * + * + * @return Return the result of the function call. + * @retval RET_SUCCESS Configuration successfully applied + * @retval RET_INVALID_PARM invalid window identifier + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspAfmSetMeasuringWindow +( + CamerIcDrvHandle_t handle, + const CamerIcIspAfmWindowId_t WdwId, + const uint16_t x, + const uint16_t y, + const uint16_t width, + const uint16_t height +); + + + +/*****************************************************************************/ +/** + * @brief This function enables the sharpness measuring of a given + * measuring window in the CmaerIC ISP AFM module. + * + * @param handle CamerIc driver handle + * @param WdwId window identifier (@see CamerIcIspAfmWindowId_e) + * + * @return Return the result of the function call. + * @retval RET_SUCCESS Configuration successfully applied + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspAfmEnableMeasuringWindow +( + CamerIcDrvHandle_t handle, + const CamerIcIspAfmWindowId_t WdwId +); + + + +/*****************************************************************************/ +/** + * @brief This function return BOOL_TRUE if the sharpness measuring of a + * given measuring window in the CmaerIC ISP AFM module enabled. + * + * @return Return the result of the function call. + * @retval RET_SUCCESS Configuration successfully applied + * @retval RET_OUTOFRANGE At least one perameter of out range + * + *****************************************************************************/ +extern bool_t CamerIcIspAfmMeasuringWindowIsEnabled +( + CamerIcDrvHandle_t handle, + const CamerIcIspAfmWindowId_t WdwId +); + + + +/*****************************************************************************/ +/** + * @brief This function disables the sharpness measuring of a given + * measuring window in the CmaerIC ISP AFM module. + * + * @param handle CamerIc driver handle + * @param WdwId window identifier (@see CamerIcIspAfmWindowId_e) + * + * @return Return the result of the function call. + * @retval RET_SUCCESS Configuration successfully applied + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspAfmDisableMeasuringWindow +( + CamerIcDrvHandle_t handle, + const CamerIcIspAfmWindowId_t WdwId +); + + + +#ifdef __cplusplus +} +#endif + +/* @} cameric_isp_afm_drv_api */ + +#endif /* __CAMERIC_ISP_AFM_DRV_API_H__ */ + diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_isp_awb_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_isp_awb_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..098f4ef8fb0846ec6d01e17ca4bd1fcf326b9853 --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_isp_awb_drv_api.h @@ -0,0 +1,352 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +#ifndef __CAMERIC_ISP_AWB_DRV_API_H__ +#define __CAMERIC_ISP_AWB_DRV_API_H__ + +/** + * @cond cameric_isp_awb + * + * @file cameric_isp_awb_drv_api.h + * + * @brief This file contains the CamerIC ISP AWB driver API definitions. + * + *****************************************************************************/ +/** + * @defgroup cameric_isp_awb_drv_api CamerIC ISP AWB driver API definitions + * @{ + * + * The AWB module is able to measure the occurrence of near-white pixels + * in an image processed by the MARVIN. To be able to measure the desired + * pixels the AWB module supports to configure the measurement window. + * + * Further on the component gains could be adjusted to control the white point. + * The Automatic White Balancing driver serves as an abstraction layer, so the + * application does not need to know which bit has to be set where in the + * registers of the AWB module. + * + * The mean value measurement is done by hardware and the gain update has to + * be done by software of the host processor. + * + * The following figure shows the position of the AWB module in the CamerIC ISP + * pipeline. + * + * @image html awb.png "Overview of the CamerIC ISP AWB driver" width=\textwidth + * @image latex awb.png "Overview of the CamerIC ISP AWB driver" width=\textwidth + * + */ + +#include +#include +#include "isi/isi.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + + +/*****************************************************************************/ +/** + * @brief Enumeration type to configure CamerIC ISP measuring mode + * + *****************************************************************************/ +typedef enum CamerIcIspAwbMeasuringMode_e +{ + CAMERIC_ISP_AWB_MEASURING_MODE_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_ISP_AWB_MEASURING_MODE_YCBCR = 1, /**< near white discrimination mode using YCbCr color space */ + CAMERIC_ISP_AWB_MEASURING_MODE_RGB = 2, /**< RGB based measurement mode */ + CAMERIC_ISP_AWB_MEASURING_MODE_MAX, /**< upper border (only for an internal evaluation) */ +} CamerIcIspAwbMeasuringMode_t; + + + +/******************************************************************************/ +/** + * @brief CamerIC AWB measurement configuration + * + ******************************************************************************/ +typedef struct CamerIcAwbMeasuringConfig_s +{ + uint8_t MaxY; /**< YCbCr Mode: only pixels values Y <= ucMaxY contribute to WB measurement (set to 0 to disable this feature) */ + /**< RGB Mode : unused */ + uint8_t RefCr_MaxR; /**< YCbCr Mode: Cr reference value */ + /**< RGB Mode : only pixels values R < MaxR contribute to WB measurement */ + uint8_t MinY_MaxG; /**< YCbCr Mode: only pixels values Y >= ucMinY contribute to WB measurement */ + /**< RGB Mode : only pixels values G < MaxG contribute to WB measurement */ + uint8_t RefCb_MaxB; /**< YCbCr Mode: Cb reference value */ + /**< RGB Mode : only pixels values B < MaxB contribute to WB measurement */ + uint8_t MaxCSum; /**< YCbCr Mode: chrominance sum maximum value, only consider pixels with Cb+Cr smaller than threshold for WB measurements */ + /**< RGB Mode : unused */ + uint8_t MinC; /**< YCbCr Mode: chrominance minimum value, only consider pixels with Cb/Cr each greater than threshold value for WB measurements */ + /**< RGB Mode : unused */ +} CamerIcAwbMeasuringConfig_t; + + + +/******************************************************************************/ +/** + * @brief CamerIc AWB Module measurement values + * + ******************************************************************************/ +typedef struct CamerIcAwbMeasuringResult_s +{ +#ifdef ISP_USE_AWBV2 + uint8_t AwbV2Data[4096]; /**< Y/G value in YCbCr/RGB Mode */ +#else + uint32_t NoWhitePixel; /**< number of white pixel */ + uint8_t MeanY__G; /**< Y/G value in YCbCr/RGB Mode */ + uint8_t MeanCb__B; /**< Cb/B value in YCbCr/RGB Mode */ + uint8_t MeanCr__R; /**< Cr/R value in YCbCr/RGB Mode */ +#endif +} CamerIcAwbMeasuringResult_t; + + + +/*****************************************************************************/ +/** + * @brief This function registers an event callback at CamerIc ISP AWB + * driver module. + * + * @param handle CamerIc driver handle + * @param func Callback function + * @param pUserContext User-Context + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +extern RESULT CamerIcIspAwbRegisterEventCb +( + CamerIcDrvHandle_t handle, + CamerIcEventFunc_t func, + void *pUserContext +); + + + +/*****************************************************************************/ +/** + * @brief This function deregisters/clears a registered event callback + * at CamerIc ISP AWB driver module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +extern RESULT CamerIcIspAwbDeRegisterEventCb +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This function enables the CamerIc ISP AWB measuring module. + * + * @return Return the result of the function call. + * @retval RET_SUCCESS ISP AWB module successfully enabled + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspAwbEnable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This function disables the CamerIc ISP AWB measuring module + * (bypassing of the white balance measuring module). + * + * @return Return the result of the function call. + * @retval RET_SUCCESS ISP AWB module successfully disabled + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspAwbDisable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief Get CamerIc ISP AWB measuring module status. + * + * @param handle CamerIc driver handle. + * @param pIsEnabled + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +extern RESULT CamerIcIspAwbIsEnabled +( + CamerIcDrvHandle_t handle, + bool_t *pIsEnabled +); + + + +/*****************************************************************************/ +/** + * @brief This function configures the measuring mode + * + * @param handle CamerIc driver handle + * @param mode measuring mode + * @param pMeasConfig Configuration of the measuring trapezoid + * + * @return Return the result of the function call. + * @retval RET_SUCCESS Configuration successfully applied + * @retval RET_OUTOFRANGE At least one perameter of out range + * + *****************************************************************************/ +extern RESULT CamerIcIspAwbSetMeasuringMode +( + CamerIcDrvHandle_t handle, + const CamerIcIspAwbMeasuringMode_t mode, + const CamerIcAwbMeasuringConfig_t *pMeasConfig +); + + + +/*****************************************************************************/ +/** + * @brief This function configures the CamerIC ISP AWB measuring window. + * + * @param handle CamerIc driver handle + * @param x start x position of measuring window + * @param y start y position of measuring window + * @param width width of measuring window + * @param height height of measuring window + * + * @return Return the result of the function call. + * @retval RET_SUCCESS Configuration successfully applied + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_OUTOFRANGE At least one perameter of out range + * + *****************************************************************************/ +extern RESULT CamerIcIspAwbSetMeasuringWindow +( + CamerIcDrvHandle_t handle, + const uint16_t x, + const uint16_t y, + const uint16_t width, + const uint16_t height +); + + +/*****************************************************************************/ +/** + * @brief This functions reads out the currently configured white balance + * gains. + * + * @param handle CamerIc driver handle + * @param pGains Pointer to store the white balance gains + * (@ref CamerIcGains_t) + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to read WB gains + * from CamerIC (maybe driver not initialized) + * @retval RET_INVALID_PARM invalid parameter + * + *****************************************************************************/ +extern RESULT CamerIcIspAwbGetGains +( + CamerIcDrvHandle_t handle, + CamerIcGains_t *pGains +); + + + +/*****************************************************************************/ +/** + * @brief This functions sets the white balance gains. + * + * @param handle CamerIc driver handle + * @param pGains Pointer to white balance gains to set + * (@ref CamerIcGains_t) + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to read WB gains + * from CamerIC (maybe driver not initialized) + * + *****************************************************************************/ +extern RESULT CamerIcIspAwbSetGains +( + CamerIcDrvHandle_t handle, + const CamerIcGains_t *pGains +); + + +/*****************************************************************************/ +/** + * @brief This functions sets the white balance gains to sensor. + * + * @param handle CamerIc Sensor driver handle + * @param pGains Pointer to white balance gains to set + * (@ref CamerIcGains_t) + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to read WB gains + * from CamerIC (maybe driver not initialized) + * + *****************************************************************************/ +extern RESULT CamerIcSensorAwbSetGains +( + IsiSensorHandle_t handle, + const CamerIcGains_t *pGains +); + +RESULT CamerIcSensorAwbInit +( + CamerIcDrvHandle_t handle, + IsiSensorHandle_t hSensor +); + +void CamerIcIspAwbV2Signal +( + CamerIcDrvHandle_t handle +); +#ifdef __cplusplus +} +#endif + +/* @} cameric_isp_awb_drv_api */ + +/* @endcond */ + +#endif /* __CAMERIC_ISP_AWB_DRV_API_H__ */ + diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_isp_bls_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_isp_bls_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..21f6afdb3eee25ecd7c75fac6fdd9f08c6778dbd --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_isp_bls_drv_api.h @@ -0,0 +1,322 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +#ifndef __CAMERIC_ISP_BLS_DRV_API_H__ +#define __CAMERIC_ISP_BLS_DRV_API_H__ + +/** + * @cond cameric_isp_bls + * + * @file cameric_isp_bls_drv_api.h + * + * @brief This file contains the CamerIC ISP BLS driver API definitions. + * + *****************************************************************************/ +/** + * @defgroup cameric_isp_bls_drv_api CamerIC ISP BLS driver API definitions + * @{ + * + * The BLS (black level substraction) module is able to correct the image sensor + * values via subtracting or adding an offset to the values. To be able to + * calculate the correct settings the BLS module supports up to two measurement + * windows. The Black Level Subtraction driver serves as an abstraction layer, + * so the application does not need to know which bit has to be set where in the + * registers of the BLS module. + * + * @image html bls.png "Overview of the CamerIC ISP BLS driver" width=\textwidth + * @image latex bls.png "Overview of the CamerIC ISP BLS driver" width=\textwidth + * + * There are two main use cases for the BLS module (@ref CamerIcIspBlsMode_e): + * + * @arg Automatic mode of the BLS module. Here the mean measured values + * of the BLS module are used as subtraction values for the image sensor + * data. The disadvantage is here that the digitized values are manipulated. + * + * @arg Manual mode of the BLS module. In the case the ISI sensor driver + * supports to do the black level subtraction before the values are + * digitized the noise of the image sensor data will be reduced also. + * Then the BLS module could be used only for measurements and the mean + * measured values are given to the ISI driver to calculate appropriate + * settings inside the image sensor. + * + */ +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + + + +/******************************************************************************/ +/** + * @brief Enumeration type to configure ISP BLS module substraction mode. + * + *****************************************************************************/ +typedef enum CamerIcIspBlsMode_e +{ + CAMERIC_ISP_BLS_MODE_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_ISP_BLS_MODE_USE_FIX_VALUES = 1, /**< substract fix values */ + CAMERIC_ISP_BLS_MODE_USE_MEASURED_VALUES = 2, /**< substract measured values */ + CAMERIC_ISP_BLS_MODE_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcIspBlsMode_t; + + + +/******************************************************************************/ +/** + * @brief Enumeration type to identify the ISP BLS measuring window. + * + *****************************************************************************/ +typedef enum CamerIcIspBlsWindowId_e +{ + CAMERIC_ISP_BLS_WINDOW_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_ISP_BLS_WINDOW_1 = 1, /**< Window 1 (1st window) */ + CAMERIC_ISP_BLS_WINDOW_2 = 2, /**< Window 2 (2nd window) */ + CAMERIC_ISP_BLS_WINDOW_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcIspBlsWindowId_t; + + + +/*****************************************************************************/ +/** + * @brief This function enables the ISP BLS module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspBlsEnable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This function disables the ISP BLS module (bypass the black level + * processing). + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspBlsDisable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This function + * + * @param handle CamerIc driver handle + * @param pIsEnabled Pointer to value to store current state + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_NULL_POINTER pIsEnabled is NULL pointer + * + *****************************************************************************/ +extern RESULT CamerIcIspBlsIsEnabled +( + CamerIcDrvHandle_t handle, + bool_t *pIsEnabled +); + + + +/*****************************************************************************/ +/** + * @brief This function sets the substraction mode of the ISP BLS module. + * + * @param handle CamerIc driver handle + * @param submode Substraction mode to configure (@ref + * CamerIcIspBlsMode_e). + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_OUTOFRANGE given substraction mode not valid + * + *****************************************************************************/ +extern RESULT CamerIcIspBlsSetSubstractionMode +( + CamerIcDrvHandle_t handle, + const CamerIcIspBlsMode_t submode +); + + + +/*****************************************************************************/ +/** + * @brief This function sets the fixed black level substraction values + * for the color channels. + * + * @note The assignment of the values for A, B, C and D to R, G, G and B + * pattern depends on the position and offset of the input acquisition + * window. + * + * The position [0,0] is always assigned to A, correlatively [0,1] + * is assigned to B, [1,0] to C and [1,1] to D. + * + * @param handle CamerIc driver handle + * @param A black-level substraction value A + * @param B black-level substraction value B + * @param C black-level substraction value C + * @param D black-level substraction value D + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_CONFIG a bayer-pattern was not configured + * @retval RET_OUTOFRANGE substraction value is to large + * + *****************************************************************************/ +extern RESULT CamerIcIspBlsSetBlackLevel +( + CamerIcDrvHandle_t handle, + const uint16_t A, + const uint16_t B, + const uint16_t C, + const uint16_t D +); + + + +/*****************************************************************************/ +/** + * @brief This function reads out the current configured fixed black level + * substraction values. + * + * @note The assignment of the values for A, B, C and D to R, G, G and B + * pattern depends on the position and offset of the input acquisition + * window. + * + * The position [0,0] is always assigned to A, correlatively [0,1] + * is assigned to B, [1,0] to C and [1,1] to D. + * + * @param handle CamerIc driver handle + * @param A pointer to store the black-level substraction value A + * @param B pointer to store the black-level substraction value B + * @param C pointer to store the black-level substraction value C + * @param D pointer to store the black-level substraction value D + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_INVALID_PARM invalid parameter + * + *****************************************************************************/ +extern RESULT CamerIcIspBlsGetBlackLevel +( + CamerIcDrvHandle_t handle, + uint16_t *A, + uint16_t *B, + uint16_t *C, + uint16_t *D +); + + + +/*****************************************************************************/ +/** + * @brief This function sets the position and size of a the black-level + * measurement window in the CamerIC ISP BLS module. + * + * @param handle CamerIc driver handle + * @param WdwId window identifier (@ref CamerIcIspBlsWindowId_e) + * @param x start x position of measuring window + * @param y start y position of measuring window + * @param width width of measuring window + * @param height height of measuring window + * + * + * @return Return the result of the function call. + * @retval RET_SUCCESS Configuration successfully applied + * @retval RET_INVALID_PARM invalid window identifier + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspBlsSetMeasuringWindow +( + CamerIcDrvHandle_t handle, + CamerIcIspBlsWindowId_t WdwId, + const uint16_t x, + const uint16_t y, + const uint16_t width, + const uint16_t height +); + + + +/*****************************************************************************/ +/** + * @brief This function reads out the current measured black level + * substraction values. + * + * @note The assignment of the values for A, B, C and D to R, G, G and B + * pattern depends on the position and offset of the input acquisition + * window. + * + * The position [0,0] is always assigned to A, correlatively [0,1] + * is assigned to B, [1,0] to C and [1,1] to D. + * + * @param handle CamerIc driver handle + * @param A pointer to store the black-level substraction value A + * @param B pointer to store the black-level substraction value B + * @param C pointer to store the black-level substraction value C + * @param D pointer to store the black-level substraction value D + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_INVALID_PARM invalid parameter + * + *****************************************************************************/ +extern RESULT CamerIcIspBlsGetMeasuredBlackLevel +( + CamerIcDrvHandle_t handle, + uint16_t *A, + uint16_t *B, + uint16_t *C, + uint16_t *D +); + + + +#ifdef __cplusplus +} +#endif + +/* @} cameric_isp_bls_drv_api */ + +/* @endcond */ + +#endif /* __CAMERIC_ISP_BLS_DRV_API_H__ */ + diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_isp_cac_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_isp_cac_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..8d6696b4142955693bd6f13c46fd7d1b2c86365d --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_isp_cac_drv_api.h @@ -0,0 +1,280 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +#ifndef __CAMERIC_ISP_CAC_DRV_API_H__ +#define __CAMERIC_ISP_CAC_DRV_API_H__ + +/** + * @cond cameric_isp_cac + * + * @file cameric_isp_cac_drv_api.h + * + * @brief This file contains the CamerIC ISP CAC driver API definitions. + * + *****************************************************************************/ +/** + * @defgroup cameric_isp_cac_drv_api CamerIC ISP CAC Driver API definitions + * @{ + * + * This hardware module corrects the chromatic aberration of the lens system by + * shifting the pixels of the incoming image. The direction and the width of the + * shift is derived from a polynomial model. The polynomial coefficients of the + * model, appropriate for the used lens system, can be programmed, as well as + * the optical center of the lens system. + * + * The following figure shows the position of the chromatic aberration + * correction module in the CamerIC ISP pipeline. + * + * @image html cac.png "Overview of the CamerIC ISP CAC driver" width=\textwidth + * @image latex cac.png "Overview of the CamerIC ISP CAC driver" width=\textwidth + * + * The initialization is static, thus parameters usually do not change afterwards + * during runtime. In this case, however, nearly all parameters do change if the + * resolution is changed. Thus the potential use case is a call to set all parameters + * during initialization or resolution change and a call to enable/disable the CAC. + * + * The polynomial coefficients in registers ISP_CAC_A, ISP_CAC_B and ISP_CAC_C + * need to be set according to the chromatic aberration which is observed for + * the used lens system. The observed aberration in an image is normally stronger + * at the corners of an image as in the middle. In general the strength of the + * aberration is dependent on the distance from the optical image center. + * + * Therefore the polynomial is defined as a function of the radius from optical image center: + * + * B_s (r) = A_blue * r + B_blue * r^2 + C_blue * r^3 \n + * R_s (r) = A_red * r + B_red * r^2 + C_red * r^3 \n + * + */ +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + + + +/******************************************************************************/ +/** + * @brief Enumeration type to configure the horizontal clip mode + * + * @note Defines the maximum red/blue pixel shift in horizontal direction + * At pixel positions, that require a larger displacement, the maximum + * shift value is used instead (vector clipping) + * + *****************************************************************************/ +typedef enum CamerIcIspCacHorizontalClipMode_e +{ + CAMERIC_CAC_H_CLIPMODE_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_CAC_H_CLIPMODE_FIX4 = 1, /**< horizontal vector clipping +/-4 pixel displacement (default) */ + CAMERIC_CAC_H_CLIPMODE_DYN5 = 2, /**< horizontal vector clipping to +/-4 or +/-5 pixel displacement + depending on pixel position inside the bayer raster (dynamic + switching between +/-4 and +/-5) */ + CAMERIC_CAC_H_CLIPMODE_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcIspCacHorizontalClipMode_t; + + + +/******************************************************************************/ +/** + * @brief Enumeration type to configure the vertical clip mode + * + * @note Defines the maximum red/blue pixel shift in vertical direction + * + *****************************************************************************/ +typedef enum CamerIcIspCacVerticalClipMode_e +{ + CAMERIC_CAC_V_CLIPMODE_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_CAC_V_CLIPMODE_FIX2 = 1, /**< vertical vector clipping to +/-2 pixel */ + CAMERIC_CAC_V_CLIPMODE_FIX3 = 2, /**< vertical vector clipping to +/-3 pixel */ + CAMERIC_CAC_V_CLIBMODE_DYN4 = 3, /**< vertical vector clipping +/-3 or +/-4 pixel displacement + depending on pixel position inside the bayer raster (dynamic + switching between +/-3 and +/-4) */ + CAMERIC_CAC_V_CLIPMODE_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcIspCacVerticalClipMode_t; + + + +/******************************************************************************/ +/** + * @brief CamerIC CAC configuration + * + *****************************************************************************/ +typedef struct CamerIcIspCacConfig_s +{ + uint16_t width; /**< width of the input image in pixel */ + uint16_t height; /**< height of the input image in pixel */ + + int16_t hCenterOffset; /**< horizontal offset between image center and optical center of the input image in pixels */ + int16_t vCenterOffset; /**< vertical offset between image center and optical center of the input image in pixels */ + + CamerIcIspCacHorizontalClipMode_t hClipMode; /**< maximum red/blue pixel shift in horizontal direction */ + CamerIcIspCacVerticalClipMode_t vClipMode; /**< maximum red/blue pixel shift in vertical direction */ + + uint16_t aBlue; /**< parameters for radial shift calculation 9 bit twos complement with 4 fractional digits, valid range -16..15.9375 */ + uint16_t aRed; /**< parameters for radial shift calculation 9 bit twos complement with 4 fractional digits, valid range -16..15.9375 */ + + uint16_t bBlue; /**< parameters for radial shift calculation 9 bit twos complement with 4 fractional digits, valid range -16..15.9375 */ + uint16_t bRed; /**< parameters for radial shift calculation 9 bit twos complement with 4 fractional digits, valid range -16..15.9375 */ + + uint16_t cBlue; /**< parameters for radial shift calculation 9 bit twos complement with 4 fractional digits, valid range -16..15.9375 */ + uint16_t cRed; /**< parameters for radial shift calculation 9 bit twos complement with 4 fractional digits, valid range -16..15.9375 */ + + uint8_t Xns; /**< horizontal normal shift parameter */ + uint8_t Xnf; /**< horizontal scaling factor */ + + uint8_t Yns; /**< vertical normal shift parameter */ + uint8_t Ynf; /**< vertical scaling factor */ + float fAspectRatio; +} CamerIcIspCacConfig_t; + + + +/*****************************************************************************/ +/** + * @brief This function configures the CAC module. + * + * @param handle CamerIc driver handle + * @param pConfig Configuration of the CAC module (@ref + * CamerIcIspCacConfig_t) + * + * @return Return the result of the function call. + * @retval RET_SUCCESS Configuration successfully applied + * @retval RET_OUTOFRANGE At least one perameter of out range + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +RESULT CamerIcIspCacConfig +( + CamerIcDrvHandle_t handle, + CamerIcIspCacConfig_t *pConfig +); + + +/*****************************************************************************/ +/** + * @brief This function reads out the current configred chromatic aberration + * correction configuration. + * + * @param handle CamerIc driver handle + * @param pConfig Pointer to store the current configuration + * (@ref CamerIcIspCacConfig_t) + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_NULL_POINTER pLscConfig is a NULL pointer + * + *****************************************************************************/ +RESULT CamerIcIspCacGetConfig +( + CamerIcDrvHandle_t handle, + CamerIcIspCacConfig_t *pConfig +); + + +/*****************************************************************************/ +/** + * @brief This functions enables the CamerIC ISP CAC module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +RESULT CamerIcIspCacEnable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * CamerIcIspCacDisable() + * + * @brief Disable CAC Module + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +RESULT CamerIcIspCacDisable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This function + * + * @param handle CamerIc driver handle + * @param pIsEnabled Pointer to value to store current state + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_NULL_POINTER pIsEnabled is NULL pointer + * + *****************************************************************************/ +RESULT CamerIcIspCacIsEnabled +( + CamerIcDrvHandle_t handle, + bool_t *pIsEnabled +); + +RESULT CamerIcIspCacGetConfig +( + CamerIcDrvHandle_t handle, + CamerIcIspCacConfig_t *pConfig +); + +/*****************************************************************************/ +/** + * @brief calculations for square, non-suare pixel mode and normalization + * values (non-square pixel sensor) + * + * @param handle CamerIc driver handle + * @param pConfig Pointer to value to config context + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_NULL_POINTER pIsEnabled is NULL pointer + * + *****************************************************************************/ +RESULT CamerIcIspCacComputeNsNf( + CamerIcDrvHandle_t handle, + CamerIcIspCacConfig_t * pConfig +); +#ifdef __cplusplus +} +#endif + +/* @} cameric_isp_cac_drv_api */ + +/* @endcond */ + +#endif /* __CAMERIC_ISP_CAC_DRV_API_H__ */ + diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_isp_cnr_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_isp_cnr_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..06ca6448ba629ab27673e9a34f290c55b3083ade --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_isp_cnr_drv_api.h @@ -0,0 +1,178 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +#ifndef __CAMERIC_ISP_CNR_DRV_API_H__ +#define __CAMERIC_ISP_CNR_DRV_API_H__ + +/** + * @cond cameric_isp_cnr + * + * @file cameric_isp_cnr_drv_api.h + * + * @brief This file contains the CamerIC ISP CNR driver API definitions. + * + *****************************************************************************/ +/** + * @defgroup cameric_isp_cnr_drv_api CamerIC ISP CNR driver API definitions + * @{ + * + * @image html cameric20MP_isp_cnr.png "CamerIC ISP CNR driver" width=\textwidth + * @image latex cameric20MP_isp_cnr.png "CamerIC ISP CNR driver" width=\textwidth + * + * The color noise reduction module is used + */ +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +/*****************************************************************************/ +/** + * @brief This function enables the CamerIC ISP CNR Module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspCnrEnable +( + CamerIcDrvHandle_t handle +); + + +/*****************************************************************************/ +/** + * @brief This function disables the CamerIc ISP CNR module (bypass the + * color noise reduction module) + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspCnrDisable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This function returns the status of the CamerIC ISP CNR module. + * + * @param handle CamerIc driver handle + * @param pIsEnabled Pointer to value to store current state + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_INVALID_PARM pIsEnabled is a NULL pointer + * + *****************************************************************************/ +extern RESULT CamerIcIspCnrIsActivated +( + CamerIcDrvHandle_t handle, + bool_t *pIsEnabled +); + + + +/*****************************************************************************/ +/** + * @brief This function sets the line-width of the CamerIC ISP CNR module. + * + * @param handle CamerIc driver handle + * @param width Line width to set + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_INVALID_PARM pIsEnabled is a NULL pointer + * + *****************************************************************************/ +extern RESULT CamerIcIspCnrSetLineWidth +( + CamerIcDrvHandle_t handle, + const uint16_t width +); + + + +/*****************************************************************************/ +/** + * @brief This function returns the thresholds of the CamerIC ISP CNR module. + * + * @param handle CamerIc driver handle + * @param threshold1 Threshold Color Channel 1 + * @param threshold2 Threshold Color Channel 2 + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_INVALID_PARM pIsEnabled is a NULL pointer + * + *****************************************************************************/ +extern RESULT CamerIcIspCnrGetThresholds +( + CamerIcDrvHandle_t handle, + uint32_t *threshold1, + uint32_t *threshold2 +); + + + +/*****************************************************************************/ +/** + * @brief This function sets the thresholds of the CamerIC ISP CNR module. + * + * @param handle CamerIc driver handle + * @param threshold1 Threshold Color Channel 1 + * @param threshold2 Threshold Color Channel 2 + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_INVALID_PARM pIsEnabled is a NULL pointer + * + *****************************************************************************/ +extern RESULT CamerIcIspCnrSetThresholds +( + CamerIcDrvHandle_t handle, + const uint32_t threshold1, + const uint32_t threshold2 +); + + + +#ifdef __cplusplus +} +#endif + +/* @} cameric_isp_cnr_drv_api */ + +/* @endcond */ + +#endif /* __CAMERIC_ISP_CNR_DRV_API_H__ */ + diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_isp_color_adjust_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_isp_color_adjust_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..420ac4e41b70aa1eebdde68a995d2fe01b15678a --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_isp_color_adjust_drv_api.h @@ -0,0 +1,141 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +#ifndef __CAMERIC_ISP_COLOR_ADJUST_DRV_API_H__ +#define __CAMERIC_ISP_COLOR_ADJUST_DRV_API_H__ + +/** + * @cond cameric_isp_color_adjust + * + * @file cameric_isp_color_adjust_drv_api.h + * + * @brief This file contains the CamerIC ISP COLOR_ADJUST Driver + * API definitions + * + *****************************************************************************/ +/** + * @defgroup cameric_isp_color_adjust_drv_api CamerIC ISP COLOR_ADJUST Driver API definitions + * + * + */ +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +#define CA_CURVE_DATA_TABLE_LEN 65 + +typedef struct CamerIcIspCa_s +{ + bool enable; + unsigned char caMode; + unsigned short CaLutXTbl[ CA_CURVE_DATA_TABLE_LEN ]; + unsigned short CaLutLumaTbl[ CA_CURVE_DATA_TABLE_LEN ]; + unsigned short CaLutChromaTbl[ CA_CURVE_DATA_TABLE_LEN ]; + unsigned short CaLutShiftTbl[ CA_CURVE_DATA_TABLE_LEN ]; + +} CamerIcIspCa_t; + +/*****************************************************************************/ +/** + * @brief This functions enables the CamerIC color adjust + * module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspCaEnable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This functions disables the CamerIC color adjust + * module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspCaDisable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief Get CamerIC color adjust module status. + * + * @param handle CamerIc driver handle. + * @param pIsEnabled + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +extern RESULT CamerIcIspCaIsEnabled +( + CamerIcDrvHandle_t handle, + bool_t *pIsEnabled +); + +extern RESULT CamerIcIspCaConfig +( + CamerIcDrvHandle_t handle, + CamerIcIspCa_t *pCfg +); + +extern RESULT CamerIcIspCaGetConfig +( + CamerIcDrvHandle_t handle, + CamerIcIspCa_t *pCfg +); + +extern RESULT CamerIcIspUpdateDciCurve +( + CamerIcDrvHandle_t handle, + int *curve +); + + +#ifdef __cplusplus +} +#endif + +/* @} cameric_isp_color_adjust_drv_api */ + +/* @endcond */ + +#endif /* __CAMERIC_ISP_COLOR_ADJUST_DRV_API_H__ */ + + + diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_isp_compand_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_isp_compand_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..8b84d6fe379a8188c87c0915b1226f07c6a31668 --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_isp_compand_drv_api.h @@ -0,0 +1,302 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +#ifndef __CAMERIC_ISP_COMPAND_DRV_API_H__ +#define __CAMERIC_ISP_COMPAND_DRV_API_H__ + +/** + * @file cameric_isp_compand_drv_api.h + * + * @brief This file contains the CamerIC ISP compand driver API definitions. + * + *****************************************************************************/ +/** + * @cond cameric_isp_compand + * + * @defgroup cameric_isp_compand_drv_api CamerIC ISP compand Driver API definitions + * @{ + * + */ +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +struct CamericIspBlsContext { + uint8_t bit_width; + bool enable; + uint32_t a; + uint32_t b; + uint32_t c; + uint32_t d; +}; +/*****************************************************************************/ +/** + * CamerIcIspCmpdSetCurve() + * + * @brief init compand Module + * + * @param handle CamerIc driver handle + * @param xData pointer to xData + * @param yData pointer to yData + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +RESULT CamerIcIspCmpdSetCurve +( + CamerIcDrvHandle_t handle, + uint32_t* xData, + uint32_t* yData +); + +/*****************************************************************************/ +/** + * CamerIcIspCmpdEnable() + * + * @brief Enable compand Module + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +RESULT CamerIcIspCmpdEnable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * CamerIcIspCmpdDisable() + * + * @brief Disable compand Module + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +RESULT CamerIcIspCmpdDisable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * CamerIcIspCmpdSetTbl() + * + * @brief set compand expand table and compress table. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_WRONG_HANDLE + * + *****************************************************************************/ +RESULT CamerIcIspCmpdSetTbl +( + CamerIcDrvHandle_t handle, + const int *pExpandTbl, + const int *pCompressTbl +); + + + +/*****************************************************************************/ +/** + * CamerIcIspCmpdConfig() + * + * @brief Config compand module + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_WRONG_HANDLE + * + *****************************************************************************/ +RESULT CamerIcIspCmpdConfig +( + CamerIcDrvHandle_t handle, + void * pExpandParam, + void * pCompressParam, + void * pBlsParam +); + + +/*****************************************************************************/ +/** + * CamerIcIspCompandConfig() + * + * @brief Config compand module + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_WRONG_HANDLE + * + *****************************************************************************/ +RESULT CamerIcIspCompandConfig +( + CamerIcDrvHandle_t handle, + bool_t compressEnable, + bool_t expandEnable, + struct CamericIspBlsContext *pBlsPara +); + + + +/*****************************************************************************/ +/** + * @brief This function sets the fixed black level substraction values + * for the color channels. + * + * @note The assignment of the values for A, B, C and D to R, G, G and B + * pattern depends on the position and offset of the input acquisition + * window. + * + * The position [0,0] is always assigned to A, correlatively [0,1] + * is assigned to B, [1,0] to C and [1,1] to D. + * + * @param handle CamerIc driver handle + * @param A black-level substraction value A + * @param B black-level substraction value B + * @param C black-level substraction value C + * @param D black-level substraction value D + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_CONFIG a bayer-pattern was not configured + * @retval RET_OUTOFRANGE substraction value is to large + * + *****************************************************************************/ +extern RESULT CamerIcIspCompandBlsSetBlackLevel +( + CamerIcDrvHandle_t handle, + const uint16_t isp_bls_a_fixed, + const uint16_t isp_bls_b_fixed, + const uint16_t isp_bls_c_fixed, + const uint16_t isp_bls_d_fixed +); + + + +/*****************************************************************************/ +/** + * @brief This function reads out the current configured fixed black level + * substraction values. + * + * @note The assignment of the values for A, B, C and D to R, G, G and B + * pattern depends on the position and offset of the input acquisition + * window. + * + * The position [0,0] is always assigned to A, correlatively [0,1] + * is assigned to B, [1,0] to C and [1,1] to D. + * + * @param handle CamerIc driver handle + * @param A pointer to store the black-level substraction value A + * @param B pointer to store the black-level substraction value B + * @param C pointer to store the black-level substraction value C + * @param D pointer to store the black-level substraction value D + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_INVALID_PARM invalid parameter + * + *****************************************************************************/ +extern RESULT CamerIcIspCompandBlsGetBlackLevel +( + CamerIcDrvHandle_t handle, + uint16_t *isp_bls_a_fixed, + uint16_t *isp_bls_b_fixed, + uint16_t *isp_bls_c_fixed, + uint16_t *isp_bls_d_fixd +); + +/****************************************************************************** + * CamerIcIspCompandBlsEnable() + *****************************************************************************/ +extern RESULT CamerIcIspCompandBlsEnable +( + CamerIcDrvHandle_t handle +); + +/****************************************************************************** + * CamerIcIspCompandBlsDisable() + *****************************************************************************/ +RESULT CamerIcIspCompandBlsDisable +( + CamerIcDrvHandle_t handle +); + +/****************************************************************************** + * CamerIcIspCompandExpandEnable() + *****************************************************************************/ +extern RESULT CamerIcIspCompandExpandEnable +( + CamerIcDrvHandle_t handle +); + +/****************************************************************************** + * CamerIcIspCompandExpandDisable() + *****************************************************************************/ +extern RESULT CamerIcIspCompandExpandDisable +( + CamerIcDrvHandle_t handle +); + +/****************************************************************************** + * CamerIcIspCompandCompressEnable() + *****************************************************************************/ +extern RESULT CamerIcIspCompandCompressEnable +( + CamerIcDrvHandle_t handle +); + +/****************************************************************************** + * CamerIcIspCompandCompressDisable() + *****************************************************************************/ +extern RESULT CamerIcIspCompandCompressDisable +( + CamerIcDrvHandle_t handle +); + +#ifdef __cplusplus +} +#endif + + + +#endif /* __CAMERIC_ISP_COMPAND_DRV_API_H__ */ + diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_isp_crop_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_isp_crop_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..ceadcd876c6cf9dbab9956c5beb6dad41f3b7fe5 --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_isp_crop_drv_api.h @@ -0,0 +1,208 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +#ifndef __CAMERIC_ISP_CROP_DRV_API_H__ +#define __CAMERIC_ISP_CROP_DRV_API_H__ + +/** + * @cond cameric_isp_crop + * + * @file cameric_isp_crop_drv_api.h + * + * @brief This file contains the CamerIC ISP crop Driver + * API definitions + * + *****************************************************************************/ + +#include +#include + +#include "cameric_drv_api.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + +typedef struct CamericIspCropContext_s +{ + /* data */ + CamerIcWindow_t outWin; + bool enabled; + uint32_t inputWidth; + uint32_t inputHeight; + uint8_t pathId; +}CamericIspCropContext_t; + + +/*****************************************************************************/ +/** + * @brief Initialize CamerIc ISP CROP driver context. + * + * @param handle CamerIc driver handle. + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +RESULT CamerIcIspCropInit +( + CamerIcDrvHandle_t handle +); + +/*****************************************************************************/ +/** + * @brief Release/Free CamerIc ISP CROP driver context. + * + * @param handle CamerIc driver handle. + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +RESULT CamerIcIspCropRelease +( + CamerIcDrvHandle_t handle +); + +/*****************************************************************************/ +/** + * @brief This functions enables the CamerIC ISP crop module. + * + * Important note: This only enables the crop + * functionality of the CROP HW. + * + * + * @param handle CamerIc driver handle + * @param pathId path id + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspEnableCrop +( + CamerIcDrvHandle_t handle, + uint8_t pathId + +); + + +/*****************************************************************************/ +/** + * @brief This functions disables the CamerIC ISP crop module. + * + * @param handle CamerIc driver handle + * @param pathId path id + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspDisableCrop +( + CamerIcDrvHandle_t handle, + uint8_t pathId +); + + + +/*****************************************************************************/ +/** + * @brief Get CamerIC ISP crop status. + * + * @param handle CamerIc driver handle. + * @param pathId path id + * @param pIsEnabled Points to value indicating if crop is + * enabled if function returns RET_SUCCESS + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_NULL_POINTER NULL pointer passed + * + *****************************************************************************/ +extern RESULT CamerIcIspIsCropEnabled +( + CamerIcDrvHandle_t handle, + uint8_t pathId, + bool_t *pIsEnabled +); + + + +/*****************************************************************************/ +/** + * @brief This functions config the crop context + * + * @param handle CamerIc driver handle + * @param pathId path id + * @param pCrop Pointer to crop context + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_NULL_POINTER NULL pointer passed + * @retval RET_WRONG_CONFIG invalid window configuration + * + *****************************************************************************/ +extern RESULT CamerIcIspConfigCrop +( + CamerIcDrvHandle_t handle, + CamericIspCropContext_t *pCrop +); + + + +/*****************************************************************************/ +/** + * @brief This functions gets the output window currently configured in the + * CamerIC ISP crop. + * + * @param handle CamerIc driver handle + * @param pathId path id + * @param pOutWin Points to current configured output window + * if function returns RET_SUCCESS. + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_NULL_POINTER NULL pointer passed + * + *****************************************************************************/ +extern RESULT CamerIcIspGetCropOutputWindow +( + CamerIcDrvHandle_t handle, + uint8_t pathId, + CamerIcWindow_t *pOutWin +); + + + +#ifdef __cplusplus +} +#endif + +/* @} cameric_isp_crop_drv_api */ + +/* @endcond */ + +#endif /* __CAMERIC_ISP_CROP_DRV_API_H__ */ + diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_isp_dec_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_isp_dec_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..e5c268417da76d4fccda198aca855e4278b770f4 --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_isp_dec_drv_api.h @@ -0,0 +1,473 @@ +/******************************************************************************\ +|* Copyright (c) 2020 by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +#ifndef __CAMERIC_ISP_DEC_DRV_API_H__ +#define __CAMERIC_ISP_DEC_DRV_API_H__ + +/** + * @file cameric_isp_dec_drv_api.h + * + * @brief This file contains the CamerIC ISP compand driver API definitions. + * + *****************************************************************************/ +/** + * @cond cameric_isp_compand + * + * @defgroup cameric_isp_compand_drv_api CamerIC ISP compand Driver API definitions + * @{ + * + */ +#include +#include +#include "cameric_isp_drv_api.h" +#ifdef __cplusplus +extern "C" +{ +#endif + +/******************************************************************************* + * + * CamerIcIspDecStreamCfg_t + * + * @brief + * + */ + typedef struct CamerIcIspDecStreamCfg_s +{ + + CamerIcIspDecWriteConfig_t decWriteConfig; + CamerIcIspDecWriteExConfig_t decWriteExConfig; + CamerIcIspDecReadConfig_t decReadConfig; + CamerIcIspDecReadExConfig_t decReadExConfig; + uint32_t baseAddr; + uint32_t endAddr; + + uint32_t cacheBaseAddr; + uint32_t flushAddr; + + +} CamerIcIspDecStreamCfg_t; + +#define MAX_STREAM 32 + +/******************************************************************************* + * + * CamerIcIspDecContext_t + * + * @brief + * + */ +typedef struct CamerIcIspDecContext_s +{ + bool_t enabled; + bool_t cfgUpdate; + + CamerIcIspDecWriteConfig_t writeConfig; + CamerIcIspDecWriteExConfig_t writeExConfig; + CamerIcIspDecReadConfig_t readConfig; + CamerIcIspDecReadExConfig_t readExConfig; + CamerIcIspDecStreamCfg_t decStreamCfg[MAX_STREAM]; + uint16_t streamIdMask; + + +} CamerIcIspDecContext_t; +/*****************************************************************************/ +/** + * @brief This function enable the ISP DEC module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspDecEnable +( + CamerIcDrvHandle_t handle +); + +/*****************************************************************************/ +/** + * @brief This function enable the ISP DEC module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspDecDisable +( + CamerIcDrvHandle_t handle +); + + +/*****************************************************************************/ +/** + * CamerIcIspDecControl() + * + * @brief Config DEC global control + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_WRONG_HANDLE + * + *****************************************************************************/ +RESULT CamerIcIspDecControl +( + CamerIcDrvHandle_t handle, + CamerIcIspDecControl_t *pDecControl, + CamerIcIspDecControl_ex_t *pDecControlEx, + CamerIcIspDecControl_ex2_t *pDecControlEx2 + +); + +/*****************************************************************************/ +/** + * CamerIcIspDecIntrEnbl() + * + * @brief Enable DEC interrupt + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_WRONG_HANDLE + * + *****************************************************************************/ +RESULT CamerIcIspDecIntrEnbl +( + CamerIcDrvHandle_t handle, + uint32_t intrEnblVec, + uint32_t intrEnblExVec, + uint32_t intrEnblEx2Vec + +); + +/*****************************************************************************/ +/** + * CamerIcIspDecWriteConfig() + * + * @brief Config DEC format, bitDepth, tileMode, alignSize, etc. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_WRONG_HANDLE + * + *****************************************************************************/ +RESULT CamerIcIspDecWriteConfig +( + CamerIcDrvHandle_t handle, + uint8_t streamId, + CamerIcIspDecWriteConfig_t *pDecWriteConfig, + CamerIcIspDecWriteExConfig_t *pDecWriteExConfig + +); + +/*****************************************************************************/ +/** + * CamerIcIspDecReadConfig() + * + * @brief Config DEC format, bitDepth, tileMode, alignSize, etc. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_WRONG_HANDLE + * + *****************************************************************************/ +RESULT CamerIcIspDecReadConfig +( + CamerIcDrvHandle_t handle, + uint8_t streamId, + CamerIcIspDecReadConfig_t *pDecReadConfig, + CamerIcIspDecReadExConfig_t *pDecReadExConfig + +); + +/*****************************************************************************/ +/** + * CamerIcIspDecWriteBufferBase() + * + * @brief Config DEC write buffer base address. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_WRONG_HANDLE + * + *****************************************************************************/ +RESULT CamerIcIspDecWriteBufferBase +( + CamerIcDrvHandle_t handle, + uint8_t streamId, + uint32_t baseAddress + +); + +/*****************************************************************************/ +/** + * CamerIcIspDecWriteBufferEnd() + * + * @brief Config DEC write buffer end address. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_WRONG_HANDLE + * + *****************************************************************************/ +RESULT CamerIcIspDecWriteBufferEnd +( + CamerIcDrvHandle_t handle, + uint8_t streamId, + uint32_t endAddress + +); + +/*****************************************************************************/ +/** + * CamerIcIspDecReadBufferBase() + * + * @brief Config DEC read buffer base address. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_WRONG_HANDLE + * + *****************************************************************************/ +RESULT CamerIcIspDecReadBufferBase +( + CamerIcDrvHandle_t handle, + uint8_t streamId, + uint32_t baseAddress + +); + +/*****************************************************************************/ +/** + * CamerIcIspDecReadBufferEnd() + * + * @brief Config DEC read buffer end address. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_WRONG_HANDLE + * + *****************************************************************************/ +RESULT CamerIcIspDecReadBufferEnd +( + CamerIcDrvHandle_t handle, + uint8_t streamId, + uint32_t endAddress + +); + +/*****************************************************************************/ +/** + * CamerIcIspDecWriteCacheBase() + * + * @brief Config DEC write cache base address. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_WRONG_HANDLE + * + *****************************************************************************/ +RESULT CamerIcIspDecWriteCacheBase +( + CamerIcDrvHandle_t handle, + uint8_t streamId, + uint32_t baseAddress + +); + +/*****************************************************************************/ +/** + * CamerIcIspDecReadCacheBase() + * + * @brief Config DEC read cache base address. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_WRONG_HANDLE + * + *****************************************************************************/ +RESULT CamerIcIspDecReadCacheBase +( + CamerIcDrvHandle_t handle, + uint8_t streamId, + uint32_t baseAddress + +); + +/*****************************************************************************/ +/** + * CamerIcIspDecWriteFlushCache() + * + * @brief Config DEC write flush cache address. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_WRONG_HANDLE + * + *****************************************************************************/ +RESULT CamerIcIspDecWriteFlushCache +( + CamerIcDrvHandle_t handle, + uint8_t streamId, + uint32_t cacheAddress + +); + +/*****************************************************************************/ +/** + * CamerIcIspDecReadFlushCache() + * + * @brief Config DEC read flush cache address. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_WRONG_HANDLE + * + *****************************************************************************/ +RESULT CamerIcIspDecReadFlushCache +( + CamerIcDrvHandle_t handle, + uint8_t streamId, + uint32_t cacheAddress + +); + +/*****************************************************************************/ +/** + * CamerIcIspDecCfg() + * + * @brief Config DEC stream. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_WRONG_HANDLE + * + *****************************************************************************/ + +RESULT CamerIcIspDecCfg +( + CamerIcDrvHandle_t handle, + uint8_t streamId, + CamerIcIspDecStreamCfg_t* pDecStreamCfg +); + +/*****************************************************************************/ +/** + * CamerIcIspDecWriteAddrCfg() + * + * @brief enable DEC compress. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_WRONG_HANDLE + * + *****************************************************************************/ + +RESULT CamerIcIspDecWriteAddrCfg +( + CamerIcDrvHandle_t handle, + uint8_t streamId, + CamerIcIspDecStreamCfg_t* pDecStreamCfg + +); + +/*****************************************************************************/ +/** + * CamerIcIspDecIsEnabled() + * + * @brief Is DEC enabled compress? + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_WRONG_HANDLE + * + *****************************************************************************/ + +bool CamerIcIspDecIsEnabled +( + CamerIcDrvHandle_t handle +); + +/*****************************************************************************/ +/** + * CamerIcIspDecReadAddrCfg() + * + * @brief enable DEC compress. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_WRONG_HANDLE + * + *****************************************************************************/ + +RESULT CamerIcIspDecReadAddrCfg +( + CamerIcDrvHandle_t handle, + uint8_t streamId, + CamerIcIspDecStreamCfg_t* pDecStreamCfg + +); + +RESULT CamerIcIspDecReadUpdateAddr +( + CamerIcDrvHandle_t handle, + uint8_t streamId +); + + +#ifdef __cplusplus +} +#endif + +/* @} cameric_isp_dec_drv_api */ + +/* @endcond */ + +#endif /* __CAMERIC_ISP_DEC_DRV_API_H__ */ + + diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_isp_degamma_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_isp_degamma_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..249642472b1c4511ad54ccc6db28ad8a79682dd5 --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_isp_degamma_drv_api.h @@ -0,0 +1,169 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +#ifndef __CAMERIC_ISP_DEGAMMA_DRV_API_H__ +#define __CAMERIC_ISP_DEGAMMA_DRV_API_H__ + +/** + * @cond cameric_isp_degamma + * + * @file cameric_isp_degamma_drv_api.h + * + * @brief This file contains the CamerIC ISP DEGAMMA driver API definitions. + * + *****************************************************************************/ +/** + * @defgroup cameric_isp_degamma_drv_api CamerIC ISP DEGAMMA driver API definitions + * @{ + * + */ +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +#define CAMERIC_DEGAMMA_CURVE_SIZE 17U + + +/******************************************************************************* + * + * @brief + * + */ +typedef struct CamerIcIspDegammaCurve_s +{ + uint8_t segment[CAMERIC_DEGAMMA_CURVE_SIZE-1]; /**< x_i segment size */ + uint16_t red[CAMERIC_DEGAMMA_CURVE_SIZE]; /**< red point */ + uint16_t green[CAMERIC_DEGAMMA_CURVE_SIZE]; /**< green point */ + uint16_t blue[CAMERIC_DEGAMMA_CURVE_SIZE]; /**< blue point */ +} CamerIcIspDegammaCurve_t; + + + +/*****************************************************************************/ +/** + * @brief This function enables the CamerIC ISP Degamma Module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspDegammaEnable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This function disables the CamerIc ISP Degamma module (bypass the + * degamma module) + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspDegammaDisable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This function returns the status of the CamerIC ISP Degamma module. + * + * @param handle CamerIc driver handle + * @param pIsEnabled Pointer to value to store current state + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_NULL_POINTER pIsEnabled is a NULL pointer + * + *****************************************************************************/ +extern RESULT CamerIcIspDegammaIsEnabled +( + CamerIcDrvHandle_t handle, + bool_t *pIsEnabled +); + + +/*****************************************************************************/ +/** + * @brief This function returns the currently configured degamma curve + * from the CamerIc ISP Degamma module. + * + * @param handle CamerIc driver handle + * @param pCurve reference to curve + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_INVALID_PARM pCurve is a NULL pointer + * + *****************************************************************************/ +extern RESULT CamerIcIspDegammaGetCurve +( + CamerIcDrvHandle_t handle, + CamerIcIspDegammaCurve_t *pCurve +); + + +/*****************************************************************************/ +/** + * @brief This function set the degamma curve to use in the CamerIc ISP + * Degamma module. + * + * @param handle CamerIc driver handle + * @param pCurve reference to curve + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_INVALID_PARM pCurve is a NULL pointer + * @retval RET_WRONG_STATE degamma module is running + * + *****************************************************************************/ +extern RESULT CamerIcIspDegammaSetCurve +( + CamerIcDrvHandle_t handle, + CamerIcIspDegammaCurve_t *pCurve +); + + + +#ifdef __cplusplus +} +#endif + +/* @} cameric_isp_degamma_drv_api */ + +/* @endcond */ + +#endif /* __CAMERIC_ISP_DEGAMMA_DRV_API_H__ */ + diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_isp_dmsc2_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_isp_dmsc2_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..3d1b97544fe1565067ad3e558393e1d55c27b954 --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_isp_dmsc2_drv_api.h @@ -0,0 +1,376 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +#ifndef __CAMERIC_ISP_DMSC2_DRV_API_H__ +#define __CAMERIC_ISP_DMSC2_DRV_API_H__ + +/** + * @cond cameric_isp_dmsc + * + * @file cameric_isp_dmsc_drv_api.h + * + * @brief This file contains the CamerIc ISP DMSC driver API definitions + * + *****************************************************************************/ +/** + * @defgroup cameric_isp_dmsc_drv_api CamerIc ISP DMSC driver API definitions + * @{ + * + * A significant challenge for low profile lenses is to minimize lens shading + * artifacts, also known as "vignetting". Lens shading artifacts are caused by + * decreased light intensity in the peripheral regions of the sensor due to + * the inability of the lens to focus the light in those areas in comparison + * to the centre region. Lens shading artifacts are minimized by image data + * processing with a lens shading correction algorithm. + * + * @image html dmsc.png "Overview of the CamerIC ISP DMSC driver" width=\textwidth + * @image latex dmsc.png "Overview of the CamerIC ISP DMSC driver" width=\textwidth + * + * Lens shading is different for each of its color components, since sensor + * produces no perfect response in all three color channels. Therefore the + * lens shading correction is alternatively performed identically for the + * four color components of the RGB Bayer input signal or calibrated + * independently for the color components RGB. + * + * The aim of the lens shading correction algorithm is to achieve a constant + * sensitivity across the entire frame after correction. Therefore each incoming + * pixel value PIN(x,y) is multiplied by a correction factor F(x,y). The + * correction factor depends on the coordinates of the pixel within the frame. + * + * The corrected pixel value PCOR(x,y) is calculated according: + * + * PCOR(x,y) = PIN(x,y) * F(x,y) (1) + * + * In order to increase the precision of the correction function, the frame + * is divided into 16 sectors in x and y dimension. The coordinates of each + * sector are programmable. Furthermore the lens shading correction parameters + * are programmable independently for each sector and for each color component + * within a sector. The sector coordinates apply for each color component. + * This unit will be designed so that either the lens shading correction parameters + * apply for all color components or each color component gets its own lens shading + * correction parameters. + * + * @image html dmsc_sectors.png "Lens Shading Correction Sectors" width=\textwidth + * @image latex dmsc_sectors.png "Lens Shading Correction Sectors" width=\textwidth + * + * To reduce hardware effort, position and size of mirrored sectors related to the + * frame center are equivalent. This means for example that size and position of + * sector X1 is equivalent to X16 related to frame center and Y3 to Y14. However + * the correction factors are independent for each sector. To reduce the memory + * for storing the coordinates of the sensor area, the size of each sector is + * programmed. Furthermore only the sizes of one quarter of the frame is programmed, + * because the sectors are symmetrical relative to the picture center. The coordinates + * are calculated by hardware during processing. + * + * Within each sector, the correction function F(x,y) can be expressed as a Bilinear + * Interpolation Function. These functions in different areas are correlated, because + * of the requirement that the correction function must be continuous and smooth. + * + * The lens shading correction unit works on RGB Bayer pattern and is placed after + * the sensor degamma and the black level correction units. + * + * @subsection Functional description + * + * The lens shading correction is based on one or more reference frames which have + * to be captured under dedicated light conditions and a dedicated position of the + * sensor. The pixels of the captured frame are then evaluated by software and the + * calculated parameters for the lens shading correction are stored in different + * tables. It is also possible to use different lens shading correction parameters + * for different environment conditions, e.g. lightness, light direction or sensor + * position. Therefore additional reference frames for the different conditions are + * to be captured and evaluated. The calculated parameters including sector settings + * can be stored in multiple tables at external memory or Flash device. Thus user + * can select one of multiple lens shading correction algorithms so that software + * can update the current required tables within the lens shading correction block. + * The correction factors at the sector corners as well as the size of the sectors + * are stored. The correction value for each pixel position is calculated using the + * bilinear interpolation. + * + */ + +#include +#include +#include "cameric_isp_drv_api.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + + +/*****************************************************************************/ +/** + * @brief demosaic configuration structure + * + *****************************************************************************/ +typedef struct CamericIspDmscIntp_t { + uint16_t intp_dir_thr_min; + uint16_t intp_dir_thr_max; +} CamericIspDmscIntp_t; + +typedef struct CamericIspDmscDemoire_t { + bool enabled; + uint8_t demoire_area_thr; + uint8_t demoire_sat_shrink; + uint16_t demoire_r2; + uint16_t demoire_r1; + uint8_t demoire_t2_shift; + uint8_t demoire_t1; + uint16_t demoire_edge_r2; + uint16_t demoire_edge_r1; + uint8_t demoire_edge_t2_shift; + uint16_t demoire_edge_t1; +} CamericIspDmscDemoire_t; + +typedef struct CamericIspDmscSharpen_t { + bool enabled; + uint16_t sharpen_factor_black; + uint16_t sharpen_factor_white; + uint16_t sharpen_clip_black; + uint16_t sharpen_clip_white; + uint16_t sharpen_t4_shift; + uint16_t sharpen_t3; + uint8_t sharpen_t2_shift; + uint16_t sharpen_t1; + uint16_t sharpen_r3; + uint16_t sharpen_r2; + uint16_t sharpen_r1; +} CamericIspDmscSharpen_t; + +typedef struct CamericIspDmscSharpenLine_t { + bool enabled; + uint8_t sharpen_line_shift2; + uint8_t sharpen_line_shift1; + uint16_t sharpen_line_t1; + uint16_t sharpen_line_strength; + uint16_t sharpen_line_r2; + uint16_t sharpen_line_r1; +} CamericIspDmscSharpenLine_t; + +typedef struct CamericIspDmscGFilter_t { + uint8_t sharpen_size; + uint8_t hf_filt_00; + uint8_t hf_filt_01; + uint8_t hf_filt_02; + uint8_t hf_filt_10; + uint8_t hf_filt_11; + uint8_t hf_filt_12; + uint8_t hf_filt_20; + uint8_t hf_filt_21; + uint8_t hf_filt_22; +} CamericIspDmscGFilter_t; + +typedef struct CamericIspDmscSkin_t { + bool enabled; + uint16_t cb_thr_max_2047; + uint16_t cb_thr_min_2047; + uint16_t cr_thr_max_2047; + uint16_t cr_thr_min_2047; + uint16_t y_thr_max_2047; + uint16_t y_thr_min_2047; +} CamericIspDmscSkin_t; + +typedef struct CamericIspDmscDepurple_t { + bool enabled; + bool red_sat, blue_sat; + uint8_t depurple_sat_shrink; + uint8_t depurple_thr; +} CamericIspDmscDepurple_t; + +typedef struct CamericIspDmscCac_t { + bool cac_enable; + uint16_t v_count_start; + uint16_t h_count_start; + uint16_t a_red; + uint16_t a_blue; + uint16_t b_red; + uint16_t b_blue; + uint16_t c_red; + uint16_t c_blue; + uint8_t x_ns; + uint8_t x_nf; + uint8_t y_ns; + uint8_t y_nf; +} CamericIspDmscCac_t; + +typedef struct CamericIspDemosaicContext { + bool enable; + uint8_t demosaic_thr; + uint8_t denoise_stren; + CamericIspDmscIntp_t intp; + CamericIspDmscDemoire_t demoire; + CamericIspDmscSharpen_t sharpen; + CamericIspDmscGFilter_t gFilter; + CamericIspDmscSharpenLine_t sharpenLine; + CamericIspDmscSkin_t skin; + CamericIspDmscDepurple_t depurple; +} CamericIspDemosaicContext; + +typedef struct CamericIspDmscSharpen2_t { + CamericIspDmscSharpen_t sharpen; + uint32_t gdenoise; + uint32_t gsharpenSize; +} CamericIspDmscSharpen2_t; + + +extern RESULT CamerIcIspDmscEnable +( + CamerIcDrvHandle_t handle +); + +extern RESULT CamerIcIspDmscDisable +( + CamerIcDrvHandle_t handle +); + +extern RESULT CamerIcIspDmscEnableDemoire(CamerIcDrvHandle_t handle); +extern RESULT CamerIcIspDmscDisableDemoire(CamerIcDrvHandle_t handle); + +extern RESULT CamerIcIspDmscGetDemoire +( + CamerIcDrvHandle_t handle, + CamericIspDmscDemoire_t *pDemoircCfg +); + +extern RESULT CamerIcIspDmscCfgDemoire +( + CamerIcDrvHandle_t handle, + CamericIspDmscDemoire_t *pDemoircCfg +); + +extern RESULT CamerIcIspDmscEnableDepurple(CamerIcDrvHandle_t handle); +extern RESULT CamerIcIspDmscDisableDepurple(CamerIcDrvHandle_t handle); + +extern RESULT CamerIcIspDmscGetDepurple +( + CamerIcDrvHandle_t handle, + CamericIspDmscDepurple_t *pDepurpleCfg +); + +extern RESULT CamerIcIspDmscCfgDepurple +( + CamerIcDrvHandle_t handle, + CamericIspDmscDepurple_t *pDepurpleCfg +); + +extern RESULT CamerIcIspDmscEnableSharpen(CamerIcDrvHandle_t handle); +extern RESULT CamerIcIspDmscDisableSharpen(CamerIcDrvHandle_t handle); + +extern RESULT CamerIcIspDmscGetSharpen(CamerIcDrvHandle_t handle, CamericIspDmscSharpen_t *pSharpenCfg); + +extern RESULT CamerIcIspDmscCfgSharpen(CamerIcDrvHandle_t handle, CamericIspDmscSharpen_t *pSharpenCfg); + +extern RESULT CamerIcIspDmscEnableSkin(CamerIcDrvHandle_t handle); +extern RESULT CamerIcIspDmscDisableSkin(CamerIcDrvHandle_t handle); + +extern RESULT CamerIcIspDmscCfgSkin +( + CamerIcDrvHandle_t handle, + CamericIspDmscSkin_t *pSkinCfg +); + +extern RESULT CamerIcIspDmscGetSkin +( + CamerIcDrvHandle_t handle, + CamericIspDmscSkin_t *pSkinCfg +); + +RESULT CamerIcIspDmscSet +( + CamerIcDrvHandle_t handle, + CamericIspDemosaicContext *pDmsc +); + +RESULT CamerIcIspGetDmsc +( + CamerIcDrvHandle_t handle, + CamerIcIspDemosaicBypass_t *pBypassMode, + uint8_t *pDemosaicThreshold +); + +RESULT CamerIcIspDmscUpdateAllSettings +( + CamerIcDrvHandle_t handle, + CamericIspDemosaicContext *pDmsc +); + +RESULT CamerIcIspDmscGetAllSettings +( + CamerIcDrvHandle_t handle, + CamericIspDemosaicContext *pDmsc +); + +RESULT CamericIspDmscSharpenEnable +( + CamerIcDrvHandle_t handle +); + + +RESULT CamericIspDmscSharpenDisable +( + CamerIcDrvHandle_t handle +); + +RESULT CamericIspDmscSharpenConfig +( + CamerIcDrvHandle_t handle, + CamericIspDmscSharpen2_t *pConfig +); + +RESULT CamerIcIspDmscSetInterplation +( + CamerIcDrvHandle_t handle, + uint16_t max, + uint16_t min +); + +RESULT CamerIcIspDmscCfgGfilter +( + CamerIcDrvHandle_t handle, + CamericIspDmscGFilter_t *pGfilter +); + +RESULT CamerIcIspDmscGetGfilter( + CamerIcDrvHandle_t handle, + CamericIspDmscGFilter_t *pGfilter +) ; + +extern RESULT CamerIcIspDmscEnableSharpenLine(CamerIcDrvHandle_t handle); +extern RESULT CamerIcIspDmscDisableSharpenLine(CamerIcDrvHandle_t handle); + +RESULT CamerIcIspDmscCfgSharpenLine +( + CamerIcDrvHandle_t handle, + CamericIspDmscSharpenLine_t *pSharpenLine +); + +RESULT CamerIcIspDmscGetSharpenLine +( + CamerIcDrvHandle_t handle, + CamericIspDmscSharpenLine_t *pSharpenLine +); + +#ifdef __cplusplus +} +#endif + +/* @} cameric_isp_dmsc_drv_api */ + +/* @endcond */ + +#endif /* __CAMERIC_ISP_DMSC_DRV_API_H__ */ + + diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_isp_dpcc_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_isp_dpcc_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..77f87cd635b738439577e3a484b8fdc4537fa039 --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_isp_dpcc_drv_api.h @@ -0,0 +1,184 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +#ifndef __CAMERIC_ISP_DPCC_DRV_API_H__ +#define __CAMERIC_ISP_DPCC_DRV_API_H__ + +/** + * @file cameric_isp_dpcc_drv_api.h + * + * @brief This file contains the CamerIC ISP DPCC driver API definitions. + * + *****************************************************************************/ +/** + * @cond cameric_isp_dpcc + * + * @defgroup cameric_isp_dpcc_drv_api CamerIC ISP DPCC Driver API definitions + * @{ + * + * The Defect Pixel Cluster Correction (DPCC) detects and corrects single pixel + * and small cluster defects on raw Bayer image data, i.e. impulsive noise. + * An integrated defect pixel table allows the correction of up to 2048 fix + * positions independently on the on the fly detection. The unit performs two tasks: + * + * Defect Pixel Detection \n + * For each pixel threshold values are calculated by several methods, using + * the correlation of neighbor pixel of the same color (red, green or blue) + * with exception of the peak gradient estimation for red and blue that also + * uses the green pixel values in the 5x5 neighborhood of the raw Bayer image. + * These methods use statistical properties and linear prediction to determine + * if a pixel needs to be marked as defect. A 3x3 sorting algorithm with rank + * estimation including the calculation of median values of some pixel groups + * is a central Unit. Output of the detection unit is a marker signal for the + * following correction stage to indicate if the current pixel is defect. The + * detection can be controlled by programmable threshold values, factors and + * options which methods should be used. The correct setting of the thresholds + * is important for a good separation between defects and keeping high resolution + * and detail features in the image. + * + * Defect Pixel Table control \n + * A defect pixel table is implemented as SRAM including 2048 entries with + * defect pixel coordinates. The table control generates a replace flag + * independently from the on the fly detection. The defect pixel coordinates + * can be located in a maximum window of 8192 horizontal by 4096 vertical. + * + * Defect Pixel Replacement \ņ + * Basic algorithm is a switching median filter [1], which performs sorting and + * rank ordering. The replacement unit takes the information of the Defect Pixel + * Detection as input. It uses a statistical sorting filter (median filter) + * separately for each color to determine the nearest neighbor value for replacement. + * The filter size is 4 (upper, lower, left and right neighbor for red/blue or + * diagonal neighbors for green) optionally 5, including the center pixel. + * The center pixel should only be included if the probability is high that + * the center pixel is not defect (depending on parameter settings). Normally + * the detection unit mostly marks true defect pixels. Especially the replacement + * value for defect pixels on edges will be more accurate (getting smooth edges) + * if the 4 Pixel kernel is selected. + */ +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + + + +/*****************************************************************************/ +/** + * @brief This type defines the static configuration structure of the + * CamerIc DPCC module (register configuration). + */ +/*****************************************************************************/ +typedef struct CamerIcDpccStaticConfig_s +{ + uint32_t isp_dpcc_mode; + uint32_t isp_dpcc_output_mode; + uint32_t isp_dpcc_set_use; + + uint32_t isp_dpcc_methods_set_1; + uint32_t isp_dpcc_methods_set_2; + uint32_t isp_dpcc_methods_set_3; + + uint32_t isp_dpcc_line_thresh_1; + uint32_t isp_dpcc_line_mad_fac_1; + uint32_t isp_dpcc_pg_fac_1; + uint32_t isp_dpcc_rnd_thresh_1; + uint32_t isp_dpcc_rg_fac_1; + + uint32_t isp_dpcc_line_thresh_2; + uint32_t isp_dpcc_line_mad_fac_2; + uint32_t isp_dpcc_pg_fac_2; + uint32_t isp_dpcc_rnd_thresh_2; + uint32_t isp_dpcc_rg_fac_2; + + uint32_t isp_dpcc_line_thresh_3; + uint32_t isp_dpcc_line_mad_fac_3; + uint32_t isp_dpcc_pg_fac_3; + uint32_t isp_dpcc_rnd_thresh_3; + uint32_t isp_dpcc_rg_fac_3; + + uint32_t isp_dpcc_ro_limits; + uint32_t isp_dpcc_rnd_offs; +} CamerIcDpccStaticConfig_t; + + + +/*****************************************************************************/ +/** + * @brief This function enables the DPCC Module + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE handle is invalid + * + *****************************************************************************/ +RESULT CamerIcIspDpccEnable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This function disables the DPCC Module + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE handle is invalid + * + *****************************************************************************/ +RESULT CamerIcIspDpccDisable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This function applies a static register configuration in + * the DPCC Module + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE handle is invalid + * + *****************************************************************************/ +RESULT CamerIcIspDpccSetStaticConfig +( + CamerIcDrvHandle_t handle, + CamerIcDpccStaticConfig_t *pConfig +); + +#ifdef __cplusplus +} +#endif + +/* @} cameric_isp_dpcc_drv_api */ + +/* @endcond */ + +#endif /* __CAMERIC_ISP_DPCC_DRV_API_H__ */ + diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_isp_dpf_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_isp_dpf_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..16a7df5a25dd330855c2b1418887f1bce86654b9 --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_isp_dpf_drv_api.h @@ -0,0 +1,300 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +#ifndef __CAMERIC_ISP_DPF_DRV_API_H__ +#define __CAMERIC_ISP_DPF_DRV_API_H__ + +/** + * @file cameric_isp_dpf_drv_api.h + * + * @brief This file contains the CamerIC ISP DPF driver API definitions. + * + *****************************************************************************/ +/** + * @cond cameric_isp_dpf + * + * @defgroup cameric_isp_dpf_drv_api CamerIC ISP DPF Driver API definitions + * @{ + * + */ +#include +#include +#include +//#include + +#ifdef __cplusplus +extern "C" +{ +#endif + + + + +#define CAMERIC_DPF_MAX_NLF_COEFFS 17 +#define CAMERIC_DPF_MAX_SPATIAL_COEFFS 6 + + + +/*****************************************************************************/ +/** + * @brief This type defines the supported filter kernel sizes for the red + * and blue channels. + */ +/*****************************************************************************/ +typedef enum CamerIcDpfRedBlueFilterSize_e +{ + CAMERIC_DPF_RB_FILTERSIZE_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_DPF_RB_FILTERSIZE_9x9 = 1, /**< red and blue filter kernel size 9x9 (means 5x5 active pixel) */ + CAMERIC_DPF_RB_FILTERSIZE_13x9 = 2, /**< red and blue filter kernel size 13x9 (means 7x5 active pixel) */ + CAMERIC_DPF_RB_FILTERSIZE_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcDpfRedBlueFilterSize_t; + + + +/*****************************************************************************/ +/** + * @brief This type defines the supported gain usage modes in the DPF + * preprocessing stage. + */ +/*****************************************************************************/ +typedef enum CamerIcDpfGainUsage_e +{ + CAMERIC_DPF_GAIN_USAGE_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_DPF_GAIN_USAGE_DISABLED = 1, /**< don't use any gains in preprocessing stage */ + CAMERIC_DPF_GAIN_USAGE_NF_GAINS = 2, /**< use only the noise function gains from registers DPF_NF_GAIN_R, ... */ + CAMERIC_DPF_GAIN_USAGE_LSC_GAINS = 3, /**< use only the gains from LSC module */ + CAMERIC_DPF_GAIN_USAGE_NF_LSC_GAINS = 4, /**< use the moise function gains and the gains from LSC module */ + CAMERIC_DPF_GAIN_USAGE_AWB_GAINS = 5, /**< use only the gains from AWB module */ + CAMERIC_DPF_GAIN_USAGE_AWB_LSC_GAINS = 6, /**< use the gains from AWB and LSC module */ + CAMERIC_DPF_GAIN_USAGE_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcDpfGainUsage_t; + + + +/*****************************************************************************/ +/** + * @brief This type defines the supported scaling of x axis. + */ +/*****************************************************************************/ +typedef enum CamerIcDpfNoiseLevelLookUpScale_e +{ + CAMERIC_NLL_SCALE_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_NLL_SCALE_LINEAR = 1, /**< use a linear scaling */ + CAMERIC_NLL_SCALE_LOGARITHMIC = 2, /**< use a logarithmic scaling */ + CAMERIC_NLL_SCALE_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcDpfNoiseLevelLookUpScale_t; + + + +/*****************************************************************************/ +/** + * @brief This type defines the + */ +/*****************************************************************************/ +typedef struct CamerIcDpfInvStrength_s +{ + uint8_t WeightR; + uint8_t WeightG; + uint8_t WeightB; +} CamerIcDpfInvStrength_t; + + + +/*****************************************************************************/ +/** + * @brief + */ +/*****************************************************************************/ +typedef struct CamerIcDpfNoiseLevelLookUp_s +{ + uint16_t NllCoeff[CAMERIC_DPF_MAX_NLF_COEFFS]; /**< Noise-Level-Lookup coefficients */ + CamerIcDpfNoiseLevelLookUpScale_t xScale; /**< type of x-axis (logarithmic or linear type) */ +} CamerIcDpfNoiseLevelLookUp_t; + + + +/*****************************************************************************/ +/** + * @brief This type defines the supported filter kernel sizes for the red + * and blue channels. + */ +/*****************************************************************************/ +typedef struct CamerIcDpfSpatial_s +{ + uint8_t WeightCoeff[CAMERIC_DPF_MAX_SPATIAL_COEFFS]; +} CamerIcDpfSpatial_t; + + + +/*****************************************************************************/ +/** + * @brief This type defines the configuration structure of the CamerIc + * DPF module. + */ +/*****************************************************************************/ +typedef struct CamerIcDpfConfig_s +{ + CamerIcDpfGainUsage_t GainUsage; /**< which gains shall be used in preprocessing stage of dpf module */ + + CamerIcDpfRedBlueFilterSize_t RBFilterSize; /**< size of filter kernel for red/blue pixel */ + + bool_t ProcessRedPixel; /**< enable filter processing for red pixel */ + bool_t ProcessGreenRPixel; /**< enable filter processing for green pixel in red lines */ + bool_t ProcessGreenBPixel; /**< enable filter processing for green pixel in blue lines */ + bool_t ProcessBluePixel; /**< enable filter processing for blux pixel */ + + CamerIcDpfSpatial_t SpatialG; /**< spatial weights for green pixel */ + CamerIcDpfSpatial_t SpatialRB; /**< spatial weights for red/blue pixel */ +} CamerIcDpfConfig_t; + + + +/*****************************************************************************/ +/** + * @brief This function enables the CamerIc ISP DPF module. + * + * @return Return the result of the function call. + * @retval RET_SUCCESS Configuration successfully applied + * @retval RET_OUTOFRANGE At least one perameter of out range + * + *****************************************************************************/ +extern RESULT CamerIcIspDpfEnable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This function disables the CamerIc ISP DPF module. + * + * @return Return the result of the function call. + * @retval RET_SUCCESS Configuration successfully applied + * @retval RET_OUTOFRANGE At least one perameter of out range + * + *****************************************************************************/ +extern RESULT CamerIcIspDpfDisable +( + CamerIcDrvHandle_t handle +); + + +/*****************************************************************************/ +/** + * @brief This functions returns the current status of the CamerIc ISP + * DPF module. + * + * @param handle CamerIc driver handle. + * @param pIsEnabled + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +extern RESULT CamerIcIspDpfIsEnabled +( + CamerIcDrvHandle_t handle, + bool_t *pIsEnabled +); + + + +/*****************************************************************************/ +/** + * @brief This function configures the CamerIc ISP DPF module. + * + * @return Return the result of the function call. + * @retval RET_SUCCESS Configuration successfully applied + * @retval RET_OUTOFRANGE At least one perameter of out range + * + *****************************************************************************/ +extern RESULT CamerIcIspDpfConfig +( + CamerIcDrvHandle_t handle, + const CamerIcDpfConfig_t *pDpfCfg +); + + + +/*****************************************************************************/ +/** + * @brief This function sets the noise function gains to the CamerIc ISP + * DPF module. + * + * @return Return the result of the function call. + * @retval RET_SUCCESS Configuration successfully applied + * @retval RET_OUTOFRANGE At least one perameter of out range + * @retval RET_NULL_POINTER NULL pointer detected + * + *****************************************************************************/ +extern RESULT CamerIcIspDpfSetNoiseFunctionGain +( + CamerIcDrvHandle_t handle, + const CamerIcGains_t *pNfGains +); + + + +/*****************************************************************************/ +/** + * @brief Programs the given inverse strength to the CamerIc ISP DPF module. + * + * @return Return the result of the function call. + * @retval RET_SUCCESS Configuration successfully applied + * @retval RET_OUTOFRANGE At least one perameter of out range + * @retval RET_NULL_POINTER NULL pointer detected + * + *****************************************************************************/ +extern RESULT CamerIcIspDpfSetStrength +( + CamerIcDrvHandle_t handle, + const CamerIcDpfInvStrength_t *pDpfStrength +); + + + +/*****************************************************************************/ +/** + * @brief Programs the given Noise-Level-Lookup-Table to the CamerIc + * ISP DPF module + * + * @return Return the result of the function call. + * @retval RET_SUCCESS Configuration successfully applied + * @retval RET_OUTOFRANGE At least one perameter of out range + * @retval RET_NULL_POINTER NULL pointer detected + * + *****************************************************************************/ +extern RESULT CamerIcIspDpfSetNoiseLevelLookUp +( + CamerIcDrvHandle_t handle, + const CamerIcDpfNoiseLevelLookUp_t *pDpfNll +); + +extern RESULT CamerIcIspDpfSetFullConfig (CamerIcDrvHandle_t handle, struct isp_dpf_context *dpf); + + +#ifdef __cplusplus +} +#endif + +/* @} cameric_isp_dpf_drv_api */ + +/* @endcond */ + +#endif /* __CAMERIC_ISP_DPF_DRV_API_H__ */ + diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_isp_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_isp_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..e41fe50056f9dfedeaa83ddd5ca34a42821e5143 --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_isp_drv_api.h @@ -0,0 +1,1721 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +#ifndef __CAMERIC_ISP_DRV_API_H__ +#define __CAMERIC_ISP_DRV_API_H__ + +/** + * @file cameric_isp_drv_api.h + * + * @brief This file contains the CamerIC ISP driver API. + * + *****************************************************************************/ +/** + * @if CAMERIC_LITE + * + * @defgroup cameric_isp_drv_api CamerIC ISP lite driver API definitions + * @{ + * + * @image html isp_lite.png "Software ISP-lite driver" width=\textwidth + * @image latex isp_lite.png "Software ISP-lite driver" width=\textwidth + * + * @endif + * + * @if CAMERIC_FULL + * + * @defgroup cameric_isp_drv_api CamerIC ISP driver API definitions + * @{ + * + * @image html isp.png "Software ISP driver" width=\textwidth + * @image latex isp.png "Software ISP driver" width=\textwidth + * + * @endif + * + */ +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + + + +/******************************************************************************/ +/** + * @cond CAMERIC_FULL + * + * @brief This macro defines the number of elements in a gamma-curve. + * + *****************************************************************************/ +#define CAMERIC_ISP_GAMMA_CURVE_SIZE 17 +#define CAMERIC_ISP_GAMMA_RGB_CURVE_SIZE 65 + +/* @endcond */ + + + + +/******************************************************************************/ +/** + * @cond CAMERIC_FULL + * + * @brief Enumeration type to configure the ISP working mode. + * + *****************************************************************************/ +typedef enum CamerIcIspMode_e +{ + CAMERIC_ISP_MODE_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_ISP_MODE_RAW = 1, /**< RAW picture with BT.601 sync (ISP bypass) */ + CAMERIC_ISP_MODE_656 = 2, /**< ITU-R BT.656 (YUV with embedded sync) */ + CAMERIC_ISP_MODE_601 = 3, /**< ITU-R BT.601 (YUV input with H and Vsync signals) */ + CAMERIC_ISP_MODE_BAYER_RGB = 4, /**< Bayer RGB processing with H and Vsync signals */ + CAMERIC_ISP_MODE_DATA = 5, /**< data mode (ISP bypass, sync signals interpreted as data enable) */ + CAMERIC_ISP_MODE_RGB656 = 6, /**< Bayer RGB processing with BT.656 synchronization */ + CAMERIC_ISP_MODE_RAW656 = 7, /**< RAW picture with ITU-R BT.656 synchronization (ISP bypass) */ + CAMERIC_ISP_MODE_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcIspMode_t; +/* @endcond */ + + + +/******************************************************************************/ +/** + * @brief Enumeration type to configure the edge sampling in ISP + * input acquisition. + * + *****************************************************************************/ +typedef enum CamerIcIspSampleEdge_e +{ + CAMERIC_ISP_SAMPLE_EDGE_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_ISP_SAMPLE_EDGE_FALLING = 1, /**< sample falling edga */ + CAMERIC_ISP_SAMPLE_EDGE_RISING = 2, /**< sample rising edge */ + CAMERIC_ISP_SAMPLE_EDGE_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcIspSampleEdge_t; + + + +/******************************************************************************/ +/** + * @brief Enumeration type to configure the vertical and horizontal + * polarity in ISP input acquisition. + * + *****************************************************************************/ +typedef enum CamerIcIspPolarity_e +{ + CAMERIC_ISP_POLARITY_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_ISP_POLARITY_HIGH = 1, /**< high active */ + CAMERIC_ISP_POLARITY_LOW = 2, /**< low active */ + CAMERIC_ISP_POLARITY_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcIspPolarity_t; + + + +/******************************************************************************/ +/** + * @brief Enumeration type to configure the bayer pattern in the ISP + * input acquisition. + * + *****************************************************************************/ +typedef enum CamerIcIspBayerPattern_e +{ + CAMERIC_ISP_BAYER_PATTERN_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_ISP_BAYER_PATTERN_RGRGGBGB = 1, /**< 1st line: RGRG... , 2nd line GBGB... , etc. */ + CAMERIC_ISP_BAYER_PATTERN_GRGRBGBG = 2, /**< 1st line: GRGR... , 2nd line BGBG... , etc. */ + CAMERIC_ISP_BAYER_PATTERN_GBGBRGRG = 3, /**< 1st line: GBGB... , 2nd line RGRG... , etc. */ + CAMERIC_ISP_BAYER_PATTERN_BGBGGRGR = 4, /**< 2st line: BGBG... , 2nd line GRGR... , etc. */ + CAMERIC_ISP_BAYER_PATTERN_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcIspBayerPattern_t; + + + +/******************************************************************************/ +/** + * @brief Enumeration type to configure the color subsampling mode in the + * ISP input acquisition. + * + *****************************************************************************/ +typedef enum CamerIcIspColorSubsampling_e +{ + CAMERIC_ISP_CONV422_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_ISP_CONV422_COSITED = 1, /**< co-sited color subsampling Y0Cb0Cr0 - Y1 */ + CAMERIC_ISP_CONV422_INTERLEAVED = 2, /**< interleaved color subsampling Y0Cb0 - Y1Cr1 (not recommended) */ + CAMERIC_ISP_CONV422_NONCOSITED = 3, /**< non-cosited color subsampling Y0Cb(0+1)/2 - Y1Cr(0+1)/2 */ + CAMERIC_ISP_CONV422_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcIspColorSubsampling_t; + + + +/******************************************************************************/ +/** + * @brief Enumeration type to configure CCIR sequence in the ISP input + * acquisition. + * + *****************************************************************************/ +typedef enum CamerIcIspCCIRSequence_e +{ + CAMERIC_ISP_CCIR_SEQUENCE_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_ISP_CCIR_SEQUENCE_YCbYCr = 1, /**< YCbYCr */ + CAMERIC_ISP_CCIR_SEQUENCE_YCrYCb = 2, /**< YCrYCb */ + CAMERIC_ISP_CCIR_SEQUENCE_CbYCrY = 3, /**< CbYCrY */ + CAMERIC_ISP_CCIR_SEQUENCE_CrYCbY = 4, /**< CrYCbY */ + CAMERIC_ISP_CCIR_SEQUENCE_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcIspCCIRSequence_t; + + +/******************************************************************************/ +/** + * @brief Enumeration type to configure field sampling in the ISP input + * acquisition. + * + *****************************************************************************/ +typedef enum CamerIcIspFieldSelection_e +{ + CAMERIC_ISP_FIELD_SELECTION_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_ISP_FIELD_SELECTION_BOTH = 1, /**< sample all fields (don't care about fields) */ + CAMERIC_ISP_FIELD_SELECTION_EVEN = 2, /**< sample only even fields */ + CAMERIC_ISP_FIELD_SELECTION_ODD = 3, /**< sample only odd fields */ + CAMERIC_ISP_FIELD_SELECTION_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcIspFieldSelection_t; + + + +/******************************************************************************/ +/** + * @brief Enumeration type to configure camera bus width in the CamerIC. + * + *****************************************************************************/ +typedef enum CamerIcIspInputSelection_e +{ + CAMERIC_ISP_INPUT_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_ISP_INPUT_12BIT = 1, /**< 12 Bit input */ + CAMERIC_ISP_INPUT_10BIT_ZZ = 2, /**< 10 Bit input with 2 zereos as LSB's */ + CAMERIC_ISP_INPUT_10BIT_EX = 3, /**< 10 Bit input with 2 MSB's as LSB's */ + CAMERIC_ISP_INPUT_8BIT_ZZ = 4, /**< 8 Bit input with 4 zeroes as LSB's */ + CAMERIC_ISP_INPUT_8BIT_EX = 5, /**< 8 Bit input with 4 MSB's as LSB's */ + CAMERIC_ISP_INPUT_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcIspInputSelection_t; + + + +/******************************************************************************/ +/** + * @brief Enumeration type to configure the input interface selector on + * the CamerIC input (if_select). + * + *****************************************************************************/ +typedef enum CamerIcIspLatencyFifo_e +{ + CAMERIC_ISP_LATENCY_FIFO_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_ISP_LATENCY_FIFO_INPUT_FORMATTER = 1, /**< use input formatter input for latency fifo */ + CAMERIC_ISP_LATENCY_FIFO_DMA_READ = 2, /**< use dma rgb read input for latency fifo */ + CAMERIC_ISP_LATENCY_FIFO_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcIspLatencyFifo_t; + +#ifdef ISP_DPF_RAW +/******************************************************************************/ +/** + * + * @brief Enumeration type to configure the ISP Nano DPF raw working mode. + * + *****************************************************************************/ +typedef enum CamerIcIspDpfRaw_e +{ + CAMERIC_ISP_DPF_RAW_DISABLE = 0, /**< NANO DPF raw diable */ + CAMERIC_ISP_DPF_RAW_ENABLE = 1, /**< NANO DPF raw enable */ + CAMERIC_ISP_DPF_RAW_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcIspDpfRaw_t; + + +#endif + +#ifdef ISP_DVP_PINMAPPING + +/******************************************************************************/ +/** + * @brief Enumeration type to configure the DVP pin mapping input interface selector on + * the Nano version. (DVP_Pin_Mapping) + * + *****************************************************************************/ +typedef enum CamerIcIspDvpPinMapping_e +{ + CAMERIC_ISP_DVP_PIN_MAPPING_12TO12 = 0, /* normal 12-bit external interface */ + CAMERIC_ISP_DVP_PIN_MAPPING_L10TOH10 = 1, /* mapping Low 10 bit to high 10 bits, append 2 zeros as LSBs */ + CAMERIC_ISP_DVP_PIN_MAPPING_L8TOH8 = 2, /* mapping Low 8 bits to high 8bits, append 4 zeros as LSBs */ + CAMERIC_ISP_DVP_PIN_MAPPING_M8TOH8 = 3, /* mapping Middle 8 bits to high 8bits, append 4 zeros as LSBs */ + CAMERIC_ISP_DVP_PIN_MAPPING_MAX /**< upper border (only for an internal evaluation) */ +}CamerIcIspDvpPinMappig_t; +#endif + +/******************************************************************************/ +/** + * @cond CAMERIC_FULL + * + * @brief Enumeration type to configure configure the demosaicing bypass. + * + *****************************************************************************/ +typedef enum CamerIcIspDemosaicBypass_e +{ + CAMERIC_ISP_DEMOSAIC_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_ISP_DEMOSAIC_NORMAL_OPERATION = 1, /**< normal operation for RGB Bayer pattern input */ + CAMERIC_ISP_DEMOSAIC_BYPASS = 2, /**< demosaicing bypass for Black&White input data */ + CAMERIC_ISP_DEMOSAIC_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcIspDemosaicBypass_t; +/* @endcond */ + + + +/******************************************************************************/ +/** + * @cond CAMERIC_FULL + * + * @brief Enumeration type to configure configure the color conversion range. + * + * @note The color conversion unit - also called color space matrix - + * performs a regular RGB to YCbCr 4:4:4 color space conversion. The + * nine coefficients take values between -2 and +1.992. + * + * \arg YCbCr range limited output \n + * Y = c0*R + c1*G + c2*B + 64 \n + * Cb = c3*R + c4*G + c5*B + 512 \n + * Cr = c6*R + c7*G + c8*B + 512 \n + * + * \arg YCbCr full range output \n + * Y = c0*R + c1*G + c2*B \n + * Cb = c3*R + c4*G + c5*B + 512 \n + * Cr = c6*R + c7*G + c8*B + 512 \n + * + *****************************************************************************/ +typedef enum CamerIcColorConversionRange_e +{ + CAMERIC_ISP_CCONV_RANGE_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_ISP_CCONV_RANGE_LIMITED_RANGE = 1, /**< YCbCr range limited output according to ITU-R BT.601 standard */ + CAMERIC_ISP_CCONV_RANGE_FULL_RANGE = 2, /**< YCbCr full range output */ + CAMERIC_ISP_CCONV_RANGE_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcColorConversionRange_t; +/* @endcond */ + + + +/******************************************************************************/ +/** + * @cond CAMERIC_FULL + * + * @brief A structure to represent a gamma-curve. + * + *****************************************************************************/ +typedef struct CamerIcGammaCurve_s +{ + uint16_t GammaY[CAMERIC_ISP_GAMMA_CURVE_SIZE]; /**< array of y coordinates */ +} CamerIcIspGammaCurve_t; +/* @endcond */ + + + +/******************************************************************************/ +/** + * @cond CAMERIC_FULL + * + * @brief Enumeration type to configure the gamma curve segementation. + * + *****************************************************************************/ +typedef enum CamerIcIspGammaSegmentationMode_e +{ + CAMERIC_ISP_SEGMENTATION_MODE_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_ISP_SEGMENTATION_MODE_LOGARITHMIC = 1, /**< logarithmic segmentation from 0 to 4095 + (64,64,64,64,128,128,128,128,256,256,256,512,512,512,512,512) */ + CAMERIC_ISP_SEGMENTATION_MODE_EQUIDISTANT = 2, /**< equidistant segmentation from 0 to 4095 + (256, 256, ... ) */ + CAMERIC_ISP_SEGMENTATION_MODE_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcIspGammaSegmentationMode_t; +/* @endcond */ + + +/******************************************************************************/ +/** + * @cond CAMERIC_FULL + * + * @brief Enumeration of TPG picture type. + * + *****************************************************************************/ +typedef enum CamerIcISPTpgImageType_e +{ + CAMERIC_ISP_TPG_IMAGE_TYPE_3X3COLORBLOCK = 0, /**< 3 x 3 color block */ + CAMERIC_ISP_TPG_IMAGE_TYPE_COLORBAR = 1, /**< color bar */ + CAMERIC_ISP_TPG_IMAGE_TYPE_GRAYBAR = 2, /**< gray bar */ + CAMERIC_ISP_TPG_IMAGE_TYPE_GRID = 3, /**< highlighted grid */ + CAMERIC_ISP_TPG_IMAGE_TYPE_RANDOM = 4, /**< random data */ + + CAMERIC_ISP_TPG_IMAGE_TYPE_MAX +} CamerIcISPTpgImageType_t; +/* @endcond */ + + +/******************************************************************************/ +/** + * @brief Enumeration type to configure the bayer pattern in the TPG + * + *****************************************************************************/ +typedef enum CamerIcIspTpgBayerPattern_e +{ + CAMERIC_ISP_TPG_BAYER_PATTERN_RGGB = 0, /**< 1st line: RGRG... , 2nd line GBGB... , etc. */ + CAMERIC_ISP_TPG_BAYER_PATTERN_GRBG = 1, /**< 1st line: GRGR... , 2nd line BGBG... , etc. */ + CAMERIC_ISP_TPG_BAYER_PATTERN_GBRG = 2, /**< 1st line: GBGB... , 2nd line RGRG... , etc. */ + CAMERIC_ISP_TPG_BAYER_PATTERN_BGGR = 3, /**< 2st line: BGBG... , 2nd line GRGR... , etc. */ + + CAMERIC_ISP_TPG_BAYER_PATTERN_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcIspTpgBayerPattern_t; +/* @endcond */ + + +/******************************************************************************/ +/** + * @brief Enumeration of data width of TPG. + * + *****************************************************************************/ +typedef enum CamerIcIspTpgColorDepth_e +{ + CAMERIC_ISP_TPG_8BIT = 0, /**< 8 Bit output */ + CAMERIC_ISP_TPG_10BIT = 1, /**< 10 Bit output */ + CAMERIC_ISP_TPG_12BIT = 2, /**< 12 Bit output */ + +} CamerIcIspTpgColorDepth_t; +/* @endcond */ + + +/******************************************************************************/ +/** + * @brief Enumeration of TPG resolution. + * + *****************************************************************************/ +typedef enum CamerIcIspTpgResolution_e +{ + CAMERIC_ISP_TPG_1080P = 0, /**< 1920 x 1080 */ + CAMERIC_ISP_TPG_720P = 1, /**< 1280 x 720 */ + CAMERIC_ISP_TPG_4K = 2, /**< 3840 x 2160 */ + CAMERIC_ISP_TPG_USER_DEFINED = 3, /**< user defined */ + +} CamerIcIspTpgResolution_t; +/* @endcond */ + +typedef enum DumpTypeShift_s { + DUMP_HIST_SHIFT = 0, + DUMP_EXPM_SHIFT = 1, + DUMP_WBM_SHIFT = 2, + DUMP_AFM_SHIFT = 3, + DUMP_VSM_SHIFT = 4, + DUMP_AEV2_SHIFT =5, + DUMP_HIST64_SHIFT = 6, + + DUMP_TYPE_MAX, +} DumpTypeShift_t; + + +/******************************************************************************/ +/** + * @brief Stucture of TPG user defined mode. + * + *****************************************************************************/ +typedef struct CamerIcIspTpgUserDefineMode_s +{ + struct + { + uint16_t total; + uint16_t fp; + uint16_t syncHeaderWidth; + uint16_t bp; + uint16_t act; + }H,V; + +} CamerIcIspTpgUserDefineMode_t; +/* @endcond */ + + +/******************************************************************************/ +/** + * @brief Stucture of TPG configuration. + * + *****************************************************************************/ +typedef struct CamerIcIspTpgConfig_s +{ + CamerIcISPTpgImageType_t imageType; + CamerIcIspTpgBayerPattern_t bayerPattern; + CamerIcIspTpgColorDepth_t colorDepth; + CamerIcIspTpgResolution_t resolution; + + uint16_t pixleGap; // image 0 (3x3 block) + uint16_t lineGap; // image 0 (3x3 block) + uint16_t gapStandard; // image 1, 2, 3. + uint32_t randomSeed; // image 4 + uint32_t frame_num; + + CamerIcIspTpgUserDefineMode_t userMode; + +} CamerIcIspTpgConfig_t; + + +/******************************************************************************/ +/** + * @brief Stucture of DigitalGain configuration. + * + *****************************************************************************/ +typedef struct CamerIcIspDigitalGainConfig_s { + bool enable; + uint16_t gainR; + uint16_t gainB; + uint16_t gainGr; + uint32_t gainGb; + +} CamerIcIspDigitalGainConfig_t; + +/* @endcond */ + +/******************************************************************************/ +/** + * @brief Enumeration type to configure the format + * + *****************************************************************************/ +typedef enum CamerIcIspDecFormat_e +{ + CAMERIC_ISP_DEC_FORMAT_ARGB8 = 0 , + CAMERIC_ISP_DEC_FORMAT_XRGB8 = 1 , + CAMERIC_ISP_DEC_FORMAT_AYUV8 = 2 , + CAMERIC_ISP_DEC_FORMAT_UYVY = 3 , + CAMERIC_ISP_DEC_FORMAT_YUY2 = 4 , + CAMERIC_ISP_DEC_FORMAT_SINGLE_Y_U_V = 5 , + CAMERIC_ISP_DEC_FORMAT_UV_MIX = 6 , + CAMERIC_ISP_DEC_FORMAT_ARGB4 = 7 , + CAMERIC_ISP_DEC_FORMAT_XRGB4 = 8 , + CAMERIC_ISP_DEC_FORMAT_ARGB1555 = 9 , + CAMERIC_ISP_DEC_FORMAT_XRGB1555 = 10, + CAMERIC_ISP_DEC_FORMAT_RGB565 = 11, + CAMERIC_ISP_DEC_FORMAT_Z24S8 = 12, + CAMERIC_ISP_DEC_FORMAT_Z24 = 13, + CAMERIC_ISP_DEC_FORMAT_Z16 = 14, + CAMERIC_ISP_DEC_FORMAT_A2RGB10 = 15, //Y410 + CAMERIC_ISP_DEC_FORMAT_BAYER = 16, + CAMERIC_ISP_DEC_FORMAT_FLOAT16 = 17, + CAMERIC_ISP_DEC_FORMAT_COEFFICIENT = 18, + CAMERIC_ISP_DEC_FORMAT_ARGB16 = 19, // Y416 + CAMERIC_ISP_DEC_FORMAT_Y216 = 20, + CAMERIC_ISP_DEC_FORMAT_X2RGB10 = 21, + CAMERIC_ISP_DEC_FORMAT_G2_Y = 22, + CAMERIC_ISP_DEC_FORMAT_G2_UV = 23, + CAMERIC_ISP_DEC_FORMAT_MAX +}CamerIcIspDecFormat_t; + +/******************************************************************************/ +/** + * @brief Enumeration type to configure the Bit Depth + * + *****************************************************************************/ +typedef enum CamerIcIspDecBitDepth_e +{ + CAMERIC_ISP_DEC_BIT_DEPTH_8_BIT = 0, + CAMERIC_ISP_DEC_BIT_DEPTH_10_BIT = 1, + CAMERIC_ISP_DEC_BIT_DEPTH_12_BIT = 2, + CAMERIC_ISP_DEC_BIT_DEPTH_14_BIT = 3, + CAMERIC_ISP_DEC_BIT_DEPTH_16_BIT = 4, + CAMERIC_ISP_DEC_BIT_DEPTH_MAX +}CamerIcIspDecBitDepth_t; + +/******************************************************************************/ +/** + * @brief Enumeration type to configure the Tile Mode + * + *****************************************************************************/ +typedef enum CamerIcIspDecTileMode_e +{ + CAMERIC_ISP_DEC_TILE_MODE_8x8_X_MAJOR = 0, + CAMERIC_ISP_DEC_TILE_MODE_8x8_Y_MAJOR = 1, + CAMERIC_ISP_DEC_TILE_MODE_16x4 = 2, + CAMERIC_ISP_DEC_TILE_MODE_8x4 = 3, + CAMERIC_ISP_DEC_TILE_MODE_4x8 = 4, + CAMERIC_ISP_DEC_TILE_MODE_4x4 = 5, + CAMERIC_ISP_DEC_TILE_MODE_16x4_RASTER = 6, + CAMERIC_ISP_DEC_TILE_MODE_64x4 = 7, + CAMERIC_ISP_DEC_TILE_MODE_32x4 = 8, + CAMERIC_ISP_DEC_TILE_MODE_256x1_RASTER = 9, + CAMERIC_ISP_DEC_TILE_MODE_128x1_RASTER = 10, + CAMERIC_ISP_DEC_TILE_MODE_64x4_RASTER = 11, + CAMERIC_ISP_DEC_TILE_MODE_256x2_RASTER = 12, + CAMERIC_ISP_DEC_TILE_MODE_128x2_RASTER = 13, + CAMERIC_ISP_DEC_TILE_MODE_128x4_RASTER = 14, + CAMERIC_ISP_DEC_TILE_MODE_64x1_RASTER = 15, + CAMERIC_ISP_DEC_TILE_MODE_16x8 = 16, + CAMERIC_ISP_DEC_TILE_MODE_8x16 = 17, + CAMERIC_ISP_DEC_TILE_MODE_512x1_RASTER = 18, + CAMERIC_ISP_DEC_TILE_MODE_32x4_RASTER = 19, + CAMERIC_ISP_DEC_TILE_MODE_64x2_RASTER = 20, + CAMERIC_ISP_DEC_TILE_MODE_32x2_RASTER = 21, + CAMERIC_ISP_DEC_TILE_MODE_32x1_RASTER = 22, + CAMERIC_ISP_DEC_TILE_MODE_16x1_RASTER = 23, + CAMERIC_ISP_DEC_TILE_MODE_128x4 = 24, + CAMERIC_ISP_DEC_TILE_MODE_256x4 = 25, + CAMERIC_ISP_DEC_TILE_MODE_512x4 = 26, + CAMERIC_ISP_DEC_TILE_MODE_16x16 = 27, + CAMERIC_ISP_DEC_TILE_MODE_32x16 = 28, + CAMERIC_ISP_DEC_TILE_MODE_64x16 = 29, + CAMERIC_ISP_DEC_TILE_MODE_128x8 = 30, + CAMERIC_ISP_DEC_TILE_MODE_8x4S = 31, + CAMERIC_ISP_DEC_TILE_MODE_16x4S = 32, + CAMERIC_ISP_DEC_TILE_MODE_TILEYF_128B = 33, + CAMERIC_ISP_DEC_TILE_MODE_TILEYF_256B = 34, + CAMERIC_ISP_DEC_TILE_MODE_MAX, + CAMERIC_ISP_DEC_TILE_MODE_UNDEFINED = -1 +}CamerIcIspDecTileMode_t; + +/******************************************************************************/ +/** + * @brief Enumeration type to configure the Align Size + * + *****************************************************************************/ +typedef enum CamerIcIspDecAlignMode_e +{ + CAMERIC_ISP_DEC_ALIGN_SIZE_1_BYTE = 0, + CAMERIC_ISP_DEC_ALIGN_SIZE_16_BYTE = 1, + CAMERIC_ISP_DEC_ALIGN_SIZE_32_BYTE = 2, + CAMERIC_ISP_DEC_ALIGN_SIZE_64_BYTE = 3, + CAMERIC_ISP_DEC_ALIGN_SIZE_256_BYTE = 4, + CAMERIC_ISP_DEC_ALIGN_SIZE_512_BYTE = 5, + CAMERIC_ISP_DEC_ALIGN_SIZE_MAX +}CamerIcIspDecAlignMode_t; + +/******************************************************************************/ +/** + * @brief Stucture of DEC control. + * + *****************************************************************************/ +typedef struct CamerIcIspDecControl_s +{ + bool_t disableRamClockGating; + bool_t disableModuleClockGating; + bool_t disableCompression; + bool_t disableDebugRegisters; + bool_t disableCachePrefetch; + bool_t disableDCache; + +} CamerIcIspDecControl_t; + +/******************************************************************************/ +/** + * @brief Stucture of DEC control_ex. + * + *****************************************************************************/ +typedef struct CamerIcIspDecControl_ex_s +{ + bool_t enableEndAddressRangeCheck; + bool_t writeMissPolicy; + bool_t readMissPolicy; + +} CamerIcIspDecControl_ex_t; + +/******************************************************************************/ +/** + * @brief Stucture of DEC control_ex2. + * + *****************************************************************************/ +typedef struct CamerIcIspDecControl_ex2_s +{ + uint8_t tileStatusReadId; + uint8_t tileStatusWriteId; + +} CamerIcIspDecControl_ex2_t; + +/******************************************************************************/ +/** + * @brief Stucture of DEC write configuration. + * + *****************************************************************************/ +typedef struct CamerIcIspDecWriteConfig_s +{ + bool_t enable; + CamerIcIspDecFormat_t format; + CamerIcIspDecAlignMode_t alignMode; + CamerIcIspDecTileMode_t tileMode; + + +} CamerIcIspDecWriteConfig_t; + +/******************************************************************************/ +/** + * @brief Stucture of DEC write configuration ex. + * + *****************************************************************************/ +typedef struct CamerIcIspDecWriteExConfig_s +{ + CamerIcIspDecBitDepth_t bitDepth; + +} CamerIcIspDecWriteExConfig_t; + +/******************************************************************************/ +/** + * @brief Stucture of DEC read configuration. + * + *****************************************************************************/ +typedef struct CamerIcIspDecReadConfig_s +{ + bool_t enable; + CamerIcIspDecFormat_t format; + CamerIcIspDecAlignMode_t alignMode; + CamerIcIspDecTileMode_t tileMode; + + +} CamerIcIspDecReadConfig_t; + +/******************************************************************************/ +/** + * @brief Stucture of DEC read configuration ex. + * + *****************************************************************************/ +typedef struct CamerIcIspDecReadExConfig_s +{ + CamerIcIspDecBitDepth_t bitDepth; + +} CamerIcIspDecReadExConfig_t; +/* @endcond */ + + +/*****************************************************************************/ +/** + * @brief This function registers a Request-Callback at the CamerIC ISP + * Module. A request callback is called if the driver needs an + * interaction from the application layer (i.e. a new data buffer + * to fill, please also @ref CamerIcRequestId_e). + * + * @param handle CamerIC driver handle + * @param func Callback function + * @param pUserContext User-Context + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_BUSY already a callback registered + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_INVALID_PARM a parameter is invalid + * @retval RET_WRONG_STATE driver is in wrong state to register a + * request callback + * + *****************************************************************************/ +extern RESULT CamerIcIspRegisterRequestCb +( + CamerIcDrvHandle_t handle, + CamerIcRequestFunc_t func, + void *pUserContext +); + + + +/*****************************************************************************/ +/** + * @brief This functions deregisters/releases a registered Request-Callback + * at CamerIc ISP Module. + * + * @param handle CamerIC driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to deregister the + * request callback + * + *****************************************************************************/ +extern RESULT CamerIcIspDeRegisterRequestCb +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This functions registers an Event-Callback at CamerIC ISP + * Module. An event callback is called if the driver needs to + * inform the application layer about an asynchronous event or + * an error situation (see @ref CamerIcEventId_e). + * + * @param handle CamerIC driver handle + * @param func Callback function + * @param pUserContext User-Context + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_BUSY already a callback registered + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_INVALID_PARM a parameter is invalid + * @retval RET_WRONG_STATE driver is in wrong state to register a + * event callback (maybe the driver is already running) + * + *****************************************************************************/ +extern RESULT CamerIcIspRegisterEventCb +( + CamerIcDrvHandle_t handle, + CamerIcEventFunc_t func, + void *pUserContext +); + + + +/*****************************************************************************/ +/** + * @brief This functions deregisters/releases a registered Event-Callback + * at CamerIC ISP Module. + * + * @param handle CamerIC driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to deregister the + * event callback (maybe the driver is still running) + * + *****************************************************************************/ +extern RESULT CamerIcIspDeRegisterEventCb +( + CamerIcDrvHandle_t handle +); + +/*****************************************************************************/ +/** + * @brief This function will enable CamerIC ISP Module. + * + * @param handle CamerIC driver handle + * + * @return Return the result of the function call. + * @retval true operation succeded + * @retval false operation failed + * + *****************************************************************************/ +extern bool CamerIcIsIspEnable +( + CamerIcDrvHandle_t handle +); + +/*****************************************************************************/ +/** + * @cond CAMERIC_FULL + * + * @brief This function configures the ISP working mode. + * + * @param handle CamerIC driver handle + * @param mode new working mode + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to configure working + * mode (maybe the driver is already running) + * @retval RET_NOTSUPP selected working mode is not supported + * + *****************************************************************************/ +extern RESULT CamerIcIspSetMode +( + CamerIcDrvHandle_t handle, + const CamerIcIspMode_t mode +); +/* @endcond */ + +/*****************************************************************************/ +/** + * @brief This function configures the CamerIC ISP input acquisition module. + * + * @param handle CamerIC driver handle + * @param tpg_enable tpg enable flag + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * + *****************************************************************************/ +RESULT CamerIcIspSetTpgBypass +( + CamerIcDrvHandle_t handle, + uint32_t tpg_enable +); + +/*****************************************************************************/ +/** + * @brief This function configures the CamerIC ISP Mcm write0 . + * + * @param handle CamerIC driver handle + * @param width mcm write0 width + * @param height mcm write0 height + * @param format mcm write0 format + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * + *****************************************************************************/ +RESULT CamerIcIspCfgMcmWr0 +( + CamerIcDrvHandle_t handle, + uint16_t width, + uint16_t height, + uint16_t format +); + +/*****************************************************************************/ +/** + * @brief This function configures the CamerIC ISP Mcm write1 . + * + * @param handle CamerIC driver handle + * @param width mcm write1 width + * @param height mcm write1 height + * @param format mcm write1 format + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * + *****************************************************************************/ +RESULT CamerIcIspCfgMcmWr1 +( + CamerIcDrvHandle_t handle, + uint16_t width, + uint16_t height, + uint16_t format +); + +/*****************************************************************************/ +/** + * @brief This function configures the CamerIC ISP Mcm g2 channel write0 . + * + * @param handle CamerIC driver handle + * @param width mcm g2 channel write0 width + * @param height mcm g2 channel write0 height + * @param format mcm g2 channel write0 format + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * + *****************************************************************************/ +RESULT CamerIcIspCfgMcmG2Wr0 +( + CamerIcDrvHandle_t handle, + uint16_t width, + uint16_t height, + uint16_t format +); + +/*****************************************************************************/ +/** + * @brief This function configures the CamerIC ISP Mcm g2 channel write1 . + * + * @param handle CamerIC driver handle + * @param width mcm g2 channel write1 width + * @param height mcm g2 channel write1 height + * @param format mcm g2 channel write1 format + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * + *****************************************************************************/ +RESULT CamerIcIspCfgMcmG2Wr1 +( + CamerIcDrvHandle_t handle, + uint16_t width, + uint16_t height, + uint16_t format +); + +/*****************************************************************************/ +/** + * @brief This function configures the CamerIC ISP Mcm rd format . + * + * @param handle CamerIC driver handle + * @param format mcm rd format + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * + *****************************************************************************/ +RESULT CamerIcIspSetMcmRdFmt +( + CamerIcDrvHandle_t handle, + uint16_t format +); + +/*****************************************************************************/ +/** + * @brief This function configures the CamerIC ISP Mcm bypass sensor switch . + * + * @param handle CamerIC driver handle + * @param bypassSwitch Bypass switch + 0000: sensor0 bypass + 0001: sensor1 bypass + … + 1111: sensor15 bypass if any + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * + *****************************************************************************/ +RESULT CamerIcIspSetMcmBypassSwitch +( + CamerIcDrvHandle_t handle, + uint8_t bypassSwitch +); + +/*****************************************************************************/ +/** + * @brief This function configures the CamerIC ISP input acquisition module. + * + * @param handle CamerIC driver handle + * @param enable mcm bypass enable + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * + *****************************************************************************/ +RESULT CamerIcIspSetMcmBypass +( + CamerIcDrvHandle_t handle, + uint32_t enable +); + + +/*****************************************************************************/ +/** + * @brief This function configures the CamerIC ISP input acquisition module. + * + * @param handle CamerIC driver handle + * @param sampleEdge sample edge (@ref CamerIcIspSampleEdge_e) + * @param hSyncPol horizontal sync polarity (@ref CamerIcIspPolarity_e) + * @param vSyncPol vertical sync polarity (@ref CamerIcIspPolarity_e) + * @param bayerPattern bayer pattern (@ref CamerIcIspBayerPattern_e) + * @param subSampling color subsampling mode (@ref CamerIcIspColorSubsampling_e) + * @param seqCCIR CCIR output sequence (@ref CamerIcIspCCIRSequence_e) + * @param fieldSelection field sampling (@ref CamerIcIspFieldSelection_e) + * @param inputSelection input format (@ref CamerIcIspInputSelection_e) + * @param latencyFifo latency fifo input (@ref CamerIcIspLatencyFifo_e) + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to configure working + * mode (maybe the driver is already running) + * @retval RET_NOTSUPP a configuration is not supported + * + *****************************************************************************/ +extern RESULT CamerIcIspSetAcqProperties +( + CamerIcDrvHandle_t handle, + const CamerIcIspSampleEdge_t sampleEdge, + const CamerIcIspPolarity_t hSyncPol, + const CamerIcIspPolarity_t vSyncPol, + const CamerIcIspBayerPattern_t bayerPattern, + const CamerIcIspColorSubsampling_t subSampling, + const CamerIcIspCCIRSequence_t seqCCIR, + const CamerIcIspFieldSelection_t fieldSelection, + const CamerIcIspInputSelection_t inputSelection, + const CamerIcIspLatencyFifo_t latencyFifo, + const uint32_t stitchingMode +); + +#ifdef ISP_DPF_RAW + +/*****************************************************************************/ +/** + * @brief This function configures the ISP DPF raw out mode. + * + * @param handle CamerIC driver handle + * @param mode DPF raw out control + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to configure working + * mode (maybe the driver is already running) + * @retval RET_NOTSUPP selected working mode is not supported + * + *****************************************************************************/ +extern RESULT CamerIcIspDpfRawCtrlNano +( + CamerIcDrvHandle_t handle, + const CamerIcIspDpfRaw_t mode +); + +#endif + +#ifdef ISP_DVP_PINMAPPING +/*****************************************************************************/ +/** + * @brief This function configures the CamerIC ISP input acquisition module for Nano specific controls + * + * @param handle CamerIC driver handle + * @param dvpPinMapping Dvp pin mapping input (@ref CamerIcIspDvpPinMappig_t) + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to configure working + * mode (maybe the driver is already running) + * @retval RET_NOTSUPP a configuration is not supported + * + *****************************************************************************/ +extern RESULT CamerIcIspSetAcqPropertiesNano +( + CamerIcDrvHandle_t handle, + const CamerIcIspDvpPinMappig_t dvpPinMapping +); + +/*****************************************************************************/ +/** + * @brief Dump function for the CamerIC ISP input acquisition acq registers for Nano specific controls + * + * @param handle CamerIC driver handle + * @param const char * dump_name + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to configure working + * mode (maybe the driver is already running) + * @retval RET_NOTSUPP a configuration is not supported + * + *****************************************************************************/ +extern RESULT CamerIcIspDumpAcqPropNanoData +( + CamerIcDrvHandle_t handle, + const char * dump_name +); +#endif + + +/*****************************************************************************/ +/** + * @brief This function configures the CamerIC ISP input resolution. + * + * @note It's possible to crop the image by using a smaller resolution. + * + * @param handle CamerIC driver handle + * @param hOffset horizontal offset + * @param vOffset vertical offset + * @param height height + * @param width width + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to change the input + * window (maybe the driver is already running) + * + *****************************************************************************/ +extern RESULT CamerIcIspSetAcqResolution +( + CamerIcDrvHandle_t handle, + const uint16_t hOffset, + const uint16_t vOffset, + const uint16_t width, + const uint16_t height +); + + + +/*****************************************************************************/ +/** + * @brief This function configures the CamerIC ISP output formatter window. + * + * @param handle CamerIC driver handle + * @param hOffset horizontal offset + * @param vOffset vertical offset + * @param height height + * @param width width + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to change the output + * window (maybe the driver is already running) + * + *****************************************************************************/ +extern RESULT CamerIcIspSetOutputFormatterResolution +( + CamerIcDrvHandle_t handle, + const uint16_t hOffset, + const uint16_t vOffset, + const uint16_t width, + const uint16_t height +); + + + +/*****************************************************************************/ +/** + * @cond CAMERIC_FULL + * + * @brief This function sets CamerIc ISP image stabilization output window. + * + * @param handle CamerIc driver handle + * @param hOffset horizontal offset + * @param vOffset vertical offset + * @param height height + * @param width width + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to change the image + * stabilization outpu window (maybe the driver + * is already running) + * + *****************************************************************************/ +extern RESULT CamerIcIspSetImageStabilizationResolution +( + CamerIcDrvHandle_t handle, + const uint16_t hOffset, + const uint16_t vOffset, + const uint16_t width, + const uint16_t height +); +/* @endcond */ + + +/*****************************************************************************/ +/** + * @cond CAMERIC_FULL + * + * @brief This function sets the demosaicing working mode and threshold. + * + * @param handle CamerIc driver handle + * @param pBypassMode Bypass mode + * @param pThreshold Demosaicing threshold + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to change the + * demosaicing mode or demosaiing threshold + * (maybe the driver is already running) + * @retval RET_NOTSUPP demosaicing mode is not supported + * + *****************************************************************************/ +extern RESULT CamerIcIspGetDemosaic +( + CamerIcDrvHandle_t handle, + CamerIcIspDemosaicBypass_t *pBypassMode, + uint8_t *pThreshold +); +/* @endcond */ + + +/*****************************************************************************/ +/** + * @cond CAMERIC_FULL + * + * @brief This function sets the demosaicing working mode and threshold. + * + * @param handle CamerIc driver handle + * @param BypassMode bypass mode to set + * @param Threshold Demosaicing threshold to set + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to change the + * demosaicing mode or demosaiing threshold + * (maybe the driver is already running) + * @retval RET_NOTSUPP demosaicing mode is not supported + * + *****************************************************************************/ +extern RESULT CamerIcIspSetDemosaic +( + CamerIcDrvHandle_t handle, + const CamerIcIspDemosaicBypass_t BypassMode, + const uint8_t Threshold +); +/* @endcond */ + + + +/*****************************************************************************/ +/** + * @cond CAMERIC_FULL + * + * @brief This function sets the color conversion range. + * + * @note The color conversion unit - also called color space matrix - + * performs a regular RGB to YCbCr 4:4:4 color space conversion. The + * nine coefficients take values between -2 and +1.992. + * + * \arg YCbCr range limited output \n + * Y = c0*R + c1*G + c2*B + 64 \n + * Cb = c3*R + c4*G + c5*B + 512 \n + * Cr = c6*R + c7*G + c8*B + 512 \n + * + * \arg YCbCr full range output \n + * Y = c0*R + c1*G + c2*B \n + * Cb = c3*R + c4*G + c5*B + 512 \n + * Cr = c6*R + c7*G + c8*B + 512 \n + * + * \arg default matrix \n + * ( 0x021 0x040 0x00D ) ( \n + * ( 0x1ED 0x1DB 0x038 ) = ( \n + * ( 0x038 0x1D1 0x1F7 ) ( \n + * + * @param handle CamerIc driver handle + * @param YConvRange luminance conversion range + * @param CrConvRange chrominance conversion range + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to change the color + * conversion matrix (maybe the driver is already + * running) + * @retval RET_NOTSUPP conversion range is not supported + * + *****************************************************************************/ +extern RESULT CamerIcIspSetColorConversionRange +( + CamerIcDrvHandle_t handle, + const CamerIcColorConversionRange_t YConvRange, + const CamerIcColorConversionRange_t CrConvRange +); +/* @endcond */ + + + +/*****************************************************************************/ +/** + * @cond CAMERIC_FULL + * + * @brief This function returns the currently configured color conversion + * coefficients. + * + * @param handle CamerIc driver handle + * @param pCConvCoefficients storage class for color conversion coefficients + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to change the color + * conversion matrix (maybe the driver is not + * initialized) + * + *****************************************************************************/ +extern RESULT CamerIcIspGetColorConversionCoefficients +( + CamerIcDrvHandle_t handle, + CamerIc3x3FloatMatrix_t *pCConvCoefficients +); +/* @endcond */ + + + +/*****************************************************************************/ +/** + * @cond CAMERIC_FULL + * + * @brief This function sets the color conversion coefficients. + * + * @param handle CamerIc driver handle + * @param pCConvCoefficients Color conversion coefficients to set + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to change the color + * conversion matrix (maybe the driver is already + * running) + * + * @endif + * + *****************************************************************************/ +extern RESULT CamerIcIspSetColorConversionCoefficients +( + CamerIcDrvHandle_t handle, + const CamerIc3x3FloatMatrix_t *pCConvCoefficients +); +/* @endcond */ + + + +/*****************************************************************************/ +/** + * @cond CAMERIC_FULL + * + * @brief This function returns the currently configured cross-talk + * coefficients. + * + * @param handle CamerIc driver handle + * @param pCTalkCoefficients Cross-talk coefficients + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to read the cross + * talk matrix (maybe the driver is not initialized) + * @retval RET_INVALID_PARM invalid parameter + * + * @endif + * + *****************************************************************************/ +extern RESULT CamerIcIspGetCrossTalkCoefficients +( + CamerIcDrvHandle_t handle, + CamerIc3x3Matrix_t *pCTalkCoefficients +); +/* @endcond */ + + + +/*****************************************************************************/ +/** + * @cond CAMERIC_FULL + * + * @brief This functions sets the cross-talk coefficients. + * + * @param handle CamerIc driver handle + * @param pCTalkCoefficients Cross-talk coefficients + * + * @return Return the result of the function call. + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to read the cross + * talk matrix (maybe the driver is not initialized) + * + *****************************************************************************/ +extern RESULT CamerIcIspSetCrossTalkCoefficients +( + CamerIcDrvHandle_t handle, + const CamerIc3x3Matrix_t *pCTalkCoefficients +); +/* @endcond */ + + + +/*****************************************************************************/ +/** + * @cond CAMERIC_FULL + * + * @brief This function returns the currently configured cross-talk + * offsets. + * + * @param handle CamerIc driver handle + * @param pCrossTalkOffset Cross-talk offsets + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to read the cross + * talk matrix (maybe the driver is not initialized) + * @retval RET_INVALID_PARM invalid parameter + * + * @endif + * + *****************************************************************************/ +extern RESULT CamerIcIspGetCrossTalkOffset +( + CamerIcDrvHandle_t handle, + CamerIcXTalkOffset_t *pCrossTalkOffset +); +/* @endcond */ + + + +/*****************************************************************************/ +/** + * @cond CAMERIC_FULL + * + * @brief This functions sets the cross-talk offsets. + * + * @param handle CamerIc driver handle + * @param pCrossTalkOffset Cross-talk offsets + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to set the cross + * talk offsets (maybe the driver is already + * running) + * + *****************************************************************************/ +extern RESULT CamerIcIspSetCrossTalkOffset +( + CamerIcDrvHandle_t handle, + const CamerIcXTalkOffset_t *pCrossTalkOffset +); +/* @endcond */ + + + +/*****************************************************************************/ +/** + * @cond CAMERIC_FULL + * + * @brief This functions enables or disables the ISP AWB module. + * + * @param handle CamerIc driver handle + * @param enable BOOL_TRUE enables ISP AWB module, + * BOOL_FALSE bypass the ISP AWB module + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to enable or disable + * AWB module + * + *****************************************************************************/ +extern RESULT CamerIcIspActivateWB +( + CamerIcDrvHandle_t handle, + const bool_t enable +); +/* @endcond */ + + + +/*****************************************************************************/ +/** + * @cond CAMERIC_FULL + * + * @brief This functions returns wether the ISP AWB module is enable or not. + * + * @param handle CamerIc driver handle + * @param pIsEnabled Pointer to value to store current ISP AWB state + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to read AWB state + * (maybe driver not initialized) + * @retval RET_INVALID_PARM invalid parameter + * + *****************************************************************************/ +extern RESULT CamerIcIspIsWBActivated +( + CamerIcDrvHandle_t handle, + bool_t *pIsEnabled +); +/* @endcond */ + + +/*****************************************************************************/ +/** + * @cond CAMERIC_FULL + * + * @brief This function eanbles the gamma-out correction. + * + * @param handle CamerIc driver handle + * @param enable BOOL_TRUE to enable, BOOL_FALSE to disable + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to switch gamma-out + * + *****************************************************************************/ +extern RESULT CamerIcIspGammaOutEnable +( + CamerIcDrvHandle_t handle +); +/* @endcond */ + + +/*****************************************************************************/ +/** + * @cond CAMERIC_FULL + * + * @brief This function disables the gamma-out correction. + * + * @param handle CamerIc driver handle + * @param enable BOOL_TRUE to enable, BOOL_FALSE to disable + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to switch gamma-out + * + *****************************************************************************/ +extern RESULT CamerIcIspGammaOutDisable +( + CamerIcDrvHandle_t handle +); +/* @endcond */ + +/*****************************************************************************/ +/** + * @cond CAMERIC_FULL + * + * @brief This function eanbles/disables the gamma-out correction. + * + * @param handle CamerIc driver handle + * @param enable BOOL_TRUE to enable, BOOL_FALSE to disable + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to switch gamma-out + * + *****************************************************************************/ +extern RESULT CamerIcIspActivateGammaOut +( + CamerIcDrvHandle_t handle, + const bool_t enable +); +/* @endcond */ + + + +/*****************************************************************************/ +/** + * @cond CAMERIC_FULL + * + * @brief This function returns the gamma-out status. + * + * @param handle CamerIc driver handle + * @param pIsEnabled Pointer to value to store current gamma-out + * state + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to read gamma-out + * status + * @retval RET_INVALID_PARM invalid parameter + * + *****************************************************************************/ +extern RESULT CamerIcIspIsGammaOutActivated +( + CamerIcDrvHandle_t handle, + bool_t *pIsEnabled +); +/* @endcond */ + + + +/*****************************************************************************/ +/** + * @cond CAMERIC_FULL + * + * @brief This function sets a gamma out curve. + * + * @param handle CamerIc driver handle + * @param mode segmentation of the x-axis + * (@ref CamerIcIspGammaSegmentationMode_e) + * @param pCurve pointer to a gamma-out curve + * (@ref CamerIcGammaCurve_s) + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to read gamma-out + * status + * @retval RET_INVALID_PARM invalid parameter + * + *****************************************************************************/ +extern RESULT CamerIcIspSetGammOutCurve +( + CamerIcDrvHandle_t handle, + const CamerIcIspGammaSegmentationMode_t mode, + const CamerIcIspGammaCurve_t *pCurve +); +/* @endcond */ + + + +/*****************************************************************************/ +/** + * @cond CAMERIC_FULL + * + * @brief This function dumps measure to file. + * + * @param handle CamerIc driver handle + * @param dump_name File name of dump + * @param dump_hism hist measure data dump enable + * @param dump_expm exp measure data dump enable + * @param dump_wbm wb measure data dump enable + + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to read gamma-out + * status + * @retval RET_INVALID_PARM invalid parameter + * + *****************************************************************************/ + +/****************************************************************************** + * CamerIcIspDumpMeasureData() + *****************************************************************************/ +extern RESULT CamerIcIspDumpMeasureData +( + CamerIcDrvHandle_t handle, + const char * dump_name, + unsigned int dump_mask +); + +extern RESULT CamerIcIspEnableDigitalGain +( + CamerIcDrvHandle_t handle, + bool enbale +); + +extern RESULT CamerIcIspDigitalGainIsActivated +( + CamerIcDrvHandle_t handle, + bool_t *pIsEnabled +); + +extern RESULT CamerIcIspSetDigitalGain +( + CamerIcDrvHandle_t handle, + CamerIcIspDigitalGainConfig_t *pDigiCfg +); + +extern RESULT CamerIcIspGetDigitalGain +( + CamerIcDrvHandle_t handle, + CamerIcIspDigitalGainConfig_t *pDigiCfg +); + + +#ifdef __cplusplus +} +#endif + +/* @} cameric_isp_drv_api */ + +#endif /* __CAMERIC_ISP_DRV_API_H__ */ + diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_isp_ee_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_isp_ee_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..9cc7b185256934fe6070166b54ea1dcd95d2944d --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_isp_ee_drv_api.h @@ -0,0 +1,163 @@ +/****************************************************************************** + * + * Copyright 2010, Dream Chip Technologies GmbH. All rights reserved. + * No part of this work may be reproduced, modified, distributed, transmitted, + * transcribed, or translated into any language or computer format, in any form + * or by any means without written permission of: + * Dream Chip Technologies GmbH, Steinriede 10, 30827 Garbsen / Berenbostel, + * Germany + * + *****************************************************************************/ +#ifndef __CAMERIC_ISP_EE_DRV_API_H__ +#define __CAMERIC_ISP_EE_DRV_API_H__ + +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +/** + * @brief Enumeration type to input data format select. + * + */ +typedef enum CamerIcIspEeInputDataFormatSelect_e +{ + CAMERIC_ISP_EE_INPUT_DATA_FORMAT_SELECT_INVALID = 0, + CAMERIC_ISP_EE_INPUT_DATA_FORMAT_SELECT_RGB = 1, + CAMERIC_ISP_EE_INPUT_DATA_FORMAT_SELECT_YUV = 2, + CAMERIC_ISP_EE_INPUT_DATA_FORMAT_SELECT_MAX +} CamerIcIspEeInputDataFormatSelect_t; + + +/******************************************************************************/ +/** + * @brief CamerIC EE configuration + * + *****************************************************************************/ +typedef struct CamerIcIspEeConfig_s +{ + bool enabled; + uint8_t strength; + + uint16_t yUpGain; + uint16_t yDownGain; + + uint16_t uvGain; + uint16_t edgeGain; + + uint8_t srcStrength; + CamerIcIspEeInputDataFormatSelect_t inputDataFormatSelect; +} CamerIcIspEeConfig_t; + + +/*****************************************************************************/ +/** + * @brief This function configures the EE module. + * + * @param handle CamerIc driver handle + * @param pConfig Configuration of the EE module (@ref + * CamerIcIspEeConfig_t) + * + * @return Return the result of the function call. + * @retval RET_SUCCESS Configuration successfully applied + * @retval RET_OUTOFRANGE At least one perameter of out range + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +RESULT CamerIcIspEeConfig +( + CamerIcDrvHandle_t handle, + CamerIcIspEeConfig_t *pConfig +); + +/*****************************************************************************/ +/** + * @brief This functions enables the CamerIC ISP EE module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +RESULT CamerIcIspEeEnable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * CamerIcIspEeDisable() + * + * @brief Disable EE Module + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +RESULT CamerIcIspEeDisable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This function + * + * @param handle CamerIc driver handle + * @param pIsEnabled Pointer to value to store current state + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_NULL_POINTER pIsEnabled is NULL pointer + * + *****************************************************************************/ +RESULT CamerIcIspEeIsEnabled +( + CamerIcDrvHandle_t handle, + bool_t *pIsEnabled +); +RESULT CamerIcIspEeSetGain +( + CamerIcDrvHandle_t handle, + const uint32_t isp_y_gain, + const uint16_t isp_uv_gain, + const uint16_t isp_edge_gain +); +RESULT CamerIcIspEeGetGain +( + CamerIcDrvHandle_t handle, + uint32_t *isp_ee_y_gain, + uint16_t *isp_ee_uv_gain, + uint16_t *isp_ee_edge_gain +); +RESULT CamerIcIspEeGetConfig +( + CamerIcDrvHandle_t handle, + CamerIcIspEeConfig_t *pConfig +); + + +#ifdef __cplusplus +} +#endif + +/* @} cameric_isp_ee_drv_api */ + +/* @endcond */ + +#endif /* __CAMERIC_ISP_EE_DRV_API_H__ */ + + diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_isp_elawb_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_isp_elawb_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..9e8154290903fcd2253021bd42d762621e2e0a50 --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_isp_elawb_drv_api.h @@ -0,0 +1,318 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +#ifndef __CAMERIC_ISP_ELAWB_DRV_API_H__ +#define __CAMERIC_ISP_ELAWB_DRV_API_H__ + +/** + * @cond cameric_isp_elawb + * + * @file cameric_isp_elawb_drv_api.h + * + * @brief This file contains the CamerIC ISP Elliptic AWB driver API definitions. + * + *****************************************************************************/ +/** + * @defgroup cameric_isp_elawb_drv_api CamerIC ISP Elliptic AWB driver API definitions + * @{ + * + */ + +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + + + +/*****************************************************************************/ +/** + * @brief Enumeration type to identify a measuring ellipsis + * + *****************************************************************************/ +typedef enum CamerIcIspElAwbElipseId_e +{ + CAMERIC_ISP_AWB_ELIPSIS_ID_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_ISP_AWB_ELIPSIS_ID_1 = 1, /**< ellipse #1 */ + CAMERIC_ISP_AWB_ELIPSIS_ID_2 = 2, /**< ellipse #2 */ + CAMERIC_ISP_AWB_ELIPSIS_ID_3 = 3, /**< ellipse #3 */ + CAMERIC_ISP_AWB_ELIPSIS_ID_4 = 4, /**< ellipse #4 */ + CAMERIC_ISP_AWB_ELIPSIS_ID_5 = 5, /**< ellipse #5 */ + CAMERIC_ISP_AWB_ELIPSIS_ID_6 = 6, /**< ellipse #6 */ + CAMERIC_ISP_AWB_ELIPSIS_ID_7 = 7, /**< ellipse #7 */ + CAMERIC_ISP_AWB_ELIPSIS_ID_8 = 8, /**< ellipse #8 */ + CAMERIC_ISP_AWB_ELIPSIS_ID_MAX, /**< upper border (only for an internal evaluation) */ +} CamerIcIspElAwbElipseId_t; + + + + +/*****************************************************************************/ +/** + * @brief This function registers an event callback at CamerIc ISP AWB + * driver module. + * + * @param handle CamerIc driver handle + * @param func Callback function + * @param pUserContext User-Context + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +extern RESULT CamerIcIspElAwbRegisterEventCb +( + CamerIcDrvHandle_t handle, + CamerIcEventFunc_t func, + void *pUserContext +); + + + +/*****************************************************************************/ +/** + * @brief This function deregisters/clears a registered event callback + * at CamerIc ISP AWB driver module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +extern RESULT CamerIcIspElAwbDeRegisterEventCb +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This function enables the CamerIc ISP AWB measuring module. + * + * @return Return the result of the function call. + * @retval RET_SUCCESS ISP AWB module successfully enabled + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspElAwbEnable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This function disables the CamerIc ISP AWB measuring module + * (bypassing of the white balance measuring module). + * + * @return Return the result of the function call. + * @retval RET_SUCCESS ISP AWB module successfully disabled + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspElAwbDisable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief Get CamerIc ISP AWB measuring module status. + * + * @param handle CamerIc driver handle. + * @param pIsEnabled + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +extern RESULT CamerIcIspElAwbIsEnabled +( + CamerIcDrvHandle_t handle, + bool_t *pIsEnabled +); + + + +/*****************************************************************************/ +/** + * @brief This function configures the CamerIC ISP AWB measuring window. + * + * @param handle CamerIc driver handle + * @param x start x position of measuring window + * @param y start y position of measuring window + * @param width width of measuring window + * @param height height of measuring window + * + * @return Return the result of the function call. + * @retval RET_SUCCESS Configuration successfully applied + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_OUTOFRANGE At least one perameter of out range + * + *****************************************************************************/ +extern RESULT CamerIcIspElAwbSetMeasuringWindow +( + CamerIcDrvHandle_t handle, + const uint16_t x, + const uint16_t y, + const uint16_t width, + const uint16_t height +); + + + +/*****************************************************************************/ +/** + * @brief This function returns a currently configured measuring ellisiod + * from CamerIC ISP AWB measuring module. + * + * @param handle CamerIc driver handle + * @param x pointer to store center x position of elipsis + * @param y pointer to store center y position of elipsis + * @param a1 pointer to store rotaion matrix coefficient (1,1) + * @param a2 pointer to store rotaion matrix coefficient (1,2) + * @param a3 pointer to store rotaion matrix coefficient (2,1) + * @param a4 pointer to store rotaion matrix coefficient (2,2) + * @param r_max_sqr pointer to store max radius square compare value + * + * @return Return the result of the function call. + * @retval RET_SUCCESS Configuration successfully applied + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_OUTOFRANGE At least one perameter of out range + * + *****************************************************************************/ +extern RESULT CamerIcIspElAwbGetMeasuringEllipse +( + CamerIcDrvHandle_t handle, + const CamerIcIspElAwbElipseId_t id, + uint16_t *x, + uint16_t *y, + uint16_t *a1, + uint16_t *a2, + uint16_t *a3, + uint16_t *a4, + uint32_t *r_max_sqr +); + + + +/*****************************************************************************/ +/** + * @brief This function configures a measuring ellisiod in CamerIC ISP + * AWB measuring module. + * + * @param handle CamerIc driver handle + * @param x center x position of elipsis + * @param y center y position of elipsis + * @param a1 rotaion matrix coefficient (1,1) + * @param a2 rotaion matrix coefficient (1,2) + * @param a3 rotaion matrix coefficient (2,1) + * @param a4 rotaion matrix coefficient (2,2) + * @param r_max_sqr max radius square compare value + * + * @return Return the result of the function call. + * @retval RET_SUCCESS Configuration successfully applied + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_OUTOFRANGE At least one perameter of out range + * + *****************************************************************************/ +extern RESULT CamerIcIspElAwbSetMeasuringEllipse +( + CamerIcDrvHandle_t handle, + const CamerIcIspElAwbElipseId_t id, + const uint16_t x, + const uint16_t y, + const uint16_t a1, + const uint16_t a2, + const uint16_t a3, + const uint16_t a4, + const uint32_t r_max_sqr +); + + + +/*****************************************************************************/ +/** + * @brief This functions reads out the currently configured white balance + * gains. + * + * @param handle CamerIc driver handle + * @param pGains Pointer to store the white balance gains + * (@ref CamerIcGains_t) + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to read WB gains + * from CamerIC (maybe driver not initialized) + * @retval RET_INVALID_PARM invalid parameter + * + *****************************************************************************/ +extern RESULT CamerIcIspElAwbGetGains +( + CamerIcDrvHandle_t handle, + CamerIcGains_t *pGains +); + + + +/*****************************************************************************/ +/** + * @brief This functions sets the white balance gains. + * + * @param handle CamerIc driver handle + * @param pGains Pointer to white balance gains to set + * (@ref CamerIcGains_t) + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to read WB gains + * from CamerIC (maybe driver not initialized) + * + *****************************************************************************/ +extern RESULT CamerIcIspElAwbSetGains +( + CamerIcDrvHandle_t handle, + const CamerIcGains_t *pGains +); + + + + +#ifdef __cplusplus +} +#endif + +/* @} cameric_isp_elawb_drv_api */ + +/* @endcond */ + +#endif /* __CAMERIC_ISP_ELAWB_DRV_API_H__ */ + diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_isp_exp_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_isp_exp_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..9e3a1a22a20fc0f19114eeabefdb4d429cc087aa --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_isp_exp_drv_api.h @@ -0,0 +1,279 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +#ifndef __CAMERIC_ISP_EXP_DRV_API_H__ +#define __CAMERIC_ISP_EXP_DRV_API_H__ + +/** + * @cond cameric_isp_exp + * + * @file cameric_isp_exp_drv_api.h + * + * @brief This file contains the CamerIC ISP AE Driver API definitions + * + *****************************************************************************/ +/** + * @defgroup cameric_isp_exp_drv_api CamerIC ISP AE Driver API definitions + * @{ + * + * @image html exp.png "Overview of the CamerIC ISP CAC driver" width=\textwidth + * @image latex exp.png "Overview of the CamerIC ISP CAC driver" width=\textwidth + * + * @image html exp_grid.png "Luminance Measurement Grid" width=0.8\textwidth + * @image latex exp_grid.png "Luminance Measurement Grid" width=0.8\textwidth + * + */ +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + + +#define CAMERIC_ISP_EXP_GRID_ITEMS 25 /**< number of grid items (see @ref CamerIcMeanLuma_t) */ + + +#define CAMERIC_ISP_EXP_GRID_00 0 /**< array position grid item 00 (see @ref CamerIcMeanLuma_t) */ +#define CAMERIC_ISP_EXP_GRID_10 1 /**< array position grid item 10 (see @ref CamerIcMeanLuma_t) */ +#define CAMERIC_ISP_EXP_GRID_20 2 /**< array position grid item 20 (see @ref CamerIcMeanLuma_t) */ +#define CAMERIC_ISP_EXP_GRID_30 3 /**< array position grid item 30 (see @ref CamerIcMeanLuma_t) */ +#define CAMERIC_ISP_EXP_GRID_40 4 /**< array position grid item 40 (see @ref CamerIcMeanLuma_t) */ + +#define CAMERIC_ISP_EXP_GRID_01 5 /**< array position grid item 01 (see @ref CamerIcMeanLuma_t) */ +#define CAMERIC_ISP_EXP_GRID_11 6 /**< array position grid item 11 (see @ref CamerIcMeanLuma_t) */ +#define CAMERIC_ISP_EXP_GRID_21 7 /**< array position grid item 21 (see @ref CamerIcMeanLuma_t) */ +#define CAMERIC_ISP_EXP_GRID_31 8 /**< array position grid item 31 (see @ref CamerIcMeanLuma_t) */ +#define CAMERIC_ISP_EXP_GRID_41 9 /**< array position grid item 41 (see @ref CamerIcMeanLuma_t) */ + +#define CAMERIC_ISP_EXP_GRID_02 10 /**< array position grid item 02 (see @ref CamerIcMeanLuma_t) */ +#define CAMERIC_ISP_EXP_GRID_12 11 /**< array position grid item 12 (see @ref CamerIcMeanLuma_t) */ +#define CAMERIC_ISP_EXP_GRID_22 12 /**< array position grid item 22 (see @ref CamerIcMeanLuma_t) */ +#define CAMERIC_ISP_EXP_GRID_32 13 /**< array position grid item 32 (see @ref CamerIcMeanLuma_t) */ +#define CAMERIC_ISP_EXP_GRID_42 14 /**< array position grid item 42 (see @ref CamerIcMeanLuma_t) */ + +#define CAMERIC_ISP_EXP_GRID_03 15 /**< array position grid item 03 (see @ref CamerIcMeanLuma_t) */ +#define CAMERIC_ISP_EXP_GRID_13 16 /**< array position grid item 13 (see @ref CamerIcMeanLuma_t) */ +#define CAMERIC_ISP_EXP_GRID_23 17 /**< array position grid item 23 (see @ref CamerIcMeanLuma_t) */ +#define CAMERIC_ISP_EXP_GRID_33 18 /**< array position grid item 33 (see @ref CamerIcMeanLuma_t) */ +#define CAMERIC_ISP_EXP_GRID_43 19 /**< array position grid item 43 (see @ref CamerIcMeanLuma_t) */ + +#define CAMERIC_ISP_EXP_GRID_04 20 /**< array position grid item 04 (see @ref CamerIcMeanLuma_t) */ +#define CAMERIC_ISP_EXP_GRID_14 21 /**< array position grid item 14 (see @ref CamerIcMeanLuma_t) */ +#define CAMERIC_ISP_EXP_GRID_24 22 /**< array position grid item 24 (see @ref CamerIcMeanLuma_t) */ +#define CAMERIC_ISP_EXP_GRID_34 23 /**< array position grid item 34 (see @ref CamerIcMeanLuma_t) */ +#define CAMERIC_ISP_EXP_GRID_44 24 /**< array position grid item 44 (see @ref CamerIcMeanLuma_t) */ + + + +/*****************************************************************************/ +/** + * @brief Enumeration type to configure CamerIC ISP exposure measuring mode. + * + *****************************************************************************/ +typedef enum CamerIcIspExpMeasuringMode_e +{ + CAMERIC_ISP_EXP_MEASURING_MODE_INVALID = 0, /**< invalid histogram measuring mode */ + CAMERIC_ISP_EXP_MEASURING_MODE_1 = 1, /**< Y = (R + G + B) x (85/256) */ + CAMERIC_ISP_EXP_MEASURING_MODE_2 = 2, /**< Y = 16 + 0.25R + 0.5G + 0.1094B */ + CAMERIC_ISP_EXP_MEASURING_MODE_MAX, +} CamerIcIspExpMeasuringMode_t; + + + +/*****************************************************************************/ +/** + * @brief Array type for ISP EXP measurment values. + * + *****************************************************************************/ +typedef uint8_t CamerIcMeanLuma_t[CAMERIC_ISP_EXP_GRID_ITEMS]; + + + +/*****************************************************************************/ +/** + * @brief This functions registers an Event-Callback at CamerIC ISP histogram + * measurement module. An event callback is called if the driver needs + * to inform the application layer about an asynchronous event or an + * error situation (i.e. please also @see CamerIcEventId_e). + * + * @param handle CamerIc driver handle + * @param func Callback function + * @param pUserContext User-Context + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_BUSY already a callback registered + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_INVALID_PARM a parameter is invalid + * @retval RET_WRONG_STATE driver is in wrong state to register a + * event callback (maybe the driver is already + * running) + * + *****************************************************************************/ +extern RESULT CamerIcIspExpRegisterEventCb +( + CamerIcDrvHandle_t handle, + CamerIcEventFunc_t func, + void *pUserContext +); + + + +/*****************************************************************************/ +/** + * @brief This functions deregisters/releases a registered Event-Callback + * at CamerIc ISP histogram measurement module. + * + * @param handle CamerIC driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to deregister the + * request callback + * + *****************************************************************************/ +extern RESULT CamerIcIspExpDeRegisterEventCb +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This functions enables the CamerIC ISP exposure measurement + * module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspExpEnable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This functions disables the CamerIC ISP exposure measurement + * module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspExpDisable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief Get CamerIC ISP exposure measurement module status. + * + * @param handle CamerIc driver handle. + * @param pIsEnabled + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +extern RESULT CamerIcIspExpIsEnabled +( + CamerIcDrvHandle_t handle, + bool_t *pIsEnabled +); + + + +/*****************************************************************************/ +/** + * @brief This functions configures the measurement mode of the CamerIC + * ISP exposure measurement module. + * + * @param handle CamerIc driver handle + * @param mode measurement mode (@see CamerIcIspHistMode_e) + * + * @return Return the result of the function call. + * @retval RET_SUCCESS Configuration successfully applied + * @retval RET_OUTOFRANGE At least one perameter of out range + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspExpSetMeasuringMode +( + CamerIcDrvHandle_t handle, + const CamerIcIspExpMeasuringMode_t mode +); + + + +/*****************************************************************************/ +/** + * @brief This function sets the position and size of a the measurement + * window in the CamerIC ISP exposure measurement module. + * + * @note This function calculates the grid-size by dividing the width and + * height by 5. + * + * @param handle CamerIc driver handle + * @param x start x position of measuring window + * @param y start y position of measuring window + * @param width width of measuring window + * @param height height of measuring window + * + * @return Return the result of the function call. + * @retval RET_SUCCESS Configuration successfully applied + * @retval RET_INVALID_PARM invalid window identifier + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspExpSetMeasuringWindow +( + CamerIcDrvHandle_t handle, + const uint16_t x, + const uint16_t y, + const uint16_t width, + const uint16_t height +); + + + +#ifdef __cplusplus +} +#endif + +/* @} cameric_isp_exp_drv_api */ + +/* @endcond */ + +#endif /* __CAMERIC_ISP_EXP_DRV_API_H__ */ + diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_isp_expv2_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_isp_expv2_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..6256038a4ec6db84fe7836f6616875f7732a024a --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_isp_expv2_drv_api.h @@ -0,0 +1,223 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +#ifndef __CAMERIC_ISP_EXPV2_DRV_API_H__ +#define __CAMERIC_ISP_EXPV2_DRV_API_H__ + +/** + * @cond cameric_isp_expv2 + * + * @file cameric_isp_expv2_drv_api.h + * + * @brief This file contains the CamerIC ISP AE Driver API definitions + * + *****************************************************************************/ +/** + * @defgroup cameric_isp_expv2_drv_api CamerIC ISP AE Driver API definitions + * @{ + * + * @image html exp.png "Overview of the CamerIC ISP CAC driver" width=\textwidth + * @image latex exp.png "Overview of the CamerIC ISP CAC driver" width=\textwidth + * + * @image html exp_grid.png "Luminance Measurement Grid" width=0.8\textwidth + * @image latex exp_grid.png "Luminance Measurement Grid" width=0.8\textwidth + * + */ +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +typedef enum CamerIcIspExpV2Sel_e +{ + AEV2_INPUT_SEL_DEGAMMA = 0, + AEV2_INPUT_SEL_AWBGAIN = 1, + AEV2_INPUT_SEL_WDR3 = 2, + AEV2_INPUT_SEL_LSC = 3 +} CamerIcIspExpV2Sel_t; +/*****************************************************************************/ +/** + * @brief This functions registers an Event-Callback at CamerIC ISP histogram + * measurement module. An event callback is called if the driver needs + * to inform the application layer about an asynchronous event or an + * error situation (i.e. please also @see CamerIcEventId_e). + * + * @param handle CamerIc driver handle + * @param func Callback function + * @param pUserContext User-Context + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_BUSY already a callback registered + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_INVALID_PARM a parameter is invalid + * @retval RET_WRONG_STATE driver is in wrong state to register a + * event callback (maybe the driver is already + * running) + * + *****************************************************************************/ +extern RESULT CamerIcIspExpV2RegisterEventCb +( + CamerIcDrvHandle_t handle, + CamerIcEventFunc_t func, + void *pUserContext +); + + + +/*****************************************************************************/ +/** + * @brief This functions deregisters/releases a registered Event-Callback + * at CamerIc ISP histogram measurement module. + * + * @param handle CamerIC driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to deregister the + * request callback + * + *****************************************************************************/ +extern RESULT CamerIcIspExpV2DeRegisterEventCb +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This functions enables the CamerIC ISP exposure measurement + * module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspExpV2Enable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This functions disables the CamerIC ISP exposure measurement + * module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspExpV2Disable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief Get CamerIC ISP exposure measurement module status. + * + * @param handle CamerIc driver handle. + * @param pIsEnabled + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +extern RESULT CamerIcIspExpV2IsEnabled +( + CamerIcDrvHandle_t handle, + bool_t *pIsEnabled +); + + + + +/*****************************************************************************/ +/** + * @brief This function sets the position and size of a the measurement + * window in the CamerIC ISP exposure measurement module. + * + * @note This function calculates the grid-size by dividing the width and + * height by 5. + * + * @param handle CamerIc driver handle + * @param x start x position of measuring window + * @param y start y position of measuring window + * @param width width of measuring window + * @param height height of measuring window + * + * @return Return the result of the function call. + * @retval RET_SUCCESS Configuration successfully applied + * @retval RET_INVALID_PARM invalid window identifier + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspExpV2SetMeasuringWindow +( + CamerIcDrvHandle_t handle, + const uint16_t x, + const uint16_t y, + const uint16_t width, + const uint16_t height +); + +RESULT CamerIcIspExpV2SetWeight +( + CamerIcDrvHandle_t handle, + const uint8_t rWeight, + const uint8_t grWeight, + const uint8_t gbWeight, + const uint8_t bWeight +); + +RESULT CamerIcIspExpV2SetSizeRatio +( + CamerIcDrvHandle_t handle, + float ratio +); + +RESULT CamerIcIspExpV2InputSel +( + CamerIcDrvHandle_t handle, + CamerIcIspExpV2Sel_t input_select +); +#ifdef __cplusplus +} +#endif + +/* @} cameric_isp_exp_drv_api */ + +/* @endcond */ + +#endif /* __CAMERIC_ISP_EXPV2_DRV_API_H__ */ + diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_isp_flt_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_isp_flt_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..1236afbca2648e772bc0f3e0dd9b27250e8e7469 --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_isp_flt_drv_api.h @@ -0,0 +1,200 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +/** + * @file cameric_isp_flt_drv_api.h + * + * @brief + * Interface description of FLT Module. + * + *****************************************************************************/ +/** + * @page cameric_isp_flt_drv_api_page CamerIc ISP FLT Driver API + * + * Describe here what this module does. + * + * For a detailed list of functions and implementation detail refer to: + * + * @defgroup cameric_isp_flt_drv_api CamerIc ISP FLT Driver API + * @{ + * + */ + +#ifndef __CAMERIC_ISP_FLT_DRV_API_H__ +#define __CAMERIC_ISP_FLT_DRV_API_H__ + +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +/** + * @brief Enumeration type to configure de-noising level. + * + */ +typedef enum CamerIcIspFltDeNoiseLevel_e +{ + CAMERIC_ISP_FLT_DENOISE_LEVEL_INVALID = 0, + CAMERIC_ISP_FLT_DENOISE_LEVEL_0 = 1, + CAMERIC_ISP_FLT_DENOISE_LEVEL_1 = 2, + CAMERIC_ISP_FLT_DENOISE_LEVEL_2 = 3, + CAMERIC_ISP_FLT_DENOISE_LEVEL_3 = 4, + CAMERIC_ISP_FLT_DENOISE_LEVEL_4 = 5, + CAMERIC_ISP_FLT_DENOISE_LEVEL_5 = 6, + CAMERIC_ISP_FLT_DENOISE_LEVEL_6 = 7, + CAMERIC_ISP_FLT_DENOISE_LEVEL_7 = 8, + CAMERIC_ISP_FLT_DENOISE_LEVEL_8 = 9, + CAMERIC_ISP_FLT_DENOISE_LEVEL_9 = 10, + CAMERIC_ISP_FLT_DENOISE_LEVEL_10 = 11, + CAMERIC_ISP_FLT_DENOISE_LEVEL_TEST = 12, + CAMERIC_ISP_FLT_DENOISE_LEVEL_MAX +} CamerIcIspFltDeNoiseLevel_t; + + + +/** + * @brief Enumeration type to configure sharpening level. + * + */ +typedef enum CamerIcIspFltSharpeningLevel_e +{ + CAMERIC_ISP_FLT_SHARPENING_LEVEL_INVALID = 0, + CAMERIC_ISP_FLT_SHARPENING_LEVEL_0 = 1, + CAMERIC_ISP_FLT_SHARPENING_LEVEL_1 = 2, + CAMERIC_ISP_FLT_SHARPENING_LEVEL_2 = 3, + CAMERIC_ISP_FLT_SHARPENING_LEVEL_3 = 4, + CAMERIC_ISP_FLT_SHARPENING_LEVEL_4 = 5, + CAMERIC_ISP_FLT_SHARPENING_LEVEL_5 = 6, + CAMERIC_ISP_FLT_SHARPENING_LEVEL_6 = 7, + CAMERIC_ISP_FLT_SHARPENING_LEVEL_7 = 8, + CAMERIC_ISP_FLT_SHARPENING_LEVEL_8 = 9, + CAMERIC_ISP_FLT_SHARPENING_LEVEL_9 = 10, + CAMERIC_ISP_FLT_SHARPENING_LEVEL_10 = 11, + CAMERIC_ISP_FLT_SHARPENING_LEVEL_MAX +} CamerIcIspFltSharpeningLevel_t; + + + +/*****************************************************************************/ +/** + * @brief Enable FLT Module. + * + * @param handle CamerIc driver handle. + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +extern RESULT CamerIcIspFltEnable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief Disable FLT Module. + * + * @param handle CamerIc driver handle. + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +extern RESULT CamerIcIspFltDisable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief Get FLT Module status. + * + * @param handle CamerIc driver handle. + * @param pIsEnabled + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +extern RESULT CamerIcIspFltIsEnabled +( + CamerIcDrvHandle_t handle, + bool_t *pIsEnabled +); + + + +/*****************************************************************************/ +/** + * @brief Get ISP filter parameter. + * + * @param handle CamerIc driver handle. + * @param pDeNoiseLevel + * @param pSharpeningLevel + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +extern RESULT CamerIcIspFltGetFilterParameter +( + CamerIcDrvHandle_t handle, + CamerIcIspFltDeNoiseLevel_t *pDeNoiseLevel, + CamerIcIspFltSharpeningLevel_t *pSharpeningLevel +); + + + +/*****************************************************************************/ +/** + * @brief Set ISP filter parameter. + * + * @param handle CamerIc driver handle. + * @param DeNoiseLevel + * @param SharpeningLevel + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +extern RESULT CamerIcIspFltSetFilterParameter +( + CamerIcDrvHandle_t handle, + const CamerIcIspFltDeNoiseLevel_t DeNoiseLevel, + const CamerIcIspFltSharpeningLevel_t SharpeningLevel +); + + +#ifdef __cplusplus +} +#endif + +/* @} cameric_isp_flt_drv_api */ + +#endif /* __CAMERIC_ISP_FLT_DRV_API_H__ */ + diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_isp_gcmono_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_isp_gcmono_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..6fc3b21fe1535b5167a360abf1f15a9074134952 --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_isp_gcmono_drv_api.h @@ -0,0 +1,164 @@ +/******************************************************************************\ +|* Copyright (c) 2020 by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +#ifndef __CAMERIC_ISP_GCMONO_DRV_API_H__ +#define __CAMERIC_ISP_GCMONO_DRV_API_H__ +#ifdef ISP_GCMONO + +/** + * @cond cameric_isp_gcmono + * + * @file cameric_isp_gcmono_drv_api.h + * + * @brief This file contains the CamerIC ISP gcmono driver API definitions. + * + *****************************************************************************/ +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +#define CAMERIC_ISP_GCMONO_LUT_NUM 1024 /* 1024 items */ +#define CAMERIC_ISP_GCMONO_PX_NUM 64 /* 64 items */ +#define CAMERIC_ISP_GCMONO_DATA_X_NUM 63 /* 63 items */ +#define CAMERIC_ISP_GCMONO_DATA_Y_NUM 64 /* 64 items */ + +typedef uint8_t CamerIcGcmonoLut_t[CAMERIC_ISP_GCMONO_LUT_NUM]; +typedef uint32_t CamerIcGcmonoPx_t[CAMERIC_ISP_GCMONO_PX_NUM]; +typedef uint32_t CamerIcGcmonoDataX_t[CAMERIC_ISP_GCMONO_DATA_X_NUM]; +typedef uint32_t CamerIcGcmonoDataY_t[CAMERIC_ISP_GCMONO_DATA_Y_NUM]; + +/*****************************************************************************/ +/** + * @brief Enumeration type to configure CamerIC ISP gcmono module. + * + *****************************************************************************/ +typedef enum CamerIcIspGCMonoSwitch_e +{ + CAMERIC_ISP_GCMONO_SWITCH_DISABLE = 0, /**< Gcmono Disable */ + CAMERIC_ISP_GCMONO_SWITCH_ENABLE = 1, /**< Gcmono Enable */ + CAMERIC_ISP_GCMONO_SWITCH_MAX, /**< upper border (only for an internal evaluation) */ +} CamerIcIspGCMonoSwitch_t; + +typedef enum CamerIcIspGCMonoSelect_e +{ + CAMERIC_ISP_GCMONO_SELECT_MODE0 = 0, /**< Gamma mono path select 0: 10->8 */ + CAMERIC_ISP_GCMONO_SELECT_MODE1 = 1, /**< Gamma mono path select 1: 12->10*/ + CAMERIC_ISP_GCMONO_SELECT_MAX, +} CamerIcIspGCMonoSelect_t; + +/******************************************************************************* + * + * CamerIcIspGcmonoContext_t + * + * @brief + * + */ +typedef struct CamerIcIspGcmonoContext_s +{ + CamerIcIspGCMonoSwitch_t enabled; /**< Gcmono switch enabled */ + CamerIcIspGCMonoSelect_t mode; /**< Gcmono mode select */ + CamerIcGcmonoLut_t gcmonoLut; /**< Gcmono lut table */ + CamerIcGcmonoPx_t gcmonoPx; /**< Gcmono px table */ + CamerIcGcmonoDataX_t gcmonoDataX; /**< Gcmono data x table */ + CamerIcGcmonoDataY_t gcmonoDataY; /**< Gcmono data y table */ +} CamerIcIspGcMonoContext_t; + +/*****************************************************************************/ +/** + * @brief This functions enables the CamerIC ISP gcmono + * module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspGcmonoEnable +( + CamerIcDrvHandle_t handle +); + + +/*****************************************************************************/ +/** + * @brief This functions disables the CamerIC ISP gcmono + * module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspGcmonoDisable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief Get CamerIC ISP Gcmono module status. + * + * @param handle CamerIc driver handle. + * @param pIsEnabled + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +extern RESULT CamerIcIspGcmonoIsEnabled +( + CamerIcDrvHandle_t handle, + CamerIcIspGCMonoSwitch_t *pIsEnabled +); + +/****************************************************************************** + * CamerIcIspGcMonoConfig() + * @brief set lut curve for CamerIC ISP Gcmono module. + * + * @param handle CamerIc driver handle. + * @param *gcMonoCtx GC Mono Context pointer + * @param enable_switch GC Mono Enable switch + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ + +extern RESULT CamerIcIspGcMonoConfig +( + CamerIcDrvHandle_t handle, + CamerIcIspGcMonoContext_t *gcMonoCtx, + CamerIcIspGCMonoSwitch_t enable_switch +); + +#ifdef __cplusplus +} +#endif + +/* @} cameric_isp_gcmono_drv_api */ + +/* @endcond */ +#endif /* ISP_GCMONO */ +#endif /* __CAMERIC_ISP_GCMONO_DRV_API_H__ */ + diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_isp_green_equilibration_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_isp_green_equilibration_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..644e6fdac14948f39fcb8d3944bf63a1e9e8c806 --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_isp_green_equilibration_drv_api.h @@ -0,0 +1,142 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +#ifndef __CAMERIC_ISP_GREEN_EQUILIBRATION_DRV_API_H__ +#define __CAMERIC_ISP_GREEN_EQUILIBRATION_DRV_API_H__ + +/** + * @cond cameric_isp_green_equilibration + * + * @file cameric_isp_green_equilibration_drv_api.h + * + * @brief This file contains the CamerIC ISP GREEN_EQUILIBRATION (video stabilization) Driver + * API definitions + * + *****************************************************************************/ +/** + * @defgroup cameric_isp_green_equilibration_drv_api CamerIC ISP GREEN_EQUILIBRATION Driver API definitions + * + * + */ +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + + +typedef struct CamerIcIspGreenEqlr_s +{ + bool enable; + uint16_t threshold; + uint16_t dummyLine; +} CamerIcIspGreenEqlr_t; + +/*****************************************************************************/ +/** + * @brief This functions enables the CamerIC ISP green equilibration + * module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspGreenEqlrEnable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This functions disables the CamerIC ISP green equilibration + * module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspGreenEqlrDisable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief Get CamerIC ISP green equilibration module status. + * + * @param handle CamerIc driver handle. + * @param pIsEnabled + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +extern RESULT CamerIcIspGreenEqlrIsEnabled +( + CamerIcDrvHandle_t handle, + bool_t *pIsEnabled +); + +/*****************************************************************************/ +/** + * @brief + * + * @param handle CamerIc driver handle. + * @param + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +RESULT CamerIcIspGreenEqlrConfig +( + CamerIcDrvHandle_t handle, + uint16_t threshold, uint16_t dummyLine +); + +RESULT CamerIcIspGetGe +( + CamerIcDrvHandle_t handle, + uint32_t *enable, + uint16_t *pThreshold, + uint16_t *pHDummy +); + +#ifdef __cplusplus +} +#endif + +/* @} cameric_isp_green_equilibration_drv_api */ + +/* @endcond */ + +#endif /* __CAMERIC_ISP_GREEN_EQUILIBRATION_DRV_API_H__ */ + + diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_isp_hist64_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_isp_hist64_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..5955a8b671e71a1dfe1f7b0c6e357722af6ed3a1 --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_isp_hist64_drv_api.h @@ -0,0 +1,469 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +#ifndef __CAMERIC_ISP_HIST64_DRV_API_H__ +#define __CAMERIC_ISP_HIST64_DRV_API_H__ + +/** + * @cond cameric_isp_hist64 + * + * @file cameric_isp_hist64_drv_api.h + * + * @brief This file contains the CamerIC ISP HIST driver API definitions. + * + *****************************************************************************/ +/** + * @defgroup cameric_isp_hist64_drv_api CamerIC ISP HIST driver API definitions + * @{ + * + * In general, a histogram is a graphical representation of the pattern of + * variation that exists in the intensity values of the color or luminance + * planes. Usually it is displayed by vertical bars drawn to indicate frequency + * levels of data collected within specific ranges. + * + * The following figure shows the position of the histogram measuring module in + * the CamerIC ISP pipeline. + * + * @image html hist.png "Overview of the CamerIC ISP HIST driver" width=\textwidth + * @image latex hist.png "Overview of the CamerIC ISP HIST driver" width=\textwidth + * + * The complete range of possible intensity values is divided into a number + * (@ref CAMERIC_ISP_HIST64_NUM_BINS) of equally-sized ranges, so called @b bins . + * Each incoming intensity value is associated to one of these bins and gets + * counted for that bin only. + * + * The histogram measurement can be configured to work in one of five modes + * (@ref CamerIcIspHist64Mode_e): + * + * @arg R separated histogram: only the red color component of incoming RGB + * triples is measured. + * @arg G separated histogram: only the green color component of incoming RGB + * triples is measured. + * @arg B separated histogram: only the blue color component of incoming RGB + * triples is measured. + * @arg RGB combined histogram: The sum of red, green and blue component of + * the incoming RGB triples is measured. Note that it is not possible + * to calculate a luminance or grayscale histogram from an RGB histogram + * since the position information is lost during its generation. + * @arg Y (luminance) histogram: the luminance values of incoming RGB triples + * are measured. + * + * Further, the histogram measurement block can be configured to measure + * not the whole incoming image, but the pixels in a smaller window only. + * Size and position of that measuring window can be set with @ref + * CamerIcIspHist64SetMeasuringWindow. + * + * The histogram measurement window is also divided into a number (@ref + * CAMERIC_ISP_HIST64_GRID_ITEMS) of sub-windows. Each sub-window may be + * assigned a different weight factor, so that the contribution of the + * sub-window to the histogram bins is weighted. + * + */ +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + + + +/*****************************************************************************/ +/** + * @brief This macro defines the number of used bins. + * + *****************************************************************************/ + +#define CAMERIC_ISP_HIST64_NUM_BINS 32 /**< number of bins */ + + + +/*****************************************************************************/ +/** + * @brief This macro defines the number of used grid items ofr weightening + * measured pixels. + * + *****************************************************************************/ +#define CAMERIC_ISP_HIST64_GRID_ITEMS 25 /**< number of grid sub windows */ + + + +/*****************************************************************************/ +/** + * @brief This typedef specifies an array type to configure the grid weights + * of CamerIC ISP historgam module. + * + *****************************************************************************/ +typedef uint8_t CamerIcHist64Weights_t[CAMERIC_ISP_HIST64_GRID_ITEMS]; + + + +/*****************************************************************************/ +/** + * @brief This typedef represents the histogram which is measured by the + * CamerIC ISP histogram module. + * + *****************************************************************************/ +typedef uint32_t CamerIcHist64Bins_t[ CAMERIC_ISP_HIST64_NUM_BINS]; + + + +/*****************************************************************************/ +/** + * @brief Enumeration type to configure CamerIC ISP histogram measuring mode. + * + *****************************************************************************/ +typedef enum CamerIcIspHist64Mode_e +{ + CAMERIC_ISP_HIST64_MODE_INVALID = -1, /**< lower border (only for an internal evaluation) */ + CAMERIC_ISP_HIST64_MODE_DISABLE = 0, /**< disable, no measurements */ + CAMERIC_ISP_HIST64_MODE_ONE_FROM_YRGB = 1, /**< Y/R/G/B histogram controlled via coefficients coeff_r/g/b */ + CAMERIC_ISP_HIST64_MODE_R = 2, /**< r histogram */ + CAMERIC_ISP_HIST64_MODE_GR = 3, /**< Gr histogram */ + CAMERIC_ISP_HIST64_MODE_B = 4, /**< B histogram */ + CAMERIC_ISP_HIST64_MODE_GB = 5, /**< GB histogram */ + CAMERIC_ISP_HIST64_MODE_MAX, /**< upper border (only for an internal evaluation) */ +} CamerIcIspHist64Mode_t; + +typedef enum CamerIcIspHist64Channel_e +{ + CAMERIC_ISP_HIST64_CHANNEL_INVALID = -1, /**< lower border (only for an internal evaluation) */ + CAMERIC_ISP_HIST64_CHANNEL_0 = 0, /**< disable, no measurements */ + CAMERIC_ISP_HIST64_CHANNEL_1 = 1, + CAMERIC_ISP_HIST64_CHANNEL_2 = 2, + CAMERIC_ISP_HIST64_CHANNEL_3 = 3, + CAMERIC_ISP_HIST64_CHANNEL_4 = 4, + CAMERIC_ISP_HIST64_CHANNEL_5 = 5, + CAMERIC_ISP_HIST64_CHANNEL_6 = 6, + CAMERIC_ISP_HIST64_CHANNEL_7 = 7, + CAMERIC_ISP_HIST64_CHANNEL_MAX, /**< upper border (only for an in*/ +} CamerIcIspHist64Channel_t; + +#define CAMERIC_ISP_HIST64_V_STEP_SIZE_MAX 127 +#define CAMERIC_ISP_HIST64_V_STEP_SIZE_INVALID 0 + +#define CAMERIC_ISP_HIST64_H_STEP_INC_MAX 0x1ffff + +#define CAMERIC_ISP_HIST64_SAMPLE_SHIFT_MAX 7 +#define CAMERIC_ISP_HIST64_SAMPLE_SHIFT_MIN 0 + +#define CAMERIC_ISP_HIST64_SAMPLE_OFFSET_MIN 0 + +#define CAMERIC_ISP_HIST64_SAMPLE_OFFSET_MAX 0xfff +typedef struct CamerIcIspHist64Window_s{ + unsigned int offsetX; + unsigned int offsetY; + unsigned int width; + unsigned int height; +}CamerIcIspHist64Window_t; + +#define CAMERIC_ISP_COEFFICIENT_MAX 1.992 +/*****************************************************************************/ +/** + * @brief This functions registers an Event-Callback at CamerIC ISP histogram + * measurement module. An event callback is called if the driver needs + * to inform the application layer about an asynchronous event or an + * error situation (i.e. please also @see CamerIcEventId_e). + * + * @param handle CamerIC driver handle + * @param func Callback function + * @param pUserContext User-Context + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_BUSY already a callback registered + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_INVALID_PARM a parameter is invalid + * @retval RET_WRONG_STATE driver is in wrong state to register a + * event callback (maybe the driver is already + * running) + * + *****************************************************************************/ +extern RESULT CamerIcIspHist64RegisterEventCb +( + CamerIcDrvHandle_t handle, + CamerIcEventFunc_t func, + void *pUserContext +); + + + +/*****************************************************************************/ +/** + * @brief This functions deregisters/releases a registered Event-Callback + * at CamerIc ISP histogram64 measurement module. + * + * @param handle CamerIC driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to deregister the + * request callback + * + *****************************************************************************/ +extern RESULT CamerIcIspHist64DeRegisterEventCb +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This functions enables the CamerIC ISP histogram measurement + * module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspHist64Enable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This functions disables the CamerIC ISP histogram measurement + * module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspHist64Disable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief Get CamerIC ISP histogram64 measurement module status. + * + * @param handle CamerIc driver handle. + * @param pIsEnabled + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +extern RESULT CamerIcIspHist64IsEnabled +( + CamerIcDrvHandle_t handle, + bool_t *pIsEnabled +); + + + +/*****************************************************************************/ +/** + * @brief This functions configures the measurement mode of the CamerIC + * ISP histogram64 measurement module. + * + * @param handle CamerIc driver handle + * @param mode measurement mode (see @ref CamerIcIspHist64Mode_e) + * + * @return Return the result of the function call. + * @retval RET_SUCCESS Configuration successfully applied + * @retval RET_OUTOFRANGE At least one perameter of out range + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspHist64SetMeasuringMode +( + CamerIcDrvHandle_t handle, + const CamerIcIspHist64Mode_t mode +); + +/*****************************************************************************/ +/** + * @brief This function sets the position and size of a the measurement + * window in the CamerIC ISP histogram64 measurement module. + * + * @param handle CamerIc driver handle + * @param x start x position of measuring window + * @param y start y position of measuring window + * @param width width of measuring window + * @param height height of measuring window + * + * + * @return Return the result of the function call. + * @retval RET_SUCCESS Configuration successfully applied + * @retval RET_INVALID_PARM invalid window identifier + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspHist64SetMeasuringWindow +( + CamerIcDrvHandle_t handle, + const uint16_t x, + const uint16_t y, + const uint16_t width, + const uint16_t height +); + +/*****************************************************************************/ +/** + * @brief This function configures the grid weights in the CamerIC ISP + * histogram64 measurement module. + * + * @param handle CamerIc driver handle + * @param weights measurement mode (@see CamerIcHistWeights_t) + * + * @return Return the result of the function call. + * @retval RET_SUCCESS Configuration successfully applied + * @retval RET_OUTOFRANGE At least one perameter of out range + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspHist64SetGridWeights +( + CamerIcDrvHandle_t handle, + const CamerIcHistWeights_t weights +); + +/*****************************************************************************/ +/** + * @brief This function configures the subsample step in the CamerIC ISP + * histogram64 measurement module. + * + * @param handle CamerIc driver handle + * @param vStepSize histogram veritcal predivider, process every + * (stepsize)th line, all other lines are skipped + * @param hStepInc horizontal subsampling step counter increment. + * + * @return Return the result of the function call. + * @retval RET_SUCCESS Configuration successfully applied + * @retval RET_OUTOFRANGE At least one perameter of out range + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +RESULT CamerIcIspHIST64SetSubSampleStep +( + CamerIcDrvHandle_t handle, + const uint8_t vStepSize, + const uint32_t hStepInc +); + +/*****************************************************************************/ +/** + * @brief This function configures the subsample range in the CamerIC ISP + * histogram64 measurement module. + * + * @param handle CamerIc driver handle + * @param shift sample (left) shift will be executed after + * offset subtraction and prior to histogram evaluation + * @param offset sample offset will be subtracted from input + * sample prior to shift and histogram evaluation + * + * @return Return the result of the function call. + * @retval RET_SUCCESS Configuration successfully applied + * @retval RET_OUTOFRANGE At least one perameter of out range + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +RESULT CamerIcIspHIST64SetSubSampleRange +( + CamerIcDrvHandle_t handle, + const uint8_t shift, + const uint16_t offset +); + +/*****************************************************************************/ +/** + * @brief This function force update the histogram register in the CamerIC ISP + * histogram64 measurement module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS Configuration successfully applied + * @retval RET_OUTOFRANGE At least one perameter of out range + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +RESULT CamerIcIspHIST64FourceUpdate +( + CamerIcDrvHandle_t handle +); + +/*****************************************************************************/ +/** + * @brief This function set the histogram conefficent in the CamerIC ISP + * histogram64 measurement module. + * + * @param handle CamerIc driver handle + * @param rCoeff r coefficient + * @param gCoeff g coefficient + * @param bCoeff b coefficient + * + * @return Return the result of the function call. + * @retval RET_SUCCESS Configuration successfully applied + * @retval RET_OUTOFRANGE At least one perameter of out range + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +RESULT CamerIcIspHist64SetCoeff +( + CamerIcDrvHandle_t handle, + const float rCoeff, + const float gCoeff, + const float bCoeff +); + +/*****************************************************************************/ +/** + * @brief This function set the histogram channel in the CamerIC ISP + * histogram64 measurement module. + * + * @param handle CamerIc driver handle + * @param channel channel select + * + * @return Return the result of the function call. + * @retval RET_SUCCESS Configuration successfully applied + * @retval RET_OUTOFRANGE At least one perameter of out range + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +RESULT CamerIcIspHist64SetMeasuringChannel +( + CamerIcDrvHandle_t handle, + const CamerIcIspHist64Channel_t channel +); +#ifdef __cplusplus +} +#endif + +/* @} cameric_isp_hist64_drv_api */ + +/* @endcond */ + +#endif /* __CAMERIC_ISP_HIST64_DRV_API_H__ */ + diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_isp_hist_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_isp_hist_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..b706f38556f2b965c5583eaf56cdf74395fef0a3 --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_isp_hist_drv_api.h @@ -0,0 +1,343 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +#ifndef __CAMERIC_ISP_HIST_DRV_API_H__ +#define __CAMERIC_ISP_HIST_DRV_API_H__ + +/** + * @cond cameric_isp_hist + * + * @file cameric_isp_hist_drv_api.h + * + * @brief This file contains the CamerIC ISP HIST driver API definitions. + * + *****************************************************************************/ +/** + * @defgroup cameric_isp_hist_drv_api CamerIC ISP HIST driver API definitions + * @{ + * + * In general, a histogram is a graphical representation of the pattern of + * variation that exists in the intensity values of the color or luminance + * planes. Usually it is displayed by vertical bars drawn to indicate frequency + * levels of data collected within specific ranges. + * + * The following figure shows the position of the histogram measuring module in + * the CamerIC ISP pipeline. + * + * @image html hist.png "Overview of the CamerIC ISP HIST driver" width=\textwidth + * @image latex hist.png "Overview of the CamerIC ISP HIST driver" width=\textwidth + * + * The complete range of possible intensity values is divided into a number + * (@ref CAMERIC_ISP_HIST_NUM_BINS) of equally-sized ranges, so called @b bins . + * Each incoming intensity value is associated to one of these bins and gets + * counted for that bin only. + * + * The histogram measurement can be configured to work in one of five modes + * (@ref CamerIcIspHistMode_e): + * + * @arg R separated histogram: only the red color component of incoming RGB + * triples is measured. + * @arg G separated histogram: only the green color component of incoming RGB + * triples is measured. + * @arg B separated histogram: only the blue color component of incoming RGB + * triples is measured. + * @arg RGB combined histogram: The sum of red, green and blue component of + * the incoming RGB triples is measured. Note that it is not possible + * to calculate a luminance or grayscale histogram from an RGB histogram + * since the position information is lost during its generation. + * @arg Y (luminance) histogram: the luminance values of incoming RGB triples + * are measured. + * + * Further, the histogram measurement block can be configured to measure + * not the whole incoming image, but the pixels in a smaller window only. + * Size and position of that measuring window can be set with @ref + * CamerIcIspHistSetMeasuringWindow. + * + * The histogram measurement window is also divided into a number (@ref + * CAMERIC_ISP_HIST_GRID_ITEMS) of sub-windows. Each sub-window may be + * assigned a different weight factor, so that the contribution of the + * sub-window to the histogram bins is weighted. + * + */ +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + + + +/*****************************************************************************/ +/** + * @brief This macro defines the number of used bins. + * + *****************************************************************************/ +#ifdef ISP_HIST256 +#define CAMERIC_ISP_HIST_NUM_BINS 256 /**< number of bins */ +#else +#define CAMERIC_ISP_HIST_NUM_BINS 16 /**< number of bins */ +#endif + + +/*****************************************************************************/ +/** + * @brief This macro defines the number of used grid items ofr weightening + * measured pixels. + * + *****************************************************************************/ +#define CAMERIC_ISP_HIST_GRID_ITEMS 25 /**< number of grid sub windows */ + + + +/*****************************************************************************/ +/** + * @brief This typedef specifies an array type to configure the grid weights + * of CamerIC ISP historgam module. + * + *****************************************************************************/ +typedef uint8_t CamerIcHistWeights_t[CAMERIC_ISP_HIST_GRID_ITEMS]; + + + +/*****************************************************************************/ +/** + * @brief This typedef represents the histogram which is measured by the + * CamerIC ISP histogram module. + * + *****************************************************************************/ +typedef uint32_t CamerIcHistBins_t[CAMERIC_ISP_HIST_NUM_BINS]; + + + +/*****************************************************************************/ +/** + * @brief Enumeration type to configure CamerIC ISP histogram measuring mode. + * + *****************************************************************************/ +typedef enum CamerIcIspHistMode_e +{ + CAMERIC_ISP_HIST_MODE_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_ISP_HIST_MODE_RGB_COMBINED = 1, /**< RGB combined histogram */ + CAMERIC_ISP_HIST_MODE_R = 2, /**< R histogram */ + CAMERIC_ISP_HIST_MODE_G = 3, /**< G histogram */ + CAMERIC_ISP_HIST_MODE_B = 4, /**< B histogram */ + CAMERIC_ISP_HIST_MODE_Y = 5, /**< luminance histogram */ + CAMERIC_ISP_HIST_MODE_MAX, /**< upper border (only for an internal evaluation) */ +} CamerIcIspHistMode_t; + +typedef struct CamerIcIspHistWindow_s{ + unsigned int offsetX; + unsigned int offsetY; + unsigned int width; + unsigned int height; +}CamerIcIspHistWindow_t; + + +/*****************************************************************************/ +/** + * @brief This functions registers an Event-Callback at CamerIC ISP histogram + * measurement module. An event callback is called if the driver needs + * to inform the application layer about an asynchronous event or an + * error situation (i.e. please also @see CamerIcEventId_e). + * + * @param handle CamerIC driver handle + * @param func Callback function + * @param pUserContext User-Context + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_BUSY already a callback registered + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_INVALID_PARM a parameter is invalid + * @retval RET_WRONG_STATE driver is in wrong state to register a + * event callback (maybe the driver is already + * running) + * + *****************************************************************************/ +extern RESULT CamerIcIspHistRegisterEventCb +( + CamerIcDrvHandle_t handle, + CamerIcEventFunc_t func, + void *pUserContext +); + + + +/*****************************************************************************/ +/** + * @brief This functions deregisters/releases a registered Event-Callback + * at CamerIc ISP histogram measurement module. + * + * @param handle CamerIC driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to deregister the + * request callback + * + *****************************************************************************/ +extern RESULT CamerIcIspHistDeRegisterEventCb +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This functions enables the CamerIC ISP histogram measurement + * module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspHistEnable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This functions disables the CamerIC ISP histogram measurement + * module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspHistDisable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief Get CamerIC ISP histogram measurement module status. + * + * @param handle CamerIc driver handle. + * @param pIsEnabled + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +extern RESULT CamerIcIspHistIsEnabled +( + CamerIcDrvHandle_t handle, + bool_t *pIsEnabled +); + + + +/*****************************************************************************/ +/** + * @brief This functions configures the measurement mode of the CamerIC + * ISP histogram measurement module. + * + * @param handle CamerIc driver handle + * @param mode measurement mode (see @ref CamerIcIspHistMode_e) + * + * @return Return the result of the function call. + * @retval RET_SUCCESS Configuration successfully applied + * @retval RET_OUTOFRANGE At least one perameter of out range + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspHistSetMeasuringMode +( + CamerIcDrvHandle_t handle, + const CamerIcIspHistMode_t mode +); + + + +/*****************************************************************************/ +/** + * @brief This function sets the position and size of a the measurement + * window in the CamerIC ISP histogram measurement module. + * + * @param handle CamerIc driver handle + * @param x start x position of measuring window + * @param y start y position of measuring window + * @param width width of measuring window + * @param height height of measuring window + * + * + * @return Return the result of the function call. + * @retval RET_SUCCESS Configuration successfully applied + * @retval RET_INVALID_PARM invalid window identifier + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspHistSetMeasuringWindow +( + CamerIcDrvHandle_t handle, + const uint16_t x, + const uint16_t y, + const uint16_t width, + const uint16_t height +); + + + +/*****************************************************************************/ +/** + * @brief This function configures the grid weights in the CamerIC ISP + * histogram measurement module. + * + * @param handle CamerIc driver handle + * @param weights measurement mode (@see CamerIcHistWeights_t) + * + * @return Return the result of the function call. + * @retval RET_SUCCESS Configuration successfully applied + * @retval RET_OUTOFRANGE At least one perameter of out range + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspHistSetGridWeights +( + CamerIcDrvHandle_t handle, + const CamerIcHistWeights_t weights +); + + + +#ifdef __cplusplus +} +#endif + +/* @} cameric_isp_hist_drv_api */ + +/* @endcond */ + +#endif /* __CAMERIC_ISP_HIST_DRV_API_H__ */ + diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_isp_is_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_isp_is_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..f930788458192801f7c67352f8fb51d74c059d06 --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_isp_is_drv_api.h @@ -0,0 +1,700 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +#ifndef __CAMERIC_ISP_IS_DRV_API_H__ +#define __CAMERIC_ISP_IS_DRV_API_H__ + +/** + * @cond cameric_isp_is + * + * @file cameric_isp_is_drv_api.h + * + * @brief This file contains the CamerIC ISP IS (image stabilization) Driver + * API definitions + * + *****************************************************************************/ +/** + * @defgroup cameric_isp_is_drv_api CamerIC ISP IS Driver API definitions + * @{ + * + * @image html cameric20MP_isp_is.png "CamerIC ISP IS driver" width=\textwidth + * @image latex cameric20MP_isp_is.png "CamerIC ISP IS driver" width=\textwidth + * + * For image stabilization a sub frame must be chosen from the input frame, because + * a certain border around the output image is needed to have some margin for correcting + * the position of the image. Based on externally generated camera global motion data, + * image stabilization offers the functionality to compensate for that camera motion by + * moving the chosen sub frame across the input frame according to the signaled camera + * motion. The information source for global motion may be a motion sensor or extracted + * from the image content by a video encoder. + * + * To prevent the sub frame from running out of the input frame, the sub frame is re-centered at a + * programmable rate that is proportional to its distance from the center of the input frame. + * + * @image html cameric20MP_isp_is_parameters.png "Illustration of image stabilization parameters" width=\textwidth + * @image latex cameric20MP_isp_is_parameters.png "Illustration of image stabilization parameters" width=\textwidth + */ +#include +#include + +#include "cameric_drv_api.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + + + +/*****************************************************************************/ +/** + * @brief This functions enables the CamerIC ISP image stabilization module. + * + * Important note: This only enables the image stabilization + * functionality of the IS HW. If disabled, the IS will still output + * data, but no displacement will be applied to the configured + * output window. + * + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspIsEnable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This functions disables the CamerIC ISP image stabilization module. + * + * See also important note for CamerIcIspIsEnable. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspIsDisable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief Get CamerIC ISP image stabilization status. + * + * @param handle CamerIc driver handle. + * @param pIsEnabled Points to value indicating if image stabilization is + * enabled if function returns RET_SUCCESS + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_NULL_POINTER NULL pointer passed + * + *****************************************************************************/ +extern RESULT CamerIcIspIsIsEnabled +( + CamerIcDrvHandle_t handle, + bool_t *pIsEnabled +); + + + +/*****************************************************************************/ +/** + * @brief This functions sets the recenter exponent in the + * CamerIC ISP image stabilization. + * + * @param handle CamerIc driver handle + * @param recenterExp Exponent for recentering. A value of 0 switches + * recentering off. A value of 1 .. 7 applies a + * recentering by + * (current displacement)/(2^recenterExp) pixels + * in both directions for each frame, where the + * center position is the one programmed by + * CamerIcIspIsSetOutputWindow. + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_CONFIG invalid value of recenterExp + * + *****************************************************************************/ +extern RESULT CamerIcIspIsSetRecenterExponent +( + CamerIcDrvHandle_t handle, + uint8_t recenterExp +); + + + +/*****************************************************************************/ +/** + * @brief This functions gets the recenter exponent currently configured in + * the CamerIC ISP image stabilization. + * + * @param handle CamerIc driver handle + * @param pRecenterExp Points to current recenter exponent if function + * returns RET_SUCCESS. + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_NULL_POINTER NULL pointer passed + * + *****************************************************************************/ +extern RESULT CamerIcIspIsGetRecenterExponent +( + CamerIcDrvHandle_t handle, + uint8_t *pRecenterExp +); + + + +/*****************************************************************************/ +/** + * @brief This functions sets the output window in the + * CamerIC ISP image stabilization. The offsets given by the window are + * regarded as "centered", i.e. this is the final window which is + * output when the configured displacement is (0,0). + * + * @param handle CamerIc driver handle + * @param pOutWin Pointer to output window to be configured. + * Maximum value for each element is 0x3FFF. + * @param force_upd Update the window immediatly. + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_NULL_POINTER NULL pointer passed + * @retval RET_WRONG_CONFIG invalid window configuration + * + *****************************************************************************/ +extern RESULT CamerIcIspIsSetOutputWindow +( + CamerIcDrvHandle_t handle, + CamerIcWindow_t *pOutWin, + bool_t force_upd +); + + + +/*****************************************************************************/ +/** + * @brief This functions gets the output window currently configured in the + * CamerIC ISP image stabilization. + * + * @param handle CamerIc driver handle + * @param pOutWin Points to current configured output window + * if function returns RET_SUCCESS. + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_NULL_POINTER NULL pointer passed + * + *****************************************************************************/ +extern RESULT CamerIcIspIsGetOutputWindow +( + CamerIcDrvHandle_t handle, + CamerIcWindow_t *pOutWin +); + + + +/*****************************************************************************/ +/** + * @brief This functions gets the window as currently output by the HW, + * depending on the configured "centered" output window, the configured + * displacement and possibly applied recentering. + * + * @param handle CamerIc driver handle + * @param pDisplWin Points to current displaced output window + * if function returns RET_SUCCESS. + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_NULL_POINTER NULL pointer passed + * + *****************************************************************************/ +extern RESULT CamerIcIspIsGetDisplacedOutputWindow +( + CamerIcDrvHandle_t handle, + CamerIcWindow_t *pDisplWin +); + + + +/*****************************************************************************/ +/** + * @brief This functions sets the maximum displacement for the + * CamerIC ISP image stabilization. + * + * @param handle CamerIc driver handle + * @param maxDisplHor Maximum absolute value of horizontal + * displacement from configured "centered" output + * window. Allowed range is 0x0000 to 0x0FFF. + * @param maxDisplVer Maximum absolute value of vertical + * displacement from configured "centered" output + * window. Allowed range is 0x0000 to 0x0FFF. + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_CONFIG invalid configuration + * + *****************************************************************************/ +extern RESULT CamerIcIspIsSetMaxDisplacement +( + CamerIcDrvHandle_t handle, + uint16_t maxDisplHor, + uint16_t maxDisplVer +); + + + +/*****************************************************************************/ +/** + * @brief This functions gets the maximum displacement currently configured in + * the CamerIC ISP image stabilization. + * + * @param handle CamerIc driver handle + * @param pMaxDisplHor If function returns RET_SUCCESS, points to + * currently configured maximum absolute value of + * horizontal displacement from configured + * "centered" output window. + * @param pMaxDisplVer If function returns RET_SUCCESS, points to + * currently configured maximum absolute value of + * vertical displacement from configured + * "centered" output window. + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_NULL_POINTER NULL pointer passed + * + *****************************************************************************/ +extern RESULT CamerIcIspIsGetMaxDisplacement +( + CamerIcDrvHandle_t handle, + uint16_t *pMaxDisplHor, + uint16_t *pMaxDisplVer +); + + + +/*****************************************************************************/ +/** + * @brief This functions sets the displacement to be applied in the + * CamerIC ISP image stabilization. + * + * @param handle CamerIc driver handle + * @param displHor Horizontal displacement from configured + * "centered" output window to be applied. The + * absolute vale of displHor must not exceed the + * currently configured maximum horizontal + * displacement value. Allowed range is + * given by the configuration applied by the last + * call of CamerIcIspIsSetMaxDisplacement. + * @param displVer Vertical displacement from configured + * "centered" output window to be applied. The + * absolute vale of displVer must not exceed the + * currently configured maximum vertical + * displacement value. Allowed range is + * given by the configuration applied by the last + * call of CamerIcIspIsSetMaxDisplacement. + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_CONFIG invalid configuration + * + *****************************************************************************/ +extern RESULT CamerIcIspIsSetDisplacement +( + CamerIcDrvHandle_t handle, + int16_t displHor, + int16_t displVer +); + + + +/*****************************************************************************/ +/** + * @brief This functions gets the displacement currently configured in the + * CamerIC ISP image stabilization. + * + * @param handle CamerIc driver handle + * @param pDisplHor If function returns RET_SUCCESS, points to + * currently configured horizontal displacement + * from configured "centered" output window. + * @param pDisplVer If function returns RET_SUCCESS, points to + * currently configured vertical displacement + * from configured "centered" output window. + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_NULL_POINTER NULL pointer passed + * + *****************************************************************************/ +extern RESULT CamerIcIspIsGetDisplacement +( + CamerIcDrvHandle_t handle, + int16_t *pDisplHor, + int16_t *pDisplVer +); + + +#ifdef ISP_RAWIS +/*****************************************************************************/ +/** + * @brief This functions enables the CamerIC ISP raw image stabilization module. + * + * Important note: This only enables the image stabilization + * functionality of the IS HW. If disabled, the IS will still output + * data, but no displacement will be applied to the configured + * output window. + * + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspRawIsEnable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This functions disables the CamerIC ISP raw image stabilization module. + * + * See also important note for CamerIcIspRawIsEnable. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspRawIsDisable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief Get CamerIC ISP raw image stabilization status. + * + * @param handle CamerIc driver handle. + * @param pIsEnabled Points to value indicating if image stabilization is + * enabled if function returns RET_SUCCESS + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_NULL_POINTER NULL pointer passed + * + *****************************************************************************/ +extern RESULT CamerIcIspRawIsIsEnabled +( + CamerIcDrvHandle_t handle, + bool_t *pIsEnabled +); + + + +/*****************************************************************************/ +/** + * @brief This functions sets the recenter exponent in the + * CamerIC ISP raw image stabilization. + * + * @param handle CamerIc driver handle + * @param recenterExp Exponent for recentering. A value of 0 switches + * recentering off. A value of 1 .. 7 applies a + * recentering by + * (current displacement)/(2^recenterExp) pixels + * in both directions for each frame, where the + * center position is the one programmed by + * CamerIcIspRawIsSetOutputWindow. + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_CONFIG invalid value of recenterExp + * + *****************************************************************************/ +extern RESULT CamerIcIspRawIsSetRecenterExponent +( + CamerIcDrvHandle_t handle, + uint8_t recenterExp +); + + + +/*****************************************************************************/ +/** + * @brief This functions gets the recenter exponent currently configured in + * the CamerIC ISP raw image stabilization. + * + * @param handle CamerIc driver handle + * @param pRecenterExp Points to current recenter exponent if function + * returns RET_SUCCESS. + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_NULL_POINTER NULL pointer passed + * + *****************************************************************************/ +extern RESULT CamerIcIspRawIsGetRecenterExponent +( + CamerIcDrvHandle_t handle, + uint8_t *pRecenterExp +); + + + +/*****************************************************************************/ +/** + * @brief This functions sets the output window in the + * CamerIC ISP raw image stabilization. The offsets given by the window are + * regarded as "centered", i.e. this is the final window which is + * output when the configured displacement is (0,0). + * + * @param handle CamerIc driver handle + * @param pOutWin Pointer to output window to be configured. + * Maximum value for each element is 0x3FFF. + * @param force_upd Update the window immediatly. + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_NULL_POINTER NULL pointer passed + * @retval RET_WRONG_CONFIG invalid window configuration + * + *****************************************************************************/ +extern RESULT CamerIcIspRawIsSetOutputWindow +( + CamerIcDrvHandle_t handle, + CamerIcWindow_t *pOutWin, + bool_t force_upd +); + + + +/*****************************************************************************/ +/** + * @brief This functions gets the output window currently configured in the + * CamerIC ISP raw image stabilization. + * + * @param handle CamerIc driver handle + * @param pOutWin Points to current configured output window + * if function returns RET_SUCCESS. + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_NULL_POINTER NULL pointer passed + * + *****************************************************************************/ +extern RESULT CamerIcIspRawIsGetOutputWindow +( + CamerIcDrvHandle_t handle, + CamerIcWindow_t *pOutWin +); + + + +/*****************************************************************************/ +/** + * @brief This functions gets the window as currently output by the HW, + * depending on the configured "centered" output window, the configured + * displacement and possibly applied recentering. + * + * @param handle CamerIc driver handle + * @param pDisplWin Points to current displaced output window + * if function returns RET_SUCCESS. + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_NULL_POINTER NULL pointer passed + * + *****************************************************************************/ +extern RESULT CamerIcIspRawIsGetDisplacedOutputWindow +( + CamerIcDrvHandle_t handle, + CamerIcWindow_t *pDisplWin +); + + + +/*****************************************************************************/ +/** + * @brief This functions sets the maximum displacement for the + * CamerIC ISP raw image stabilization. + * + * @param handle CamerIc driver handle + * @param maxDisplHor Maximum absolute value of horizontal + * displacement from configured "centered" output + * window. Allowed range is 0x0000 to 0x0FFF. + * @param maxDisplVer Maximum absolute value of vertical + * displacement from configured "centered" output + * window. Allowed range is 0x0000 to 0x0FFF. + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_CONFIG invalid configuration + * + *****************************************************************************/ +extern RESULT CamerIcIspRawIsSetMaxDisplacement +( + CamerIcDrvHandle_t handle, + uint16_t maxDisplHor, + uint16_t maxDisplVer +); + + + +/*****************************************************************************/ +/** + * @brief This functions gets the maximum displacement currently configured in + * the CamerIC ISP raw image stabilization. + * + * @param handle CamerIc driver handle + * @param pMaxDisplHor If function returns RET_SUCCESS, points to + * currently configured maximum absolute value of + * horizontal displacement from configured + * "centered" output window. + * @param pMaxDisplVer If function returns RET_SUCCESS, points to + * currently configured maximum absolute value of + * vertical displacement from configured + * "centered" output window. + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_NULL_POINTER NULL pointer passed + * + *****************************************************************************/ +extern RESULT CamerIcIspRawIsGetMaxDisplacement +( + CamerIcDrvHandle_t handle, + uint16_t *pMaxDisplHor, + uint16_t *pMaxDisplVer +); + + + +/*****************************************************************************/ +/** + * @brief This functions sets the displacement to be applied in the + * CamerIC ISP raw image stabilization. + * + * @param handle CamerIc driver handle + * @param displHor Horizontal displacement from configured + * "centered" output window to be applied. The + * absolute vale of displHor must not exceed the + * currently configured maximum horizontal + * displacement value. Allowed range is + * given by the configuration applied by the last + * call of CamerIcIspRawIsSetMaxDisplacement. + * @param displVer Vertical displacement from configured + * "centered" output window to be applied. The + * absolute vale of displVer must not exceed the + * currently configured maximum vertical + * displacement value. Allowed range is + * given by the configuration applied by the last + * call of CamerIcIspRawIsSetMaxDisplacement. + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_CONFIG invalid configuration + * + *****************************************************************************/ +extern RESULT CamerIcIspRawIsSetDisplacement +( + CamerIcDrvHandle_t handle, + int16_t displHor, + int16_t displVer +); + + + +/*****************************************************************************/ +/** + * @brief This functions gets the displacement currently configured in the + * CamerIC ISP raw image stabilization. + * + * @param handle CamerIc driver handle + * @param pDisplHor If function returns RET_SUCCESS, points to + * currently configured horizontal displacement + * from configured "centered" output window. + * @param pDisplVer If function returns RET_SUCCESS, points to + * currently configured vertical displacement + * from configured "centered" output window. + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_NULL_POINTER NULL pointer passed + * + *****************************************************************************/ +extern RESULT CamerIcIspRawIsGetDisplacement +( + CamerIcDrvHandle_t handle, + int16_t *pDisplHor, + int16_t *pDisplVer +); + + +#endif + +#ifdef __cplusplus +} +#endif + +/* @} cameric_isp_is_drv_api */ + +/* @endcond */ + +#endif /* __CAMERIC_ISP_IS_DRV_API_H__ */ + diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_isp_lsc_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_isp_lsc_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..287e050086d020fe68032edf6d35c86152477e00 --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_isp_lsc_drv_api.h @@ -0,0 +1,381 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +#ifndef __CAMERIC_ISP_LSC_DRV_API_H__ +#define __CAMERIC_ISP_LSC_DRV_API_H__ + +/** + * @cond cameric_isp_lsc + * + * @file cameric_isp_lsc_drv_api.h + * + * @brief This file contains the CamerIc ISP LSC driver API definitions + * + *****************************************************************************/ +/** + * @defgroup cameric_isp_lsc_drv_api CamerIc ISP LSC driver API definitions + * @{ + * + * A significant challenge for low profile lenses is to minimize lens shading + * artifacts, also known as "vignetting". Lens shading artifacts are caused by + * decreased light intensity in the peripheral regions of the sensor due to + * the inability of the lens to focus the light in those areas in comparison + * to the centre region. Lens shading artifacts are minimized by image data + * processing with a lens shading correction algorithm. + * + * @image html lsc.png "Overview of the CamerIC ISP LSC driver" width=\textwidth + * @image latex lsc.png "Overview of the CamerIC ISP LSC driver" width=\textwidth + * + * Lens shading is different for each of its color components, since sensor + * produces no perfect response in all three color channels. Therefore the + * lens shading correction is alternatively performed identically for the + * four color components of the RGB Bayer input signal or calibrated + * independently for the color components RGB. + * + * The aim of the lens shading correction algorithm is to achieve a constant + * sensitivity across the entire frame after correction. Therefore each incoming + * pixel value PIN(x,y) is multiplied by a correction factor F(x,y). The + * correction factor depends on the coordinates of the pixel within the frame. + * + * The corrected pixel value PCOR(x,y) is calculated according: + * + * PCOR(x,y) = PIN(x,y) * F(x,y) (1) + * + * In order to increase the precision of the correction function, the frame + * is divided into 16 sectors in x and y dimension. The coordinates of each + * sector are programmable. Furthermore the lens shading correction parameters + * are programmable independently for each sector and for each color component + * within a sector. The sector coordinates apply for each color component. + * This unit will be designed so that either the lens shading correction parameters + * apply for all color components or each color component gets its own lens shading + * correction parameters. + * + * @image html lsc_sectors.png "Lens Shading Correction Sectors" width=\textwidth + * @image latex lsc_sectors.png "Lens Shading Correction Sectors" width=\textwidth + * + * To reduce hardware effort, position and size of mirrored sectors related to the + * frame center are equivalent. This means for example that size and position of + * sector X1 is equivalent to X16 related to frame center and Y3 to Y14. However + * the correction factors are independent for each sector. To reduce the memory + * for storing the coordinates of the sensor area, the size of each sector is + * programmed. Furthermore only the sizes of one quarter of the frame is programmed, + * because the sectors are symmetrical relative to the picture center. The coordinates + * are calculated by hardware during processing. + * + * Within each sector, the correction function F(x,y) can be expressed as a Bilinear + * Interpolation Function. These functions in different areas are correlated, because + * of the requirement that the correction function must be continuous and smooth. + * + * The lens shading correction unit works on RGB Bayer pattern and is placed after + * the sensor degamma and the black level correction units. + * + * @subsection Functional description + * + * The lens shading correction is based on one or more reference frames which have + * to be captured under dedicated light conditions and a dedicated position of the + * sensor. The pixels of the captured frame are then evaluated by software and the + * calculated parameters for the lens shading correction are stored in different + * tables. It is also possible to use different lens shading correction parameters + * for different environment conditions, e.g. lightness, light direction or sensor + * position. Therefore additional reference frames for the different conditions are + * to be captured and evaluated. The calculated parameters including sector settings + * can be stored in multiple tables at external memory or Flash device. Thus user + * can select one of multiple lens shading correction algorithms so that software + * can update the current required tables within the lens shading correction block. + * The correction factors at the sector corners as well as the size of the sectors + * are stored. The correction value for each pixel position is calculated using the + * bilinear interpolation. + * + */ + +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + + + +/*****************************************************************************/ +/** + * @brief This macro defines the size of lens shading data table in 16 Bit + * words. + * + *****************************************************************************/ +#define CAMERIC_DATA_TBL_SIZE 289 + + + +/*****************************************************************************/ +/** + * @brief This macro defines the size of lens shading grad table in 16 Bit + * words. + * + *****************************************************************************/ +#define CAEMRIC_GRAD_TBL_SIZE 8 + + + +/*****************************************************************************/ +/** + * @brief This macro defines the size of lens shading sectors in x or y + * direction + * + *****************************************************************************/ +#define CAMERIC_MAX_LSC_SECTORS 16 + + + +/*****************************************************************************/ +/** + * @brief Lens shade correction configuration structure + * + *****************************************************************************/ +typedef struct CamerIcIspLscConfig_s +{ + uint16_t LscRDataTbl[CAMERIC_DATA_TBL_SIZE]; /**< correction values of R color part */ + uint16_t LscGRDataTbl[CAMERIC_DATA_TBL_SIZE]; /**< correction values of G (red lines) color part */ + uint16_t LscGBDataTbl[CAMERIC_DATA_TBL_SIZE]; /**< correction values of G (blue lines) color part */ + uint16_t LscBDataTbl[CAMERIC_DATA_TBL_SIZE]; /**< correction values of B color part */ + uint16_t LscXGradTbl[CAEMRIC_GRAD_TBL_SIZE]; /**< multiplication factors of x direction */ + uint16_t LscYGradTbl[CAEMRIC_GRAD_TBL_SIZE]; /**< multiplication factors of y direction */ + uint16_t LscXSizeTbl[CAEMRIC_GRAD_TBL_SIZE]; /**< sector sizes of x direction */ + uint16_t LscYSizeTbl[CAEMRIC_GRAD_TBL_SIZE]; /**< sector sizes of y direction */ +} CamerIcIspLscConfig_t; + + + +/*****************************************************************************/ +/** + * @brief Lens shade sector configuration structure + * + *****************************************************************************/ +typedef struct CamerIcIspLscSectorConfig_s +{ + uint16_t LscXGradTbl[CAEMRIC_GRAD_TBL_SIZE]; /**< multiplication factors of x direction */ + uint16_t LscYGradTbl[CAEMRIC_GRAD_TBL_SIZE]; /**< multiplication factors of y direction */ + uint16_t LscXSizeTbl[CAEMRIC_GRAD_TBL_SIZE]; /**< sector sizes of x direction */ + uint16_t LscYSizeTbl[CAEMRIC_GRAD_TBL_SIZE]; /**< sector sizes of y direction */ +} CamerIcIspLscSectorConfig_t; + + + +/*****************************************************************************/ +/** + * @brief This function enables the ISP LSC Module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspLscEnable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This function disables the ISP LSC module (bypass the lens shade + * correction). + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspLscDisable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This function returns the status of the ISP LSC module. + * + * @param handle CamerIc driver handle + * @param pIsEnabled Pointer to value to store current state + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_NULL_POINTER pIsEnabled is a NULL pointer + * + *****************************************************************************/ +extern RESULT CamerIcIspLscIsEnabled +( + CamerIcDrvHandle_t handle, + bool_t *pIsEnabled +); + + + +/*****************************************************************************/ +/** + * @brief This function reads out the current configred lens shade + * correction configuration. + * + * @note This function also reads out the current segmentation and + * gradient tables. + * + * @param handle CamerIc driver handle + * @param pLscConfig Pointer to store the current configuration + * (@ref CamerIcIspLscConfig_t) + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_NULL_POINTER pLscConfig is a NULL pointer + * + *****************************************************************************/ +extern RESULT CamerIcIspLscGetLenseShadeCorrection +( + CamerIcDrvHandle_t handle, + CamerIcIspLscConfig_t *pLscConfig +); + + + +/*****************************************************************************/ +/** + * @brief This function sets the lens shade correction configuration. + * + * @note This function also sets the current segmentation and gradient + * tables. + * + * @param handle CamerIc driver handle. + * @param pLscConfig Pointer to lens shade correction configuration + * (@ref CamerIcIspLscConfig_t) + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_NULL_POINTER pLscConfig is a NULL pointer + * + *****************************************************************************/ +extern RESULT CamerIcIspLscSetLenseShadeCorrection +( + CamerIcDrvHandle_t handle, + const CamerIcIspLscConfig_t *pLscConfig +); + + + +/*****************************************************************************/ +/** + * @brief This function reads out the current configred lens shade + * correction configuration. + * + * @note This function also reads out the current segmentation and + * gradient tables. + * + * @param handle CamerIc driver handle + * @param pLscConfig Pointer to store the current configuration + * (@ref CamerIcIspLscConfig_t) + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_NULL_POINTER pLscConfig is a NULL pointer + * + *****************************************************************************/ +extern RESULT CamerIcIspLscGetLenseShadeSectorConfig +( + CamerIcDrvHandle_t handle, + CamerIcIspLscSectorConfig_t *pLscConfig +); + + + +/*****************************************************************************/ +/** + * @brief This function sets the lens shade correction configuration. + * + * @note This function also sets the current segmentation and gradient + * tables. + * + * @param handle CamerIc driver handle. + * @param pLscConfig Pointer to lens shade correction configuration + * (@ref CamerIcIspLscConfig_t) + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_NULL_POINTER pLscConfig is a NULL pointer + * + *****************************************************************************/ +extern RESULT CamerIcIspLscSetLenseShadeSectorConfig +( + CamerIcDrvHandle_t handle, + const CamerIcIspLscSectorConfig_t *pLscConfig +); + + + +/*****************************************************************************/ +/** + * @brief This function sets the lens shade correction matrix for all + * RGB color channels. + * + * @note The segmentation and gradient tables are unaffected by this + * function. + * + * @param handle CamerIc driver handle. + * @param pLscRDataTbl Array of lens shade correction values for red + * channel + * @param pLscGRDataTbl Array of lens shade correction values for green + * channel in red lines + * @param pLscGBDataTbl Array of lens shade correction values for green + * channel in blue lines + * @param pLscBDataTbl Array of lens shade correction values for blue + * channel + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspLscSetLenseShadeCorrectionMatrix +( + CamerIcDrvHandle_t handle, + const uint16_t *pLscRDataTbl, /**< correction values of R color part */ + const uint16_t *pLscGRDataTbl, /**< correction values of G color part */ + const uint16_t *pLscGBDataTbl, /**< correction values of G color part */ + const uint16_t *pLscBDataTbl /**< correction values of B color part */ +); + + + +#ifdef __cplusplus +} +#endif + +/* @} cameric_isp_lsc_drv_api */ + +/* @endcond */ + +#endif /* __CAMERIC_ISP_LSC_DRV_API_H__ */ + diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_isp_rgbgamma_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_isp_rgbgamma_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..3de1097189a72c08d68ef31ca4aec0f8d716260c --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_isp_rgbgamma_drv_api.h @@ -0,0 +1,155 @@ +/******************************************************************************\ +|* Copyright (c) 2020 by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ +#ifndef __CAMERIC_ISP_RGBGAMMA_DRV_API_H__ +#define __CAMERIC_ISP_RGBGAMMA_DRV_API_H__ +//#ifdef ISP_RGBGC + +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +#define CAMERIC_ISP_RGBGAMMA_PX_NUM 64 /* 64 items */ +#define CAMERIC_ISP_RGBGAMMA_DATA_X_NUM 63 /* 63 items */ +#define CAMERIC_ISP_RGBGAMMA_DATA_Y_NUM 64 /* 64 items */ + + +/******************************************************************************* + * + * CamerIcIsprgb gammaContext_t + * + * @brief + * + */ +typedef struct CamerIcIspRgbGammaContext_s +{ + bool enabled; /**< rgb gamma enabled */ + uint32_t rgbgammaRPx[CAMERIC_ISP_RGBGAMMA_PX_NUM]; /**< rgb gamma px table */ + uint32_t rgbgammaRDataX[CAMERIC_ISP_RGBGAMMA_DATA_X_NUM]; /**< rgb gamma data x table */ + uint32_t rgbgammaRDataY[CAMERIC_ISP_RGBGAMMA_DATA_Y_NUM]; /**< rgb gamma data y table */ + + uint32_t rgbgammaGPx[CAMERIC_ISP_RGBGAMMA_PX_NUM]; /**< rgb gamma px table */ + uint32_t rgbgammaGDataX[CAMERIC_ISP_RGBGAMMA_DATA_X_NUM]; /**< rgb gamma data x table */ + uint32_t rgbgammaGDataY[CAMERIC_ISP_RGBGAMMA_DATA_Y_NUM]; /**< rgb gamma data y table */ + + uint32_t rgbgammaBPx[CAMERIC_ISP_RGBGAMMA_PX_NUM]; /**< rgb gamma px table */ + uint32_t rgbgammaBDataX[CAMERIC_ISP_RGBGAMMA_DATA_X_NUM]; /**< rgb gamma data x table */ + uint32_t rgbgammaBDataY[CAMERIC_ISP_RGBGAMMA_DATA_Y_NUM]; /**< rgb gamma data y table */ +} CamerIcIspRgbGammaContext_t; + +/*****************************************************************************/ +/** + * @brief This functions enables the CamerIC ISP rgbgamma + * module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspRgbGammaEnable +( + CamerIcDrvHandle_t handle +); + + +/*****************************************************************************/ +/** + * @brief This functions disables the CamerIC ISP rgbgamma + * module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspRgbGammaDisable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief Get CamerIC ISP rgb gamma module status. + * + * @param handle CamerIc driver handle. + * @param pIsEnabled + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +extern RESULT CamerIcIspRgbGammaIsEnabled +( + CamerIcDrvHandle_t handle, + bool *pIsEnabled +); + +/****************************************************************************** + * CamerIcIspRgbGammaConfig() + * @brief config CamerIC ISP rgb gamma module. + * + * @param handle CamerIc driver handle. + * @param pRgbGammaCtx rgbgamma Context pointer + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ + +extern RESULT CamerIcIspRgbGammaConfig +( + CamerIcDrvHandle_t handle, + CamerIcIspRgbGammaContext_t *pRgbGammaCtx +); + +/****************************************************************************** + * CamerIcIspRgbGammaGetConfig() + * @brief get ISP rgb gamma module config.. + * + * @param handle CamerIc driver handle. + * @param *pRgbGammaCtx rgb gamma Context pointer + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +RESULT CamerIcIspRgbGammaGetConfig +( + CamerIcDrvHandle_t handle, + CamerIcIspRgbGammaContext_t *pRgbGammaCtx +); + + +#ifdef __cplusplus +} +#endif + +/* @} cameric_isp_rgbgamma_drv_api */ + +/* @endcond */ +//#endif /* ISP_RGBGAMMA */ +#endif /* __CAMERIC_ISP_RGBGAMMA_DRV_API_H__ */ + + diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_isp_rgbir_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_isp_rgbir_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..818237b3140d99a92c99d2924e3c3ad4d3f6e725 --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_isp_rgbir_drv_api.h @@ -0,0 +1,177 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +#ifndef __CAMERIC_ISP_RGBIR_DRV_API_H__ +#define __CAMERIC_ISP_RGBIR_DRV_API_H__ + +/** + * @file cameric_isp_rgbir_drv_api.h + * + * @brief This file contains the CamerIC ISP WDR driver API definitions. + * + *****************************************************************************/ +/** + * @cond cameric_isp_rgbir + * + * @defgroup cameric_isp_rgbir_drv_api CamerIC ISP RGBIR Driver API definitions + * @{ + * + */ +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +typedef enum CamerIcRgbirOutBpt_e { + CAMERA_IC_RGBIR_OUT_BPT_RGGB = 0, + CAMERA_IC_RGBIR_OUT_BPT_GRBG, + CAMERA_IC_RGBIR_OUT_BPT_GBRG, + CAMERA_IC_RGBIR_OUT_BPT_BGGR, +} CamerIcRgbirOutBpt_t; + +typedef enum CamerIcRgbirBpt_e{ + CAMERA_IC_RGBIR_BPT_BGGIR= 0, + CAMERA_IC_RGBIR_BPT_GRIRG, + CAMERA_IC_RGBIR_BPT_RGGIR, + CAMERA_IC_RGBIR_BPT_GBIRG, + CAMERA_IC_RGBIR_BPT_GIRRG, + CAMERA_IC_RGBIR_BPT_IRGGB, + CAMERA_IC_RGBIR_BPT_GIRBG, + CAMERA_IC_RGBIR_BPT_IRGGR, + CAMERA_IC_RGBIR_BPT_RGIRB, + CAMERA_IC_RGBIR_BPT_GRBIR, + CAMERA_IC_RGBIR_BPT_IRBRG, + CAMERA_IC_RGBIR_BPT_BIRGR, + CAMERA_IC_RGBIR_BPT_BGIRR, + CAMERA_IC_RGBIR_BPT_GBRIR, + CAMERA_IC_RGBIR_BPT_IRRBG, + CAMERA_IC_RGBIR_BPT_RIRGB, +} CamerIcRgbirBpt_t; + +typedef enum CamerIcRgbirFiltMode_e{ + CAMERA_IC_RGBIR_GREEN_FILT_STATIC= 0, + CAMERA_IC_RGBIR_GREEN_FILT_DYNAMIC, +} CamerIcRgbirFiltMode_t; + +typedef struct CamerIcIspRgbirConfig_s { + bool_t part1Enable; + bool_t part2Enable; + uint8_t dmscThreshold; + uint8_t stageSelect; + CamerIcRgbirOutBpt_t outRgbBpt; + CamerIcRgbirBpt_t rgbirBpt; + CamerIcRgbirFiltMode_t filtMode; + bool filtEnable; + + uint16_t ir_threshold, l_threshold; + uint16_t bls_r, bls_g, bls_b, bls_ir; + double gain_r, gain_g, gain_b; + double cc_mtx[12]; + double ir_sigmas; + uint16_t width, height; +} CamerIcIspRgbirConfig_t; + + +/*****************************************************************************/ +/** + * CamerIcIspRgbirEnable() + * + * @brief Enable RGBIR Module + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +RESULT CamerIcIspRgbirEnable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * CamerIcIspRgbirDisable() + * + * @brief Disable RGBIR Module + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +RESULT CamerIcIspRgbirDisable +( + CamerIcDrvHandle_t handle +); + + +/*****************************************************************************/ +/** +* CamerIcIspRgbirConfig() +* +* @brief Config RGBIR Module +* +* @param handle CamerIc driver handle +* +* @return Return the result of the function call. +* @retval RET_SUCCESS +* @retval RET_FAILURE +* +*****************************************************************************/ +RESULT CamerIcIspRgbirConfig +( + CamerIcDrvHandle_t handle, + CamerIcIspRgbirConfig_t *pRgbirCfg +); + +/*****************************************************************************/ +/** +* CamerIcIspRgbirSetIrRawOut() +* +* @brief set RGBIR Module ir raw output +* +* @param handle CamerIc driver handle +* @param enable rgbir ir raw output enable. +* +* @return Return the result of the function call. +* @retval RET_SUCCESS +* @retval RET_FAILURE +* +*****************************************************************************/ +RESULT CamerIcIspRgbirSetIrRawOut +( + CamerIcDrvHandle_t handle, + bool enable +); + +#ifdef __cplusplus +} +#endif + + + +#endif /* __CAMERIC_ISP_RGBIR_DRV_API_H__ */ + + diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_isp_stitching_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_isp_stitching_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..c95284779f082233ecc16315b7fe272cb42f6e2f --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_isp_stitching_drv_api.h @@ -0,0 +1,628 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +#ifndef __CAMERIC_ISP_STITCHING_DRV_API_H__ +#define __CAMERIC_ISP_STITCHING_DRV_API_H__ + +/** +* @file cameric_isp_stitching_drv_api.h +* +* @brief This file contains the CamerIC ISP STITCHING driver API definitions. +* +*****************************************************************************/ +/** +* @cond cameric_isp_stitching +* +* @defgroup cameric_isp_stitching_drv_api CamerIC ISP STITCHING Driver API definitions +* @{ +* +*/ +#include +#include +#include "cameric_isp_exp_drv_api.h" +#include "cameric_isp_hist_drv_api.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + + +/*****************************************************************************/ +/** + * @brief This macro defines the size of stitching compress + * Look-Up Table + * + *****************************************************************************/ +#define CAMERIC_ISP_STITCHING_LUT_SIZE 15U + + + +/******************************************************************************/ +/** + * @brief Enumeration type to configure the vertical and horizontal + * polarity type in stitching. + * + *****************************************************************************/ +typedef enum CamerIcIspStitchingPolarityType_e +{ + CAMERIC_ISP_STITCHING_POLARITY_TYPE_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_ISP_STITCHING_POLARITY_TYPE_LEVEL = 1, /**< signal from sesnro is level */ + CAMERIC_ISP_STITCHING_POLARITY_TYPE_PULSE = 2, /**< signal from sensor is pulse */ + CAMERIC_ISP_STITCHING_POLARITY_TYPE_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcIspStitchingPolarityType_t; + + + +/******************************************************************************/ +/** + * @brief Enumeration type to configure the bayer pattern in the + * stitching. + * + *****************************************************************************/ +typedef enum CamerIcIspStitchingBayerPattern_e +{ + CAMERIC_ISP_STITCHING_BAYER_PATTERN_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_ISP_STITCHING_BAYER_PATTERN_RGRGGBGB = 1, /**< 1st line: RGRG... , 2nd line GBGB... , etc. */ + CAMERIC_ISP_STITCHING_BAYER_PATTERN_GRGRBGBG = 2, /**< 1st line: GRGR... , 2nd line BGBG... , etc. */ + CAMERIC_ISP_STITCHING_BAYER_PATTERN_GBGBRGRG = 3, /**< 1st line: GBGB... , 2nd line RGRG... , etc. */ + CAMERIC_ISP_STITCHING_BAYER_PATTERN_BGBGGRGR = 4, /**< 2st line: BGBG... , 2nd line GRGR... , etc. */ + CAMERIC_ISP_STITCHING_BAYER_PATTERN_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcIspStitchingBayerPattern_t; + + +/******************************************************************************/ +/** + * @brief Enumeration type to configure bypass select mode. + * + *****************************************************************************/ +typedef enum CamerIcIspStitchingBypassSelectMode_e +{ + CAMERIC_ISP_STITCHING_BYPASS_SELECT_MODE_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_ISP_STITCHING_BYPASS_SELECT_MODE_LONG = 1, /**< select long frame */ + CAMERIC_ISP_STITCHING_BYPASS_SELECT_MODE_SHORT = 2, /**< select short frame */ + CAMERIC_ISP_STITCHING_BYPASS_SELECT_MODE_VERY_SHORT = 3, /**< select very short frame */ + CAMERIC_ISP_STITCHING_BYPASS_SELECT_MODE_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcIspStitchingBypassSelectMode_t; + + + +/******************************************************************************/ +/** + * @brief Enumeration type to configure combination mode. + * + *****************************************************************************/ +typedef enum CamerIcIspStitchingCombinationMode_e +{ + CAMERIC_ISP_STITCHING_COMBINATION_MODE_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_ISP_STITCHING_COMBINATION_MODE_0 = 1, /**< linear L+S and LV+VS*/ + CAMERIC_ISP_STITCHING_COMBINATION_MODE_1 = 2, /**< nonlinear L+S */ + CAMERIC_ISP_STITCHING_COMBINATION_MODE_2 = 3, /**< linear L+S and nonlinear LS+VS */ + CAMERIC_ISP_STITCHING_COMBINATION_MODE_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcIspStitchingCombinationMode_t; + + + +/******************************************************************************/ +/** + * @brief Enumeration type to configure base frame selection. + * + *****************************************************************************/ +typedef enum CamerIcIspStitchingBaseFrameSelection_e +{ + CAMERIC_ISP_STITCHING_BASE_FRAME_SELECTION_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_ISP_STITCHING_BASE_FRAME_SELECTION_SHORT = 1, /**< select short frame as base frame */ + CAMERIC_ISP_STITCHING_BASE_FRAME_SELECTION_LONG = 2, /**< select long frame as base frame */ + CAMERIC_ISP_STITCHING_BASE_FRAME_SELECTION_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcIspStitchingBaseFrameSelection_t; + + + +/******************************************************************************/ +/** + * @brief Enumeration type to configure hdr mode. + * + *****************************************************************************/ +typedef enum CamerIcIspStitchingHdrMode_e +{ + CAMERIC_ISP_STITCHING_HDR_MODE_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_ISP_STITCHING_HDR_MODE_DUAL_DCG = 1, /**< dual DCG mode 3x12-bit */ + CAMERIC_ISP_STITCHING_HDR_MODE_3DOL = 2, /**< dol3 frame 3x12-bit */ + CAMERIC_ISP_STITCHING_HDR_MODE_LINEBYLINE = 3, /**< 3x12-bit line by line without waiting */ + CAMERIC_ISP_STITCHING_HDR_MODE_16BIT_COMPRESS = 4, /**< 16-bit compressed data + 12-bit RAW */ + CAMERIC_ISP_STITCHING_HDR_MODE_DUAL_DCG_NOWAIT = 5, /**< 2x12-bit dual DCG without waiting */ + CAMERIC_ISP_STITCHING_HDR_MODE_2DOL = 6, /**< dol2 frame or 1 CG+VS sx12-bit RAW */ + CAMERIC_ISP_STITCHING_HDR_MODE_L_AND_S = 7, /**< L+S 2x12-bit RAW */ + CAMERIC_ISP_STITCHING_HDR_MODE_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcIspStitchingHdrMode_t; + +/******************************************************************************/ +/** + * @brief Enumeration type to configure hdr RET STR. + * + *****************************************************************************/ +typedef enum CamerIcIspStitchingHdrRdStr_e +{ + CAMERIC_ISP_STITCHING_HDR_RD_STR_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_ISP_STITCHING_HDR_RD_STR_L = 1, + CAMERIC_ISP_STITCHING_HDR_RD_STR_L_S = 2, + CAMERIC_ISP_STITCHING_HDR_RD_STR_L_S_VS = 3, + CAMERIC_ISP_STITCHING_HDR_RD_STR_L_VS = 4, + CAMERIC_ISP_STITCHING_HDR_RD_STR_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcIspStitchingHdrRdStr_t; + + +/*****************************************************************************/ +/** + * @brief Stitching properties configuration structure + * + *****************************************************************************/ +typedef struct CamerIcIspStitchingProperties_s +{ + bool regsInformEnable; + bool awbGainEnable; + uint16_t width; + uint16_t height; + uint8_t longBitDepth; + uint8_t shortBitDepth; + uint8_t vsBitDepth; + uint8_t lsBitDepth; + uint16_t longExposureTime; + uint16_t shortExposureTime; + uint16_t vsExposureTime; + uint16_t dummyShortHBlank; + uint16_t outHBlank; + uint16_t dummyVsHBlank; + uint16_t outVBlank; + CamerIcIspStitchingPolarityType_t hSyncPol; + CamerIcIspStitchingPolarityType_t vSyncPol; + CamerIcIspStitchingBayerPattern_t bayerPattern; + CamerIcIspStitchingBypassSelectMode_t bypassSelectMode; + CamerIcIspStitchingCombinationMode_t combinationMode; + CamerIcIspStitchingBaseFrameSelection_t baseFrameSelection; + CamerIcIspStitchingHdrMode_t hdrMode; +} CamerIcIspStitchingProperties_t; + + + +/*****************************************************************************/ +/** + * @brief Stitching compress LUT configuration structure + * + *****************************************************************************/ +typedef struct CamerIcIspStitchingCompressLookUpTable_s +{ + uint8_t lutFirstValidX; /**< LUT first valid x */ + uint16_t sampleVal[CAMERIC_ISP_STITCHING_LUT_SIZE]; /**< LUT sample value */ +} CamerIcIspStitchingCompressLookUpTable_t; + + + +/*****************************************************************************/ +/** +* CamerIcIspStitchingEnable() +* +* @brief Enable STITCHING Module +* +* @param handle CamerIc driver handle +* +* @return Return the result of the function call. +* @retval RET_SUCCESS +* @retval RET_FAILURE +* +*****************************************************************************/ +RESULT CamerIcIspStitchingEnable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** +* CamerIcIspStitchingDisable() +* +* @brief Disable STITCHING Module +* +* @param handle CamerIc driver handle +* +* @return Return the result of the function call. +* @retval RET_SUCCESS +* @retval RET_FAILURE +* +*****************************************************************************/ +RESULT CamerIcIspStitchingDisable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** +* CamerIcIspSetStitchingProperties() +* +* @brief Disable STITCHING Module +* +* @param handle CamerIc driver handle +* +* @return Return the result of the function call. +* @retval RET_SUCCESS +* @retval RET_FAILURE +* +*****************************************************************************/ +RESULT CamerIcIspSetStitchingProperties +( + CamerIcDrvHandle_t handle, + const CamerIcIspStitchingProperties_t *pProperties +); + + + +/*****************************************************************************/ +/** +* CamerIcIspStitchingGetBlackLevel() +* +* @brief Disable STITCHING Module +* +* @param handle CamerIc driver handle +* +* @return Return the result of the function call. +* @retval RET_SUCCESS +* @retval RET_FAILURE +* +*****************************************************************************/ +RESULT CamerIcIspStitchingGetBlackLevel +( + CamerIcDrvHandle_t handle, + uint16_t *isp_bls_a_fixed, + uint16_t *isp_bls_b_fixed, + uint16_t *isp_bls_c_fixed, + uint16_t *isp_bls_d_fixed +); + + + +/*****************************************************************************/ +/** +* CamerIcIspStitchingSetBlackLevel() +* +* @brief Disable STITCHING Module +* +* @param handle CamerIc driver handle +* +* @return Return the result of the function call. +* @retval RET_SUCCESS +* @retval RET_FAILURE +* +*****************************************************************************/ +RESULT CamerIcIspStitchingSetBlackLevel +( + CamerIcDrvHandle_t handle, + const uint16_t isp_bls_a_fixed, + const uint16_t isp_bls_b_fixed, + const uint16_t isp_bls_c_fixed, + const uint16_t isp_bls_d_fixed +); + + + +/*****************************************************************************/ +/** +* CamerIcIspStitchingGetAwbGain() +* +* @brief Disable STITCHING Module +* +* @param handle CamerIc driver handle +* +* @return Return the result of the function call. +* @retval RET_SUCCESS +* @retval RET_FAILURE +* +*****************************************************************************/ +RESULT CamerIcIspStitchingGetAwbGain +( + CamerIcDrvHandle_t handle, + CamerIcGains_t *pGains +); + + + +/*****************************************************************************/ +/** +* CamerIcIspStitchingSetAwbGain() +* +* @brief Disable STITCHING Module +* +* @param handle CamerIc driver handle +* +* @return Return the result of the function call. +* @retval RET_SUCCESS +* @retval RET_FAILURE +* +*****************************************************************************/ +RESULT CamerIcIspStitchingSetAwbGain +( + CamerIcDrvHandle_t handle, + const CamerIcGains_t *pGains +); + + + +/*****************************************************************************/ +/** +* CamerIcIspStitchingSetLinearTransRange() +* +* @brief Disable STITCHING Module +* +* @param handle CamerIc driver handle +* +* @return Return the result of the function call. +* @retval RET_SUCCESS +* @retval RET_FAILURE +* +*****************************************************************************/ +RESULT CamerIcIspStitchingSetLinearTransRange +( + CamerIcDrvHandle_t handle, + const uint16_t startLinear, + const uint16_t factorMulLinear +); + + + +/*****************************************************************************/ +/** +* CamerIcIspStitchingSetNonlinearTransRange() +* +* @brief Disable STITCHING Module +* +* @param handle CamerIc driver handle +* +* @return Return the result of the function call. +* @retval RET_SUCCESS +* @retval RET_FAILURE +* +*****************************************************************************/ +RESULT CamerIcIspStitchingSetNonlinearTransRange +( + CamerIcDrvHandle_t handle, + const uint16_t startNonLinear, + const uint16_t factorMulNonLinear +); + + + +/*****************************************************************************/ +/** +* CamerIcIspStitchingSetLSRatio() +* +* @brief Disable STITCHING Module +* +* @param handle CamerIc driver handle +* +* @return Return the result of the function call. +* @retval RET_SUCCESS +* @retval RET_FAILURE +* +*****************************************************************************/ +RESULT CamerIcIspStitchingSetLSRatio +( + CamerIcDrvHandle_t handle, + const uint16_t ratio_0, + const uint16_t ratio_1 +); + + + +/*****************************************************************************/ +/** +* CamerIcIspStitchingSetVSRatio() +* +* @brief Disable STITCHING Module +* +* @param handle CamerIc driver handle +* +* @return Return the result of the function call. +* @retval RET_SUCCESS +* @retval RET_FAILURE +* +*****************************************************************************/ +RESULT CamerIcIspStitchingSetVSRatio +( + CamerIcDrvHandle_t handle, + const uint16_t ratio_0, + const uint16_t ratio_1 +); + + + +/*****************************************************************************/ +/** +* CamerIcIspStitchingSetCompressLUT() +* +* @brief Disable STITCHING Module +* +* @param handle CamerIc driver handle +* +* @return Return the result of the function call. +* @retval RET_SUCCESS +* @retval RET_FAILURE +* +*****************************************************************************/ +RESULT CamerIcIspStitchingSetCompressLUT +( + CamerIcDrvHandle_t handle, + const CamerIcIspStitchingCompressLookUpTable_t *pCompessLut +); + + + +/*****************************************************************************/ +/** +* CamerIcIspStitchingGetExtBit() +* +* @brief Disable STITCHING Module +* +* @param handle CamerIc driver handle +* +* @return Return the result of the function call. +* @retval RET_SUCCESS +* @retval RET_FAILURE +* +*****************************************************************************/ +RESULT CamerIcIspStitchingGetExtBit +( + CamerIcDrvHandle_t handle, + uint8_t *pLsExtBit, + uint8_t *pVsExtBit +); + + + +/*****************************************************************************/ +/** +* CamerIcIspStitchingSetExtBit() +* +* @brief Disable STITCHING Module +* +* @param handle CamerIc driver handle +* +* @return Return the result of the function call. +* @retval RET_SUCCESS +* @retval RET_FAILURE +* +*****************************************************************************/ +RESULT CamerIcIspStitchingSetExtBit +( + CamerIcDrvHandle_t handle, + const uint8_t lsExtBit, + const uint8_t vsExtBit +); +RESULT CamerIcIspStitchingDigitalGainSet(CamerIcDrvHandle_t handle, + const uint16_t isp_digital_gain_r_fixed, + const uint16_t isp_digital_gain_g_fixed, + const uint16_t isp_digital_gain_gr_fixed, + const uint16_t isp_digital_gain_gb_fixed); + + + +/*****************************************************************************/ +/** +* CamerIcIspStitchingSetVSParams() +* +* @brief Disable STITCHING Module +* +* @param handle CamerIc driver handle +* +* @return Return the result of the function call. +* @retval RET_SUCCESS +* @retval RET_FAILURE +* +*****************************************************************************/ +RESULT CamerIcIspStitchingSetVSParams +( + CamerIcDrvHandle_t handle, + const uint16_t vs_valid_thresh, + const uint16_t vs_valid_offset_val +); + + + +/*****************************************************************************/ +/** +* CamerIcIspStitchingSetLSParams() +* +* @brief Disable STITCHING Module +* +* @param handle CamerIc driver handle +* +* @return Return the result of the function call. +* @retval RET_SUCCESS +* @retval RET_FAILURE +* +*****************************************************************************/ +RESULT CamerIcIspStitchingSetLSParams +( + CamerIcDrvHandle_t handle, + const uint16_t long_sat_thresh, + const uint16_t long_combine_weight +); + + + +/*****************************************************************************/ +/** +* CamerIcIspStitchingSetColorWeight() +* +* @brief Disable STITCHING Module +* +* @param handle CamerIc driver handle +* +* @return Return the result of the function call. +* @retval RET_SUCCESS +* @retval RET_FAILURE +* +*****************************************************************************/ +RESULT CamerIcIspStitchingSetColorWeight +( + CamerIcDrvHandle_t handle, + const uint8_t weight0, + const uint8_t weight1, + const uint8_t weight2 +); + + +RESULT CamerIcIspStitchingIsEnabled +( + CamerIcDrvHandle_t handle, + bool_t *pIsEnabled +); + +RESULT CamerIcIspStitchingHdrMode +( + CamerIcDrvHandle_t handle, + int *pHdrMode +); + +/*****************************************************************************/ +/** +* CamerIcIspStitchingSetRdWrStr() +* +* @brief set stitching RdWr str. +* +* @param handle CamerIc driver handle +* +* @return Return the result of the function call. +* @retval RET_SUCCESS +* @retval RET_FAILURE +* +*****************************************************************************/ +RESULT CamerIcIspStitchingSetRdWrStr +( + CamerIcDrvHandle_t handle, + uint8_t rdWrStr +); +#ifdef __cplusplus +} +#endif + +/* @} cameric_isp_stitching_drv_api */ + +/* @endcond */ + +#endif /* __CAMERIC_ISP_STITCHING_DRV_API_H__ */ + diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_isp_stitching_exp_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_isp_stitching_exp_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..748a6d58dde3106937c3e7672ba4952b4a2b0cc0 --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_isp_stitching_exp_drv_api.h @@ -0,0 +1,205 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +#ifndef __CAMERIC_ISP_STITCHING_EXP_DRV_API_H__ +#define __CAMERIC_ISP_STITCHING_EXP_DRV_API_H__ + +/** + * @cond cameric_isp_stitching_exp + * + * @file cameric_isp_stitching_exp_drv_api.h + * + * @brief This file contains the CamerIC ISP AE Driver API definitions + * + *****************************************************************************/ +/** + * @defgroup cameric_isp_exp_drv_api CamerIC ISP AE Driver API definitions + * @{ + * + * @image html exp.png "Overview of the CamerIC ISP CAC driver" width=\textwidth + * @image latex exp.png "Overview of the CamerIC ISP CAC driver" width=\textwidth + * + * @image html exp_grid.png "Luminance Measurement Grid" width=0.8\textwidth + * @image latex exp_grid.png "Luminance Measurement Grid" width=0.8\textwidth + * + */ +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + + +extern RESULT CamerIcIspStitchingExpRegisterEventCb +( + CamerIcDrvHandle_t handle, + CamerIcEventFunc_t func, + void *pUserContext +); + + + +/*****************************************************************************/ +/** + * @brief This functions deregisters/releases a registered Event-Callback + * at CamerIc ISP histogram measurement module. + * + * @param handle CamerIC driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to deregister the + * request callback + * + *****************************************************************************/ +extern RESULT CamerIcIspStitchingExpDeRegisterEventCb +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This functions enables the CamerIC ISP exposure measurement + * module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspStitchingExpEnable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This functions disables the CamerIC ISP exposure measurement + * module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspStitchingExpDisable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief Get CamerIC ISP exposure measurement module status. + * + * @param handle CamerIc driver handle. + * @param pIsEnabled + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +extern RESULT CamerIcIspStitchingExpIsEnabled +( + CamerIcDrvHandle_t handle, + bool_t *pIsEnabled +); + + + +/*****************************************************************************/ +/** + * @brief This functions configures the measurement mode of the CamerIC + * ISP exposure measurement module. + * + * @param handle CamerIc driver handle + * @param mode measurement mode (@see CamerIcIspHistMode_e) + * + * @return Return the result of the function call. + * @retval RET_SUCCESS Configuration successfully applied + * @retval RET_OUTOFRANGE At least one perameter of out range + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +RESULT CamerIcIspStitchingExpSetMeasuringMode +( + CamerIcDrvHandle_t handle, + const CamerIcIspExpMeasuringMode_t mode +); + + +/*****************************************************************************/ +/** + * @brief This function sets the position and size of a the measurement + * window in the CamerIC ISP exposure measurement module. + * + * @note This function calculates the grid-size by dividing the width and + * height by 5. + * + * @param handle CamerIc driver handle + * @param x start x position of measuring window + * @param y start y position of measuring window + * @param width width of measuring window + * @param height height of measuring window + * + * @return Return the result of the function call. + * @retval RET_SUCCESS Configuration successfully applied + * @retval RET_INVALID_PARM invalid window identifier + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspStitchingExpSetMeasuringWindow +( + CamerIcDrvHandle_t handle, + const uint16_t x, + const uint16_t y, + const uint16_t width, + const uint16_t height +); + +RESULT CamerIcIspStitchingStart +( + CamerIcDrvHandle_t handle +); + +RESULT CamerIcIspStitchingStop +( + CamerIcDrvHandle_t handle +); + +#ifdef __cplusplus +} +#endif + +/* @} cameric_isp_exp_drv_api */ + +/* @endcond */ + +#endif /* __CAMERIC_ISP_EXP_DRV_API_H__ */ + diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_isp_stitching_hist_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_isp_stitching_hist_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..999136a05cad56f9f8e4af94a2ab42b837aab7b5 --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_isp_stitching_hist_drv_api.h @@ -0,0 +1,268 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +#ifndef __CAMERIC_ISP_STITCHING_HIST_DRV_API_H__ +#define __CAMERIC_ISP_STITCHING_HIST_DRV_API_H__ + +/** + * @cond cameric_isp_hist + * + * @file cameric_isp_hist_drv_api.h + * + * @brief This file contains the CamerIC ISP HIST driver API definitions. + * + *****************************************************************************/ +/** + * @defgroup cameric_isp_hist_drv_api CamerIC ISP HIST driver API definitions + * @{ + * + * In general, a histogram is a graphical representation of the pattern of + * variation that exists in the intensity values of the color or luminance + * planes. Usually it is displayed by vertical bars drawn to indicate frequency + * levels of data collected within specific ranges. + * + * The following figure shows the position of the histogram measuring module in + * the CamerIC ISP pipeline. + * + * @image html hist.png "Overview of the CamerIC ISP HIST driver" width=\textwidth + * @image latex hist.png "Overview of the CamerIC ISP HIST driver" width=\textwidth + * + * The complete range of possible intensity values is divided into a number + * (@ref CAMERIC_ISP_HIST_NUM_BINS) of equally-sized ranges, so called @b bins . + * Each incoming intensity value is associated to one of these bins and gets + * counted for that bin only. + * + * The histogram measurement can be configured to work in one of five modes + * (@ref CamerIcIspStitchingHistMode_e): + * + * @arg R separated histogram: only the red color component of incoming RGB + * triples is measured. + * @arg G separated histogram: only the green color component of incoming RGB + * triples is measured. + * @arg B separated histogram: only the blue color component of incoming RGB + * triples is measured. + * @arg RGB combined histogram: The sum of red, green and blue component of + * the incoming RGB triples is measured. Note that it is not possible + * to calculate a luminance or grayscale histogram from an RGB histogram + * since the position information is lost during its generation. + * @arg Y (luminance) histogram: the luminance values of incoming RGB triples + * are measured. + * + * Further, the histogram measurement block can be configured to measure + * not the whole incoming image, but the pixels in a smaller window only. + * Size and position of that measuring window can be set with @ref + * CamerIcIspStitchingHistSetMeasuringWindow. + * + * The histogram measurement window is also divided into a number (@ref + * CAMERIC_ISP_HIST_GRID_ITEMS) of sub-windows. Each sub-window may be + * assigned a different weight factor, so that the contribution of the + * sub-window to the histogram bins is weighted. + * + */ +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +/*****************************************************************************/ +/** + * @brief This functions registers an Event-Callback at CamerIC ISP histogram + * measurement module. An event callback is called if the driver needs + * to inform the application layer about an asynchronous event or an + * error situation (i.e. please also @see CamerIcEventId_e). + * + * @param handle CamerIC driver handle + * @param func Callback function + * @param pUserContext User-Context + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_BUSY already a callback registered + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_INVALID_PARM a parameter is invalid + * @retval RET_WRONG_STATE driver is in wrong state to register a + * event callback (maybe the driver is already + * running) + * + *****************************************************************************/ +extern RESULT CamerIcIspStitchingHistRegisterEventCb +( + CamerIcDrvHandle_t handle, + CamerIcEventFunc_t func, + void *pUserContext +); + + + +/*****************************************************************************/ +/** + * @brief This functions deregisters/releases a registered Event-Callback + * at CamerIc ISP histogram measurement module. + * + * @param handle CamerIC driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to deregister the + * request callback + * + *****************************************************************************/ +extern RESULT CamerIcIspStitchingHistDeRegisterEventCb +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This functions enables the CamerIC ISP histogram measurement + * module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspStitchingHistEnable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This functions disables the CamerIC ISP histogram measurement + * module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspStitchingHistDisable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief Get CamerIC ISP histogram measurement module status. + * + * @param handle CamerIc driver handle. + * @param pIsEnabled + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +extern RESULT CamerIcIspStitchingHistIsEnabled +( + CamerIcDrvHandle_t handle, + bool_t *pIsEnabled +); + + + +/*****************************************************************************/ +/** + * @brief This functions configures the measurement mode of the CamerIC + * ISP histogram measurement module. + * + * @param handle CamerIc driver handle + * @param mode measurement mode (see @ref CamerIcIspStitchingHistMode_e) + * + * @return Return the result of the function call. + * @retval RET_SUCCESS Configuration successfully applied + * @retval RET_OUTOFRANGE At least one perameter of out range + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +RESULT CamerIcIspStitchingHistSetMeasuringMode +( + CamerIcDrvHandle_t handle, + const CamerIcIspHistMode_t mode +); + + + +/*****************************************************************************/ +/** + * @brief This function sets the position and size of a the measurement + * window in the CamerIC ISP histogram measurement module. + * + * @param handle CamerIc driver handle + * @param x start x position of measuring window + * @param y start y position of measuring window + * @param width width of measuring window + * @param height height of measuring window + * + * + * @return Return the result of the function call. + * @retval RET_SUCCESS Configuration successfully applied + * @retval RET_INVALID_PARM invalid window identifier + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspStitchingHistSetMeasuringWindow +( + CamerIcDrvHandle_t handle, + const uint16_t x, + const uint16_t y, + const uint16_t width, + const uint16_t height +); + + + +/*****************************************************************************/ +/** + * @brief This function configures the grid weights in the CamerIC ISP + * histogram measurement module. + * + * @param handle CamerIc driver handle + * @param weights measurement mode (@see CamerIcHistWeights_t) + * + * @return Return the result of the function call. + * @retval RET_SUCCESS Configuration successfully applied + * @retval RET_OUTOFRANGE At least one perameter of out range + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ + +#ifdef __cplusplus +} +#endif + +/* @} cameric_isp_hist_drv_api */ + +/* @endcond */ + +#endif /* __CAMERIC_ISP_HIST_DRV_API_H__ */ + diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_isp_tdnr3_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_isp_tdnr3_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..5539ae9b4fdcea36e83e6f2f2c949373ddfe8fa5 --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_isp_tdnr3_drv_api.h @@ -0,0 +1,264 @@ +#ifndef __CAMERIC_ISP_TDNR_DRV_API_H__ +#define __CAMERIC_ISP_TDNR_DRV_API_H__ + +/** +* @file cameric_isp_3dnr_drv_api.h +* +* @brief This file contains the CamerIC ISP TDNR driver API definitions. +* +*****************************************************************************/ +/** +* @cond cameric_isp_3dnr +* +* @defgroup cameric_isp_3dnr_drv_api CamerIC ISP TDNR Driver API definitions +* @{ +* +*/ +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +typedef struct CamerIcIspTdnr3Config_s { + bool enable; + bool enable_inv_gamma; + bool enable_pre_gamma; + bool enable_motion_erosion; + bool enable_motion_converage; + bool enable_motion_dilation; + bool enable_tnr; + bool enable_2dnr; + uint8_t strength; // [0, 128] + uint16_t noise_level; // [0, 100] -> [0, 65535] + uint16_t motion_slope; // [0, 100] -> [0, 2047] + uint16_t sad_weight; // [0, 16] + uint16_t update_factor; // [0, 1024] + uint16_t motion_update_factor; // [0, 1024] + + uint16_t dnr2_sigma; // [0, 8] + uint16_t dnr2_strength; // [0, 32] + uint16_t motion_inv_factor; + uint16_t noise_mean; + uint16_t motion_mean; + uint16_t pre_motion_weight; + uint16_t range_h; + uint16_t range_v; + uint16_t dilate_range_h; + uint16_t noise_threshold; +} CamerIcIspTdnr3Config_t; + +typedef struct CamerIcIspTdnr3Stats_s{ + uint32_t bg_sum; + uint32_t motion_sum; + uint32_t bg_pixel_cnt; + uint32_t motion_pixel_cnt; + uint32_t frame_avg; +} CamerIcIspTdnr3Stats_t; + +/*****************************************************************************/ +/** +* CamerIcIsp3DnrV3Enable() +* +* @brief Enable 3DNRv3 Module +* +* @param handle CamerIc driver handle +* +* @return Return the result of the function call. +* @retval RET_SUCCESS +* @retval RET_FAILURE +* +*****************************************************************************/ +RESULT CamerIcIsp3DnrV3Enable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** +* CamerIcIsp3DnrV3Disable() +* +* @brief Enable 3DNRv3 Module +* +* @param handle CamerIc driver handle +* +* @return Return the result of the function call. +* @retval RET_SUCCESS +* @retval RET_FAILURE +* +*****************************************************************************/ +RESULT CamerIcIsp3DnrV3Disable +( + CamerIcDrvHandle_t handle +); + +RESULT CamerIcIspTdnrPropertyEnable +( + CamerIcDrvHandle_t handle +); + +RESULT CamerIcIspTdnrPropertyDisable +( + CamerIcDrvHandle_t handle +); + +RESULT CamerIcIspTdnrIsPropertyEnabled +( + CamerIcDrvHandle_t handle, + bool_t *pIsEnabled +); + +/*****************************************************************************/ +/** +* CamerIcIspTdnr3Enable() +* +* @brief Enable TDNR Module +* +* @param handle CamerIc driver handle +* +* @return Return the result of the function call. +* @retval RET_SUCCESS +* @retval RET_FAILURE +* +*****************************************************************************/ +RESULT CamerIcIspTdnr3Enable +( + CamerIcDrvHandle_t handle +); + + +/*****************************************************************************/ +/** +* CamerIcIspTdnr3Disable() +* +* @brief Disable TDNR Module +* +* @param handle CamerIc driver handle +* +* @return Return the result of the function call. +* @retval RET_SUCCESS +* @retval RET_FAILURE +* +*****************************************************************************/ +RESULT CamerIcIspTdnr3Disable +( + CamerIcDrvHandle_t handle +); + + +/*****************************************************************************/ +/** +* CamerIcIspTdnr3UpdateCurve() +* +* @brief Config 3dnr of TDNR Module Curve +* +* @param handle CamerIc driver handle +* @param DENOISE3D_model_a noise model parameters, calibrated according to gain +* @param DENOISE3D_model_b noise model parameters, calibrated according to gain +* +* @return Return the result of the function call. +* @retval RET_SUCCESS +* @retval RET_FAILURE +* +*****************************************************************************/ +RESULT CamerIcIspTdnr3UpdateCurve +( + CamerIcDrvHandle_t handle, + float DENOISE3D_model_a, + float DENOISE3D_model_b +); + +/*****************************************************************************/ +/** +* CamerIcIspTdnr3NoiseUpdate() +* +* @brief update TDNR Module register noise config +* +* @param handle CamerIc driver handle +* +* @return Return the result of the function call. +* @retval RET_SUCCESS +* @retval RET_FAILURE +* +*****************************************************************************/ +RESULT CamerIcIspTdnr3NoiseUpdate +( + CamerIcDrvHandle_t handle, + float autoStrength +); + +/*****************************************************************************/ +/** +* CamerIcIspTdnr3Update() +* +* @brief update TDNR Module threshold update & motion threshold update +* +* @param handle CamerIc driver handle +* +* @return Return the result of the function call. +* @retval RET_SUCCESS +* @retval RET_FAILURE +* +*****************************************************************************/ +RESULT CamerIcIspTdnr3ThrUpdate +( + CamerIcDrvHandle_t handle, + int tnr_update_factor, + int tnr_motion_update_factor +); + +/*****************************************************************************/ +/** +* CamerIcIspTdnr3SetStrength() +* +* @brief set TDNR Module's denoiseStrength +* +* @param handle CamerIc driver handle +* @param denoiseStrength strength +* +* @return Return the result of the function call. +* @retval RET_SUCCESS +* @retval RET_FAILURE +* +*****************************************************************************/ +RESULT CamerIcIspTdnr3SetStrength( + CamerIcDrvHandle_t handle, + unsigned int denoiseStrength +); + + +RESULT CamerIcIspTdnr3GetConfig( + CamerIcDrvHandle_t handle, + CamerIcIspTdnr3Config_t *pConfig +); + +RESULT CamerIcIspTdnr3SetConfig( + CamerIcDrvHandle_t handle, + const CamerIcIspTdnr3Config_t *pConfig +); + +RESULT CamerIcIspTdnr3GetStats( + CamerIcDrvHandle_t handle, + CamerIcIspTdnr3Stats_t *pStats +); + +RESULT CamerIcIspTdnr3GetWindow( + CamerIcDrvHandle_t handle, + CamerIcWindow_t *pWindow +); + + +#ifdef __cplusplus +} +#endif + +/* @} cameric_isp_3dnr_drv_api */ + +/* @endcond */ + +#endif /* __CAMERIC_ISP_TDNR_DRV_API_H__ */ + diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_isp_tpg_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_isp_tpg_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..5a5a10a29733204be94eb5ba5a8afd2350090aad --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_isp_tpg_drv_api.h @@ -0,0 +1,105 @@ +/******************************************************************************\ +|* Copyright (c) 2020 by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +#ifndef __CAMERIC_ISP_TPG_DRV_API_H__ +#define __CAMERIC_ISP_TPG_DRV_API_H__ + +/** + * @file cameric_isp_tpg_drv_api.h + * + * @brief This file contains the CamerIC ISP compand driver API definitions. + * + *****************************************************************************/ +/** + * @cond cameric_isp_compand + * + * @defgroup cameric_isp_compand_drv_api CamerIC ISP compand Driver API definitions + * @{ + * + */ +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + + + +/*****************************************************************************/ +/** + * CamerIcIspTpgEnable() + * + * @brief Enable TPG Module + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +RESULT CamerIcIspTpgEnable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * CamerIcIspTpgDisable() + * + * @brief Disable TPG Module + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +RESULT CamerIcIspTpgDisable +( + CamerIcDrvHandle_t handle +); + +/*****************************************************************************/ +/** + * CamerIcIspTpgConfigMode() + * + * @brief Config TPG mode + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_WRONG_HANDLE + * + *****************************************************************************/ +RESULT CamerIcIspTpgConfig +( + CamerIcDrvHandle_t handle, + CamerIcIspTpgConfig_t *pTpgConfig + +); + + +#ifdef __cplusplus +} +#endif + + + +#endif /* __CAMERIC_ISP_TPG_DRV_API_H__ */ + diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_isp_vsm_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_isp_vsm_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..cd2ef0fd428f63409ff083c053c2b0de03865215 --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_isp_vsm_drv_api.h @@ -0,0 +1,291 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +#ifndef __CAMERIC_ISP_VSM_DRV_API_H__ +#define __CAMERIC_ISP_VSM_DRV_API_H__ + +/** + * @cond cameric_isp_vsm + * + * @file cameric_isp_vsm_drv_api.h + * + * @brief This file contains the CamerIC ISP VSM (video stabilization) Driver + * API definitions + * + *****************************************************************************/ +/** + * @defgroup cameric_isp_vsm_drv_api CamerIC ISP VSM Driver API definitions + * @{ + * + * The video stabilization measurement is done in two steps. + * At first the vector accumulation unit calculates one line and one column projection vector + * for each frame which is the accumulated sum of all row pixels respectively column pixels. + * Two versions of these vectors are stored in SRAM buffers, one from the current frame + * and one from the previous frame. + * + * In the second step the correlation units analyze the correlation between these vectors, + * to find the global minimum of the correlation function in horizontal and vertical direction. + * The correlation function is the sum of all absolute differences between the current and + * the old stored vector with an index offset of delta. The point, where the correlation value + * reaches its minimum, indicates the displacement value. + * + * To program the measure window consider the following restrictions: \n + * + * @arg vsm_h_size is limited from 64 to 1920, but must not exceed isp_h_size - vsm_h_offs. + * @arg vsm_v_size is limited from 64 to 1088, but must not exceed isp_v_size - vsm_v_offs. + * @arg vsm_h_size and vsm_v_size must be even values (bit 0 is fixed to zero). + * @arg A border of at least 2 pixels around the measure window is recommended to + * exclude interpolation artifacts near the edges of the input frame. + * @arg For processing requirements the absolute max value for vsm_X_segments is + * ( vsm_X_size - 48 ) / 16, (X either h or v). + * @arg To prevent detection errors the delta range should be limited to the necessary + * range. The recommended max horizontal/vertical segments value should not + * exceed Size / 64. + * + * @image html cameric20MP_isp_vsm_window.png "Measure Window" width=0.75\textwidth + * @image latex cameric20MP_isp_vsm_window.png "Measure Window" width=0.75\textwidth + * + */ +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + + +/*****************************************************************************/ +/** + * @brief CamerIc ISP video stabilization measurement displacement vector. + * + *****************************************************************************/ +typedef struct CamerIcIspVsmDisplVec_s +{ + int16_t delta_h; /**< horizontal displacement */ + int16_t delta_v; /**< vertical displacement */ +} CamerIcIspVsmDisplVec_t; + + + +/*****************************************************************************/ +/** + * @brief Data to be passed in event callback. + * + *****************************************************************************/ +typedef struct CamerIcIspVsmEventData_s +{ + uint32_t frameId; /**< ID of the frame to which the measured + displacement vector belongs. */ + CamerIcIspVsmDisplVec_t DisplVec; /**< latest calculated displacement vector */ +} CamerIcIspVsmEventData_t; + + + +/*****************************************************************************/ +/** + * @brief This functions registers an Event-Callback at CamerIC ISP VSM + * measurement module. An event callback is called if the driver needs + * to inform the application layer about an asynchronous event or an + * error situation (i.e. please also @see CamerIcEventId_e). + * + * @param handle CamerIc driver handle + * @param func Callback function + * @param pUserContext User-Context + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_BUSY already a callback registered + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_INVALID_PARM a parameter is invalid + * @retval RET_WRONG_STATE driver is in wrong state to register a + * event callback (maybe the driver is already + * running) + * + *****************************************************************************/ +extern RESULT CamerIcIspVsmRegisterEventCb +( + CamerIcDrvHandle_t handle, + CamerIcEventFunc_t func, + void *pUserContext +); + + + +/*****************************************************************************/ +/** + * @brief This functions deregisters/releases a registered Event-Callback + * at CamerIc ISP VSM measurement module. + * + * @param handle CamerIC driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to deregister the + * request callback + * + *****************************************************************************/ +extern RESULT CamerIcIspVsmDeRegisterEventCb +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This functions enables the CamerIC ISP video stabilization + * measurement module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspVsmEnable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This functions disables the CamerIC ISP video stabilization + * measurement module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcIspVsmDisable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief Get CamerIC ISP video stabilization measurement module status. + * + * @param handle CamerIc driver handle. + * @param pIsEnabled + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +extern RESULT CamerIcIspVsmIsEnabled +( + CamerIcDrvHandle_t handle, + bool_t *pIsEnabled +); + + + +/*****************************************************************************/ +/** + * @brief This function sets the position and size of a the measurement + * window in the CamerIC ISP video stabilization measurement module. + * + * @param handle CamerIc driver handle + * @param pMeasureWin Pointer to measuring window parameters + * @param horSegments Number of horizontal 16 point segments used + * for first step of correlation function. + * If h_segments is even, horizontal displacements + * checked in first step are [-8*h_segments, + * -8*h_segments + 16, ..., -16, 0, +16, ..., + * +8*h_segments - 16, +8*h_segments], + * If h_segments is odd, horizontal displacements + * checked in first step are [-8*h_segments, + * -8*h_segments + 16, ..., -8, +8, ..., + * +8*h_segments - 16, +8*h_segments]. + * @param verSegments Number of vertical 16 point segments used + * for first step of correlation function, + * analogous to h_segments. + * + * @return Return the result of the function call. + * @retval RET_SUCCESS Configuration successfully applied + * @retval RET_INVALID_PARM invalid window identifier + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_NULL_POINTER NULL pointer passed + * @retval RET_WRONG_CONFIG Configuration is invalid + * @retval RET_OUTOFRANGE Configuration parameters are out of range + * + *****************************************************************************/ +extern RESULT CamerIcIspVsmSetMeasuringWindow +( + CamerIcDrvHandle_t handle, + CamerIcWindow_t *pMeasureWin, + uint8_t horSegments, + uint8_t verSegments +); + + + +/*****************************************************************************/ +/** + * @brief This function retrieves the currently configured + * measuring window. + * + * @param handle CamerIc driver handle + * @param pMeasureWin Pointer to configured measuring window + * parameters if function returns RET_SUCCESS. + * @param pHorSegments Pointer to configured number of horizontal 16 + * point segments used for first step of + * correlation function, if function returns + * RET_SUCCESS. + * @param verSegments Pointer to configured number of horizontal 16 + * point segments used for first step of + * correlation function, if function returns + * RET_SUCCESS. + * + * @return Return the result of the function call. + * @retval RET_SUCCESS Configuration successfully applied + * @retval RET_INVALID_PARM invalid window identifier + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_NULL_POINTER NULL pointer passed + * + *****************************************************************************/ +extern RESULT CamerIcIspVsmGetMeasuringWindow +( + CamerIcDrvHandle_t handle, + CamerIcWindow_t *pMeasureWin, + uint8_t *pHorSegments, + uint8_t *pVerSegments +); + + + +#ifdef __cplusplus +} +#endif + +/* @} cameric_isp_vsm_drv_api */ + +/* @endcond */ + +#endif /* __CAMERIC_ISP_VSM_DRV_API_H__ */ + diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_isp_wdr2_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_isp_wdr2_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..72ebc6b3ae4a97f4be9443b5c10c17636684205b --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_isp_wdr2_drv_api.h @@ -0,0 +1,164 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +#ifndef __CAMERIC_ISP_WDR2_DRV_API_H__ +#define __CAMERIC_ISP_WDR2_DRV_API_H__ + +/** + * @file cameric_isp_wdr2_drv_api.h + * + * @brief This file contains the CamerIC ISP WDR driver API definitions. + * + *****************************************************************************/ +/** + * @cond cameric_isp_wdr2 + * + * @defgroup cameric_isp_wdr2_drv_api CamerIC ISP WDR2 Driver API definitions + * @{ + * + */ +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +#define CAMERIC_WDR2_MAX_COEFFS 33 +#define CAMERIC_WDR2_MAX_SEGMENTS ( CAMERIC_WDR2_MAX_COEFFS - 1 ) + + + +/******************************************************************************* + * + * CamerIcIspWdr2ToneCurve_t + * + * @brief + * + */ +typedef struct CamerIcIspWdr2ToneCurve_s +{ + uint16_t Segment[CAMERIC_WDR2_MAX_SEGMENTS]; + uint16_t Ym[CAMERIC_WDR2_MAX_COEFFS]; +} CamerIcIspWdr2ToneCurve_t; + + + + +/*****************************************************************************/ +/** + * CamerIcIspWdr2Enable() + * + * @brief Enable WDR2 Module + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +RESULT CamerIcIspWdr2Enable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * CamerIcIspWdr2Disable() + * + * @brief Disable WDR2 Module + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +RESULT CamerIcIspWdr2Disable +( + CamerIcDrvHandle_t handle +); + +/*****************************************************************************/ +/** + * CamerIcIspWdr2SetStaticDemoConfig() + * + * @brief Set static WDR2 configuration; quick hack for demo purposes only! + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +RESULT CamerIcIspWdr2SetStaticDemoConfig +( + CamerIcDrvHandle_t handle +); + +/*********************************************************************** +**************************************************************** +*Modify by Fei for demo Only Start!!! +**************************************************************** +************************************************************************/ +RESULT CamerIcIspWdr2SetStaticDemoConfigCurve0 +( + CamerIcDrvHandle_t handle +); + + +RESULT CamerIcIspWdr2SetStaticDemoConfigCurve1 +( + CamerIcDrvHandle_t handle +); + +RESULT CamerIcIspWdr2SetStaticDemoConfigCurve2 +( + CamerIcDrvHandle_t handle +); + +RESULT CamerIcIspWdr2SetStaticDemoConfigCurve3 +( + CamerIcDrvHandle_t handle +); + +/*********************************************************************** +**************************************************************** +*Modify by Fei for demo Only End!!! +**************************************************************** +************************************************************************/ +RESULT CamerIcIspWdr2SetStrength +( + CamerIcDrvHandle_t handle, + float wdr2CurveStrength +); + +#ifdef __cplusplus +} +#endif + +/* @} cameric_isp_wdr_drv_api */ + +/* @endcond */ + +#endif /* __CAMERIC_ISP_WDR2_DRV_API_H__ */ + diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_isp_wdr3_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_isp_wdr3_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..c705ed0839149763f264790095f14456e412fa47 --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_isp_wdr3_drv_api.h @@ -0,0 +1,174 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +#ifndef __CAMERIC_ISP_WDR3_DRV_API_H__ +#define __CAMERIC_ISP_WDR3_DRV_API_H__ + +/** + * @file cameric_isp_wdr3_drv_api.h + * + * @brief This file contains the CamerIC ISP WDR driver API definitions. + * + *****************************************************************************/ +/** + * @cond cameric_isp_wdr3 + * + * @defgroup cameric_isp_wdr3_drv_api CamerIC ISP WDR3 Driver API definitions + * @{ + * + */ +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + + +typedef struct CamerIcIspWdr3Config_s { + uint8_t strength; /**< strength */ + uint8_t globalStrength; /**< globalStrength */ + uint8_t maxGain; /**< maxGain */ +} CamerIcIspWdr3Config_t; + + +/*****************************************************************************/ +/** + * CamerIcIspWdr3Enable() + * + * @brief Enable WDR3 Module + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +RESULT CamerIcIspWdr3Enable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * CamerIcIspWdr3Disable() + * + * @brief Disable WDR3 Module + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +RESULT CamerIcIspWdr3Disable +( + CamerIcDrvHandle_t handle +); + + +/*****************************************************************************/ +/** +* CamerIcIspWdr3Config() +* +* @brief Config WDR3 Module +* +* @param handle CamerIc driver handle +* +* @return Return the result of the function call. +* @retval RET_SUCCESS +* @retval RET_FAILURE +* +*****************************************************************************/ +RESULT CamerIcIspWdr3Config +( + CamerIcDrvHandle_t handle, + CamerIcIspWdr3Config_t *pWdr3Cfg +); + +RESULT CamerIcIspWdr3SetLowlightStrength +( + CamerIcDrvHandle_t handle, + float strength +); + +RESULT CamerIcIspWdr3SetGammadownCurve +( + CamerIcDrvHandle_t handle, + unsigned short* pGammadownCurve +); + +RESULT CamerIcIspWdr3SetLocalStrength +( + CamerIcDrvHandle_t handle, + int strength +); + +RESULT CamerIcIspWdr3SetPixelSlope +( + CamerIcDrvHandle_t handle, + unsigned char merge_slope, + unsigned char merge_base, + unsigned char adjust_slope, + unsigned char adjust_base +); + +RESULT CamerIcIspWdr3SetEntropySlope +( + CamerIcDrvHandle_t handle, + unsigned short slope, + unsigned short base +); + +RESULT CamerIcIspWdr3GetHistogram(CamerIcDrvHandle_t handle, unsigned int* bin); +RESULT CamerIcIspWdr3SetHistogram(CamerIcDrvHandle_t handle, unsigned int* bin); + +RESULT CamerIcIspWdr3GetGammaup(CamerIcDrvHandle_t handle, unsigned int* bin); +RESULT CamerIcIspWdr3SetGammaup(CamerIcDrvHandle_t handle, unsigned int* bin); + +RESULT CamerIcIspWdr3GetEntropy(CamerIcDrvHandle_t handle, unsigned int* bin); +RESULT CamerIcIspWdr3SetEntropy(CamerIcDrvHandle_t handle, unsigned int* bin); + +RESULT CamerIcIspWdr3GetDistanceWeight(CamerIcDrvHandle_t handle, unsigned int* bin); +RESULT CamerIcIspWdr3SetDistanceWeight(CamerIcDrvHandle_t handle, unsigned int* bin); + +RESULT CamerIcIspWdr3GetDiffWeight(CamerIcDrvHandle_t handle, unsigned int* bin); +RESULT CamerIcIspWdr3SetDiffWeight(CamerIcDrvHandle_t handle, unsigned int* bin); + +RESULT CamerIcIspWdr3GetInvertLinear(CamerIcDrvHandle_t handle, unsigned int* bin); +RESULT CamerIcIspWdr3SetInvertLinear(CamerIcDrvHandle_t handle, unsigned int* bin); + +RESULT CamerIcIspWdr3GetInvertCurve(CamerIcDrvHandle_t handle, unsigned int* bin); +RESULT CamerIcIspWdr3SetInvertCurve(CamerIcDrvHandle_t handle, unsigned int* bin); + +RESULT CamerIcIspWdr3GetSigma(CamerIcDrvHandle_t handle, int* pSigmaWidth, int* pSigmaHeight, int* pSigmaValue); +RESULT CamerIcIspWdr3SetSigma(CamerIcDrvHandle_t handle, int w, int h, int val); + +bool CamerIcIspWdr3IsEnable(CamerIcDrvHandle_t handle); + +#ifdef __cplusplus +} +#endif + + + +#endif /* __CAMERIC_ISP_WDR3_DRV_API_H__ */ + diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_isp_wdr4_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_isp_wdr4_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..25b5c8ee67cb55ad384a62512e8b18187c4c1562 --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_isp_wdr4_drv_api.h @@ -0,0 +1,213 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +#ifndef __CAMERIC_ISP_WDR4_DRV_API_H__ +#define __CAMERIC_ISP_WDR4_DRV_API_H__ + +/** + * @file cameric_isp_wdr4_drv_api.h + * + * @brief This file contains the CamerIC ISP WDR driver API definitions. + * + *****************************************************************************/ +/** + * @cond cameric_isp_wdr4 + * + * @defgroup cameric_isp_wdr4_drv_api CamerIC ISP WDR4 Driver API definitions + * @{ + * + */ +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + + +typedef struct CamerIcIspWdr4Config_s { + uint8_t strength; /**< strength */ + uint8_t highStrength; /**< highStrength */ + uint8_t lowStrength; /**< lowStrength */ + uint8_t globalStrength; /**< globalStrength */ + int contrast; /**< contrast */ + uint8_t flatStrength; /**< flatStrength */ + uint8_t flatThreshold; /**< flatThreshold */ +} CamerIcIspWdr4Config_t; + +RESULT CamerIcIspWdr4Init +( + CamerIcDrvHandle_t handle +); + +RESULT CamerIcIspWdr4Release +( + CamerIcDrvHandle_t handle +); +/*****************************************************************************/ +/** + * CamerIcIspWdr4Enable() + * + * @brief Enable WDR4 Module + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +RESULT CamerIcIspWdr4Enable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * CamerIcIspWdr4Disable() + * + * @brief Disable WDR4 Module + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +RESULT CamerIcIspWdr4Disable +( + CamerIcDrvHandle_t handle +); + +RESULT CamerIcIspWdr4PropertyEnable +( + CamerIcDrvHandle_t handle +); + +RESULT CamerIcIspWdr4PropertyDisable +( + CamerIcDrvHandle_t handle +); + +RESULT CamerIcIspWdr4IsPropertyEnabled +( + CamerIcDrvHandle_t handle, + bool_t *pIsEnabled +); + +/*****************************************************************************/ +/** +* CamerIcIspWdr4Config() +* +* @brief Config WDR4 Module +* +* @param handle CamerIc driver handle +* +* @return Return the result of the function call. +* @retval RET_SUCCESS +* @retval RET_FAILURE +* +*****************************************************************************/ +RESULT CamerIcIspWdr4Config +( + CamerIcDrvHandle_t handle, + CamerIcIspWdr4Config_t *pWdr4Cfg +); + +RESULT CamerIcIspWdr4SetFlat +( + CamerIcDrvHandle_t handle, + uint8_t strength, + uint8_t threshold +); + +/*****************************************************************************/ +/** +* CamerIcIspWdr4StoreHdrRatio() +* +* @brief Config WDR4 Module +* +* @param handle CamerIc driver handle +* @param ratioLSVS, hdr long exposure and very short exposure +* @param ratioLS hdr long exposure and short exposure +* @return Return the result of the function call. +* @retval RET_SUCCESS +* @retval RET_FAILURE +* +*****************************************************************************/ +RESULT CamerIcIspWdr4StoreHdrRatio +( + CamerIcDrvHandle_t handle, + uint8_t ratioLSVS, + uint8_t ratioLS +); + +RESULT CamerIcIspWdr4GetEnable +( + CamerIcDrvHandle_t handle, + bool *pEnabled +); + +RESULT CamerIcIspWdr4GetLowStrength +( + CamerIcDrvHandle_t handle, + uint32_t *low_strength +); + +RESULT CamerIcIspWdr4SetEntropy +( + CamerIcDrvHandle_t handle, + uint32_t *entropy +); + +RESULT CamerIcIspWdr4SetGammaPre +( + CamerIcDrvHandle_t handle, + uint32_t *gammapre +); + +RESULT CamerIcIspWdr4SetGammaUp +( + CamerIcDrvHandle_t handle, + uint32_t *gammaup +); + +RESULT CamerIcIspWdr4SetGammaDown +( + CamerIcDrvHandle_t handle, + uint32_t *gammadown +); + +RESULT CamerIcIspWdr4SetEntropySlope +( + CamerIcDrvHandle_t handle, + uint32_t slope, + uint32_t base +); + +#ifdef __cplusplus +} +#endif + + + +#endif /* __CAMERIC_ISP_WDR4_DRV_API_H__ */ + + diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_isp_wdr_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_isp_wdr_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..1decb71255921c7473b6985d91a398cda142cdda --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_isp_wdr_drv_api.h @@ -0,0 +1,208 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +#ifndef __CAMERIC_ISP_WDR_DRV_API_H__ +#define __CAMERIC_ISP_WDR_DRV_API_H__ + +/** + * @file cameric_isp_wdr_drv_api.h + * + * @brief This file contains the CamerIC ISP WDR driver API definitions. + * + *****************************************************************************/ +/** + * @cond cameric_isp_wdr + * + * @defgroup cameric_isp_wdr_drv_api CamerIC ISP WDR Driver API definitions + * @{ + * + */ +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +#define CAMERIC_WDR_MAX_COEFFS 33 +#define CAMERIC_WDR_MAX_SEGMENTS ( CAMERIC_WDR_MAX_COEFFS - 1 ) + + + +/******************************************************************************* + * + * CamerIcIspWdrToneCurve_t + * + * @brief + * + */ +typedef struct CamerIcIspWdrToneCurve_s +{ + uint16_t Segment[CAMERIC_WDR_MAX_SEGMENTS]; + uint16_t Ym[CAMERIC_WDR_MAX_COEFFS]; +} CamerIcIspWdrToneCurve_t; + + + +/*****************************************************************************/ +/** + * CamerIcIspWdrEnable() + * + * @brief Enable WDR Module + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +RESULT CamerIcIspWdrEnable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * CamerIcIspWdrDisable() + * + * @brief Disable WDR Module + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +RESULT CamerIcIspWdrDisable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * CamerIcIspWdrSetRgbOffset() + * + * @brief Set RGB Offset + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +RESULT CamerIcIspWdrSetRgbOffset +( + CamerIcDrvHandle_t handle, + const uint32_t RgbOffset +); + + + +/*****************************************************************************/ +/** + * CamerIcIspWdrSetLumOffset() + * + * @brief Set Luminance Offset + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +RESULT CamerIcIspWdrSetLumOffset +( + CamerIcDrvHandle_t handle, + const uint32_t LumOffset +); + + + +/*****************************************************************************/ +/** + * CamerIcIspWdrSetStaticDemoConfig() + * + * @brief Set static WDR configuration; quick hack for demo purposes only! + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +RESULT CamerIcIspWdrSetStaticDemoConfig +( + CamerIcDrvHandle_t handle +); + +/*********************************************************************** +**************************************************************** +*Modify by Fei for demo Only Start!!! +**************************************************************** +************************************************************************/ +RESULT CamerIcIspWdrSetStaticDemoConfigCurve0 +( + CamerIcDrvHandle_t handle +); + + +RESULT CamerIcIspWdrSetStaticDemoConfigCurve1 +( + CamerIcDrvHandle_t handle +); + +RESULT CamerIcIspWdrSetStaticDemoConfigCurve2 +( + CamerIcDrvHandle_t handle +); + +RESULT CamerIcIspWdrSetStaticDemoConfigCurve3 +( + CamerIcDrvHandle_t handle +); + +/*********************************************************************** +**************************************************************** +*Modify by Fei for demo Only End!!! +**************************************************************** +************************************************************************/ +RESULT CamerIcIspWdrSetCurve +( + CamerIcDrvHandle_t handle, + uint16_t *Ym, + uint8_t *dY +); + +#ifdef __cplusplus +} +#endif + +/* @} cameric_isp_wdr_drv_api */ + +/* @endcond */ + +#endif /* __CAMERIC_ISP_DPF_DRV_API_H__ */ + diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_jpe_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_jpe_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..16a729ea23fe45d48ed27f8bf5b9a625f9340979 --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_jpe_drv_api.h @@ -0,0 +1,334 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +#ifndef __CAMERIC_JPE_DRV_API_H__ +#define __CAMERIC_JPE_DRV_API_H__ + +/** + * @cond cameric_jpe + * + * @file cameric_jpe_drv_api.h + * + * @brief This file contains the CamerIC JPE driver API definitions. + * + *****************************************************************************/ +/** + * @defgroup cameric_jpe_drv_api CamerIc JPE driver API definitions + * @{ + * + * + * + */ +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + + + +/******************************************************************************/ +/** + * @brief Enumeration type to configure CamerIC JPE working mode. + * + *****************************************************************************/ +typedef enum CamerIcJpeMode_e +{ + CAMERIC_JPE_MODE_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_JPE_MODE_SINGLE_SHOT = 1, /**< only one frame */ + CAMERIC_JPE_MODE_SHORT_CONTINUOUS = 2, /**< motion jpeg ( only first frame with header ) */ + CAMERIC_JPE_MODE_LARGE_CONTINUOUS = 3, /**< motion jpeg ( every frame with header ) */ + CAMERIC_JPE_MODE_SCALADO = 4, /**< single snapshot with Scalado encoding */ + CAMERIC_JPE_MODE_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcJpeMode_t; + + + +/******************************************************************************/ +/** + * @brief Enumeration type to configure CamerIC JPE luminance input scaling. + * + *****************************************************************************/ +typedef enum CamerIcJpeLuminanceScale_e +{ + CAMERIC_JPE_LUMINANCE_SCALE_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_JPE_LUMINANCE_SCALE_ENABLE = 1, /**< scaling Y input from [16..235] to [0..255] */ + CAMERIC_JPE_LUMINANCE_SCALE_DISABLE = 2, /**< no Y input scaling */ + CAMERIC_JPE_LUMINANCE_SCALE_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcJpeLuminanceScale_t; + + + +/******************************************************************************/ +/** + * @brief Enumeration type to configure CamerIC JPE chrominance input scaling. + * + *****************************************************************************/ +typedef enum CamerIcJpeChrominaceScale_e +{ + CAMERIC_JPE_CHROMINANCE_SCALE_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_JPE_CHROMINANCE_SCALE_ENABLE = 1, /**< scaling Cb/Cr input from [16..235] to [0..255] */ + CAMERIC_JPE_CHROMINANCE_SCALE_DISABLE = 2, /**< no Cb/Cr input scaling */ + CAMERIC_JPE_CHROMINANCE_SCALE_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcJpeChrominaceScale_t; + + + +/******************************************************************************/ +/** + * @brief Enumeration type to configure CamerIC JPE compression level + * + *****************************************************************************/ +typedef enum CamerIcJpeCompressionLevel_e +{ + CAMERIC_JPE_COMPRESSION_LEVEL_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_JPE_COMPRESSION_LEVEL_HIGH = 1, /**< */ + CAMERIC_JPE_COMPRESSION_LEVEL_LOW = 2, /**< */ + CAMERIC_JPE_COMPRESSION_LEVEL_01_PRECENT = 3, /**< */ + CAMERIC_JPE_COMPRESSION_LEVEL_20_PERCENT = 4, /**< */ + CAMERIC_JPE_COMPRESSION_LEVEL_30_PERCENT = 5, /**< */ + CAMERIC_JPE_COMPRESSION_LEVEL_40_PERCENT = 6, /**< */ + CAMERIC_JPE_COMPRESSION_LEVEL_50_PERCENT = 7, /**< */ + CAMERIC_JPE_COMPRESSION_LEVEL_60_PERCENT = 8, /**< */ + CAMERIC_JPE_COMPRESSION_LEVEL_70_PERCENT = 9, /**< */ + CAMERIC_JPE_COMPRESSION_LEVEL_80_PERCENT = 10, /**< */ + CAMERIC_JPE_COMPRESSION_LEVEL_90_PERCENT = 11, /**< */ + CAMERIC_JPE_COMPRESSION_LEVEL_99_PERCENT = 12, /**< */ + CAMERIC_JPE_COMPRESSION_LEVEL_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcJpeCompressionLevel_t; + + + +/******************************************************************************/ +/** + * @brief Enumeration type to configure CamerIC JPE header + * + *****************************************************************************/ +typedef enum CamerIcJpeHeader_e +{ + CAMERIC_JPE_HEADER_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_JPE_HEADER_NONE = 1, + CAMERIC_JPE_HEADER_JFIF = 2, + CAMERIC_JPE_HEADER_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcJpeHeader_t; + + + + +/******************************************************************************/ +/** + * @brief Enumeration type to configure CamerIC JPE compression level + * + *****************************************************************************/ +typedef struct CamerIcJpeConfig_s +{ + CamerIcJpeMode_t mode; /**< encoder mode */ + CamerIcJpeCompressionLevel_t level; /**< compression level */ + + CamerIcJpeLuminanceScale_t yscale; /**< luminace upscale mode (BT601 -> full range) */ + CamerIcJpeChrominaceScale_t cscale; /**< chrominance upscale mode (BT601 -> full range) */ + + uint16_t width; /**< frame width */ + uint16_t height; /**< frame height */ +} CamerIcJpeConfig_t; + + + +/*****************************************************************************/ +/** + * @brief This functions enables the CamerIC JPE module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +RESULT CamerIcJpeEnable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This functions disables the CamerIC JPE module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +RESULT CamerIcJpeDisable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This function returns the status of the CamerIC JPE module. + * + * @param handle CamerIc driver handle + * @param pIsEnabled Pointer to value to store current state + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_NULL_POINTER pIsEnabled is a NULL pointer + * + *****************************************************************************/ +extern RESULT CamerIcJpeIsEnabled +( + CamerIcDrvHandle_t handle, + bool_t *pIsEnabled +); + + + +/*****************************************************************************/ +/** + * @brief This function configures the JPE module. + * + * @param handle CamerIC driver handle + * @param pConfig pointer to jpe configuration structure + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_NOTSUPP selected working mode is not supported + * @retval RET_NULL_POINTER null pointer + * @retval RET_BUSY image effects already enabled + * + *****************************************************************************/ +extern RESULT CamerIcJpeConfigure +( + CamerIcDrvHandle_t handle, + CamerIcJpeConfig_t *pConfig +); + + + +/*****************************************************************************/ +/** + * @brief This functions registers an Event-Callback at CamerIC Jpeg + * Encoder Module. An event callback is called if the driver + * needs to inform the application layer about an asynchronous event + * or an error situation (i.e. please also see @ref CamerIcEventId_e). + * + * @param handle CamerIc driver handle + * @param func Callback function + * @param pUserContext User-Context + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_BUSY already a callback registered + * @retval RET_WRONG_HANDLE given handle is invalid + * @retval RET_INVALID_PARM given parameter is invalid + * @retval RET_WRONG_STATE driver is in wrong state to register a + * event callback + * + *****************************************************************************/ +extern RESULT CamerIcJpeRegisterEventCb +( + CamerIcDrvHandle_t handle, + CamerIcEventFunc_t func, + void *pUserContext +); + + + +/*****************************************************************************/ +/** + * @brief This functions deregisters/releases a registered Event-Callback + * at CamerIC Jpeg Encoder Interface Module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE given handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to deregister the + * event callback + * + *****************************************************************************/ +extern RESULT CamerIcJpeDeRegisterEventCb +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This function starts the JPEG header generation + * + * @param handle CamerIc driver handle + * @param hmode mode (see @ref CamerIcJpeMode_e) + * + * @return Return the result of the function call. + * @retval RET_SUCCESS Configuration successfully applied + * @retval RET_OUTOFRANGE At least one perameter of out range + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcJpeStartHeaderGeneration +( + CamerIcDrvHandle_t handle, + const CamerIcJpeHeader_t header +); + + + +/*****************************************************************************/ +/** + * @brief This function starts CamerIC JPE data encoding. + * + * @param handle CamerIc driver handle + * @param mode mode (see @ref CamerIcJpeMode_e) + * + * @return Return the result of the function call. + * @retval RET_SUCCESS Configuration successfully applied + * @retval RET_OUTOFRANGE At least one perameter of out range + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcJpeStartEncoding +( + CamerIcDrvHandle_t handle, + const CamerIcJpeMode_t mode +); + + + +#ifdef __cplusplus +} +#endif + +/* @} cameric_jpe_drv_api */ + +/* @endcond */ + +#endif /* __CAMERIC_JPE_DRV_API_H__ */ + diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_mi_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_mi_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..e88bf10116db1142d86d7c8b1755f7685aed0d9e --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_mi_drv_api.h @@ -0,0 +1,887 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +#ifndef __CAMERIC_MI_DRV_API_H__ +#define __CAMERIC_MI_DRV_API_H__ + +/** + * @file cameric_mi_drv_api.h + * + * @brief This file contains the CamerIC MI driver API definitions. + * + *****************************************************************************/ +/** + * @cond cameric_mi + * + * @defgroup cameric_mi_drv_api CamerIc MI Driver API definitions + * @{ + * + * The Memory Interface module is able to write data from the main picture path + * to the system memory. For the main picture path alternatively one of raw data, + * main picture path resize, or JPEG encoder output paths could be used. The MI + * module is also able to write data from the self picture path to the system memory. + * Further on the DMA read port path could be used to read an image from the system + * memory, e.g. as input for the Super Impose (SI) module. The Memory Interface Driver + * serves as an abstraction layer, so the application does not need to know which bit + * has to be set where in the registers of the MI module. + * + * @image html mi.png "Overview of the CamerIC MI driver" width=\textwidth + * @image latex mi.png "Overview of the CamerIC MI driver" width=\textwidth + * + * The Memory interface module driver also abstracts the scaler-units in the + * main and self path (see MRSZ or SRSZ). + * + */ +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +#define CAMERIC_ALIGN_SIZE ALIGN_SIZE_1K +#define CAMERIC_MI_ALIGN ALIGN_UP_1K + + + +/*****************************************************************************/ +/** + * @brief Enumeration type to identify the CamerIC output path + * + *****************************************************************************/ +typedef enum CamerIcMiPath_e +{ + CAMERIC_MI_PATH_INVALID = -1, /**< lower border (only for an internal evaluation) */ + CAMERIC_MI_PATH_MAIN = 0, /**< main path index */ + CAMERIC_MI_PATH_SELF = 1, /**< self path index */ + CAMERIC_MI_PATH_SELF2_BP = 2, /**< self path index */ +#ifdef ISP_MI_MCM_WR + CAMERIC_MI_PATH_MCM_WR0 , /** ABCDEFGH */ + CAMERIC_MI_MP_OUTPUT_BYTE_SWAP_BYTE = 1, /** 3'b001: ABCDEFGH => BADCFEHG */ + CAMERIC_MI_MP_OUTPUT_BYTE_SWAP_WORD = 2, /** 3'b010: ABCDEFGH => CDABGHEF */ + CAMERIC_MI_MP_OUTPUT_BYTE_SWAP_WORD_BYTE = 3, /** 3'b011: ABCDEFGH => DCBAHGFE */ + CAMERIC_MI_MP_OUTPUT_BYTE_SWAP_DWORD = 4, /** 3'b100: ABCDEFGH => EFGHABCD */ + CAMERIC_MI_MP_OUTPUT_BYTE_SWAP_DWORD_BYTE = 5, /** 3'b101: ABCDEFGH => FEHGBADC */ + CAMERIC_MI_MP_OUTPUT_BYTE_SWAP_DWORD_WORD = 6, /** 3'b110: ABCDEFGH => GHEFCDAB */ + CAMERIC_MI_MP_OUTPUT_BYTE_SWAP_DWORD_WORD_BYTE = 7, /** 3'b111: ABCDEFGH => HGFEDCBA */ + CAMERIC_MI_MP_OUTPUT_BYTE_SWAP_MAX /**< upper border (only for an internal evaluation) */ +}CamerIcMiMpOutputByteSwap_t; +#endif + +#ifdef ISP_MI_HANDSHAKE_NANO +/*****************************************************************************/ +/** + * @brief Enumeration type to specify the NANO ISP handshake enable status + * HW Active high + * + *****************************************************************************/ +typedef enum CamerIcMiMpHandshakeSwitch_e +{ + CAMERIC_MI_MP_HANDSHK_SWITCH_DISABLE = 0, /** handshake disable */ + CAMERIC_MI_MP_HANDSHK_SWITCH_ENABLE = 1, /** handshake enalbe */ + CAMERIC_MI_MP_HANDSHK_SWITCH_MAX /**< upper border (only for an internal evaluation) */ +}CamerIcMiMpHandshakeSwitch_t; + +/*****************************************************************************/ +/** + * @brief Enumeration type to specify the NANO ISP handshake storage format + * Planar + * Semi planar, for YCbCr4:2:x + * Interleaved(combiled), for YCbCr 4:2:2 only or RAW format. + * + *****************************************************************************/ +typedef enum CamerIcMiMpHandshakeStorageFormat_e +{ + CAMERIC_MI_MP_HANDSHK_STORAGE_FMT_PLANAR = 0, /**00: Planar */ + CAMERIC_MI_MP_HANDSHK_STORAGE_FMT_SEMIPLANAR = 1, /**01: SemiPlanar */ + CAMERIC_MI_MP_HANDSHK_STORAGE_FMT_INTERLEAVED = 2, /**10: Interleaved */ + CAMERIC_MI_MP_HANDSHK_STORAGE_FMT_MAX /**< upper border (only for an internal evaluation) */ +}CamerIcMiMpHandshakeStorageFormat_t; + +/*****************************************************************************/ +/** + * @brief Enumeration type to specify the NANO ISP handshake data format + * RAW foramt + * Reserved + * YUV422 + * YUV420 + * + *****************************************************************************/ +typedef enum CamerIcMiMpHandshakeDataFormat_e +{ + CAMERIC_MI_MP_HANDSHK_DATA_FMT_RAW = 0, /**00: Raw format */ + CAMERIC_MI_MP_HANDSHK_DATA_FMT_RESERVED = 1, /**01: Reserved */ + CAMERIC_MI_MP_HANDSHK_DATA_FMT_YUV422 = 2, /**10: YUV422 */ + CAMERIC_MI_MP_HANDSHK_DATA_FMT_YUV420 = 3, /**11: YUV420 */ + CAMERIC_MI_MP_HANDSHK_DATA_FMT_MAX /**< upper border (only for an internal evaluation) */ +}CamerIcMiMpHandshakeDataFormat_t; + +/*****************************************************************************/ +/** + * @brief Typedef struct type to specify the NANO ISP handshake control parameters + * Handshake control setting for registers. + * Handshake address settings for registers. + * Handshake slice control settings for registers. + * + *****************************************************************************/ +typedef struct CamerIcMiMpHandshake_s{ + CamerIcMiMpHandshakeSwitch_t handshk_switch; + CamerIcMiMpHandshakeStorageFormat_t storage_fmt; + CamerIcMiMpHandshakeDataFormat_t data_fmt; + + uint32_t line_per_slice_minus1; + uint32_t slice_per_buffer_minus1; + uint32_t ack_count; + + uint32_t mp_y_base_ad_init; + uint32_t mp_cb_base_ad_init; + uint32_t mp_cr_base_ad_init; + + uint32_t mp_y_llength_pixel; + uint32_t mp_y_slice_offset_bytes; + uint32_t mp_c_slice_offset_bytes; + + uint32_t mp_y_pic_width_pixel; + uint32_t mp_y_pic_height_pixel; + uint32_t mp_y_pic_size_pixel; //auto calculation, no need to fill + + uint32_t mp_y_buf_size; //Y buffer size, no need to fill + uint32_t mp_c_buf_size; //Cb buffer size, no need to fill + + uint8_t* p_y_buffer; //For handshake sw testbench, no need to fill + uint8_t* p_cb_buffer; //For handshake sw testbench, no need to fill + uint8_t* p_cr_buffer; //For handshake sw testbench, no need to fill +}CamerIcMiMpHandshake_t; + +#endif + +#ifdef ISP_DEC +//#ifdef HAL_CMODEL + +typedef struct CamerIcCmpPrm_s{ + char* dstFileName; +}CamerIcCmpPrm_t; +//#endif +#endif + +/*****************************************************************************/ +/** + * @brief Enumeration type to specify the picture orientation on the self + * path + * + *****************************************************************************/ +//! self picture operating modes +typedef enum CamerIcMiOrientation_e +{ + CAMERIC_MI_ORIENTATION_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_MI_ORIENTATION_ORIGINAL = 1, /**< no rotation, no horizontal or vertical flipping */ + CAMERIC_MI_ORIENTATION_VERTICAL_FLIP = 2, /**< vertical flipping (no additional rotation) */ + CAMERIC_MI_ORIENTATION_HORIZONTAL_FLIP = 3, /**< horizontal flipping (no additional rotation) */ + CAMERIC_MI_ORIENTATION_ROTATE90 = 4, /**< rotation 90 degrees ccw (no additional flipping) */ + CAMERIC_MI_ORIENTATION_ROTATE180 = 5, /**< rotation 180 degrees ccw (equal to horizontal plus vertical flipping) */ + CAMERIC_MI_ORIENTATION_ROTATE270 = 6, /**< rotation 270 degrees ccw (no additional flipping) */ + +#if 0 + eMrvMifSp_Rot_090_V_Flip = 6, //!< rotation 90 degrees ccw plus vertical flipping + eMrvMifSp_Rot_270_V_Flip = 7 //!< rotation 270 degrees ccw plus vertical flipping +#endif + + CAMERIC_MI_ORIENTATION_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcMiOrientation_t; + + + +/*****************************************************************************/ +/** + * @brief This function registers a Request-Callback at the CamerIC Memory + * Interface Module. A request callback is called if the driver + * needs an interaction from the application layer (i.e. a new image + * buffer to fill, please also see @ref CamerIcRequestId_e). + * + * @param handle CamerIc driver handle + * @param func Callback function + * @param pUserContext User-Context + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_BUSY already a callback registered + * @retval RET_WRONG_HANDLE given handle is invalid + * @retval RET_INVALID_PARM given parameter is invalid + * @retval RET_WRONG_STATE driver is in wrong state to register a + * request callback + * + *****************************************************************************/ +extern RESULT CamerIcMiRegisterRequestCb +( + CamerIcDrvHandle_t handle, + CamerIcRequestFunc_t func, + void *pUserContext +); + + + +/*****************************************************************************/ +/** + * @brief This functions deregisters/releases a registered Request-Callback + * at CamerIC Memory Interface Module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE given handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to deregister the + * request callback + * + *****************************************************************************/ +extern RESULT CamerIcMiDeRegisterRequestCb +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This functions registers an Event-Callback at CamerIC Memory + * Interface Module. An event callback is called if the driver + * needs to inform the application layer about an asynchronous event + * or an error situation (i.e. please also see @ref CamerIcEventId_e). + * + * @param handle CamerIc driver handle + * @param func Callback function + * @param pUserContext User-Context + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_BUSY already a callback registered + * @retval RET_WRONG_HANDLE given handle is invalid + * @retval RET_INVALID_PARM given parameter is invalid + * @retval RET_WRONG_STATE driver is in wrong state to register a + * event callback + * + *****************************************************************************/ +extern RESULT CamerIcMiRegisterEventCb +( + CamerIcDrvHandle_t handle, + CamerIcEventFunc_t func, + void *pUserContext +); + + + +/*****************************************************************************/ +/** + * @brief This functions deregisters/releases a registered Event-Callback + * at CamerIC Memory Interface Module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE given handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to deregister the + * event callback + * + *****************************************************************************/ +extern RESULT CamerIcMiDeRegisterEventCb +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This functions configures the burstlength to use for luminance + * and chrominance planes. + * + * @note It could be more efficient to configure different burstlength + * depending on the pixel subsampling (YUV422, YUV400, ... ) + * + * @param handle CamerIc driver handle + * @param y_burstlength burstlegth of luminace plane + * @param c_burstlength burstlegth of chrominace plane + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_WRONG_HANDLE given handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to set burstlength + * + *****************************************************************************/ +extern RESULT CamerIcMiSetBurstLength +( + CamerIcDrvHandle_t handle, + const CamerIcMiBurstLength_t y_burstlength, + const CamerIcMiBurstLength_t c_burstlength +); + + + +/*****************************************************************************/ +/** + * @brief This function configures the input and output resolution of + * a given path. + * + * @param handle CamerIc driver handle + * @param path Path index of CamerIC (@ref CamerIcMiPath_e) + * @param in_width input width + * @param in_height input height + * @param out_width output width + * @param out_height output height + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_WRONG_HANDLE given handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to set burstlength + * + *****************************************************************************/ +extern RESULT CamerIcMiSetResolution +( + CamerIcDrvHandle_t handle, + const CamerIcMiPath_t path, + const uint32_t in_width, + const uint32_t in_height, + const uint32_t out_width, + const uint32_t out_height, + const uint32_t in_mode +); + + + +/*****************************************************************************/ +/** + * @brief This function configures the data mode for the given path. + * + * @param handle CamerIc driver handle + * @param path Path index of CamerIC (@ref CamerIcMiPath_e) + * @param mode Data output mode (@ref CamerIcMiDataMode_e) + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_WRONG_HANDLE given handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to change datamode + * @retval RET_INVALID_PARM invalid parameter + * + *****************************************************************************/ +extern RESULT CamerIcMiSetDataMode +( + CamerIcDrvHandle_t handle, + const CamerIcMiPath_t path, + const CamerIcMiDataMode_t mode +); + +/*****************************************************************************/ +/** + * @brief This function configures the pixel data align mode for the given path. + * + * @param handle CamerIc driver handle + * @param path Path index of CamerIC (@ref CamerIcMiPath_e) + * @param alignMode Data output align mode (@ref CamerIcMiDataAlignMode_e) + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_WRONG_HANDLE given handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to change datamode + * @retval RET_INVALID_PARM invalid parameter + * + *****************************************************************************/ + +extern RESULT CamerIcMiSetDataAlignMode +( + CamerIcDrvHandle_t handle, + const CamerIcMiPath_t path, + const CamerIcMiDataAlignMode_t alignMode +); + +/*****************************************************************************/ +/** + * @brief This function configures the pixel data yuv output bit for the given path. + * + * @param handle CamerIc driver handle + * @param path Path index of CamerIC (@ref CamerIcMiPath_e) + * @param yuv_bit 0: 8 bit YUV/RGB; 1: 10 bit YUV/RGB + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_WRONG_HANDLE given handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to change datamode + * @retval RET_INVALID_PARM invalid parameter + * + *****************************************************************************/ + +extern RESULT CamerIcMiSetDataYUVMode +( + CamerIcDrvHandle_t handle, + const CamerIcMiPath_t path, + const bool_t yuv_bit +); + +#ifdef ISP_MI_FIFO_DEPTH_NANO +/*****************************************************************************/ +/** + * @brief Register read function configures the MP output fifo depth + * + * @param handle CamerIc driver handle + * @param address register address of the fifo depth + * @param data register data of the fifo depth + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_WRONG_HANDLE given handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to change datamode + * @retval RET_INVALID_PARM invalid parameter + * + *****************************************************************************/ +RESULT CamerIcMiMpOutputFifoDepthRegRead +( + CamerIcDrvHandle_t handle, + unsigned int * address, + unsigned int * data +); + +/*****************************************************************************/ +/** + * @brief This function configures the MP output fifo depth + * + * @param handle CamerIc driver handle + * @param path Path index of CamerIC (@ref CamerIcMiPath_e) + * @param depth Fifo depth mode (@ref CamerIcMiMpOutputFifoDepth_t) + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_WRONG_HANDLE given handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to change datamode + * @retval RET_INVALID_PARM invalid parameter + * + *****************************************************************************/ +RESULT CamerIcMiMpOutputFifoSetDepth +( + CamerIcDrvHandle_t handle, + const CamerIcMiPath_t path, + const CamerIcMiMpOutputFifoDepth_t depth +); +#endif + +#ifdef ISP_MI_ALIGN_NANO +/*****************************************************************************/ +/** + * @brief This function configures the MP output alignment configuration + * + * @param handle CamerIc driver handle + * @param path Path index of CamerIC (@ref CamerIcMiPath_e) + * @param align lsb align cfg(@ref CamerIcMiMpOutputLsbAlign_t) + * @param swap byte swap set(@ref CamerIcMiMpOutputByteSwap_t) + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_WRONG_HANDLE given handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to change datamode + * @retval RET_INVALID_PARM invalid parameter + * + *****************************************************************************/ +RESULT CamerIcMiMpAlignSetCfg +( + CamerIcDrvHandle_t handle, + const CamerIcMiPath_t path, + const CamerIcMiMpOutputLsbAlign_t align, + const CamerIcMiMpOutputByteSwap_t swap +); +#endif + +#ifdef ISP_MI_HANDSHAKE_NANO +/*****************************************************************************/ +/** + * @brief This function configures the MP handshake configuration + * + * @param handle CamerIc driver handle + * @param path Path index of CamerIC (@ref CamerIcMiPath_e) + * @param *handshk_cfg point to handshake configuration(@ref CamerIcMiMpHandshake_t) + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_WRONG_HANDLE given handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to change datamode + * @retval RET_INVALID_PARM invalid parameter + * + *****************************************************************************/ +RESULT CamerIcMiHandshakeSetCfg +( + CamerIcDrvHandle_t handle, + const CamerIcMiPath_t path, + const CamerIcMiMpHandshake_t *handshk_cfg +); + +#endif + +/*****************************************************************************/ +/** + * @brief Dump configuration function for MI media buffer dump. + * + * @param hCamEngine handle to the CamerIcDrvHandle_t instance + * @param path MI path cfg + * @param mp_dump_name dump file name + * + * @return Return the result of the function call. + * @retval RET_SUCCESS function succeed + * @retval RET_WRONG_HANDLE invalid instance handle + * @retval RET_NULL_POINTER handle is NULL + * @retval RET_FAILURE module not available by driver or hardware + * + *****************************************************************************/ +extern RESULT CamerIcMiDumpBufCfg +( + CamerIcDrvHandle_t hCamerIcDrv, + const CamerIcMiPath_t path, + const char * dump_name +); + +/*****************************************************************************/ +/** + * @brief Call Dump function for MI media buffer dump to file. + * + * @param hCamEngine handle to the CamerIcDrvHandle_t instance + * @param path MI path cfg + * + * @return Return the result of the function call. + * @retval RET_SUCCESS function succeed + * @retval RET_WRONG_HANDLE invalid instance handle + * @retval RET_WRONG_CONFIG FP handle not configured + * @retval RET_FAILURE module not available by driver or hardware + * + *****************************************************************************/ +extern RESULT CamerIcMiDumpToFile +( + CamerIcDrvHandle_t hCamerIcDrv, + const CamerIcMiPath_t path +); + +#ifdef ISP_DEC +//#ifdef HAL_CMODEL + +/*****************************************************************************/ +/** + * @brief Call Dump function for MI media buffer compress dump to file. + * + * @param hCamEngine handle to the CamerIcDrvHandle_t instance + * @param path MI path cfg + * @param CamerIcCmpPrm_t compress parm + * + * @return Return the result of the function call. + * @retval RET_SUCCESS function succeed + * @retval RET_WRONG_HANDLE invalid instance handle + * @retval RET_WRONG_CONFIG FP handle not configured + * @retval RET_FAILURE module not available by driver or hardware + * + *****************************************************************************/ +extern RESULT CamerIcMiCompressToFile +( + CamerIcDrvHandle_t hCamerIcDrv, + const CamerIcMiPath_t path, + const CamerIcCmpPrm_t *pParm +); +//#endif +#endif + +/*****************************************************************************/ +/** + * @brief This function configures the data layout for the given path. + * + * @param handle CamerIc driver handle + * @param path Path index of CamerIC (@ref CamerIcMiPath_e) + * @param layout Data layout (@ref CamerIcMiDataLayout_e) + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_WRONG_HANDLE given handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to change datamode + * @retval RET_INVALID_PARM invalid parameter + * + *****************************************************************************/ +extern RESULT CamerIcMiSetDataLayout +( + CamerIcDrvHandle_t handle, + const CamerIcMiPath_t path, + const CamerIcMiDataLayout_t layout +); + + + +/*****************************************************************************/ +/** + * @brief This function configures the picture orientation for the + * Self path. + * + * @param handle CamerIc driver handle + * @param orientation Picture orientation (@ref CamerIcMiDataLayout_e) + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_WRONG_HANDLE given handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to change datamode + * @retval RET_INVALID_PARM invalid parameter + * + *****************************************************************************/ +extern RESULT CamerIcMiSetPictureOrientation +( + CamerIcDrvHandle_t handle, + const CamerIcMiPath_t path, + const CamerIcMiOrientation_t orientation +); + + + +/*****************************************************************************/ +/** + * @brief This function configures the picture orientation for the + * Self path. + * + * @param handle CamerIc driver handle + * @param numFramesToSkip Number of frames to skip (e.g. after sensor resolution change) + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_FAILURE common error occured + * @retval RET_WRONG_HANDLE given handle is invalid + * @retval RET_WRONG_STATE driver is in wrong state to change datamode + * @retval RET_INVALID_PARM invalid parameter + * + *****************************************************************************/ +extern RESULT CamerIcMiSetFramesToSkip +( + CamerIcDrvHandle_t handle, + uint32_t numFramesToSkip +); + +#ifdef ISP_MI_PP_WRITE + +/*****************************************************************************/ +/** + * @brief config the post process write line number + * + * @param handle cameric drv handle + * @param num line nume + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +RESULT CamerIcMiSetPpwLineNum(CamerIcDrvHandle_t handle, uint16_t num); + +/*****************************************************************************/ +/** + * @brief get the post process write line count + * + * @param handle cameric drv handle + * @param pCnt pointer to the counter + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +RESULT CamerIcMiGetPpwLineCnt(CamerIcDrvHandle_t handle, uint16_t *pCnt); +RESULT CamerIcMiGetPpwBufInfo(CamerIcDrvHandle_t handle, pp_write_line_entry_t *pp_wr_line_entry); +#endif + +#ifdef ISP_MI_PP_READ +/*****************************************************************************/ +/** + * @brief set the post process dma line and buf number + * + * @param handle cameric drv handle + * @param bufNum the line count in all entries + * @param lineNum the line count in all entries + * @return Return the result of the function call. + * @retval RET_SUCCESS + * @retval RET_FAILURE + * + *****************************************************************************/ +RESULT CamerIcMiCfgPpDmaLineEntry(CamerIcDrvHandle_t handle, uint16_t bufNum, uint16_t lineNum); +#endif + + +#ifdef __cplusplus +} +#endif + +/* @} cameric_mi_drv_api */ + +/* @endcond */ + +#endif /* __CAMERIC_MI_DRV_API_H__ */ + diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_mipi_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_mipi_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..029d2b6473879e74d069b9c0c54fa2742c7b6397 --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_mipi_drv_api.h @@ -0,0 +1,260 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +#ifndef __CAMERIC_MIPI_DRV_API_H__ +#define __CAMERIC_MIPI_DRV_API_H__ + +/** + * @cond cameric_mipi + * + * @file cameric_mipi_drv_api.h + * + * @brief This file contains the CamerIC ISP MIPI driver API definitions. + * + *****************************************************************************/ +/** + * @defgroup cameric_mipi_drv_api CamerIC MIPI driver API definitions + * @{ + * + */ +#include + +#include +#include + + + +#ifdef __cplusplus +extern "C" +{ +#endif + + + +/*****************************************************************************/ +/** + * @brief This function enables CamerIC MIPI module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcMipiEnable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This function disables CamerIC MIPI module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcMipiDisable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This function returns the status of the mipi module. + * + * @param handle CamerIc driver handle. + * @param pIsEnabled Pointer to value to store current state + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_NULL_POINTER pIsEnabled is a NULL pointer. + * + *****************************************************************************/ +extern RESULT CamerIcMipiIsEnabled +( + CamerIcDrvHandle_t handle, + bool_t *pIsEnabled +); + + + +/*****************************************************************************/ +/** + * @brief This function returns the number of currently used MIPI lanes. + * + * @param handle CamerIc driver handle. + * @param no_lanes number of MIPI lanes to use (1..4) + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_INVALID_PARM no_lanes is a NULL pointer. + * + *****************************************************************************/ +extern RESULT CamerIcMipiGetNumberOfLanes +( + CamerIcDrvHandle_t handle, + uint32_t *no_lanes +); + + + +/*****************************************************************************/ +/** + * @brief This function sets the number of MIPI lanes to use. + * + * @param handle CamerIC driver handle. + * @param no_lanes Number of MIPI lanes to use (1..4) + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_OUTOFRANGE number of lanes is out of range. + * + *****************************************************************************/ +extern RESULT CamerIcMipiSetNumberOfLanes +( + CamerIcDrvHandle_t handle, + const uint32_t no_lanes +); + + + +/*****************************************************************************/ +/** + * @brief This function sets the MIPI virtual channel and data type of the + * packages to process. + * + * @param handle CamerIC driver handle. + * @param vc virtul channel number + * @param dt data type of image data + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_BUSY module is currently in use. + * @retval RET_OUTOFRANGE at least one config parameter is invalid + * @retval RET_NOTSUPP at least one config parameter is invalid + * + *****************************************************************************/ +extern RESULT CamerIcMipiSetVirtualChannelAndDataType +( + CamerIcDrvHandle_t handle, + const MipiVirtualChannel_t vc, + const MipiDataType_t dt +); + + +/*****************************************************************************/ +/** + * @brief This function sets the MIPI compression scheme and predictor block. + * + * @param handle CamerIC driver handle. + * @param cs compression scheme + * @param pred predictor block + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_BUSY module is currently in use. + * @retval RET_OUTOFRANGE at least one config parameter is invalid + * + *****************************************************************************/ +extern RESULT CamerIcMipiSetCompressionSchemeAndPredictorBlock +( + CamerIcDrvHandle_t handle, + const MipiDataCompressionScheme_t cs, + const MipiPredictorBlock_t pred +); + + +/*****************************************************************************/ +/** + * @brief This function enables compressed data processing. + * + * @param handle CamerIC driver handle. + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_BUSY module is currently in use + * @retval RET_WRONG_CONFIG at least one config parameter set before is invalid + * + *****************************************************************************/ +extern RESULT CamerIcMipiEnableCompressedMode +( + CamerIcDrvHandle_t handle +); + + +/*****************************************************************************/ +/** + * @brief This function disables compressed data processing. + * + * @param handle CamerIC driver handle. + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_BUSY module is currently in use + * + *****************************************************************************/ +extern RESULT CamerIcMipiDisableCompressedMode +( + CamerIcDrvHandle_t handle +); + + +/*****************************************************************************/ +/** + * @brief This function returns the status of the compressed data processing mode. + * + * @param handle CamerIc driver handle. + * @param pIsEnabled Pointer to value to store current state + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_NULL_POINTER pIsEnabled is a NULL pointer + * + *****************************************************************************/ +extern RESULT CamerIcMipiIsEnabledCompressedMode +( + CamerIcDrvHandle_t handle, + bool_t *pIsEnabled +); + + +#ifdef __cplusplus +} +#endif + +/* @} cameric_mipi_drv_api */ + +/* @endcond */ + +#endif /* __CAMERIC_MIPI_DRV_API_H__ */ + diff --git a/th1520/hardware/camera/include/cameric_drv/cameric_simp_drv_api.h b/th1520/hardware/camera/include/cameric_drv/cameric_simp_drv_api.h new file mode 100755 index 0000000000000000000000000000000000000000..f517316b99f4bdceba8877d34cf61de54ebb8c89 --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/cameric_simp_drv_api.h @@ -0,0 +1,212 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +#ifndef __CAMERIC_SIMP_DRV_API_H__ +#define __CAMERIC_SIMP_DRV_API_H__ + +/** + * @cond cameric_simp + * + * @file cameric_simp_drv_api.h + * + * @brief This file contains the CamerIC SI driver API definitions. + * + *****************************************************************************/ +/** + * @defgroup cameric_simp_drv_api CamerIC SI Driver API definitions + * @{ + * + * The Super Impose module overlays an image with a bitmap from the main memory + * (see Figure). Color of the transparent area in superimpose bitmap is configurable. + * So the camera picture interfuses through the transparent area. Furthermore the + * Superimpose block is able to position a bitmap with the appropriate coordinates + * over the camera image range. + * + * @image html si-usecase.png "Superimpose Effect with the CamerIC SI driver" width=\textwidth + * @image latex si-usecase.png "Superimpose Effect with the CamerIC SI driver" width=\textwidth + * + * The Superimpose module gets picture data in YCbCr 4:2:2 formats from Image Effects module. + * The Memory Interface module delivers the Y, Cb and Cr pixel components of the superimpose + * bitmap. Within the common area of the two pictures, output pixel data is determined by the + * bitmap from main memory or by the image from image effect module. The overlaid picture is + * sent to the Y/C splitter module. + * @if CAMERIC_LITE + * + * @image html si_lite.png "Overview of the CamerIC SI driver" width=\textwidth + * @image latex si_lite.png "Overview of the CamerIC SI driver" width=\textwidth + * + * @endif + * + * @if CAMERIC_FULL + * + * @image html si.png "Overview of the CamerIC SI driver" width=\textwidth + * @image latex si.png "Overview of the CamerIC SI driver" width=\textwidth + * + * @endif + * + */ +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + + + +/******************************************************************************/ +/** + * @brief Enumeration type to configure the Super-Impose transparency mode. + * + *****************************************************************************/ +typedef enum CamerIcSimpTransparencyMode_e +{ + CAMERIC_SIMP_TRANSPARENCY_MODE_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_SIMP_TRANSPARENCY_MODE_ENABLED = 1, /**< transparency mode disabled */ + CAMERIC_SIMP_TRANSPARENCY_MODE_DISABLED = 2, /**< transparency mode disabled */ + CAMERIC_SIMP_TRANSPARENCY_MODE_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcSimpTransparencyMode_t; + + + +/******************************************************************************/ +/** + * @brief Enumeration type to configure the Super-Impose reference mode. + * + * @note The reference image defines the size of the output image. + * + *****************************************************************************/ +typedef enum CamerIcSimpReferenceMode_e +{ + CAMERIC_SIMP_REFERENCE_MODE_INVALID = 0, /**< lower border (only for an internal evaluation) */ + CAMERIC_SIMP_REFERENCE_MODE_FROM_MEMORY = 1, /**< reference images comes from main memory */ + CAMERIC_SIMP_REFERENCE_MODE_FROM_CAMERA = 2, /**< reference images comes from camera (Image Effect module) */ + CAMERIC_SIMP_REFERENCE_MODE_MAX /**< upper border (only for an internal evaluation) */ +} CamerIcSimpReferenceMode_t; + + + +/******************************************************************************/ +/** + * @brief Structure to configure the Super-Impose module. + * + *****************************************************************************/ +typedef struct CamerIcSimpConfig_s +{ + CamerIcSimpTransparencyMode_t TransparencyMode; /**< transparency mode */ + CamerIcSimpReferenceMode_t ReferenceMode; /**< reference mode */ + + uint16_t OffsetX; /**< x offset */ + uint16_t OffsetY; /**< y offset */ + + uint8_t Y; /**< Y-component of transparent color */ + uint8_t Cb; /**< Cb-component of transparent color */ + uint8_t Cr; /**< Cr-component of transparent color */ +} CamerIcSimpConfig_t; + + + +/*****************************************************************************/ +/** + * @brief This function enables the Super-Impose module. + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcSimpEnable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This function disables the Super-Impose module (bypass the super + * impose module). + * + * @param handle CamerIc driver handle + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * + *****************************************************************************/ +extern RESULT CamerIcSimpDisable +( + CamerIcDrvHandle_t handle +); + + + +/*****************************************************************************/ +/** + * @brief This function returns the status of the Super-Impose module. + * + * @param handle CamerIc driver handle + * @param pIsEnabled Pointer to value to store current state + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_NULL_POINTER pIsEnabled is a NULL pointer + * + *****************************************************************************/ +extern RESULT CamerIcSimpIsEnabled +( + CamerIcDrvHandle_t handle, + bool_t *pIsEnabled +); + + + +/*****************************************************************************/ +/** + * @brief This function configures the Super-Impose module + * + * @param handle CamerIC driver handle + * @param pConfig pointer to image effects configuration structure + * + * @return Return the result of the function call. + * @retval RET_SUCCESS operation succeded + * @retval RET_WRONG_HANDLE handle is invalid + * @retval RET_NOTSUPP selected working mode is not supported + * @retval RET_NULL_POINTER null pointer + * + *****************************************************************************/ +extern RESULT CamerIcSimpConfigure +( + CamerIcDrvHandle_t handle, + CamerIcSimpConfig_t *pConfig +); + + + +#ifdef __cplusplus +} +#endif + +/* @} cameric_simp_drv_api */ + +/* @endcond */ + +#endif /* __CAMERIC_SIMP_DRV_API_H__ */ + diff --git a/th1520/hardware/camera/include/cameric_drv/mainpage.h b/th1520/hardware/camera/include/cameric_drv/mainpage.h new file mode 100755 index 0000000000000000000000000000000000000000..2284124d250b80aa3697271facc5771f51960544 --- /dev/null +++ b/th1520/hardware/camera/include/cameric_drv/mainpage.h @@ -0,0 +1,143 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + + +/** + * @file mainpage.h + * + *****************************************************************************/ + +/** + * + * @mainpage General Concept + * + * The CamerIC driver package provides a general application programing + * interface (API) for configuring the CamerIC ISP hardware. This driver + * package does not incorporate any "intelligence", like gain or integration + * time controlling. It only provides an abstraction level for accessing + * the CamerIC hardware. + * + * The following figure illustrates a typical software architecture using + * the CamerIC driver. + * + * @image html usecase.png "General usecase of the CamerIC driver" width=0.5\textwidth + * @image latex usecase.png "General usecase of the CamerIC driver" width=0.5\textwidth + * + * The CamerIC driver package uses an underlying Hardware Abstraction + * Layer (HAL) to access CamerIC registers (HalReadReg / HalWriteReg) and + * to register or release interrupt service routines (HalConnectIrq / HalDisconnectIrq). + * This functionality aims to support different hardware platforms. Only + * the HAL needs to be ported to a new hardware architecture. In case of a Linux + * Kernel driver the HAL implements a wrapper functionality for register_irq and + * free_irq. + * + * The Camera-Engine a typical middleware in a Camera-Software-Architecture works + * on top of the CamerIC driver. It initializes, configures and controls the + * underlying hardware by calling CamerIC driver API functions. In case of a + * Linux implementation an IOCTL layer is included between the Camera-Engine + * and the CamerIC driver software. + * + * @section cameric_drv_init_section Creating and Releasing a CamerIC driver instance + * + * The following figure shows the lifecycle-diagram of a CamerIC driver + * instance. Genrally an instance can be in on of the following two states. + * + * @arg INIT/STOP state: in this state all configuration parameter, like + * resoulution or measuring window, are changeable + * + * @arg RUNNING state: in this state it's only allowed to change the dynamic + * configuration parameter, like measurement window or measurment mode. + * + * @image html state.png "States of a CamerIC driver instance" width=0.75\textwidth + * @image latex state.png "States of a CamerIC driver instance" width=0.75\textwidth + * + * An instance is created by @ref CamerIcDriverInit and released by @ref + * CamerIcDriverRelease. After a static configuration of the CamerIC driver + * instance, which includes the configutration of the input acquistion (resoulution, + * bayerpattern, cropping window, ... ) it can be started by calling @ref CamerIcDriverStart. + * If a statically reconfiguring or a releasing the driver instance necessary + * the instance needs to be stopped with calling @ref CamerIcDriverStop. + * + * The following figure presents the initialization flow chart of the CamerIC Driver. + * First the CamEngine fills in the configuration structure @ref CamerIcDrvConfig_s. + * This includes the base address of the CamerIC mapped register table and a HAL handle. + * Than the Camengine calls @ref CamerIcDriverInit, which creates and initializes the + * driver context. + * + * @image html uml.png "Initialization and Releasing of the CamerIC driver" width=0.8\textwidth + * @image latex uml.png "Initialization and Releasing of the CamerIC driver" width=0.8\textwidth + * + * On success the CamerIcDriverInit returns the handle of the new created CamerIc driver + * instance. This handle is returned in the configuration structure (see + * DrvHandle in @ref CamerIcDrvConfig_s). + * + * @section cameric_drv_config_section Running a CamerIC driver instance + * + * As already said a driver instance can be started after a static configuration with @ref + * CamerIcDriverStart. In the following flowchart an static configuration is exemplary + * applied by configuring the ISP input acquistion (@ref + * CamerIcSetAcqProperties and @ CamerIcSetAcqResoulution). + * + * @image html uml_config.png "Running a CamerIC driver instance" width=0.8\textwidth + * @image latex uml_config.png "Running a CamerIC driver instance" width=0.8\textwidth + * + * A complete overview about all static and dynamic configuration parameter can be found in + * @ref static_config_param_list. + * + * @section cameric_drv_streaming_ection Start/Stop streaming in a CamerIC driver instance + * + * @image html uml_streaming.png "Start/Stop Image capturing or video streaming" width=0.8\textwidth + * @image latex uml_streaming.png "Start/Stop Image capturing or video streaming" width=0.8\textwidth + * + * @section cameric_drv_buffer_section Framehandling + * + * @section cameric_drv_modularization_section Modularization of the CamerIC driver + * + * @if CAMERIC_LITE + * + * The following image shows all CamrIC-Lite driver top-level modules (red bordered). + * * + * @image html cameric_lite.png "Software toplevel modules of the CamerIC lite driver" width=\textwidth + * @image latex cameric_lite.png "Software toplevel modules of the CamerIC lite driver" width=\textwidth + * + * @arg CamerIC CPROC (color processing, @ref cameric_cproc_drv_api) + * @arg CamerIC IE (image effects, @ref cameric_ie_drv_api) + * @arg CamerIC SI (super impose, @ref cameric_si_drv_api) + * @arg CamerIC JPE (jpeg encoder, @ref cameric_jpe_drv_api) + * @arg CamerIC MI (memory interface, @ref cameric_mi_drv_api) + * + * @endif + * + * @if CAMERIC_FULL + * + * The following image shows all CamrIC driver top-level modules (red bordered). + * + * @image html cameric.png "Software toplevel modules of the CamerIC driver" width=\textwidth + * @image latex cameric.png "Software toplevel modules of the CamerIC driver" width=\textwidth + * + * @arg CamerIC MIPI (@ref cameric_mipi_drv_api) + * @arg CamerIC SMIA (@ref cameric_smia_drv_api) + * @arg CamerIC ISP (@ref cameric_isp_drv_api) + * @arg CamerIC CPROC (color processing, @ref cameric_cproc_drv_api) + * @arg CamerIC IE (image effects, @ref cameric_ie_drv_api) + * @arg CamerIC SI (super impose, @ref cameric_si_drv_api) + * @arg CamerIC JPE (jpeg encoder, @ref cameric_jpe_drv_api) + * @arg CamerIC MI (memory interface, @ref cameric_mi_drv_api) + * + * @endif + * + *****************************************************************************/ + diff --git a/th1520/hardware/camera/include/common/align.h b/th1520/hardware/camera/include/common/align.h new file mode 100755 index 0000000000000000000000000000000000000000..205937c18161f5844b78826029e8405924c36292 --- /dev/null +++ b/th1520/hardware/camera/include/common/align.h @@ -0,0 +1,36 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +/** + * @file align.h + * + * @brief + * + *****************************************************************************/ +#ifndef __ALIGN_H__ +#define __ALIGN_H__ + +#ifndef ALIGN_UP +#define ALIGN_UP(addr, align) ( ((addr) + ((align)-1)) & ~(uintptr_t)((align)-1) ) //!< Aligns addr to next higher aligned addr; align must be a power of two. +#endif +#define ALIGN_DOWN(addr, align) ( ((addr) ) & ~(uintptr_t)((align)-1) ) //!< Aligns addr to next lower aligned addr; align must be a power of two. + +#define ALIGN_SIZE_1K ( 0x400 ) +#define ALIGN_UP_1K(addr) ( ALIGN_UP(addr, ALIGN_SIZE_1K) ) + +#define MAX_ALIGNED_SIZE(size, align) ( ALIGN_UP(size, align) + align ) //!< Calcs max size of memory required to be able to hold a block of size bytes with a start address aligned to align. + +#endif /* __ALIGN_H__ */ diff --git a/th1520/hardware/camera/include/common/array_size.h b/th1520/hardware/camera/include/common/array_size.h new file mode 100755 index 0000000000000000000000000000000000000000..68a2492855d4422944d1d0ed2f57df7af32a9f23 --- /dev/null +++ b/th1520/hardware/camera/include/common/array_size.h @@ -0,0 +1,28 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +/** + * @file misc.h + * + * @brief Some often used little helpers; mainly implemented as macros. + * + *****************************************************************************/ +#ifndef __ARRAY_SIZE_H__ +#define __ARRAY_SIZE_H__ + +#define ARRAY_SIZE(arr) ( sizeof(arr) / sizeof((arr)[0]) ) + +#endif /* __ARRAY_SIZE_H__ */ diff --git a/th1520/hardware/camera/include/common/cam_types.h b/th1520/hardware/camera/include/common/cam_types.h new file mode 100755 index 0000000000000000000000000000000000000000..1ba8ef7da2c13b66de4b01585d11bb247c1232c4 --- /dev/null +++ b/th1520/hardware/camera/include/common/cam_types.h @@ -0,0 +1,932 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +/** + * @file cam_types.h + * + * @brief Interface description for image sensor specific implementation (iss). + * + *****************************************************************************/ +/** + * @page module_name_page Module Name + * Describe here what this module does. + * + * For a detailed list of functions and implementation detail refer to: + * - @ref module_name + * + * @defgroup cam_types Common Camera Type Definitions + * @{ + * + */ +#ifndef __CAM_TYPES_H__ +#define __CAM_TYPES_H__ + +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + + + +/*****************************************************************************/ +/** + * @brief doortype of an illumination profile + */ +/*****************************************************************************/ +typedef enum CamDoorType_e +{ + CAM_DOOR_TYPE_OUTDOOR = 0, + CAM_DOOR_TYPE_INDOOR = ( !CAM_DOOR_TYPE_OUTDOOR ) +} CamDoorType_t; + + + +/*****************************************************************************/ +/** + * @brief doortype of an illumination profile + */ +/*****************************************************************************/ +typedef enum CamAwbType_e +{ + CAM_AWB_TYPE_MANUAL = 0, + CAM_AWB_TYPE_AUTO = ( !CAM_AWB_TYPE_MANUAL ) +} CamAwbType_t; + + + +/*****************************************************************************/ +/** + * @brief 3 channel color components + */ +/*****************************************************************************/ +typedef enum Cam3ChColorComponent_e +{ + CAM_3CH_COLOR_COMPONENT_RED = 0, + CAM_3CH_COLOR_COMPONENT_GREEN = 1, + CAM_3CH_COLOR_COMPONENT_BLUE = 2, + CAM_3CH_COLOR_COMPONENT_MAX +} Cam3ChColorComponent_t; + + + +/*****************************************************************************/ +/** + * @brief 4 channel color components + */ +/*****************************************************************************/ +typedef enum Cam4ChColorComponent_e +{ + CAM_4CH_COLOR_COMPONENT_RED = 0, + CAM_4CH_COLOR_COMPONENT_GREENR = 1, + CAM_4CH_COLOR_COMPONENT_GREENB = 2, + CAM_4CH_COLOR_COMPONENT_BLUE = 3, + CAM_4CH_COLOR_COMPONENT_MAX +} Cam4ChColorComponent_t; + + + +/*****************************************************************************/ +/** + * @brief Matrix coefficients + * + * | 0 | + * + * @note Coefficients are represented as float numbers + */ +/*****************************************************************************/ +typedef struct Cam1x1FloatMatrix_s +{ + float fCoeff[1]; +} Cam1x1FloatMatrix_t; + + + +/*****************************************************************************/ +/** + * @brief Matrix coefficients + * + * | 0 | 1 | 2 | + * + * @note Coefficients are represented as float numbers + */ +/*****************************************************************************/ +typedef struct Cam1x3FloatMatrix_s +{ + float fCoeff[3]; +} Cam1x3FloatMatrix_t; + + + +/*****************************************************************************/ +/** + * @brief Matrix coefficients + * + * | 0 | 1 | ... | 4 | + * + * @note Coefficients are represented as float numbers + */ +/*****************************************************************************/ +typedef struct Cam1x4FloatMatrix_s +{ + float fCoeff[4]; +} Cam1x4FloatMatrix_t; + + + +/*****************************************************************************/ +/** + * @brief Matrix coefficients + * + * | 0 | 1 | ... | 6 | + * + * @note Coefficients are represented as float numbers + */ +/*****************************************************************************/ +typedef struct Cam1x6FloatMatrix_s +{ + float fCoeff[6]; +} Cam1x6FloatMatrix_t; + + + +/*****************************************************************************/ +/** + * @brief Matrix coefficients + * + * | 0 | 1 | ... | 15 | + * + * @note Coefficients are represented as float numbers + */ +/*****************************************************************************/ +typedef struct Cam1x16FloatMatrix_s +{ + float fCoeff[16]; +} Cam1x16FloatMatrix_t; + + + +/*****************************************************************************/ +/** + * @brief Matrix coefficients + * + * | 0 | 1 | + * + * @note Coefficients are represented as float numbers + */ +/*****************************************************************************/ +typedef struct Cam2x1FloatMatrix +{ + float fCoeff[2]; +} Cam2x1FloatMatrix_t; + + + +/*****************************************************************************/ +/** + * @brief Matrix coefficients + * + * | 0 | 1 | + * | 2 | 3 | + * + * @note Coefficients are represented as float numbers + */ +/*****************************************************************************/ +typedef struct Cam2x2FloatMatrix +{ + float fCoeff[4]; +} Cam2x2FloatMatrix_t; + + + +/*****************************************************************************/ +/** + * @brief Matrix coefficients + * + * | 0 | 1 | 2 | + * + * @note Coefficients are represented as float numbers + */ +/*****************************************************************************/ +typedef struct Cam3x1FloatMatrix +{ + float fCoeff[3]; +} Cam3x1FloatMatrix_t; + + + +/*****************************************************************************/ +/** + * @brief Matrix coefficients + * + * | 0 | 1 | 2 | + * | 3 | 4 | 5 | + * + * @note Coefficients are represented as float numbers + */ +/*****************************************************************************/ +typedef struct Cam3x2FloatMatrix_s +{ + float fCoeff[6]; +} Cam3x2FloatMatrix_t; + + + +/*****************************************************************************/ +/** + * @brief Matrix coefficients + * + * | 0 | 1 | 2 | + * | 3 | 4 | 5 | + * | 6 | 7 | 8 | + * + * @note Coefficients are represented as float numbers + */ +/*****************************************************************************/ +typedef struct Cam3x3FloatMatrix_s +{ + float fCoeff[9]; +} Cam3x3FloatMatrix_t; + + + +/*****************************************************************************/ +/** + * @brief Matrix coefficients + * + * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | .... + * | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | .... + * | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | .... + * ... + * ... + * ... + * | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | .... | 288 | + * + * @note Coefficients are represented as short numbers + */ +/*****************************************************************************/ +typedef struct Cam17x17FloatMatrix_s +{ + float fCoeff[17 * 17]; +} Cam17x17FloatMatrix_t; + + + +/*****************************************************************************/ +/** + * @brief Matrix coefficients + * + * | 0 | 1 | 2 | + * + * @note Coefficients are represented as short numbers + */ +/*****************************************************************************/ +typedef struct Cam1x3ShortMatrix_s +{ + int16_t Coeff[3]; +} Cam1x3ShortMatrix_t; + + + +/*****************************************************************************/ +/** + * @brief Matrix coefficients + * + * | 0 | 1 | 2 | ... | 4 | + * + * @note Coefficients are represented as short numbers + */ +/*****************************************************************************/ +typedef struct Cam1x4UShortMatrix_s +{ + uint16_t uCoeff[4]; +} Cam1x4UShortMatrix_t; + + + +/*****************************************************************************/ +/** + * @brief Matrix coefficients + * + * | 0 | 1 | 2 | ... | 16 | + * + * @note Coefficients are represented as short numbers + */ +/*****************************************************************************/ +typedef struct Cam1x17UShortMatrix_s +{ + uint16_t uCoeff[17]; +} Cam1x17UShortMatrix_t; + + + +/*****************************************************************************/ +/** + * @brief Matrix coefficients + * + * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | .... + * | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | .... + * | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | .... + * ... + * ... + * ... + * | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | .... | 288 | + * + * @note Coefficients are represented as short numbers + */ +/*****************************************************************************/ +typedef struct Cam17x17UShortMatrix_s +{ + uint16_t uCoeff[17 * 17]; +} Cam17x17UShortMatrix_t; + + + +/*****************************************************************************/ +/** + * @brief name/identifier of a resolution + */ +/*****************************************************************************/ +#define CAM_RESOLUTION_NAME ( 15U ) +typedef char CamResolutionName_t[CAM_RESOLUTION_NAME]; + + + +/*****************************************************************************/ +/** + * @brief name/identifier of an illumination + */ +/*****************************************************************************/ +#define CAM_BLS_PROFILE_NAME ( 10U ) +typedef char CamBlsProfileName_t[CAM_BLS_PROFILE_NAME]; + + + +/*****************************************************************************/ +/** + * @brief name/identifier of an illumination + */ +/*****************************************************************************/ +#define CAM_ILLUMINATION_NAME ( 20U ) +typedef char CamIlluminationName_t[CAM_ILLUMINATION_NAME]; + + + +/*****************************************************************************/ +/** + * @brief name/identifier of a lense shade correction profile (LscProfile) + */ +/*****************************************************************************/ +#define CAM_LSC_PROFILE_NAME ( 25U ) +typedef char CamLscProfileName_t[CAM_LSC_PROFILE_NAME]; + + + +/*****************************************************************************/ +/** + * @brief name/identifier of a color correction profile (CcProfile) + */ +/*****************************************************************************/ +#define CAM_CC_PROFILE_NAME ( 20U ) +typedef char CamCcProfileName_t[CAM_CC_PROFILE_NAME]; + + + +/*****************************************************************************/ +/** + * @brief name/identifier of a auto white balance profile (AwbProfile) + */ +/*****************************************************************************/ +#define CAM_AWB_PROFILE_NAME ( 20U ) +typedef char CamAwbProfileName_t[CAM_AWB_PROFILE_NAME]; + + + +/*****************************************************************************/ +/** + * @brief name/identifier of an exposure scheme (EcmScheme) + */ +/*****************************************************************************/ +#define CAM_ECM_SCHEME_NAME ( 20U ) +typedef char CamEcmSchemeName_t[CAM_ECM_SCHEME_NAME]; + + + +/*****************************************************************************/ +/** + * @brief name/identifier of an exposure profile (EcmProfile) + */ +/*****************************************************************************/ +#define CAM_ECM_PROFILE_NAME ( 20U ) +typedef char CamEcmProfileName_t[CAM_ECM_PROFILE_NAME]; + + + +/*****************************************************************************/ +/** + * @brief name/identifier of a chromatic abberation correction profile + * (CacProfile) + */ +/*****************************************************************************/ +#define CAM_CAC_PROFILE_NAME ( 20U ) +typedef char CamCacProfileName_t[CAM_CAC_PROFILE_NAME]; + + + +/*****************************************************************************/ +/** + * @brief name/identifier of a denoising prefilter profile (DpfProfile) + */ +/*****************************************************************************/ +#define CAM_DPF_PROFILE_NAME ( 20U ) +typedef char CamDpfProfileName_t[CAM_DPF_PROFILE_NAME]; + + + +/*****************************************************************************/ +/** + * @brief name/identifier of a denoising prefilter profile (DpccProfile) + */ +/*****************************************************************************/ +#define CAM_DPCC_PROFILE_NAME ( 20U ) +typedef char CamDpccProfileName_t[CAM_DPCC_PROFILE_NAME]; + + + +/*****************************************************************************/ +/** + * @brief resolution profile + */ +/*****************************************************************************/ +typedef struct CamResolution_t +{ + void *p_next; /**< for adding to a list */ + + CamResolutionName_t name; /**< desctriptor */ + uint16_t width; /**< resolution width */ + uint16_t height; /**< resolution height */ + uint16_t framerate; /**< frames pre second */ + uint32_t id; /**< bitmask identifier */ +} CamResolution_t; + + + +/*****************************************************************************/ +/** + * @brief parameters for a sensorgain to saturation interpolation + */ +/*****************************************************************************/ +typedef struct CamSaturationCurve_s +{ + uint16_t ArraySize; + float *pSensorGain; + float *pSaturation; +} CamSaturationCurve_t; + + + +/*****************************************************************************/ +/** + * @brief parameters for a sensorgain to vignetting (compensation) + * interpolation + */ +/*****************************************************************************/ +typedef struct CamVignettingCurve_s +{ + uint16_t ArraySize; + float *pSensorGain; + float *pVignetting; +} CamVignettingCurve_t; + + + +/*****************************************************************************/ +/** + * @brief parameters for a sensorgain to vignetting (compensation) + * interpolation + * + */ +/*****************************************************************************/ +typedef struct CamLscMatrix_s +{ + Cam17x17UShortMatrix_t LscMatrix[CAM_4CH_COLOR_COMPONENT_MAX]; +} CamLscMatrix_t; + + + +/*****************************************************************************/ +/** + * @brief BLS calibration structure + */ +/*****************************************************************************/ +typedef struct CamBlsProfile_s +{ + void *p_next; /**< for adding to a list */ + + CamBlsProfileName_t name; /**< profile name */ + CamResolutionName_t resolution; /**< resolution link */ + + Cam1x4UShortMatrix_t level; /**< black level for all 4 color components */ +} CamBlsProfile_t; + + + +/*****************************************************************************/ +/** + * @brief Illumination specific structure. + */ +/*****************************************************************************/ +typedef struct CamIlluProfile_s +{ + void *p_next; /**< for adding to a list */ + + CamIlluminationName_t name; /**< name of the illumination profile (i.e. "D65", "A", ... )*/ + uint32_t id; /**< unique id */ + + CamDoorType_t DoorType; /**< indoor or outdoor profile */ + CamAwbType_t AwbType; /**< manual or auto profile */ + + /* for manual white balance data */ + Cam3x3FloatMatrix_t CrossTalkCoeff; /**< CrossTalk matrix coefficients */ + Cam1x3FloatMatrix_t CrossTalkOffset; /**< CrossTalk offsets */ + Cam1x4FloatMatrix_t ComponentGain; /**< White Balance Gains*/ + + /* gaussian mixture modell */ + Cam2x1FloatMatrix_t GaussMeanValue; /**< */ + Cam2x2FloatMatrix_t CovarianceMatrix; /**< */ + Cam1x1FloatMatrix_t GaussFactor; /**< */ + Cam2x1FloatMatrix_t Threshold; /**< */ + + /* adaptive color correctio */ + CamSaturationCurve_t SaturationCurve; /**< stauration over gain curve */ + + /* adative lense shade correction */ + CamVignettingCurve_t VignettingCurve; /**< vignetting over gain curve */ + + #define CAM_NO_CC_PROFILES ( 10 ) /**< max number of cc-profiles per illumination */ + int32_t cc_no; + CamCcProfileName_t cc_profiles[CAM_NO_CC_PROFILES]; + + #define CAM_NO_LSC_PROFILES ( 5 ) + #define CAM_NO_RESOLUTIONS ( 4 ) + int32_t lsc_res_no; + int32_t lsc_no[CAM_NO_RESOLUTIONS]; + CamLscProfileName_t lsc_profiles[CAM_NO_RESOLUTIONS][CAM_NO_LSC_PROFILES]; +} CamIlluProfile_t; + + + +/*****************************************************************************/ +/** + * @brief LSC profile + */ +/*****************************************************************************/ +typedef struct CamLscProfile_s +{ + void *p_next; /**< for adding to a list */ + + CamLscProfileName_t name; /**< profile name */ + CamResolutionName_t resolution; /**< resolution link */ + CamIlluminationName_t illumination; /**< illumination link */ + float vignetting; /**< vignetting value */ + + uint16_t LscSectors; + uint16_t LscNo; + uint16_t LscXo; + uint16_t LscYo; + + uint16_t LscXGradTbl[8]; + uint16_t LscYGradTbl[8]; + uint16_t LscXSizeTbl[8]; + uint16_t LscYSizeTbl[8]; + + Cam17x17UShortMatrix_t LscMatrix[CAM_4CH_COLOR_COMPONENT_MAX]; /**< matrix for different color channels */ +} CamLscProfile_t; + + + +/*****************************************************************************/ +/** + * @brief CC profile + * + */ +/*****************************************************************************/ +typedef struct CamCcProfile_s +{ + void *p_next; /**< for adding to a list */ + + CamCcProfileName_t name; /**< profile name */ + float saturation; /**< saturation value */ + + Cam3x3FloatMatrix_t CrossTalkCoeff; /**< CrossTalk matrix coefficients */ + Cam1x3FloatMatrix_t CrossTalkOffset; /**< CrossTalk offsets */ + Cam1x4FloatMatrix_t ComponentGain; /**< White Balance Gains*/ +} CamCcProfile_t; + + + +/*****************************************************************************/ +/** + * @brief CAC calibration structure + */ +/*****************************************************************************/ +typedef struct CamCacProfile_s +{ + void *p_next; /**< for adding to a list */ + + CamCacProfileName_t name; /**< profile name */ + CamResolutionName_t resolution; /**< resolution link */ + + uint8_t x_ns; /**< horizontal normalization shift */ + uint8_t x_nf; /**< horizontal normalization factor */ + uint8_t y_ns; /**< vertical normalization shift */ + uint8_t y_nf; /**< vertical normalization factor */ + + Cam1x3FloatMatrix_t Red; /**< coeffciencts A, B and C for red */ + Cam1x3FloatMatrix_t Blue; /**< coeffciencts A, B and C for blue */ + + int16_t hCenterOffset; + int16_t vCenterOffset; +} CamCacProfile_t; + + + +/*****************************************************************************/ +/** + * @brief DPF calibration structure + */ +/*****************************************************************************/ +typedef struct CamDpfProfile_s +{ + void *p_next; /**< for adding to a list */ + + CamDpfProfileName_t name; /**< profile name */ + CamResolutionName_t resolution; /**< resolution link */ + + uint16_t nll_segmentation; + Cam1x17UShortMatrix_t nll_coeff; + + uint16_t SigmaGreen; /**< */ + uint16_t SigmaRedBlue; /**< */ + float fGradient; /**< */ + float fOffset; /**< */ + Cam1x4FloatMatrix_t NfGains; /**< */ +} CamDpfProfile_t; + + + +/*****************************************************************************/ +/** + * @brief DPCC calibration structure + */ +/*****************************************************************************/ +typedef struct CamDpccProfile_s +{ + void *p_next; /**< for adding to a list */ + + CamDpccProfileName_t name; /**< profile name */ + CamResolutionName_t resolution; /**< resolution link */ + + uint32_t isp_dpcc_mode; + uint32_t isp_dpcc_output_mode; + uint32_t isp_dpcc_set_use; + uint32_t isp_dpcc_methods_set_1; + uint32_t isp_dpcc_methods_set_2; + uint32_t isp_dpcc_methods_set_3; + uint32_t isp_dpcc_line_thresh_1; + uint32_t isp_dpcc_line_mad_fac_1; + uint32_t isp_dpcc_pg_fac_1; + uint32_t isp_dpcc_rnd_thresh_1; + uint32_t isp_dpcc_rg_fac_1; + uint32_t isp_dpcc_line_thresh_2; + uint32_t isp_dpcc_line_mad_fac_2; + uint32_t isp_dpcc_pg_fac_2; + uint32_t isp_dpcc_rnd_thresh_2; + uint32_t isp_dpcc_rg_fac_2; + uint32_t isp_dpcc_line_thresh_3; + uint32_t isp_dpcc_line_mad_fac_3; + uint32_t isp_dpcc_pg_fac_3; + uint32_t isp_dpcc_rnd_thresh_3; + uint32_t isp_dpcc_rg_fac_3; + uint32_t isp_dpcc_ro_limits; + uint32_t isp_dpcc_rnd_offs; +} CamDpccProfile_t; + + + +/*****************************************************************************/ +/** + * @brief Contains pointers to parameter arrays for Rg/Bg color space + * clipping + */ +/*****************************************************************************/ +typedef struct CamAwbClipParm_s +{ + float *pRg1; + float *pMaxDist1; + float *pRg2; + float *pMaxDist2; + uint16_t ArraySize1; + uint16_t ArraySize2; +} CamAwbClipParm_t; + + + +/*****************************************************************************/ +/** + * @brief Contains pointers to parameter arrays for AWB out of range + * handling + * + */ +/*****************************************************************************/ +typedef struct CamAwbGlobalFadeParm_s +{ + float *pGlobalFade1; + float *pGlobalGainDistance1; + float *pGlobalFade2; + float *pGlobalGainDistance2; + uint16_t ArraySize1; + uint16_t ArraySize2; +} CamAwbGlobalFadeParm_t; + + + +/*****************************************************************************/ +/** + * @brief Contains pointers to parameter arrays for near white pixel + * parameter calculations + */ +/*****************************************************************************/ +typedef struct CamAwbFade2Parm_s +{ + float* pFade; + float* pCbMinRegionMax; + float* pCrMinRegionMax; + float* pMaxCSumRegionMax; + float* pCbMinRegionMin; + float* pCrMinRegionMin; + float* pMaxCSumRegionMin; + uint16_t ArraySize; +} CamAwbFade2Parm_t; + + + +/*****************************************************************************/ +/** + * IsiLine_t + * + * @brief Contains parameters for a straight line in Hesse normal form in + * Rg/Bg colorspace + * + */ +/*****************************************************************************/ +typedef struct CamCenterLine_s +{ + float f_N0_Rg; /**< Rg component of normal vector */ + float f_N0_Bg; /**< Bg component of normal vector */ + float f_d; /**< Distance of normal vector */ +} CamCenterLine_t; + + + +/*****************************************************************************/ +/** + * @brief Global AWB IIR Filter + */ +/*****************************************************************************/ +typedef struct CamCalibIIR_s +{ + float fIIRDampCoefAdd; /**< incrementer of damping coefficient */ + float fIIRDampCoefSub; /**< decrementer of damping coefficient */ + float fIIRDampFilterThreshold; /**< threshold for incrementing or decrementing of damping coefficient */ + + float fIIRDampingCoefMin; /**< minmuim value of damping coefficient */ + float fIIRDampingCoefMax; /**< maximum value of damping coefficient */ + float fIIRDampingCoefInit; /**< initial value of damping coefficient */ + + uint16_t IIRFilterSize; /**< number of filter items */ + float fIIRFilterInitValue; /**< initial value of the filter items */ +} CamCalibIIR_t; + + + +/*****************************************************************************/ +/** + * @brief Global AWB calibration structure + */ +/*****************************************************************************/ +typedef struct CamCalibAwbGlobal_s +{ + void *p_next; /**< for adding to a list */ + + CamAwbProfileName_t name; /**< profile name */ + CamResolutionName_t resolution; /**< resolution link */ + + Cam3x1FloatMatrix_t SVDMeanValue; + Cam3x2FloatMatrix_t PCAMatrix; + CamCenterLine_t CenterLine; + Cam1x1FloatMatrix_t KFactor; + + CamAwbClipParm_t AwbClipParam; /**< clipping parameter in Rg/Bg space */ + CamAwbGlobalFadeParm_t AwbGlobalFadeParm; + CamAwbFade2Parm_t AwbFade2Parm; + + float fRgProjIndoorMin; + float fRgProjOutdoorMin; + float fRgProjMax; + float fRgProjMaxSky; + + CamIlluminationName_t outdoor_clipping_profile; + + float fRegionSize; + float fRegionSizeInc; + float fRegionSizeDec; + + CamCalibIIR_t IIR; +} CamCalibAwbGlobal_t; + + + +/*****************************************************************************/ +/** + * @brief ECM scheme + */ +/*****************************************************************************/ +typedef struct CamEcmScheme_s +{ + void *p_next; /**< for adding to a list */ + + CamEcmSchemeName_t name; /**< scheme name */ + + float OffsetT0Fac; /**< start flicker avoidance above OffsetT0Fac * Tflicker integration time */ + float SlopeA0; /**< slope of gain */ +} CamEcmScheme_t; + + + +/*****************************************************************************/ +/** + * @brief ECM profile + */ +/*****************************************************************************/ +typedef struct CamEcmProfile_s +{ + void *p_next; /**< for adding to a list */ + + CamEcmProfileName_t name; /**< profile name => serves as resolution link as well */ + + List ecm_scheme; /**< list of ECM schemes; at least one item is expected */ +} CamEcmProfile_t; + + + +/*****************************************************************************/ +/** + * @brief Global AEC calibration structure + */ +/*****************************************************************************/ +typedef struct CamCalibAecGlobal_s +{ + float SetPoint; /**< set point to hit by the ae control system */ + float ClmTolerance; + float DampOver; + float DampUnder; + float AfpsMaxGain; +} CamCalibAecGlobal_t; + + + +/*****************************************************************************/ +/** + * @brief System data structure. + */ +/*****************************************************************************/ +typedef struct CamCalibSystemData_s +{ + bool_t AfpsDefault; +} CamCalibSystemData_t; + + + +#ifdef __cplusplus +} +#endif + +/* @} cam_types */ + +#endif /* __CAM_TYPES_H__ */ + diff --git a/th1520/hardware/camera/include/common/cea_861.h b/th1520/hardware/camera/include/common/cea_861.h new file mode 100755 index 0000000000000000000000000000000000000000..3bbc073ea911948aace2d4983c9c9d3553710cf6 --- /dev/null +++ b/th1520/hardware/camera/include/common/cea_861.h @@ -0,0 +1,90 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +/** + * @file cea_861.h + * + * @brief Defines CEA 861 style video format stuff. + * + *****************************************************************************/ +#ifndef __CEA_861_H__ +#define __CEA_861_H__ + +#include + +#if defined (__cplusplus) +extern "C" { +#endif + +typedef enum Cea861VideoFormat_e +{ + CEA_861_VIDEOFORMAT_INVALID = 0, + + // CEA 861 formats below + CEA_861_VIDEOFORMAT_640x480p60 = 1, + CEA_861_VIDEOFORMAT_1280x720p60 = 4, + CEA_861_VIDEOFORMAT_1920x1080p60 = 16, + CEA_861_VIDEOFORMAT_1920x1080p50 = 31, + CEA_861_VIDEOFORMAT_1920x1080p24 = 32, + CEA_861_VIDEOFORMAT_1920x1080p25 = 33, + CEA_861_VIDEOFORMAT_1920x1080p30 = 34, + + // user defined formats below + CEA_861_VIDEOFORMAT_CUSTOM_BASE = 256 +} Cea861VideoFormat_t; //!< @note The names and numbers intentionally match the CEA 861 Specification; Version D + +typedef struct Cea861VideoFormatDetails_s //!< All counting in CEA spec starts at 1 (not 0) and so do we! +{ + Cea861VideoFormat_t FormatID; //!< CEA 861 format ID. + Cea861VideoFormat_t FormatIDInfoFrame; //!< Format ID to be used in HDMI info frame; required for 3D support; same as FormatID for all CEA 861 formats and most HDMI 3D formats. + char *szName; //!< Format description. + uint16_t Hactive; //!< Active width in pixel. + uint16_t Vactive; //!< Active height in lines. + bool_t Progressive; //!< Progressive/Interlaced (true/false) scanning. + uint32_t PixClk; //!< Pixel clock. + uint16_t PixRep; //!< Clocks per pixel (used for pixel repetition). + uint16_t Htotal; //!< Total width in pixel. + uint16_t HsyncStart; //!< HSync start position. + uint16_t HsyncStop; //!< HSync stop position. + uint16_t HactStart; //!< First active pixel. + uint16_t HfieldPos; //!< Horizontal position of field sync change. + uint16_t Vtotal; //!< Total height in lines (for interlaced: of full frame). + uint16_t VsyncStart; //!< VSync start position. + uint16_t VsyncStop; //!< VSync stop position. + uint16_t VactStart; //!< First active line. + uint16_t VactStartDelay; //!< Delay between VactStart and first line containing active image data; required for 3D support only; set to 0 (null) for CEA 861 formats. + bool_t HsyncPolarity; //!< Hsync polarity high-active/low-active (true/false). + bool_t VsyncPolarity; //!< Vsync polarity high-active/low-active (true/false). + bool_t FsyncPolarity; //!< Field sync polarity high-active/low-active (true/false). + bool_t EnPolarity; //!< Pixel enable polarity high-active/low-active (true/false). +} Cea861VideoFormatDetails_t; + +extern const Cea861VideoFormatDetails_t* Cea861GetVideoFormatDetails +( + Cea861VideoFormat_t FormatID +); + +extern bool_t Cea861AlignVideoFormatDetails +( + Cea861VideoFormatDetails_t *pVideoFormatDetails +); + + +#if defined (__cplusplus) +} +#endif + +#endif /* __CEA_861_H__*/ diff --git a/th1520/hardware/camera/include/common/hdmi_3d.h b/th1520/hardware/camera/include/common/hdmi_3d.h new file mode 100755 index 0000000000000000000000000000000000000000..b4149aee8ae30929e32bc1e1ae44cfdf09a803b0 --- /dev/null +++ b/th1520/hardware/camera/include/common/hdmi_3d.h @@ -0,0 +1,93 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +/** + * @file hdmi_3d.h + * + * @brief Defines HDMI 3D style video format stuff. + * + *****************************************************************************/ +#ifndef __HDMI_3D_H__ +#define __HDMI_3D_H__ + +#include +#include +#include + +#if defined (__cplusplus) +extern "C" { +#endif + +typedef enum Hdmi3DVideoFormat_e +{ + HDMI_3D_VIDEOFORMAT_FRAME_PACKING = 0x00, //!< 0000 Frame packing + HDMI_3D_VIDEOFORMAT_FIELD_ALTERNATIVE = 0x01, //!< 0001 Field alternative + HDMI_3D_VIDEOFORMAT_LINE_ALTERNATIVE = 0x02, //!< 0010 Line alternative + HDMI_3D_VIDEOFORMAT_SIDE_BY_SIDE_FULL = 0x03, //!< 0011 Side-by-Side (Full) + HDMI_3D_VIDEOFORMAT_L_DEPTH = 0x04, //!< 0100 L + depth + HDMI_3D_VIDEOFORMAT_L_DEPTH_GRFX_DEPTH = 0x05, //!< 0101 L + depth + graphics + graphics-depth + HDMI_3D_VIDEOFORMAT_TOP_AND_BOTTOM = 0x06, //!< 0110 Top-and-Bottom + // 0111 Reserved for future use. + HDMI_3D_VIDEOFORMAT_SIDE_BY_SIDE_HALF = 0x08, //!< 1000 Side-by-Side (Half) (See Table H-3) + // 1001 ~ 1110 Reserved for future use. + HDMI_3D_VIDEOFORMAT_INVALID = 0x0f //!< 1111 Not in use. +} Hdmi3DVideoFormat_t; //!< @note The names and numbers intentionally match the HDMI Specification; Version 1.4a; March 4, 2010; chapter "Extraction of 3D Signaling Portion". + +typedef struct Hdmi3DVideoFormatDetails_s +{ + Hdmi3DVideoFormat_t FormatID; //!< HDMI 3D format ID. + char *szName; //!< Format description. + struct Progressive_s + { + bool_t Supported; //!< Can be used with progressive video. + uint16_t SubImages; //!< Number of sub images expected per 3D image. + } Progressive; + struct Interlaced_s + { + bool_t Supported; //!< Can be used with progressive video. + uint16_t SubImages; //!< Number of sub images expected per 3D image. + } Interlaced; +} Hdmi3DVideoFormatDetails_t; + +#define Hdmi3DHasExtData(_format) ((_format&0x8)!=0) + +extern const Hdmi3DVideoFormatDetails_t* Hdmi3DGet3DFormatDetails +( + Hdmi3DVideoFormat_t FormatID //!< ID of 3D format to get details for. +); + +extern uint16_t Hdmi3DGetNumSubImages +( + const Hdmi3DVideoFormat_t FormatID, //!< ID of 3D format to use. + const Cea861VideoFormatDetails_t *pBaseCeaFormatDetails //!< Reference to base CEA 861 timing details. +); + +extern RESULT Hdmi3DGetVideoFormatDetails +( + const Hdmi3DVideoFormat_t FormatID, //!< ID of 3D format to use. + const uint16_t SubImageNum, //!< Number of sub image for which to calc timing details; 0 = first image. + const Cea861VideoFormatDetails_t *pBaseCeaFormatDetails, //!< Reference to base CEA 861 timing details. + Cea861VideoFormatDetails_t *pSubCeaFormatDetails //!< Reference to storage space for calculated sub image timing details. +); + +// NOTE: The value must match the highest SubImages number in Hdmi3DVideoFormats table in implementation. +#define HDMI_3D_MAX_NUM_SUBIMAGES 4 //!< Max number of sub images required for supported 3D formats. + +#if defined (__cplusplus) +} +#endif + +#endif /* __HDMI_3D_H__*/ diff --git a/th1520/hardware/camera/include/common/hw_version.h b/th1520/hardware/camera/include/common/hw_version.h new file mode 100755 index 0000000000000000000000000000000000000000..ae039f6492ab0ac5a27cb7df5e19026656fe278e --- /dev/null +++ b/th1520/hardware/camera/include/common/hw_version.h @@ -0,0 +1,98 @@ +/****************************************************************************** + * + * Copyright 2010, Dream Chip Technologies GmbH. All rights reserved. + * No part of this work may be reproduced, modified, distributed, transmitted, + * transcribed, or translated into any language or computer format, in any form + * or by any means without written permission of: + * Dream Chip Technologies GmbH, Steinriede 10, 30827 Garbsen / Berenbostel, + * Germany + * + *****************************************************************************/ +/** + * @file hw_version.h + * + * @brief + * This header files contains hardware module version define informations. + * + *****************************************************************************/ +#ifndef __HW_VERSION_H__ +#define __HW_VERSION_H__ + + +/*****************************************************************************/ +/** + * @brief HDR module version type + */ +/*****************************************************************************/ +#define VSI_ISP_HDR_NOTSUPPORT 0 //!< Not support HDR +#define VSI_ISP_HDR_V10 1 //!< Version V10 +#define VSI_ISP_HDR_V11 2 //!< Version V11 +#define VSI_ISP_HDR_V12 3 //!< Version V12 +#define VSI_ISP_HDR_V13 4 //!< Version V13 + + + + +///////////////////////////////////////// +//add Version defines +///////////////////////////////////////// +#ifdef ISP8000NANO_V1801 + +#define VSI_ISP_HDR_VERSION VSI_ISP_HDR_NOTSUPPORT + +#elif defined ISP8000NANO_V1802 + +#define VSI_ISP_HDR_VERSION VSI_ISP_HDR_V11 + +#elif defined ISP8000_V1901 + +#define VSI_ISP_HDR_VERSION VSI_ISP_HDR_V11 + +#elif defined ISP8000L_V1901 + +#define VSI_ISP_HDR_VERSION VSI_ISP_HDR_NOTSUPPORT + +#elif defined ISP8000L_V1902 + +#define VSI_ISP_HDR_VERSION VSI_ISP_HDR_V11 + +#elif defined ISP8000L_V1903 + +#define VSI_ISP_HDR_VERSION VSI_ISP_HDR_V12 + +#elif defined ISP8000L_V1905 + +#define VSI_ISP_HDR_VERSION VSI_ISP_HDR_V12 + +#elif defined ISP8000L_V2001 + +#define VSI_ISP_HDR_VERSION VSI_ISP_HDR_V12 + +#elif defined ISP8000L_V2002 + +#define VSI_ISP_HDR_VERSION VSI_ISP_HDR_V12 + +#elif defined ISP8000_V2003 + +#define VSI_ISP_HDR_VERSION VSI_ISP_HDR_V13 + +#elif defined ISP8000L_V2007 + +#define VSI_ISP_HDR_VERSION VSI_ISP_HDR_V12 + +#elif defined ISP8000L_V2008 + +#define VSI_ISP_HDR_VERSION VSI_ISP_HDR_V12 + +#elif defined ISP8000NANO_V2012 + +#define VSI_ISP_HDR_VERSION VSI_ISP_HDR_NOTSUPPORT + +#endif + + + + + +#endif /* __HW_VERSION_H__ */ + diff --git a/th1520/hardware/camera/include/common/list.h b/th1520/hardware/camera/include/common/list.h new file mode 100755 index 0000000000000000000000000000000000000000..c80e7d6ca421424903120085cec84db596bc82ca --- /dev/null +++ b/th1520/hardware/camera/include/common/list.h @@ -0,0 +1,471 @@ +/******************************************************************************\ +|* Copyright (c) <2010> by Silicon Image, Inc., used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +/*! + * @file list.h + * @version 1.0 + * @author Ulrich Marx + * + * @brief implementation of a single linked list + * + * @note (the tag is omitted if there are no notes) \n + */ + +/** + * @file list.h + * + *
+ *
+ *   Principal Author: Ulrich Marx 
+ *   Company: Silicon Image
+ *
+ *   Programming Language: C
+ *   Date:    Tue 22 Apr 2008 07:58:35 PM CEST
+ *   Designed for any OS (conformable to ANSI)
+ *
+ *   Description:
+ *
+ *
+ * 
+ * + ******************************************************************************/ +#ifndef __LIST_H__ +#define __LIST_H__ + +#include /* for DCT_ASSERT */ + +#define ASSERT DCT_ASSERT + +/******************************************************************************/ +/** + * @brief Implementation of single linked list + * + ******************************************************************************/ +typedef struct _List +{ + struct _List* p_next; +} List; + + +/******************************************************************************/ +/** + * @brief Prepare a list item. + * + * @note This function prepares a list item so that it can be added to a list. + * + * @param p_item The list item to be initialized. + * + ******************************************************************************/ +static inline void ListPrepareItem(void* p_item) +{ + ASSERT( p_item != NULL ); + ((List *)p_item)->p_next = NULL; +} + + + +/******************************************************************************/ +/** + * @brief Initialize a list. + * + * @note This function initalizes a list. The list will be empty after this + * function has been called. + * + * @param p_list The list to be initialized. + * + ******************************************************************************/ +static inline void ListInit(List* p_list) +{ + ASSERT( p_list != NULL ); + p_list->p_next = NULL; +} + + + +/******************************************************************************/ +/** + * @brief Get a pointer to the first element of a list. + * + * @note This function returns a pointer to the first element of the list. + * The element will \b not be removed from the list. + * + * @param p_list The list. + * + * @return A pointer to the first element on the list. + * + ******************************************************************************/ +static inline List *ListHead(const List *p_list) +{ + List *p_head; + + ASSERT( p_list != NULL ); + + p_head = p_list->p_next; + + return ( p_head ); +} + + + +/******************************************************************************/ +/** + * @brief Get the tail of a list. + * + * @note This function returns a pointer to the elements following the first + * element of a list. No elements are removed by this function. + * + * @param p_list The list + * + * @return A pointer to the element after the first element on the list. + * + ******************************************************************************/ +static inline List* ListTail(List* p_list) +{ + List* l; + + ASSERT( p_list != NULL ); + + if (p_list->p_next == NULL) + { + return ( NULL ); + } + + for (l = p_list; l->p_next != NULL; l = l->p_next) + { + /* make lint happy */ + } + + return ( l ); +} + + + +/******************************************************************************/ +/** + * @brief Tests wheter a list is empty. + * + * @param p_list The list + * + ******************************************************************************/ +static inline int ListEmpty(const List* p_list) +{ + ASSERT( p_list != NULL ); + + return ( ((p_list->p_next == NULL) ? 1 : 0) ); +} + + + +/******************************************************************************/ +/** + * @brief Returns No of Elemtens + * + * @param p_list The list + * + ******************************************************************************/ +static inline int ListNoItems(const List* p_list) +{ + int cnt = 0; + List* l; + + ASSERT( p_list != NULL ); + + l = ListHead( p_list ); + while ( l != NULL ) + { + ++cnt; + l = l->p_next; + } + + return ( cnt ); +} + + + +/******************************************************************************/ +/** + * @brief Add an item at the end of a list. + * + * @note This function adds an item to the end of the list. + * + * @param p_list The list. + * @param p_item A pointer to the item to be added. + * + ******************************************************************************/ +static inline void ListAddTail(List* p_list, void* p_item) +{ + List* l; + + ASSERT( p_list != NULL ); + ASSERT( p_item != NULL ); + + ((List *)p_item)->p_next = NULL; + l = ListTail(p_list); + if ( l == NULL ) + { + p_list->p_next = (List *)p_item; + } + else + { + l->p_next = (List *)p_item; + } +} + + + +/******************************************************************************/ +/** + * @brief Get the first object on a list. + * + * @note This function removes the first object on the list and returns a + * pointer to the list. + * + * @param p_list The list. + * + * @return The removed head item of the list. + * + ******************************************************************************/ +static inline List* ListGetHead(List* p_list) +{ + List* l; + + ASSERT( p_list != NULL ); + + if ( p_list->p_next != NULL ) + { + l = p_list->p_next; + return ( l ); + } + + return ( NULL ); +} + + + +/******************************************************************************/ +/** + * @brief Get the first object on a list. + * + * @note This function removes the first object on the list and returns a + * pointer to the list. + * + * @param p_list The list. + * + * @return The removed head item of the list. + * + ******************************************************************************/ +static inline List* ListGetItemByIdx(List* p_list, const int idx) +{ + List* l; + int cnt = 0; + + ASSERT( p_list != NULL ); + + l = ListHead( p_list ); + while ( (l != NULL) && (cnt < idx) ) + { + ++cnt; + l = l->p_next; + } + + return ( l ); +} + + + +/******************************************************************************/ +/** + * @brief Remove the first object on a list. + * + * @note This function removes the first object on the list and returns a + * pointer to the list. + * + * @param p_list The list. + * + * @return The removed head item of the list. + * + ******************************************************************************/ +static inline List* ListRemoveHead(List* p_list) +{ + List* l; + + ASSERT( p_list != NULL ); + + if ( p_list->p_next != NULL ) + { + l = p_list->p_next; + p_list->p_next = l->p_next; + return ( l ); + } + + return ( NULL ); +} + + + +/******************************************************************************/ +/** + * @brief Search an element in list + * + * @note This function searches the first element which matches to the + * given search-function + * + * @param p_list The list. + * func The search function out side this file + * key The key that search function matches + * + * @return The first element + * @retval NULL no element matches + * + ******************************************************************************/ +typedef int (*pSearchFunc)(List *, void *key); + +static inline List* ListSearch(List *p_list, pSearchFunc func, void *key) +{ + List *l; + + ASSERT ( p_list != NULL ); + ASSERT ( func != NULL ); + + l = ListHead( p_list ); + while ( l ) + { + if ( func( l, key) ) + { + return ( l ); + } + l = l->p_next; + } + + return ( NULL ); +} + + + +/******************************************************************************/ +/** + * @brief Search an element in list + * + * @note This function searches the first element which matches to the + * given search-function + * + * @param p_list The list. + * func The search function out side this file + * key The key that search function matches + * + * @return The first element + * @retval NULL no element matches + * + ******************************************************************************/ +typedef void (*pForEachFunc)(List *, void *); + +static inline List* ListForEach(List *p_list, pForEachFunc func, void *param) +{ + List *l; + + ASSERT ( p_list != NULL ); + ASSERT ( func != NULL ); + + l = ListHead( p_list ); + while ( l ) + { + func( l, param ); + l = l->p_next; + } + + return ( NULL ); +} + + + +/******************************************************************************/ +/** + * @brief Get the Index of an Item + * + * @note This function removes the first object on the list and returns a + * pointer to the list. + * + * @param p_list The list. + * + * @return The removed head item of the list. + * + ******************************************************************************/ +static inline int ListGetIdxByItem(List *p_list, pSearchFunc func, void *key) +{ + List* l; + int cnt = 0; + + ASSERT( p_list != NULL ); + + l = ListHead( p_list ); + while ( l ) + { + if ( func( l, key) ) + { + return ( cnt ); + } + + ++cnt; + l = l->p_next; + } + + return ( -1 ); +} + + + + +/******************************************************************************/ +/** + * @brief Search an element in list + * + * @note This function searches the first element which matches to the + * given search-function + * + * @param p_list The list. + * func The search function out side this file + * key The key that search function matches + * + * @return The first element + * @retval NULL no element matches + * + ******************************************************************************/ +static inline List* ListRemoveItem(List *p_list, pSearchFunc func, void *key) +{ + List *l, *pre_l; + + ASSERT ( p_list != NULL ); + + pre_l = p_list; + l = ListHead( p_list ); + while ( l ) + { + if ( func( l, key) ) + { + /* isolate l from list */ + pre_l->p_next = l->p_next; + l->p_next = NULL; + return ( l ); + } + pre_l = l; + l = l->p_next; + } + + return ( NULL ); +} + + +#endif /* __LIST_H__ */ diff --git a/th1520/hardware/camera/include/common/mipi.h b/th1520/hardware/camera/include/common/mipi.h new file mode 100755 index 0000000000000000000000000000000000000000..091eeb443cc825fa86d23bbcd13dd3d4fb55c465 --- /dev/null +++ b/th1520/hardware/camera/include/common/mipi.h @@ -0,0 +1,156 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +/** + * @file mipi.h + * + * @brief Definition of MIPI CSI-2 spec. stuff. + * + *****************************************************************************/ +#ifndef __MIPI_H__ +#define __MIPI_H__ + +#include + +#if defined (__cplusplus) +extern "C" { +#endif + + +/******************************************************************************/ +/** + * @brief MIPI virtual channels. + * + ******************************************************************************/ +typedef enum MipiVirtualChannel_e +{ + MIPI_VIRTUAL_CHANNEL_0 = 0x00, //!< virtual channel 0 + MIPI_VIRTUAL_CHANNEL_1 = 0x01, //!< virtual channel 1 + MIPI_VIRTUAL_CHANNEL_2 = 0x02, //!< virtual channel 2 + MIPI_VIRTUAL_CHANNEL_3 = 0x03, //!< virtual channel 3 + + MIPI_VIRTUAL_CHANNEL_MAX +} MipiVirtualChannel_t; + + +/******************************************************************************/ +/** + * @brief MIPI data types. + * + ******************************************************************************/ +typedef enum MipiDataType_e +{ + MIPI_DATA_TYPE_FSC = 0x00, //!< frame start code + MIPI_DATA_TYPE_FEC = 0x01, //!< frame end code + MIPI_DATA_TYPE_LSC = 0x02, //!< line start code + MIPI_DATA_TYPE_LEC = 0x03, //!< line end code + + // 0x04 .. 0x07 reserved + + MIPI_DATA_TYPE_GSPC1 = 0x08, //!< gerneric short packet code 1 + MIPI_DATA_TYPE_GSPC2 = 0x09, //!< gerneric short packet code 2 + MIPI_DATA_TYPE_GSPC3 = 0x0A, //!< gerneric short packet code 3 + MIPI_DATA_TYPE_GSPC4 = 0x0B, //!< gerneric short packet code 4 + MIPI_DATA_TYPE_GSPC5 = 0x0C, //!< gerneric short packet code 5 + MIPI_DATA_TYPE_GSPC6 = 0x0D, //!< gerneric short packet code 6 + MIPI_DATA_TYPE_GSPC7 = 0x0E, //!< gerneric short packet code 7 + MIPI_DATA_TYPE_GSPC8 = 0x0F, //!< gerneric short packet code 8 + + MIPI_DATA_TYPE_NULL = 0x10, //!< null + MIPI_DATA_TYPE_BLANKING = 0x11, //!< blanking data + MIPI_DATA_TYPE_EMBEDDED = 0x12, //!< embedded 8-bit non image data + + // 0x13 .. 0x17 reserved + + MIPI_DATA_TYPE_YUV420_8 = 0x18, //!< YUV 420 8-Bit + MIPI_DATA_TYPE_YUV420_10 = 0x19, //!< YUV 420 10-Bit + MIPI_DATA_TYPE_LEGACY_YUV420_8 = 0x1A, //!< YUV 420 8-Bit + // 0x1B reserved + MIPI_DATA_TYPE_YUV420_8_CSPS = 0x1C, //!< YUV 420 8-Bit (chroma shifted pixel sampling) + MIPI_DATA_TYPE_YUV420_10_CSPS = 0x1D, //!< YUV 420 10-Bit (chroma shifted pixel sampling) + MIPI_DATA_TYPE_YUV422_8 = 0x1E, //!< YUV 422 8-Bit + MIPI_DATA_TYPE_YUV422_10 = 0x1F, //!< YUV 422 10-Bit + + MIPI_DATA_TYPE_RGB444 = 0x20, //!< RGB444 + MIPI_DATA_TYPE_RGB555 = 0x21, //!< RGB555 + MIPI_DATA_TYPE_RGB565 = 0x22, //!< RGB565 + MIPI_DATA_TYPE_RGB666 = 0x23, //!< RGB666 + MIPI_DATA_TYPE_RGB888 = 0x24, //!< RGB888 + + // 0x25 .. 0x27 reserved + + MIPI_DATA_TYPE_RAW_6 = 0x28, //!< RAW6 + MIPI_DATA_TYPE_RAW_7 = 0x29, //!< RAW7 + MIPI_DATA_TYPE_RAW_8 = 0x2A, //!< RAW8 + MIPI_DATA_TYPE_RAW_10 = 0x2B, //!< RAW10 + MIPI_DATA_TYPE_RAW_12 = 0x2C, //!< RAW12 + MIPI_DATA_TYPE_RAW_14 = 0x2D, //!< RAW14 + + // 0x2E .. 0x2F reserved + + MIPI_DATA_TYPE_USER_1 = 0x30, //!< user defined 1 + MIPI_DATA_TYPE_USER_2 = 0x31, //!< user defined 2 + MIPI_DATA_TYPE_USER_3 = 0x32, //!< user defined 3 + MIPI_DATA_TYPE_USER_4 = 0x33, //!< user defined 4 + MIPI_DATA_TYPE_USER_5 = 0x34, //!< user defined 5 + MIPI_DATA_TYPE_USER_6 = 0x35, //!< user defined 6 + MIPI_DATA_TYPE_USER_7 = 0x36, //!< user defined 7 + MIPI_DATA_TYPE_USER_8 = 0x37, //!< user defined 8 + + MIPI_DATA_TYPE_MAX +} MipiDataType_t; + + +/******************************************************************************/ +/** + * @brief MIPI compression schemes. + * + ******************************************************************************/ +typedef enum MipiDataCompressionScheme_e +{ + MIPI_DATA_COMPRESSION_SCHEME_NONE = 0, //!< NONE + MIPI_DATA_COMPRESSION_SCHEME_12_8_12 = 1, //!< 12_8_12 + MIPI_DATA_COMPRESSION_SCHEME_12_7_12 = 2, //!< 12_7_12 + MIPI_DATA_COMPRESSION_SCHEME_12_6_12 = 3, //!< 12_6_12 + MIPI_DATA_COMPRESSION_SCHEME_10_8_10 = 4, //!< 10_8_10 + MIPI_DATA_COMPRESSION_SCHEME_10_7_10 = 5, //!< 10_7_10 + MIPI_DATA_COMPRESSION_SCHEME_10_6_10 = 6, //!< 10_6_10 + + MIPI_DATA_COMPRESSION_SCHEME_MAX +} MipiDataCompressionScheme_t; + + +/******************************************************************************/ +/** + * @brief MIPI predictor blocks. + * + ******************************************************************************/ +typedef enum MipiPredictorBlock_e +{ + MIPI_PREDICTOR_BLOCK_INVALID = 0, //!< invalid + + MIPI_PREDICTOR_BLOCK_1 = 1, //!< Predictor1 (simple algorithm) + MIPI_PREDICTOR_BLOCK_2 = 2, //!< Predictor2 (more complex algorithm) + + MIPI_PREDICTOR_BLOCK_MAX +} MipiPredictorBlock_t; + + +#if defined (__cplusplus) +} +#endif + +#endif /* __MIPI_H__*/ diff --git a/th1520/hardware/camera/include/common/misc.h b/th1520/hardware/camera/include/common/misc.h new file mode 100755 index 0000000000000000000000000000000000000000..271c1e1fe8ae65ee180b1fe892d211a73956a651 --- /dev/null +++ b/th1520/hardware/camera/include/common/misc.h @@ -0,0 +1,60 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +/** + * @file misc.h + * + * @brief Some often used little helpers; mainly implemented as macros. + * + *****************************************************************************/ +#ifndef __MISC_H__ +#define __MISC_H__ + +/* beware of macro side effects! */ + +#ifndef __FLT_EPSILON__ +#define __FLT_EPSILON__ 0.000000119209289550781250000000 +#endif /* __FLT_EPSILON__ */ + +#ifndef FLT_EPSILON +#define FLT_EPSILON __FLT_EPSILON__ +#endif /* FLT_EPSILON */ + +#ifndef FLT_MAX +#define FLT_MAX ((float)3.40282346638528860e+38) +#endif /* FLT_MAX */ + +#ifndef MIN +#define MIN(a, b) ( ((a)<(b)) ? (a) : (b) ) +#endif /* MIN */ + +#ifndef MAX +#define MAX(a, b) ( ((a)>(b)) ? (a) : (b) ) +#endif /* MAX */ + +#ifndef ABS +#define ABS(a) ( ((a)<0) ? -(a) : (a) ) +#endif /*ABS */ + +#ifndef SIGN +#define SIGN(a) ( ((a)<0) ? -1 : ((a)>0) ? 1 : 0 ) +#endif /* SIGN */ + +#ifndef ROUND_UP +#define ROUND_UP(a, b) ((a + b - 1) / b * b) +#endif + +#endif /* __MISC_H__ */ diff --git a/th1520/hardware/camera/include/common/picture_buffer.h b/th1520/hardware/camera/include/common/picture_buffer.h new file mode 100755 index 0000000000000000000000000000000000000000..73f5eb553c3d8d06c3939b2c210b3de40793d6e1 --- /dev/null +++ b/th1520/hardware/camera/include/common/picture_buffer.h @@ -0,0 +1,84 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +/** + * @file picture_buffer.h + * + * @brief Defines picture buffer meta data structure including its components + * and helper functions around that structure. + * + *****************************************************************************/ +/** + * @page module_name_page Module Name + * Describe here what this module does. + * + * For a detailed list of functions and implementation detail refer to: + * - @ref module_name + * + * @defgroup picture_buffer Picture buffer descriptor + * @{ + * + */ +#ifndef __PICTURE_BUFFER_H__ +#define __PICTURE_BUFFER_H__ + +#include +#include +#include +#include + +#if defined (__cplusplus) +extern "C" { +#endif + +/* input and output buffer macro define, default disable. */ +#define ENABLE_BUFFER_DUMP 0 + + + +/*****************************************************************************/ +/** + * PicBufIsConfigValid() + * + * @brief Check the given picture buffer meta data structure for valid + * type & layout combination. + * + * @param Reference to picture buffer meta data structure. + * @return Return the result of the function call. + * @retval RET_SUCCESS type & layout combination is valid + * @retval RET_NOTSUPP type & layout combination is invalid + * @retval RET_OUTOFRANGE invalid type and/or layout + * + *****************************************************************************/ +extern RESULT PicBufIsConfigValid +( + PicBufMetaData_t *pPicBufMetaData +); + +extern RESULT PicBufDump +( + PicBufMetaData_t *pPicBuffer, + const uint8_t *logical, + bool_t inputSource +); + +/* @} picture_buffer */ + +#if defined (__cplusplus) +} +#endif + +#endif /* __PICTURE_BUFFER_H__ */ diff --git a/th1520/hardware/camera/include/common/return_codes.h b/th1520/hardware/camera/include/common/return_codes.h new file mode 100755 index 0000000000000000000000000000000000000000..4501ff6d8aeb92719b900e184fc7e90f60755d38 --- /dev/null +++ b/th1520/hardware/camera/include/common/return_codes.h @@ -0,0 +1,52 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +/** + * @file return_codes.h + * + * @brief + * This header files contains general return codes . + * + *****************************************************************************/ +#ifndef __RETURN_CODES_H__ +#define __RETURN_CODES_H__ + +typedef int RESULT; + +#define RET_SUCCESS 0 //!< this has to be 0, if clauses rely on it +#define RET_FAILURE 1 //!< general failure +#define RET_NOTSUPP 2 //!< feature not supported +#define RET_BUSY 3 //!< there's already something going on... +#define RET_CANCELED 4 //!< operation canceled +#define RET_OUTOFMEM 5 //!< out of memory +#define RET_OUTOFRANGE 6 //!< parameter/value out of range +#define RET_IDLE 7 //!< feature/subsystem is in idle state +#define RET_WRONG_HANDLE 8 //!< handle is wrong +#define RET_NULL_POINTER 9 //!< the/one/all parameter(s) is a(are) NULL pointer(s) +#define RET_NOTAVAILABLE 10 //!< profile not available +#define RET_DIVISION_BY_ZERO 11 //!< a divisor equals ZERO +#define RET_WRONG_STATE 12 //!< state machine in wrong state +#define RET_INVALID_PARM 13 //!< invalid parameter +#define RET_PENDING 14 //!< command pending +#define RET_WRONG_CONFIG 15 //!< given configuration is invalid + + +#define UPDATE_RESULT( cur_res, new_res ) { RESULT __lres__ = (new_res); if (cur_res == RET_SUCCESS) cur_res = __lres__; } //!< Keeps first non-success result; cur_res must be a modifiable L-value; new_res can be any type of R-value including function call. + +#define RETURN_RESULT_IF_DIFFERENT( cur_res, exp_res ) if ( exp_res != cur_res ) { return ( cur_res ); } + +#endif /* __RETURN_CODES_H__ */ + diff --git a/th1520/hardware/camera/include/common/utl_fixfloat.h b/th1520/hardware/camera/include/common/utl_fixfloat.h new file mode 100755 index 0000000000000000000000000000000000000000..4b6d579d2d7292c4155a82eb0b92e032846647d1 --- /dev/null +++ b/th1520/hardware/camera/include/common/utl_fixfloat.h @@ -0,0 +1,92 @@ +/******************************************************************************\ +|* Copyright (c) <2010> by Silicon Image, Inc., used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +/*! + * @file utl_fixfloat.h + * @version 1.0 + * @author Neugebauer + * @brief Floatingpoint to Fixpoint and vice versa conversion + * routines. + */ + + +#ifndef __UTL_FIXFLOAT_H__ +#define __UTL_FIXFLOAT_H__ + +/***************************************************************************** + * Prototypes + *****************************************************************************/ + +uint32_t UtlFloatToFix_U0107( float fFloat ); +float UtlFixToFloat_U0107( uint32_t ulFix ); + +uint32_t UtlFloatToFix_U0208( float fFloat ); +float UtlFixToFloat_U0208( uint32_t ulFix ); + +uint32_t UtlFloatToFix_U0408( float fFloat ); +float UtlFixToFloat_U0408( uint32_t ulFix ); + +uint32_t UtlFloatToFix_U0800( float fFloat ); +float UtlFixToFloat_U0800( uint32_t ulFix ); + +uint32_t UtlFloatToFix_U1000( float fFloat ); +float UtlFixToFloat_U1000( uint32_t ulFix ); + +uint32_t UtlFloatToFix_U1200( float fFloat ); +float UtlFixToFloat_U1200( uint32_t ulFix ); + +uint32_t UtlFloatToFix_U0010( float fFloat ); +float UtlFixToFloat_U0010( uint32_t ulFix ); + +uint32_t UtlFloatToFix_S0207( float fFloat ); +float UtlFixToFloat_S0207( uint32_t ulFix ); + +uint32_t UtlFloatToFix_S0307( float fFloat ); +float UtlFixToFloat_S0307( uint32_t ulFix ); + +uint32_t UtlFloatToFix_S0407( float fFloat ); +float UtlFixToFloat_S0407( uint32_t ulFix ); + +uint32_t UtlFloatToFix_S0504( float fFloat ); +float UtlFixToFloat_S0504( uint32_t ulFix ); + +uint32_t UtlFloatToFix_S0808( float fFloat ); +float UtlFixToFloat_S0808( uint32_t ulFix ); + +uint32_t UtlFloatToFix_S0800( float fFloat ); +float UtlFixToFloat_S0800( uint32_t ulFix ); + +uint32_t UtlFloatToFix_S0900( float fFloat ); +float UtlFixToFloat_S0900( uint32_t ulFix ); + +uint32_t UtlFloatToFix_S1200( float fFloat ); +float UtlFixToFloat_S1200( uint32_t ulFix ); + +uint32_t UtlFloatToFix_S0109( float fFloat ); +float UtlFixToFloat_S0109( uint32_t ulFix ); + +uint32_t UtlFloatToFix_S0408( float fFloat ); +float UtlFixToFloat_S0408( uint32_t ulFix ); + +uint32_t UtlFloatToFix_S0108( float fFloat ); +float UtlFixToFloat_S0108( uint32_t ulFix ); + +uint32_t UtlFloatToFix_S0110( float fFloat ); +float UtlFixToFloat_S0110( uint32_t ulFix ); +uint32_t UtlValueMap( uint32_t value, uint32_t sLower, uint32_t sUpper, uint32_t dLower, uint32_t dUpper); + +#endif /* __UTL_FIXfloat_H__ */ + diff --git a/th1520/hardware/camera/include/csi_hal/csi_allocator.h b/th1520/hardware/camera/include/csi_hal/csi_allocator.h new file mode 100755 index 0000000000000000000000000000000000000000..30a7eea3e0da1a7a8fa9687c08021182f511b9d5 --- /dev/null +++ b/th1520/hardware/camera/include/csi_hal/csi_allocator.h @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2021 Alibaba Group Holding Limited + * Author: LuChongzhi + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef __CSI_ALLOCATOR_H__ +#define __CSI_ALLOCATOR_H__ + +#include +#include +#include +#include + +typedef enum csi_allocator_type { + CSI_ALLOCATOR_TYPE_SYSTEM, + CSI_ALLOCATOR_TYPE_SYSTEM_CONTIG, + CSI_ALLOCATOR_TYPE_CARVEOUT, + CSI_ALLOCATOR_TYPE_DMA, + CSI_ALLOCATOR_TYPE_CUSTOM, +} csi_allocator_type_e; // refer from ion_heap_type + +typedef struct csi_mem { + void *usr_addr; + union { + int64_t phy_addr; /* 0 means invalid */ + int fd; /* -1 means invalid */ + }; + + size_t size; + void *opaque; /* not for user, DO NOT use or modify it */ +} csi_mem_s; + + +typedef struct csi_allocator { + //int (*init)(char *args); + csi_mem_s *(*alloc)(csi_allocator_type_e type, size_t size, uint32_t align); + void (*free)(csi_mem_s *mem); + void *(*map)(csi_mem_s *mem); + void (*unmap)(csi_mem_s *mem); +} csi_allocator_s; + +//csi_allocator_s *csi_allocator_get(csi_allocator_type_e type); +int32_t csi_hal_set_allocator(csi_allocator_s allocator); +int32_t csi_hal_get_allocator(csi_allocator_s *allocator); + +#endif /* __CSI_ALLOCATOR_H__ */ diff --git a/th1520/hardware/camera/include/csi_hal/csi_audio_ai.h b/th1520/hardware/camera/include/csi_hal/csi_audio_ai.h new file mode 100755 index 0000000000000000000000000000000000000000..9d09f54e1b733ec0c30e8f4cdebb4b06db996a0d --- /dev/null +++ b/th1520/hardware/camera/include/csi_hal/csi_audio_ai.h @@ -0,0 +1,135 @@ +/* + * Copyright (C) 2021 Alibaba Group Holding Limited + * Author: fuqian.zxr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#ifndef __CSI_AUDIO_AI_H__ +#define __CSI_AUDIO_AI_H__ + +#include "csi_audio_common.h" + +#define CSI_AUDIO_AI_VERSION_MAJOR 0 +#define CSI_AUDIO_AI_VERSION_MINOR 1 + +#define VQE_DRC_SECNUM 5 + +#define CSI_AI_MAX_COUNT 16 +#define CSI_AI_NAME_MAX_LEN 32 + +#define CSI_AI_CAP_SPDIF 0x00000001 /*Is a spdif device*/ +#define CSI_AI_CAP_HDMI 0x00000002 /*IS a hdmi audio*/ +#define CSI_AI_CAP_CODEC 0x00000003 /*Is a codec audio*/ + +typedef struct csi_ai_info { + char ai_name[CSI_AI_NAME_MAX_LEN]; + unsigned int capbilities; +}csi_ai_info_s; + +typedef struct csi_ai_infos { + unsigned int count; + csi_ai_info_s info[CSI_AI_MAX_COUNT]; +}csi_ai_infos_s; + +typedef struct csi_aec_frame { + csi_audio_frame_s refframe; + bool bvalid; + bool bsysbind; +}csi_aec_frame_s; + +typedef struct csi_aichn_frame{ + uint32_t usr_frm_depth; +}csi_aichn_frame_s; + +typedef struct csi_ai_aec_config { + bool usrmode; + int8_t cngmode; + int8_t nearallpassenergy; + int8_t nearcleansupenergy; + int16_t dthnl_sort_qth; + int16_t echobandlow; + int16_t echobandhigh; + int16_t echobandlow2; + int16_t echobandhigh2; + int16_t erl_band[6]; + int16_t erl[7]; + int16_t voice_protect_freql; + int16_t voice_protect_freql1; + int32_t reserved; +}csi_ai_aec_config_s; + +typedef struct csi_ai_rnr_config { + bool usrmode; + int32_t nrmode; + int32_t maxnrlevel; + int32_t noisethresh; +}csi_ai_rnr_config_s; + +typedef struct csi_ai_hdr_config { + bool usrmode; + int32_t mingaindb; + int32_t maxgaindb; + int32_t micgaindb; + int32_t micgainstepdb; + void *callback; +}csi_ai_hdr_config_s; + +typedef struct csi_ai_drc_config { + bool usrmode; + int16_t attacktime; + int16_t releasetime; + int16_t oldlevdb[VQE_DRC_SECNUM]; + int16_t newlevdb[VQE_DRC_SECNUM]; +}csi_ai_drc_config_s; + + +int32_t csi_ai_get_version(csi_api_version_u *version); + +int32_t csi_ai_query_list(csi_ai_infos_s *infos); + +int32_t csi_ai_setpubattr(int32_t aidevid,csi_aio_attr_s *aiattr); +int32_t csi_ai_getpubattr(int32_t aidevid,csi_aio_attr_s *aiattr); + +int32_t csi_ai_enable(int32_t aidevid); +int32_t csi_ai_disable(int32_t aidevid); + +int32_t csi_ai_enablechn(int32_t aidevid,int32_t aichn); +int32_t csi_ai_disablechn(int32_t aidevid,int32_t aichn); + +int32_t csi_ai_getframe(int32_t aidev,int32_t aichn,csi_audio_frame_s *frm,csi_aec_frame_s *aecfrm,int32_t timeout); +int32_t csi_ai_releaseframe(int32_t aidev,int32_t aichn,csi_audio_frame_s *frm,csi_aec_frame_s *aecfrm); + +int32_t csi_ai_setchnparam(int32_t aidev,int32_t aichn,csi_aichn_frame_s *chnparam); +int32_t csi_ai_getchnparam(int32_t aidev,int32_t aichn,csi_aichn_frame_s *chnparam); + +int32_t csi_ai_enableresmp(int32_t aidev,int32_t aichn,csi_audio_sample_rate_e out_sample_rate); +int32_t csi_ai_disableresmp(int32_t aidev,int32_t aichn); + +int32_t csi_ai_setvqeattr(int32_t aidev,int32_t aichn,int32_t aochn,int *level); +int32_t csi_ai_getvqeattr(int32_t aidev,int32_t aichn,int *level); + +int32_t csi_ai_settalkvqeattr(int32_t aidev,int32_t aichn,int32_t aodev,int32_t aochn,int *level); +int32_t csi_ai_gettalkvqeattr(int32_t aidev,int32_t aichn,int *level); + +int32_t csi_ai_setrecordvqeattr(int32_t aidev,int32_t aichn,int *level); +int32_t csi_ai_getrecordvqeattr(int32_t aidev,int32_t aichn,int *level); + +int32_t csi_ai_enablevqe(int32_t aidev,int32_t aichn); +int32_t csi_ai_disablevqe(int32_t aidev,int32_t aichn); + +int32_t csi_ai_settrackmode(int32_t aidev,csi_audio_track_mode_e trackmode); +int32_t csi_ai_gettrackmode(int32_t aidev,csi_audio_track_mode_e *trackmode); + +int32_t csi_ai_reset(int32_t aidevid); + +int32_t csi_ai_queryfilestatus(int32_t aidev,int32_t aichn,csi_audio_file_status_s *filestatus); + +int32_t csi_ai_setvqevolume(int32_t aidev,int32_t aichn,int32_t volumedb); +int32_t csi_ai_getvqevolume(int32_t aidev,int32_t aichn,int32_t *volumedb); + +int32_t csi_ai_enableaecrefframe(int32_t aidev,int32_t aichn,int32_t aodev,int32_t aochn); +int32_t csi_ai_disableaecrefframe(int32_t aidev,int32_t aichn); + +#endif \ No newline at end of file diff --git a/th1520/hardware/camera/include/csi_hal/csi_audio_ao.h b/th1520/hardware/camera/include/csi_hal/csi_audio_ao.h new file mode 100755 index 0000000000000000000000000000000000000000..dedfde926f957bbda65c7e6db5ef38b3c8dbebbd --- /dev/null +++ b/th1520/hardware/camera/include/csi_hal/csi_audio_ao.h @@ -0,0 +1,113 @@ +/* + * Copyright (C) 2021 Alibaba Group Holding Limited + * Author: fuqian.zxr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#ifndef __CSI_AUDIO_AO_H__ +#define __CSI_AUDIO_AO_H__ + +#include "csi_audio_common.h" + +#define CSI_AO_MAX_COUNT 16 +#define CSI_AO_NAME_MAX_LEN 32 + +#define CSI_AO_CAP_SPDIF 0x00000001 /*Is a spdif device*/ +#define CSI_AO_CAP_HDMI 0x00000002 /*IS a hdmi audio*/ +#define CSI_AO_CAP_CODEC 0x00000003 /*Is a codec audio*/ + +typedef struct csi_ao_info { + char ai_name[CSI_AO_NAME_MAX_LEN]; + unsigned int capbilities; +}csi_ao_info_s; + +typedef struct csi_ao_infos { + unsigned int count; + csi_ao_info_s info[CSI_AO_MAX_COUNT]; +}csi_ao_infos_s; + +#define CSI_AUDIO_AO_VERSION_MAJOR 0 +#define CSI_AUDIO_AO_VERSION_MINOR 1 + +typedef struct csi_ao_chn_state { + uint32_t chntotalnum; + uint32_t chnfreenum; + uint32_t chnbusynum; +}csi_ao_chn_state_s; + +typedef enum csi_audio_fade_rate { + AUIDO_FADE_RATE_1 = 0, + AUIDO_FADE_RATE_2 = 1, + AUIDO_FADE_RATE_4 = 2, + AUIDO_FADE_RATE_8 = 3, + AUIDO_FADE_RATE_16 = 4, + AUIDO_FADE_RATE_32 = 5, + AUIDO_FADE_RATE_64 = 6, + AUIDO_FADE_RATE_128 = 7, + AUIDO_FADE_RATE_BUTT +}csi_audio_fade_rate_e; + +typedef struct csi_audio_fade { + bool fade; + csi_audio_fade_rate_e fadeinrate; + csi_audio_fade_rate_e fadeoutrate; +}csi_audio_fade_s; + +typedef struct csi_ao_vqe_config { + int32_t hpfopen; + int32_t anropen; + int32_t agcopen; + int32_t eqopen; + int32_t worksamplerate; + int32_t framesample; + csi_vqe_workstate_e workstate; + csi_audio_hpf_config_s hpfcfg; + csi_audio_anr_config_s anrcfg; + csi_audio_agc_config_s agccfg; + csi_audio_eq_config_s eqcfg; +}csi_ao_vqe_config_s; + +int32_t csi_ao_get_version(csi_api_version_u *version); + +int32_t csi_ao_query_list(csi_ao_infos_s *infos); +int32_t csi_ao_setpubattr(int32_t aodev,csi_aio_attr_s *attr); +int32_t csi_ao_getpubattr(int32_t aodev,csi_aio_attr_s *attr); + +int32_t csi_ao_enable(int32_t aodev); +int32_t csi_ao_disable(int32_t aodev); + +int32_t csi_ao_enablechn(int32_t aodev,int32_t aochn); +int32_t csi_ao_disablechn(int32_t aodev,int32_t aochn); + + +int32_t csi_ao_sendframe(int32_t aodev,int32_t aochn,const csi_audio_frame_s *data,int32_t timeout); +int32_t csi_ao_enableresmp(int32_t aodev,int32_t aochn,csi_audio_sample_rate_e insamplerate); + +int32_t csi_ao_disableresmp(int32_t aodev,int32_t aochn); +int32_t csi_ao_pausechn(int32_t aodev,int32_t aochn); + +int32_t csi_ao_resumechn(int32_t aodev,int32_t aochn); +int32_t csi_ao_clearchnbuf(int32_t aodev,int32_t aochn); + +int32_t csi_ao_querychnstat(int32_t aodev,int32_t aochn,csi_ao_chn_state_s *status); + +int32_t csi_ao_settrackmode(int32_t aodev,csi_audio_track_mode_e trackmode); +int32_t csi_ao_gettrackmode(int32_t aodev,csi_audio_track_mode_e *trackmode); + +int32_t csi_ao_setvolume(int32_t aodev,int32_t volume); +int32_t csi_ao_getvolume(int32_t aodev,int32_t *volume); + +int32_t csi_ao_setmute(int32_t aodev,bool enable,csi_audio_fade_s *fade); +int32_t csi_ao_getmute(int32_t aodev,bool enable,csi_audio_fade_s *fade); + +int32_t csi_ao_reset(int32_t aodev); + +int32_t csi_ao_setvqeattr(int32_t aodev,int32_t aochn,csi_ao_vqe_config_s *vqeconfig); +int32_t csi_ao_getvqeattr(int32_t aodev,int32_t aochn,csi_ao_vqe_config_s *vqeconfig); + +int32_t csi_ao_enablevqe(int32_t aodev,int32_t aochn); +int32_t csi_ao_disablevqe(int32_t aodev,int32_t aochn); + +#endif diff --git a/th1520/hardware/camera/include/csi_hal/csi_audio_common.h b/th1520/hardware/camera/include/csi_hal/csi_audio_common.h new file mode 100755 index 0000000000000000000000000000000000000000..52503d81a93c73f22214ac9b7d71bad1c6a52aaa --- /dev/null +++ b/th1520/hardware/camera/include/csi_hal/csi_audio_common.h @@ -0,0 +1,168 @@ +/* + * Copyright (C) 2021 Alibaba Group Holding Limited + * Author: fuqian.zxr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#ifndef __CSI_AUDIO_COMMON_H__ +#define __CSI_AUDIO_COMMON_H__ + +#include +#include +#include +#include "csi_common.h" + +#define MAX_AUDIO_FILE_PATH_LEN 256 +#define VQE_EQ_BAND_NUM 10 + +typedef enum csi_audio_sample_rate { + AUDIO_SAMPLE_RATE_8000 = 8000, /*8K samplerate*/ + AUDIO_SAMPLE_RATE_12000 = 12000, /*12K samplerate*/ + AUDIO_SAMPLE_RATE_11025 = 11025, /*11.025K samplerate*/ + AUDIO_SAMPLE_RATE_16000 = 16000, /*16K samplerate*/ + AUDIO_SAMPLE_RATE_22050 = 22050, /*22.05k samplerate*/ + AUDIO_SAMPLE_RATE_24000 = 24000, /*24K samplerate*/ + AUDIO_SAMPLE_RATE_32000 = 32000, /*32K samplerate*/ + AUDIO_SAMPLE_RATE_44100 = 44100, /*44.1K samplerate*/ + AUDIO_SAMPLE_RATE_48000 = 48000, /*48K samplerate*/ + AUDIO_SAMPLE_RATE_64000 = 64000, /*64K samplerate*/ + AUDIO_SAMPLE_RATE_96000 = 96000, /*96K samplerate*/ + AUDIO_SAMPLE_RATE_BUTT, +}csi_audio_sample_rate_e; + +typedef enum csi_audio_bit_width { + AUDIO_BIT_WIDTH_8 = 0, /*8bit width*/ + AUDIO_BIT_WIDTH_16 = 1, /*16bit width*/ + AUDIO_BIT_WIDTH_24 = 2, /*24bit width*/ + AUDIO_BIT_WIDTH_BUTT, +}csi_audio_bit_width_e; + +typedef enum csi_audio_mode { + AIO_MODE_I2S_MASTER = 0, /* AIO I2S master mode */ + AIO_MODE_I2S_SLAVE, /* AIO I2S slave mode */ + AIO_MODE_PCM_SLAVE_STD, /* AIO PCM slave standard mode */ + AIO_MODE_PCM_SLAVE_NSTD, /* AIO PCM slave non-standard mode */ + AIO_MODE_PCM_MASTER_STD, /* AIO PCM master standard mode */ + AIO_MODE_PCM_MASTER_NSTD, /* AIO PCM master non-standard mode */ + AIO_MODE_BUTT, +}csi_audio_mode_e; + +typedef enum csi_audio_sound_mode { + AUDIO_SOUND_MODE_MONO = 0, /*mono*/ + AUDIO_SOUND_MODE_STEREO = 1, /*stereo*/ + AUDIO_SOUND_MODE_BUTT +}csi_audio_sound_mode_e; + +typedef enum csi_auido_i2stype { + AIO_I2STYPE_INNERCODEC = 0, /*AIO I2S connect inner audio CODEC*/ + AIO_I2STYPE_INNERHDMI, /*AIO I2S connect inner HDMI*/ + AIO_I2STYPE_EXTERN, /*AIO I2S connect extern hardware*/ +}csi_auido_i2stype_e; + +typedef struct csi_aio_attr { + csi_audio_sample_rate_e samplerate; /*sample rate*/ + csi_audio_bit_width_e bitwidth; /*bitwidth*/ + csi_audio_mode_e workmode; /*master or slave mode*/ + csi_audio_sound_mode_e soundmode; /*mono or steror*/ + uint32_t exflag; + uint32_t frmnum; + uint32_t pt_num_per_frm; + uint32_t chncnt; + csi_auido_i2stype_e i2stype; +}csi_aio_attr_s; + +typedef struct csi_audio_frame { + csi_audio_bit_width_e bitwidth; + csi_audio_sound_mode_e soundmode; + void *viraddr[2]; + uint32_t phyaddr[2]; + uint64_t timestamp; /*audio frame timestamp*/ + uint32_t seq; /*audio frame seq*/ + uint32_t len; /*data length per channel in frame*/ + uint32_t poolid[2]; +}csi_audio_frame_s; + +typedef enum csi_audio_track_mode { + AUDIO_TRACK_NORMAL = 0, + AUDIO_TRACK_BOTH_LEFT = 1, + AUDIO_TRACK_BOTH_RIGHT = 2, + AUDIO_TRACK_EXCHANGE = 3, + AUDIO_TRACK_MIX = 4, + AUDIO_TRACK_LEFT_MUTE = 5, + AUDIO_TRACK_RIGHT_MUTE = 6, + AUDIO_TRACK_BOTH_MUTE = 7, + AUDIO_TRACK_BUTT, +}csi_audio_track_mode_e; + +typedef struct csi_audio_save_file_info { + bool cfg; + char filepath[MAX_AUDIO_FILE_PATH_LEN]; + char filename[MAX_AUDIO_FILE_PATH_LEN]; + uint32_t filesize; +}csi_audio_save_file_info_s; + +typedef struct csi_audio_file_status { + bool saving; +}csi_audio_file_status_s; + +typedef enum csi_vqe_workstate { + VQE_WORKSTATE_COMMON = 0, + VQE_WORKSTATE_MUSIC = 1, + VQE_WORKSTATE_NOISY = 2 +}csi_vqe_workstate_e; + +typedef enum csi_audio_hpf_freq { + AUDIO_HPF_FREQ_80 = 80, /*80HZ*/ + AUDIO_HPF_FREQ_120 = 120, /*120Hz*/ + AUDIO_HPF_FREQ_150 = 150, /*150Hz*/ + AUDIO_HPF_FREQ_BUTT, +}csi_audio_hpf_freq_e; + +typedef struct csi_audio_hpf_config { + bool usrmode; + csi_audio_hpf_freq_e hpffreq; +}csi_audio_hpf_config_s; + +typedef struct csi_audio_anr_config { + bool usrmode; + int16_t nrintensity; + int16_t noisedbthr; + int8_t sp_pro_switch; + int32_t reserved; +}csi_audio_anr_config_s; + +typedef struct csi_audio_agc_config { + bool usrmode; + int8_t target_level; + int8_t noise_floor; + int8_t maxgain; + int8_t adjustspeed; + int8_t improvesnr; + int8_t usehighpassfilt; + int8_t outputmode; + int16_t noisesupswitch; + int32_t reserved; +}csi_audio_agc_config_s; + +typedef struct csi_audio_eq_config { + int8_t gaindb[VQE_EQ_BAND_NUM]; + int32_t reserved; +}csi_audio_eq_config_s; + +typedef enum { + PT_PCMU = 0, + PT_1016 = 1, + PT_BUTT +}PAYLOAD_TYPE_E; + +typedef struct csi_audio_stream { + uint8_t *stream; /*the virtual address of stream*/ + uint32_t phyaddr; /*the physics address of stream*/ + uint32_t len; /*stream length,by bytes*/ + uint64_t timestamp; /*frame time stamp*/ + uint32_t seq; /*frame seq,if stream is not a valid frame 0*/ +}csi_audio_stream_s; + +#endif \ No newline at end of file diff --git a/th1520/hardware/camera/include/csi_hal/csi_audio_dec.h b/th1520/hardware/camera/include/csi_hal/csi_audio_dec.h new file mode 100755 index 0000000000000000000000000000000000000000..9683171a941bd299fdd76784ad22c897ad415aeb --- /dev/null +++ b/th1520/hardware/camera/include/csi_hal/csi_audio_dec.h @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2021 Alibaba Group Holding Limited + * Author: fuqian.zxr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#ifndef __CSI_AUDIO_DEC_H__ +#define __CSI_AUDIO_DEC_H__ + +#include "csi_audio_common.h" + +#define CSI_AUDIO_DEC_VERSION_MAJOR 0 +#define CSI_AUDIO_DEC_VERSION_MINOR 1 + +typedef enum csi_adec_mode { + ADEC_MODE_PACK = 0, + ADEC_MODE_STREAM, + ADEC_MODE_BUTT +}csi_adec_mode_e; + +typedef struct csi_adec_ch_attr { + PAYLOAD_TYPE_E type; + uint32_t bufsize; + csi_adec_mode_e mode; + void *value; +}csi_adec_ch_attr_s; + +typedef struct csi_adec_decoder { + PAYLOAD_TYPE_E type; + char name[16]; + int32_t (*openendecoder)(void *decoderattr,void **decoder); + int32_t (*decoderfrm)(void *decoder,uint8_t **inbuf,int32_t leftbyte,uint16_t *outbuf,uint32_t *outlen,uint32_t *chns); + int32_t (*getfrminfo)(void *decoder,void *info); + int32_t (*closedecoder)(void *decoder); + int32_t (*resetdecoder)(void *decoder); +}csi_adec_decoder_s; + +typedef struct csi_audio_frame_info { + csi_audio_frame_s *frame; + uint32_t id; +}csi_audio_frame_info_s; + +int32_t csi_adec_get_version(csi_api_version_u *version); + +int32_t csi_adec_create(int32_t adchn,csi_adec_ch_attr_s); +int32_t csi_adec_destroy(int32_t adchn); + +int32_t csi_adec_sendstream(int32_t adchn,const csi_audio_stream_s *stream, bool block); +int32_t csi_adec_clearchnbuf(int32_t adchn); + +int32_t csi_adec_registerdecoder(int32_t handle,csi_adec_decoder_s *decoder); +int32_t csi_adec_unregisterdecoder(int32_t hanbdle); + +int32_t csi_adec_getframe(int32_t adchn,csi_audio_frame_info_s *frameinfo,bool block); +int32_t csi_adec_releaseframe(int32_t adchn,csi_audio_frame_info_s *frameinfo); + +int32_t csi_adec_sendendofstream(int adchn,bool instant); + +#endif \ No newline at end of file diff --git a/th1520/hardware/camera/include/csi_hal/csi_audio_enc.h b/th1520/hardware/camera/include/csi_hal/csi_audio_enc.h new file mode 100755 index 0000000000000000000000000000000000000000..d6ea0cee3a91409dd9bfe38d951c2e3366a828de --- /dev/null +++ b/th1520/hardware/camera/include/csi_hal/csi_audio_enc.h @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2021 Alibaba Group Holding Limited + * Author: fuqian.zxr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef __CSI_AUDIO_ENC_H__ +#define __CSI_AUDIO_ENC_H__ + +#include +#include +#include + +#include "csi_audio_common.h" + +#define CSI_AUDIO_ENC_VERSION_MAJOR 0 +#define CSI_AUDIO_ENC_VERSION_MINOR 1 + +typedef struct csi_aenc_chn_attr +{ + PAYLOAD_TYPE_E type; + uint32_t numperfrm; + uint32_t buffersize; +}csi_aenc_chn_attr_s; + +typedef struct csi_aec_frame { + csi_audio_frame_s refframe; + bool valid; + bool sysbind; +}csi_aec_frame_s; + +typedef struct csi_aenc_encode { + PAYLOAD_TYPE_E type; + uint32_t maxfrmlen; + char name[16]; + int32_t (*openencoder)(void *encoderattr,void **encoder); + int32_t (*encoderfrm)(void *encoder,const csi_audio_frame_s *data,uint8_t *outbuf,uint32_t *outlen); + int32_t (*closeencoder)(void *encoder); +}csi_aenc_encode_s; + +int32_t csi_adec_get_version(csi_api_version_u *version); + +int32_t csi_aenc_createchn(int32_t aechn,const csi_aenc_chn_attr_s attr); +int32_t csi_aenc_destroychn(int32_t aechn); + +int32_t csi_aenc_sendframe(int32_t aechn,const csi_audio_frame_s *frm,const csi_aec_frame_s *aecfrm); +int32_t csi_aenc_getstream(int32_t aechn,csi_audio_stream_s *stream,int32_t timeout); + +int32_t csi_aenc_releasestream(int32_t aechn,const csi_audio_stream_s *stream); + +int32_t csi_aenc_getfd(int32_t aechn); +int32_t csi_aenc_registerencoder(int32_t handle,csi_aenc_encode_s *encoder); +int32_t csi_aenc_unregisterencoder(int32_t handle); + +int32_t csi_aenc_savefile(int32_t aechn,csi_audio_save_file_info_s *savefileinfo); +int32_t csi_aenc_queryfilestatus(int32_t aechn,csi_audio_file_status_s *filestatus); + +int32_t csi_aec_getstreambufinfo(int32_t aechn,uint32_t *physaddr,uint32_t *size); + +#endif \ No newline at end of file diff --git a/th1520/hardware/camera/include/csi_hal/csi_camera.h b/th1520/hardware/camera/include/csi_hal/csi_camera.h new file mode 100755 index 0000000000000000000000000000000000000000..b74eceef42b3081adb98798605db7460dd0b27ff --- /dev/null +++ b/th1520/hardware/camera/include/csi_hal/csi_camera.h @@ -0,0 +1,323 @@ +/* + * Copyright (C) 2021 Alibaba Group Holding Limited + * Author: LuChongzhi + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef __CSI_CAMERA_H__ +#define __CSI_CAMERA_H__ + +#include + +#include "csi_common.h" +#include "csi_camera_property.h" +#include "csi_camera_frame.h" +#include "csi_frame_ex.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Camera logical parts are below, including: input sensor and output channel + * @------------------------------@ + * | Camera Settings _____|______ Channel Settings + * | =================== | | ===================== + * | Exposure | channel[0] | configuration: width/height, pix_fmt + * | R/G/B Gain |_____ ______| ---> Channel Events + * | HDR mode _____|______ + * | ...... | | + * | | channel[1] | configuration: width/height, pix_fmt + * | |_____ ______| ---> Channel Events + * | _____|______ + * | | | + * | | channel[n] | configuration: width/height, pix_fmt + * | |_____ ______| ---> Channel Events + * | CAMERA | + * @------------------------------@ ===> Camera Events (sensor, error, warning...) + */ + +#define CSI_CAMERA_VERSION_MAJOR 0 +#define CSI_CAMERA_VERSION_MINOR 4 + +#define CSI_CAMERA_NAME_MAX_LEN 32 +typedef void *csi_cam_handle_t; +typedef void *csi_cam_event_handle_t; +typedef struct csi_cam_handle_info { + int idx; +} csi_cam_handle_info_t; + +#define MAX_FRAME_COUNT 1024 +typedef enum csi_frame_status_type { + CSI_FRAME_IDLE = 1, + CSI_FRAME_WORKING = 2, + CSI_FRAME_READY = 3, + CSI_FRAME_DISPATCHED = 4, +} csi_frame_status_type_e; + +typedef struct frame_channel_info { + + unsigned char *frame_bufs[MAX_FRAME_COUNT]; + int frame_status[MAX_FRAME_COUNT]; + int refcount[MAX_FRAME_COUNT]; + + int frame_cnt; + csi_frame_s frame[MAX_FRAME_COUNT]; +} frame_channel_info_s; + +typedef struct camera_frame_info { + unsigned char *frame_bufs; + int frame_status; +} camera_frame_info_s; + +#define CSI_CAMERA_CAP_VIDEO_CAPTURE 0x00000001 /* Is a video capture device */ +#define CSI_CAMERA_CAP_META_CAPTURE 0x00800000 /* Is a metadata capture device */ + +typedef struct csi_camera_info { + char camera_name[CSI_CAMERA_NAME_MAX_LEN]; + char device_name[CSI_CAMERA_NAME_MAX_LEN]; + char bus_info[32]; /* e.g. "MIPI-CSI" */ + unsigned int capabilities; /* bit mask of CSI_CAMERA_CAP_xx */ +} csi_camera_info_s; + +#define CSI_CAMERA_MAX_COUNT 16 +typedef struct csi_camera_infos { + unsigned int count; + csi_camera_info_s info[CSI_CAMERA_MAX_COUNT]; +} csi_camera_infos_s; + +#define CSI_CAMERA_MODE_MAX_COUNT 16 +typedef struct csi_camera_modes { + int count; + struct { + int mode_id; + char description[128]; + } modes[CSI_CAMERA_MODE_MAX_COUNT]; +} csi_camera_modes_s; + +typedef struct csi_camera_mode_cfg { + int mode_id; + char *calibriation; /* set NULL to use default in system */ + char *lib3a; /* set NULL to use default in system */ +} csi_camera_mode_cfg_s; + +typedef enum csi_camera_property_type { + CSI_CAMERA_PROPERTY_TYPE_INTEGER = 1, + CSI_CAMERA_PROPERTY_TYPE_BOOLEAN = 2, + CSI_CAMERA_PROPERTY_TYPE_ENUM = 3, + CSI_CAMERA_PROPERTY_TYPE_STRING = 7, + CSI_CAMERA_PROPERTY_TYPE_BITMASK = 8, + CSI_CAMERA_PROPERTY_TYPE_FLOAT = 9, +} csi_camera_property_type_e; + +typedef union csi_camera_property_data { + bool bool_value; + int int_value; + int enum_value; + uint32_t bitmask_value; + char str_value[32]; + float float_value; +} csi_camera_property_data_u; + +typedef struct csi_camera_property_description { + unsigned int id; /* CSI_CAMERA_PID_xx */ + csi_camera_property_type_e type; /* data type */ + char name[32]; /* Whatever */ + int minimum; /* Note signedness */ + int maximum; + int step; + csi_camera_property_data_u default_value; + csi_camera_property_data_u value; /*current value*/ + unsigned int flags; + unsigned int reserved[2]; +} csi_camera_property_description_s; + +typedef struct csi_camera_property { + unsigned int id; + csi_camera_property_type_e type; /* data type */ + csi_camera_property_data_u value; +} csi_camera_property_s; + +typedef struct csi_camera_properties { + unsigned int count; + csi_camera_property_s *property; +} csi_camera_properties_s; + +typedef enum csi_camera_channel_id { + CSI_CAMERA_CHANNEL_0 = 0, + CSI_CAMERA_CHANNEL_1, + CSI_CAMERA_CHANNEL_2, + CSI_CAMERA_CHANNEL_3, + CSI_CAMERA_CHANNEL_4, + CSI_CAMERA_CHANNEL_5, + CSI_CAMERA_CHANNEL_6, + CSI_CAMERA_CHANNEL_7, + CSI_CAMERA_CHANNEL_MAX_COUNT +} csi_camera_channel_id_e; + +typedef enum csi_camera_channel_status { + CSI_CAMERA_CHANNEL_INVALID = -1, /* channel can't be openned */ + CSI_CAMERA_CHANNEL_CLOSED, + CSI_CAMERA_CHANNEL_OPENED, + CSI_CAMERA_CHANNEL_RUNNING, + CSI_CAMERA_CHANNEL_EXCEPTION, +} csi_camera_channel_status_e; + +typedef enum csi_camera_channel_capture_type { + CSI_CAMERA_CHANNEL_CAPTURE_VIDEO = (1 << 0), + CSI_CAMERA_CHANNEL_CAPTURE_META = (1 << 1), +} csi_camera_channel_capture_type_e; + +typedef struct csi_camera_channel_cfg { + csi_camera_channel_id_e chn_id; + unsigned int capture_type; /* bitmask of: csi_camera_channel_capture_type_e */ + unsigned int frm_cnt; + csi_img_format_t img_fmt; + csi_img_type_e img_type; + unsigned int meta_fields; /* bitmask of: csi_camera_meta_id_e */ + csi_camera_channel_status_e status; + csi_frame_alloctor_s alloctor; /***external frame buffer allocater***/ +} csi_camera_channel_cfg_s; + +typedef enum csi_camera_event_type { + CSI_CAMERA_EVENT_TYPE_INVALID = -1, + CSI_CAMERA_EVENT_TYPE_CAMERA, + CSI_CAMERA_EVENT_TYPE_CHANNEL0, + CSI_CAMERA_EVENT_TYPE_CHANNEL1, + CSI_CAMERA_EVENT_TYPE_CHANNEL2, + CSI_CAMERA_EVENT_TYPE_CHANNEL3, + CSI_CAMERA_EVENT_TYPE_CHANNEL4, + CSI_CAMERA_EVENT_TYPE_CHANNEL5, + CSI_CAMERA_EVENT_TYPE_CHANNEL6, + CSI_CAMERA_EVENT_TYPE_CHANNEL7, +} csi_camera_event_type_e; + +typedef enum csi_camera_event_id { + CSI_CAMERA_EVENT_WARNING = 1 << 0, + CSI_CAMERA_EVENT_ERROR = 1 << 1, + CSI_CAMERA_EVENT_SENSOR_FIRST_IMAGE_ARRIVE = 1 << 2, + CSI_CAMERA_EVENT_ISP_3A_ADJUST_READY = 1 << 3, + + CSI_CAMERA_EVENT_MAX_COUNT = 32 +} csi_camera_event_id_e; + +typedef enum csi_camera_3a_status{ + CSI_CAMERA_3A_STATUS_AE_LOCKED = 1 << 0, + CSI_CAMERA_3A_STATUS_AWB_LOCKED = 1 << 1, + CSI_CAMERA_3A_STATUS_AF_FOCUSFOUND = 1 << 2, +}csi_camera_3a_status_e; + +typedef enum csi_camera_channel_event_id { + CSI_CAMERA_CHANNEL_EVENT_FRAME_READY = 1 << 0, + CSI_CAMERA_CHANNEL_EVENT_FRAME_PUT = 1 << 1, + CSI_CAMERA_CHANNEL_EVENT_OVERFLOW = 1 << 2, + + CSI_CAMERA_CHANNEL_EVENT_MAX_COUNT = 32 +} csi_camera_channel_event_id_e; + +typedef struct csi_camera_event_subscription { + csi_camera_event_type_e type; + unsigned int id; /* bitmasks */ +} csi_camera_event_subscription_s; + +typedef struct csi_camera_event { + csi_camera_event_type_e type; + unsigned int id; + struct timespec timestamp; + union { + char bin[128]; + }; +} csi_camera_event_s; + + +typedef enum csi_camera_error{ + CSI_CAMERA_RET_ERR_INVALID_DEV = -1001,/* device is not valid */ + CSI_CAMERA_RET_ERR_INVALID_PARA, /* input params is not valid */ + CSI_CAMERA_RET_ERR_NULL_PTR, + CSI_CAMERA_RET_ERR_DEV_BUSY, /* device is budy */ + CSI_CAMERA_RET_ERR_NOMEM, /* malloc fail */ + CSI_CAMERA_RET_ERR_TIMEOUT, /* evet or frame wait timeout */ + CSI_CAMERA_RET_ERR_NOT_SUPPORT, /* setting or config is not supported */ + CSI_CAMERA_RET_ERR_NO_SENSOR_DETECT, /* sensor is not detected */ + CSI_CAMERA_CHANNEL_RET_ERR_INVALID_CHN = -501,/*channel is not valid */ + CSI_CAMERA_CHANNEL_RET_ERR_NOTOPEN, + CSI_CAMERA_RET_ERR = -1, /*common sw error */ + CSI_CAMERA_RET_OK =0, + +}csi_camera_erro_e; + +int csi_camera_get_version(csi_api_version_u *version); + +int csi_camera_query_list(csi_camera_infos_s *infos); +int csi_camera_open(csi_cam_handle_t *cam_handle, const char *device_name); +int csi_camera_close(csi_cam_handle_t cam_handle); + +int csi_camera_get_modes(csi_cam_handle_t cam_handle, + csi_camera_modes_s *modes); + +int csi_camera_set_mode(csi_cam_handle_t cam_handle, + csi_camera_mode_cfg_s *cfg); + +int csi_camera_get_io_pattern(csi_cam_handle_t cam_handle, int *pattern); +int csi_camera_get_frame_config(csi_cam_handle_t cam_handle, csi_img_format_t *img_fmt, csi_frame_config_s *frm_cfg); +int csi_camera_set_frame_config(csi_cam_handle_t cam_handle, csi_img_format_t *img_fmt, csi_frame_config_s *frm_cfg); + +int csi_sensor_enable_colobar(csi_cam_handle_t cam_handle, int en); +int csi_camera_query_property(csi_cam_handle_t cam_handle, + csi_camera_property_description_s *desc); +int csi_camera_get_property(csi_cam_handle_t cam_handle, + csi_camera_properties_s *properties); +int csi_camera_set_property(csi_cam_handle_t cam_handle, + csi_camera_properties_s *properties); + +int csi_camera_channel_open(csi_cam_handle_t cam_handle, + csi_camera_channel_cfg_s *cfg); +int csi_camera_channel_close(csi_cam_handle_t cam_handle, + csi_camera_channel_id_e chn_id); +int csi_camera_channel_query(csi_cam_handle_t cam_handle, + csi_camera_channel_cfg_s *cfg); + +int csi_camera_get_frame_count(csi_cam_handle_t cam_handle, + csi_camera_channel_id_e chn_id); +int csi_camera_get_frame(csi_cam_handle_t cam_handle, + csi_camera_channel_id_e chn_id, + csi_frame_ex_s *frame, int timeout); + +int csi_camera_put_frame(csi_frame_ex_s *frame); + + +int csi_camera_dequeue_frame(csi_cam_handle_t cam_handle, + csi_camera_channel_id_e chn_id, + csi_frame_ex_s **frame, + int timeout); + +int csi_camera_enqueue_frame(csi_cam_handle_t cam_handle, + csi_camera_channel_id_e chn_id, + csi_frame_ex_s *frame); + + +int csi_camera_create_event(csi_cam_event_handle_t *event_handle, + csi_cam_handle_t cam_handle); +int csi_camera_destory_event(csi_cam_event_handle_t event_handle); + +int csi_camera_subscribe_event(csi_cam_event_handle_t event_handle, + csi_camera_event_subscription_s *subscribe); +int csi_camera_unsubscribe_event(csi_cam_event_handle_t event_handle, + csi_camera_event_subscription_s *subscribe); +int csi_camera_get_event(csi_cam_event_handle_t event_handle, + csi_camera_event_s *event, + int timeout); + +int csi_camera_channel_start(csi_cam_handle_t cam_handle, + csi_camera_channel_id_e chn_id); +int csi_camera_channel_stop(csi_cam_handle_t cam_handle, + csi_camera_channel_id_e chn_id); + +#ifdef __cplusplus +} +#endif + +#endif /* __CSI_CAMERA_H__ */ diff --git a/th1520/hardware/camera/include/csi_hal/csi_camera_dev_api.h b/th1520/hardware/camera/include/csi_hal/csi_camera_dev_api.h new file mode 100755 index 0000000000000000000000000000000000000000..701f1d7bb404d7552514000afefc71b96a5a7266 --- /dev/null +++ b/th1520/hardware/camera/include/csi_hal/csi_camera_dev_api.h @@ -0,0 +1,178 @@ +/* + * Copyright (c) 2021 Alibaba Group. All rights reserved. + * License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef CSI_CAMERA_DEV_API_H +#define CSI_CAMERA_DEV_API_H + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + + + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void (*cb_fn)(void*context,void*arg); +typedef struct csi_camera_dsp_algo_param{ + char* algo_name; //加载的算法 + struct{ + cb_fn cb; //算法上报结果的回调函数(比如3A的结果) + void* context; //回调句柄 + int arg_size; //回调函数的输入参数的大小 + }algo_cb; + void* sett_ptr; //算法的setting + size_t sett_size; //算法的setting的size + int extra_buf_num; //算法的除了input&output buffer 额外需要的buffer 个数 + int *extra_buf_sizes; //额外需要的buffer size list + void **extra_bufs; //申请到的buffer的指针 list + +} csi_camera_dsp_algo_param_t; + +typedef enum line_buf_mode{ + LINE_BUF_MODE_DDR, + LINE_BUF_MODE_SRAM, +} line_buf_mode_t; + +typedef enum { + LED_FLOODLIGHT = 1, + LED_PROJECTION = 2, + LED_FLOODLIGHT_PROJECTION = 3, +} flash_led_mask_t; + +typedef enum { + LED_STANDBY, + LED_EXT_TORCH, + LED_EXT_FLASH, + LED_INT_TORCH, + LED_INT_FLASH, + LED_IR_STANDBY, + LED_IR_ENABLE, +} flash_led_mode_mask_t; + + +typedef enum{ + SWITCH_MODE_PROJECTION_EVEN_FLOODLIGHT_ODD, + SWITCH_MODE_PROJECTION_ODD_FLOODLIGHT_EVEN, + SWITCH_MODE_PROJECTION_ALWAYS_ON, + SWITCH_MODE_FLOODLIGHT_ALWAYS_ON, + SWITCH_MODE_BOTH_ON, + SWITCH_MODE_BOTH_OFF, +}csi_camera_led_switch_mode_t; + +#define MAX_LANDMARK_COUNT 100 +#define MAX_ROI_COUNT 10 +struct face_landmask{ + float x; + float y; +}; +struct vsi3a_roi{ + unsigned int x; /* (x,y)为人脸窗口左上角坐标,(x2,y2)为右下角*/ + unsigned int y; + unsigned int x2; + unsigned int y2; + + int point_nums; /* 人脸特征点数,如典型的68,没有该功能就填0 */ + struct face_landmask point_list[MAX_LANDMARK_COUNT]; /* 人脸特征点坐标详细 */ +}; +struct vsi3a_roi_info{ + unsigned int frame_cnt; /* the counting of frame,用来作为帧对齐 */ + unsigned int width; /* 人脸帧的图像宽,如640 */ + unsigned int height; /* 人脸帧的图像高,如480 */ + unsigned int facenums; /* 检测到的人脸数*/ + struct vsi3a_roi face_roi_list[MAX_ROI_COUNT]; /* 详细人脸信息 */ +}; + +/** + * @description: The function load dsp firmware algo lib + * passing algo seeting and create bufs for dsp path in CAM. + * @param[in] {cam_handle} cam handle + * @param[in] {int}dsp device id should be 0/1 + * @param[in] {int} path_type for dsp in cam + * typedef enum dsp_path_type{ + * DSP_PATH_ISP_RY = 0, + * DSP_PATH_ISP_CPU, + * DSP_PATH_VIPRE_DDR, +* DSP_PATH_VIPRE_EVEN, +* DSP_PATH_VIPRE_ODD, +* DSP_PATH_VIPRE_RY, +* DSP_PATH_CPU_CPU, +* DSP_PATH_MAX, +* } dsp_path_type_e; + * @param[in/out] {csi_camera_dsp_algo_param_t *} point to param for algo + * @return{int} return 0 when delete success, not 0 in case of error + */ +int csi_camera_set_dsp_algo_param(csi_cam_handle_t cam_handle, int dsp_id,int path_type, csi_camera_dsp_algo_param_t *algo_param); + +/** + * @description: The function update algo setting. + * @param[in] {cam_handle} Sub-device output path handle + * @param[in] {int}dsp device id should be 0/1 + * @param[in] {int} path_type for dsp in cam + * @param[in] {void*} point to new setting for algo + * @return{int} return 0 when delete success, not 0 in case of error + */ +int csi_camera_update_dsp_algo_setting(csi_cam_handle_t cam_handle, int dsp_id,int path_type, void* sett_ptr); + +/** + * @description: The function update buf for dsp algo. + * @param[in] {cam_handle} Sub-device output path handle + * @param[in] {int}dsp device id should be 0/1 + * @param[in] {int} path_type for dsp in cam + * @param[in] {void*} point to buf which new data is writen and should update to dsp algo + * @param[out] {void*} buf can be udapte for next time + * @return{int} return 0 when delete success, not 0 in case of error + */ +int csi_camera_update_dsp_algo_buf(csi_cam_handle_t cam_handle, int dsp_id,int path_type,void*buf,void**replace_buf); + +int csi_camera_set_pp_path_param(csi_cam_handle_t cam_handle, uint16_t line_num,uint16_t buf_mode); +int csi_camera_set_sensor_resolution(csi_cam_handle_t cam_handle, csi_camera_channel_id_e chn_id, char* subdev_name, unsigned int width, unsigned int height); + +int csi_camera_get_active_sensor(csi_cam_handle_t cam_handle); + +int csi_camera_projection_led_set_mode(csi_cam_handle_t cam_handle, flash_led_mode_mask_t led_mode); +int csi_camera_floodlight_led_set_mode(csi_cam_handle_t cam_handle, flash_led_mode_mask_t led_mode); + +int csi_camera_led_enable(csi_cam_handle_t cam_handle, flash_led_mask_t mask); +int csi_camera_led_disable(csi_cam_handle_t cam_handle, flash_led_mask_t mask); + +int csi_camera_floodlight_led_set_flash_bright(csi_cam_handle_t cam_handle, unsigned long ma); +int csi_camera_floodlight_led_set_torch_bright(csi_cam_handle_t cam_handle, unsigned long ma); + +int csi_camera_projection_led_set_flash_bright(csi_cam_handle_t cam_handle, unsigned long ma); +int csi_camera_projection_led_set_torch_bright(csi_cam_handle_t cam_handle, unsigned long ma); + +int csi_camera_led_set_switch_mode(csi_cam_handle_t cam_handle, csi_camera_led_switch_mode_t mode); + +int csi_camera_projection_led_get_temperature(csi_cam_handle_t cam_handle, int *temperature); +int csi_camera_floodlignt_led_get_temperature(csi_cam_handle_t cam_handle, int *temperature); + +int csi_camera_set_roi(csi_cam_handle_t cam_handle, void *data); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/th1520/hardware/camera/include/csi_hal/csi_camera_frame.h b/th1520/hardware/camera/include/csi_hal/csi_camera_frame.h new file mode 100755 index 0000000000000000000000000000000000000000..1bc46d475ce3fdf03298a41735214f74755fd1a2 --- /dev/null +++ b/th1520/hardware/camera/include/csi_hal/csi_camera_frame.h @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2021 Alibaba Group Holding Limited + * Author: LuChongzhi + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef __CSI_CAMERA_FRAME_H__ +#define __CSI_CAMERA_FRAME_H__ + +#include +#include +#include + +#include "csi_frame.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define CSI_CAMERA_META_MAX_LEN 1024 + +typedef enum csi_camera_meta_id { + CSI_CAMERA_META_ID_CAMERA_NAME = (1<<0), /* str_value */ + CSI_CAMERA_META_ID_CHANNEL_ID = (1<<1), /* uint_value */ + CSI_CAMERA_META_ID_FRAME_ID = (1<<2), /* uint_value: Re-Count from zero when start() */ + CSI_CAMERA_META_ID_TIMESTAMP = (1<<3), /* time_value: Get from gettimeofday() */ + CSI_CAMERA_META_ID_HDR = (1<<4), /* bool_value */ +} csi_camera_meta_id_e; + +#define CSI_CAMERA_META_NO_FIELD 0 +#define CSI_CAMERA_META_DEFAULT_FIELDS (CSI_CAMERA_META_ID_CAMERA_NAME | \ + CSI_CAMERA_META_ID_CHANNEL_ID | \ + CSI_CAMERA_META_ID_FRAME_ID | \ + CSI_CAMERA_META_ID_TIMESTAMP) + +typedef struct csi_camrea_meta_unit { + csi_camera_meta_id_e id; + csi_meta_value_type_e type; + union { + bool bool_value; + int int_value; + unsigned int uint_value; + char str_value[32]; + struct timeval time_value; + }; +} csi_camera_meta_unit_s; + +typedef struct csi_camera_meta { + unsigned int count; + size_t size; + csi_camera_meta_unit_s *units; // Is meta_unit array head +} csi_camera_meta_s; + +int csi_camera_frame_alloc_meta(csi_camera_meta_s **meta, int meta_count, size_t *meta_data_size); +int csi_camera_frame_free_meta(csi_camera_meta_s *meta); + +int csi_camera_frame_get_meta_unit(csi_camera_meta_unit_s *meta_unit, + csi_camera_meta_s *meta_data, + csi_camera_meta_id_e meta_field); + +#ifdef __cplusplus +} +#endif + +#endif /* __CSI_CAMERA_FRAME_H__ */ + diff --git a/th1520/hardware/camera/include/csi_hal/csi_camera_platform_spec.h b/th1520/hardware/camera/include/csi_hal/csi_camera_platform_spec.h new file mode 100755 index 0000000000000000000000000000000000000000..db5dcdacc6ce2c5c1bed5b19b7456d35453ee8b3 --- /dev/null +++ b/th1520/hardware/camera/include/csi_hal/csi_camera_platform_spec.h @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2021 Alibaba Group Holding Limited + * Author: LuChongzhi + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef __CSI_CAMERA_PLATFORM_SPEC_H__ +#define __CSI_CAMERA_PLATFORM_SPEC_H__ +#include +#include + +/******************************************************************************/ +/*********** Platform Spec in Enum ********************************************/ +/******************************************************************************/ + +#define CAMERA_PROPERTY_MAX_ENUM_COUNT 16 + +typedef struct camera_support_enums { + int count; + int enums[CAMERA_PROPERTY_MAX_ENUM_COUNT]; +} camera_spec_enums_s; + +typedef enum camera_sepc_enums { + CAMERA_SPEC_ENUM_CHANNEL_PIX_FMT, + CAMERA_SPEC_ENUM_CHANNEL_IMG_TYPE, + CAMERA_SPEC_ENUM_CAMERA_EVENT_TYPES, + CAMERA_SPEC_ENUM_CHANNEL_EVENT_TYPES, + + /* Camera Properties below */ + CAMERA_SPEC_ENUM_CAMERA_EXPOSURE_MODES = CSI_CAMERA_PID_EXPOSURE_MODE, +} camera_sepc_enums_e; + +const camera_spec_enums_s *camera_spec_get_enum_array(int property_id); + + +/******************************************************************************/ +/*********** Platform Spec in Bitmask *****************************************/ +/******************************************************************************/ + +#define CAMERA_PROPERTY_MAX_BITMASK_COUNT 32 + +typedef struct camera_support_bitmasks { + int count; + int bitmask[CAMERA_PROPERTY_MAX_BITMASK_COUNT]; +} camera_spec_bitmasks_t; + + +typedef enum camera_sepc_bitmasks { + CAMERA_SPEC_BITMAKS_CHANNEL_CAPTURE_TYPE, + CAMERA_SPEC_BITMAKS_CHANNEL_META_TYPE, + + /* Camera Properties below */ + CAMERA_SPEC_BITMAKS_CAMERA_3A_LOCK = CSI_CAMERA_PID_3A_LOCK, +} camera_sepc_bitmasks_e; + +const camera_spec_bitmasks_t *camera_spec_get_bitmask_array(int property_id); + +#endif /* __CSI_CAMERA_PLATFORM_SPEC_H__ */ + diff --git a/th1520/hardware/camera/include/csi_hal/csi_camera_property.h b/th1520/hardware/camera/include/csi_hal/csi_camera_property.h new file mode 100755 index 0000000000000000000000000000000000000000..d6b0ae3dd2e3e68e0d12b01d24a0f7b7717e1f3d --- /dev/null +++ b/th1520/hardware/camera/include/csi_hal/csi_camera_property.h @@ -0,0 +1,104 @@ +/* + * Copyright (C) 2021 Alibaba Group Holding Limited + * Author: LuChongzhi + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef __CSI_CAMERA_PROPERTY_H__ +#define __CSI_CAMERA_PROPERTY_H__ + +#ifdef __cplusplus +extern "C" { +#endif +/* Camera Property ID */ +#define CSI_CAMERA_PID_BASE (0x009a0000 | 0x900) + +#define CSI_CAMERA_FLAG_NEXT_CTRL 0x80000000 + +/* image processing releated */ +#define CSI_CAMERA_PID_HFLIP (CSI_CAMERA_PID_BASE + 0x1) +#define CSI_CAMERA_PID_VFLIP (CSI_CAMERA_PID_BASE + 0x2) +#define CSI_CAMERA_PID_ROTATE (CSI_CAMERA_PID_BASE + 0x3) + +/* exposure related */ +#define CSI_CAMERA_PID_EXPOSURE_MODE (CSI_CAMERA_PID_BASE + 0x11) +enum CSI_CAMERA_EXPOSURE_MODE { + CSI_CAMERA_EXPOSURE_MODE_AUTO = 0, + CSI_CAMERA_EXPOSURE_MANUAL = 1, + CSI_CAMERA_EXPOSURE_SHUTTER_PRIORITY = 2, + CSI_CAMERA_EXPOSURE_APERTURE_PRIORITY = 3, +}; +#define CSI_CAMERA_PID_EXPOSURE_ABSOLUTE (CSI_CAMERA_PID_BASE + 0x12) +#define CSI_CAMERA_PID_EXPOSURE_AUTO_PRIORITY (CSI_CAMERA_PID_BASE + 0x13) +#define CSI_CAMERA_PID_EXPOSURE_BIAS (CSI_CAMERA_PID_BASE + 0x14) +#define CSI_CAMERA_PID_EXPOSURE_METERING (CSI_CAMERA_PID_BASE + 0x15) +enum CSI_CAMERA_PID_EXPOSURE_METERING_MODE { + CSI_CAMERA_EXPOSURE_METERING_AVERAGE = 0, + CSI_CAMERA_EXPOSURE_METERING_CENTER_WEIGHTED = 1, + CSI_CAMERA_EXPOSURE_METERING_SPOT = 2, + CSI_CAMERA_EXPOSURE_METERING_MATRIX = 3, +}; + +/* Focus related */ +#define CSI_CAMERA_PID_FOCUS_ABSOLUTE (CSI_CAMERA_PID_BASE + 0x21) +#define CSI_CAMERA_PID_FOCUS_RELATIVE (CSI_CAMERA_PID_BASE + 0x22) +#define CSI_CAMERA_PID_FOCUS_AUTO (CSI_CAMERA_PID_BASE + 0x23) + +#define CSI_CAMERA_PID_AUTO_FOCUS_START (CSI_CAMERA_PID_BASE + 0x24) +#define CSI_CAMERA_PID_AUTO_FOCUS_STOP (CSI_CAMERA_PID_BASE + 0x25) + +#define CSI_CAMERA_PID_AUTO_FOCUS_STATUS (CSI_CAMERA_PID_BASE + 0x26) +#define CSI_CAMERA_AUTO_FOCUS_STATUS_IDLE (1<<0) +#define CSI_CAMERA_AUTO_FOCUS_STATUS_BUSY (1<<1) +#define CSI_CAMERA_AUTO_FOCUS_STATUS_REACHED (1<<2) +#define CSI_CAMERA_AUTO_FOCUS_STATUS_FAILED (1<<3) + +/* 3A misc */ +#define CSI_CAMERA_PID_AUTO_PRESET_WHITE_BALANCE (CSI_CAMERA_PID_BASE + 0x31) +enum CSI_CAMERA_AUTO_PRESET_WHITE_BALANCE_MODE { + CSI_CAMERA_WHITE_BALANCE_MANUAL = 0, + CSI_CAMERA_WHITE_BALANCE_AUTO = 1, + CSI_CAMERA_WHITE_BALANCE_TUNGSTEN= 2, + CSI_CAMERA_WHITE_BALANCE_INCANDESCENT = 3, + CSI_CAMERA_WHITE_BALANCE_SUNNY = 4, + CSI_CAMERA_WHITE_BALANCE_CLOUDY = 5, +}; + +#define CSI_CAMERA_PID_3A_LOCK (CSI_CAMERA_PID_BASE + 0x32) +#define CSI_CAMERA_LOCK_EXPOSURE (1 << 0) +#define CSI_CAMERA_LOCK_WHITE_BALANCE (1 << 1) +#define CSI_CAMERA_LOCK_FOCUS (1 << 2) + +/* Gain */ +#define CSI_CAMERA_PID_RED_GAIN (CSI_CAMERA_PID_BASE + 0x41) +#define CSI_CAMERA_PID_GREEN_GAIN (CSI_CAMERA_PID_BASE + 0x42) +#define CSI_CAMERA_PID_BLUE_GAIN (CSI_CAMERA_PID_BASE + 0x43) +#define CSI_CAMERA_PID_WIDE_DYNAMIC_RANGE (CSI_CAMERA_PID_BASE + 0x44) +#define CSI_CAMERA_PID_ZOOM_ABSOLUTE (CSI_CAMERA_PID_BASE + 0x45) +#define CSI_CAMERA_PID_ZOOM_RELATIVE (CSI_CAMERA_PID_BASE + 0x46) +#define CSI_CAMERA_PID_ZOOM_CONTINOUS (CSI_CAMERA_PID_BASE + 0x47) + +/* PAN & TILT */ +#define CSI_CAMERA_PID_PAN_RELATIVE (CSI_CAMERA_PID_BASE + 0x51) +#define CSI_CAMERA_PID_TILT_RELATIVE (CSI_CAMERA_PID_BASE + 0x52) +#define CSI_CAMERA_PID_PAN_ABSOLUTE (CSI_CAMERA_PID_BASE + 0x53) +#define CSI_CAMERA_PID_TILT_ABSOLUTE (CSI_CAMERA_PID_BASE + 0x54) +#define CSI_CAMERA_PID_PAN_RESET (CSI_CAMERA_PID_BASE + 0x55) +#define CSI_CAMERA_PID_TILT_RESET (CSI_CAMERA_PID_BASE + 0x56) + +/* misc enhance */ +#define CSI_CAMERA_PID_HDR_MODE (CSI_CAMERA_PID_BASE + 0x61) +#define CSI_CAMERA_PID_BAND_STOP_FILTER (CSI_CAMERA_PID_BASE + 0x62) +#define CSI_CAMERA_PID_IMAGE_STABILIZATION (CSI_CAMERA_PID_BASE + 0x63) + +#define CSI_CAMERA_PID_GAIN (CSI_CAMERA_PID_BASE + 0x64) +#define CSI_CAMERA_PID_TDNR (CSI_CAMERA_PID_BASE + 0x65) + +#ifdef __cplusplus +} +#endif +#endif /* __CSI_CAMERA_PROPERTY_H__ */ + diff --git a/th1520/hardware/camera/include/csi_hal/csi_common.h b/th1520/hardware/camera/include/csi_hal/csi_common.h new file mode 100755 index 0000000000000000000000000000000000000000..52948dcb6808f55d7f5443761990db70fdb67e3b --- /dev/null +++ b/th1520/hardware/camera/include/csi_hal/csi_common.h @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2021 Alibaba Group Holding Limited + * Author: LuChongzhi + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef __CSI_COMMON_H__ +#define __CSI_COMMON_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) + +typedef union csi_api_version { + struct { + uint16_t minor; + uint16_t major; + }; + uint32_t version; +} csi_api_version_u; + +typedef struct csi_size { + uint32_t width; + uint32_t height; +} csi_size_s; + +typedef struct csi_rect { + uint32_t pos_x; + uint32_t pos_y; + uint32_t width; + uint32_t height; +} csi_rect_s; + + +enum { + CSI_IO_PATTERN_INTERNAL_MEMORY = 0x01, /* Internal preparation IO memory mode */ + CSI_IO_PATTERN_EXTERNAL_MEMORY = 0x02 /* External preparation IO memory mode */ +}; + +typedef enum csi_common_err_code { + CSI_SUCCESS, + CSI_ERR_BAD_PARAM, + CSI_ERR_NOT_SUPPORT, + CSI_ERR_BUSY, + CSI_ERR_OUT_OF_MEMORY, + CSI_ERR_NEED_MORE_DATA, + CSI_ERR_NEED_MORE_IO_FRAME, + CSI_ERR_TIMEOUT, + CSI_ERR_WAIT +} csi_common_err_code_e; + + +int32_t csi_hal_init(); +int32_t csi_hal_deinit(); + + +#ifdef __cplusplus +} +#endif + +#endif /* __CSI_COMMON_H__ */ diff --git a/th1520/hardware/camera/include/csi_hal/csi_fce.h b/th1520/hardware/camera/include/csi_hal/csi_fce.h new file mode 100755 index 0000000000000000000000000000000000000000..568da907f8a47c1851fa6f6fea198858835d2a37 --- /dev/null +++ b/th1520/hardware/camera/include/csi_hal/csi_fce.h @@ -0,0 +1,54 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright(C) 2021 Alibaba Communications Inc. + * Author: David Li + */ + +#ifndef _FCE_HAL_H_ +#define _FCE_HAL_H_ + +#ifdef __cplusplus +extern "C"{ +#endif + +#include "fce_cfg.h" + +enum FCE_EVENT { + FCE_EVENT_COMPLETE = 0, + FCE_EVENT_PAUSE, + FCE_EVENT_BUSERR, + FCE_EVENT_TIMEOUT, + FCE_EVENT_UNDEFMSG, + FCE_EVENT_SOCKERR, + FCE_EVENT_OTHER +}; + +typedef void *csi_fce_handle_t; +typedef void *csi_fce_sock_handle_t; + +int csi_fce_open(csi_fce_handle_t *fce_handle, char *name); +int csi_fce_close(csi_fce_handle_t fce_handle); +int csi_fce_query_result_cnt(csi_fce_handle_t fce_handle, unsigned int *cnt); +int csi_fce_set_result_cnt(csi_fce_handle_t fce_handle, unsigned int *cnt); +int csi_fce_set_attr(csi_fce_handle_t fce_handle, struct fce_cfg *cfg); +int csi_fce_get_attr(csi_fce_handle_t fce_handle, struct fce_cfg *cfg); +int csi_fce_do_compare(csi_fce_handle_t fce_handle, struct target_vector *target_vect); +int csi_fce_get_result(csi_fce_handle_t fce_handle, struct top_result *top_buf); +int csi_fce_suspend(csi_fce_handle_t fce_handle); +int csi_fce_resume(csi_fce_handle_t fce_handle); + +unsigned long csi_fce_create_featurelib(csi_fce_handle_t fce_handle, unsigned int size); +int csi_fce_release_featurelib(csi_fce_handle_t fce_handle, unsigned long offset); + +int csi_fce_config_init(struct fce_cfg *cfg); +int csi_fce_check_result(struct top_result *res1, struct top_result *res2); + +int csi_fce_init_sock(csi_fce_sock_handle_t *sock_handle, unsigned long timeout_ms); +int csi_fce_release_sock(csi_fce_sock_handle_t sock_handle); +enum FCE_EVENT csi_fce_waitevent(csi_fce_sock_handle_t sock_handle); + +#ifdef __cplusplus +} +#endif + +#endif // #ifndef _FCE_HAL_H_ \ No newline at end of file diff --git a/th1520/hardware/camera/include/csi_hal/csi_fce_cfg.h b/th1520/hardware/camera/include/csi_hal/csi_fce_cfg.h new file mode 100755 index 0000000000000000000000000000000000000000..fbade6038ed1394d40020e8bf2283f305826287f --- /dev/null +++ b/th1520/hardware/camera/include/csi_hal/csi_fce_cfg.h @@ -0,0 +1,94 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright(C) 2021 Alibaba Communications Inc. + * Author: David Li + */ + +#ifndef FCE_CFG_H +#define FCE_CFG_H + +#ifdef __cplusplus +extern "C"{ +#endif + +#define MAX_BASE_NUM 1000000 +#define TOPREG_CNT 8 +#define TARGET_VECTOR_CNT 64 +#define PREPRO_VECTOR_CNT 64 +#define BITS_PER_BYTE 8 + +enum FCE_BASE_NUM { + BASENUM_1 = 0, + BASENUM_10, + BASENUM_1w, + BASENUM_5w, + BASENUM_10w, + BASENUM_20w, + BASENUM_50w, + BASENUM_100w, + BASENUM_MAX = BASENUM_100w, +}; + +enum FCE_DIMENSION { + DIM_128 = 0, + DIM_160, + DIM_192, + DIM_224, + DIM_256, + DIM_MAX = DIM_256, +}; + +enum FCE_INT_WIDTH { + INT_WIDTH_8 = 0, + INT_WIDTH_4, + INT_WIDTH_MAX = INT_WIDTH_4, +}; + +enum FCE_SIGN_SEL { + UNSIGN = 0, + SIGN, + SIGSEL_MAX = SIGN, +}; + +struct target_vector { + int value; +}; + +struct prepro_vector { + int value; +}; + +enum FCE_ENDIAN_SEL { + FCE_LIT_ENDIAN = 0, + FCE_BIG_ENDIAN, + FCE_ENDIAN_MAX = FCE_BIG_ENDIAN, +}; + +struct fce_cfg { + unsigned int base_num; // feature num in library, < MAX_BASE_NUM + // comparasion start address in feature library buffer, default is 0 + unsigned long offset_base; + unsigned long saddr; // fill in kernel driver + enum FCE_DIMENSION dim; // dimension + enum FCE_INT_WIDTH width; + enum FCE_SIGN_SEL sigsel; // sign or unsign + unsigned int readnum; // number of target vector, unit byte + // data endian format of feature library + enum FCE_ENDIAN_SEL base_endian; + // data endian format of target feature vector for comparasion + enum FCE_ENDIAN_SEL target_endian; + // data endian format of xor operation on the feature library + enum FCE_ENDIAN_SEL prepro_endian; + struct prepro_vector prepro_vect[PREPRO_VECTOR_CNT]; // xor vector +}; + +struct top_result { + int match_value; + unsigned int match_index; +}; + +#ifdef __cplusplus +} +#endif + +#endif // #ifndef FCE_CFG_H \ No newline at end of file diff --git a/th1520/hardware/camera/include/csi_hal/csi_frame.h b/th1520/hardware/camera/include/csi_hal/csi_frame.h new file mode 100755 index 0000000000000000000000000000000000000000..e4a23e97b2e5dff450944b60c02ef4b69962d2b7 --- /dev/null +++ b/th1520/hardware/camera/include/csi_hal/csi_frame.h @@ -0,0 +1,140 @@ +/* + * Copyright (C) 2021 Alibaba Group Holding Limited + * Author: LuChongzhi + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef __CSI_FRAME_H__ +#define __CSI_FRAME_H__ + +#include +#include +#include +#include +#include "csi_meta.h" +#ifdef __cplusplus +extern "C" { +#endif +/* + * CSI frame defination is below, including + * + * @-- [frm_id] ----------------@ + * | __________ ___________ | + * | | | | | | + * | | img_info | | meta_info | | + * | |__________| |___________| | + * | | + * @------- csi_frame_s --------@ + */ + +#define CSI_IMAGE_MAX_PLANES 3 +#define CSI_IMAGE_I420_PLANES 2 + +typedef enum csi_pixel_fmt { + CSI_PIX_FMT_INVALID = -1, + CSI_PIX_FMT_I420, // YYYYYYYY UU VV, alias: YUV420P/YU12/IYUV + CSI_PIX_FMT_NV12, // YYYYYYYY UV UV, alias: YUV420SP + CSI_PIX_FMT_BGR, + CSI_PIX_FMT_RAW_8BIT,/*default no align*/ + CSI_PIX_FMT_RAW_10BIT, + CSI_PIX_FMT_RAW_12BIT, + CSI_PIX_FMT_RAW_14BIT, + CSI_PIX_FMT_RAW_16BIT, + CSI_PIX_FMT_RGB_PLANAR_888, + CSI_PIX_FMT_RGB_INTEVLEAVED_888, + CSI_PIX_FMT_YUV_PLANAR_422, + CSI_PIX_FMT_YUV_PLANAR_420, + CSI_PIX_FMT_YUV_PLANAR_444, + CSI_PIX_FMT_YUV_SEMIPLANAR_422, + CSI_PIX_FMT_YUV_SEMIPLANAR_420, + CSI_PIX_FMT_YUV_SEMIPLANAR_444, + CSI_PIX_FMT_YUV_TEVLEAVED_422, + CSI_PIX_FMT_YUV_TEVLEAVED_420, + CSI_PIX_FMT_YUV_TEVLEAVED_444, +} csi_pixel_fmt_e; + +typedef enum csi_color_gamut { + CSI_COLOR_GAMUT_DEFAULT = 0, + CSI_COLOR_GAMUT_BT601, + CSI_COLOR_GAMUT_BT709, + CSI_COLOR_GAMUT_BT2020, +} csi_color_gamut_e; + +typedef enum csi_img_type { + CSI_IMG_TYPE_DMA_BUF, // memory allocated via dma-buf + CSI_IMG_TYPE_SYSTEM_CONTIG, // memory allocated via kmalloc + CSI_IMG_TYPE_CARVEOUT, // memory allocated from reserved memory + CSI_IMG_TYPE_UMALLOC, // memory allocated from user mode malloc + CSI_IMG_TYPE_SHM, // memory allocated from share memory() +} csi_img_type_e; + +/* + * CSI frame config design + * + * line_stride -->| + * img_width -->| | + * _____________|___| __ start addr of frame/image, alignment (such as 4096) + * | | | + * | img_content | | + * |_____________|___| __ end addr of image, No alignment requirement + * | extra_data | + * |_________________| __ end addr of frame, No alignment requirement + */ + +typedef struct csi_img_format { + uint32_t width; + uint32_t height; + csi_pixel_fmt_e pix_fmt; +} csi_img_format_t; + + +typedef struct { + int32_t stride_alignment; // should >= to the width of the image according to IP design + int32_t addr_alignment; // physical begin address alignment according to IP design + int32_t extra_size; // storaging platform private data according to IP design (meta data storage is suggested) + int32_t min_buffers_count; // minimum number of buffers required +} csi_frame_config_s; // New defined structure + +typedef struct { + int fds; // stores in dma_buf memory(s) + unsigned long offset; +} cam_frame_dmabuf_t; + +typedef struct csi_img { + csi_img_type_e type; + size_t size; + uint32_t width; + uint32_t height; + csi_pixel_fmt_e pix_format; + csi_color_gamut_e color_gamut; + uint32_t num_planes; + union { + cam_frame_dmabuf_t dmabuf[CSI_IMAGE_MAX_PLANES]; // stores in dma_buf memory(s) + int fds[CSI_IMAGE_MAX_PLANES]; // stores in dma_buf memory(s) + void *phy_addr[CSI_IMAGE_MAX_PLANES]; // stores in phy contigous memory(s) + void *usr_addr[CSI_IMAGE_MAX_PLANES]; // stores in usr contigous memory(s) + }; + uint32_t strides[CSI_IMAGE_MAX_PLANES]; + uint32_t offsets[CSI_IMAGE_MAX_PLANES]; + uint64_t modifier; + void *priv; +} csi_img_s; +typedef struct csi_frame { + csi_img_s img; + csi_meta_s meta; +} csi_frame_s; + + +int csi_frame_reference(csi_frame_s *frame_dest, csi_frame_s *frame_src); +int csi_frame_release(csi_frame_s *frame); +void *csi_frame_mmap(csi_frame_s *frame); +int csi_frame_munmap(csi_frame_s *frame); + +#ifdef __cplusplus +} +#endif + +#endif /* __CSI_FRAME_H__ */ diff --git a/th1520/hardware/camera/include/csi_hal/csi_frame_ex.h b/th1520/hardware/camera/include/csi_hal/csi_frame_ex.h new file mode 100755 index 0000000000000000000000000000000000000000..9e27355f50bbb4363e9f1b8861e8a0a1cee052b0 --- /dev/null +++ b/th1520/hardware/camera/include/csi_hal/csi_frame_ex.h @@ -0,0 +1,131 @@ +/** +* Copyright (C) 2021 Alibaba Group Holding Limited +**/ +#ifndef _CSI_FRAME_EX_H +#define _CSI_FRAME_EX_H + +#include "csi_common.h" +#include "csi_meta.h" +#ifdef __cplusplus +extern "C" { +#endif +#define MAX_PLANE_COUNT 3 + +#if 0 +typedef enum { + CSI_PICTURE_TYPE_NONE = 0, /* undefined */ + CSI_PICTURE_TYPE_I, /* intra */ + CSI_PICTURE_TYPE_P, /* predicted */ + CSI_PICTURE_TYPE_B, /* BI-dir predictd */ + CSI_PICTURE_TYPE_S, /* S(GMC)-VOP MPEG-4 */ + CSI_PICTURE_TYPE_SI, /* Switching intra */ + CSI_PICTURE_TYPE_SP, /* Switching Predicted */ + CSI_PICTURE_TYPE_BI, /* BI Type */ +} csi_picture_type_e; +#endif + + +typedef enum { + CSI_CHROMA_LOCATION_LEFT, + CSI_CHROMA_LOCATION_CENTER, + CSI_CHROMA_LOCATION_TOPLEFT, + CSI_CHROMA_LOCATION_TOP, + CSI_CHROMA_LOCATION_BOTTOMLEFT, + CSI_CHROMA_LOCATION_BOTTOM, + CSI_CHROMA_LOCATION_DV420 +} csi_chroma_location_e; + +#if 0 +typedef enum { + CSI_FRAME_COMPRESS_MODE_NONE = 0, /* no compress */ + CSI_FRAME_COMPRESS_MODE_SEQ, /* compress unit is 256x1 bytes as a segment. */ + CSI_FRAME_COMPRESS_MODE_TILE, /* compress unit is a tile. */ + CSI_FRAME_COMPRESS_MODE_LINE, /* compress unit is the whole line. raw for VI */ + CSI_FRAME_COMPRESS_MODE_FRAME, /* compress unit is the whole frame. YUV for VI(3DNR), RGB for TDE(write)/VO(read) */ + CSI_FRAME_COMPRESS_MAX +} csi_frame_compress_mode; +#endif + +typedef enum { + CSI_COLORSPACE_ACES, /* RGB color space ACES standardized as SMPTE ST 2065-1:2012. */ + CSI_COLORSPACE_ACESCG, /* RGB color space ACEScg standardized as Academy S-2014-004. */ + CSI_COLORSPACE_RGB, /* RGB color space Adobe RGB (1998). */ + CSI_COLORSPACE_BT2020, /* RGB color space BT.2020 standardized as Rec. */ + CSI_COLORSPACE_BT709, /* RGB color space BT.709 standardized as Rec. */ + CSI_COLORSPACE_CIE_LAB, /* Lab color space CIE L*a*b*. */ + CSI_COLORSPACE_CIE_XYZ, /* XYZ color space CIE XYZ. */ + CSI_COLORSPACE_DCI_P3, /* RGB color space DCI-P3 standardized as SMPTE RP 431-2-2007. */ + CSI_COLORSPACE_DISPLAY_p3, /* RGB color space Display P3 based on SMPTE RP 431-2-2007 and IEC 61966-2.1:1999. */ + CSI_COLORSPACE_EXTENDED_SRGB, /* RGB color space scRGB-nl standardized as IEC 61966-2-2:2003. */ + CSI_COLORSPACE_LINEAR_EXTENDED_SRGB, /* RGB color space scRGB standardized as IEC 61966-2-2:2003. */ + CSI_COLORSPACE_LINEAR_SRGB, /* RGB color space sRGB standardized as IEC 61966-2.1:1999. */ + CSI_COLORSPACE_NTSC_1953, /* RGB color space NTSC, 1953 standard. */ + CSI_COLORSPACE_PRO_PHOTO_RGB, /* RGB color space NTSC, 1953 standard. */ + CSI_COLORSPACE_SMPTE_C, /* RGB color space SMPTE C. */ + CSI_COLORSPACE_SRGB /* RGB color space sRGB standardized as IEC 61966-2.1:1999. */ +} csi_color_space_e; + +typedef enum { + CSI_VIDEO_FORMAT_UNDEFINED, + CSI_VIDEO_FORMAT_COMPONENT, + CSI_VIDEO_FORMAT_PAL, + CSI_VIDEO_FORMAT_NTSC, + CSI_VIDEO_FORMAT_SECAM, + CSI_VIDEO_FORMAT_MAC +} csi_video_format_e; + +typedef struct csi_frame_info { + int32_t width; + int32_t height; + /* the region of interest of the frame */ + //csi_rect_s roi; + int32_t pixel_format; //define in csi_pixel_fmt_e + //csi_frame_compress_mode compress_mode; + csi_color_space_e color_space; + csi_chroma_location_e chroma_location; +} csi_frame_info_s; + +typedef struct csi_frame_data { + int64_t pts; + int64_t dts; + int64_t frame_num; + int8_t is_key_frame; + int8_t is_eos; /* last frame */ + + int32_t offset[MAX_PLANE_COUNT]; + int32_t stride[MAX_PLANE_COUNT]; + int32_t num_plane; + + void *vir_addr[MAX_PLANE_COUNT]; + union { + int fd[MAX_PLANE_COUNT]; /* -1 means invalid */ + int64_t phy_addr[MAX_PLANE_COUNT]; /* 0 means invalid */ + }; +} csi_frame_data_s; + +typedef struct csi_frame_ex { + csi_frame_info_s frame_info; + csi_frame_data_s frame_data; + csi_meta_s frame_meta; + void *opaque; /* for user private data, csi NOT use or modify it */ + void *csi_priv;/**for csi private data,user NOT use or modify it***************/ +} csi_frame_ex_s; + +typedef struct csi_frame_alloctor{ + int (*alloc)(csi_frame_ex_s * frame); /* base on the frame info,alloc fill the fd */ + int (*free)(csi_frame_ex_s * frame); +}csi_frame_alloctor_s; +#if 0 +typedef struct csi_bitstream { + void *buf; + uint32_t len; + uint8_t is_eos; //is the end of stream + uint8_t is_frame; //is whole compress frame data +} csi_bitstream_s; +#endif + +#ifdef __cplusplus +} +#endif + +#endif \ No newline at end of file diff --git a/th1520/hardware/camera/include/csi_hal/csi_meta.h b/th1520/hardware/camera/include/csi_hal/csi_meta.h new file mode 100755 index 0000000000000000000000000000000000000000..435a339a1d776d84f1998cb165c09f06b10110b5 --- /dev/null +++ b/th1520/hardware/camera/include/csi_hal/csi_meta.h @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2021 Alibaba Group Holding Limited + * Author: LuChongzhi + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef __CSI_META_H__ +#define __CSI_META_H__ + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif +typedef enum csi_meta_type { + CSI_META_TYPE_SYSTEM, + CSI_META_TYPE_CAMERA, + CSI_META_TYPE_VDEC, + CSI_META_TYPE_GPU, + CSI_META_TYPE_G2D, +} csi_meta_type_e; +typedef enum csi_meta_value_type { + CSI_META_VALUE_TYPE_BOOL, + CSI_META_VALUE_TYPE_INT, + CSI_META_VALUE_TYPE_UINT, + CSI_META_VALUE_TYPE_STR, + CSI_META_VALUE_TYPE_TIMEVAL, +} csi_meta_value_type_e; + +typedef struct csi_meta { + csi_meta_type_e type; + size_t size; + void *data; +} csi_meta_s; + +#ifdef __cplusplus +} +#endif + +#endif /* __CSI_META_H__ */ diff --git a/th1520/hardware/camera/include/csi_hal/csi_vcodec_common.h b/th1520/hardware/camera/include/csi_hal/csi_vcodec_common.h new file mode 100755 index 0000000000000000000000000000000000000000..9b0cdef2f6f423e0c882189e15eb90b01ddbe19e --- /dev/null +++ b/th1520/hardware/camera/include/csi_hal/csi_vcodec_common.h @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2021 Alibaba Group Holding Limited + * Author: LuChongzhi + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef __CSI_VIDEO_COMMON__ +#define __CSI_VIDEO_COMMON__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Refer ffmpeg: libavcodec/codec_id.h */ +typedef enum csi_vcodec_id { + CSI_VCODEC_ID_UNKNOWN = 0, /* unknown decoder */ + + CSI_VCODEC_ID_JPEG = (1 << 0), + CSI_VCODEC_ID_MJPEG = (1 << 1), + + CSI_VCODEC_ID_MPEG1 = (1 << 2), + CSI_VCODEC_ID_MPEG2 = (1 << 3), /* MPEG-2 decoder */ + CSI_VCODEC_ID_MPEG4 = (1 << 4), /* MPEG-4 decoder */ + + CSI_VCODEC_ID_H263P = (1 << 5), /* H.263 progressive */ + CSI_VCODEC_ID_H263I = (1 << 6), /* H.263 interleave */ + CSI_VCODEC_ID_H264 = (1 << 7), /* H.264 AVC/SVC */ + CSI_VCODEC_ID_H265 = (1 << 8), /* H.265 */ + CSI_VCODEC_ID_H266 = (1 << 9), /* H.266 */ + + CSI_VCODEC_ID_RV30 = (1 << 10), /* RealVideo 8 */ + CSI_VCODEC_ID_RV40 = (1 << 11), /* RealVideo 9/10 */ + + CSI_VCODEC_ID_WMV1 = (1 << 12), + CSI_VCODEC_ID_WMV2 = (1 << 13), + CSI_VCODEC_ID_WMV3 = (1 << 14), + + CSI_VCODEC_ID_MSMPEG4V1 = (1 << 15), + CSI_VCODEC_ID_MSMPEG4V2 = (1 << 16), + CSI_VCODEC_ID_MSMPEG4V3 = (1 << 17), + + // Alias names + CSI_VCODEC_ID_HEVC = CSI_VCODEC_ID_H265, + CSI_VCODEC_ID_DIVX = CSI_VCODEC_ID_MSMPEG4V2, +} csi_vcodec_id_e; + +typedef enum csi_vcodec_frame_type { + CSI_VCODEC_I_FRAME = 1 << 0, + CSI_VCODEC_P_FRAME = 1 << 1, + CSI_VCODEC_B_FRAME = 1 << 2, +} csi_vcodec_frame_type_e; + +#ifdef __cplusplus +} +#endif + +#endif /* __CSI_VIDEO_COMMON__ */ diff --git a/th1520/hardware/camera/include/csi_hal/csi_vdec.h b/th1520/hardware/camera/include/csi_hal/csi_vdec.h new file mode 100755 index 0000000000000000000000000000000000000000..f50b4b8d92a14a3c9adf43421d7532a94aa544f6 --- /dev/null +++ b/th1520/hardware/camera/include/csi_hal/csi_vdec.h @@ -0,0 +1,263 @@ +/* + * Copyright (C) 2021 Alibaba Group Holding Limited + * Author: LuChongzhi + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef __CSI_VDEC_H__ +#define __CSI_VDEC_H__ + +#include +#include +#include + +#include "csi_common.h" +#include "csi_vcodec_common.h" +#include "csi_allocator.h" +#include "csi_frame.h" +#include "csi_frame_ex.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define CSI_VDEC_VERSION_MAJOR 0 +#define CSI_VDEC_VERSION_MINOR 2 + +typedef void *csi_vdec_dev_t; +typedef void *csi_vdec_chn_t; +typedef void *csi_vdec_event_handle_t; + +typedef enum csi_vdec_status { + CSI_VDEC_STATUS_OK = 0, + CSI_VDEC_STATUS_MORE_FRAME_BUFFER = 1, + CSI_VDEC_STATUS_MORE_BITSTREAM = 2, + CSI_VDEC_STATUS_HAS_INFO = 3, + CSI_VDEC_STATUS_PIC_DECODED = 4, + CSI_VDEC_STATUS_NO_FRAME_BUFFER = 5, + CSI_VDEC_STATUS_EOS = 6, + CSI_VDEC_STATUS_TIMEOUT = 7, + CSI_VDEC_STATUS_SKIPPED = 8, + CSI_VDEC_STATUS_PIC_OUTPUT = 9, + CSI_VDEC_STATUS_FLUSHED = 10, + + /* error codes < 0 */ + CSI_VDEC_ERR_UNKOWN = -1, + CSI_VDEC_ERR_UNSUPPORTED = -2, + CSI_VDEC_ERR_INSUFFICIENT_RESOURCES = -3, + CSI_VDEC_ERR_WRONG_PARAM = -4, + CSI_VDEC_ERR_BAD_STREAM = -5, + CSI_VDEC_ERR_NOT_INTIALIZED = -6, + CSI_VDEC_ERR_MEMORY = -7, + /* add more ... */ + + /* warnings > 0 */ + CSI_VDEC_WRN_DEVICE_BUSY = 256, + CSI_VDEC_WRN_INCOMPATIBLE_PARAM = 257, + CSI_VDEC_WRN_NOT_IMPLEMENTED = 258, + /* add more ... */ +} csi_vdec_status_e; + +typedef enum csi_vdec_event_type { + CSI_VDEC_EVENT_TYPE_DECODER, + CSI_VDEC_EVENT_TYPE_CHANNEL, +} csi_vdec_event_type_e; + +typedef enum csi_vdec_event_id { + CSI_VDEC_EVENT_ID_ERROR = 1 << 0, +} csi_vdec_event_id_e; + +typedef enum csi_vdec_channel_event_id { + CSI_VDEC_CHANNEL_EVENT_ID_ERROR = 1 << 0, + CSI_VDEC_CHANNEL_EVENT_ID_FRAME_READY = 1 << 1, +} csi_vdec_channel_event_id_e; + +typedef enum csi_framebuf_source { + CSI_FB_SOURCE_DMABUF, + CSI_FB_SOURCE_CARVEOUT, +} csi_framebuf_source_e; + +typedef enum csi_vdec_input_mode { + CSI_VDEC_INPUT_MODE_STREAM, + CSI_VDEC_INPUT_MODE_FRAME, +} csi_vdec_input_mode_e; + +typedef enum csi_vdec_img_type { + CSI_VDEC_MODE_I = CSI_VCODEC_I_FRAME, + CSI_VDEC_MODE_IP = (CSI_VCODEC_I_FRAME | CSI_VCODEC_P_FRAME), + CSI_VDEC_MODE_IPB = (CSI_VCODEC_I_FRAME | CSI_VCODEC_P_FRAME | CSI_VCODEC_B_FRAME), +} csi_vdec_img_type_e; + +typedef enum csi_vdec_output_order { + CSI_VDEC_OUTPUT_ORDER_DISP = 0, + CSI_VDEC_OUTPUT_ORDER_DEC, +} csi_vdec_output_order_e; + +typedef enum csi_vdec_pp_rotate { + CSI_VDEC_PP_ROTATE_0, + CSI_VDEC_PP_ROTATE_90, + CSI_VDEC_PP_ROTATE_180, + CSI_VDEC_PP_ROTATE_270 +} csi_vdec_pp_rotate_t; + +#define CSI_VDEC_NAME_MAX_LEN 32 +typedef struct csi_vdec_info { + char module_name[CSI_VDEC_NAME_MAX_LEN]; + char device_name[CSI_VDEC_NAME_MAX_LEN]; + uint64_t capabilities; /* bitmask of 1<<(csi_vcodec_id_e) */ +} csi_vdec_info_t; + +#define CSI_VDEC_MAX_COUNT 2 +typedef struct csi_vdec_infos { + uint32_t count; + csi_vdec_info_t info[CSI_VDEC_MAX_COUNT]; +} csi_vdec_infos_s; + +typedef struct csi_vdec_stream { + uint32_t length; + uint64_t pts; + bool eos; + char *data; +} csi_vdec_stream_s; + +typedef struct csi_vdec_mode { + csi_framebuf_source_e fb_source; + bool low_latency_mode; + bool mini_buf_mode; +} csi_vdec_mode_s; + + +typedef struct csi_vdec_video_264 { +} csi_vdec_video_264_s; + +typedef struct csi_vdec_video_265 { +} csi_vdec_video_265_s; + +typedef struct csi_vdec_picture_jpeg { +} csi_vdec_picture_jpeg_s; + +typedef struct csi_vdec_config { + csi_vcodec_id_e dec_vcodec_id; + uint32_t dec_frame_buf_cnt; + uint32_t dec_frame_buf_size; + union { + csi_vdec_video_264_s video_264_param; + csi_vdec_video_265_s video_265_param; + csi_vdec_picture_jpeg_s picture_jpeg_param; + }; + + csi_vdec_input_mode_e input_mode; + uint32_t input_stream_buf_size; + + csi_vdec_img_type_e output_img_type; + csi_pixel_fmt_e output_format; + uint32_t output_width; + uint32_t output_height; + csi_vdec_output_order_e output_order; +} csi_vdec_config_s; + +typedef struct csi_vdec_pp_config { + csi_vdec_pp_rotate_t rotate; + bool h_flip; + bool v_flip; + csi_rect_s crop; /* width or height to be zero means no crop */ +} csi_vdec_pp_config_s; + +typedef struct csi_vdec_error_stats { + int32_t format_err; /* R; format error. eg: do not support filed */ + int32_t pic_size_err_set; /* R; picture width or height is larger than chnnel width or height*/ + int32_t stream_unsupprt; /* R; unsupport the stream specification */ + int32_t pack_err; /* R; stream package error */ + int32_t prtcl_num_err_set; /* R; protocol num is not enough. eg: slice, pps, sps */ + int32_t ref_err_set; /* R; refrence num is not enough */ + int32_t pic_buf_size_err_set; /* R; the buffer size of picture is not enough */ + int32_t stream_size_over; /* R; the stream size is too big and and force discard stream */ + int32_t vdec_stream_not_release;/* R; the stream not released for too long time */ +} csi_vdec_error_stats_s; + +typedef struct csi_vdec_chn_status { + csi_vcodec_id_e dec_vcodec_id; /* R; video type to be decoded */ + uint32_t left_stream_bytes; /* R; left stream bytes waiting for decode */ + uint32_t left_stream_frames; /* R; left frames waiting for decode,only valid for VIDEO_MODE_FRAME*/ + uint32_t left_pics; /* R; pics waiting for output */ + bool recv_stream_started; /* R; had started recv stream? */ + uint32_t recv_stream_frames; /* R; how many frames of stream has been received. valid when send by frame. */ + uint32_t decode_stream_frames; /* R; how many frames of stream has been decoded. valid when send by frame. */ + csi_vdec_error_stats_s stVdecDecErr; /* R; information about decode error */ +} csi_vdec_chn_status_s; + +typedef struct csi_vdec_event_subscription { + csi_vdec_event_type_e type; + unsigned int id; /* bitmasks */ +} csi_vdec_event_subscription_t; + +typedef struct csi_vdec_event { + csi_vdec_event_type_e type; + unsigned int id; + struct timespec timestamp; + union { + char bin[128]; + }; +} csi_vdec_event_s; + +int csi_vdec_get_version(csi_api_version_u *version); +int csi_vdec_query_list(csi_vdec_infos_s *infos); + +int csi_vdec_open(csi_vdec_dev_t *dec, const char *device_name); +int csi_vdec_close(csi_vdec_dev_t dec); + +int csi_vdec_get_io_pattern(csi_vdec_dev_t dec, int *pattern); + +int csi_vdec_create_channel(csi_vdec_chn_t *chn, csi_vdec_dev_t dec, csi_vdec_config_s *cfg); +int csi_vdec_destory_channel(csi_vdec_chn_t chn); + +int csi_vdec_get_frame_config(csi_vdec_chn_t chn, csi_img_format_t *img_fmt, csi_frame_config_s *frm_cfg); +int csi_vdec_set_frame_config(csi_vdec_chn_t chn, csi_img_format_t *img_fmt, csi_frame_config_s *frm_cfg); + +//int csi_vdec_set_memory_allocator(csi_vdec_chn_t chn, csi_allocator_s *allocator); + +int csi_vdec_set_mode(csi_vdec_chn_t chn, csi_vdec_mode_s *mode); +int csi_vdec_get_mode(csi_vdec_chn_t chn, csi_vdec_mode_s *mode); + +int csi_vdec_set_chn_config(csi_vdec_chn_t chn, csi_vdec_config_s *cfg); +int csi_vdec_get_chn_config(csi_vdec_chn_t chn, csi_vdec_config_s *cfg); + +int csi_vdec_set_pp_config(csi_vdec_chn_t chn, csi_vdec_pp_config_s *cfg); +int csi_vdec_get_pp_config(csi_vdec_chn_t chn, csi_vdec_pp_config_s *cfg); + +int csi_vdec_start(csi_vdec_chn_t chn); +int csi_vdec_stop(csi_vdec_chn_t chn); +int csi_vdec_reset(csi_vdec_chn_t chn); + +//int csi_vdec_get_frame_info(csi_vdec_chn_t chn, csi_vdec_frame_info *stream_info, csi_vdec_stream_s *stream); +int csi_vdec_send_stream_buf(csi_vdec_chn_t chn, csi_vdec_stream_s *stream, int32_t timeout); + +int csi_vdec_register_frames(csi_vdec_chn_t chn, csi_frame_s *frame[], int count); +int csi_vdec_put_frame(csi_vdec_chn_t chn, csi_frame_s *frame); +int csi_vdec_get_frame(csi_vdec_chn_t chn, csi_frame_s **frame, int32_t timeout);// Release by frame.release() + + +int csi_vdec_enqueue_frame(csi_vdec_chn_t chn, csi_frame_ex_s *frame); +int csi_vdec_dequeue_frame(csi_vdec_chn_t chn, csi_frame_ex_s **frame, int32_t timeout); + + +int csi_vdec_query_status(csi_vdec_chn_t chn, csi_vdec_chn_status_s *pstStatus); + +int csi_vdec_create_event_handle(csi_vdec_event_handle_t *chn, csi_vdec_dev_t event_handle); +int csi_vdec_destory_event(csi_vdec_event_handle_t event_handle); + +int csi_vdec_subscribe_event(csi_vdec_event_handle_t event_handle, + csi_vdec_event_subscription_t *subscribe); +int csi_vdec_unsubscribe_event(csi_vdec_event_handle_t event_handle, + csi_vdec_event_subscription_t *subscribe); +int csi_vdec_get_event(csi_vdec_event_handle_t event_handle, + csi_vdec_event_s *event, int timeout); + +#ifdef __cplusplus +} +#endif + +#endif /* __CSI_VDEC_H__ */ diff --git a/th1520/hardware/camera/include/csi_hal/csi_venc.h b/th1520/hardware/camera/include/csi_hal/csi_venc.h new file mode 100755 index 0000000000000000000000000000000000000000..7b1578f52c5f5a3a623665e74496e882b88305f3 --- /dev/null +++ b/th1520/hardware/camera/include/csi_hal/csi_venc.h @@ -0,0 +1,202 @@ +/* + * Copyright (C) 2021 Alibaba Group Holding Limited + * Author: LuChongzhi + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef __CSI_VENC_H__ +#define __CSI_VENC_H__ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define CSI_VENC_VERSION_MAJOR 0 +#define CSI_VENC_VERSION_MINOR 3 + +typedef void *csi_venc_dev_t; +typedef void *csi_venc_chn_t; +typedef void *csi_venc_event_handle_t; + +#define CSI_VENC_NAME_MAX_LEN 32 +typedef struct csi_venc_info { + char module_name[CSI_VENC_NAME_MAX_LEN]; + char device_name[CSI_VENC_NAME_MAX_LEN]; + uint64_t capabilities; /* bitmask of 1<<(csi_vcodec_id_e) */ +} csi_venc_info_s; + +#define CSI_VENC_MAX_COUNT 2 +typedef struct csi_venc_infos { + uint32_t count; + csi_venc_info_s info[CSI_VENC_MAX_COUNT]; +} csi_venc_infos_s; + +typedef struct csi_venc_chn_cfg { + csi_venc_attr_s attr; + csi_venc_gop_property_s gop; + csi_venc_rc_property_s rc; +} csi_venc_chn_cfg_s; + +typedef enum csi_venc_event_type { + CSI_VENC_EVENT_TYPE_DECODER, + CSI_VENC_EVENT_TYPE_CHANNEL, +} csi_venc_event_type_e; + +/* the attribute of the roi */ +typedef struct csi_venc_chn_roi_prop { + uint32_t index; /* Range:[0, 7]; Index of an ROI. The system supports indexes ranging from 0 to 7 */ + bool enable; /* Range:[0, 1]; Whether to enable this ROI */ + bool abs_qp; /* Range:[0, 1]; QP mode of an ROI.HI_FALSE: relative QP.HI_TURE: absolute QP.*/ + int32_t qp; /* Range:[-51, 51]; QP value,only relative mode can QP value less than 0. */ + csi_rect_s rect; /* Region of an ROI*/ +} csi_venc_chn_roi_prop_s; + +typedef enum csi_venc_ext_property_id { + CSI_VENC_EXT_PROPERTY_ROI, +} csi_venc_ext_property_id_e; + +typedef struct csi_venc_chn_ext_property { + csi_venc_ext_property_id_e prop_id; + union { + csi_venc_chn_roi_prop_s roi_prop; // CSI_VENC_EXT_PROPERTY_ROI + }; +} csi_venc_chn_ext_property_s; + +typedef enum csi_venc_event_id { + CSI_VENC_EVENT_ID_ERROR = 1 << 0, +} csi_venc_event_id_e; + +typedef enum csi_venc_chn_event_id { + CSI_VENC_CHANNEL_EVENT_ID_ERROR = 1 << 0, + CSI_VENC_CHANNEL_EVENT_ID_FRAME_READY = 1 << 1, +} csi_venc_chn_event_id_e; + +typedef struct csi_venc_event_subscription { + csi_venc_event_type_e type; + unsigned int id; /* bitmasks */ +} csi_venc_event_subscription_s; + +typedef struct csi_venc_event { + csi_venc_event_type_e type; + unsigned int id; + struct timespec timestamp; + union { + char bin[128]; + }; +} csi_venc_event_s; + +typedef union csi_venc_data_type { + csi_venc_h264_nalu_e h264_type; + csi_venc_h265_nalu_e h265_type; + csi_venc_jpeg_pack_e jpeg_type; +} csi_venc_data_type_u; + +typedef struct csi_stream { + size_t size; + union { + int buf_fd; // stores in dma_buf memory + void *phy_addr; // stores in phy contigous memory + void *usr_addr; // stores in usr contigous memory + }; + uint64_t pts; + bool frame_end; + csi_venc_data_type_u data_type; + uint32_t data_num; +} csi_stream_s; + +typedef enum csi_venc_prop_type { + CSI_VENC_FRAME_PROP_NONE = 0, + CSI_VENC_FRAME_PROP_FORCE_IDR, // Instantaneous Decoding Refresh + CSI_VENC_FRAME_PROP_FORCE_SKIP, +} csi_venc_prop_type_e; + +typedef struct csi_venc_prop { + csi_venc_prop_type_e type; + union { + bool force_idr; // CSI_VENC_FRAME_PROP_FORCE_IDR + bool force_skip; // CSI_VENC_FRAME_PROP_FORCE_SKIP + }; +} csi_venc_frame_prop_s; + +/* the status of the venc chnl*/ +typedef struct csi_venc_chn_status { + uint32_t left_pics; /* R; left picture number */ + uint32_t left_stream_bytes; /* R; left stream bytes*/ + uint32_t left_stream_frames; /* R; left stream frames*/ + uint32_t cur_packs; /* R; pack number of current frame*/ + uint32_t left_recv_pics; /* R; Number of frames to be received. This member is valid after HI_MPI_VENC_StartRecvPicEx is called.*/ + uint32_t left_enc_pics; /* R; Number of frames to be encoded. This member is valid after HI_MPI_VENC_StartRecvPicEx is called.*/ + bool jpeg_snap_end; /* R; the end of Snap.*/ +} csi_venc_chn_status_s; + +int csi_venc_get_version(csi_api_version_u *version); +int csi_venc_query_list(csi_venc_infos_s *infos); + +int csi_venc_open(csi_venc_dev_t *enc, const char *device_name); +int csi_venc_close(csi_venc_dev_t enc); + +int csi_venc_get_io_pattern(csi_venc_dev_t enc, int *pattern); +int csi_venc_get_frame_config(csi_venc_dev_t enc, csi_img_format_t *img_fmt, csi_frame_config_s *frm_cfg); +int csi_venc_set_frame_config(csi_venc_dev_t enc, csi_img_format_t *img_fmt, csi_frame_config_s *frm_cfg); + + + +int csi_venc_create_channel(csi_venc_chn_t *chn, csi_venc_dev_t enc, csi_venc_chn_cfg_s *cfg); +int csi_venc_destory_channel(csi_venc_chn_t chn); + +//int csi_venc_set_memory_allocator(csi_venc_chn_t chn, csi_allocator_s *allocator); + +int csi_venc_set_ext_property(csi_venc_chn_t chn, csi_venc_chn_ext_property_s *prop); +int csi_venc_get_ext_property(csi_venc_chn_t chn, csi_venc_chn_ext_property_s *prop); + +int csi_venc_start(csi_venc_chn_t chn); +int csi_venc_stop(csi_venc_chn_t chn); +int csi_venc_reset(csi_venc_chn_t chn); + +int csi_venc_send_frame(csi_venc_chn_t chn, csi_frame_s *frame, int timeout); +int csi_venc_send_frame_ex(csi_venc_chn_t chn, csi_frame_s *frame, int timeout, + csi_venc_frame_prop_s *prop, int prop_count); + + +int csi_venc_enqueue_frame(csi_venc_chn_t chn, csi_frame_ex_s *frame); +int csi_venc_enqueue_frame_ex(csi_venc_chn_t chn, csi_frame_ex_s *frame, + csi_venc_frame_prop_s *prop, int prop_count); +int csi_venc_dequeue_frame(csi_venc_chn_t chn, csi_frame_ex_s **frame, int timeout); + + +int csi_venc_get_stream(csi_venc_chn_t chn, csi_stream_s *stream, int timeout);// Release by stream.release() + +int csi_venc_query_status(csi_venc_chn_t chn, csi_venc_chn_status_s *status); + +int csi_venc_create_event_handle(csi_venc_event_handle_t *chn, csi_venc_dev_t event_handle); +int csi_venc_destory_event(csi_venc_event_handle_t event_handle); + +int csi_venc_subscribe_event(csi_venc_event_handle_t event_handle, + csi_venc_event_subscription_s *subscribe); +int csi_venc_unsubscribe_event(csi_venc_event_handle_t event_handle, + csi_venc_event_subscription_s *subscribe); +int csi_venc_get_event(csi_venc_event_handle_t event_handle, + csi_venc_event_s *event, int timeout); + +#ifdef __cplusplus +} +#endif + +#endif /* __CSI_ENC_H__ */ diff --git a/th1520/hardware/camera/include/csi_hal/csi_venc_h264.h b/th1520/hardware/camera/include/csi_hal/csi_venc_h264.h new file mode 100755 index 0000000000000000000000000000000000000000..3c98cd9cd7b40e299e1fa6085abcb688e3182be6 --- /dev/null +++ b/th1520/hardware/camera/include/csi_hal/csi_venc_h264.h @@ -0,0 +1,98 @@ +/* + * Copyright (C) 2021 Alibaba Group Holding Limited + * Author: LuChongzhi + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef __CSI_VENC_H264_H__ +#define __CSI_VENC_H264_H__ + +typedef enum { + CSI_VENC_H264_PROFILE_BASELINE = 0, + CSI_VENC_H264_PROFILE_EXTENDED = 1, + CSI_VENC_H264_PROFILE_MAIN = 2, + CSI_VENC_H264_PROFILE_HIGH = 3, + CSI_VENC_H264_PROFILE_HIGH10 = 4, + CSI_VENC_H264_PROFILE_HIGH422 = 5, + CSI_VENC_H264_PROFILE_HIGH444 = 6, + + CSI_VENC_H264_PROFILE_SVC = 10, +} csi_venc_h264_profile_e; + +typedef enum { + CSI_VENC_H264_LEVEL_1 = 10, /* QCIF (176x144) 64k bps */ + CSI_VENC_H264_LEVEL_1_b = 99, + CSI_VENC_H264_LEVEL_1_1 = 11, + CSI_VENC_H264_LEVEL_1_2 = 12, + CSI_VENC_H264_LEVEL_1_3 = 13, + CSI_VENC_H264_LEVEL_2 = 20, /* CIF (352x288) 576k bps" */ + CSI_VENC_H264_LEVEL_2_1 = 21, + CSI_VENC_H264_LEVEL_2_2 = 22, + CSI_VENC_H264_LEVEL_3 = 30, /* SD (720x576) 2M bps */ + CSI_VENC_H264_LEVEL_3_1 = 31, + CSI_VENC_H264_LEVEL_3_2 = 32, + CSI_VENC_H264_LEVEL_4 = 40, /* 1080p (1920x1080) 25M bps */ + CSI_VENC_H264_LEVEL_4_1 = 41, + CSI_VENC_H264_LEVEL_4_2 = 42, + CSI_VENC_H264_LEVEL_5 = 50, /* 2k (2560x1920) 168M bps */ + CSI_VENC_H264_LEVEL_5_1 = 51, + CSI_VENC_H264_LEVEL_5_2 = 52, +} csi_venc_h264_level_e; + +typedef struct csi_venc_h264_attr { + csi_venc_h264_profile_e profile; + csi_venc_h264_level_e level; + uint32_t frame_type; // bitmask of csi_vcodec_frame_type_e + bool frame_mode; // encode by frame or slice mode + bool share_buf; //Whether to enable the Share Buf of Rcn and Ref +} csi_venc_h264_attr_s; + +typedef struct csi_venc_h264_cbr { + uint32_t stat_time; /* Range:[1, 60]; the rate statistic time, the unit is senconds(s) */ + uint32_t framerate_numer; + uint32_t framerate_denom; + uint32_t bit_rate; /* Range:[2, 409600]; average bitrate, units:kbps */ +} csi_venc_h264_cbr_s; + +typedef struct csi_venc_h264_vbr { + uint32_t stat_time; /* Range:[1, 60]; the rate statistic time, the unit is senconds(s) */ + uint32_t framerate_numer; + uint32_t framerate_denom; + uint32_t max_bit_rate; /* Range:[2, 409600]; average bitrate, units:kbps */ +} csi_venc_h264_vbr_s; + +typedef struct csi_venc_h264_avbr { + uint32_t stat_time; /* Range:[1, 60]; the rate statistic time, the unit is senconds(s) */ + uint32_t framerate_numer; + uint32_t framerate_denom; + uint32_t max_bit_rate; /* Range:[2, 409600]; average bitrate, units:kbps */ +} csi_venc_h264_avbr_s; + +typedef struct csi_venc_h264_fixqp { + uint32_t framerate_numer; + uint32_t framerate_denom; + uint32_t i_qp; /* Range:[0, 51]; qp of the I frame */ + uint32_t p_qp; /* Range:[0, 51]; qp of the P frame */ + uint32_t b_qp; /* Range:[0, 51]; qp of the B frame */ +} csi_venc_h264_fixqp_s; + +typedef struct csi_venc_h264_qpmap { + uint32_t stat_time; /* Range:[1, 60]; the rate statistic time, the unit is senconds(s) */ + uint32_t framerate_numer; + uint32_t framerate_denom; +} csi_venc_h264_qpmap_s; + +typedef enum csi_venc_h264_nalu { + CSI_VENC_H264_NALU_BSLICE, /*B SLICE types*/ + CSI_VENC_H264_NALU_PSLICE, /*P SLICE types*/ + CSI_VENC_H264_NALU_ISLICE, /*I SLICE types*/ + CSI_VENC_H264_NALU_IDRSLICE, /*IDR SLICE types*/ + CSI_VENC_H264_NALU_SEI, /*SEI types*/ + CSI_VENC_H264_NALU_SPS, /*SPS types*/ + CSI_VENC_H264_NALU_PPS, /*PPS types*/ +} csi_venc_h264_nalu_e; + +#endif /* __CSI_VENC_H264_H__ */ diff --git a/th1520/hardware/camera/include/csi_hal/csi_venc_h265.h b/th1520/hardware/camera/include/csi_hal/csi_venc_h265.h new file mode 100755 index 0000000000000000000000000000000000000000..056091a28bd4e7e7a8d886db81c7a8921f7b790c --- /dev/null +++ b/th1520/hardware/camera/include/csi_hal/csi_venc_h265.h @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2021 Alibaba Group Holding Limited + * Author: LuChongzhi + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef __CSI_VENC_H265_H__ +#define __CSI_VENC_H265_H__ + +#include + +typedef enum { + CSI_VENC_H265_PROFILE_MAIN = 0, + CSI_VENC_H265_PROFILE_MAIN10, + CSI_VENC_H265_PROFILE_MAINSTILL, +} csi_venc_h265_profile_e; + +typedef enum { + CSI_VENC_H265_LEVEL_1 = 10, /* QCIF (176x144) 64k bps */ + CSI_VENC_H265_LEVEL_2 = 20, /* CIF (352x288) 122k bps" */ + CSI_VENC_H265_LEVEL_2_1 = 21, + CSI_VENC_H265_LEVEL_3 = 30, /* SD (720x576) 6M bps */ + CSI_VENC_H265_LEVEL_3_1 = 31, + CSI_VENC_H265_LEVEL_4 = 40, /* 1080p (1920x1080) 12M bps */ + CSI_VENC_H265_LEVEL_4_1 = 41, + CSI_VENC_H265_LEVEL_5 = 50, /* 4k (3840x2160) 25M bps */ + CSI_VENC_H265_LEVEL_5_1 = 51, + CSI_VENC_H265_LEVEL_5_2 = 52, + CSI_VENC_H265_LEVEL_6 = 60, /* 8k (7680x4320) 60M bps */ + CSI_VENC_H265_LEVEL_6_1 = 61, + CSI_VENC_H265_LEVEL_6_2 = 62, +} csi_venc_h265_level_e; + +typedef struct csi_venc_h265_attr { + csi_venc_h265_profile_e profile; + csi_venc_h265_level_e level; + + uint32_t frame_type; // bitmask of csi_vcodec_frame_type_e + bool frame_mode; // encode by frame or slice mode + bool share_buf; //Whether to enable the Share Buf of Rcn and Ref +} csi_venc_h265_attr_s; + +typedef enum csi_venc_h265_nalu { + CSI_VENC_H265_NALU_BSLICE, /*B SLICE types*/ + CSI_VENC_H265_NALU_PSLICE, /*P SLICE types*/ + CSI_VENC_H265_NALU_ISLICE, /*I SLICE types*/ + CSI_VENC_H265_NALU_IDRSLICE, /*IDR SLICE types*/ + CSI_VENC_H265_NALU_VPS, /*VPS types*/ + CSI_VENC_H265_NALU_SEI, /*SEI types*/ + CSI_VENC_H265_NALU_SPS, /*SPS types*/ + CSI_VENC_H265_NALU_PPS, /*PPS types*/ +} csi_venc_h265_nalu_e; + +typedef csi_venc_h264_cbr_s csi_venc_h265_cbr_s; +typedef csi_venc_h264_vbr_s csi_venc_h265_vbr_s; +typedef csi_venc_h264_avbr_s csi_venc_h265_avbr_s; +typedef csi_venc_h264_fixqp_s csi_venc_h265_fixqp_s; + +#endif /* __CSI_VENC_H265_H__ */ diff --git a/th1520/hardware/camera/include/csi_hal/csi_venc_mjpeg.h b/th1520/hardware/camera/include/csi_hal/csi_venc_mjpeg.h new file mode 100755 index 0000000000000000000000000000000000000000..04613dda5b1cded8f1968c10702006fecbdd64ec --- /dev/null +++ b/th1520/hardware/camera/include/csi_hal/csi_venc_mjpeg.h @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2021 Alibaba Group Holding Limited + * Author: LuChongzhi + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef __CSI_VENC_MJPEG_H__ +#define __CSI_VENC_MJPEG_H__ + +typedef struct csi_venc_mpf_cfg +{ + uint8_t large_thumbnail_count; /* Range:[0,2]; the large thumbnail pic num of the MPF */ + csi_size_s large_thumbnail_size[2]; /* The resolution of large ThumbNail*/ +} csi_venc_mpf_cfg_s; + +/*the attribute of jpeg */ +typedef struct csi_venc_jpeg_attr { + bool support_dcf; /* Range:[0,1]; support dcf */ + csi_venc_mpf_cfg_s mpf_cfg; /* Range:[0,1]; config of Mpf*/ +} csi_venc_jpeg_attr_s; + +/*the attribute of mjpeg */ +typedef struct csi_venc_mjpeg_attr { + // reserve +} csi_venc_mjpeg_attr_s; + +typedef struct csi_venc_mjpeg_cbr { + uint32_t stat_time; /* Range:[1, 60]; the rate statistic time, the unit is senconds(s) */ + uint32_t framerate_numer; + uint32_t framerate_denom; + uint32_t bit_rate; /* Range:[2, 409600]; average bitrate, units:kbps */ +} csi_venc_mjpeg_cbr_s; + +typedef struct csi_venc_mjpeg_vbr { + uint32_t stat_time; /* Range:[1, 60]; the rate statistic time, the unit is senconds(s) */ + uint32_t framerate_numer; + uint32_t framerate_denom; + uint32_t max_bit_rate; /* Range:[2, 409600]; average bitrate, units:kbps */ +} csi_venc_mjpeg_vbr_s; + +typedef struct csi_venc_mjpeg_fixqp { + uint32_t framerate_numer; + uint32_t framerate_denom; + uint32_t q_factor; /* Range:[1,99];image quality. */ +} csi_venc_mjpeg_fixqp_s; + +typedef enum csi_venc_jpeg_pack { + CSI_VENC_JPEG_PACK_ECS, /*ECS types*/ + CSI_VENC_JPEG_PACK_APP, /*APP types*/ + CSI_VENC_JPEG_PACK_VDO, /*VDO types*/ + CSI_VENC_JPEG_PACK_PIC, /*PIC types*/ +} csi_venc_jpeg_pack_e; + +#endif /* __CSI_VENC_MJPEG_H__ */ diff --git a/th1520/hardware/camera/include/csi_hal/csi_venc_property.h b/th1520/hardware/camera/include/csi_hal/csi_venc_property.h new file mode 100755 index 0000000000000000000000000000000000000000..3c9d4bc99104df35ad59e8b1a2ba74703e37402f --- /dev/null +++ b/th1520/hardware/camera/include/csi_hal/csi_venc_property.h @@ -0,0 +1,121 @@ +/* + * Copyright (C) 2021 Alibaba Group Holding Limited + * Author: LuChongzhi + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef __CSI_VENC_PROPERTY_H__ +#define __CSI_VENC_PROPERTY_H__ + +#include + +typedef struct csi_venc_attr { + csi_vcodec_id_e enc_vcodec_id; /* RW; the type of payload*/ + csi_pixel_fmt_e input_format; + uint32_t max_pic_width; /* RW; maximum width of a picture to be encoded, in pixel*/ + uint32_t max_pic_height; /* RW; maximum height of a picture to be encoded, in pixel*/ + uint32_t buf_size; /* RW; stream buffer size*/ + uint32_t pic_width; /* RW; maximum width of a picture to be encoded, in pixel*/ + uint32_t pic_height; /* RW; maximum height of a picture to be encoded, in pixel*/ + union { + csi_venc_h264_attr_s h264_attr; + csi_venc_h265_attr_s h265_attr; + csi_venc_jpeg_attr_s jpeg_attr; + csi_venc_mjpeg_attr_s mjpeg_attr; + }; +} csi_venc_attr_s; + +/* VENC GOP Property */ +typedef enum csi_venc_gop_mode { + CSI_VENC_GOPMODE_NORMALP = 0, + CSI_VENC_GOPMODE_DUALP = 1, + CSI_VENC_GOPMODE_SMARTP = 2, + CSI_VENC_GOPMODE_ADVSMARTP = 3, + CSI_VENC_GOPMODE_BIPREDB = 4, + CSI_VENC_GOPMODE_LOWDELAYB = 5, +} csi_venc_gop_mode_e; + +typedef struct csi_venc_gop_normalp { + int32_t ip_qp_delta; /* Range:[-10,30]; QP variance between P frame and I frame */ +} csi_venc_gop_normalp_s; + +typedef struct csi_venc_gop_dualp { + uint32_t sp_interval; /* Range:[0, 1)U(1, Gop -1]; Interval of the special P frames */ + int32_t sp_qp_delta; /* Range:[-10,30]; QP variance between P frame and special P frame */ + int32_t ip_qp_delta; /* Range:[-10,30]; QP variance between P frame and I frame */ +} csi_venc_gop_dualp_s; + +typedef struct csi_venc_gop_smartp { + uint32_t bg_interval; /* Range:[0, 1)U(1, Gop -1]; Interval of the special P frames */ + int32_t sp_qp_delta; /* Range:[-10,30]; QP variance between P frame and special P frame */ + int32_t ip_qp_delta; /* Range:[-10,30]; QP variance between P frame and I frame */ +} csi_venc_gop_smartp_s; + +typedef struct csi_venc_gop_advsmartp { + uint32_t bg_interval; /* Range:[Gop,4294967295] ;Interval of the long-term reference frame */ + int32_t bg_qp_delta; /* Range:[-10,30]; QP variance between P frame and Bg frame */ + int32_t vi_qp_delta; /* Range:[-10,30]; QP variance between P frame and virtual I frame */ +} csi_venc_gop_advsmartp_s; + +typedef struct csi_venc_gop_bipredb { + uint32_t b_frm_num; /* Range:[1,3]; Number of B frames */ + int32_t b_qp_delta; /* Range:[-10,30]; QP variance between P frame and B frame */ + int32_t ip_qp_delta; /* Range:[-10,30]; QP variance between P frame and I frame */ +} csi_venc_gop_bipredb_s; + +typedef struct csi_venc_gop_property { + uint32_t gop_num; + csi_venc_gop_mode_e gop_mode; + union { + csi_venc_gop_normalp_s normalp; /* attributes of normal P */ + csi_venc_gop_dualp_s dualp; /* attributes of dual P */ + csi_venc_gop_smartp_s smartp; /* attributes of Smart P */ + csi_venc_gop_advsmartp_s advsmartp; /* attributes of AdvSmart P */ + csi_venc_gop_bipredb_s bipredb; /* attributes of B */ + }; +} csi_venc_gop_property_s; + +/* VENC Rate Control Property */ +typedef enum csi_venc_rc_mode { + CSI_VENC_RC_MODE_NONE = 0, /* JPEG use it */ + + CSI_VENC_RC_MODE_H264CBR = 1, + CSI_VENC_RC_MODE_H264VBR, + CSI_VENC_RC_MODE_H264AVBR, + CSI_VENC_RC_MODE_H264FIXQP, + CSI_VENC_RC_MODE_H264QPMAP, + + CSI_VENC_RC_MODE_H265CBR, + CSI_VENC_RC_MODE_H265VBR, + CSI_VENC_RC_MODE_H265AVBR, + CSI_VENC_RC_MODE_H265FIXQP, + CSI_VENC_RC_MODE_H265QPMAP, + + CSI_VENC_RC_MODE_MJPEGCBR, + CSI_VENC_RC_MODE_MJPEGVBR, + CSI_VENC_RC_MODE_MJPEGFIXQP, +} csi_venc_rc_mode_e; + +typedef struct csi_venc_rc_property { + csi_venc_rc_mode_e rc_mode; + union { + csi_venc_h264_cbr_s h264_cbr; + csi_venc_h264_vbr_s h264_vbr; + csi_venc_h264_avbr_s h264_avbr; + csi_venc_h264_fixqp_s h264_fixqp; + + csi_venc_h265_cbr_s h265_cbr; + csi_venc_h265_vbr_s h265_vbr; + csi_venc_h265_avbr_s h265_avbr; + csi_venc_h265_fixqp_s h265_fixqp; + + csi_venc_mjpeg_cbr_s mjpeg_cbr; + csi_venc_mjpeg_vbr_s mjpeg_vbr; + csi_venc_mjpeg_fixqp_s mjpeg_fixqp; + }; +} csi_venc_rc_property_s; + +#endif /* __CSI_VENC_PROPERTY_H__ */ diff --git a/th1520/hardware/camera/include/ebase/builtins.h b/th1520/hardware/camera/include/ebase/builtins.h new file mode 100755 index 0000000000000000000000000000000000000000..a58aaf20cf21ca656c88798becaf8fedec7e5edc --- /dev/null +++ b/th1520/hardware/camera/include/ebase/builtins.h @@ -0,0 +1,46 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +/** + * @file builtins.h + * + * This file defines some macros for standard library functions. Usually we + * dont link against glibc, so we use the builtins. Standard library function + * calls are only permitted in debug mode. + * + *****************************************************************************/ +#ifndef BUILTINS_H_ +#define BUILTINS_H_ + +#include "types.h" + +#if defined(__GNUC__) + #include + + void* __builtin_memset( void* s, int32_t c, size_t n ); + #define MEMSET( TARGET, C, LEN) __builtin_memset(TARGET, C, LEN) + + void* __builtin_memcpy( void* s1, const void* s2, size_t n); + #define MEMCPY( DST, SRC, LEN) __builtin_memcpy(DST,SRC,LEN) +#else + #include + #define MEMSET( TARGET, C, LEN) memset(TARGET,C,LEN) + #define MEMCPY( DST, SRC, LEN) memcpy(DST,SRC,LEN) +#endif + +#define WIPEOBJ( TARGET ) MEMSET( &TARGET, 0, sizeof( TARGET ) ) + +#endif /*BUILTINS_H_*/ diff --git a/th1520/hardware/camera/include/ebase/dct_assert.h b/th1520/hardware/camera/include/ebase/dct_assert.h new file mode 100755 index 0000000000000000000000000000000000000000..dab241424a5b432e63f6ea7ef70f4fd9443a25fb --- /dev/null +++ b/th1520/hardware/camera/include/ebase/dct_assert.h @@ -0,0 +1,94 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +/** + * @file dct_assert.h + * + * This file defines the API for the assertion facility of the embedded lib. + * + *****************************************************************************/ +/*****************************************************************************/ +/** + * @defgroup module_assert Assert macros + * + * @brief The assertion system used by Dream Chip. + * + * Example use of the assert system: + * + * + * - In your source file just use the macro + * + * @code + * void foo( uint8_t* pData, size_t size) + * { + * DCT_ASSERT(pData != NULL); + * DCT_ASSERT(size > 0); + * } + * @endcode + * + * @{ + * + *****************************************************************************/ +#ifndef ASSERT_H_ +#define ASSERT_H_ +#include + +/** + * @brief The type of the assert handler. @see assert_handler + * + *****************************************************************************/ +typedef void (*ASSERT_HANDLER)(void) __attribute__((noreturn)); + + +/** + * The assert handler is a function that is called in case an + * assertion failed. If no handler is registered, which is the + * default, exit() is called. + * + *****************************************************************************/ +extern ASSERT_HANDLER assert_handler; + +#if defined(ENABLE_ASSERT) || !defined(NDEBUG) + /** + * Dump information on stderr and exit. + * + * @param file Filename where assertion occured. + * @param line Linenumber where assertion occured. + * + *****************************************************************************/ +#ifdef __cplusplus + extern "C" +#endif + void exit_(const char *file, int line) __attribute__((noreturn)); + + /** + * The assert macro. + * + * @param exp Expression which assumed to be true. + * + *****************************************************************************/ + #define DCT_ASSERT(exp) do { if (!(exp)){ static CHAR filename[] = __FILE__; exit_(&filename[0], __LINE__);}}while(0) +#else + #define DCT_ASSERT(exp)\ + do {\ + if ((exp)) {\ + }\ + } while(0) +#endif + +/* @} module_tracer*/ + +#endif /*ASSERT_H_*/ diff --git a/th1520/hardware/camera/include/ebase/ext_types.h b/th1520/hardware/camera/include/ebase/ext_types.h new file mode 100755 index 0000000000000000000000000000000000000000..f2fb9f836b738340bcf1a0f7682c99eeecfa847e --- /dev/null +++ b/th1520/hardware/camera/include/ebase/ext_types.h @@ -0,0 +1,10 @@ + + +#ifndef __EXT_TYPES_H__ +#define __EXT_TYPES_H__ + +typedef void (*GFunc) (void* data, void* user_data); +typedef int32_t (*GCompareFunc) (const void* a, const void* b); +typedef int32_t (*GCompareDataFunc) (const void* a, const void* b, void* user_data); + +#endif /* __EXT_TYPES_H__ */ diff --git a/th1520/hardware/camera/include/ebase/linux_compat.h b/th1520/hardware/camera/include/ebase/linux_compat.h new file mode 100755 index 0000000000000000000000000000000000000000..2f48a39dbaf9cb9b1ceb8e7b44755b322d60c6b6 --- /dev/null +++ b/th1520/hardware/camera/include/ebase/linux_compat.h @@ -0,0 +1,42 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +/** + * @file linux_compat.h + * + * @brief + * Linux compatibility layer. + * + *****************************************************************************/ +#ifndef LINUX_COMPAT_H_ +#define LINUX_COMPAT_H_ + +/***** macro definitions *****************************************************/ + +# ifdef __cplusplus +# include +# include +# else +# include +# include +# endif + +/***** public type definitions ***********************************************/ + +/***** public function prototypes ********************************************/ + +#endif /* LINUX_COMPAT_H_ */ + diff --git a/th1520/hardware/camera/include/ebase/list.h b/th1520/hardware/camera/include/ebase/list.h new file mode 100755 index 0000000000000000000000000000000000000000..c5fe2d457623a3871046d6eebfcbcedb136605d9 --- /dev/null +++ b/th1520/hardware/camera/include/ebase/list.h @@ -0,0 +1,357 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +/** + * @file list.h + * + * @brief + * Extended data types: Linked list + * + *****************************************************************************/ +/** + * @defgroup module_ext_list Double Linked List + * + * @brief This module implements a "Double Linked List" + * + * @{ + * + *****************************************************************************/ +#ifndef __LIST_H__ +#define __LIST_H__ + +#include "types.h" +#include "ext_types.h" + + +typedef struct _GList GList; + +/** + * @brief Structure that represents an element in the list. + */ +struct _GList { + void* data; /**< Pointer to object using the list for */ + GList *next; /**< Pointer to next element in list */ + GList *prev; /**< Pointer to prev element in list */ +}; + + +#define listNext(list) ((list) ? (((GList *) (list))->next) : NULL) +#define listPrevious(list) ((list) ? (((GList *) (list))->prev) : NULL) + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +GList* listAlloc(void); + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +GList* listAppend(GList* list, void* data); + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +GList* listPrepend(GList* list, void* data); + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +void listFree(GList* list); + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +void listFree1(GList* list); + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +GList* listCopy(GList* list); + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +uint32_t listLength(GList* list); + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +int32_t listIndex(GList* list, const void* data); + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +GList* listNth(GList * list, uint32_t n); + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +void* listNthData(GList* list, uint32_t n); + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +GList* listLast(GList* list); + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +GList* listConcat(GList* list1, GList* list2); + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +void listForeach(GList* list, GFunc func, void* user_data); + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +GList* listFirst(GList* list); + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +GList* listFind(GList* list,const void* data); + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +GList* listFindCustom(GList* list,const void* data, GCompareFunc func); + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +GList* listRemove(GList* list,const void* data); + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +GList* listReverse(GList* list); + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +GList* listRemoveLink(GList* list, GList* link); + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +GList* listDeleteLink(GList* list, GList* link); + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +GList* listInsertSorted(GList* list, void* data, GCompareFunc func); + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +GList* listInsertBefore(GList* list, GList* sibling, void* data); + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +GList* listSort(GList* sort, GCompareFunc func); + +/* @} module_ext_list */ + +#endif /* __LIST_H__ */ + + diff --git a/th1520/hardware/camera/include/ebase/queue.h b/th1520/hardware/camera/include/ebase/queue.h new file mode 100755 index 0000000000000000000000000000000000000000..19e659403c59351ee148f2fe296b5c24c7df0d3b --- /dev/null +++ b/th1520/hardware/camera/include/ebase/queue.h @@ -0,0 +1,112 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +/** + * @file queue.h + * + * @brief + * Extended data types: Queue + * + *****************************************************************************/ +/** + * @defgroup module_ext_queue Queue + * + * @{ + * + *****************************************************************************/ +#ifndef __QUEUE_H__ +#define __QUEUE_H__ + +#include "types.h" +#include "ext_types.h" +#include "list.h" + + +/** + * @brief Structure that represents an element in the queue. + */ +typedef struct +{ + GList *head; /**< Head element of queue */ + GList *tail; /**< Tail element of queue */ + uint32_t length; /**< Length of queue */ +} GQueue; + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +void* queuePopHead(GQueue* queue); + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +void queuePushHead(GQueue* queue, void* data); + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +bool_t queueIsEmpty(GQueue* queue); + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +GQueue* queueNew(void); + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +void queueFree(GQueue* queue); + +/* @} module_ext_queue */ + +#endif /* __QUEUE_H__ */ diff --git a/th1520/hardware/camera/include/ebase/slist.h b/th1520/hardware/camera/include/ebase/slist.h new file mode 100755 index 0000000000000000000000000000000000000000..61d4208f58e3e95847f93ed9d3f26c11a2cb9599 --- /dev/null +++ b/th1520/hardware/camera/include/ebase/slist.h @@ -0,0 +1,353 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +/** + * @file slist.h + * + * @brief + * Extended data types: Linked list + * + *****************************************************************************/ +/** + * @defgroup module_ext_slist Linked List + * + * @brief This module implements a "Single Linked List". + * + * @{ + * + *****************************************************************************/ +#ifndef __SLIST_H__ +#define __SLIST_H__ + +#include "types.h" +#include "ext_types.h" + + +typedef struct _GSList GSList; + +/** + * @brief Structure that represents an element in the list. + */ +struct _GSList { + void* data; /**< Pointer to object using the list for */ + GSList *next; /**< Pointer to next element in list */ +}; + + +#define slistNext(slist) ((slist) ? (((GSList *) (slist))->next) : NULL) + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +GSList* slistAlloc(void); + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +GSList* slistAppend(GSList* list, void* data); + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +GSList* slistPrepend(GSList* list, void* data); + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +void slistFree(GSList* list); + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +void slistFree1(GSList* list); + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +GSList* slistCopy(GSList* list); + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +GSList* slistConcat(GSList* list1, GSList* list2); + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +void slistForeach(GSList* list, GFunc func, void* user_data); + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +GSList* slistLast(GSList* list); + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +GSList* slistFind(GSList* list, const void* data); + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +GSList* slistFindCustom(GSList* list, const void* data, GCompareFunc func); + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +GSList* slistRemove(GSList* list, const void* data); + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +GSList* slistRemoveAll(GSList* list, const void* data); + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +GSList* slistReverse(GSList* list); + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +uint32_t slistLength(GSList* list); + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +GSList* slistRemoveLink(GSList* list, GSList* link); + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +GSList* slistDeleteLink(GSList* list, GSList* link); + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +GSList* slistInsertSorted(GSList* list, void* data, GCompareFunc func); + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +GSList* slistInsertBefore(GSList* list, GSList* sibling, void* data); + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +GSList* slistSort(GSList* list, GCompareFunc func); + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +int32_t slistIndex(GSList* list, const void* data); + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +GSList *slistNth(GSList* list, uint32_t n); + + +/*****************************************************************************/ +/** + * @brief + * + * @param + * + * @return + * @retval + * + *****************************************************************************/ +void* slistNthData(GSList* list, uint32_t n); + +/* @} module_ext_slist */ + +#endif /* __SLIST_H__ */ diff --git a/th1520/hardware/camera/include/ebase/sort.frag.h b/th1520/hardware/camera/include/ebase/sort.frag.h new file mode 100755 index 0000000000000000000000000000000000000000..85b023452f13217e7510fbbc5473876c03c12d6f --- /dev/null +++ b/th1520/hardware/camera/include/ebase/sort.frag.h @@ -0,0 +1,187 @@ +/* + * sort.frag.h: Common implementation of linked-list sorting + * + * Author: + * Raja R Harinath (rharinath@novell.com) + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * (C) 2006 Novell, Inc. + */ +#ifndef __SORT_FRAG_H__ +#define __SORT_FRAG_H__ + +/* + * This code requires a typedef named 'list_node' for the list node. It + * is assumed that the list type is the type of a pointer to a list + * node, and that the node has a field named 'next' that implements to + * the linked list. No additional invariant is maintained (e.g. the + * 'prev' pointer of a doubly-linked list node is _not_ updated). Any + * invariant would require a post-processing pass to fix matters if + * necessary. + */ +typedef list_node *digit; + +/* + * The maximum possible depth of the merge tree + * = ceiling (log2 (maximum number of list nodes)) + * = ceiling (log2 (maximum possible memory size/size of each list node)) + * = number of bits in 'size_t' - floor (log2 (sizeof digit)) + * Also, each list in sort_info is at least 2 nodes long: we can reduce the depth by 1 + */ +#define FLOOR_LOG2(x) (((x)>=2) + ((x)>=4) + ((x)>=8) + ((x)>=16) + ((x)>=32) + ((x)>=64) + ((x)>=128)) +#define MAX_RANKS ((sizeof (size_t) * 8) - FLOOR_LOG2(sizeof (list_node)) - 1) + +struct sort_info +{ + int min_rank, n_ranks; + GCompareFunc func; + + /* Invariant: ranks[i] == NULL || length(ranks[i]) >= 2**(i+1) */ + list_node *ranks [MAX_RANKS]; /* ~ 128 bytes on 32bit, ~ 512 bytes on 64bit */ +}; + +static inline void +init_sort_info (struct sort_info *si, GCompareFunc func) +{ + si->min_rank = si->n_ranks = 0; + si->func = func; + /* we don't need to initialize si->ranks, since we never lookup past si->n_ranks. */ +} + +static inline list_node * +merge_lists (list_node *first, list_node *second, GCompareFunc func) +{ + /* merge the two lists */ + list_node *list = NULL; + list_node **pos = &list; + while (first && second) { + if (func (first->data, second->data) > 0) { + *pos = second; + second = second->next; + } else { + *pos = first; + first = first->next; + } + pos = &((*pos)->next); + } + *pos = first ? first : second; + return list; +} + +/* Pre-condition: upto <= si->n_ranks, list == NULL || length(list) == 1 */ +static inline list_node * +sweep_up (struct sort_info *si, list_node *list, int upto) +{ + int i; + for (i = si->min_rank; i < upto; ++i) { + list = merge_lists (si->ranks [i], list, si->func); + si->ranks [i] = NULL; + } + return list; +} + +/* + * The 'ranks' array essentially captures the recursion stack of a mergesort. + * The merge tree is built in a bottom-up manner. The control loop for + * updating the 'ranks' array is analogous to incrementing a binary integer, + * and the O(n) time for counting upto n translates to O(n) merges when + * inserting rank-0 lists. When we plug in the sizes of the lists involved in + * those merges, we get the O(n log n) time for the sort. + * + * Inserting higher-ranked lists reduce the height of the merge tree, and also + * eliminate a lot of redundant comparisons when merging two lists that would've + * been part of the same run. Adding a rank-i list is analogous to incrementing + * a binary integer by 2**i in one operation, thus sharing a similar speedup. + * + * When inserting higher-ranked lists, we choose to clear out the lower ranks + * in the interests of keeping the sort stable, but this makes analysis harder. + * Note that clearing the lower-ranked lists is O(length(list))-- thus it + * shouldn't affect the O(n log n) behaviour. IOW, inserting one rank-i list + * is equivalent to inserting 2**i rank-0 lists, thus even if we do i additional + * merges in the clearing-out (taking at most 2**i time) we are still fine. + */ + +#define stringify2(x) #x +#define stringify(x) stringify2(x) + +/* Pre-condition: 2**(rank+1) <= length(list) < 2**(rank+2) (therefore: length(list) >= 2) */ +static inline void +insert_list (struct sort_info *si, list_node* list, int rank) +{ + int32_t i; + + if (rank > si->n_ranks) { + if (rank > (int32_t)MAX_RANKS) { + rank = MAX_RANKS; + } + list = merge_lists (sweep_up (si, NULL, si->n_ranks), list, si->func); + for (i = si->n_ranks; i < rank; ++i) + si->ranks [i] = NULL; + } else { + if (rank) + list = merge_lists (sweep_up (si, NULL, rank), list, si->func); + for (i = rank; i < si->n_ranks && si->ranks [i]; ++i) { + list = merge_lists (si->ranks [i], list, si->func); + si->ranks [i] = NULL; + } + } + + if (i == MAX_RANKS) /* Will _never_ happen: so we can just devolve into quadratic ;-) */ + --i; + if (i >= si->n_ranks) + si->n_ranks = i + 1; + si->min_rank = i; + si->ranks [i] = list; +} + +#undef stringify2 +#undef stringify +#undef MAX_RANKS +#undef FLOOR_LOG2 + +/* A non-recursive mergesort */ +static inline digit +do_sort (list_node* list, GCompareFunc func) +{ + struct sort_info si; + + init_sort_info (&si, func); + + while (list && list->next) { + list_node* next = list->next; + list_node* tail = next->next; + + if (func (list->data, next->data) > 0) { + next->next = list; + next = list; + list = list->next; + } + next->next = NULL; + + insert_list (&si, list, 0); + + list = tail; + } + + return sweep_up (&si, list, si.n_ranks); +} + +#endif /* __SORT_FRAG_H__ */ diff --git a/th1520/hardware/camera/include/ebase/trace.h b/th1520/hardware/camera/include/ebase/trace.h new file mode 100755 index 0000000000000000000000000000000000000000..e1bd70bbedcc6b82b5fea35eef86e6738f6730c0 --- /dev/null +++ b/th1520/hardware/camera/include/ebase/trace.h @@ -0,0 +1,286 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +/** + * @file trace.h + * + * This file defines the API for the tracing facility of the embedded lib. + * + * WARNING: Due to use of variadic macros which were introduced into C in + * c99 this can not be used with c++ code in pedantic mode. + * + *****************************************************************************/ +/** + * @defgroup module_tracer Trace System + * + * @brief The trace system used by Dream Chip. + * + * Example use of the trace system: + * + * - Create a file like tracer_cfg.c + * + * @code + * CREATE_TRACER(MODULE_INFO, "ModInfo: ", INFO, 1); + * CREATE_TRACER(MODULE_WARNING, "ModWarn: ", WARNING, 1); + * CREATE_TRACER(MODULE_ERROR, "ModError: ", ERROR, 1); + * @endcode + * + * - In your source file import the tracer you like to use + * + * @code + * USE_TRACER(MODULE_INFO); + * USE_TRACER(MODULE_WARNING); + * USE_TRACER(MODULE_ERROR); + * + * void foo() + * { + * TRACE(MODULE_INFO, "enter %s\n", __FUNCTION); + * TRACE(MODULE_INFO, "leave %s\n", __FUNCTION); + * } + * @endcode + * + * @{ + * + *****************************************************************************/ +#ifndef TRACE_H_ +#define TRACE_H_ + +/* must be defined even for release */ +#include "linux_compat.h" +#include "types.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + +#ifdef ERROR +#undef ERROR +#endif + +enum +{ + TRACE_OFF = 0x00, + INFO = 0x01, + DBG = 0x02, + WARNING = 0x04, + ERROR = 0x08, + MAX_LEVEL = (0x01U | 0x02U | 0x04U | 0x08U) +}; + +typedef struct tracer_s +{ + FILE* fp; + char_t* prefix; + int16_t level; + int8_t enabled; + int8_t linked; + char_t* name; + struct tracer_s* next; +} Tracer; + +#ifndef NDEBUG + int getTraceLevel(void); + void setTraceLevel(int); + void enableTracer(Tracer *); + void disableTracer(Tracer *); + void setTracerFile(Tracer *, FILE *); + void flushTracer(const Tracer *); + void trace(Tracer*, const CHAR*, ...); + Tracer* getTracerList(void); + +#if !defined(USE_SDRAM_FOR_TRACE) +#define TRACER_DATA +#else +#define TRACER_DATA DRAM_DATA +#endif + /** + * + * This macro creates a Tracer. Every Tracer has its own output like + * stdout or a file and a trace level associated. A tracer may be + * enabled and disabled. If the global trace level is lower than the + * Tracers level, than output send to an enabled tracer is output to + * its file or stdout. If eg the global trace level is INFO and the + * Tracer has the level WARNING, its output is active. If the global + * trace level were ERROR instead, output of the tracer were + * suppressed. + * + * \warning THIS MACRO MUST BE USED IN GLOBAL SCOPE. + * + * + * @param name Name of the tracer. + * @param arg_prefix All output of this tracer is preceeded by + * . + * @param arg_level Initial trace level. + * @param arg_enabled Decide wether the tracer starts in enabled state. + * + * @return No return value. + * + *****************************************************************************/ +#define CREATE_TRACER(name, arg_prefix, arg_level, arg_enabled) \ + CHAR tracerName##name[] TRACER_DATA = #name; \ + CHAR tracerPrefix##name[] TRACER_DATA = arg_prefix; \ + Tracer instance__##name TRACER_DATA = \ + { \ + 0, \ + &tracerPrefix##name[0], \ + arg_level, \ + arg_enabled, \ + 0, \ + &tracerName##name[0], \ + NULL \ + }; \ + Tracer *name = &instance__##name + + /** + * + * If tracer was created in another compile unit this macro + * makes the named tracer available in the current unit. + * + * @param ... First parameter is name of tracer.Use variable argument + * list like printf. + * @return No return value. + * + *****************************************************************************/ +#define USE_TRACER(name)\ + extern Tracer *name + + /** + * + * Send output to a tracer. + * + * @param ... First parameter is name of tracer.Use variable argument + * list like printf. + * @return No return value. + * + *****************************************************************************/ +#define TRACE(...) trace(__VA_ARGS__) + + /** + * + * Send output to a tracer, If DEBUG_LEVEL if high enough + * + * @param ... First parameter is the required DEBUG_LEVEL to get the + * output, second parameter is name of tracer. Use variable argument + * list like printf. + * @return No return value. + * + *****************************************************************************/ +#if defined (DEBUG_LEVEL) +#define DL_TRACE(level, ...) if (DEBUG_LEVEL >= level) { trace(__VA_ARGS__); } +#else +#define DL_TRACE(level, ...) (void)0 +#endif + + /** + * + * Enable a tracer. + * + * @param T name of tracer. + * @return No return value. + * + *****************************************************************************/ +#define ENABLE_TRACER(T) enableTracer(T) + + /** + * + * Disable a tracer. + * + * @param T name of tracer. + * @return No return value. + * + *****************************************************************************/ +#define DISABLE_TRACER(T) disableTracer(T) + + /** + * + * Set the global trace level. + * + * @param L Trace level. + * @return No return value. + * + *****************************************************************************/ +#define SET_TRACE_LEVEL(L) setTraceLevel(L) + + /** + * + * Init the global trace level. + * + * @param L Trace level. + * @return No return value. + * + *****************************************************************************/ +#define INIT_TRACE_LEVEL() initTraceLevel() + + /** + * + * Redirect a tracer to a file. + * + * @param T name of tracer. + * @param F A valid FILE*. + * + * @return No return value. + * + *****************************************************************************/ +#define SET_TRACER_FILE(T, F) setTracerFile(T, F) + + /** + * + * Flush a tracer. + * + * @param T name of tracer. + * + * @return No return value. + * + *****************************************************************************/ +#define FLUSH_TRACER(T) flushTracer(T) +#define GET_TRACE_LEVEL() getTraceLevel() +#define GET_TRACER_LIST() getTracerList() + +/* this macro can be used to define statements or variables which are only + * active if NDEBUG is not defined: + */ +#define IF_TRACE_ON(x) x +#else + /* The macro for CREATE_TRACER can not just expand to nothing. Otherwise we + * would have a single semicolon which C does not allow outside of function + * bodies. For this reason we expand to this extern declaration. As the + * external variable is never used linking should not be a problem. */ +#define CREATE_TRACER(name, arg_prefix, arg_level, arg_enabled) extern int32_t name +#define USE_TRACER(name) extern int32_t use##name +#define TRACE(...) (void)0 +#define DL_TRACE(level, ...) (void)0 +#define ENABLE_TRACER(T) (void)0 +#define DISABLE_TRACER(T) (void)0 +#define SET_TRACE_LEVEL(L) (void)0 +#define SET_TRACER_FILE(T, F) (void)0 +#define FLUSH_TRACER(T) (void)0 +#define GET_TRACE_LEVEL() (void)0 +#define GET_TRACER_LIST() (void)0 + +/* this macro can be used to define statements or variables which are only + * active if NDEBUG is not defined: + */ +#define IF_TRACE_ON(x) +#endif /* NDEBUG */ + +#ifdef __cplusplus +} +#endif + +/* @} module_tracer*/ + +#endif /*TRACE_H_*/ diff --git a/th1520/hardware/camera/include/ebase/types.h b/th1520/hardware/camera/include/ebase/types.h new file mode 100755 index 0000000000000000000000000000000000000000..b3a4eb980cdb5c4f10b19913962be3201d364cf1 --- /dev/null +++ b/th1520/hardware/camera/include/ebase/types.h @@ -0,0 +1,110 @@ +/******************************************************************************\ +|* Copyright 2010, Dream Chip Technologies GmbH. used with permission by *| +|* VeriSilicon. *| +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +/** + * @file types.h + * + * This file defines some basic type names like the int types. + * + *****************************************************************************/ +#ifndef TYPES_H_ +#define TYPES_H_ + +#include "linux_compat.h" +#include + +#ifndef __cplusplus + /* Only C99 compilers know stdbool */ + #if (__STDC_VERSION__ >= 199901L) || defined(CONFIG_HAVE_STDBOOL) + #include + #else + #define bool unsigned int + #define true (1) + #define false (0) + #endif +#endif + + +#if defined(__GNUC__) + #if !defined(INLINE) + #define INLINE static inline + #endif +#endif + +#include + +#if defined(__cplusplus) || ((__STDC_VERSION__ >= 199901L)) + #include +#else + + /* We only check for __int8_t_defined */ + /* as this is all that gcc defines. */ + #if !defined(__int8_t_defined) + + /* In the rare cases that a system does not define + * __int8_t_defined (Android p.e.) we check for the + * include guard of the stdint header */ + #if !defined(_STDINT_H) + + typedef unsigned char uint8_t; + typedef signed char int8_t; + typedef unsigned short uint16_t; + typedef short int16_t; + typedef unsigned int uint32_t; + typedef int int32_t; + + #if !defined(_MSC_VER) + typedef signed long long int64_t; + typedef unsigned long long uint64_t; + #else + typedef signed __int64 int64_t; + typedef unsigned __int64 uint64_t; + #endif /* #if !defined(_MSC_VER) */ + + typedef unsigned int uint_least32_t; + typedef int int_least32_t; + typedef unsigned int uint_least8_t; + typedef unsigned int uint; + typedef unsigned char uchar; + + #endif /* #if !defined(_STDINT_H) */ + #endif /* #if !defined(__int8_t_defined) */ +#endif /* #if defined(__cplusplus) || ((__STDC_VERSION__ >= 199901L)) */ + +#ifndef NULL + #define NULL ((void*)0) +#endif + +/* make lint happy: */ +typedef char CHAR; +typedef char char_t; /* like suggested in Misra 6.3 (P. 29) */ + +typedef enum +{ + BOOL_FALSE = 0, + BOOL_TRUE = (!BOOL_FALSE) +} bool_t; + + +#define UNUSED_PARAM(unref_param) ((void) (unref_param)); +#define CAST_POINTER_TO_UINT32( pointer ) ((uint32_t) (pointer)) +#define CAST_POINTER_TO_INT32( pointer ) ((int32_t) (pointer)) +#define CAST_UINT32_TO_POINTER( pointerType, value ) ((pointerType)(value)) +#define CAST_INT32_TO_POINTER( value ) ((int32_t*)(value)) +#define N_ELEMENTS(s) (sizeof(s) / sizeof ((s) [0])) +#define ABS(a) ((a) > 0 ? (a) : -(a)) + +#endif /*TYPES_H_*/ diff --git a/th1520/hardware/camera/include/fpga/altera_fpga.h b/th1520/hardware/camera/include/fpga/altera_fpga.h new file mode 100755 index 0000000000000000000000000000000000000000..23758280c5016b25803f55f93bf19d0d3c79fb0d --- /dev/null +++ b/th1520/hardware/camera/include/fpga/altera_fpga.h @@ -0,0 +1,304 @@ +/*******************************************************************************/ +/*! This is an unpublished work, the copyright in which vests in sci-worx GmbH. +* The information contained herein is the property of sci-worx GmbH and is +* supplied without liability for errors or omissions. No part may be repro- +* duced or used except as authorized by contract or other written permission. +* Copyright(c) sci-worx GmbH, 2007. All rights reserved. +*/ +/******************************************************************************/ +/*! Module : Altera driver +* +* Hierarchy : +* +* Purpose : User-level driver for the Altera FPGA board +* +* Creator : Martin Fiedler +*/ +/******************************************************************************/ +/** + * @file altera_fpga.h + * @brief User-level driver for the Altera FPGA board + */ + +#ifndef _ALTERA_FPGA_H +#define _ALTERA_FPGA_H + +#include + + +#ifdef __cplusplus +extern "C" { +#endif + +/** Register access mode switch. + * If set to zero (0), each register access will be done with a "DoMem" ioctl() + * call to the driver. + * If set to one (1), all registers will be memory-mapped and accessed directly. */ +#define FPGA_USE_MMAP 0 + +#define FPGA_BOARD_NUM 0 /**< board (DMA engine) number */ + +#define FPGA_REG_BAR_NUM 1 /**< PCI BAR for register access */ + +#define FPGA_REGISTER_SPACE_SIZE (512*1024) /**< size of register BAR */ + +// these mainly influence byte reordering stuff in AlteraFPGABoard_DMARead/Write functions +// use AlteraFPGABoard_RawDMARead/Write functions to avoid byte reordering & stuff +#define FPGA_DATA_ITEM_SIZE 8 +#define FPGA_DATA_BLOCK_SIZE 8 +#define FPGA_DATA_BLOCK_STRIDE 8 + +#define FPGA_DMA_ALIGNMENT (4*1024) /**< DMA helper buffer alignment (*must* be a power of two!); used by AlteraFPGABoard_DMARead/Write functions only */ +#define FPGA_DMA_SIZE_ALIGNMENT 32 /**< DMA transfer size alignment (*must* be a power of two!); used by AlteraFPGABoard_DMARead/Write functions only */ + +#define FPGA_DMA_BLOCK_SIZE (1024*1024) /**< DMA max block size */ + +#define FPGA_IRQ_POLL_INTERVAL 1000 //20 //50 //20 /**< interrupt poll interval in microseconds */ +//#define FPGA_IRQ_POLL_INTERVAL 30000 //50 //20 /**< interrupt poll interval in microseconds */ + +/** Address adjustment macro. + * Internally, the driver operates with DWORD (32-bit aligned) adresses. On the + * FPGA, however, adresses are 128-bit aligned, creating a gap of 3 unused DWORDs + * between each consecutive pair of registers. To compensate for that, register + * addresses need to be shifted two bits to the left before using them as FPGA + * (PCI BAR) addresses. */ +#if 0 +#define FPGA_REG_ADDRESS_MOD(x) ((x) << 2) +#else +#define FPGA_REG_ADDRESS_MOD(x) (x) +#endif + + +/* PLL config type. */ +typedef struct _AlteraFPGAPLLConfig { + uint32_t Fin; + uint16_t M; + uint16_t N; + uint16_t C[10]; +} AlteraFPGAPLLConfig_t; + +/* PLL type. */ +typedef struct _AlteraFPGAPLL { + uint32_t reg_offset; + uint32_t config_pll_reset_mask; + uint32_t config_reset_mask; +} AlteraFPGAPLL_t; + +/* Predefined PLL descriptions */ +extern const AlteraFPGAPLL_t AlteraFPGAPLL_1; //vdu +extern const AlteraFPGAPLL_t AlteraFPGAPLL_2; //msvd, cam1 etc + +#if FPGA_USE_MMAP + extern volatile uint32_t* fpga_regs_mmap; /**< memory-mapped registers */ +#endif + +/** error codes */ +#define FPGA_RES_OK 0 /**< no error */ +#define FPGA_RES_NODEV 1 /**< device file not open / could not open device */ +#define FPGA_RES_FAIL 2 /**< general HW failure / wrong or missing device */ +#define FPGA_RES_NODMA 3 /**< no DMA engines available */ +#define FPGA_RES_INVAL 4 /**< operation not allowed */ + +#define FPGA_READ_ERROR 0xDEADBEEF /**< returned from ReadReg in case of failure */ + +/** AlteraFPGABoard_Open() + * @brief Open and initialize the FPGA board. + * @retval FPGA_RES_OK operation successful + * @retval FPGA_RES_INVAL board already opened + * @retval FPGA_RES_NODEV cannot open device (driver not loaded or wrong permissions) + * @retval FPGA_RES_FAIL hardware failure or unexpected hardware behavior + * @retval FPGA_RES_NODMA operation successful, but no DMA engines found + * (register access is possible, but DMA access is not) */ +uint32_t AlteraFPGABoard_Open(HalHandle_t HalHandle); + + +void AlteraFPGABoard_Reset(HalHandle_t HalHandle); + +/** AlteraFPGABoard_Close() + * @brief Uninitialize and close the FPGA board. + * @retval FPGA_RES_OK operation successful + * @retval FPGA_RES_NODEV FPGA board not initialized (need to call AlteraFPGABoard_Open() first) */ +uint32_t AlteraFPGABoard_Close(HalHandle_t HalHandle); + + +/** AlteraFPGABoard_ReadBAR() + * @brief Read a 32-bit DWORD from one of the PCI BARs on the FPGA. + * @param bar the number of the PCI BAR to access + * @param address the address (128-bit aligned) to read from + * @return the value read from the register, or FPGA_READ_ERROR if any error occured */ +uint32_t AlteraFPGABoard_ReadBAR(int32_t isp_fd, uint32_t address); + + +/** AlteraFPGABoard_WriteBAR() + * @brief Write a 32-bit DWORD to one of the PCI BARs on the FPGA. + * @param bar the number of the PCI BAR to access + * @param address the address (128-bit aligned) to write to + * @param data the data word to write + * @retval FPGA_RES_OK operation successful + * @retval FPGA_RES_NODEV FPGA board not initialized (need to call AlteraFPGABoard_Open() first) + * @retval FPGA_RES_FAIL could not write value */ +uint32_t AlteraFPGABoard_WriteBAR(int32_t isp_fd, uint32_t address, uint32_t data); + + +/** AlteraFPGABoard_ReadReg() + * @brief Read a 32-bit DWORD from one of the registers on the predefined PCI BAR. + * @param address the address (32-bit aligned) to read from + * @return the value read from the register, or FPGA_READ_ERROR if any error occured */ +INLINE uint32_t AlteraFPGABoard_ReadReg(int32_t isp_fd, uint32_t address) { +#if FPGA_USE_MMAP + return fpga_regs_mmap[FPGA_REG_ADDRESS_MOD(address) >> 2]; +#else + return AlteraFPGABoard_ReadBAR(isp_fd, FPGA_REG_ADDRESS_MOD(address)); +#endif +} + + +/** AlteraFPGABoard_WriteReg() + * @brief Write a 32-bit DWORD to one of the registers on the predefined PCI BAR. + * @param address the address (32-bit aligned) to write to + * @param data the data word to write + * @retval FPGA_RES_OK operation successful + * @retval FPGA_RES_NODEV FPGA board not initialized (need to call AlteraFPGABoard_Open() first) + * @retval FPGA_RES_FAIL could not write value */ +INLINE uint32_t AlteraFPGABoard_WriteReg(int32_t isp_fd, uint32_t address, uint32_t data) { +#if FPGA_USE_MMAP + fpga_regs_mmap[FPGA_REG_ADDRESS_MOD(address) >> 2] = data; + return FPGA_RES_OK; +#else + return AlteraFPGABoard_WriteBAR(isp_fd, FPGA_REG_ADDRESS_MOD(address), data); +#endif +} + +/** AlteraFPGABoard_ReadMis() + * @brief Read a 32-bit DWORD from one of the mis array store in kernel. + * @param pAry pointer to the irq mis src and val array. + * @return the value read from the mis, or RET_FAILURE if any error occured */ +uint32_t AlteraFPGABoard_ReadMis(int32_t isp_fd, uint64_t* pAry); + +/** AlteraFPGABoard_RawDMARead() + * @brief Transfer a block of memory from the FPGA board's memory into host memory, + * bypassing the 256-to-64-bit memory translation. + * @param data host memory pointer to write data to + * @param address board memory address (256-bit aligned) to read data from + * @param size transfer size in bytes (must be a multiple of 32 bytes) + * @retval FPGA_RES_OK operation successful + * @retval FPGA_RES_NODEV FPGA board not initialized (need to call AlteraFPGABoard_Open() first) + * @retval FPGA_RES_FAIL transfer failed + * @retval FPGA_RES_NODMA DMA not available on this board */ +uint32_t AlteraFPGABoard_RawDMARead(HalHandle_t HalHandle, void* data, uint32_t address, uint32_t size); + + + +/** AlteraFPGABoard_RawDMAWrite() + * @brief Transfer a block of memory from host memory into the FPGA board's memory, + * bypassing the 256-to-64-bit memory translation. + * @param data host memory pointer to read data from + * @param address board memory address (256-bit aligned) to write data to + * @param size transfer size in bytes (must be a multiple of 32 bytes) + * @retval FPGA_RES_OK operation successful + * @retval FPGA_RES_NODEV FPGA board not initialized (need to call AlteraFPGABoard_Open() first) + * @retval FPGA_RES_FAIL transfer failed + * @retval FPGA_RES_NODMA DMA not available on this board */ +uint32_t AlteraFPGABoard_RawDMAWrite(HalHandle_t HalHandle, void* data, uint32_t address, uint32_t size); + + +/** AlteraFPGABoard_DMARead() + * @brief Transfer a block of memory from the FPGA board's memory into host memory + * with 256-to-64-bit memory translation. + * @param data host memory pointer to write data to + * @param address board memory address (64-bit aligned, MSVD address space) to read data from + * @param size transfer size in bytes (must be a multiple of 8 bytes) + * @retval FPGA_RES_OK operation successful + * @retval FPGA_RES_NODEV FPGA board not initialized (need to call AlteraFPGABoard_Open() first) + * @retval FPGA_RES_FAIL transfer failed + * @retval FPGA_RES_NODMA DMA not available on this board */ +uint32_t AlteraFPGABoard_DMARead(HalHandle_t HalHandle, uint8_t* data, uint32_t address, uint32_t size); + + +/** AlteraFPGABoard_DMAWrite() + * @brief Transfer a block of memory from host memory into the FPGA board's memory + * with 256-to-64-bit memory translation. + * @param data host memory pointer to read data from + * @param address board memory address (64-bit aligned, MSVD address space) to write data to + * @param size transfer size in bytes (must be a multiple of 8 bytes) + * @retval FPGA_RES_OK operation successful + * @retval FPGA_RES_NODEV FPGA board not initialized (need to call AlteraFPGABoard_Open() first) + * @retval FPGA_RES_FAIL transfer failed + * @retval FPGA_RES_NODMA DMA not available on this board */ +uint32_t AlteraFPGABoard_DMAWrite(HalHandle_t HalHandle, uint8_t* data, uint32_t address, uint32_t size); + + +/** AlteraFPGABoard_SetupIRQ() + * @brief Set up user interrupt and service routine. + * @param irq pointer to fpga_irq_handle_t structure to be initialized + * @param mis_addr address (32-bit aligned) of the interrupt status register in the user design + * @param cis_addr address (32-bit aligned) of the interrupt clear register in the user design + * @param timeout timeout, in milliseconds, after which a WaitForIRQ() call shall return + * if no interrupt occured. If this is zero (0), no timeout will occur. + * @retval FPGA_RES_OK operation successful + * @retval FPGA_RES_NODEV FPGA board not initialized (need to call AlteraFPGABoard_Open() first) + * @retval FPGA_RES_FAIL interrupt setup failed */ +uint32_t AlteraFPGABoard_SetupIRQ(fpga_irq_handle_t *irq, uint32_t mis_addr, uint32_t cis_addr, uint32_t timeout); + + +/** AlteraFPGABoard_StopIRQ() + * @brief Deregister interrupt service routine. + * @param irq pointer to fpga_irq_handle_t structure to be used + * @retval FPGA_RES_OK operation successful + * @retval FPGA_RES_NODEV FPGA board not initialized (need to call AlteraFPGABoard_Open() first) + * @retval FPGA_RES_FAIL interrupt setup failed */ +uint32_t AlteraFPGABoard_StopIRQ(fpga_irq_handle_t *irq); + + +/** AlteraFPGABoard_WaitForIRQ() + * @brief Wait for an interrupt. + * @param irq pointer to fpga_irq_handle_t structure to be used + * @param irq_status pointer to a variable that receives the contents of the interrupt status register + * @retval FPGA_RES_OK operation successful + * @retval FPGA_RES_NODEV FPGA board not initialized (need to call AlteraFPGABoard_Open() first) + * @retval FPGA_RES_FAIL wait for interrupt failed or timed out */ +uint32_t AlteraFPGABoard_WaitForIRQ(HalIrqCtx_t *pIrqCtx, uint64_t irq_src, uint64_t *irq_status); + + +/** AlteraFPGABoard_CancelIRQ() + * @brief Cancel all pending interrupts. + * @param irq pointer to fpga_irq_handle_t structure to be used + * @retval FPGA_RES_OK operation successful + * @retval FPGA_RES_NODEV FPGA board not initialized (need to call AlteraFPGABoard_Open() first) + * @retval FPGA_RES_FAIL cancelling of interrupts failed */ +uint32_t AlteraFPGABoard_CancelIRQ(fpga_irq_handle_t *irq); + + +/** AlteraFPGABoard_SetPLLConfig() + * @brief Update PLL configuration. + * @param pll one of the predefined PLL object structures + * @retval cfg pointer to the new configuration + * @retval FPGA_RES_OK operation successful + * @retval FPGA_RES_NODEV FPGA board not initialized (need to call AlteraFPGABoard_Open() first) + * @retval FPGA_RES_FAIL reconfiguration failed */ +uint32_t AlteraFPGABoard_SetPLLConfig(const AlteraFPGAPLL_t* pll, const AlteraFPGAPLLConfig_t* cfg); + + +#if FPGA_USE_KERNEL_IRQ_HANDLING + +#define AlteraFPGABoard_ForbidIRQPolling(x) do { } while (0) +#define AlteraFPGABoard_AllowIRQPolling(x) do { } while (0) + +#else + +/** AlteraFPGABoard_ForbidIRQPolling() + * @brief Temporally forbid IRQ polling */ +void AlteraFPGABoard_ForbidIRQPolling(fpga_irq_handle_t *irq); + +/** AlteraFPGABoard_AllowIRQPolling() + * @brief Re-allow IRQ polling */ +void AlteraFPGABoard_AllowIRQPolling(fpga_irq_handle_t *irq); + +#endif + + +#ifdef __cplusplus +} +#endif + +#endif /* _ALTERA_FPGA_H */ diff --git a/th1520/hardware/camera/include/hal/adapt.h b/th1520/hardware/camera/include/hal/adapt.h new file mode 100755 index 0000000000000000000000000000000000000000..cc35c2b9d2bce521a317644e4e9c1f306bd37b46 --- /dev/null +++ b/th1520/hardware/camera/include/hal/adapt.h @@ -0,0 +1,210 @@ +/******************************************************************************\ +|* Copyright (c) <2020> by VeriSilicon Holdings Co., Ltd. ("VeriSilicon") *| +|* All Rights Reserved. *| +|* *| +|* The material in this file is confidential and contains trade secrets of *| +|* of VeriSilicon. This is proprietary information owned or licensed by *| +|* VeriSilicon. No part of this work may be disclosed, reproduced, copied, *| +|* transmitted, or used in any way for any purpose, without the express *| +|* written permission of VeriSilicon. *| +|* *| +\******************************************************************************/ + +/* VeriSilicon 2020 */ + +/******************************************************************************* + * @file adapt.h + * + * @brief adapter Layer for isp + * + * This header file exports + * + * + * @note + * + *****************************************************************************/ + +#ifndef __ADATPT_H__ +#define __ADATPT_H__ + +#include +#include +//#include +#include + +#include "oslayer/oslayer.h" + +/* Set this macro to 1 enable register dump. */ +#define ENABLE_REGISTER_DUMP 0 + +/****************************************************************************** + * local macro definitions + *****************************************************************************/ +#define SEARCH_V4L2_DEV_NUM_MAX 20 +#define SEARCH_V4L2_SUB_DEV_NUM_MAX 20 +#define SENSOR_NAME_SIZE_MAX 16 +#define SENSOR_DRV_NAME_SIZE_MAX 128 +#define SENSOR_CALIB_NAME_SIZE_MAX 128 + +#define SENSOR_ADAPT_MODE_MAX 20 + +#define DW_NAME_SIZE_MAX 16 + +/****************************************************************************** + * local enum definitions + *****************************************************************************/ +typedef enum AdaptModule_s +{ + ADAPT_MODULE_VIDEO = 0x01,//!