11bd4fe43Sopenharmony_ci/* 21bd4fe43Sopenharmony_ci * Copyright (c) 2022 HiSilicon (Shanghai) Technologies CO., LIMITED. 31bd4fe43Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 41bd4fe43Sopenharmony_ci * you may not use this file except in compliance with the License. 51bd4fe43Sopenharmony_ci * You may obtain a copy of the License at 61bd4fe43Sopenharmony_ci * 71bd4fe43Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 81bd4fe43Sopenharmony_ci * 91bd4fe43Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 101bd4fe43Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 111bd4fe43Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 121bd4fe43Sopenharmony_ci * See the License for the specific language governing permissions and 131bd4fe43Sopenharmony_ci * limitations under the License. 141bd4fe43Sopenharmony_ci */ 151bd4fe43Sopenharmony_ci 161bd4fe43Sopenharmony_ci#ifndef __HI_COMM_SYS_H__ 171bd4fe43Sopenharmony_ci#define __HI_COMM_SYS_H__ 181bd4fe43Sopenharmony_ci 191bd4fe43Sopenharmony_ci#include "hi_type.h" 201bd4fe43Sopenharmony_ci#include "hi_errno.h" 211bd4fe43Sopenharmony_ci#include "hi_debug.h" 221bd4fe43Sopenharmony_ci#include "hi_comm_video.h" 231bd4fe43Sopenharmony_ci 241bd4fe43Sopenharmony_ci#ifdef __cplusplus 251bd4fe43Sopenharmony_ciextern "C" { 261bd4fe43Sopenharmony_ci#endif /* End of #ifdef __cplusplus */ 271bd4fe43Sopenharmony_ci 281bd4fe43Sopenharmony_ci#define BIND_DEST_MAXNUM 64 291bd4fe43Sopenharmony_ci#define HI_UNIQUE_ID_NUM 6 301bd4fe43Sopenharmony_ci#define HI_GPS_ACCURACY_LEVEL 3 /* dd/mm/ss */ 311bd4fe43Sopenharmony_ci#define HI_GPS_NUMBER_DIMENSION 2 /* numerator/denominator */ 321bd4fe43Sopenharmony_ci 331bd4fe43Sopenharmony_citypedef struct hiVPSS_VENC_WRAP_PARAM_S { 341bd4fe43Sopenharmony_ci HI_BOOL bAllOnline; 351bd4fe43Sopenharmony_ci /* 361bd4fe43Sopenharmony_ci * Input frame rate of VIPROC(linear/Frame mode WDR is the sensor frame rate, 371bd4fe43Sopenharmony_ci * and the line mode WDR is the frame rate after synthesis) 381bd4fe43Sopenharmony_ci */ 391bd4fe43Sopenharmony_ci HI_U32 u32FrameRate; 401bd4fe43Sopenharmony_ci HI_U32 u32FullLinesStd; /* Total height of sensor, include of VBlank */ 411bd4fe43Sopenharmony_ci 421bd4fe43Sopenharmony_ci SIZE_S stLargeStreamSize; /* VENC Large Stream Size */ 431bd4fe43Sopenharmony_ci SIZE_S stSmallStreamSize; /* VENC Small Stream Size */ 441bd4fe43Sopenharmony_ci} VPSS_VENC_WRAP_PARAM_S; 451bd4fe43Sopenharmony_ci 461bd4fe43Sopenharmony_citypedef struct hiMPP_SYS_CONFIG_S { 471bd4fe43Sopenharmony_ci HI_U32 u32Align; 481bd4fe43Sopenharmony_ci} MPP_SYS_CONFIG_S; 491bd4fe43Sopenharmony_ci 501bd4fe43Sopenharmony_citypedef struct hiSYS_VIRMEM_INFO_S { 511bd4fe43Sopenharmony_ci HI_U64 u64PhyAddr; 521bd4fe43Sopenharmony_ci HI_BOOL bCached; 531bd4fe43Sopenharmony_ci} SYS_VIRMEM_INFO_S; 541bd4fe43Sopenharmony_ci 551bd4fe43Sopenharmony_citypedef struct hiMPP_BIND_DEST_S { 561bd4fe43Sopenharmony_ci HI_U32 u32Num; 571bd4fe43Sopenharmony_ci MPP_CHN_S astMppChn[BIND_DEST_MAXNUM]; 581bd4fe43Sopenharmony_ci} MPP_BIND_DEST_S; 591bd4fe43Sopenharmony_ci 601bd4fe43Sopenharmony_citypedef enum hiSCALE_RANGE_E { 611bd4fe43Sopenharmony_ci SCALE_RANGE_0 = 0, /* scale range < 8/64 */ 621bd4fe43Sopenharmony_ci SCALE_RANGE_1, /* scale range >= 8/64 */ 631bd4fe43Sopenharmony_ci SCALE_RANGE_2, /* scale range >= 10/64 */ 641bd4fe43Sopenharmony_ci SCALE_RANGE_3, /* scale range >= 15/64 */ 651bd4fe43Sopenharmony_ci SCALE_RANGE_4, /* scale range >= 19/64 */ 661bd4fe43Sopenharmony_ci SCALE_RANGE_5, /* scale range >= 24/64 */ 671bd4fe43Sopenharmony_ci SCALE_RANGE_6, /* scale range >= 29/64 */ 681bd4fe43Sopenharmony_ci SCALE_RANGE_7, /* scale range >= 33/64 */ 691bd4fe43Sopenharmony_ci SCALE_RANGE_8, /* scale range >= 35/64 */ 701bd4fe43Sopenharmony_ci SCALE_RANGE_9, /* scale range >= 38/64 */ 711bd4fe43Sopenharmony_ci SCALE_RANGE_10, /* scale range >= 42/64 */ 721bd4fe43Sopenharmony_ci SCALE_RANGE_11, /* scale range >= 45/64 */ 731bd4fe43Sopenharmony_ci SCALE_RANGE_12, /* scale range >= 48/64 */ 741bd4fe43Sopenharmony_ci SCALE_RANGE_13, /* scale range >= 51/64 */ 751bd4fe43Sopenharmony_ci SCALE_RANGE_14, /* scale range >= 53/64 */ 761bd4fe43Sopenharmony_ci SCALE_RANGE_15, /* scale range >= 55/64 */ 771bd4fe43Sopenharmony_ci SCALE_RANGE_16, /* scale range >= 57/64 */ 781bd4fe43Sopenharmony_ci SCALE_RANGE_17, /* scale range >= 60/64 */ 791bd4fe43Sopenharmony_ci SCALE_RANGE_18, /* scale range > 1 */ 801bd4fe43Sopenharmony_ci SCALE_RANGE_BUTT, 811bd4fe43Sopenharmony_ci} SCALE_RANGE_E; 821bd4fe43Sopenharmony_ci 831bd4fe43Sopenharmony_citypedef enum hiCOEFF_LEVEL_E { 841bd4fe43Sopenharmony_ci COEFF_LEVEL_0 = 0, /* coefficient level 0 */ 851bd4fe43Sopenharmony_ci COEFF_LEVEL_1, /* coefficient level 1 */ 861bd4fe43Sopenharmony_ci COEFF_LEVEL_2, /* coefficient level 2 */ 871bd4fe43Sopenharmony_ci COEFF_LEVEL_3, /* coefficient level 3 */ 881bd4fe43Sopenharmony_ci COEFF_LEVEL_4, /* coefficient level 4 */ 891bd4fe43Sopenharmony_ci COEFF_LEVEL_5, /* coefficient level 5 */ 901bd4fe43Sopenharmony_ci COEFF_LEVEL_6, /* coefficient level 6 */ 911bd4fe43Sopenharmony_ci COEFF_LEVEL_7, /* coefficient level 7 */ 921bd4fe43Sopenharmony_ci COEFF_LEVEL_8, /* coefficient level 8 */ 931bd4fe43Sopenharmony_ci COEFF_LEVEL_9, /* coefficient level 9 */ 941bd4fe43Sopenharmony_ci COEFF_LEVEL_10, /* coefficient level 10 */ 951bd4fe43Sopenharmony_ci COEFF_LEVEL_11, /* coefficient level 11 */ 961bd4fe43Sopenharmony_ci COEFF_LEVEL_12, /* coefficient level 12 */ 971bd4fe43Sopenharmony_ci COEFF_LEVEL_13, /* coefficient level 13 */ 981bd4fe43Sopenharmony_ci COEFF_LEVEL_14, /* coefficient level 14 */ 991bd4fe43Sopenharmony_ci COEFF_LEVEL_15, /* coefficient level 15 */ 1001bd4fe43Sopenharmony_ci COEFF_LEVEL_16, /* coefficient level 16 */ 1011bd4fe43Sopenharmony_ci COEFF_LEVEL_17, /* coefficient level 17 */ 1021bd4fe43Sopenharmony_ci COEFF_LEVEL_18, /* coefficient level 18 */ 1031bd4fe43Sopenharmony_ci COEFF_LEVEL_BUTT, 1041bd4fe43Sopenharmony_ci} COEFF_LEVEL_E; 1051bd4fe43Sopenharmony_ci 1061bd4fe43Sopenharmony_citypedef struct hiSCALE_COEFF_LEVEL_S { 1071bd4fe43Sopenharmony_ci COEFF_LEVEL_E enHorLum; /* horizontal luminance coefficient level */ 1081bd4fe43Sopenharmony_ci COEFF_LEVEL_E enHorChr; /* horizontal chrominance coefficient level */ 1091bd4fe43Sopenharmony_ci COEFF_LEVEL_E enVerLum; /* vertical luminance coefficient level */ 1101bd4fe43Sopenharmony_ci COEFF_LEVEL_E enVerChr; /* vertical chrominance coefficient level */ 1111bd4fe43Sopenharmony_ci} SCALE_COEFF_LEVEL_S; 1121bd4fe43Sopenharmony_ci 1131bd4fe43Sopenharmony_citypedef struct hiSCALE_RANGE_S { 1141bd4fe43Sopenharmony_ci SCALE_RANGE_E enHorizontal; 1151bd4fe43Sopenharmony_ci SCALE_RANGE_E enVertical; 1161bd4fe43Sopenharmony_ci} SCALE_RANGE_S; 1171bd4fe43Sopenharmony_ci 1181bd4fe43Sopenharmony_citypedef struct hiSCALE_COEFF_INFO_S { 1191bd4fe43Sopenharmony_ci SCALE_RANGE_S stScaleRange; 1201bd4fe43Sopenharmony_ci SCALE_COEFF_LEVEL_S stScaleCoeffLevel; 1211bd4fe43Sopenharmony_ci} SCALE_COEFF_INFO_S; 1221bd4fe43Sopenharmony_ci 1231bd4fe43Sopenharmony_citypedef struct hiGPS_INFO_S { 1241bd4fe43Sopenharmony_ci /* GPS LatitudeRef Indicates whether the latitude is north or south latitude, 'N'/'S', default 'N' */ 1251bd4fe43Sopenharmony_ci HI_CHAR chGPSLatitudeRef; 1261bd4fe43Sopenharmony_ci /* 1271bd4fe43Sopenharmony_ci * GPS Latitude is expressed as degrees, minutes and seconds, 1281bd4fe43Sopenharmony_ci * a typical format like "dd/1, mm/1, ss/1", default 0/1, 0/1, 0/1 1291bd4fe43Sopenharmony_ci */ 1301bd4fe43Sopenharmony_ci HI_U32 au32GPSLatitude[HI_GPS_ACCURACY_LEVEL][HI_GPS_NUMBER_DIMENSION]; 1311bd4fe43Sopenharmony_ci /* GPS LongitudeRef Indicates whether the longitude is east or west longitude, 'E'/'W', default 'E' */ 1321bd4fe43Sopenharmony_ci HI_CHAR chGPSLongitudeRef; 1331bd4fe43Sopenharmony_ci /* 1341bd4fe43Sopenharmony_ci * GPS Longitude is expressed as degrees, minutes and seconds, a typical format 1351bd4fe43Sopenharmony_ci * like "dd/1, mm/1, ss/1", default 0/1, 0/1, 0/1 1361bd4fe43Sopenharmony_ci */ 1371bd4fe43Sopenharmony_ci HI_U32 au32GPSLongitude[HI_GPS_ACCURACY_LEVEL][HI_GPS_NUMBER_DIMENSION]; 1381bd4fe43Sopenharmony_ci /* GPS AltitudeRef Indicates the reference altitude used, 0 - above sea level,1 - below sea level default 0 */ 1391bd4fe43Sopenharmony_ci HI_U8 u8GPSAltitudeRef; 1401bd4fe43Sopenharmony_ci /* 1411bd4fe43Sopenharmony_ci * GPS AltitudeRef Indicates the altitude based on the reference u8GPSAltitudeRef, 1421bd4fe43Sopenharmony_ci * the reference unit is meters, default 0/1 1431bd4fe43Sopenharmony_ci */ 1441bd4fe43Sopenharmony_ci HI_U32 au32GPSAltitude[HI_GPS_NUMBER_DIMENSION]; 1451bd4fe43Sopenharmony_ci} GPS_INFO_S; 1461bd4fe43Sopenharmony_ci 1471bd4fe43Sopenharmony_citypedef enum hiVI_VPSS_MODE_E { 1481bd4fe43Sopenharmony_ci VI_OFFLINE_VPSS_OFFLINE = 0, 1491bd4fe43Sopenharmony_ci VI_OFFLINE_VPSS_ONLINE, 1501bd4fe43Sopenharmony_ci VI_ONLINE_VPSS_OFFLINE, 1511bd4fe43Sopenharmony_ci VI_ONLINE_VPSS_ONLINE, 1521bd4fe43Sopenharmony_ci VI_PARALLEL_VPSS_OFFLINE, 1531bd4fe43Sopenharmony_ci VI_PARALLEL_VPSS_PARALLEL, 1541bd4fe43Sopenharmony_ci VI_VPSS_MODE_BUTT 1551bd4fe43Sopenharmony_ci} VI_VPSS_MODE_E; 1561bd4fe43Sopenharmony_ci 1571bd4fe43Sopenharmony_citypedef struct hiVI_VPSS_MODE_S { 1581bd4fe43Sopenharmony_ci VI_VPSS_MODE_E aenMode[VI_MAX_PIPE_NUM]; 1591bd4fe43Sopenharmony_ci} VI_VPSS_MODE_S; 1601bd4fe43Sopenharmony_ci 1611bd4fe43Sopenharmony_citypedef struct hiRAW_FRAME_COMPRESS_PARAM_S { 1621bd4fe43Sopenharmony_ci HI_U32 u32CompRatio_10Bit; /* compression ratio of 10 bit */ 1631bd4fe43Sopenharmony_ci HI_U32 u32CompRatio_12Bit; /* compression ratio of 12 bit */ 1641bd4fe43Sopenharmony_ci HI_U32 u32CompRatio_14Bit; /* compression ratio of 14 bit */ 1651bd4fe43Sopenharmony_ci} RAW_FRAME_COMPRESS_PARAM_S; 1661bd4fe43Sopenharmony_ci 1671bd4fe43Sopenharmony_citypedef struct hiHI_UNIQUE_ID_S { 1681bd4fe43Sopenharmony_ci HI_U32 u32Id[HI_UNIQUE_ID_NUM]; 1691bd4fe43Sopenharmony_ci} HI_UNIQUE_ID_S; 1701bd4fe43Sopenharmony_ci 1711bd4fe43Sopenharmony_ci#define HI_ERR_SYS_NULL_PTR HI_DEF_ERR(HI_ID_SYS, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR) 1721bd4fe43Sopenharmony_ci#define HI_ERR_SYS_NOTREADY HI_DEF_ERR(HI_ID_SYS, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY) 1731bd4fe43Sopenharmony_ci#define HI_ERR_SYS_NOT_PERM HI_DEF_ERR(HI_ID_SYS, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM) 1741bd4fe43Sopenharmony_ci#define HI_ERR_SYS_NOMEM HI_DEF_ERR(HI_ID_SYS, EN_ERR_LEVEL_ERROR, EN_ERR_NOMEM) 1751bd4fe43Sopenharmony_ci#define HI_ERR_SYS_ILLEGAL_PARAM HI_DEF_ERR(HI_ID_SYS, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM) 1761bd4fe43Sopenharmony_ci#define HI_ERR_SYS_BUSY HI_DEF_ERR(HI_ID_SYS, EN_ERR_LEVEL_ERROR, EN_ERR_BUSY) 1771bd4fe43Sopenharmony_ci#define HI_ERR_SYS_NOT_SUPPORT HI_DEF_ERR(HI_ID_SYS, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_SUPPORT) 1781bd4fe43Sopenharmony_ci 1791bd4fe43Sopenharmony_ci#ifdef __cplusplus 1801bd4fe43Sopenharmony_ci} 1811bd4fe43Sopenharmony_ci#endif /* __cplusplus */ 1821bd4fe43Sopenharmony_ci 1831bd4fe43Sopenharmony_ci#endif /* __HI_COMM_SYS_H__ */ 184