广角扭曲校正

static ER DCE_IQparam(IQS_FLOW_MSG MsgID, DCE_SUBFUNC *subf,IPL_HAL_GROUP* group)
{
    UINT32 ISO_Value, Zoom_Value, SenMode_Value,IMEffect_Value;

    IMEffect_Value = IPL_AlgGetUIInfo(IPL_SEL_IMAGEEFFECT);
    ISO_Value = IQS_GetISOIdx(MsgID);
    Zoom_Value = IQS_GetZoomIdx(MsgID);
    SenMode_Value = IQS_GetSenModeIdx(MsgID);

    switch((UINT32)MsgID)
    {
        case IQS_MANUAL_TRIG:
        case IQS_OZOOM_END:
        case IQCB_PRV_DCE_INIT:
        case IQCB_PREIME_D2D_DCE_QV:
        case IQCB_PREIME_D2D_DCE_PRI:
        case IQS_IMAGE_EFFECT:
            //enable function

            //Setting parameter
            group->dceUpdate |= (
                                DCE_DisT           | ///< update H/V distance factor/ratio selection
                                DCE_CAB            | ///< update color aberration factor
                                DCE_LUT            | ///< update LUT table address
                                DCE_FOV            | ///< update FOV
                                DCE_ENH            | ///< update enhancement
                                DCE_DISTOR           ///< update distortion parameter set
                              );
            if ( MsgID == IQCB_PREIME_D2D_DCE_QV )
            {
                IQ_DCE_Distortion.Center.x = IPL_CtrlGetInfor(IPL_ID_1, IPLCTRL_SIE_CH0_CAP_RAW_SIZE_H)>>1;
                IQ_DCE_Distortion.Center.y = IPL_CtrlGetInfor(IPL_ID_1, IPLCTRL_SIE_CH0_CAP_RAW_SIZE_V)>>1;
            }
            else if ( MsgID == IQCB_PREIME_D2D_DCE_PRI )
            {
                IQ_DCE_Distortion.Center.x = IPL_CtrlGetInfor(IPL_ID_1, IPLCTRL_SIE_CH0_CAP_RAW_SIZE_H)>>1;
                IQ_DCE_Distortion.Center.y = IPL_CtrlGetInfor(IPL_ID_1, IPLCTRL_SIE_CH0_CAP_RAW_SIZE_V)>>1;
            }
            else  //preview
            {
                IQ_DCE_Distortion.Center.x = IPL_CtrlGetInfor(IPL_ID_1, IPLCTRL_PRE_IN_SIZE_H)>>1;
                IQ_DCE_Distortion.Center.y = IPL_CtrlGetInfor(IPL_ID_1, IPLCTRL_PRE_IN_SIZE_V)>>1;
            }
            IQ_DCE_Distortion.Fov = DCE_Fov[Zoom_Value];
            IQ_DCE_Distortion.Enh = DCE_Enh[Zoom_Value];
            IQ_DCE_Distortion.ColorAber = DCE_ColorAbbration[Zoom_Value];
            IQ_DCE_Distortion.LUT_TblAddr = (UINT32)DCE_2D_LUT[Zoom_Value];
            IQ_DCE_Distortion.LutType = DCE_GetTableType(DCE_2D_LUT[Zoom_Value]);
            subf->pDistortion = &IQ_DCE_Distortion;
            subf->Dce_Dist = DCE_Dist[SenMode_Value];
            subf->Radious = DCE_Radious[SenMode_Value];

#if 0
            switch (IMEffect_Value)
            {
                case SEL_IMAGEEFFECT_FISHEYE:
                    group->dceUpdate |= ( DCE_LUT | DCE_LUTType );
                    IQ_DCE_Distortion.LUT_TblAddr = (UINT32)IE_FISYEYE_LUT;
                    IQ_DCE_Distortion.LutType = NON_STRICTLY_INC_DEC; //DCE_GetTableType(IE_FISYEYE_LUT);
                    subf->pDistortion = &IQ_DCE_Distortion;
                    break;
                default:
                    break;
            }
#else
            switch (IMEffect_Value)
            {
               case SEL_IMAGEEFFECT_FISHEYE:
                   group->dceUpdate |= ( DCE_LUT | DCE_LUTType );
                   IQ_DCE_Distortion.LUT_TblAddr = (UINT32)IE_FISYEYE_LUT;
                   IQ_DCE_Distortion.LutType = NON_STRICTLY_INC_DEC; //DCE_GetTableType(IE_FISYEYE_LUT);
                   subf->pDistortion = &IQ_DCE_Distortion;
                   break;
                   
               case SEL_IMAGEEFFECT_OFF:
               case SEL_IMAGEEFFECT_BW:
                   group->dceUpdate |= ( DCE_LUT | DCE_LUTType );
                   IQ_DCE_Distortion.LUT_TblAddr = (UINT32)IE_PINCUSHION_LUT_BL0002;
                   IQ_DCE_Distortion.LutType = NON_STRICTLY_INC_DEC; //DCE_GetTableType(IE_FISYEYE_LUT);
                   subf->pDistortion = &IQ_DCE_Distortion;
                   break;
                   
               default:
                   break;

            }

#endif
            break;

        case IQS_AE_END:
        case IQS_AWB_END:
        case IQS_AF_START:
        case IQS_AF_END:
            break;
        default :
            DBG_ERR("DCE_IQparam() param mode(%d) selection error!\r\n",MsgID);
            return E_SYS;
    }
    return E_OK;
}

猜你喜欢

转载自blog.csdn.net/volval/article/details/116746990