static HI_S32 s32VpssStartGrp(VPSS_GRP VpssGrp, VPSS_GRP_ATTR_S *pstVpssGrpAttr) { HI_S32 s32Ret; VPSS_NR_PARAM_U unNrParam = {{0}}; if (VpssGrp < 0 || VpssGrp > VPSS_MAX_GRP_NUM) { printf("VpssGrp%d is out of rang. \n", VpssGrp); return HI_FAILURE; } if (HI_NULL == pstVpssGrpAttr) { printf("null ptr,line%d. \n", __LINE__); return HI_FAILURE; } s32Ret = HI_MPI_VPSS_CreateGrp(VpssGrp, pstVpssGrpAttr); if (s32Ret != HI_SUCCESS) { printf("HI_MPI_VPSS_CreateGrp failed with %#x!\n", s32Ret); return HI_FAILURE; } /*** set vpss 3DNR param ***/ s32Ret = HI_MPI_VPSS_GetNRParam(VpssGrp, &unNrParam); if (s32Ret != HI_SUCCESS) { printf("failed with %#x!\n", s32Ret); return HI_FAILURE; } s32Ret = HI_MPI_VPSS_SetNRParam(VpssGrp, &unNrParam); if (s32Ret != HI_SUCCESS) { printf("failed with %#x!\n", s32Ret); return HI_FAILURE; } s32Ret = HI_MPI_VPSS_StartGrp(VpssGrp); if (s32Ret != HI_SUCCESS) { printf("HI_MPI_VPSS_StartGrp failed with %#x\n", s32Ret); return HI_FAILURE; } return HI_SUCCESS; }
/***************************************************************************** * function : start vpss. VPSS chn with frame *****************************************************************************/ static HI_S32 SAMPLE_COMM_IVE_VpssStart(HI_S32 s32VpssGrpCnt, SIZE_S astSize[], VPSS_CHN aVpssChn[], HI_S32 s32VpssChnCnt, VPSS_GRP_ATTR_S *pstVpssGrpAttr) { VPSS_GRP VpssGrp; VPSS_CHN VpssChn; VPSS_GRP_ATTR_S stGrpAttr = {0}; //VPSS_CHN_ATTR_S stChnAttr = {0}; VPSS_NR_PARAM_U unNrParam = {{0}}; VPSS_CHN_MODE_S stVpssChnMode = {0}; VPSS_FRAME_RATE_S stVpssFrmRate = {30, 30}; HI_S32 s32Ret = HI_SUCCESS; HI_S32 i, j; HI_U32 u32Depth = 1; HI_ASSERT(s32VpssGrpCnt>0); HI_ASSERT(s32VpssChnCnt>0); /*** Set Vpss Grp Attr ***/ if(NULL == pstVpssGrpAttr) { stGrpAttr.u32MaxW = astSize[0].u32Width; stGrpAttr.u32MaxH = astSize[0].u32Height; stGrpAttr.bIeEn = HI_FALSE; stGrpAttr.bNrEn = HI_TRUE; stGrpAttr.bHistEn = HI_FALSE; stGrpAttr.enDieMode = VPSS_DIE_MODE_NODIE; stGrpAttr.enPixFmt = SAMPLE_PIXEL_FORMAT; } else { memcpy(&stGrpAttr,pstVpssGrpAttr,sizeof(VPSS_GRP_ATTR_S)); } for(i=0; i<s32VpssGrpCnt; i++) { VpssGrp = i; /*** create vpss group ***/ s32Ret = HI_MPI_VPSS_CreateGrp(VpssGrp, &stGrpAttr); if (HI_SUCCESS != s32Ret) { SAMPLE_PRT("HI_MPI_VPSS_CreateGrp failed with errno: %#x!\n", s32Ret); return HI_FAILURE; } //*** set vpss param ***/ s32Ret = HI_MPI_VPSS_GetNRParam(VpssGrp, &unNrParam); if (HI_SUCCESS != s32Ret) { SAMPLE_PRT("HI_MPI_VPSS_GetNRParam failed with errno: %#x!\n", s32Ret); return HI_FAILURE; } s32Ret = HI_MPI_VPSS_SetNRParam(VpssGrp, &unNrParam); if (HI_SUCCESS != s32Ret) { SAMPLE_PRT("HI_MPI_VPSS_SetNRParam failed with errno: %#x!\n", s32Ret); return HI_FAILURE; } s32Ret = HI_MPI_VPSS_SetGrpFrameRate(VpssGrp, &stVpssFrmRate); if (HI_SUCCESS != s32Ret) { SAMPLE_PRT("HI_MPI_VPSS_SetGrpFrameRate failed with errno: %#x!\n", s32Ret); return HI_FAILURE; } /*** enable vpss chn, with frame ***/ for(j=0; j<s32VpssChnCnt; j++) { VpssChn = aVpssChn[j]; stVpssChnMode.enChnMode = VPSS_CHN_MODE_USER; stVpssChnMode.u32Width = astSize[j].u32Width; stVpssChnMode.u32Height = astSize[j].u32Height; stVpssChnMode.enPixelFormat = SAMPLE_PIXEL_FORMAT; stVpssChnMode.enCompressMode = COMPRESS_MODE_NONE; s32Ret = HI_MPI_VPSS_SetChnMode(VpssGrp, VpssChn, &stVpssChnMode); if (HI_SUCCESS != s32Ret) { SAMPLE_PRT("HI_MPI_VPSS_SetChnMode failed with errno: %#x\n", s32Ret); return HI_FAILURE; } s32Ret = HI_MPI_VPSS_SetDepth(VpssGrp, VpssChn, u32Depth); if (HI_SUCCESS != s32Ret) { SAMPLE_PRT("HI_MPI_VPSS_SetDepth failed with errno: %#x\n", s32Ret); return HI_FAILURE; } s32Ret = HI_MPI_VPSS_EnableChn(VpssGrp, VpssChn); if (HI_SUCCESS != s32Ret) { SAMPLE_PRT("HI_MPI_VPSS_EnableChn failed with errno: %#x\n", s32Ret); return HI_FAILURE; } } /*** start vpss group ***/ s32Ret = HI_MPI_VPSS_StartGrp(VpssGrp); if (HI_SUCCESS != s32Ret) { SAMPLE_PRT("HI_MPI_VPSS_StartGrp failed with %#x\n", s32Ret); return HI_FAILURE; } } return HI_SUCCESS; }
void PS3210k_SetNR3D(int level) { VPSS_GRP VpssGrp =0; HI_MPI_VPSS_SetNRParam(VpssGrp, &NrParam_3Ddenoise[level]); }