sdc_os_api.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. /******************************************************************************
  2. 版权所有 (C), 2019-2029, SDC OS 开源软件小组所有
  3. ******************************************************************************
  4. 文 件 名 : sdc_os_api.h
  5. 版 本 号 : 初稿
  6. 作 者 : jelly
  7. 生成日期 : 2019年6月8日
  8. 最近修改 :
  9. 功能描述 : sdc_os_api.c 的头文件
  10. 函数列表 :
  11. 修改历史 :
  12. 1.日 期 : 2019年6月8日
  13. 作 者 : jelly
  14. 修改内容 : 创建文件
  15. ******************************************************************************/
  16. /*----------------------------------------------*
  17. * 包含头文件 *
  18. *----------------------------------------------*/
  19. /*----------------------------------------------*
  20. * 外部变量说明 *
  21. *----------------------------------------------*/
  22. /*----------------------------------------------*
  23. * 外部函数原型说明 *
  24. *----------------------------------------------*/
  25. /*----------------------------------------------*
  26. * 内部函数原型说明 *
  27. *----------------------------------------------*/
  28. /*----------------------------------------------*
  29. * 全局变量 *
  30. *----------------------------------------------*/
  31. /*----------------------------------------------*
  32. * 模块级变量 *
  33. *----------------------------------------------*/
  34. /*----------------------------------------------*
  35. * 常量定义 *
  36. *----------------------------------------------*/
  37. /*----------------------------------------------*
  38. * 宏定义 *
  39. *----------------------------------------------*/
  40. #ifndef __SDC_OS_API_H__
  41. #define __SDC_OS_API_H__
  42. #include "sdc.h"
  43. #include "sample_comm_nnie.h"
  44. #ifdef __cplusplus
  45. #if __cplusplus
  46. extern "C"{
  47. #endif
  48. #endif /* __cplusplus */
  49. #define YUV_CHANNEL_LEN (3)
  50. typedef struct YUV_FRAME
  51. {
  52. UINT32 uWidth;
  53. UINT32 uHeight;
  54. //VW_PIXEL_FORMAT_E enPixelFormat;
  55. int enPixelFormat;
  56. UINT64 ulPhyAddr[YUV_CHANNEL_LEN];
  57. UINT64 ulVirAddr[YUV_CHANNEL_LEN];
  58. UINT32 uStride[YUV_CHANNEL_LEN];
  59. UINT64 ullpts;
  60. UINT32 uVbBlk;
  61. UINT32 uPoolId;
  62. char* pYuvImgAddr;
  63. UINT32 uFrmSize;
  64. } VW_YUV_FRAME_S;
  65. /*stack for sort*/
  66. typedef struct hiSAMPLE_SVP_NNIE_STACK
  67. {
  68. HI_S32 s32Min;
  69. HI_S32 s32Max;
  70. } SAMPLE_SVP_NNIE_STACK_S;
  71. #define SAMPLE_SVP_NNIE_COORDI_NUM 4 /*coordinate numbers*/
  72. #define SAMPLE_SVP_NNIE_HALF 0.5f /*the half value*/
  73. #define SAMPLE_SVP_NNIE_MAX(a,b) (((a) > (b)) ? (a) : (b))
  74. #define SAMPLE_SVP_NNIE_MIN(a,b) (((a) < (b)) ? (a) : (b))
  75. #define SAMPLE_SVP_NNIE_PROPOSAL_WIDTH 6 /*the number of proposal values*/
  76. #define SAMPLE_SVP_NNIE_QUANT_BASE 4096 /*the base value*/
  77. extern int SDC_SVP_ForwardBGR(HI_CHAR *pcSrcBGR, SDC_SSD_RESULT_S *pstResult);
  78. extern int SDC_SVP_ForwardYUV(HI_CHAR *pcSrcYUV, SDC_SSD_RESULT_S *pstResult);
  79. extern void SDC_DisplayExtendHead(sdc_extend_head_s* extendhead);
  80. extern void SDC_DisplayYuvData(sdc_yuv_data_s* yuv_data);
  81. extern int SDC_GetHardWareId(sdc_hardware_id_s *pstHardWareParas);
  82. extern int SDC_LoadModel(unsigned int uiLoadMode, char *pucModelFileName, SVP_NNIE_MODEL_S *pstModel);
  83. extern int SDC_MemAlloc(int fd, unsigned int size, int uiCacheFlag, sdc_mmz_alloc_s* pstMemParas);
  84. extern void SDC_MemFree(int fd, sdc_mmz_alloc_s* pstMemParas);
  85. extern int SDC_ModelDecript(sdc_mmz_alloc_s *pstMmzAddr);
  86. extern int SDC_Nnie_Forward(sdc_nnie_forward_s *p_sdc_nnie_forward);
  87. extern int SDC_Nnie_Forward_Withbox(sdc_nnie_forward_withbox_s *p_sdc_nnie_forward_withbox);
  88. extern int SDC_ServiceCreate(void);
  89. extern int SDC_UnLoadModel(SVP_NNIE_MODEL_S *pstModel);
  90. extern int SDC_YuvChnAttrGet(int fd);
  91. extern int SDC_YuvChnAttrSet(int fd, int uiYuvChnId);
  92. extern void SDC_YuvDataFree(int fd, sdc_yuv_data_s *yuv_data);
  93. extern int SDC_YuvDataReq(int fd, int extendheadflag, unsigned int uiChnId, unsigned int uiMaxUsedBufNum);
  94. extern int SDC_LoadModel_test(unsigned int uiLoadMode, char *pucModelFileName, SVP_NNIE_MODEL_S *pstModel);
  95. extern HI_S32 SAMPLE_SVP_NNIE_Yolov3_ParamInit(int fd, SAMPLE_SVP_NNIE_CFG_S* pstCfg,
  96. SAMPLE_SVP_NNIE_PARAM_S *pstNnieParam, SAMPLE_SVP_NNIE_YOLOV3_SOFTWARE_PARAM_S* pstSoftWareParam);
  97. extern HI_S32 SAMPLE_COMM_SVP_SysInit(HI_VOID);
  98. extern int SDC_TransYUV2RGB(int fd, sdc_yuv_frame_s *yuv, sdc_yuv_frame_s *rgb);
  99. extern void SDC_Struct2RGB(sdc_yuv_frame_s *pstSdcRGBFrame, VW_YUV_FRAME_S *pstRGBFrameData);
  100. extern int SDC_TransYUV2RGBRelease(int fd, sdc_yuv_frame_s *rgb);
  101. extern int SDC_YuvChnAttrGetIdleYuvChn(int fd, unsigned int *puiChnId);
  102. #ifdef __cplusplus
  103. #if __cplusplus
  104. }
  105. #endif
  106. #endif /* __cplusplus */
  107. #endif /* __SDC_OS_API_H__ */