/* Copyright Statement:
*
* This software/firmware and related documentation ("MediaTek Software") are
* protected under relevant copyright laws. The information contained herein
* is confidential and proprietary to MediaTek Inc. and/or its licensors.
* Without the prior written permission of MediaTek inc. and/or its licensors,
* any reproduction, modification, use or disclosure of MediaTek Software,
* and information contained herein, in whole or in part, shall be strictly prohibited.
*/
/* MediaTek Inc. (C) 2010. All rights reserved.
*
* BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON
* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH
* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES
* THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES
* CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK
* SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
* STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND
* CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO
* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
*
* The following software/firmware and/or related documentation ("MediaTek Software")
* have been modified by MediaTek Inc. All revisions are subject to any receiver's
* applicable license agreements with MediaTek Inc.
*/
/********************************************************************************************
* LEGAL DISCLAIMER
*
* (Header of MediaTek Software/Firmware Release or Documentation)
*
* BY OPENING OR USING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") RECEIVED
* FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON AN "AS-IS" BASIS
* ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR
* A PARTICULAR PURPOSE OR NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY
* WHATSOEVER WITH RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
* INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK
* ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S SPECIFICATION
* OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
*
* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE LIABILITY WITH
* RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION,
TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE
* FEES OR SERVICE CHARGE PAID BY BUYER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
*
* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE WITH THE LAWS
* OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF LAWS PRINCIPLES.
************************************************************************************************/
#include <utils/Log.h>
#include <fcntl.h>
#include <math.h>
#include <string.h>
#include "camera_custom_nvram.h"
#include "camera_custom_sensor.h"
#include "image_sensor.h"
#include "kd_imgsensor_define.h"
#include "camera_AE_PLineTable_ov5648mipiraw.h"
#include "camera_info_ov5648mipiraw.h"
#include "camera_custom_AEPlinetable.h"
#include "camera_custom_tsf_tbl.h"
const NVRAM_CAMERA_ISP_PARAM_STRUCT CAMERA_ISP_DEFAULT_VALUE =
{{
//Version
Version: NVRAM_CAMERA_PARA_FILE_VERSION,
//SensorId
SensorId: SENSOR_ID,
ISPComm:{
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
}
},
ISPPca:{
#include INCLUDE_FILENAME_ISP_PCA_PARAM
},
ISPRegs:{
#include INCLUDE_FILENAME_ISP_REGS_PARAM
},
ISPMfbMixer:{{
{//00: MFB mixer for ISO 100
0x00000000, 0x00000000
},
{//01: MFB mixer for ISO 200
0x00000000, 0x00000000
},
{//02: MFB mixer for ISO 400
0x00000000, 0x00000000
},
{//03: MFB mixer for ISO 800
0x00000000, 0x00000000
},
{//04: MFB mixer for ISO 1600
0x00000000, 0x00000000
},
{//05: MFB mixer for ISO 2400
0x00000000, 0x00000000
},
{//06: MFB mixer for ISO 3200
0x00000000, 0x00000000
}
}},
ISPMulitCCM:{
Poly22:{
75170, // i4R_AVG
13190, // i4R_STD
79140, // i4B_AVG
26270, // i4B_STD
4095, // i4R_MAX
512, // i4R_MIN
4095, // i4G_MAX
512, // i4G_MIN
4095, // i4B_MAX
512, // i4B_MIN
{ // i4P00[9]
8897296,-2989626,-787686,-1208954,6829026,-500072,170190,-2770908,7720566
},
{ // i4P10[9]
1867396,-1257886,-609516,-495040,-44440,539480,-147722,392332,-245110
},
{ // i4P01[9]
1628734,-988046,-640704,-716820,-361112,1077932,-114812,-380908,495378
},
{ // i4P20[9]
788014,-983900,196062,-43050,119624,-76574,281758,-1043902,762090
},
{ // i4P11[9]
-71500,-689612,761476,243148,119000,-362148,286776,-619070,332618
},
{ // i4P02[9]
-631502,130466,501236,302926,68298,-371224,43616,-17274,-25994
}
},
AWBGain:{
// Strobe
{
810, // i4R
512, // i4G
677 // i4B
},
// A
{
519, // i4R
512, // i4G
1450 // i4B
},
// TL84
{
605, // i4R
512, // i4G
1172 // i4B
},
// CWF
{
771, // i4R
512, // i4G
1293 // i4B
},
// D65
{
810, // i4R
512, // i4G
677 // i4B
},
// Reserved 1
{
512, // i4R
512, // i4G
512 // i4B
},
// Reserved 2
{
512, // i4R
512, // i4G
512 // i4B
},
// Reserved 3
{
512, // i4R
512, // i4G
512 // i4B
}
},
Weight:{
1, // Strobe
1, // A
1, // TL84
1, // CWF
1, // D65
1, // Reserved 1
1, // Reserved 2
1 // Reserved 3
}
},
//bInvokeSmoothCCM
bInvokeSmoothCCM: MTRUE,
DngMetadata:{
0, //i4RefereceIlluminant1
3, //i4RefereceIlluminant2
rNoiseProfile:{
{
S:{