1/* 2 * Copyright (c) 2022 HiSilicon (Shanghai) Technologies CO., LIMITED. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16#ifndef _HI_MPI_IVE_H_ 17#define _HI_MPI_IVE_H_ 18 19#include "hi_ive.h" 20 21#ifdef __cplusplus 22#if __cplusplus 23extern "C" { 24#endif 25#endif 26 27/***************************************************************************** 28* Prototype : HI_MPI_IVE_DMA 29* Description : Direct memory access (DMA): 30* 1. Direct memory copy; 31* 2. Copy with interval bytes; 32* 3. Memset using 3 bytes; 33* 4. Memset using 8 bytes; 34* Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task. 35* IVE_DATA_S *pstSrc Input source data.The input data is treated as U8C1 data. 36* IVE_DATA_S *pstDst Output result data. 37* IVE_DMA_CTRL_S *pstDmaCtrl DMA control parameter. 38* HI_BOOL bInstant Flag indicating whether to generate an interrupt. 39* If the output result blocks the next operation, 40* set bInstant to HI_TRUE. 41* Return Value : HI_SUCCESS: Success;Error codes: Failure. 42* Spec : The size of the input data ranges from 32x1 pixels to 1920x1080 pixels. 43* The stride must be 16-byte-aligned. 44*****************************************************************************/ 45HI_S32 HI_MPI_IVE_DMA(IVE_HANDLE *pIveHandle, IVE_DATA_S *pstSrc, IVE_DST_DATA_S *pstDst, 46 IVE_DMA_CTRL_S *pstDmaCtrl, HI_BOOL bInstant); 47 48/***************************************************************************** 49* Prototype : HI_MPI_IVE_Filter 50* Description : 5x5 template filter. 51* Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task 52* IVE_SRC_IMAGE_S *pstSrc Input source data. 53* The U8C1,SP420 and SP422 input formats are supported. 54* IVE_DST_IMAGE_S *pstDst Output result, of same type with the input. 55* IVE_FILTER_CTRL_S *pstFltCtrl Control parameters of filter 56* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. 57* Return Value : HI_SUCCESS: Success;Error codes: Failure. 58* Spec : The size of the input data ranges from 64x64 pixels to 1920x1024 pixels. 59* The physical addresses of the input data and output data must be 16-byte-aligned. 60* The stride must be 16-pixel-aligned. 61*****************************************************************************/ 62HI_S32 HI_MPI_IVE_Filter(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc, IVE_DST_IMAGE_S *pstDst, 63 IVE_FILTER_CTRL_S *pstFltCtrl, HI_BOOL bInstant); 64 65/***************************************************************************** 66* Prototype : HI_MPI_IVE_CSC 67* Description : YUV2RGB\YUV2HSV\YUV2LAB\RGB2YUV color space conversion are supported. 68* Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task 69* IVE_SRC_IMAGE_S *pstSrc Input source data: 70* 1. SP420\SP422 type for YUV2RGB\YUV2HSV\YUV2LAB; 71* 2. U8C3_PACKAGE\U8C3_PLANAR type for RGB2YUV; 72* IVE_DST_IMAGE_S *pstDst Output result: 73* 1. U8C3_PACKAGE\U8C3_PLANAR typed for 74* YUV2RGB\YUV2HSV\YUV2LAB; 75* 2. SP420\SP422 type for RGB2YUV; 76* IVE_CSC_CTRL_S *pstCscCtrl Control parameters for CSC 77* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. 78* Return Value : HI_SUCCESS: Success;Error codes: Failure. 79* Spec : The size of the input data ranges from 64x64 pixels to 1920x1080 pixels. 80* The physical addresses of the input data and output data must be 16-byte-aligned. 81* The stride must be 16-pixel-aligned. 82*****************************************************************************/ 83HI_S32 HI_MPI_IVE_CSC(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc, IVE_DST_IMAGE_S *pstDst, 84 IVE_CSC_CTRL_S *pstCscCtrl, HI_BOOL bInstant); 85 86/***************************************************************************** 87* Prototype : HI_MPI_IVE_FILTER_AND_CSC 88* Description : Only support YUV2RGB color space conversion. 89* Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task. 90* IVE_SRC_IMAGE_S *pstSrc Input source data.Only SP420\SP422 type 91* are supported. 92* IVE_DST_IMAGE_S *pstDst Output result.Only U8C3_PACKAGE\U8C3_PLANAR 93* are supported. 94* IVE_FILTER_AND_CSC_CTRL_S *pstFltCscCtrl Control parameters. 95* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. 96* Return Value : HI_SUCCESS: Success;Error codes: Failure. 97* Spec : The size of the input data ranges from 64x64 pixels to 1920x1024 pixels. 98* The physical addresses of the input data and output data must be 16-byte-aligned. 99* The stride must be 16-pixel-aligned. 100*****************************************************************************/ 101HI_S32 HI_MPI_IVE_FilterAndCSC(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc, IVE_DST_IMAGE_S *pstDst, 102 IVE_FILTER_AND_CSC_CTRL_S *pstFltCscCtrl, HI_BOOL bInstant); 103 104/***************************************************************************** 105* Prototype : HI_MPI_IVE_Sobel 106* Description : SOBEL is used to extract the gradient information. 107* Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task 108* IVE_SRC_IMAGE_S *pstSrc Input source data. Only the U8C1 input image 109* is supported. 110* IVE_DST_IMAGE_S *pstDstH The (horizontal) result of input image filtered by 111* the input mask; 112* IVE_DST_IMAGE_S *pstDstV The (vertical) result of input image filtered by 113* the transposed mask; 114* IVE_SOBEL_CTRL_S *pstSobelCtrl Control parameters 115* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. 116* Return Value : HI_SUCCESS: Success;Error codes: Failure. 117* Spec : The size of the input data ranges from 64x64 pixels to 1920x1024 pixels. 118* The physical addresses of the input data and output data must be 16-byte-aligned. 119* The stride must be 16-pixel-aligned. 120*****************************************************************************/ 121HI_S32 HI_MPI_IVE_Sobel(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc, IVE_DST_IMAGE_S *pstDstH, 122 IVE_DST_IMAGE_S *pstDstV, IVE_SOBEL_CTRL_S *pstSobelCtrl, HI_BOOL bInstant); 123 124/***************************************************************************** 125* Prototype : HI_MPI_IVE_MagAndAng 126* Description : MagAndAng is used to extract the edge information. 127* Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task 128* IVE_SRC_INFO_S *pstSrc Input source data. Only the U8C1 input format 129* is supported. 130* IVE_MEM_INFO_S *pstDstMag Output magnitude. 131* IVE_MEM_INFO_S *pstDstAng Output angle. 132* If the output mode is set to magnitude only, 133* this item can be set to null. 134* IVE_MAG_AND_ANG_CTRL_S *pstMagAndAngCtrl Control parameters 135* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. 136* Return Value : HI_SUCCESS: Success;Error codes: Failure. 137* Spec : The size of the input data ranges from 64x64 pixels to 1920x1024 pixels. 138* The physical addresses of the input data and output data must be 16-byte-aligned. 139* The stride must be 16-pixel-aligned. 140*****************************************************************************/ 141HI_S32 HI_MPI_IVE_MagAndAng(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc, IVE_DST_IMAGE_S *pstDstMag, 142 IVE_DST_IMAGE_S *pstDstAng, IVE_MAG_AND_ANG_CTRL_S *pstMagAndAngCtrl, HI_BOOL bInstant); 143 144/***************************************************************************** 145* Prototype : HI_MPI_IVE_Dilate 146* Description : 5x5 template dilate. Only the U8C1 binary image input is supported. 147* Or else the result is not expected. 148* Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task 149* IVE_SRC_IMAGE_S *pstSrc Input binary image, which consists of 0 or 255 150* IVE_DST_IMAGE_S *pstDst Output result. 151* IVE_DILATE_CTRL_S *pstDilateCtrl Control parameters. 152* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. 153* Return Value : HI_SUCCESS: Success;Error codes: Failure. 154* Spec : The size of the input data ranges from 64x64 pixels to 1920x1024 pixels. 155* The physical addresses of the input data and output data must be 16-byte-aligned. 156* The stride must be 16-pixel-aligned. 157* The input value, output value, and mask value must be 0 or 255. 158*****************************************************************************/ 159HI_S32 HI_MPI_IVE_Dilate(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc, IVE_DST_IMAGE_S *pstDst, 160 IVE_DILATE_CTRL_S *pstDilateCtrl, HI_BOOL bInstant); 161 162/***************************************************************************** 163* Prototype : HI_MPI_IVE_Erode 164* Parameters : 5x5 template erode. Only the U8C1 binary image input is supported. 165* Or else the result is not correct. 166* Input : IVE_HANDLE *pIveHandle Returned handle ID of a task 167* IVE_SRC_IMAGE_S *pstSrc Input binary image, which consists of 0 or 255 168* IVE_DST_IMAGE_S *pstDst Output result. 169* IVE_ERODE_CTRL_S *pstErodeCtrl Control parameters 170* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. 171* Return Value : HI_SUCCESS: Success;Error codes: Failure. 172* Spec : The size of the input data ranges from 64x64 pixels to 1920x1024 pixels. 173* The physical addresses of the input data and output data must be 16-byte-aligned. 174* The stride must be 16-pixel-aligned. 175* The input value, output value, and mask value must be 0 or 255. 176*****************************************************************************/ 177HI_S32 HI_MPI_IVE_Erode(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc, IVE_DST_IMAGE_S *pstDst, 178 IVE_ERODE_CTRL_S *pstErodeCtrl, HI_BOOL bInstant); 179 180/***************************************************************************** 181* Prototype : HI_MPI_IVE_Thresh 182* Description : Thresh operation to the input image. 183* Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task 184* IVE_SRC_IMAGE_S *pstSrc Input source data. Only the U8C1 input format is supported. 185* IVE_DST_IMAGE_S *pstDst Output result 186* IVE_THRESH_CTRL_S *pstThrCtrl Control parameters 187* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. 188* Return Value : HI_SUCCESS: Success;Error codes: Failure. 189* Spec : The size of the input data ranges from 64x64 pixels to 1920x1080 pixels. 190* The stride must be 16-pixel-aligned. 191*****************************************************************************/ 192HI_S32 HI_MPI_IVE_Thresh(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc, IVE_DST_IMAGE_S *pstDst, 193 IVE_THRESH_CTRL_S *pstThrCtrl, HI_BOOL bInstant); 194 195/***************************************************************************** 196* Prototype : HI_MPI_IVE_And 197* Description : Binary images' And operation. 198* Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task 199* IVE_SRC_IMAGE_S *pstSrc1 The input source1. Only U8C1 input format is supported. 200* IVE_SRC_IMAGE_S *pstSrc2 The input source2.Only U8C1 input format is supported. 201* IVE_DST_IMAGE_S *pstDst Output result of " src1 & src2 ". 202* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. 203* Return Value : HI_SUCCESS: Success;Error codes: Failure. 204* Spec : The size of the input data ranges from 64x64 pixels to 1920x1080 pixels. 205* The stride must be 16-pixel-aligned. 206* The types, widths, heights of two input sources must be the same. 207*****************************************************************************/ 208HI_S32 HI_MPI_IVE_And(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc1, IVE_SRC_IMAGE_S *pstSrc2, 209 IVE_DST_IMAGE_S *pstDst, HI_BOOL bInstant); 210 211/***************************************************************************** 212* Prototype : HI_MPI_IVE_Sub 213* Description : Two gray images' Sub operation. 214* Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task 215* IVE_SRC_IMAGE_S *pstSrc1 Minuend of the input source.Only the U8C1 input format 216* is supported. 217* IVE_SRC_IMAGE_S *pstSrc2 Subtrahend of the input source.Only the U8C1 input 218* format is supported. 219* IVE_DST_IMAGE_S *pstDst Output result of src1 minus src2 220* IVE_SUB_CTRL_S *pstSubCtrl Control parameter 221* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. 222* Return Value : HI_SUCCESS: Success;Error codes: Failure. 223* Spec : The size of the input data ranges from 64x64 pixels to 1920x1080 pixels. 224* The stride must be 16-pixel-aligned. 225* The types, widths, heights of two input sources must be the same. 226*****************************************************************************/ 227HI_S32 HI_MPI_IVE_Sub(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc1, IVE_SRC_IMAGE_S *pstSrc2, 228 IVE_DST_IMAGE_S *pstDst, IVE_SUB_CTRL_S *pstSubCtrl, HI_BOOL bInstant); 229 230/***************************************************************************** 231* Prototype : HI_MPI_IVE_Or 232* Description : Two binary images' Or operation. 233* Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task 234* IVE_SRC_IMAGE_S *pstSrc1 Input source1. Only the U8C1 input format is supported. 235* IVE_SRC_IMAGE_S *pstSrc2 Input source2. Only the U8C1 input format is supported. 236* IVE_DST_IMAGE_S *pstDst Output result src1 or src2 237* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. 238* Return Value : HI_SUCCESS: Success;Error codes: Failure. 239* Spec : The size of the input data ranges from 64x64 pixels to 1920x1080 pixels. 240* The stride must be 16-pixel-aligned. 241* The types, widths, heights of two input sources must be the same. 242*****************************************************************************/ 243HI_S32 HI_MPI_IVE_Or(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc1, IVE_SRC_IMAGE_S *pstSrc2, 244 IVE_DST_IMAGE_S *pstDst, HI_BOOL bInstant); 245 246/***************************************************************************** 247* Prototype : HI_MPI_IVE_INTEG 248* Description : Calculate the input gray image's integral image. 249* Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task 250* IVE_SRC_IMAGE_S *pstSrc Input source data.Only the U8C1 input format 251* is supported. 252* IVE_DST_IMAGE_S *pstDst Output result.Can be U32C1 or U64C1, relied on the 253* control parameter. 254* IVE_INTEG_CTRL_S *pstIntegCtrl Integ Control 255* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. 256* Return Value : HI_SUCCESS: Success;Error codes: Failure. 257* Spec : The size of the input data ranges from 64x64 pixels to 1920x1080 pixels. 258* The physical addresses of the input data and output data must be 16-byte-aligned. 259* The stride must be 16-pixel-aligned. 260* The pixel can be 32bit or 64 bit relied on the control parameter. 261*****************************************************************************/ 262HI_S32 HI_MPI_IVE_Integ(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc, IVE_DST_IMAGE_S *pstDst, 263 IVE_INTEG_CTRL_S *pstIntegCtrl, HI_BOOL bInstant); 264 265/***************************************************************************** 266* Prototype : HI_MPI_IVE_Hist 267* Description : Calculate the input gray image's histogram. 268* Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task 269* IVE_SRC_IMAGE_S *pstSrc Input source data. Only the U8C1 input format 270* is supported. 271* IVE_DST_MEM_INFO_S *pstDst Output result. 272* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. 273* Return Value : HI_SUCCESS: Success;Error codes: Failure. 274* Spec : The size of the input data ranges from 64x64 pixels to 1920x1080 pixels. 275* The physical addresses of the input data and output data must be 16-byte-aligned. 276* The stride must be 16-pixel-aligned. 277*****************************************************************************/ 278HI_S32 HI_MPI_IVE_Hist(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc, IVE_DST_MEM_INFO_S *pstDst, 279 HI_BOOL bInstant); 280 281/***************************************************************************** 282* Prototype : HI_MPI_IVE_Thresh_S16 283* Description : S16 image's THRESH operation. 284* Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task 285* IVE_SRC_IMAGE_S *pstSrc Input source data.Only the S16 input format 286* is supported. 287* IVE_DST_IMAGE_S *pstDst Output result. 288* IVE_THRESH_S16_CTRL_S *pstThrS16Ctrl Control parameters 289* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. 290* Return Value : HI_SUCCESS: Success;Error codes: Failure. 291* Spec : The size of the input data ranges from 64x64 pixels to 1920x1080 pixels. 292* The physical addresses of the input data must be 2-byte-aligned. 293* The stride must be 16-pixel-aligned. 294*****************************************************************************/ 295HI_S32 HI_MPI_IVE_Thresh_S16(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc, IVE_DST_IMAGE_S *pstDst, 296 IVE_THRESH_S16_CTRL_S *pstThrS16Ctrl, HI_BOOL bInstant); 297 298/***************************************************************************** 299* Prototype : HI_MPI_IVE_Thresh_U16 300* Description : U16 image's THRESH operation. 301* Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task 302* IVE_SRC_IMAGE_S *pstSrc Input source data. Only the U16 input 303* format is supported. 304* IVE_DST_IMAGE_S *pstDst Output result 305* IVE_THRESH_U16_CTRL_S *pstThrU16Ctrl Control parameters 306* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. 307* Return Value : HI_SUCCESS: Success;Error codes: Failure. 308* Spec : The size of the input data ranges from 64x64 pixels to 1920x1080 pixels. 309* The physical addresses of the input data must be 2-byte-aligned. 310* The stride must be 16-pixel-aligned. 311*****************************************************************************/ 312HI_S32 HI_MPI_IVE_Thresh_U16(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc, IVE_DST_IMAGE_S *pstDst, 313 IVE_THRESH_U16_CTRL_S *pstThrU16Ctrl, HI_BOOL bInstant); 314 315/***************************************************************************** 316* Prototype : HI_MPI_IVE_16BitTo8Bit 317* Description : Scale the input 16bit data to the output 8bit data. 318* Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task 319* IVE_SRC_IMAGE_S *pstSrc Input source data.Only U16C1\S16C1 320* input is supported. 321* IVE_DST_IMAGE_S *pstDst Output result 322* IVE_16BITTO8BIT_CTRL_S *pst16BitTo8BitCtrl control parameter 323* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. 324* Return Value : HI_SUCCESS: Success;Error codes: Failure. 325* Spec : The size of the input data ranges from 64x64 pixels to 1920x1080 pixels. 326* The physical addresses of the input data must be 2-byte-aligned. 327* The stride must be 16-pixel-aligned. 328*****************************************************************************/ 329HI_S32 HI_MPI_IVE_16BitTo8Bit(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc, IVE_DST_IMAGE_S *pstDst, 330 IVE_16BIT_TO_8BIT_CTRL_S *pst16BitTo8BitCtrl, HI_BOOL bInstant); 331 332/***************************************************************************** 333* Prototype : HI_MPI_IVE_OrdStatFilter 334* Description : Order Statistic Filter. It can be used as median\max\min value filter. 335* Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task 336* IVE_SRC_IMAGE_S *pstSrc Input source data. Only U8C1 input 337* is supported 338* IVE_DST_IMAGE_S *pstDst Output result 339* IVE_ORD_STAT_FILTER_CTRL_S *pstOrdStatFltCtrl Control parameter 340* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. 341* Return Value : HI_SUCCESS: Success;Error codes: Failure. 342* Spec : The size of the input data ranges from 64x64 pixels to 1920x1024 pixels. 343* The physical addresses of the input data and output data must be 16-byte-aligned. 344* The stride must be 16-pixel-aligned. 345*****************************************************************************/ 346HI_S32 HI_MPI_IVE_OrdStatFilter(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc, IVE_DST_IMAGE_S *pstDst, 347 IVE_ORD_STAT_FILTER_CTRL_S *pstOrdStatFltCtrl, HI_BOOL bInstant); 348 349/***************************************************************************** 350* Prototype : HI_MPI_IVE_Map 351* Description : Map a image to another through a lookup table. 352* Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task 353* IVE_SRC_IMAGE_S *pstSrc Input source. Only the U8C1 input format is supported. 354* IVE_SRC_MEM_INFO_S *pstMap Input lookup table. Must be an U8 array of size 256. 355* IVE_DST_IMAGE_S *pstDst Output result. 356* IVE_MAP_CTRL_S *pstMapCtrl Map control parameter. 357* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. 358* Return Value : HI_SUCCESS: Success;Error codes: Failure. 359* Spec : The size of the input data ranges from 64x64 pixels to 1920x1080 pixels. 360* The physical addresses of the input data and output data must be 16-byte-aligned. 361* The stride must be 16-pixel-aligned. 362*****************************************************************************/ 363HI_S32 HI_MPI_IVE_Map(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc, IVE_SRC_MEM_INFO_S *pstMap, 364 IVE_DST_IMAGE_S *pstDst, IVE_MAP_CTRL_S *pstMapCtrl, HI_BOOL bInstant); 365 366/***************************************************************************** 367* Prototype : HI_MPI_IVE_EqualizeHist 368* Description : Enhance the input image's contrast through histogram equalization. 369* Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task 370* IVE_SRC_IMAGE_S *pstSrc Input source.Only U8C1 input format 371* is supported. 372* IVE_DST_IMAGE_S *pstDst Output result. 373* IVE_EQUALIZEHIST_CTRL_S *pstEqualizeHistCtrl EqualizeHist control parameter. 374* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. 375* Return Value : HI_SUCCESS: Success;Error codes: Failure. 376* Spec : The size of the input data ranges from 64x64 pixels to 1920x1080 pixels. 377* The physical addresses of map data must be 16-byte-aligned. 378* The stride must be 16-pixel-aligned. 379*****************************************************************************/ 380HI_S32 HI_MPI_IVE_EqualizeHist(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc, IVE_DST_IMAGE_S *pstDst, 381 IVE_EQUALIZE_HIST_CTRL_S *pstEqualizeHistCtrl, HI_BOOL bInstant); 382 383/***************************************************************************** 384* Prototype : HI_MPI_IVE_Add 385* Description : Two gray images' Add operation. 386* Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task 387* IVE_SRC_IMAGE_S *pstSrc1 Augend of the input source.Only the U8C1 input 388* format is supported. 389* IVE_SRC_IMAGE_S *pstSrc2 Addend of the input source.Only the U8C1 input 390* format is supported. 391* IVE_DST_IMAGE_S *pstDst Output result of src1 plus src2 392* IVE_ADD_CTRL_S *pstAddCtrl Control parameter 393* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. 394* Return Value : HI_SUCCESS: Success;Error codes: Failure. 395* Spec : The size of the input data ranges from 64x64 pixels to 1920x1080 pixels. 396* The stride must be 16-pixel-aligned. 397* The types, widths, heights of two input sources must be the same. 398*****************************************************************************/ 399HI_S32 HI_MPI_IVE_Add(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc1, IVE_SRC_IMAGE_S *pstSrc2, 400 IVE_DST_IMAGE_S *pstDst, IVE_ADD_CTRL_S *pstAddCtrl, HI_BOOL bInstant); 401 402/***************************************************************************** 403* Prototype : HI_MPI_IVE_Xor 404* Description : Two binary images' Xor operation. 405* Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task 406* IVE_SRC_IMAGE_S *pstSrc1 The input source1.Only the U8C1 input format is supported. 407* IVE_SRC_IMAGE_S *pstSrc2 The input source2. 408* IVE_DST_IMAGE_S *pstDst Output result 409* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. 410* Return Value : HI_SUCCESS: Success;Error codes: Failure. 411* Spec : The size of the input data ranges from 64x64 pixels to 1920x1080 pixels. 412* The stride must be 16-pixel-aligned. 413* The types, widths, heights of two input sources must be the same. 414*****************************************************************************/ 415HI_S32 HI_MPI_IVE_Xor(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc1, IVE_SRC_IMAGE_S *pstSrc2, 416 IVE_DST_IMAGE_S *pstDst, HI_BOOL bInstant); 417 418/***************************************************************************** 419* Prototype : HI_MPI_IVE_NCC 420* Description : Calculate two gray images' NCC (Normalized Cross Correlation). 421* Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task 422* IVE_SRC_IMAGE_S *pstSrc1 Input source1. Only the U8C1 input format is supported. 423* IVE_SRC_IMAGE_S *pstSrc2 Input source2. Must be of the same type, size of source1. 424* IVE_DST_MEM_INFO_S *pstDst Output result 425* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. 426* Return Value : HI_SUCCESS: Success;Error codes: Failure. 427* Spec : The size of the input data ranges from 64x64 pixels to 1920x1024 pixels. 428* The physical addresses of output data must be 16-byte-aligned. 429* The stride must be 16-pixel-aligned. 430*****************************************************************************/ 431HI_S32 HI_MPI_IVE_NCC(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc1, IVE_SRC_IMAGE_S *pstSrc2, 432 IVE_DST_MEM_INFO_S *pstDst, HI_BOOL bInstant); 433 434/***************************************************************************** 435* Prototype : HI_MPI_IVE_CCL 436* Description : Connected Component Labeling. Only 8-Connected method is supported. 437* Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task 438* IVE_IMAGE_S *pstSrcDst Input source 439* IVE_MEM_INFO_S *pstBlob Output result of detected region; 440* IVE_CCL_CTRL_S *pstCclCtrl CCL control parameter 441* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. 442* Return Value : HI_SUCCESS: Success;Error codes: Failure. 443* Spec : The size of the input data ranges from 64x64 pixels to 720x640 pixels. 444* The physical addresses of the input data and output data must be 16-byte-aligned. 445* The stride must be 16-pixel-aligned. 446*****************************************************************************/ 447HI_S32 HI_MPI_IVE_CCL(IVE_HANDLE *pIveHandle, IVE_IMAGE_S *pstSrcDst, IVE_DST_MEM_INFO_S *pstBlob, 448 IVE_CCL_CTRL_S *pstCclCtrl, HI_BOOL bInstant); 449 450/***************************************************************************** 451* Prototype : HI_MPI_IVE_GMM 452* Description : Separate foreground and background using GMM(Gaussian Mixture Model) method; 453* Gray or RGB GMM are supported. 454* Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task 455* IVE_SRC_IMAGE_S *pstSrc Input source. Only support U8C1 or U8C3_PACKAGE input. 456* IVE_DST_IMAGE_S *pstFg Output foreground (Binary) image. 457* IVE_DST_IMAGE_S *pstBg Output background image. Of the sampe type of pstSrc. 458* IVE_MEM_INFO_S *pstModel Model data. 459* IVE_GMM_CTRL_S *pstGmmCtrl Control parameter. 460* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. 461* Return Value : HI_SUCCESS: Success;Error codes: Failure. 462* Spec : The size of the input data ranges from 64x64 pixels to 720x576 pixels. 463* The physical addresses of the input data and output data must be 16-byte-aligned. 464* The stride must be 16-pixel-aligned. 465*****************************************************************************/ 466HI_S32 HI_MPI_IVE_GMM(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc, IVE_DST_IMAGE_S *pstFg, 467 IVE_DST_IMAGE_S *pstBg, IVE_MEM_INFO_S *pstModel, IVE_GMM_CTRL_S *pstGmmCtrl, HI_BOOL bInstant); 468 469/***************************************************************************** 470* Prototype : HI_MPI_IVE_GMM2 471* Description : Separate foreground and background using GMM(Gaussian Mixture Model) method; 472* Gray or RGB GMM are supported. 473* Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task 474* IVE_SRC_IMAGE_S *pstSrc Only U8C1 or U8C3_PACKAGE input are supported. 475* IVE_SRC_IMAGE_S *pstFactor U16C1 input, low-8bits is sensitivity factor, 476* and high-8bits is life update factor. 477* IVE_DST_IMAGE_S *pstFg Output foreground (Binary) image. 478* IVE_DST_IMAGE_S *pstBg Output background image. With same type of pstSrc. 479* IVE_DST_IMAGE_S *pstMatchModelInfo Output U8C1 match model info image. 480* Low-1bit is match flag,and high-7bits is 481* max freq index. 482* IVE_MEM_INFO_S *pstModel Model data. 483* IVE_GMM2_CTRL_S *pstGmm2Ctrl Control parameter. 484* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. 485* Return Value : HI_SUCCESS: Success;Error codes: Failure. 486* Spec : The size of the input data ranges from 64x64 pixels to 1280x720 pixels. 487* The physical addresses of the input data and output data must be 16-byte-aligned. 488* The stride must be 16-pixel-aligned. 489*****************************************************************************/ 490HI_S32 HI_MPI_IVE_GMM2(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc, IVE_SRC_IMAGE_S *pstFactor, 491 IVE_DST_IMAGE_S *pstFg, IVE_DST_IMAGE_S *pstBg, IVE_DST_IMAGE_S *pstMatchModelInfo, IVE_MEM_INFO_S *pstModel, 492 IVE_GMM2_CTRL_S *pstGmm2Ctrl, HI_BOOL bInstant); 493 494/***************************************************************************** 495* Prototype : HI_MPI_IVE_CannyHysEdge 496* Description : The first part of canny Edge detection. Including step: gradient calculation, 497* magnitude and angle calculation, hysteresis threshold, NMS(Non-Maximum Suppression) 498* Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task 499* IVE_SRC_IMAGE_S *pstSrc Input source. Only the U8C1 input 500* format is supported 501* IVE_DST_IMAGE_S *pstEdge Output result. 502* IVE_DST_MEM_INFO_S *pstStack OutPut stack for CannyEdge 503* IVE_CANNY_HYS_EDGE_CTRL_S *pstCannyHysEdgeCtrl Control parameter. 504* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. 505* Return Value : HI_SUCCESS: Success;Error codes: Failure. 506* Spec : The size of the input data ranges from 64x64 pixels to 1920x1024 pixels. 507* The physical addresses of the input data and output data must be 16-byte-aligned. . 508* The stride must be 16-pixel-aligned. 509*****************************************************************************/ 510HI_S32 HI_MPI_IVE_CannyHysEdge(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc, IVE_DST_IMAGE_S *pstEdge, 511 IVE_DST_MEM_INFO_S *pstStack, IVE_CANNY_HYS_EDGE_CTRL_S *pstCannyHysEdgeCtrl, HI_BOOL bInstant); 512 513/***************************************************************************** 514* Prototype : HI_MPI_IVE_CannyEdge 515* Description : The second part of canny Edge detection: trace strong edge by weak edge. 516* Parameters : IVE_IMAGE_S *pstEdge Input and Output source. Only the U8C1 format is supported 517* IVE_MEM_INFO_S *pstStack stack for CannyEdge 518* Return Value : HI_SUCCESS: Success;Error codes: Failure. 519* Spec : The size of the input data ranges from 64x64 pixels to 1920x1024 pixels. 520* The physical addresses of the input data and output data must be 16-byte-aligned. 521* The stride must be 16-pixel-aligned. 522*****************************************************************************/ 523HI_S32 HI_MPI_IVE_CannyEdge(IVE_IMAGE_S *pstEdge, IVE_MEM_INFO_S *pstStack); 524 525/***************************************************************************** 526* Prototype : HI_MPI_IVE_LBP 527* Description : LBP calculation using the original method and a extensional method. 528* Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task 529* IVE_SRC_IMAGE_S *pstSrc Input source.Only the U8C1 input format is supported. 530* IVE_DST_IMAGE_S *pstDst Output result 531* IVE_LBP_CTRL_S *pstLbpCtrl Control parameter 532* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. 533* Return Value : HI_SUCCESS: Success;Error codes: Failure. 534* Spec : The size of the input data ranges from 64x64 pixels to 1920x1024 pixels. 535* The physical addresses of the input data and output data must be 16-byte-aligned. 536* The stride must be 16-pixel-aligned. 537*****************************************************************************/ 538HI_S32 HI_MPI_IVE_LBP(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc, IVE_DST_IMAGE_S *pstDst, 539 IVE_LBP_CTRL_S *pstLbpCtrl, HI_BOOL bInstant); 540 541/***************************************************************************** 542* Prototype : HI_MPI_IVE_NormGrad 543* Description : Gradient calculation and the output is normalized to S8. 544* Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task 545* IVE_SRC_IMAGE_S *pstSrc Input source data 546* IVE_DST_IMAGE_S *pstDstH The (horizontal) result of input image filtered 547* by the input mask 548* IVE_DST_IMAGE_S *pstDstV The (vertical) result of input image filtered 549* by the transposed mask 550* IVE_DST_IMAGE_S *pstDstHV Output the horizontal and vertical component 551* in single image in package format. 552* IVE_NORM_GRAD_CTRL_S *pstNormGradCtrl Control parameter 553* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. 554* Return Value : HI_SUCCESS: Success;Error codes: Failure. 555* Spec : The size of the input data ranges from 64x64 pixels to 1920x1024 pixels. 556* The physical addresses of the input data and output data must be 16-byte-aligned. 557* The stride must be 16-pixel-aligned. 558*****************************************************************************/ 559HI_S32 HI_MPI_IVE_NormGrad(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc, IVE_DST_IMAGE_S *pstDstH, 560 IVE_DST_IMAGE_S *pstDstV, IVE_DST_IMAGE_S *pstDstHV, IVE_NORM_GRAD_CTRL_S *pstNormGradCtrl, HI_BOOL bInstant); 561 562/***************************************************************************** 563* Prototype : HI_MPI_IVE_LKOpticalFlowPyr 564* Description : Calculate LK Optical Flow using multi-layer of the pyramid-images. 565* Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task 566* IVE_SRC_IMAGE_S astSrcPrevPyr Prev-frame's pyramid. 567* Must be U8C1 images. 568* IVE_SRC_IMAGE_S astSrcNextPyr Next-frame's pyramid. Same size and 569* type with astSrcPrePyr. 570* IVE_SRC_MEM_INFO_S *pstPrevPts Intresting points on astSrcPrePyr[0]. 571* IVE_MEM_INFO_S *pstNextPts Output points. When bUseInitFlow is 572* true, must have the same size of 573* pstPrevPts as input. 574* IVE_LK_OPTICAL_FLOW_PYR_CTRL_S *pstLkOptiFlowCtrl Control parameters. 575* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. 576* Return Value : HI_SUCCESS: Success;Error codes: Failure. 577* Spec : The size of the input data ranges from 64x64 pixels to 1280x720 pixels. 578* The physical addresses of the input data and output data must be 16-byte-aligned. 579* The stride must be 16-pixel-aligned. 580****************************************************************************/ 581HI_S32 HI_MPI_IVE_LKOpticalFlowPyr(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S astSrcPrevPyr[], 582 IVE_SRC_IMAGE_S astSrcNextPyr[], IVE_SRC_MEM_INFO_S *pstPrevPts, IVE_MEM_INFO_S *pstNextPts, 583 IVE_DST_MEM_INFO_S *pstStatus, IVE_DST_MEM_INFO_S *pstErr, IVE_LK_OPTICAL_FLOW_PYR_CTRL_S *pstLkOptiFlowPyrCtrl, 584 HI_BOOL bInstant); 585 586/***************************************************************************** 587* Prototype : HI_MPI_IVE_STCandiCorner 588* Description : The first part of corners detection using Shi-Tomasi-like method: calculate 589* candidate corners. 590* Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task 591* IVE_SRC_IMAGE_S *pstSrc Input source data 592* IVE_DST_IMAGE_S *pstCandiCorner Output result of eig 593* IVE_ST_CANDI_CORNER_CTRL_S *pstStCandiCornerCtrl Control parameter 594* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. 595* Return Value : HI_SUCCESS: Success;Error codes: Failure. 596* Spec : The size of the input data ranges from 64x64 pixels to 720x576 pixels. 597* The physical addresses of the input data and output data must be 16-byte-aligned. 598* The stride must be 16-pixel-aligned. 599*****************************************************************************/ 600HI_S32 HI_MPI_IVE_STCandiCorner(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc, 601 IVE_DST_IMAGE_S *pstCandiCorner, IVE_ST_CANDI_CORNER_CTRL_S *pstStCandiCornerCtrl, HI_BOOL bInstant); 602 603/***************************************************************************** 604* Prototype : HI_MPI_IVE_STCorner 605* Description : The second part of corners detection using Shi-Tomasi-like method: 606* select corners by certain rules. 607* IVE_SRC_IMAGE_S *pstCandiCorner Input source data 608* IVE_DST_MEM_INFO_S *pstCorner Output result of Corner 609* IVE_ST_CORNER_CTRL_S *pstStCornerCtrl Control parameter 610* Return Value : HI_SUCCESS: Success;Error codes: Failure. 611* Spec : The size of the input data ranges from 64x64 pixels to 720x576 pixels. 612* The physical addresses of the input data and output data must be 16-byte-aligned. 613* The stride must be 16-pixel-aligned. 614*****************************************************************************/ 615HI_S32 HI_MPI_IVE_STCorner(IVE_SRC_IMAGE_S *pstCandiCorner, IVE_DST_MEM_INFO_S *pstCorner, 616 IVE_ST_CORNER_CTRL_S *pstStCornerCtrl); 617 618/***************************************************************************** 619* Prototype : HI_MPI_IVE_GradFg 620* Description : 621* Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task 622* IVE_SRC_IMAGE_S *pstBgDiffFg Background subtraction foreground image 623* IVE_SRC_IMAGE_S *pstCurGrad Current gradient image, both horizontally and vertically 624* graded in accordance with [xyxyxy ...] format 625* IVE_SRC_IMAGE_S *pstBgGrad Background gradient image 626* IVE_DST_IMAGE_S *pstGradFg Gradient foreground image 627* IVE_GRAD_FG_CTRL_S *pstGradFgCtrl Gradient calculation parameters 628* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. 629* Return Value : HI_SUCCESS: Success;Error codes: Failure. 630* Spec : None 631*****************************************************************************/ 632HI_S32 HI_MPI_IVE_GradFg(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstBgDiffFg, IVE_SRC_IMAGE_S *pstCurGrad, 633 IVE_SRC_IMAGE_S *pstBgGrad, IVE_DST_IMAGE_S *pstGradFg, IVE_GRAD_FG_CTRL_S *pstGradFgCtrl, HI_BOOL bInstant); 634 635/***************************************************************************** 636* Prototype : HI_MPI_IVE_MatchBgModel 637* Description : 638* Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task 639* IVE_SRC_IMAGE_S *pstCurImg Current grayscale image 640* IVE_DATA_S *pstBgModel Background model data 641* IVE_IMAGE_S *pstFgFlag Foreground status image 642* IVE_DST_IMAGE_S *pstBgDiffFg Foreground image obtained by background 643* matching, the background pixel value 644* is 0, the foreground pixel value is 645* the gray difference value 646* IVE_DST_IMAGE_S *pstFrmDiffFg Foreground image obtained by interframe 647* difference, the background pixel value 648* is 0, the foreground pixel value is 649* the gray difference value 650* IVE_DST_MEM_INFO_S *pstStatData Result status data 651* IVE_MATCH_BG_MODEL_CTRL_S *pstMatchBgModelCtrl Background matching parameters 652* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. 653* Return Value : HI_SUCCESS: Success;Error codes: Failure. 654* Spec : None 655*****************************************************************************/ 656HI_S32 HI_MPI_IVE_MatchBgModel(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstCurImg, IVE_DATA_S *pstBgModel, 657 IVE_IMAGE_S *pstFgFlag, IVE_DST_IMAGE_S *pstBgDiffFg, IVE_DST_IMAGE_S *pstFrmDiffFg, 658 IVE_DST_MEM_INFO_S *pstStatData, IVE_MATCH_BG_MODEL_CTRL_S *pstMatchBgModelCtrl, HI_BOOL bInstant); 659 660/***************************************************************************** 661* Prototype : HI_MPI_IVE_UpdateBgModel 662* Description : 663* Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task 664* IVE_DATA_S *pstBgModel Background model data 665* IVE_IMAGE_S *pstFgFlag Foreground status image 666* IVE_DST_IMAGE_S *pstBgImg Background grayscale image 667* IVE_DST_IMAGE_S *pstChgStaImg Change state life image, 668* for still detection 669* IVE_DST_IMAGE_S *pstChgStaFg Change state grayscale image, 670* for still detection 671* IVE_DST_IMAGE_S *pstChgStaLife Change state foreground image, 672* for still detection 673* IVE_DST_MEM_INFO_S *pstStatData result status data 674* IVE_UPDATE_BG_MODEL_CTRL_S *pstUpdateBgModelCtrl Background update parameters 675* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. 676* Return Value : HI_SUCCESS: Success;Error codes: Failure. 677* Spec : None 678*****************************************************************************/ 679HI_S32 HI_MPI_IVE_UpdateBgModel(IVE_HANDLE *pIveHandle, IVE_DATA_S *pstBgModel, IVE_IMAGE_S *pstFgFlag, 680 IVE_DST_IMAGE_S *pstBgImg, IVE_DST_IMAGE_S *pstChgStaImg, IVE_DST_IMAGE_S *pstChgStaFg, 681 IVE_DST_IMAGE_S *pstChgStaLife, IVE_DST_MEM_INFO_S *pstStatData, IVE_UPDATE_BG_MODEL_CTRL_S *pstUpdateBgModelCtrl, 682 HI_BOOL bInstant); 683 684/***************************************************************************** 685* Prototype : HI_MPI_IVE_ANN_MLP_LoadModel 686* Description : Load ANN_MLP model data from ".bin" file. 687* Parameters : HI_CHAR *pchFileName ANN_MLP model file name, must be ".bin" file. 688* IVE_ANN_MLP_MODEL_S *pstAnnMlpModel ANN_MLP model data. 689* Return Value : HI_SUCCESS: Success;Error codes: Failure. 690* Spec : None 691*****************************************************************************/ 692HI_S32 HI_MPI_IVE_ANN_MLP_LoadModel(const HI_CHAR *pchFileName, IVE_ANN_MLP_MODEL_S *pstAnnMlpModel); 693 694/***************************************************************************** 695* Prototype : HI_MPI_IVE_ANN_MLP_UnloadModel 696* Description : Unload ANN_MLP model data. 697* Parameters : IVE_ANN_MLP_MODEL_S *pstAnnMlpModel ANN_MLP model data. 698* Return Value : HI_SUCCESS: Success;Error codes: Failure. 699* Spec : None 700*****************************************************************************/ 701HI_VOID HI_MPI_IVE_ANN_MLP_UnloadModel(IVE_ANN_MLP_MODEL_S *pstAnnMlpModel); 702 703/***************************************************************************** 704* Prototype : HI_MPI_IVE_ANN_MLP_Predict 705* Description : 706* Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task 707* IVE_SRC_DATA_S *pstSrc Input samples 708* IVE_SRC_MEM_INFO_S *pstActivFuncTable Look-up talbe for active function 709* IVE_ANN_MLP_MODEL_S *pstAnnMlpModel ANN_MLP model 710* IVE_DST_DATA_S *pstDst Output layers of every intput sample 711* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. 712* Return Value : HI_SUCCESS: Success;Error codes: Failure. 713* Spec : None 714*****************************************************************************/ 715HI_S32 HI_MPI_IVE_ANN_MLP_Predict(IVE_HANDLE *pIveHandle, IVE_SRC_DATA_S *pstSrc, 716 IVE_LOOK_UP_TABLE_S *pstActivFuncTab, IVE_ANN_MLP_MODEL_S *pstAnnMlpModel, IVE_DST_DATA_S *pstDst, 717 HI_BOOL bInstant); 718 719/***************************************************************************** 720* Prototype : HI_MPI_IVE_SVM_LoadModel 721* Description : Load SVM model data from ".bin" file. 722* Parameters : HI_CHAR *pchFileName SVM model file name, must be ".bin" file. 723* IVE_SVM_MODEL_S *pstSvmModel SVM model data. 724* Return Value : HI_SUCCESS: Success;Error codes: Failure. 725* Spec : None 726*****************************************************************************/ 727HI_S32 HI_MPI_IVE_SVM_LoadModel(const HI_CHAR *pchFileName, IVE_SVM_MODEL_S *pstSvmModel); 728 729/***************************************************************************** 730* Prototype : HI_MPI_IVE_SVM_UnloadModel 731* Description : Unload SVM model data. 732* Parameters : IVE_SVM_MODEL_S *pstSvmModel SVM model data. 733* Return Value : HI_SUCCESS: Success;Error codes: Failure. 734* Spec : None 735*****************************************************************************/ 736HI_VOID HI_MPI_IVE_SVM_UnloadModel(IVE_SVM_MODEL_S *pstSvmModel); 737 738/***************************************************************************** 739* Prototype : HI_MPI_IVE_SVM_Predict 740* Description : 741* Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task 742* IVE_SRC_DATA_S *pstSrc Input sample 743* IVE_SRC_MEM_INFO_S *pstKernelTable Look-up talbe for active function 744* IVE_SVM_MODEL_S *pstSvmModel SVM model 745* IVE_SRC_DATA_S *pstDstVote Output Votes' array of each class 746* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. 747* Return Value : HI_SUCCESS: Success;Error codes: Failure. 748* Spec : None 749*****************************************************************************/ 750HI_S32 HI_MPI_IVE_SVM_Predict(IVE_HANDLE *pIveHandle, IVE_SRC_DATA_S *pstSrc, IVE_LOOK_UP_TABLE_S *pstKernelTab, 751 IVE_SVM_MODEL_S *pstSvmModel, IVE_DST_DATA_S *pstDstVote, HI_BOOL bInstant); 752 753/***************************************************************************** 754* Prototype : HI_MPI_IVE_SAD 755* Description : Sum of absolute differences. 756* Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task 757* IVE_SRC_IMAGE_S *pstSrc1 The input source1.Only the U8C1 input format is supported. 758* IVE_SRC_IMAGE_S *pstSrc2 The input source2.Only the U8C1 input format is supported. 759* IVE_DST_IMAGE_S *pstSad Output result of sad value.Only the U8C1/U16C1 format is 760* supported. 761* IVE_DST_IMAGE_S *pstThr Output result of thresh.Only the U8C1 format is supported. 762* IVE_SAD_CTRL_S *pstSadCtrl Control parameter 763* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. 764* Return Value : HI_SUCCESS: Success;Error codes: Failure. 765* Spec : The size of the input data ranges from 64x64 pixels to 1920x1080 pixels. 766* The stride must be 16-pixel-aligned. 767* The types, widths, heights of two input sources must be the same. 768*****************************************************************************/ 769HI_S32 HI_MPI_IVE_SAD(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc1, IVE_SRC_IMAGE_S *pstSrc2, 770 IVE_DST_IMAGE_S *pstSad, IVE_DST_IMAGE_S *pstThr, IVE_SAD_CTRL_S *pstSadCtrl, HI_BOOL bInstant); 771 772/***************************************************************************** 773* Prototype : HI_MPI_IVE_Resize 774* Description : Resize. 775* Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task 776* IVE_SRC_IMAGE_S astSrc[] The input source.Only the U8C1/U8C3_PLANAR input format 777* is supported. 778* IVE_DST_IMAGE_S astDst[] Output result.Only the U8C1/U8C3_PLANAR format is 779* supported. 780* IVE_RESIZE_CTRL_S *pstResizeCtrl Control parameter 781* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. 782* Return Value : HI_SUCCESS: Success;Error codes: Failure. 783* Spec : The size of the input data ranges from 32x16 pixels to 1920x1080 pixels. 784* The stride must be 16-pixel-aligned. 785*****************************************************************************/ 786HI_S32 HI_MPI_IVE_Resize(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S astSrc[], IVE_DST_IMAGE_S astDst[], 787 IVE_RESIZE_CTRL_S *pstResizeCtrl, HI_BOOL bInstant); 788 789/***************************************************************************** 790* Prototype : HI_MPI_IVE_CNN_LoadModel 791* Description : Load CNN model data from ".bin" file. 792* Parameters : HI_CHAR *pchFileName CNN model file name, must be ".bin" file. 793* IVE_CNN_MODEL_S *pstCnnModel CNN model data. 794* Return Value : HI_SUCCESS: Success;Error codes: Failure. 795* Spec : None 796*****************************************************************************/ 797HI_S32 HI_MPI_IVE_CNN_LoadModel(const HI_CHAR *pchFileName, IVE_CNN_MODEL_S *pstCnnModel); 798 799/***************************************************************************** 800* Prototype : HI_MPI_IVE_CNN_UnloadModel 801* Description : Unload CNN model data and release memory. 802* Parameters : IVE_CNN_MODEL_S *pstCnnModel CNN model data. 803* Return Value : HI_SUCCESS: Success;Error codes: Failure. 804* Spec : None 805*****************************************************************************/ 806HI_VOID HI_MPI_IVE_CNN_UnloadModel(IVE_CNN_MODEL_S *pstCnnModel); 807 808/***************************************************************************** 809* Prototype : HI_MPI_IVE_CNN_Predict 810* Description : Perform CNN prediction on input sample(s), and output responses for 811* corresponding sample(s) 812* Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task 813* IVE_SRC_IMAGE_S astSrc[] Input images array. Only the U8C1 and U8C3_PLANAR input 814* are supported 815* IVE_CNN_MODEL_S *pstCnnModel CNN model data 816* IVE_CNN_CTRL_S *pstCnnCtrl CNN control parameter 817* IVE_DST_DATA_S *pstDst Output vectors of CNN_Predict 818* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. 819* Return Value : HI_SUCCESS: Success; Error codes: Failure. 820* Spec : The stride must be 16-pixel-aligned. 821* The types, widths, heights and strides of input images must be the same. 822*****************************************************************************/ 823HI_S32 HI_MPI_IVE_CNN_Predict(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S astSrc[], IVE_CNN_MODEL_S *pstCnnModel, 824 IVE_DST_DATA_S *pstDst, IVE_CNN_CTRL_S *pstCnnCtrl, HI_BOOL bInstant); 825 826/***************************************************************************** 827* Prototype : HI_MPI_IVE_CNN_GetResult 828* Description : Calculate classification and confidence with CNN output by softmax regression. 829* Parameters : IVE_SRC_DATA_S *pstSrc The result of CNN_Predict output. 830* IVE_DST_MEM_INFO_S *pstDst The prediction about classification label 831* index and confidence. 832* IVE_CNN_MODEL_S *pstpstCnnModel CNN model data 833* IVE_CNN_CTRL_S *pstCnnCtrl CNN control parameter 834* Return Value : HI_SUCCESS: Success;Error codes: Failure. 835* Spec : None 836*****************************************************************************/ 837HI_S32 HI_MPI_IVE_CNN_GetResult(IVE_SRC_DATA_S *pstSrc, IVE_DST_MEM_INFO_S *pstDst, 838 IVE_CNN_MODEL_S *pstCnnModel, IVE_CNN_CTRL_S *pstCnnCtrl); 839 840/***************************************************************************** 841* Prototype : HI_MPI_IVE_PerspTrans 842* Description : Perspective transform 843* Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task. 844* IVE_SRC_IMAGE_S *pstSrc The input source.Only the U8C1/YUVSP420 input 845* format is supported. 846* IVE_RECT_U32_S astRoi[] Roi array. 847* IVE_SRC_MEM_INFO_S astPointPair[] Point pair array. 848* IVE_DST_IMAGE_S astDst[] Output result.Only the U8C1/YUVSP420/ 849* U8C3_PACKAGE format is supported. 850* IVE_PERSP_TRANS_CTRL_S *pstPerspTransCtrl PerspTrans control parameter. 851* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. 852* Return Value : HI_SUCCESS: Success;Error codes: Failure. 853* Spec : The stride must be 16-pixel-aligned. 854*****************************************************************************/ 855HI_S32 HI_MPI_IVE_PerspTrans(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc, IVE_RECT_U32_S astRoi[], 856 IVE_SRC_MEM_INFO_S astPointPair[], IVE_DST_IMAGE_S astDst[], IVE_PERSP_TRANS_CTRL_S *pstPerspTransCtrl, 857 HI_BOOL bInstant); 858 859/***************************************************************************** 860* Prototype : HI_MPI_IVE_KCF_GetMemSize 861* Description : KCF get object memory size 862* Parameters : HI_U32 u32MaxObjNum The maximum numbers of tracking object. 863* HI_U32 *pu32Size memmory size. 864* Return Value : HI_SUCCESS: Success;Error codes: Failure. 865* Spec : None 866*****************************************************************************/ 867HI_S32 HI_MPI_IVE_KCF_GetMemSize(HI_U32 u32MaxObjNum, HI_U32 *pu32Size); 868 869/***************************************************************************** 870* Prototype : HI_MPI_IVE_KCF_CreateObjList 871* Description : KCF creste object list 872* Parameters : IVE_MEM_INFO_S *pstMem The memory of object for object list. 873* HI_U32 u32MaxObjNum The maximum numbers of tracking object (list node). 874* IVE_KCF_OBJ_LIST_S *pstObjList The object list. 875* Return Value : HI_SUCCESS: Success;Error codes: Failure. 876* Spec : None 877*****************************************************************************/ 878HI_S32 HI_MPI_IVE_KCF_CreateObjList(IVE_MEM_INFO_S *pstMem, HI_U32 u32MaxObjNum, 879 IVE_KCF_OBJ_LIST_S *pstObjList); 880 881/***************************************************************************** 882* Prototype : HI_MPI_IVE_KCF_DestroyObjList 883* Description : KCF destroy object list 884* Parameters : IVE_KCF_OBJ_LIST_S *pstObjList The object list. 885* 886* Return Value : HI_SUCCESS: Success;Error codes: Failure. 887* Spec : None 888*****************************************************************************/ 889HI_S32 HI_MPI_IVE_KCF_DestroyObjList(IVE_KCF_OBJ_LIST_S *pstObjList); 890 891/***************************************************************************** 892* Prototype : HI_MPI_IVE_KCF_CreateGaussPeak 893* Description : KCF calculate gauss peak 894* Parameters : HI_U3Q5 u3q5Padding The multiple of roi rectangle's width and height. 895* IVE_DST_MEM_INFO_S *pstGaussPeak The memory of gauss peak. 896* Return Value : HI_SUCCESS: Success;Error codes: Failure. 897* Spec : None 898*****************************************************************************/ 899HI_S32 HI_MPI_IVE_KCF_CreateGaussPeak(HI_U3Q5 u3q5Padding, IVE_DST_MEM_INFO_S *pstGaussPeak); 900 901/***************************************************************************** 902* Prototype : HI_MPI_IVE_KCF_CreateCosWin 903* Description : KCF calculate cos window x and y. 904* Parameters : IVE_DST_MEM_INFO_S *pstCosWinX The memory of cos window x. 905* IVE_DST_MEM_INFO_S *pstCosWinY The memory of cos window y. 906* Return Value : HI_SUCCESS: Success;Error codes: Failure. 907* Spec : None 908*****************************************************************************/ 909HI_S32 HI_MPI_IVE_KCF_CreateCosWin(IVE_DST_MEM_INFO_S *pstCosWinX, IVE_DST_MEM_INFO_S *pstCosWinY); 910 911/***************************************************************************** 912* Prototype : HI_MPI_IVE_KCF_GetTrainObj 913* Description : KCF get train object. 914* Parameters : HI_U3Q5 u3q5Padding The multiple of roi rectangle's width and height. 915* IVE_ROI_INFO_S astRoiInfo[] The array of roi information. 916* HI_U32 u32ObjNum The numbers of RoiInfo and object. 917* IVE_MEM_INFO_S *pstCosWinX The memory of cos window x. 918* IVE_MEM_INFO_S *pstCosWinY The memory of cos window y. 919* IVE_MEM_INFO_S *pstGaussPeak The memory of gauss peak. 920* IVE_KCF_OBJ_LIST_S *pstObjList The object list. 921* Return Value : HI_SUCCESS: Success;Error codes: Failure. 922* Spec : None 923*****************************************************************************/ 924HI_S32 HI_MPI_IVE_KCF_GetTrainObj(HI_U3Q5 u3q5Padding, IVE_ROI_INFO_S astRoiInfo[], HI_U32 u32ObjNum, 925 IVE_MEM_INFO_S *pstCosWinX, IVE_MEM_INFO_S *pstCosWinY, IVE_MEM_INFO_S *pstGaussPeak, 926 IVE_KCF_OBJ_LIST_S *pstObjList); 927 928/***************************************************************************** 929* Prototype : HI_MPI_IVE_KCF_Process 930* Description : KCF process. 931* Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task 932* IVE_SRC_IMAGE_S *pstSrc Input source.Only the YUV420SP inpu format is supported. 933* IVE_KCF_OBJ_LIST_S *pstObjList The object list. 934* IVE_KCF_PRO_CTRL_S *pstKcfProCtrl Control parameter. 935* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. 936* Return Value : HI_SUCCESS: Success;Error codes: Failure. 937* Spec : None 938*****************************************************************************/ 939HI_S32 HI_MPI_IVE_KCF_Process(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc, IVE_KCF_OBJ_LIST_S *pstObjList, 940 IVE_KCF_PRO_CTRL_S *pstKcfProCtrl, HI_BOOL bInstant); 941 942/***************************************************************************** 943* Prototype : HI_MPI_IVE_KCF_GetObjBbox 944* Description : KCF get track object bbox information. 945* Parameters : IVE_KCF_OBJ_LIST_S *pstObjList The object list. 946* IVE_KCF_BBOX_S astBbox The output bbox of object. 947* HI_U32 *pu32BboxObjNum The valid numbers of output bbox. 948* IVE_KCF_BBOX_CTRL_S *pstKcfBboxCtrl Control parameter. 949* Return Value : HI_SUCCESS: Success;Error codes: Failure. 950* Spec : None 951*****************************************************************************/ 952HI_S32 HI_MPI_IVE_KCF_GetObjBbox(IVE_KCF_OBJ_LIST_S *pstObjList, IVE_KCF_BBOX_S astBbox[], 953 HI_U32 *pu32BboxObjNum, IVE_KCF_BBOX_CTRL_S *pstKcfBboxCtrl); 954 955/***************************************************************************** 956* Prototype : HI_MPI_IVE_KCF_JudgeObjBboxTrackState 957* Description : KCF judge object tracking state. 958* Parameters : IVE_KCF_OBJ_LIST_S *pstObjList The object list. 959* IVE_KCF_BBOX_S *pstBbox The bbox of object. 960* HI_BOOL *pbTrackOk The tracking state of object. 961* Return Value : HI_SUCCESS: Success;Error codes: Failure. 962* Spec : None 963*****************************************************************************/ 964HI_S32 HI_MPI_IVE_KCF_JudgeObjBboxTrackState(IVE_ROI_INFO_S *pstRoiInfo, IVE_KCF_BBOX_S *pstBbox, 965 HI_BOOL *pbTrackOk); 966 967/***************************************************************************** 968* Prototype : HI_MPI_IVE_KCF_ObjUpdate 969* Description : KCF update object. 970* Parameters : IVE_KCF_OBJ_LIST_S *pstObjList The object list. 971* IVE_KCF_BBOX_S astBbox The bbox information of update object. 972* HI_U32 u32BboxObjNum The update numbers of bbox. 973* Return Value : HI_SUCCESS: Success;Error codes: Failure. 974* Spec : None 975*****************************************************************************/ 976HI_S32 HI_MPI_IVE_KCF_ObjUpdate(IVE_KCF_OBJ_LIST_S *pstObjList, IVE_KCF_BBOX_S astBbox[], 977 HI_U32 u32BboxObjNum); 978 979/***************************************************************************** 980* Prototype : HI_MPI_IVE_Hog 981* Description : get Hog feature. 982* Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task. 983* IVE_SRC_IMAGE_S *pstSrc Input source.Only the YUV420SP inpu format is supported. 984* IVE_RECT_U32_S astRoi[] The array of roi. 985* IVE_DST_BLOB_S astDst[] The array of Hog feature. 986* IVE_HOG_CTRL_S *pstHogCtrl Control parameter. 987* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. 988* Return Value : HI_SUCCESS: Success;Error codes: Failure. 989* Spec : None 990*****************************************************************************/ 991HI_S32 HI_MPI_IVE_Hog(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc, IVE_RECT_U32_S astRoi[], 992 IVE_DST_BLOB_S astDst[], IVE_HOG_CTRL_S *pstHogCtrl, HI_BOOL bInstant); 993 994/***************************************************************************** 995* Prototype : HI_MPI_IVE_Query 996* Description : This API is used to query the status of a called function by using the returned 997* IveHandle of the function. In block mode, the system waits until the function that 998* is being queried is called. In non-block mode, the current status is queried and 999* no action is taken. 1000* Parameters : IVE_HANDLE IveHandle IveHandle of a called function. It is entered by users. 1001* HI_BOOL *pbFinish Returned status 1002* HI_BOOL bBlock Flag indicating the block mode or non-block mode 1003* Return Value : HI_SUCCESS: Success;Error codes: Failure. 1004* Spec : None 1005*****************************************************************************/ 1006HI_S32 HI_MPI_IVE_Query(IVE_HANDLE IveHandle, HI_BOOL *pbFinish, HI_BOOL bBlock); 1007 1008/***************************************************************************** 1009* Prototype : HI_MPI_IVE_Query_Timeout 1010* Description : This API is used to query the status of a called function by using the returned 1011* IveHandle of the function. The system waits until it is timeout. It is never 1012* timeout when the s32MilliSec is -1. 1013* Parameters : IVE_HANDLE IveHandle IveHandle of a called function. It is entered by users. 1014* HI_S32 s32MilliSec Wait time,millisecond 1015* HI_BOOL *pbFinish Returned status 1016* Return Value : HI_SUCCESS: Success;Error codes: Failure. 1017* Spec : None 1018*****************************************************************************/ 1019HI_S32 HI_MPI_IVE_Query_Timeout(IVE_HANDLE IveHandle, HI_S32 s32MilliSec, HI_BOOL *pbFinish); 1020 1021#ifdef __cplusplus 1022#if __cplusplus 1023} 1024#endif 1025#endif 1026#endif