From 114d085cfda710081ebbf9f92c3b795ba7518b05 Mon Sep 17 00:00:00 2001 From: Dmitry Ilyin <6576495+widgetii@users.noreply.github.com> Date: Thu, 21 May 2026 17:22:30 +0300 Subject: [PATCH] hisilicon-osdrv-hi3520dv200: ship V2 MPP headers + libhdmi.a MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Today the published hi3520dv200 toolchain ships hi3516cv100-era MPP headers as a fallback (Makefile BUNDLE_SDK at line 131: if a board has no files/include/, the cv100 set is copied in unconditionally for every hisilicon board). That worked as a stopgap because the common subset of struct layouts is stable across V1/V2, but it has two gaps for hi3520dv200: 1. mpi_hdmi.h / hi_comm_hdmi.h are V2-era additions (cv100 has no HDMI hardware), so HDMI bring-up via HI_MPI_HDMI_Open/SetAttr/ Start can't be compiled against the toolchain — consumers have to vendor the headers themselves. 2. cv100 ships ISP/sensor/3A headers (mpi_isp.h, mpi_ae.h, etc.) that are meaningless on the analog-input hi3520dv200 board — they're dead weight and a source of misleading "cv100 SDK" assumptions. Mirror the V2 hi3520dv200 header set from the openhisilicon kernel include directory into files/include/. Once the toolchain rebuilds, the cv100 fallback is skipped (the `! -d "$OSDRV_DIR/include"` guard in BUNDLE_SDK now sees the new dir) and the SDK ships the V2-correct set: hi_comm_hdmi.h, mpi_hdmi.h — HDMI control API (new) hi_jpeg_api.h + jpeg/libjpeg.h — JPEG decode/encode API (new) mkp/mod_ext.h — vendor module extension (new) hi_comm_*, mpi_*, hi*.h, hifb.h — V2 MPP base (replaces cv100) Header diff cv100 -> V2: removed (cv100 only): acodec.h, hi_ae_comm.h, hi_af_comm.h, hi_awb_comm.h, hi_comm_3a.h, hi_comm_isp.h, hi_comm_sns.h, hi_isp_debug.h, hi_pq_bin.h, hi_sns_ctrl.h, hi_vreg.h, mod_ext.h, mpi_ae.h, mpi_af.h, mpi_awb.h, mpi_isp.h — all ISP/sensor/3A, none of which apply to hi3520dv200 (no in-tree consumer compiles against them for this board) added (V2 only): hi_comm_hdmi.h, mpi_hdmi.h, hi_jpeg_api.h, jconfig.h, jerror.h, jmorecfg.h, jpeglib.h, mkp/mod_ext.h shared: 46 headers (the common V1/V2 MPP base) Also drops libhdmi.a alongside the existing libmpi.so / libaec.so / etc. in files/lib/. The HDMI control API (HI_MPI_HDMI_Init / Open / GetAttr / SetAttr / Start) is NOT exported by libmpi.so on this SoC (nm/strings come up empty) — vendor split it into a separate static library that has to be linked into the consumer. Without this, VO_Enable returns 0x0 but the HDMI module reports "do not Open" in /proc/umap/hdmi and the monitor sees no signal. Source provenance: files/include/ <- openhisilicon kernel/include/hi3520dv200 (public mirror of vendor V2 MPP headers) files/lib/libhdmi.a <- Hi3520D_SDK_V2.0.5.1/package/mpp/lib/libhdmi.a (vendor static library, 19 KiB) No in-tree package currently builds userspace against MPP headers for hi3520dv200 (osdrv ships only kmod/lib/script; opensdk handles kernel modules), so this change can't regress any existing build. Verified the openhisilicon mirror's headers compile against the published toolchain via the dvr_home demo (private hifb-demo repo) with VENC all-channel bring-up and HDMI bring-up both succeeding. Once this lands + the toolchain release rebuilds (delete the stale toolchain.hisilicon-hi3520dv200.tgz asset, re-run toolchain.yml), the next consumer to drive HDMI on this SoC can just `-lhdmi` like they already `-lmpi` instead of vendoring the blob. --- .../files/include/hi_comm_adec.h | 170 +++ .../files/include/hi_comm_aenc.h | 120 ++ .../files/include/hi_comm_ai.h | 36 + .../files/include/hi_comm_aio.h | 388 ++++++ .../files/include/hi_comm_ao.h | 37 + .../files/include/hi_comm_hdmi.h | 760 +++++++++++ .../files/include/hi_comm_ive.h | 257 ++++ .../files/include/hi_comm_pciv.h | 279 ++++ .../files/include/hi_comm_rc.h | 382 ++++++ .../files/include/hi_comm_region.h | 261 ++++ .../files/include/hi_comm_sys.h | 69 + .../files/include/hi_comm_vb.h | 122 ++ .../files/include/hi_comm_vda.h | 288 +++++ .../files/include/hi_comm_vdec.h | 287 +++++ .../files/include/hi_comm_venc.h | 570 +++++++++ .../files/include/hi_comm_vi.h | 510 ++++++++ .../files/include/hi_comm_video.h | 327 +++++ .../files/include/hi_comm_vo.h | 493 ++++++++ .../files/include/hi_comm_vpss.h | 284 +++++ .../files/include/hi_common.h | 452 +++++++ .../files/include/hi_debug.h | 145 +++ .../files/include/hi_defines.h | 293 +++++ .../files/include/hi_errno.h | 131 ++ .../files/include/hi_io.h | 50 + .../files/include/hi_jpeg_api.h | 474 +++++++ .../files/include/hi_math.h | 292 +++++ .../files/include/hi_mem.h | 33 + .../files/include/hi_tde_api.h | 458 +++++++ .../files/include/hi_tde_errcode.h | 54 + .../files/include/hi_tde_type.h | 657 ++++++++++ .../files/include/hi_type.h | 87 ++ .../files/include/hifb.h | 325 +++++ .../files/include/jconfig.h | 45 + .../files/include/jerror.h | 451 +++++++ .../files/include/jmorecfg.h | 373 ++++++ .../files/include/jpeglib.h | 1117 +++++++++++++++++ .../files/include/list.h | 149 +++ .../files/include/mkp/mod_ext.h | 101 ++ .../files/include/mpi_adec.h | 54 + .../files/include/mpi_aenc.h | 58 + .../files/include/mpi_ai.h | 81 ++ .../files/include/mpi_ao.h | 71 ++ .../files/include/mpi_hdmi.h | 60 + .../files/include/mpi_ive.h | 460 +++++++ .../files/include/mpi_pciv.h | 247 ++++ .../files/include/mpi_region.h | 62 + .../files/include/mpi_sys.h | 116 ++ .../files/include/mpi_vb.h | 57 + .../files/include/mpi_vda.h | 307 +++++ .../files/include/mpi_vdec.h | 87 ++ .../files/include/mpi_venc.h | 143 +++ .../files/include/mpi_vi.h | 99 ++ .../files/include/mpi_vo.h | 185 +++ .../files/include/mpi_vpss.h | 123 ++ .../files/lib/libhdmi.a | Bin 0 -> 19518 bytes 55 files changed, 13537 insertions(+) create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_adec.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_aenc.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_ai.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_aio.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_ao.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_hdmi.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_ive.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_pciv.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_rc.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_region.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_sys.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_vb.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_vda.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_vdec.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_venc.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_vi.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_video.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_vo.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_vpss.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_common.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_debug.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_defines.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_errno.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_io.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_jpeg_api.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_math.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_mem.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_tde_api.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_tde_errcode.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_tde_type.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_type.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/hifb.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/jconfig.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/jerror.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/jmorecfg.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/jpeglib.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/list.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/mkp/mod_ext.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_adec.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_aenc.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_ai.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_ao.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_hdmi.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_ive.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_pciv.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_region.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_sys.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_vb.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_vda.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_vdec.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_venc.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_vi.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_vo.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_vpss.h create mode 100644 general/package/hisilicon-osdrv-hi3520dv200/files/lib/libhdmi.a diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_adec.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_adec.h new file mode 100644 index 0000000000..aa79606c75 --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_adec.h @@ -0,0 +1,170 @@ +/****************************************************************************** + + Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. + + ****************************************************************************** + File Name : hi_comm_adec.h + Version : Initial Draft + Author : Hisilicon multimedia software group + Created : 2006/12/15 + Last Modified : + Description : + Function List : + History : + 1.Date : 2006/12/15 + Author : z50825 + Modification : Created file + 2.Date : 2007/5/10 + Author : z50825 + Modification : add err code +******************************************************************************/ + + +#ifndef __HI_COMM_ADEC_H__ +#define __HI_COMM_ADEC_H__ + + +#include "hi_type.h" +#include "hi_common.h" +#include "hi_comm_aio.h" + +#ifdef __cplusplus +#if __cplusplus +extern "C"{ +#endif +#endif /* End of #ifdef __cplusplus */ + +typedef struct hiADEC_ATTR_G711_S +{ + HI_U32 resv; +}ADEC_ATTR_G711_S; + +typedef struct hiADEC_ATTR_G726_S +{ + G726_BPS_E enG726bps; +}ADEC_ATTR_G726_S; + +typedef struct hiADEC_ATTR_ADPCM_S +{ + ADPCM_TYPE_E enADPCMType; +}ADEC_ATTR_ADPCM_S; + +typedef struct hiADEC_ATTR_LPCM_S +{ + HI_U32 resv; +}ADEC_ATTR_LPCM_S; + +typedef enum hiADEC_MODE_E +{ + ADEC_MODE_PACK = 0,/*require input is valid dec pack(a + complete frame encode result), + e.g.the stream get from AENC is a + valid dec pack, the stream know actually + pack len from file is also a dec pack. + this mode is high-performative*/ + ADEC_MODE_STREAM ,/*input is stream,low-performative, + if you couldn't find out whether a stream is + vaild dec pack,you could use + this mode*/ + ADEC_MODE_BUTT +}ADEC_MODE_E; + +typedef struct hiADEC_CH_ATTR_S +{ + PAYLOAD_TYPE_E enType; + HI_U32 u32BufSize; /*buf size[2~MAX_AUDIO_FRAME_NUM]*/ + ADEC_MODE_E enMode; /*decode mode*/ + HI_VOID *pValue; +}ADEC_CHN_ATTR_S; + +typedef struct hiADEC_DECODER_S +{ + PAYLOAD_TYPE_E enType; + HI_CHAR aszName[16]; + HI_S32 (*pfnOpenDecoder)(HI_VOID *pDecoderAttr, HI_VOID **ppDecoder); /*struct ppDecoder is packed by user,user malloc and free memory for this struct */ + HI_S32 (*pfnDecodeFrm)(HI_VOID *pDecoder, HI_U8 **pu8Inbuf,HI_S32 *ps32LeftByte, + HI_U16 *pu16Outbuf,HI_U32 *pu32OutLen,HI_U32 *pu32Chns); + HI_S32 (*pfnGetFrmInfo)(HI_VOID *pDecoder, HI_VOID *pInfo); + HI_S32 (*pfnCloseDecoder)(HI_VOID *pDecoder); +} ADEC_DECODER_S; + +typedef enum hiEN_ADEC_ERR_CODE_E +{ + ADEC_ERR_DECODER_ERR = 64, + ADEC_ERR_BUF_LACK, + ADEC_ERR_VOICE_DEC_TYPE, + ADEC_ERR_VOICE_DEC_FRAMESIZE, + ADEC_ERR_VOICE_DEC_FRAMETYPE, + ADEC_ERR_VOICE_INVALID_DEVICE, + ADEC_ERR_VOICE_INVALID_INBUF, + ADEC_ERR_VOICE_INVALID_OUTBUF, + ADEC_ERR_VOICE_TRANS_DEVICE, + ADEC_ERR_VOICE_TRANS_TYPE, + +} EN_ADEC_ERR_CODE_E; + + +typedef enum hi_ADEC_OUTPUT_MODE_E +{ + ADEC_OUTPUT_MODE_BIND = 0, + ADEC_OUTPUT_MODE_MANUAL, + ADEC_OUTPUT_MODE_BUTTL +} ADEC_OUTPUT_MODE_E; + + + +/* invlalid device ID */ +#define HI_ERR_ADEC_INVALID_DEVID HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_DEVID) +/* invlalid channel ID */ +#define HI_ERR_ADEC_INVALID_CHNID HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_CHNID) +/* at lease one parameter is illagal ,eg, an illegal enumeration value */ +#define HI_ERR_ADEC_ILLEGAL_PARAM HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM) +/* channel exists */ +#define HI_ERR_ADEC_EXIST HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, EN_ERR_EXIST) +/* channel unexists */ +#define HI_ERR_ADEC_UNEXIST HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, EN_ERR_UNEXIST) +/* using a NULL point */ +#define HI_ERR_ADEC_NULL_PTR HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR) +/* try to enable or initialize system,device or channel, before configing attribute */ +#define HI_ERR_ADEC_NOT_CONFIG HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_CONFIG) +/* operation is not supported by NOW */ +#define HI_ERR_ADEC_NOT_SUPPORT HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_SUPPORT) +/* operation is not permitted ,eg, try to change stati attribute */ +#define HI_ERR_ADEC_NOT_PERM HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM) +/* failure caused by malloc memory */ +#define HI_ERR_ADEC_NOMEM HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, EN_ERR_NOMEM) +/* failure caused by malloc buffer */ +#define HI_ERR_ADEC_NOBUF HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, EN_ERR_NOBUF) +/* no data in buffer */ +#define HI_ERR_ADEC_BUF_EMPTY HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_EMPTY) +/* no buffer for new data */ +#define HI_ERR_ADEC_BUF_FULL HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_FULL) +/* system is not ready,had not initialed or loaded*/ +#define HI_ERR_ADEC_SYS_NOTREADY HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY) +/* decoder internal err */ +#define HI_ERR_ADEC_DECODER_ERR HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, ADEC_ERR_DECODER_ERR) +/* input buffer not enough to decode one frame */ +#define HI_ERR_ADEC_BUF_LACK HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, ADEC_ERR_BUF_LACK) + + + +#define HI_ERR_ADEC_DEC_TYPE HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, ADEC_ERR_VOICE_DEC_TYPE) +#define HI_ERR_ADEC_DEC_FRAMESIZE HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, ADEC_ERR_VOICE_DEC_FRAMESIZE) +#define HI_ERR_ADEC_DEC_FRAMETYPE HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, ADEC_ERR_VOICE_DEC_FRAMETYPE) +#define HI_ERR_ADEC_INVALID_DEVICE HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, ADEC_ERR_VOICE_INVALID_DEVICE) +#define HI_ERR_ADEC_INVALID_INBUF HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, ADEC_ERR_VOICE_INVALID_INBUF) +#define HI_ERR_ADEC_INVALID_OUTBUF HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, ADEC_ERR_VOICE_INVALID_OUTBUF) +#define HI_ERR_ADEC_TRANS_DEVICE HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, ADEC_ERR_VOICE_TRANS_DEVICE) +#define HI_ERR_ADEC_TRANS_TYPE HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, ADEC_ERR_VOICE_TRANS_TYPE) + + + + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif /* End of #ifdef __cplusplus */ + +#endif/* End of #ifndef __HI_COMM_ADEC_H__*/ + diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_aenc.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_aenc.h new file mode 100644 index 0000000000..5716988a7c --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_aenc.h @@ -0,0 +1,120 @@ +/****************************************************************************** + + Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. + + ****************************************************************************** + File Name : hi_comm_aenc.h + Version : Initial Draft + Author : Hisilicon multimedia software group + Created : 2006/12/15 + Last Modified : + Description : + Function List : + History : + 1.Date : 2006/12/15 + Author : z50825 + Modification : Created file + 2.Date : 2007/5/10 + Author : z50825 + Modification : add err code +******************************************************************************/ + + +#ifndef __HI_COMM_AENC_H__ +#define __HI_COMM_AENC_H__ + +#include "hi_type.h" +#include "hi_common.h" +#include "hi_comm_aio.h" + + +#ifdef __cplusplus +#if __cplusplus +extern "C"{ +#endif +#endif /* End of #ifdef __cplusplus */ + +typedef struct hiAENC_ATTR_G711_S +{ + HI_U32 resv; /*reserve item*/ +}AENC_ATTR_G711_S; + +typedef struct hiAENC_ATTR_G726_S +{ + G726_BPS_E enG726bps; +}AENC_ATTR_G726_S; + +typedef struct hiAENC_ATTR_ADPCM_S +{ + ADPCM_TYPE_E enADPCMType; +}AENC_ATTR_ADPCM_S; + +typedef struct hiAENC_ATTR_LPCM_S +{ + HI_U32 resv; /*reserve item*/ +}AENC_ATTR_LPCM_S; + +typedef struct hiAENC_ENCODER_S +{ + PAYLOAD_TYPE_E enType; + HI_U32 u32MaxFrmLen; + HI_CHAR aszName[16]; /* encoder type,be used to print proc information */ + HI_S32 (*pfnOpenEncoder)(HI_VOID *pEncoderAttr, HI_VOID **ppEncoder); /* pEncoder is the handle to control the encoder */ + HI_S32 (*pfnEncodeFrm)(HI_VOID *pEncoder, const AUDIO_FRAME_S *pstData, + HI_U8 *pu8Outbuf,HI_U32 *pu32OutLen); + HI_S32 (*pfnCloseEncoder)(HI_VOID *pEncoder); +} AENC_ENCODER_S; + +typedef struct hiAENC_CHN_ATTR_S +{ + PAYLOAD_TYPE_E enType; /*payload type ()*/ + HI_U32 u32BufSize; /*buf size [2~MAX_AUDIO_FRAME_NUM]*/ + HI_VOID *pValue; /*point to attribute of definite audio encoder*/ +}AENC_CHN_ATTR_S; + +typedef enum hiEN_AENC_ERR_CODE_E +{ + ADEC_ERR_ENCODER_ERR = 64 , + +} EN_AENC_ERR_CODE_E; + +/* invlalid device ID */ +#define HI_ERR_AENC_INVALID_DEVID HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_DEVID) +/* invlalid channel ID */ +#define HI_ERR_AENC_INVALID_CHNID HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_CHNID) +/* at lease one parameter is illagal ,eg, an illegal enumeration value */ +#define HI_ERR_AENC_ILLEGAL_PARAM HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM) +/* channel exists */ +#define HI_ERR_AENC_EXIST HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_EXIST) +/* channel unexists */ +#define HI_ERR_AENC_UNEXIST HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_UNEXIST) +/* using a NULL point */ +#define HI_ERR_AENC_NULL_PTR HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR) +/* try to enable or initialize system,device or channel, before configing attribute */ +#define HI_ERR_AENC_NOT_CONFIG HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_CONFIG) +/* operation is not supported by NOW */ +#define HI_ERR_AENC_NOT_SUPPORT HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_SUPPORT) +/* operation is not permitted ,eg, try to change static attribute */ +#define HI_ERR_AENC_NOT_PERM HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM) +/* failure caused by malloc memory */ +#define HI_ERR_AENC_NOMEM HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_NOMEM) +/* failure caused by malloc buffer */ +#define HI_ERR_AENC_NOBUF HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_NOBUF) +/* no data in buffer */ +#define HI_ERR_AENC_BUF_EMPTY HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_EMPTY) +/* no buffer for new data */ +#define HI_ERR_AENC_BUF_FULL HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_FULL) +/* system is not ready,had not initialed or loaded*/ +#define HI_ERR_AENC_SYS_NOTREADY HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY) +/* encoder internal err */ +#define HI_ERR_AENC_ENCODER_ERR HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, ADEC_ERR_ENCODER_ERR) + + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif /* End of #ifdef __cplusplus */ + +#endif/* End of #ifndef __HI_COMM_AENC_H__*/ + diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_ai.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_ai.h new file mode 100644 index 0000000000..d11ed3b883 --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_ai.h @@ -0,0 +1,36 @@ +/****************************************************************************** + + Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. + + ****************************************************************************** + File Name : hi_comm_ai.h + Version : Initial Draft + Author : Hisilicon multimedia software group + Created : 2009/5/5 + Description : + History : + 1.Date : 2009/5/5 + Author : p00123320 + Modification: Created file +******************************************************************************/ + + +#ifndef __HI_COMM_AI_H__ +#define __HI_COMM_AI_H__ + +#ifdef __cplusplus +#if __cplusplus +extern "C"{ +#endif +#endif /* End of #ifdef __cplusplus */ + + + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif /* End of #ifdef __cplusplus */ + +#endif /* End of #ifndef __HI_COMM_AI_H__ */ + diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_aio.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_aio.h new file mode 100644 index 0000000000..9a964c4c57 --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_aio.h @@ -0,0 +1,388 @@ +/****************************************************************************** + + Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. + + ****************************************************************************** + File Name : hi_comm_aio.h + Version : Initial Draft + Author : Hisilicon multimedia software group + Created : 2009/5/5 + Description : + History : + 1.Date : 2009/5/5 + Author : p00123320 + Modification: Created file +******************************************************************************/ + + +#ifndef __HI_COMM_AIO_H__ +#define __HI_COMM_AIO_H__ + +#include "hi_common.h" +#include "hi_errno.h" + +#ifdef __cplusplus +#if __cplusplus +extern "C"{ +#endif +#endif /* End of #ifdef __cplusplus */ + + +#define MAX_AUDIO_FRAME_NUM 50 /*max count of audio frame in Buffer */ +#define MAX_AUDIO_POINT_BYTES 4 /*max bytes of one sample point(now 32bit max)*/ + +#define MAX_VOICE_POINT_NUM 480 /*max sample per frame for voice encode */ + +#define MAX_AUDIO_POINT_NUM 2048 /*max sample per frame for all encoder(aacplus:2048)*/ +#define MAX_AO_POINT_NUM 4096 /*31/21 AO support 4096 framelen*/ +#define MIN_AUDIO_POINT_NUM 80 /*min sample per frame*/ + +/*max length of audio frame by bytes, one frame contain many sample point */ +#define MAX_AUDIO_FRAME_LEN (MAX_AUDIO_POINT_BYTES*MAX_AO_POINT_NUM) + +/*max length of audio stream by bytes */ +#define MAX_AUDIO_STREAM_LEN MAX_AUDIO_FRAME_LEN + +#define MAX_AI_USRFRM_DEPTH 30 /*max depth of user frame buf */ + +typedef enum hiAUDIO_SAMPLE_RATE_E +{ + AUDIO_SAMPLE_RATE_8000 = 8000, /* 8K samplerate*/ + AUDIO_SAMPLE_RATE_12000 = 12000, /* 12K samplerate*/ + AUDIO_SAMPLE_RATE_11025 = 11025, /* 11.025K samplerate*/ + AUDIO_SAMPLE_RATE_16000 = 16000, /* 16K samplerate*/ + AUDIO_SAMPLE_RATE_22050 = 22050, /* 22.050K samplerate*/ + AUDIO_SAMPLE_RATE_24000 = 24000, /* 24K samplerate*/ + AUDIO_SAMPLE_RATE_32000 = 32000, /* 32K samplerate*/ + AUDIO_SAMPLE_RATE_44100 = 44100, /* 44.1K samplerate*/ + AUDIO_SAMPLE_RATE_48000 = 48000, /* 48K samplerate*/ + AUDIO_SAMPLE_RATE_BUTT, +} AUDIO_SAMPLE_RATE_E; + +typedef enum hiAUDIO_BIT_WIDTH_E +{ + AUDIO_BIT_WIDTH_8 = 0, /* 8bit width */ + AUDIO_BIT_WIDTH_16 = 1, /* 16bit width*/ + AUDIO_BIT_WIDTH_32 = 2, /* 32bit width*/ + AUDIO_BIT_WIDTH_BUTT, +} AUDIO_BIT_WIDTH_E; + +typedef enum hiAIO_MODE_E +{ + AIO_MODE_I2S_MASTER = 0, /* SIO I2S master mode */ + AIO_MODE_I2S_SLAVE, /* SIO I2S slave mode */ + AIO_MODE_PCM_SLAVE_STD, /* SIO PCM slave standard mode */ + AIO_MODE_PCM_SLAVE_NSTD, /* SIO PCM slave non-standard mode */ + AIO_MODE_PCM_MASTER_STD, /* SIO PCM master standard mode */ + AIO_MODE_PCM_MASTER_NSTD, /* SIO PCM master non-standard mode */ + AIO_MODE_BUTT +} AIO_MODE_E; + +typedef enum hiAIO_SOUND_MODE_E +{ + AUDIO_SOUND_MODE_MONO =0,/*mono*/ + AUDIO_SOUND_MODE_STEREO =1,/*stereo*/ + AUDIO_SOUND_MODE_BUTT +} AUDIO_SOUND_MODE_E; + +/* +An example of the packing scheme for G726-32 codewords is as shown, and bit A3 is the least significant bit of the first codeword: +RTP G726-32: +0 1 +0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 ++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- +|B B B B|A A A A|D D D D|C C C C| ... +|0 1 2 3|0 1 2 3|0 1 2 3|0 1 2 3| ++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- + +MEDIA G726-32: +0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 ++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- +|A A A A|B B B B|C C C C|D D D D| ... +|3 2 1 0|3 2 1 0|3 2 1 0|3 2 1 0| ++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- +*/ +typedef enum hiG726_BPS_E +{ + G726_16K = 0, /* G726 16kbps, see RFC3551.txt 4.5.4 G726-16 */ + G726_24K, /* G726 24kbps, see RFC3551.txt 4.5.4 G726-24 */ + G726_32K, /* G726 32kbps, see RFC3551.txt 4.5.4 G726-32 */ + G726_40K, /* G726 40kbps, see RFC3551.txt 4.5.4 G726-40 */ + MEDIA_G726_16K, /* G726 16kbps for ASF ... */ + MEDIA_G726_24K, /* G726 24kbps for ASF ... */ + MEDIA_G726_32K, /* G726 32kbps for ASF ... */ + MEDIA_G726_40K, /* G726 40kbps for ASF ... */ + G726_BUTT, +} G726_BPS_E; + +typedef enum hiADPCM_TYPE_E +{ + /* see DVI4 diiffers in three respects from the IMA ADPCM at RFC3551.txt 4.5.1 DVI4 */ + + ADPCM_TYPE_DVI4 = 0, /* 32kbps ADPCM(DVI4) for RTP */ + ADPCM_TYPE_IMA, /* 32kbps ADPCM(IMA),NOTICE:point num must be 161/241/321/481 */ + ADPCM_TYPE_ORG_DVI4, + ADPCM_TYPE_BUTT, +} ADPCM_TYPE_E; + +#define AI_EXPAND 0x01 + +typedef struct hiAIO_ATTR_S +{ + AUDIO_SAMPLE_RATE_E enSamplerate; /* sample rate*/ + AUDIO_BIT_WIDTH_E enBitwidth; /* bitwidth*/ + AIO_MODE_E enWorkmode; /* master or slave mode*/ + AUDIO_SOUND_MODE_E enSoundmode; /* momo or steror*/ + HI_U32 u32EXFlag; /* expand 8bit to 16bit,use AI_EXPAND(only valid for AI 8bit) */ + HI_U32 u32FrmNum; /* frame num in buf[2,MAX_AUDIO_FRAME_NUM]*/ + HI_U32 u32PtNumPerFrm; /* point num per frame (80/160/240/320/480/1024/2048) + (ADPCM IMA should add 1 point, AMR only support 160)*/ + HI_U32 u32ChnCnt; /* channle number on FS, valid value:2/4/8/16 */ + HI_U32 u32ClkSel; /* clock select, meaning is diffrent when master and slave mode, + if sio slave mode: + 0: AD and DA clock of codec is separate + 1: AD and DA clock of codec is inseparate + else sio master mode: + 0:ACKOUT clock is from sio 0 + 1:ACKOUT clock is from sio 1/2 + */ +} AIO_ATTR_S; + +typedef struct hiAI_CHN_PARAM_S +{ + HI_U32 u32UsrFrmDepth; + HI_S32 s32Rev; +} AI_CHN_PARAM_S; + +typedef struct hiAUDIO_FRAME_S +{ + AUDIO_BIT_WIDTH_E enBitwidth; /*audio frame bitwidth*/ + AUDIO_SOUND_MODE_E enSoundmode; /*audio frame momo or stereo mode*/ + HI_VOID *pVirAddr[2]; + HI_U32 u32PhyAddr[2]; + HI_U64 u64TimeStamp; /*audio frame timestamp*/ + HI_U32 u32Seq; /*audio frame seq*/ + HI_U32 u32Len; /*data lenth per channel in frame*/ + HI_U32 u32PoolId[2]; +} AUDIO_FRAME_S; + +typedef struct hiAEC_FRAME_S +{ + AUDIO_FRAME_S stRefFrame; /* AEC reference audio frame */ + HI_BOOL bValid; /* whether frame is valid */ + HI_BOOL bSysBind; /* whether is sysbind */ +} AEC_FRAME_S; + +typedef struct hiAUDIO_FRAME_COMBINE_S +{ + AUDIO_FRAME_S stFrm; /* audio frame */ + AEC_FRAME_S stRefFrm; /* AEC reference audio frame */ +} AUDIO_FRAME_COMBINE_S; + +typedef struct hiAUDIO_FRAME_INFO_S +{ + AUDIO_FRAME_S *pstFrame;/*frame ptr*/ + HI_U32 u32Id; /*frame id*/ +} AUDIO_FRAME_INFO_S; + +typedef struct hiAUDIO_STREAM_S +{ + HI_U8 *pStream; /* the virtual address of stream */ + HI_U32 u32PhyAddr; /* the physics address of stream */ + HI_U32 u32Len; /* stream lenth, by bytes */ + HI_U64 u64TimeStamp; /* frame time stamp*/ + HI_U32 u32Seq; /* frame seq,if stream is not a valid frame,u32Seq is 0*/ +} AUDIO_STREAM_S; + +typedef enum hiAUDIO_RESAMPLE_TYPE_E +{ + AUDIO_RESAMPLE_1X2 = 0x1, + AUDIO_RESAMPLE_2X1 = 0x2, + AUDIO_RESAMPLE_1X4 = 0x3, + AUDIO_RESAMPLE_4X1 = 0x4, + AUDIO_RESAMPLE_1X6 = 0x5, + AUDIO_RESAMPLE_6X1 = 0x6, + AUDIO_RESAMPLE_BUTT +} AUDIO_RESAMPLE_TYPE_E; + +typedef struct hiAUDIO_RESAMPLE_ATTR_S +{ + HI_U32 u32InPointNum; /* input point number of frame */ + AUDIO_SAMPLE_RATE_E enInSampleRate; /* input sample rate */ + AUDIO_RESAMPLE_TYPE_E enReSampleType; /* resample type */ +} AUDIO_RESAMPLE_ATTR_S; + +typedef struct hiAUDIO_RESAMPLE_ATTR_EX_S +{ + HI_U32 u32InPointNum; /* input point number of frame */ + AUDIO_SAMPLE_RATE_E enInSampleRate; /* input sample rate */ + AUDIO_SAMPLE_RATE_E enOutSampleRate; /* output sample rate */ +} AUDIO_RESAMPLE_ATTR_EX_S; + +typedef struct hiAO_CHN_STATE_S +{ + HI_U32 u32ChnTotalNum; /* total number of channel buffer */ + HI_U32 u32ChnFreeNum; /* free number of channel buffer */ + HI_U32 u32ChnBusyNum; /* busy number of channel buffer */ +} AO_CHN_STATE_S; + +typedef struct hiAIO_RESMP_INFO_S +{ + HI_BOOL bReSmpEnable; /* resample enable or disable */ + HI_BOOL bReSmpEnableEx; /*advanced resample enable or disable */ + AUDIO_RESAMPLE_ATTR_S stResmpAttr; + AUDIO_RESAMPLE_ATTR_EX_S stResmpAttrEx; +} AIO_RESMP_INFO_S; + +typedef struct hiAI_ANR_INFO_S +{ + HI_BOOL bAnrEnable; /* noise reduce enable or disable */ +} AI_ANR_INFO_S; + +typedef enum hiAUDIO_AEC_MODE_E +{ + AUDIO_AEC_MODE_RECEIVER = 0, + AUDIO_AEC_MODE_SPEAKER = 1, + AUDIO_AEC_MODE_HEADPHONE = 2, + + AUDIO_AEC_MODE_BUTT +} AUDIO_AEC_MODE_E; + +/**Defines the configure parameters of ALC.*/ +typedef struct hiAI_ALC_CONFIG_S +{ + HI_S32 s32MaxLev; /*s32MaxLev£º[-23dBm0, -4dBm0]¡£default: -4dBm0*/ + HI_S32 s32MinLev; /*s32MinLev£º [-23dBm0, -4dBm0]¡£default: -16dBm0*/ + HI_U32 u32MaxGain; /*u32MaxGain£º[3dB,12dB]¡£default: 12dB*/ +} AI_ALC_CONFIG_S; + +/**Defines the configure parameters of AEC.*/ +typedef struct hiAI_AEC_CONFIG_S +{ + AUDIO_AEC_MODE_E enAecMode; /* AEC mode, default is speaker, 0:receiver 1:speaker 2:headphone */ + HI_S32 s32Reserved; +} AI_AEC_CONFIG_S; + + +/**Defines the configure parameters of ANR.*/ +typedef struct hiAI_ANR_CONFIG_S +{ + HI_S32 s32Reserved; +} AI_ANR_CONFIG_S; + +/**Defines the configure parameters of HPF.*/ +typedef enum hiAUDIO_HPF_FREQ_E +{ + AUDIO_HPF_FREQ_80 = 80, /* 80Hz */ + AUDIO_HPF_FREQ_120 = 120, /* 120Hz */ + AUDIO_HPF_FREQ_150 = 150, /* 150Hz */ + AUDIO_HPF_FREQ_BUTT, +} AUDIO_HPF_FREQ_E; + +typedef struct hiAI_HPF_CONFIG_S +{ + AUDIO_HPF_FREQ_E enHpfFreq; /*freq to be processed*/ +} AI_HPF_CONFIG_S; +typedef struct hiAI_HPF_ATTR_S +{ + AI_HPF_CONFIG_S stHpfCfg; + HI_S32 bHpfOpen; +} AI_HPF_ATTR_S; +/**Defines the configure parameters of VQE.*/ +typedef struct hiAI_VQE_CONFIG_S +{ + HI_S32 bAecOpen; + HI_S32 bAnrOpen; + HI_S32 bAlcOpen; + HI_S32 s32SampleRate; /* Sample Rate£º8KHz/11.025K/12K/16KHz¡£default: 8KHz*/ + HI_S32 s32FrameSample; /* VQE frame length£º + sample rate 8KHz: VQE frame length: 80/160/240/320/400/480£¬ default: 160; + sample rate 11.025K/12K/16KHz: VQE frame length: 160/320/480/960£¬ default: 160 */ + AI_AEC_CONFIG_S stAecCfg; + AI_ANR_CONFIG_S stAnrCfg; + AI_ALC_CONFIG_S stAlcCfg; +} AI_VQE_CONFIG_S; + +typedef struct hiAI_VQE_INFO_S +{ + AI_VQE_CONFIG_S stVqeConfig; /*vqe config*/ + HI_BOOL bVqeEnable; /* vqe enable or disable */ + HI_BOOL bHpfOpen; /* vqe enable or disable */ +} AI_VQE_INFO_S; + +/**Defines the configure parameters of AI saving file.*/ +typedef struct hiAUDIO_SAVE_FILE_INFO_S +{ + HI_BOOL bCfg; + HI_CHAR aFilePath[256]; + //AI_SAVE_FILE_COMMOND_E eSaveFileCommond; + HI_U32 u32FileSize; /*in KB*/ +} AUDIO_SAVE_FILE_INFO_S; + +/* invlalid device ID */ +#define HI_ERR_AI_INVALID_DEVID HI_DEF_ERR(HI_ID_AI, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_DEVID) +/* invlalid channel ID */ +#define HI_ERR_AI_INVALID_CHNID HI_DEF_ERR(HI_ID_AI, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_CHNID) +/* at lease one parameter is illagal ,eg, an illegal enumeration value */ +#define HI_ERR_AI_ILLEGAL_PARAM HI_DEF_ERR(HI_ID_AI, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM) +/* using a NULL point */ +#define HI_ERR_AI_NULL_PTR HI_DEF_ERR(HI_ID_AI, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR) +/* try to enable or initialize system,device or channel, before configing attribute */ +#define HI_ERR_AI_NOT_CONFIG HI_DEF_ERR(HI_ID_AI, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_CONFIG) +/* operation is not supported by NOW */ +#define HI_ERR_AI_NOT_SUPPORT HI_DEF_ERR(HI_ID_AI, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_SUPPORT) +/* operation is not permitted ,eg, try to change stati attribute */ +#define HI_ERR_AI_NOT_PERM HI_DEF_ERR(HI_ID_AI, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM) +/* the devide is not enabled */ +#define HI_ERR_AI_NOT_ENABLED HI_DEF_ERR(HI_ID_AI, EN_ERR_LEVEL_ERROR, EN_ERR_UNEXIST) +/* failure caused by malloc memory */ +#define HI_ERR_AI_NOMEM HI_DEF_ERR(HI_ID_AI, EN_ERR_LEVEL_ERROR, EN_ERR_NOMEM) +/* failure caused by malloc buffer */ +#define HI_ERR_AI_NOBUF HI_DEF_ERR(HI_ID_AI, EN_ERR_LEVEL_ERROR, EN_ERR_NOBUF) +/* no data in buffer */ +#define HI_ERR_AI_BUF_EMPTY HI_DEF_ERR(HI_ID_AI, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_EMPTY) +/* no buffer for new data */ +#define HI_ERR_AI_BUF_FULL HI_DEF_ERR(HI_ID_AI, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_FULL) +/* system is not ready,had not initialed or loaded*/ +#define HI_ERR_AI_SYS_NOTREADY HI_DEF_ERR(HI_ID_AI, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY) + +#define HI_ERR_AI_BUSY HI_DEF_ERR(HI_ID_AI, EN_ERR_LEVEL_ERROR, EN_ERR_BUSY) + +/* invlalid device ID */ +#define HI_ERR_AO_INVALID_DEVID HI_DEF_ERR(HI_ID_AO, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_DEVID) +/* invlalid channel ID */ +#define HI_ERR_AO_INVALID_CHNID HI_DEF_ERR(HI_ID_AO, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_CHNID) +/* at lease one parameter is illagal ,eg, an illegal enumeration value */ +#define HI_ERR_AO_ILLEGAL_PARAM HI_DEF_ERR(HI_ID_AO, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM) +/* using a NULL point */ +#define HI_ERR_AO_NULL_PTR HI_DEF_ERR(HI_ID_AO, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR) +/* try to enable or initialize system,device or channel, before configing attribute */ +#define HI_ERR_AO_NOT_CONFIG HI_DEF_ERR(HI_ID_AO, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_CONFIG) +/* operation is not supported by NOW */ +#define HI_ERR_AO_NOT_SUPPORT HI_DEF_ERR(HI_ID_AO, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_SUPPORT) +/* operation is not permitted ,eg, try to change stati attribute */ +#define HI_ERR_AO_NOT_PERM HI_DEF_ERR(HI_ID_AO, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM) +/* the devide is not enabled */ +#define HI_ERR_AO_NOT_ENABLED HI_DEF_ERR(HI_ID_AO, EN_ERR_LEVEL_ERROR, EN_ERR_UNEXIST) +/* failure caused by malloc memory */ +#define HI_ERR_AO_NOMEM HI_DEF_ERR(HI_ID_AO, EN_ERR_LEVEL_ERROR, EN_ERR_NOMEM) +/* failure caused by malloc buffer */ +#define HI_ERR_AO_NOBUF HI_DEF_ERR(HI_ID_AO, EN_ERR_LEVEL_ERROR, EN_ERR_NOBUF) +/* no data in buffer */ +#define HI_ERR_AO_BUF_EMPTY HI_DEF_ERR(HI_ID_AO, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_EMPTY) +/* no buffer for new data */ +#define HI_ERR_AO_BUF_FULL HI_DEF_ERR(HI_ID_AO, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_FULL) +/* system is not ready,had not initialed or loaded*/ +#define HI_ERR_AO_SYS_NOTREADY HI_DEF_ERR(HI_ID_AO, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY) + +#define HI_ERR_AO_BUSY HI_DEF_ERR(HI_ID_AO, EN_ERR_LEVEL_ERROR, EN_ERR_BUSY) + + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif /* End of #ifdef __cplusplus */ + +#endif /* End of #ifndef __HI_COMM_AI_H__ */ + diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_ao.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_ao.h new file mode 100644 index 0000000000..78fd51b2ce --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_ao.h @@ -0,0 +1,37 @@ +/****************************************************************************** + + Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. + + ****************************************************************************** + File Name : hi_comm_ao.h + Version : Initial Draft + Author : Hisilicon multimedia software group + Created : 2009/5/5 + Description : + History : + 1.Date : 2009/5/5 + Author : p00123320 + Modification: Created file +******************************************************************************/ + + +#ifndef __HI_COMM_AO_H__ +#define __HI_COMM_AO_H__ + +#ifdef __cplusplus +#if __cplusplus +extern "C"{ +#endif +#endif /* End of #ifdef __cplusplus */ + + + + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif /* End of #ifdef __cplusplus */ + +#endif /* End of #ifndef __HI_COMM_AO_H__ */ + diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_hdmi.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_hdmi.h new file mode 100644 index 0000000000..7130655a03 --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_hdmi.h @@ -0,0 +1,760 @@ +/****************************************************************************** + + Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. + + ****************************************************************************** + File Name : hi_comm_hdmi.h + Version : Initial Draft + Author : Hisilicon multimedia software group + Created : 2011/12/21 + Description : + History : + 1.Date : 2011/12/21 + Author : n00168968 + Modification: Created file + +******************************************************************************/ + +#ifndef __HI_COMM_HDMI_H__ +#define __HI_COMM_HDMI_H__ + +#include "hi_type.h" +#include "hi_errno.h" +#include "hi_common.h" +#include "hi_comm_video.h" + +#define HI_HDMI_MAX_AUDIO_CAP_COUNT 15 + +#define HI_HDMI_MAX_AUDIO_SMPRATE_COUNT 10 + +#ifdef __cplusplus +#if __cplusplus +extern "C"{ +#endif +#endif /* End of #ifdef __cplusplus */ + +typedef enum hiHDMI_VIDEO_FMT_E +{ + HI_HDMI_VIDEO_FMT_1080P_60 = 0, + HI_HDMI_VIDEO_FMT_1080P_50, + HI_HDMI_VIDEO_FMT_1080P_30, + HI_HDMI_VIDEO_FMT_1080P_25, + HI_HDMI_VIDEO_FMT_1080P_24, + + HI_HDMI_VIDEO_FMT_1080i_60, + HI_HDMI_VIDEO_FMT_1080i_50, + + HI_HDMI_VIDEO_FMT_720P_60, + HI_HDMI_VIDEO_FMT_720P_50, + + HI_HDMI_VIDEO_FMT_576P_50, + HI_HDMI_VIDEO_FMT_480P_60, + + HI_HDMI_VIDEO_FMT_PAL, /* B D G H I PAL */ + HI_HDMI_VIDEO_FMT_PAL_N, /* (N)PAL */ + HI_HDMI_VIDEO_FMT_PAL_Nc, /* (Nc)PAL */ + + HI_HDMI_VIDEO_FMT_NTSC, /* (M)NTSC */ + HI_HDMI_VIDEO_FMT_NTSC_J, /* NTSC-J */ + HI_HDMI_VIDEO_FMT_NTSC_PAL_M, /* (M)PAL */ + + HI_HDMI_VIDEO_FMT_SECAM_SIN, /**< SECAM_SIN*/ + HI_HDMI_VIDEO_FMT_SECAM_COS, /**< SECAM_COS*/ + + HI_HDMI_VIDEO_FMT_861D_640X480_60, + HI_HDMI_VIDEO_FMT_VESA_800X600_60, + HI_HDMI_VIDEO_FMT_VESA_1024X768_60, + HI_HDMI_VIDEO_FMT_VESA_1280X720_60, + HI_HDMI_VIDEO_FMT_VESA_1280X800_60, + HI_HDMI_VIDEO_FMT_VESA_1280X1024_60, + HI_HDMI_VIDEO_FMT_VESA_1366X768_60, + HI_HDMI_VIDEO_FMT_VESA_1440X900_60, + HI_HDMI_VIDEO_FMT_VESA_1440X900_60_RB, + HI_HDMI_VIDEO_FMT_VESA_1600X900_60_RB, + HI_HDMI_VIDEO_FMT_VESA_1600X1200_60, + HI_HDMI_VIDEO_FMT_VESA_1680X1050_60, + HI_HDMI_VIDEO_FMT_VESA_1920X1080_60, + HI_HDMI_VIDEO_FMT_VESA_1920X1200_60, + HI_HDMI_VIDEO_FMT_VESA_2560X1440_30, + HI_HDMI_VIDEO_FMT_VESA_2048X1152_60, /* Currently, not support */ + HI_HDMI_VIDEO_FMT_VESA_CUSTOMER_DEFINE, /* Currently, not support */ + + HI_HDMI_VIDEO_FMT_BUTT +}HI_HDMI_VIDEO_FMT_E; + +typedef enum hiHDMI_VIDEO_SAMPLE_TYPE_E +{ + HI_HDMI_VIDEO_SAMPLE_TYPE_UNKNOWN, + HI_HDMI_VIDEO_SAMPLE_TYPE_PROGRESSIVE, + HI_HDMI_VIDEO_SAMPLE_TYPE_INTERLACE, + HI_HDMI_VIDEO_SAMPLE_TYPE_INFERED_PROGRESSIVE, + HI_HDMI_VIDEO_SAMPLE_TYPE_INFERED_INTERLACE, + + HI_HDMI_VIDEO_SAMPLE_TYPE_BUTT +}HI_HDMI_VIDEO_SAMPLE_TYPE_E; + +typedef enum hiHDMI_ASPECT_RATIO_E +{ + HI_HDMI_ASPECT_RATIO_UNKNOWN, /**< unknown aspect ratio */ + HI_HDMI_ASPECT_RATIO_4TO3, /**< 4:3 */ + HI_HDMI_ASPECT_RATIO_16TO9, /**< 16:9 */ + HI_HDMI_ASPECT_RATIO_SQUARE, /**< square */ + HI_HDMI_ASPECT_RATIO_14TO9, /**< 14:9 */ + HI_HDMI_ASPECT_RATIO_221TO1, /**< 221:100 */ + HI_HDMI_ASPECT_RATIO_ZOME, /**< default not support, use source's aspect ratio to display */ + HI_HDMI_ASPECT_RATIO_FULL, /**< default not support, full screen display */ + + HI_HDMI_ASPECT_RATIO_BUTT +}HI_HDMI_ASPECT_RATIO_E; + +typedef enum hiHDMI_SAMPLE_RATE_E +{ + HI_HDMI_SAMPLE_RATE_UNKNOWN=0, /**< unknown sample rate */ + HI_HDMI_SAMPLE_RATE_8K = 8000, /**< 8K sample rate */ + HI_HDMI_SAMPLE_RATE_11K = 11025, /**< 11.025K sample rate */ + HI_HDMI_SAMPLE_RATE_12K = 12000, /**< 12K sample rate */ + HI_HDMI_SAMPLE_RATE_16K = 16000, /**< 16K sample rate */ + HI_HDMI_SAMPLE_RATE_22K = 22050, /**< 22.050K sample rate */ + HI_HDMI_SAMPLE_RATE_24K = 24000, /**< 24K sample rate */ + HI_HDMI_SAMPLE_RATE_32K = 32000, /**< 32K sample rate */ + HI_HDMI_SAMPLE_RATE_44K = 44100, /**< 44.1K sample rate */ + HI_HDMI_SAMPLE_RATE_48K = 48000, /**< 48K sample rate */ + HI_HDMI_SAMPLE_RATE_88K = 88200, /**< 88.2K sample rate */ + HI_HDMI_SAMPLE_RATE_96K = 96000, /**< 96K sample rate */ + HI_HDMI_SAMPLE_RATE_176K = 176400, /**< 176K sample rate */ + HI_HDMI_SAMPLE_RATE_192K = 192000, /**< 192K sample rate */ + + HI_HDMI_SAMPLE_RATE_BUTT +}HI_HDMI_SAMPLE_RATE_E; + +typedef enum hiHDMI_BIT_DEPTH_E +{ + HI_HDMI_BIT_DEPTH_UNKNOWN =0, /**< unknown bit width */ + HI_HDMI_BIT_DEPTH_8 = 8, /**< 8 bits width */ + HI_HDMI_BIT_DEPTH_16 = 16, /**< 16 bits width */ + HI_HDMI_BIT_DEPTH_18 = 18, /**< 18 bits width */ + HI_HDMI_BIT_DEPTH_20 = 20, /**< 20 bits width */ + HI_HDMI_BIT_DEPTH_24 = 24, /**< 24 bits width */ + HI_HDMI_BIT_DEPTH_32 = 32, /**< 32 bits width */ + + HI_HDMI_BIT_DEPTH_BUTT +}HI_HDMI_BIT_DEPTH_E; + +typedef enum hiHDMI_SND_INTERFACE_E +{ + HI_HDMI_SND_INTERFACE_I2S, /** Used as a response to indicate that the device does not support the requested message type, or that it cannot execute it at the present time. */ +#define CEC_OPCODE_ABORT_MESSAGE 0XFF /**< Message This message is reserved for testing purposes. */ +/**< One Touch Play Feature*/ +#define CEC_OPCODE_ACTIVE_SOURCE 0X82 /**< Used by a new source to indicate that it has started to transmit a stream OR used in response to a */ +#define CEC_OPCODE_IMAGE_VIEW_ON 0X04 /**< Sent by a source device to the TV whenever it enters the active state (alternatively it may send ). */ +#define CEC_OPCODE_TEXT_VIEW_ON 0X0D /**< As , but should also remove any text, menus and PIP windows from the TV¡¯s display. */ +/**< Routing Control Feature*/ +#define CEC_OPCODE_INACTIVE_SOURCE 0X9D /**< Used by the currently active source to inform the TV that it has no video to be presented to the user, or is going into standby as the result of a local user command on the device. */ +#define CEC_OPCODE_REQUEST_ACTIVE_SOURCE 0X85 /**< Used by a new device to discover the status of the system. */ +#define CEC_OPCODE_ROUTING_CHANGE 0X80 /**< Sent by a CEC Switch when it is manually switched to inform all other devices on the network that the active route below the switch has changed. */ +#define CEC_OPCODE_ROUTING_INFORMATION 0X81 /**< Sent by a CEC Switch to indicate the active route below the switch. */ +#define CEC_OPCODE_SET_STREAM_PATH 0X86 /**< Used by the TV to request a streaming path from the specified physical address. */ +/**< Standby Feature*/ +#define CEC_OPCODE_STANDBY 0X36 /**< Switches one or all devices into standby mode. Can be used as a broadcast message or be addressed to a specific device. See section CEC 13.3 for important notes on the use of this message */ +/**< One Touch Record Feature*/ +#define CEC_OPCODE_RECORD_OFF 0X0B /**< Requests a device to stop a recording. */ +#define CEC_OPCODE_RECORD_ON 0X09 /**< Attempt to record the specified source. */ +#define CEC_OPCODE_RECORD_STATUS 0X0A /**< Used by a Recording Device to inform the initiator of the message about its status. */ +#define CEC_OPCODE_RECORD_TV_SCREEN 0X0F /**< Request by the Recording Device to record the presently displayed source. */ +/**< Timer Programming Feature*/ +#define CEC_OPCODE_CLEAR_ANALOGUE_TIMER 0X33 /**< Used to clear an Analogue timer block of a device. */ +#define CEC_OPCODE_CLEAR_DIGITAL_TIMER 0X99 /**< Used to clear a Digital timer block of a device. */ +#define CEC_OPCODE_CLEAR_EXTERNAL_TIMER 0XA1 /**< Used to clear an External timer block of a device. */ +#define CEC_OPCODE_SET_ANALOGUE_TIMER 0X34 /**< Used to set a single timer block on an Analogue Recording Device. */ +#define CEC_OPCODE_SET_DIGITAL_TIMER 0X97 /**< Used to set a single timer block on a Digital Recording Device. */ +#define CEC_OPCODE_SET_EXTERNAL_TIMER 0XA2 /**< Used to set a single timer block to record from an external device. */ +#define CEC_OPCODE_SET_TIMER_PROGRAM_TITLE 0X67 /**< Used to set the name of a program associated with a timer block. Sent directly after sending a or message. The name is then associated with that timer block. */ +#define CEC_OPCODE_TIMER_CLEARED_STATUS 0X43 /**< Used to give the status of a , or message. */ +#define CEC_OPCODE_TIMER_STATUS 0X35 /**< Used to send timer status to the initiator of a message. */ +/**< System Information Feature*/ +#define CEC_OPCODE_CEC_VERSION 0X9E /**< Used to indicate the supported CEC version, in response to a */ +#define CEC_OPCODE_GET_CEC_VERSION 0X9F /**< Used by a device to enquire which version of CEC the target supports */ +#define CEC_OPCODE_GIVE_PHYSICAL_ADDRESS 0X83 /**< A request to a device to return its physical address. */ +#define CEC_OPCODE_REPORT_PHYSICAL_ADDRESS 0X84 /**< Used to inform all other devices of the mapping between physical and logical address of the initiator. */ +#define CEC_OPCODE_GET_MENU_LANGUAGE 0X91 /**< Sent by a device capable of character generation (for OSD and Menus) to a TV in order to discover the currently selected Menu language. Also used by a TV during installation to discover the currently set menu language of other devices. */ +#define CEC_OPCODE_SET_MENU_LANGUAGE 0X32 /**< Used by a TV or another device to indicate the menu language. */ +/**< Deck Control Feature*/ +#define CEC_OPCODE_DECK_CONTROL 0X42 /**< Used to control a device¡¯s media functions. */ +#define CEC_OPCODE_DECK_STATUS 0X1B /**< Used to provide a deck¡¯s status to the initiator of the message. */ +#define CEC_OPCODE_GIVE_DECK_STATUS 0X1A /**< Used to request the status of a device, regardless of whether or not it is the current active source. */ +#define CEC_OPCODE_PLAY 0X41 /**< Used to control the playback behaviour of a source device. */ +/**< Tuner Control Feature*/ +#define CEC_OPCODE_GIVE_TUNER_DEVICE_STATUS 0X08 /**< Used to request the status of a tuner device. */ +#define CEC_OPCODE_SELECT_ANALOGUE_SERVICE 0X92 /**< Directly selects a Digital TV, Radio or Data Broadcast Service */ +#define CEC_OPCODE_TUNER_DEVICE_STATUS 0X07 /**< Use by a tuner device to provide its status to the initiator of the message. */ +#define CEC_OPCODE_TUNER_STEP_DECREMENT 0X06 /**< Used to tune to next lowest service in a tuner¡¯s service list. Can be used for PIP. */ +#define CEC_OPCODE_TUNER_STEP_INCREMENT 0X05 /**< Used to tune to next highest service in a tuner¡¯s service list. Can be used for PIP. */ +/**< Vendor Specific Command*/ +#define CEC_OPCODE_DEVICE_VENDOR_ID 0X87 /**< Reports the vendor ID of this device. */ +#define CEC_OPCODE_GIVE_DEVICE_VENDOR_ID 0X8C /**< Requests the Vendor ID from a device. */ +#define CEC_OPCODE_VENDOR_COMMAND 0X89 /**< Allows vendor specific commands to be sent between two devices. */ +#define CEC_OPCODE_VENDOR_COMMAND_WITH_ID 0XA0 /**< Allows vendor specific commands to be sent between two devices or broadcast. */ +#define CEC_OPCODE_VENDOR_REMOTE_BUTTON_DOWN 0X8A /**< Indicates that a remote control button has been depressed. */ +#define CEC_OPCODE_VENDOR_REMOTE_BUTTON_UP 0X8B /**< Indicates that a remote control button (the last button pressed indicated by the Vendor Remote Button Down message) has been released. */ +/**< OSD Display Feature*/ +#define CEC_OPCODE_SET_OSD_STRING 0X64 /**< Used to send a text message to output on a TV. */ +#define CEC_OPCODE_GIVE_OSD_NAME 0X46 /**< Used to request the preferred OSD name of a device for use in menus associated with that device. */ +#define CEC_OPCODE_SET_OSD_NAME 0X47 /**< Used to set the preferred OSD name of a device for use in menus associated with that device. */ +/**< Device Menu Control Feature*/ +#define CEC_OPCODE_MENU_REQUEST 0X8D /**< A request from the TV for a device to show/remove a menu or to query if a device is currently showing a menu. */ +#define CEC_OPCODE_MENU_STATUS 0X8E /**< Used to indicate to the TV that the device is showing/has removed a menu and requests the remote control keys to be passed though. */ +#define CEC_OPCODE_USER_CONTROL_PRESSED 0X44 /**< Used to indicate that the user pressed a remote control button or switched from one remote control button to another. */ +#define CEC_OPCODE_USER_CONTROL_RELEASED 0X45 /**< Indicates that user released a remote control button (the last one indicated by the message) */ +/**< Power Status Feature*/ +#define CEC_OPCODE_GIVE_DEVICE_POWER_STATUS 0X8F /**< Used to determine the current power status of a target device */ +#define CEC_OPCODE_REPORT_POWER_STATUS 0X90 /**< Used to inform a requesting device of the current power status */ +/**< System Audio Control Feature*/ +#define CEC_OPCODE_GIVE_AUDIO_STATUS 0X71 /**< Requests an amplifier to send its volume and mute status */ +#define CEC_OPCODE_GIVE_SYSTEM_AUDIO_MODE_STATUS 0x7D /**< Requests the status of the System Audio Mode */ +#define CEC_OPCODE_REPORT_AUDIO_STATUS 0X7A /**< Reports an amplifier¡¯s volume and mute status */ +#define CEC_OPCODE_SET_SYSTEM_AUDIO_MODE 0X72 /**< Turns the System Audio Mode On or Off. */ +#define CEC_OPCODE_SYSTEM_AUDIO_MODE_REQUEST 0X70 /**< A device implementing System Audio Control and which has volume control RC buttons (eg TV or STB) requests to use System Audio Mode to the amplifier */ +#define CEC_OPCODE_SYSTEM_AUDIO_MODE_STATUS 0X7E /**< Reports the current status of the System Audio Mode */ +/**< Audio Rate Control Feature*/ +#define CEC_OPCODE_SET_AUDIO_RATE 0X9A /**< Used to control audio rate from Source Device. */ + +#define CEC_OPCODE_POLLING_MESSAGE 0XFE/**< POLL message have no opcode, So, we just use this value */ + +typedef enum hiUNF_CEC_LOGICALADD_S +{ + HI_CEC_LOGICALADD_TV = 0X00, + HI_CEC_LOGICALADD_RECORDDEV_1 = 0X01, + HI_CEC_LOGICALADD_RECORDDEV_2 = 0X02, + HI_CEC_LOGICALADD_TUNER_1 = 0X03, + HI_CEC_LOGICALADD_PLAYDEV_1 = 0X04, + HI_CEC_LOGICALADD_AUDIOSYSTEM = 0X05, + HI_CEC_LOGICALADD_TUNER_2 = 0X06, + HI_CEC_LOGICALADD_TUNER_3 = 0X07, + HI_CEC_LOGICALADD_PLAYDEV_2 = 0X08, + HI_CEC_LOGICALADD_RECORDDEV_3 = 0X09, + HI_CEC_LOGICALADD_TUNER_4 = 0X0A, + HI_CEC_LOGICALADD_PLAYDEV_3 = 0X0B, + HI_CEC_LOGICALADD_RESERVED_1 = 0X0C, + HI_CEC_LOGICALADD_RESERVED_2 = 0X0D, + HI_CEC_LOGICALADD_SPECIALUSE = 0X0E, + HI_CEC_LOGICALADD_BROADCAST = 0X0F, + HI_CEC_LOGICALADD_BUTT +}HI_CEC_LOGICALADD_S; + +typedef enum hiUNF_CEC_CMDTYPE_E +{ + HI_CEC_STRUCTCOMMAND, + HI_CEC_RAWCOMMAND, + HI_CEC_BUTT +}HI_CEC_CMDTYPE_E; + +typedef struct hiUNF_CEC_RAWDATA_S +{ + HI_U8 u8Length; + HI_U8 u8Data[15]; +}HI_CEC_RAWDATA_S; + +typedef enum hiUNF_CEC_UICMD_E /**< User Interface Command Opcode */ +{ + HI_CEC_UICMD_SELECT = 0x00, + HI_CEC_UICMD_UP = 0x01, + HI_CEC_UICMD_DOWN = 0x02, + HI_CEC_UICMD_LEFT = 0x03, + HI_CEC_UICMD_RIGHT = 0x04, + HI_CEC_UICMD_RIGHT_UP = 0x05, + HI_CEC_UICMD_RIGHT_DOWN = 0x06, + HI_CEC_UICMD_LEFT_UP = 0x07, + HI_CEC_UICMD_LEFT_DOWN = 0x08, + HI_CEC_UICMD_ROOT_MENU = 0x09, + HI_CEC_UICMD_SETUP_MENU = 0x0A, + HI_CEC_UICMD_CONTENTS_MENU = 0x0B, + HI_CEC_UICMD_FAVORITE_MENU = 0x0C, + HI_CEC_UICMD_EXIT = 0x0D, + HI_CEC_UICMD_NUM_0 = 0x20, + HI_CEC_UICMD_NUM_1 = 0x21, + HI_CEC_UICMD_NUM_2 = 0x22, + HI_CEC_UICMD_NUM_3 = 0x23, + HI_CEC_UICMD_NUM_4 = 0x24, + HI_CEC_UICMD_NUM_5 = 0x25, + HI_CEC_UICMD_NUM_6 = 0x26, + HI_CEC_UICMD_NUM_7 = 0x27, + HI_CEC_UICMD_NUM_8 = 0x28, + HI_CEC_UICMD_NUM_9 = 0x29, + HI_CEC_UICMD_DOT = 0x2A, + HI_CEC_UICMD_ENTER = 0x2B, + HI_CEC_UICMD_CLEAR = 0x2C, + HI_CEC_UICMD_NEXT_FAVORITE = 0x2F, + HI_CEC_UICMD_CHANNEL_UP = 0x30, + HI_CEC_UICMD_CHANNEL_DOWN = 0x31, + HI_CEC_UICMD_PREVIOUS_CHANNEL = 0x32, + HI_CEC_UICMD_SOUND_SELECT = 0x33, + HI_CEC_UICMD_INPUT_SELECT = 0x34, + HI_CEC_UICMD_DISPLAY_INFORMATION = 0x35, + HI_CEC_UICMD_HELP = 0x36, + HI_CEC_UICMD_PAGE_UP = 0x37, + HI_CEC_UICMD_PAGE_DOWN = 0x38, + HI_CEC_UICMD_POWER = 0x40, + HI_CEC_UICMD_VOLUME_UP = 0x41, + HI_CEC_UICMD_VOLUME_DOWN = 0x42, + HI_CEC_UICMD_MUTE = 0x43, + HI_CEC_UICMD_PLAY = 0x44, + HI_CEC_UICMD_STOP = 0x45, + HI_CEC_UICMD_PAUSE = 0x46, + HI_CEC_UICMD_RECORD = 0x47, + HI_CEC_UICMD_REWIND = 0x48, + HI_CEC_UICMD_FAST_FORWARD = 0x49, + HI_CEC_UICMD_EJECT = 0x4A, + HI_CEC_UICMD_FORWARD = 0x4B, + HI_CEC_UICMD_BACKWARD = 0x4C, + HI_CEC_UICMD_STOP_RECORD = 0x4D, + HI_CEC_UICMD_PAUSE_RECORD = 0x4E, + HI_CEC_UICMD_ANGLE = 0x50, + HI_CEC_UICMD_SUBPICTURE = 0x51, + HI_CEC_UICMD_VIDEO_ON_DEMAND = 0x52, + HI_CEC_UICMD_ELECTRONIC_PROGRAM_GUIDE = 0x53, + HI_CEC_UICMD_TIMER_PROGRAMMING = 0x54, + HI_CEC_UICMD_INITIAL_CONFIGURATION = 0x55, + HI_CEC_UICMD_PLAY_FUNCTION = 0x60, + HI_CEC_UICMD_PAUSE_PLAY_FUNCTION = 0x61, + HI_CEC_UICMD_RECORD_FUNCTION = 0x62, + HI_CEC_UICMD_PAUSE_RECORD_FUNCTION = 0x63, + HI_CEC_UICMD_STOP_FUNCTION = 0x64, + HI_CEC_UICMD_MUTE_FUNCTION = 0x65, + HI_CEC_UICMD_RESTORE_VOLUME_FUNCTION = 0x66, + HI_CEC_UICMD_TUNE_FUNCTION = 0x67, + HI_CEC_UICMD_SELECT_MEDIA_FUNCTION = 0x68, + HI_CEC_UICMD_SELECT_AV_INPUT_FUNCTION = 0x69, + HI_CEC_UICMD_SELECT_AUDIO_INPUT_FUNCTION = 0x6A, + HI_CEC_UICMD_POWER_TOGGLE_FUNCTION = 0x6B, + HI_CEC_UICMD_POWER_OFF_FUNCTION = 0x6C, + HI_CEC_UICMD_POWER_ON_FUNCTION = 0x6D, + HI_CEC_UICMD_F1_BLUE = 0x71, + HI_CEC_UICMD_F2_RED = 0x72, + HI_CEC_UICMD_F3_GREEN = 0x73, + HI_CEC_UICMD_F4_YELLOW = 0x74, + HI_CEC_UICMD_F5 = 0x75, + HI_CEC_UICMD_DATA = 0x76 +}HI_CEC_UICMD_E; /* User Control Code */ + +typedef union hiUNF_CEC_Operand_t +{ + HI_CEC_RAWDATA_S stRawData; + HI_CEC_UICMD_E stUIOpcode; +}HI_CEC_Operand_t; + +typedef struct hiUNF_HDMI_CEC_CMD_S +{ + HI_CEC_LOGICALADD_S enSrcAdd; + HI_CEC_LOGICALADD_S enDstAdd; + HI_U8 u8Opcode; + HI_CEC_Operand_t unOperand; +}HI_HDMI_CEC_CMD_S; + +typedef struct hiUNF_HDMI_CEC_STATUS_S +{ + HI_BOOL bEnable; + HI_U8 u8PhysicalAddr[4]; /**< CEC physic addr */ + HI_U8 u8LogicalAddr; /**< CEC logic addr, default:0x03. */ + HI_U8 u8Network[HI_CEC_LOGICALADD_BUTT]; /**< CEC's net work£¬1:this device can answer cec command */ +}HI_HDMI_CEC_STATUS_S; + + +typedef enum hiERR_HDMI_CODE_E +{ + ERR_HDMI_NOT_INIT = 1, + ERR_HDMI_INVALID_PARA = 2, + ERR_HDMI_NUL_PTR = 3, + ERR_HDMI_DEV_NOT_OPEN = 4, + ERR_HDMI_DEV_NOT_CONNECT = 5, + ERR_HDMI_READ_SINK_FAILED = 6, + ERR_HDMI_INIT_ALREADY = 7, + ERR_HDMI_CALLBACK_ALREADY = 8, + ERR_HDMI_INVALID_CALLBACK = 9, + ERR_HDMI_FEATURE_NO_SUPPORT = 10, + ERR_HDMI_BUS_BUSY = 11, + ERR_HDMI_READ_EVENT_FAILED = 12, + ERR_HDMI_NOT_START = 13, + ERR_HDMI_READ_EDID_FAILED = 14, + ERR_HDMI_READ_DVI_EDID_SUCCESS = 15, + + ERR_HDMI_BUTT, +} ERR_HDMI_CODE_E; + +#define HI_ERR_HDMI_NOT_INIT HI_DEF_ERR(HI_ID_HDMI, EN_ERR_LEVEL_ERROR, ERR_HDMI_NOT_INIT) +#define HI_ERR_HDMI_INVALID_PARA HI_DEF_ERR(HI_ID_HDMI, EN_ERR_LEVEL_ERROR, ERR_HDMI_INVALID_PARA) +#define HI_ERR_HDMI_NUL_PTR HI_DEF_ERR(HI_ID_HDMI, EN_ERR_LEVEL_ERROR, ERR_HDMI_NUL_PTR) +#define HI_ERR_HDMI_DEV_NOT_OPEN HI_DEF_ERR(HI_ID_HDMI, EN_ERR_LEVEL_ERROR, ERR_HDMI_DEV_NOT_OPEN) +#define HI_ERR_HDMI_DEV_NOT_CONNECT HI_DEF_ERR(HI_ID_HDMI, EN_ERR_LEVEL_ERROR, ERR_HDMI_DEV_NOT_CONNECT) +#define HI_ERR_HDMI_READ_SINK_FAILED HI_DEF_ERR(HI_ID_HDMI, EN_ERR_LEVEL_ERROR, ERR_HDMI_READ_SINK_FAILED) +#define HI_ERR_HDMI_INIT_ALREADY HI_DEF_ERR(HI_ID_HDMI, EN_ERR_LEVEL_ERROR, ERR_HDMI_INIT_ALREADY) +#define HI_ERR_HDMI_CALLBACK_ALREADY HI_DEF_ERR(HI_ID_HDMI, EN_ERR_LEVEL_ERROR, ERR_HDMI_CALLBACK_ALREADY) +#define HI_ERR_HDMI_INVALID_CALLBACK HI_DEF_ERR(HI_ID_HDMI, EN_ERR_LEVEL_ERROR, ERR_HDMI_INVALID_CALLBACK) +#define HI_ERR_HDMI_FEATURE_NO_SUPPORT HI_DEF_ERR(HI_ID_HDMI, EN_ERR_LEVEL_ERROR, ERR_HDMI_FEATURE_NO_SUPPORT) +#define HI_ERR_HDMI_BUS_BUSY HI_DEF_ERR(HI_ID_HDMI, EN_ERR_LEVEL_ERROR, ERR_HDMI_BUS_BUSY) +#define HI_ERR_HDMI_READ_EVENT_FAILED HI_DEF_ERR(HI_ID_HDMI, EN_ERR_LEVEL_ERROR, ERR_HDMI_READ_EVENT_FAILED) +#define HI_ERR_HDMI_NOT_START HI_DEF_ERR(HI_ID_HDMI, EN_ERR_LEVEL_ERROR, ERR_HDMI_NOT_START) +#define HI_ERR_HDMI_READ_EDID_FAILED HI_DEF_ERR(HI_ID_HDMI, EN_ERR_LEVEL_ERROR, ERR_HDMI_READ_EDID_FAILED) +/*HSCP201311290001 l00183122 20131210 DVIģʽÏ£¬ÓÐÊä³ö£¬µ«ÊǶÁ²»µ½EDID + ÀíÂÛÉÏ£¬DVIģʽÏÂÊÇ¿ÉÒÔ¶Áȡǰ128λEDID£¬µ«ÊÇÈç¹û¶ÁÈ¡ºó·µ»Ø³É¹¦£¬½«¸Ä±äÔ­ÓÐÁ÷³Ì£¬·çÏÕ²»¿É¿Ø£» + Òò´ËΪÁ˲»¸Ä±äÔ­ÓÐÁ÷³Ì£¬ÉèÖÃÒ»¸öÌØÊâµÄ´íÎóÂ룬ÔÚDVIģʽÏÂʹÓ㬼ȿÉÒÔ¶Áµ½EDID£¬µ«Á÷³ÌÉÏÓÖ°´¶Á²»µ½´¦Àí£¬Ö»Ó°ÏìÓû§¶ÁÈ¡EDIDµÄ½á¹û*/ +#define HI_ERR_HDMI_READ_DVI_EDID_SUCCESS HI_DEF_ERR(HI_ID_HDMI, EN_ERR_LEVEL_ERROR, ERR_HDMI_READ_DVI_EDID_SUCCESS) + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif /* End of #ifdef __cplusplus */ + +#endif /* End of #ifndef __HI_COMM_VO_H__ */ + diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_ive.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_ive.h new file mode 100644 index 0000000000..675ce28c9e --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_ive.h @@ -0,0 +1,257 @@ +/****************************************************************************** + + Copyright (C), 2001-2011, HiSilicon Technologies Co., Ltd. + + ****************************************************************************** + File Name : hi_comm_ive.h + Version : Initial Draft + Author : HiSilicon multimedia software group + Created on : 2011-04-12 + Description : Intelligent video engine (IVE) data structure + + History : + 1.Date : 2011-04-12 + Author : Gong Xiongliang (employee ID: 00181683) + Modification: This file is created. + ******************************************************************************/ + +#ifndef __HI_COMM_IVE_H__ +#define __HI_COMM_IVE_H__ + +#include "hi_type.h" +#include "hi_debug.h" +#include "hi_common.h" +#include "hi_errno.h" +#include "hi_defines.h" + +#ifdef __cplusplus + #if __cplusplus + extern "C"{ + #endif +#endif + +#define IVE_MAX_HANDLE_NR 0x0FFFFFFF + +/* +*Describes the information about stored data. +*/ +typedef struct hiIVE_DATA_ATTR_S +{ + HI_U32 u32PhyAddr; /*Physical address of the data*/ + HI_U32 u32Stride; /*Data stride*/ +}IVE_MEM_INFO_S; + +/* +*Type of the input data +*The input data is classified into three types: +*SP420, SP422, and single component (including the components Y, U, V, R, G, and B) +*/ +typedef enum hiIVE_SRC_FMT_E +{ + IVE_SRC_FMT_SINGLE = 0, /*Single component*/ + IVE_SRC_FMT_SP420, /*YUV SP420*/ + IVE_SRC_FMT_SP422, /*YUV SP422*/ + IVE_SRC_FMT_BUTT +}IVE_SRC_FMT_E; + +/* +*Input data format +*Information about the data formats supported by the IVE. The IVE supports the data in the following formats: +*1 YUV SP422/SP420 +*2 RGB package/planar +*3 Single component +*/ +typedef struct hiIVE_SRC_INFO_S +{ + IVE_SRC_FMT_E enSrcFmt; + IVE_MEM_INFO_S stSrcMem; /*Data information*/ + + HI_U32 u32Height; /*Data height*/ + HI_U32 u32Width; /*Data width*/ +}IVE_SRC_INFO_S; + + +/* +*Type of the color space conversion (CSC) output results +*/ +typedef enum hiIVE_CSC_OUT_FMT_E +{ + IVE_CSC_OUT_FMT_PACKAGE = 0, + IVE_CSC_OUT_FMT_PLANAR, + IVE_CSC_OUT_FMT_BUTT +}IVE_CSC_OUT_FMT_E; + +/* +*CSC working mode +*/ +typedef enum hiIVE_CSC_MODE_E +{ + IVE_CSC_MODE_VIDEO_BT601_AND_BT656 = 0, /*CSC video transfer mode [16, 235]*/ + IVE_CSC_MODE_VIDEO_BT709, /*CSC video transfer mode [16, 235]*/ + IVE_CSC_MODE_PIC_BT601_AND_BT656, /*CSC picture transfer mode [0, 255]*/ + IVE_CSC_MODE_PIC_BT709, /*CSC picture transfer mode [0, 255]*/ + IVE_CSC_MODE_BUTT +}IVE_CSC_MODE_E; + +/* +*CSC control parameters +*You need to set these parameters when using the CSC operator. +*/ +typedef struct hiIVE_CSC_CTRL_S +{ + IVE_CSC_OUT_FMT_E enOutFmt; /*Output format*/ + IVE_CSC_MODE_E enCscMode; /*Working mode*/ +}IVE_CSC_CTRL_S; + + +/* +*Filter control parameters +*You need to set these parameters when using the filter operator. +*/ +typedef struct hiIVE_FILTER_CTRL_S +{ + HI_S8 as8Mask[9]; /*Template parameter filter coefficient*/ + HI_S8 u8Norm; /*Sum of all mask parameter values for normalization*/ +}IVE_FILTER_CTRL_S; + + +/* +*Filter+CSC control parameters +*You need to set these parameters when using the filter+CSC operator. +*The control information about both the filter and CSC needs to be configured. +*/ +typedef struct hiIVE_FILTER_AND_CSC_CTRL_S +{ + IVE_CSC_OUT_FMT_E enOutFmt; /*Output format*/ + IVE_CSC_MODE_E enCscMode; /*CSC working mode*/ + HI_S8 as8Mask[9]; /*Template parameter filter coefficient*/ + HI_S8 u8Norm; /*Sum of all mask parameter values for normalization*/ +}IVE_FILTER_AND_CSC_CTRL_S; + +/* +*SOBEL control parameter +*/ +typedef struct hiIVE_SOBEL_CTRL_S +{ + HI_S8 as8Mask[9]; /*Template parameter*/ +}IVE_SOBEL_CTRL_S; + + + +/* +*Type of the CANNY output results +*/ +typedef enum hiIVE_CANNY_OUT_FMT_E +{ + IVE_CANNY_OUT_FMT_ONLY_MAG = 0, /*Only the magnitude is output.*/ + IVE_CANNY_OUT_FMT_MAG_AND_ANG, /*The magnitude and angle are output.*/ + IVE_CANNY_OUT_FMT_BUTT +}IVE_CANNY_OUT_FMT_E; + +/* +*CANNY control parameter +*/ +typedef struct hiIVE_CANNY_CTRL_S +{ + IVE_CANNY_OUT_FMT_E enOutFmt; + HI_S8 as8Mask[9]; /*The template parameter is the same as that of the SOBEL operator.*/ +}IVE_CANNY_CTRL_S; + + +/* +*Dilate control parameters +*/ +typedef struct hiIVE_DILATE_CTRL_S +{ + HI_U8 au8Mask[9]; /*The template parameter value must be 0 or 255.*/ +}IVE_DILATE_CTRL_S; + + +/* +*Erode control parameter +*/ +typedef struct hiIVE_ERODE_CTRL_S +{ + HI_U8 au8Mask[9]; /*The template parameter value must be 0 or 255.*/ +}IVE_ERODE_CTRL_S; + + +/* +*Type of the thresh output results +*/ +typedef enum hiIVE_THRESH_OUT_FMT_E +{ + IVE_THRESH_OUT_FMT_BINARY = 0,/*If the source value is greater than the thresh, the maximum value is used; if the source value is smaller than or equal to the thresh, the minimum value is used.*/ + IVE_THRESH_OUT_FMT_TRUNC, /*If the source value is greater than the thresh, the maximum value is used; if the source value is smaller than or equal to the thresh, the source value is retained.*/ + IVE_THRESH_OUT_FMT_TOZERO, /*If the source value is greater than the thresh, the source value is retained; if the source value is smaller than or equal to the thresh, the minimum value is used.*/ + IVE_THRESH_OUT_FMT_BUTT +}IVE_THRESH_OUT_FMT_E; + +/* +*Thresh control parameters +*/ +typedef struct hiIVE_THRESH_CTRL_S +{ + IVE_THRESH_OUT_FMT_E enOutFmt; + HI_U32 u32Thresh; /*user-defined threshold*/ + HI_U32 u32MinVal; /*Minimum value when binarization*/ + HI_U32 u32MaxVal; /*Maxmum value when binarization*/ +}IVE_THRESH_CTRL_S; + + +/* +*Type of the SUB output results +*/ +typedef enum hiIVE_SUB_OUT_FMT_E +{ + IVE_SUB_OUT_FMT_ABS = 0, /*Absolute value of the difference*/ + IVE_SUB_OUT_FMT_SFR, /*The output result is obtained by shifting the result one digit right to reserve the signed bit.*/ + IVE_SUB_OUT_FMT_BUTT +}IVE_SUB_OUT_FMT_E; + + +/*Invalid device ID*/ +#define HI_ERR_IVE_INVALID_DEVID HI_DEF_ERR(HI_ID_IVE, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_DEVID) +/*Invalid channel ID*/ +#define HI_ERR_IVE_INVALID_CHNID HI_DEF_ERR(HI_ID_IVE, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_CHNID) +/*At least one parameter is illegal. For example, an illegal enumeration value exists.*/ +#define HI_ERR_IVE_ILLEGAL_PARAM HI_DEF_ERR(HI_ID_IVE, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM) +/*The channel exists.*/ +#define HI_ERR_IVE_EXIST HI_DEF_ERR(HI_ID_IVE, EN_ERR_LEVEL_ERROR, EN_ERR_EXIST) +/*The UN exists.*/ +#define HI_ERR_IVE_UNEXIST HI_DEF_ERR(HI_ID_IVE, EN_ERR_LEVEL_ERROR, EN_ERR_UNEXIST) +/*A null point is used.*/ +#define HI_ERR_IVE_NULL_PTR HI_DEF_ERR(HI_ID_IVE, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR) +/*Try to enable or initialize the system, device, or channel before configuring attributes.*/ +#define HI_ERR_IVE_NOT_CONFIG HI_DEF_ERR(HI_ID_IVE, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_CONFIG) +/*The operation is not supported currently.*/ +#define HI_ERR_IVE_NOT_SURPPORT HI_DEF_ERR(HI_ID_IVE, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_SUPPORT) +/*The operation, changing static attributes for example, is not permitted.*/ +#define HI_ERR_IVE_NOT_PERM HI_DEF_ERR(HI_ID_IVE, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM) +/*A failure caused by the malloc memory occurs.*/ +#define HI_ERR_IVE_NOMEM HI_DEF_ERR(HI_ID_IVE, EN_ERR_LEVEL_ERROR, EN_ERR_NOMEM) +/*A failure caused by the malloc buffer occurs.*/ +#define HI_ERR_IVE_NOBUF HI_DEF_ERR(HI_ID_IVE, EN_ERR_LEVEL_ERROR, EN_ERR_NOBUF) +/*The buffer is empty.*/ +#define HI_ERR_IVE_BUF_EMPTY HI_DEF_ERR(HI_ID_IVE, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_EMPTY) +/*No buffer is provided for storing new data.*/ +#define HI_ERR_IVE_BUF_FULL HI_DEF_ERR(HI_ID_IVE, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_FULL) +/*The source address or target address is incorrect during the operations such as calling copy_from_user or copy_to_user.*/ +#define HI_ERR_IVE_BADADDR HI_DEF_ERR(HI_ID_IVE, EN_ERR_LEVEL_ERROR, EN_ERR_BADADDR) +/*The resource is busy during the operations such as destroying a VENC channel without deregistering it.*/ +#define HI_ERR_IVE_BUSY HI_DEF_ERR(HI_ID_IVE, EN_ERR_LEVEL_ERROR, EN_ERR_BUSY) + +/*The system is not ready because it may be not initialized or loaded. + *The error code is returned when a device file fails to be opened. + */ +#define HI_ERR_IVE_NOTREADY HI_DEF_ERR(HI_ID_IVE, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY) + + +#ifdef __cplusplus + #if __cplusplus +} + #endif +#endif +#endif/*__HI_COMM_IVE_H__*/ + + diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_pciv.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_pciv.h new file mode 100644 index 0000000000..ae601f7c31 --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_pciv.h @@ -0,0 +1,279 @@ + +/****************************************************************************** + + Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. + + ****************************************************************************** + File Name : hi_comm_pciv.h + Version : Initial Draft + Author : Hisilicon multimedia software pciv + Created : 2008/06/04 + Last Modified : + Description : common struct definition for PCIV + Function List : + History : + +******************************************************************************/ + +#ifndef __HI_COMM_PCIV_H__ +#define __HI_COMM_PCIV_H__ + +#include "hi_type.h" +#include "hi_common.h" +#include "hi_errno.h" +#include "hi_comm_video.h" +#include "hi_comm_vdec.h" +#include "hi_comm_vpss.h" + +#ifdef __cplusplus +#if __cplusplus +extern "C"{ +#endif +#endif /* __cplusplus */ + +typedef HI_S32 PCIV_CHN; + +#define PCIV_MAX_BUF_NUM 16 /* pciv channel max buffer number */ +#define PCIV_MAX_CHIPNUM 32 /* max pciv device number which can join in the system */ + +#define MAKE_DWORD(high,low) (((low)&0x0000ffff)|((high)<<16)) +#define HIGH_WORD(x) (((x)&0xffff0000)>>16) +#define LOW_WORD(x) ((x)&0x0000ffff) + +/* vi object struct */ +typedef struct hiPCIV_VIDEVICE_S +{ + VI_DEV viDev; /* vi device number */ + VI_CHN viChn; /* vi channel number */ +} PCIV_VIDEVICE_S; + +/* vo object struct */ +typedef struct hiPCIV_VODEVICE_S +{ + VO_DEV voDev; /* vo device number */ + VO_CHN voChn; /* vo channel number */ +} PCIV_VODEVICE_S; + +/* vdec object struct */ +typedef struct hiPCIV_VDECDEVICE_S +{ + VDEC_CHN vdecChn; /* vedc channel number */ +} PCIV_VDECDEVICE_S; + +/* vpss object struct */ +typedef struct hiPCIV_VPSSDEVICE_S +{ + VPSS_GRP vpssGrp; /* vpss group number */ + VPSS_CHN vpssChn; /* vpss channel number */ +} PCIV_VPSSDEVICE_S; + +/* bind type for pciv */ +typedef enum hiPCIV_BIND_TYPE_E +{ + PCIV_BIND_VI = 0, + PCIV_BIND_VO = 1, + PCIV_BIND_VDEC = 2, + PCIV_BIND_VPSS = 3, + PCIV_BIND_BUTT +} PCIV_BIND_TYPE_E; + +/* bind object struct for pciv */ +typedef struct hiPCI_BIND_OBJ_S +{ + PCIV_BIND_TYPE_E enType; /* bind type for pciv */ + union + { + PCIV_VIDEVICE_S viDevice; + PCIV_VODEVICE_S voDevice; + PCIV_VDECDEVICE_S vdecDevice; + PCIV_VPSSDEVICE_S vpssDevice; + } unAttachObj; +} PCIV_BIND_OBJ_S; + +/* remote pciv object */ +typedef struct hiPCIV_REMOTE_OBJ_S +{ + HI_S32 s32ChipId; /* remote pciv device Id number */ + PCIV_CHN pcivChn; /* pciv channel number of remote pciv device */ +} PCIV_REMOTE_OBJ_S; + +/* attribution of target picture */ +typedef struct hiPCIV_PIC_ATTR_S +{ + HI_U32 u32Width; /* pciture width of pciv channel */ + HI_U32 u32Height; /* picture height of pciv channel */ + HI_U32 u32Stride[3]; /* pciture stride of pciv channel */ + VIDEO_FIELD_E u32Field; /* video frame field type of pciv channel */ + PIXEL_FORMAT_E enPixelFormat; /* pixel format of pciture of pciv channel */ +} PCIV_PIC_ATTR_S; + + +/* attribution of pciv chn */ +typedef struct hiPCIV_ATTR_S +{ + PCIV_PIC_ATTR_S stPicAttr; /* picture attibute */ + HI_S32 s32BufChip; /* The chip id which buffer is belong to */ + HI_U32 u32BlkSize; /* vb size of receiver for preview */ + HI_U32 u32Count; /* lenght of address list */ + HI_U32 u32PhyAddr[PCIV_MAX_BUF_NUM]; /* address list for picture move */ + PCIV_REMOTE_OBJ_S stRemoteObj; /* remote pciv object */ +} PCIV_ATTR_S; + +/* max count of video buffer block for pci window */ +#define PCIV_MAX_VBCOUNT 8 + +/* mpp video buffer config for pci window */ +typedef struct hiPCIV_WINVBCFG_S +{ + HI_U32 u32PoolCount; /* total number of video buffer pool */ + HI_U32 u32BlkSize[PCIV_MAX_VBCOUNT]; /* size of video buffer pool */ + HI_U32 u32BlkCount[PCIV_MAX_VBCOUNT]; /* number of video buffer pool */ +} PCIV_WINVBCFG_S; + +typedef struct hiPCIV_BASEWINDOW_S +{ + HI_S32 s32ChipId; /* pciv device number */ + HI_U32 u32NpWinBase; /* non-prefetch window pcie base address */ + HI_U32 u32PfWinBase; /* prefetch window pcie base address */ + HI_U32 u32CfgWinBase; /* config window pcie base address */ + HI_U32 u32PfAHBAddr; /* prefetch window AHB base address */ +} PCIV_BASEWINDOW_S; + +#define PCIV_MAX_DMABLK 128 +typedef struct hiPCIV_DMA_BLOCK_S +{ + HI_U32 u32SrcAddr; /* source address of dma task */ + HI_U32 u32DstAddr; /* destination address of dma task */ + HI_U32 u32BlkSize; /* data block size of dma task */ +} PCIV_DMA_BLOCK_S; + +typedef struct hiPCIV_DMA_TASK_S +{ + HI_U32 u32Count; /* total dma task number */ + HI_BOOL bRead; /* dam task is read or write data */ + PCIV_DMA_BLOCK_S *pBlock; +} PCIV_DMA_TASK_S; + + +/* + * Message port used in pciv_drvadp, you can't use it in your application. + */ +#define PCIV_MSGPORT_KERNEL 80 + + +/* + * You should not use follow mocros, they will be deleted ! + */ +#define PCIV_MSGPORT_MAXPORT 100 +#define PCIV_MSGPORT_TIME 79 +#define PCIV_MSGPORT_USERCMD 81 +#define PCIV_MSGPORT_USERNOTIFY2HOST 82 +#define PCIV_MSGPORT_USERNOTIFY2SLAVE 83 +#define PCIV_MSGPORT_USERNOTIFY2HOST_VDEC 84 +#define PCIV_MSGPORT_USERNOTIFY2SLAVE_VDEC 85 +#define PCIV_MAXVO_BIND 4 +/*----------------------------------------*/ + +typedef enum hiPCIV_FILTER_TYPE_E +{ + PCIV_FILTER_TYPE_NORM, + PCIV_FILTER_TYPE_EX, + PCIV_FILTER_TYPE_EX2, + + PCIV_FILTER_TYPE_BUTT +} PCIV_FILTER_TYPE_E; + +typedef enum hiPCIV_PIC_FIELD_E +{ + PCIV_FIELD_TOP, + PCIV_FIELD_BOTTOM, + PCIV_FIELD_BOTH, + + PCIV_FIELD_BUTT +} PCIV_PIC_FIELD_E; + +/* + * configuration of pre-process before sending source picture whth PCI + * item in this structrue have default value when sys init + */ +typedef struct hiPCIV_PREPROC_CFG_S +{ + PCIV_PIC_FIELD_E enFieldSel; /* pictrue field select */ + PCIV_FILTER_TYPE_E enFilterType; /* filter group type */ + DSU_HSCALE_FILTER_E enHFilter; /* horizontal filter */ + DSU_VSCALE_FILTER_E enVFilterL; /* vertical filter of luminance */ + DSU_VSCALE_FILTER_E enVFilterC; /* vertical filter of chroma */ +} PCIV_PREPROC_CFG_S; + + +#if 0 +/* Synchronize the time and PTS. The host is base. */ +typedef struct hiPCIV_TIME_SYNC_S +{ + struct timeval stSysTime; /* The current system time */ + HI_U64 u64PtsBase; /* The media PTS */ + HI_U32 u32ReqTagId; +} PCIV_TIME_SYNC_S; +#endif + +/* invlalid channel ID */ +#define HI_ERR_PCIV_INVALID_CHNID HI_DEF_ERR(HI_ID_PCIV, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_CHNID) +/* at lease one parameter is illagal ,eg, an illegal enumeration value */ +#define HI_ERR_PCIV_ILLEGAL_PARAM HI_DEF_ERR(HI_ID_PCIV, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM) +/* channel exists */ +#define HI_ERR_PCIV_EXIST HI_DEF_ERR(HI_ID_PCIV, EN_ERR_LEVEL_ERROR, EN_ERR_EXIST) +/* channel exists */ +#define HI_ERR_PCIV_UNEXIST HI_DEF_ERR(HI_ID_PCIV, EN_ERR_LEVEL_ERROR, EN_ERR_UNEXIST) +/* using a NULL point */ +#define HI_ERR_PCIV_NULL_PTR HI_DEF_ERR(HI_ID_PCIV, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR) +/* try to enable or initialize system,device or channel, before configing attribute */ +#define HI_ERR_PCIV_NOT_CONFIG HI_DEF_ERR(HI_ID_PCIV, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_CONFIG) +/* operation is not supported by NOW */ +#define HI_ERR_PCIV_NOT_SUPPORT HI_DEF_ERR(HI_ID_PCIV, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_SUPPORT) +/* operation is not permitted ,eg, try to change stati attribute */ +#define HI_ERR_PCIV_NOT_PERM HI_DEF_ERR(HI_ID_PCIV, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM) +/* failure caused by malloc memory */ +#define HI_ERR_PCIV_NOMEM HI_DEF_ERR(HI_ID_PCIV, EN_ERR_LEVEL_ERROR, EN_ERR_NOMEM) +/* failure caused by malloc buffer */ +#define HI_ERR_PCIV_NOBUF HI_DEF_ERR(HI_ID_PCIV, EN_ERR_LEVEL_ERROR, EN_ERR_NOBUF) +/* no data in buffer */ +#define HI_ERR_PCIV_BUF_EMPTY HI_DEF_ERR(HI_ID_PCIV, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_EMPTY) +/* no buffer for new data */ +#define HI_ERR_PCIV_BUF_FULL HI_DEF_ERR(HI_ID_PCIV, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_FULL) +/* system is not ready,had not initialed or loaded*/ +#define HI_ERR_PCIV_SYS_NOTREADY HI_DEF_ERR(HI_ID_PCIV, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY) +/* One DMA task is working, wait a minute */ +#define HI_ERR_PCIV_BUSY HI_DEF_ERR(HI_ID_PCIV, EN_ERR_LEVEL_ERROR, EN_ERR_BUSY) +#define HI_ERR_PCIV_TIMEOUT HI_DEF_ERR(HI_ID_PCIV, EN_ERR_LEVEL_ERROR, EN_ERR_BUTT+1) + +#define PCIV_TRACE(level, fmt...)\ +do{ \ + HI_TRACE(level, HI_ID_PCIV,"[Func]:%s [Line]:%d [Info]:", __FUNCTION__, __LINE__);\ + HI_TRACE(level,HI_ID_PCIV,##fmt);\ +}while(0) + +#define PCIV_CHECK_CHNID(ChnID)\ +do{\ + if(((ChnID) < 0) || ((ChnID) >= PCIV_MAX_CHN_NUM))\ + {\ + PCIV_TRACE(HI_DBG_ERR, "invalid chn id:%d \n", ChnID);\ + return HI_ERR_PCIV_INVALID_CHNID;\ + }\ +}while(0) + +#define PCIV_CHECK_PTR(ptr)\ +do{\ + if(NULL == (ptr))\ + {\ + return HI_ERR_PCIV_NULL_PTR;\ + }\ +}while(0) + + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif /* __cplusplus */ +#endif /* __HI_COMM_PCIV_H__ */ + diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_rc.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_rc.h new file mode 100644 index 0000000000..f1b3bd0549 --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_rc.h @@ -0,0 +1,382 @@ +/****************************************************************************** + + Copyright (C), 2001-2012, Hisilicon Tech. Co., Ltd. + + ****************************************************************************** + File Name : hi_comm_rc.h + Version : + Author : Hisilicon Hi35xx MPP Team + Created : 2006/11/24 + Last Modified : + Description : common struct definition for Rate control + Function List : + History : +******************************************************************************/ +#ifndef __HI_COMM_RC_H__ +#define __HI_COMM_RC_H__ + +#ifdef __cplusplus +#if __cplusplus +extern "C"{ +#endif +#endif /* __cplusplus */ + +typedef HI_U32 HI_FR32; + +typedef enum hiVENC_RC_MODE_E +{ + VENC_RC_MODE_H264CBR = 1, + VENC_RC_MODE_H264VBR, + VENC_RC_MODE_H264ABR, + VENC_RC_MODE_H264FIXQP, + + VENC_RC_MODE_MJPEGCBR, + VENC_RC_MODE_MJPEGVBR, + VENC_RC_MODE_MJPEGABR, + VENC_RC_MODE_MJPEGFIXQP, + + VENC_RC_MODE_MPEG4CBR, + VENC_RC_MODE_MPEG4VBR, + VENC_RC_MODE_MPEG4ABR, + VENC_RC_MODE_MPEG4FIXQP, + + VENC_RC_MODE_H264CBRv2, + VENC_RC_MODE_H264VBRv2, + VENC_RC_MODE_MJPEGCBRv2, + VENC_RC_MODE_MJPEGVBRv2, + VENC_RC_MODE_BUTT, + +}VENC_RC_MODE_E; + + +typedef struct hiVENC_ATTR_H264_FIXQP_S +{ + HI_U32 u32Gop; /*the interval of ISLICE. */ + HI_U32 u32ViFrmRate; /* the input frame rate of the venc chnnel */ + HI_FR32 fr32TargetFrmRate ; /* the target frame rate of the venc chnnel */ + HI_U32 u32IQp; /* qp of the i frame */ + HI_U32 u32PQp; /* qp of the p frame */ +} VENC_ATTR_H264_FIXQP_S; + +typedef struct hiVENC_ATTR_H264_CBR_S +{ + HI_U32 u32Gop; /*the interval of ISLICE. */ + HI_U32 u32StatTime; /* the rate statistic time, the unit is senconds(s) */ + HI_U32 u32ViFrmRate; /* the input frame rate of the venc chnnel */ + HI_FR32 fr32TargetFrmRate ; /* the target frame rate of the venc chnnel */ + HI_U32 u32BitRate; /* average bitrate */ + HI_U32 u32FluctuateLevel; /* level [0..5].scope of bitrate fluctuate. 1-5: 10%-50%. 0: SDK optimized, recommended; */ +} VENC_ATTR_H264_CBR_S; + +typedef struct hiVENC_ATTR_H264_VBR_S +{ + HI_U32 u32Gop; /*the interval of ISLICE. */ + HI_U32 u32StatTime; /* the rate statistic time, the unit is senconds(s) */ + HI_U32 u32ViFrmRate; /* the input frame rate of the venc chnnel */ + HI_FR32 fr32TargetFrmRate ; /* the target frame rate of the venc chnnel */ + HI_U32 u32MaxBitRate; /* the max bitrate */ + HI_U32 u32MaxQp; /* the max qp */ + HI_U32 u32MinQp; /* the min qp */ +}VENC_ATTR_H264_VBR_S; + +typedef struct hiVENC_ATTR_H264_ABR_S +{ + HI_U32 u32Gop; /*the interval of ISLICE. */ + HI_U32 u32StatTime; /* the rate statistic time, the unit is senconds(s) */ + HI_U32 u32ViFrmRate; /* the input frame rate of the venc chnnel */ + HI_FR32 fr32TargetFrmRate ; /* the target frame rate of the venc chnnel */ + HI_U32 u32AvgBitRate; /* average bitrate */ + HI_U32 u32MaxBitRate; /* the max bitrate */ +}VENC_ATTR_H264_ABR_S; + +typedef struct hiVENC_ATTR_MPEG4_FIXQP_S +{ + HI_U32 u32Gop; /*the interval of ISLICE. */ + HI_U32 u32ViFrmRate; /* the input frame rate of the venc chnnel */ + HI_FR32 fr32TargetFrmRate ; /* the target frame rate of the venc chnnel */ + HI_U32 u32IQp; /* qp of the i frame */ + HI_U32 u32PQp; /* qp of the p frame */ +}VENC_ATTR_MPEG4_FIXQP_S; + +typedef struct hiVENC_ATTR_MPEG4_CBR_S +{ + HI_U32 u32Gop; /*the interval of ISLICE. */ + HI_U32 u32StatTime; /* the rate statistic time, the unit is senconds(s) */ + HI_U32 u32ViFrmRate; /* the input frame rate of the venc chnnel */ + HI_FR32 fr32TargetFrmRate ; /* the target frame rate of the venc chnnel */ + HI_U32 u32BitRate; /* average bitrate */ + HI_U32 u32FluctuateLevel; /* level [0..5].scope of bitrate fluctuate. 1-5: 10%-50%. 0: SDK optimized, recommended; */ +}VENC_ATTR_MPEG4_CBR_S; + +typedef struct hiVENC_ATTR_MPEG4_VBR_S +{ + HI_U32 u32Gop; /* the interval of ISLICE. */ + HI_U32 u32StatTime; /* the rate statistic time, the unit is senconds(s) */ + HI_U32 u32ViFrmRate; /* the input frame rate of the venc chnnel */ + HI_FR32 fr32TargetFrmRate ; /* the target frame rate of the venc chnnel */ + HI_U32 u32MaxBitRate; /* the max bitrate */ + HI_U32 u32MaxQp; /* the max qp */ + HI_U32 u32MinQp; /* the min qp */ +}VENC_ATTR_MPEG4_VBR_S; + +typedef struct hiVENC_ATTR_MJPEG_FIXQP_S +{ + HI_U32 u32ViFrmRate; /* the input frame rate of the venc chnnel */ + HI_FR32 fr32TargetFrmRate; /* the target frame rate of the venc chnnel */ + HI_U32 u32Qfactor; /* image quality :[1,99]*/ +}VENC_ATTR_MJPEG_FIXQP_S; + +typedef struct hiVENC_ATTR_MJPEG_CBR_S +{ + HI_U32 u32StatTime; /* the rate statistic time, the unit is senconds(s) */ + HI_U32 u32ViFrmRate; /* the input frame rate of the venc chnnel */ + HI_FR32 fr32TargetFrmRate ; /* the target frame rate of the venc chnnel */ + HI_U32 u32BitRate; /* average bitrate */ + HI_U32 u32FluctuateLevel; /* level [0..5].scope of bitrate fluctuate. 1-5: 10%-50%. 0: SDK optimized, recommended; */ +} VENC_ATTR_MJPEG_CBR_S; + +typedef struct hiVENC_ATTR_MJPEG_VBR_S +{ + HI_U32 u32StatTime; /* the rate statistic time, the unit is senconds(s) */ + HI_U32 u32ViFrmRate; /* the input frame rate of the venc chnnel */ + HI_FR32 fr32TargetFrmRate; /* the target frame rate of the venc chnnel */ + HI_U32 u32MaxBitRate; /* max bitrate */ + HI_U32 u32MaxQfactor; /* max image quailty allowed */ + HI_U32 u32MinQfactor; /* min image quality allowed */ +}VENC_ATTR_MJPEG_VBR_S; + +typedef struct hiVENC_RC_ATTR_S +{ + VENC_RC_MODE_E enRcMode; /*the type of rc*/ + union + { + VENC_ATTR_H264_CBR_S stAttrH264Cbr; + VENC_ATTR_H264_VBR_S stAttrH264Vbr; + VENC_ATTR_H264_FIXQP_S stAttrH264FixQp; + VENC_ATTR_H264_ABR_S stAttrH264Abr; + + VENC_ATTR_MPEG4_CBR_S stAttrMpeg4Cbr; + VENC_ATTR_MPEG4_FIXQP_S stAttrMpeg4FixQp; + VENC_ATTR_MPEG4_VBR_S stAttrMpeg4Vbr; + + VENC_ATTR_MJPEG_CBR_S stAttrMjpegeCbr; + VENC_ATTR_MJPEG_FIXQP_S stAttrMjpegeFixQp; + VENC_ATTR_MJPEG_VBR_S stAttrMjpegeVbr; + }; + HI_VOID* pRcAttr ; /*the rc attribute which could be specified by user*/ + +}VENC_RC_ATTR_S; + +typedef enum hiRC_SUPERFRM_MODE_EN +{ + SUPERFRM_NONE, /* sdk don't care super frame */ + SUPERFRM_DISCARD, /* the super frame is discarded */ + SUPERFRM_REENCODE, /* the super frame is re-encode */ + SUPERFRM_BUTT +}VENC_SUPERFRM_MODE_EN; + +typedef struct hiVENC_PARAM_H264_CBR_S +{ + HI_U32 u32MinIprop; /* the min ratio of i frame and p frame */ + HI_U32 u32MaxIprop; /* the max ratio of i frame and p frame */ + HI_U32 u32MaxQp; /* the max QP value */ + HI_U32 u32MaxStartQp; /* the max QP value for rate control of frame level,should between [u32MinQp,u32MaxQp] */ + HI_U32 u32MinQp; /* the min QP value */ + HI_U32 u32MaxPPDeltaQp; /* the max qp value difference between two successive P frame */ + HI_U32 u32MaxIPDeltaQp; /* the max qp value difference between p frame and the next i frame */ + HI_BOOL bLostFrmOpen; /* Indicates whether to discard frames to ensure + stable bit rate when the instant bit rate is exceeded */ + HI_U32 u32LostFrmBpsThr; /* the instant bit rate threshold */ + VENC_SUPERFRM_MODE_EN enSuperFrmMode; /* the super frame mode */ + HI_U32 u32SuperIFrmBitsThr; /* Indicate the threshold of the super I frame + for enabling the super frame processing mode */ + HI_U32 u32SuperPFrmBitsThr; /* Indicate the threshold of the super I frame + for enabling the super frame processing mode */ + HI_S32 s32IPQPDelta; /* the qp difference between the i frame and the before gop avarage qp */ + HI_U32 u32RQRatio[8]; /* the rate stabilization weight, + 100-u32RQRatio[i] is the sequence quality stabilization weight */ + HI_U32 u32MinIQp; /* min qp for i frame */ +}VENC_PARAM_H264_CBR_S; + +typedef struct hiVENC_PARAM_H264_CBRV2_S +{ + HI_U32 u32MinIprop; /* the min ratio of i frame and p frame */ + HI_U32 u32MaxIprop; /* the max ratio of i frame and p frame */ + HI_U32 u32MaxQp; /* the max QP value */ + HI_U32 u32MaxStartQp; /* the max QP value for rate control of frame level,should between [u32MinQp,u32MaxQp] */ + HI_U32 u32MinQp; /* the min QP value */ + HI_BOOL bLostFrmOpen; /* Indicates whether to discard frames to ensure + stable bit rate when the instant bit rate is exceeded */ + HI_U32 u32LostFrmBpsThr; /* the instant bit rate threshold */ + VENC_SUPERFRM_MODE_EN enSuperFrmMode; /* the super frame mode */ + HI_U32 u32SuperIFrmBitsThr; /* Indicate the threshold of the super I frame + for enabling the super frame processing mode */ + HI_U32 u32SuperPFrmBitsThr; /* Indicate the threshold of the super I frame + for enabling the super frame processing mode */ + HI_S32 s32IPQPDelta; /* the qp difference between the i frame and the before gop avarage qp; == Qp(P) - Qp(I) */ + HI_S32 s32QualityLevel; /* quality of picture [1, 5] */ + HI_S32 s32MaxReEncodeTimes; /* max number of re-encode times [0, 3]*/ + HI_U32 u32MinIQp; /* min qp for i frame */ +}VENC_PARAM_H264_CBRV2_S; + +typedef struct hiVENC_PARAM_H264_VBR_S +{ + HI_S32 s32DeltaQP; /* Indicates the maximum change of QP values of frames + when the picture quality changes */ + HI_S32 s32ChangePos; /* Indicates the ratio of the current bit rate to the maximum + bit rate when the QP value starts to be adjusted */ + HI_U32 u32MinIprop; /* the min ratio of i frame and p frame */ + HI_U32 u32MaxIprop; /* the max ratio of i frame and p frame */ + + HI_BOOL bLostFrmOpen; /* Indicates whether to discard frames to ensure + stable bit rate when the instant bit rate is exceeded */ + HI_U32 u32LostFrmBpsThr; /* the instant bit rate threshold */ + + VENC_SUPERFRM_MODE_EN enSuperFrmMode; /* Indicates the mode of processing the super frame */ + HI_U32 u32SuperIFrmBitsThr; /* Indicate the threshold of the super I frame + for enabling the super frame processing mode */ + HI_U32 u32SuperPFrmBitsThr; /* Indicate the threshold of the super I frame + for enabling the super frame processing mode */ + HI_U32 u32MinIQP; /* min qp for i frame */ +}VENC_PARAM_H264_VBR_S; + +typedef struct hiVENC_PARAM_H264_ABR_S +{ + HI_U32 u32MaxQp; + HI_U32 u32MinQp; + HI_S32 s32IPQPDelta; + HI_U32 u32StartQp; +}VENC_PARAM_H264_ABR_S; + +typedef struct hiVENC_PARAM_MJPEG_CBR_S +{ + HI_U32 u32MaxQfactor; /* the max Qfactor value*/ + HI_U32 u32MinQfactor; /* the min Qfactor value */ + + HI_BOOL bLostFrmOpen; /* Indicates whether to discard frames to ensure + stable bit rate when the instant bit rate is exceeded */ + HI_U32 u32LostFrmBpsThr; /* the instant bit rate threshold */ + + VENC_SUPERFRM_MODE_EN enSuperFrmMode; /* the super frame mode */ + HI_U32 u32SuperFrmBitsThr; /* Indicate the threshold of the super frame + for enabling the super frame processing mode */ + HI_U32 u32RQRatio[8]; /* the rate stabilization weight, + 100-u32RQRatio[i] is the sequence quality stabilization weight */ + +}VENC_PARAM_MJPEG_CBR_S; + +typedef struct hiVENC_PARAM_MJPEG_VBR_S +{ + HI_S32 s32DeltaQfactor; /* Indicates the maximum change of Qfactor values of frames + when the picture quality changes */ + HI_S32 s32ChangePos; /* Indicates the ratio of the current bit rate to the maximum + bit rate when the Qfactor value starts to be adjusted */ + HI_BOOL bLostFrmOpen; /* Indicates whether to discard frames to ensure + stable bit rate when the instant bit rate is exceeded */ + HI_U32 u32LostFrmBpsThr; /* the instant bit rate threshold */ + + VENC_SUPERFRM_MODE_EN enSuperFrmMode; /* Indicates the mode of processing the super frame */ + + HI_U32 u32SuperFrmBitsThr; /* Indicate the threshold of the super frame + for enabling the super frame processing mode */ +}VENC_PARAM_MJPEG_VBR_S; + +typedef struct hiVENC_PARAM_MPEG4_CBR_S +{ + HI_U32 u32MinIprop; /* the min ratio of i frame and p frame*/ + HI_U32 u32MaxIprop; /* the max ratio of i frame and p frame */ + + HI_U32 u32MaxQp; /* the max QP value*/ + HI_U32 u32MaxStartQp; /* the max QP value for rate control of frame level,should between [u32MinQp,u32MaxQp]*/ + HI_U32 u32MinQp; /* the min QP value */ + HI_U32 u32MaxPPDeltaQp; /* the max qp value difference between two successive P frame */ + HI_U32 u32MaxIPDeltaQp; /* the max qp value difference between p frame and the next i frame */ + + HI_BOOL bLostFrmOpen; /* Indicates whether to discard frames to ensure + stable bit rate when the instant bit rate is exceeded */ + HI_U32 u32LostFrmBpsThr; /* the instant bit rate threshold */ + + VENC_SUPERFRM_MODE_EN enSuperFrmMode; /* the super frame mode */ + HI_U32 u32SuperIFrmBitsThr; /* Indicate the threshold of the super I frame + for enabling the super frame processing mode */ + HI_U32 u32SuperPFrmBitsThr; /* Indicate the threshold of the super I frame + for enabling the super frame processing mode */ + + HI_S32 s32IPQPDelta; /* the qp difference between the i frame and the before gop avarage qp*/ + + HI_U32 u32RQRatio[8]; /* the rate stabilization weight, + 100-u32RQRatio[i] is the sequence quality stabilization weight */ +}VENC_PARAM_MPEG4_CBR_S; + +typedef struct hiVENC_PARAM_MPEG4_VBR_S +{ + HI_S32 s32DeltaQP; /* Indicates the maximum change of QP values of frames + when the picture quality changes */ + HI_S32 s32ChangePos; /* Indicates the ratio of the current bit rate to the maximum + bit rate when the QP value starts to be adjusted */ + + HI_U32 u32MinIprop; /* the min ratio of i frame and p frame */ + HI_U32 u32MaxIprop; /* the max ratio of i frame and p frame */ + + HI_BOOL bLostFrmOpen; /* Indicates whether to discard frames to ensure + stable bit rate when the instant bit rate is exceeded */ + HI_U32 u32LostFrmBpsThr; /* the instant bit rate threshold */ + + VENC_SUPERFRM_MODE_EN enSuperFrmMode; /* Indicates the mode of processing the super frame */ + HI_U32 u32SuperIFrmBitsThr; /* Indicate the threshold of the super I frame + for enabling the super frame processing mode */ + HI_U32 u32SuperPFrmBitsThr; /* Indicate the threshold of the super I frame + for enabling the super frame processing mode */ +}VENC_PARAM_MPEG4_VBR_S; + +typedef struct hiVENC_RC_PARAM_S +{ + HI_U32 u32ThrdI[12]; /* just useful for h264 and mpeg4 for now */ + HI_U32 u32ThrdP[12]; + HI_U32 u32QpDelta; + union + { + VENC_PARAM_H264_CBR_S stParamH264Cbr; + VENC_PARAM_H264_VBR_S stParamH264VBR; + VENC_PARAM_H264_ABR_S stParamH264ABR; + VENC_PARAM_MJPEG_CBR_S stParamMjpegCbr; + VENC_PARAM_MJPEG_VBR_S stParamMjpegVbr; + VENC_PARAM_MPEG4_CBR_S stParamMpeg4Cbr; + VENC_PARAM_MPEG4_VBR_S stParamMpeg4Vbr; + VENC_PARAM_H264_CBRV2_S stParamH264CbrV2; + }; + + HI_VOID* pRcParam; /*RC parameter which could be specified by usrer*/ +}VENC_RC_PARAM_S; + +typedef enum hiVENC_RC_PRIORITY_E +{ + VENC_RC_PRIORITY_BITRATE_FIRST = 1, + VENC_RC_PRIORITY_FRAMEBITS_FIRST, + + VENC_RC_PRIORITY_BUTT, +} VENC_RC_PRIORITY_E; + +typedef enum hiVENC_LOSTFRM_MODE_E +{ + LOSTFRM_NORMAL, /*normal mode*/ + LOSTFRM_PSKIP, /*pskip*/ + LOSTFRM_BUTT, +} VENC_LOSTFRM_MODE_E; + +typedef struct hiVENC_PARAM_LOSTFRM_S +{ + HI_BOOL bLostFrmOpen; /* Indicates whether to discard frames to ensure + stable bit rate when the instant bit rate is exceeded */ + HI_U32 u32LostFrmBpsThr; /* the instant bit rate threshold */ + VENC_LOSTFRM_MODE_E enLostFrmMode; /* lost frame strategy */ + HI_U32 u32LostFrmGaps; /* the gap of lost frame */ +} VENC_PARAM_LOSTFRM_S; + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif /* __cplusplus */ + +#endif /* __HI_COMM_RC_H__ */ \ No newline at end of file diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_region.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_region.h new file mode 100644 index 0000000000..666e102ba1 --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_region.h @@ -0,0 +1,261 @@ +/****************************************************************************** +* +* Copyright (C), 2001-2011, Huawei Tech. Co., Ltd. +* +******************************************************************************* +* File Name : hi_comm_region.h +* Version : Initial Draft +* Author : j00169368 +* Created : 2010/12/13 +* Last Modified : +* Description : include RGN struct , Marco and Error information +* Function List : +* +* +* History: +* +* 1. Date : 2010/12/13 +* Author : j00169368 +* Modification : Created file +* +******************************************************************************/ + + +#ifndef __HI_COMM_REGION_H__ +#define __HI_COMM_REGION_H__ + +#include "hi_common.h" +#include "hi_comm_video.h" +#include "hi_errno.h" +#include "hi_defines.h" + + +#ifdef __cplusplus +#if __cplusplus +extern "C"{ +#endif +#endif /* End of #ifdef __cplusplus */ + + + + + +typedef HI_U32 RGN_HANDLE; + +/* type of video regions */ +typedef enum hiRGN_TYPE_E +{ + OVERLAY_RGN = 0, /* video overlay region */ + COVER_RGN, + COVEREX_RGN, + OVERLAYEX_RGN, + RGN_BUTT +} RGN_TYPE_E; + +typedef enum hiINVERT_COLOR_MODE_E +{ + LESSTHAN_LUM_THRESH = 0, /* the lum of the video is less than the lum threshold which is set by u32LumThresh */ + MORETHAN_LUM_THRESH, /* the lum of the video is more than the lum threshold which is set by u32LumThresh */ + INVERT_COLOR_BUTT +}INVERT_COLOR_MODE_E; + +typedef struct hiOVERLAY_QP_INFO_S +{ + HI_BOOL bAbsQp; + HI_S32 s32Qp; +}OVERLAY_QP_INFO_S; + +typedef struct hiOVERLAY_INVERT_COLOR_S +{ + SIZE_S stInvColArea; //It must be multipe of 16 but not more than 64. + HI_U32 u32LumThresh; //The threshold to decide whether invert the OSD's color or not. + INVERT_COLOR_MODE_E enChgMod; + HI_BOOL bInvColEn; //The switch of inverting color. +}OVERLAY_INVERT_COLOR_S; + +/* Define which feild to be attached */ +typedef enum hiRGN_ATTACH_FIELD_E +{ + RGN_ATTACH_FIELD_FRAME = 0, /* whole frame */ + RGN_ATTACH_FIELD_TOP, /* top field */ + RGN_ATTACH_FIELD_BOTTOM, /* bottom field */ + + RGN_ATTACH_FIELD_BUTT +} RGN_ATTACH_FIELD_E; + +typedef struct hiOVERLAY_ATTR_S +{ + /* bitmap pixel format,now only support ARGB1555 or ARGB4444 */ + PIXEL_FORMAT_E enPixelFmt; + + /* background color, pixel format depends on "enPixelFmt" */ + HI_U32 u32BgColor; + + /* region size,W:[4,4096],align:2,H:[4,4096],align:2 */ + SIZE_S stSize; +}OVERLAY_ATTR_S; + +typedef struct hiOVERLAY_CHN_ATTR_S +{ + /* X:[0,4096],align:4,Y:[0,4096],align:4 */ + POINT_S stPoint; + + /* background an foreground transparence when pixel format is ARGB1555 + * the pixel format is ARGB1555,when the alpha bit is 1 this alpha is value! + * range:[0,128] + */ + HI_U32 u32FgAlpha; + + /* background an foreground transparence when pixel format is ARGB1555 + * the pixel format is ARGB1555,when the alpha bit is 0 this alpha is value! + * range:[0,128] + */ + HI_U32 u32BgAlpha; + + HI_U32 u32Layer; /* OVERLAY region layer range:[0,7]*/ + + OVERLAY_QP_INFO_S stQpInfo; + + OVERLAY_INVERT_COLOR_S stInvertColor; +}OVERLAY_CHN_ATTR_S; + +typedef struct hiCOVER_CHN_ATTR_S +{ + RECT_S stRect; + HI_U32 u32Color; + HI_U32 u32Layer; /* COVER region layer range:[0,3] */ +}COVER_CHN_ATTR_S; + +typedef struct hiCOVEREX_CHN_ATTR_S +{ + RECT_S stRect; + HI_U32 u32Color; + HI_U32 u32Layer; /* COVEREX region layer range:[0,7] */ +}COVEREX_CHN_ATTR_S; + +typedef struct hiOVERLAYEX_COMM_ATTR_S +{ + PIXEL_FORMAT_E enPixelFmt; + + /* background color, pixel format depends on "enPixelFmt" */ + HI_U32 u32BgColor; + + /* region size,W:[4,1920],align:2,H:[4,1080],align:2 */ + SIZE_S stSize; +}OVERLAYEX_ATTR_S; + +typedef struct hiOVERLAYEX_CHN_ATTR_S +{ + /* X:[0,4096],align:4,Y:[0,4636],align:4 */ + POINT_S stPoint; + + /* background an foreground transparence when pixel format is ARGB1555 + * the pixel format is ARGB1555,when the alpha bit is 1 this alpha is value! + * range:[0,128] + */ + HI_U32 u32FgAlpha; + + /* background an foreground transparence when pixel format is ARGB1555 + * the pixel format is ARGB1555,when the alpha bit is 0 this alpha is value! + * range:[0,128] + */ + HI_U32 u32BgAlpha; + + HI_U32 u32Layer; /* OVERLAYEX region layer range:[0,15]*/ +}OVERLAYEX_CHN_ATTR_S; + +typedef union hiRGN_ATTR_U +{ + OVERLAY_ATTR_S stOverlay; /* attribute of overlay region */ + OVERLAYEX_ATTR_S stOverlayEx; /* attribute of overlayex region */ +} RGN_ATTR_U; + +typedef union hiRGN_CHN_ATTR_U +{ + OVERLAY_CHN_ATTR_S stOverlayChn; /* attribute of overlay region */ + COVER_CHN_ATTR_S stCoverChn; /* attribute of cover region */ + COVEREX_CHN_ATTR_S stCoverExChn; /* attribute of coverex region */ + OVERLAYEX_CHN_ATTR_S stOverlayExChn; /* attribute of overlayex region */ +} RGN_CHN_ATTR_U; + +/* attribute of a region */ +typedef struct hiRGN_ATTR_S +{ + RGN_TYPE_E enType; /* region type */ + RGN_ATTR_U unAttr; /* region attribute */ +} RGN_ATTR_S; + +/* attribute of a region */ +typedef struct hiRGN_CHN_ATTR_S +{ + HI_BOOL bShow; + RGN_TYPE_E enType; /* region type */ + RGN_CHN_ATTR_U unChnAttr; /* region attribute */ +} RGN_CHN_ATTR_S; + + + +#define RGN_MAX_BMP_UPD_NUM 16 + +typedef struct hiRGN_BMP_UPD_S +{ + POINT_S stPoint; + BITMAP_S stBmp; + HI_U32 u32Stride; +} RGN_BMP_UPD_S; + +typedef struct hiRGN_BMP_UPD_CFG_S +{ + HI_U32 u32BmpCnt; + RGN_BMP_UPD_S astBmpUpd[RGN_MAX_BMP_UPD_NUM]; +} RGN_BMP_UPD_CFG_S; + + +/* invlalid device ID */ +#define HI_ERR_RGN_INVALID_DEVID HI_DEF_ERR(HI_ID_RGN, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_DEVID) +/* invlalid channel ID */ +#define HI_ERR_RGN_INVALID_CHNID HI_DEF_ERR(HI_ID_RGN, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_CHNID) +/* at lease one parameter is illagal ,eg, an illegal enumeration value */ +#define HI_ERR_RGN_ILLEGAL_PARAM HI_DEF_ERR(HI_ID_RGN, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM) +/* channel exists */ +#define HI_ERR_RGN_EXIST HI_DEF_ERR(HI_ID_RGN, EN_ERR_LEVEL_ERROR, EN_ERR_EXIST) +/*UN exist*/ +#define HI_ERR_RGN_UNEXIST HI_DEF_ERR(HI_ID_RGN, EN_ERR_LEVEL_ERROR, EN_ERR_UNEXIST) +/* using a NULL point */ +#define HI_ERR_RGN_NULL_PTR HI_DEF_ERR(HI_ID_RGN, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR) +/* try to enable or initialize system,device or channel, before configing attribute */ +#define HI_ERR_RGN_NOT_CONFIG HI_DEF_ERR(HI_ID_RGN, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_CONFIG) +/* operation is not supported by NOW */ +#define HI_ERR_RGN_NOT_SUPPORT HI_DEF_ERR(HI_ID_RGN, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_SUPPORT) +/* operation is not permitted ,eg, try to change stati attribute */ +#define HI_ERR_RGN_NOT_PERM HI_DEF_ERR(HI_ID_RGN, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM) +/* failure caused by malloc memory */ +#define HI_ERR_RGN_NOMEM HI_DEF_ERR(HI_ID_RGN, EN_ERR_LEVEL_ERROR, EN_ERR_NOMEM) +/* failure caused by malloc buffer */ +#define HI_ERR_RGN_NOBUF HI_DEF_ERR(HI_ID_RGN, EN_ERR_LEVEL_ERROR, EN_ERR_NOBUF) +/* no data in buffer */ +#define HI_ERR_RGN_BUF_EMPTY HI_DEF_ERR(HI_ID_RGN, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_EMPTY) +/* no buffer for new data */ +#define HI_ERR_RGN_BUF_FULL HI_DEF_ERR(HI_ID_RGN, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_FULL) +/* bad address, eg. used for copy_from_user & copy_to_user */ +#define HI_ERR_RGN_BADADDR HI_DEF_ERR(HI_ID_RGN, EN_ERR_LEVEL_ERROR, EN_ERR_BADADDR) +/* resource is busy, eg. destroy a venc chn without unregistering it */ +#define HI_ERR_RGN_BUSY HI_DEF_ERR(HI_ID_RGN, EN_ERR_LEVEL_ERROR, EN_ERR_BUSY) + +/* System is not ready,maybe not initialed or loaded. + * Returning the error code when opening a device file failed. + */ +#define HI_ERR_RGN_NOTREADY HI_DEF_ERR(HI_ID_RGN, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY) + + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif /* __cplusplus */ + + +#endif /* __HI_COMM_REGION_H__ */ + + + diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_sys.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_sys.h new file mode 100644 index 0000000000..ff0ba40120 --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_sys.h @@ -0,0 +1,69 @@ +/****************************************************************************** +Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. +****************************************************************************** +File Name : hi3511_sys.h +Version : Initial Draft +Author : Hi3511 MPP Team +Created : 2007/1/30 +Last Modified : +Description : Hi3511 chip specific configure data structure +Function List : +History : + 1.Date : 2007/1/30 + Author : c42025 + Modification: Created file + + 2.Date : 2007/11/30 + Author : c42025 + Modification: modify according review comments + + 3.Date : 2008/03/03 + Author : c42025 + Modification: modify HI_TRACE_SYS + + 4.Date : 2008/03/05 + Author : c42025 + Modification: modify 'HI_LOG_LEVEL_ERROR' to 'EN_ERR_LEVEL_ERROR' + +******************************************************************************/ +#ifndef __HI_COMM_SYS_H__ +#define __HI_COMM_SYS_H__ + +#include "hi_type.h" +#include "hi_errno.h" +#include "hi_debug.h" + +#ifdef __cplusplus +#if __cplusplus +extern "C"{ +#endif +#endif /* End of #ifdef __cplusplus */ + +#define HI_TRACE_SYS(level, fmt...) HI_TRACE(level, HI_ID_SYS,##fmt) +typedef struct hiMPP_SYS_CONF_S +{ + /* stride of picture buffer must be aligned with this value. + * you can choose a value from 1 to 1024, and it must be multiple of 16. + */ + HI_U32 u32AlignWidth; + +}MPP_SYS_CONF_S; + + +#define HI_ERR_SYS_NULL_PTR HI_DEF_ERR(HI_ID_SYS, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR) +#define HI_ERR_SYS_NOTREADY HI_DEF_ERR(HI_ID_SYS, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY) +#define HI_ERR_SYS_NOT_PERM HI_DEF_ERR(HI_ID_SYS, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM) +#define HI_ERR_SYS_NOMEM HI_DEF_ERR(HI_ID_SYS, EN_ERR_LEVEL_ERROR, EN_ERR_NOMEM) +#define HI_ERR_SYS_ILLEGAL_PARAM HI_DEF_ERR(HI_ID_SYS, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM) +#define HI_ERR_SYS_BUSY HI_DEF_ERR(HI_ID_SYS, EN_ERR_LEVEL_ERROR, EN_ERR_BUSY) +#define HI_ERR_SYS_NOT_SUPPORT HI_DEF_ERR(HI_ID_SYS, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_SUPPORT) + + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif /* __cplusplus */ + +#endif /* __HI_COMM_SYS_H__ */ + diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_vb.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_vb.h new file mode 100644 index 0000000000..cb90a4a0db --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_vb.h @@ -0,0 +1,122 @@ +/****************************************************************************** +Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. +****************************************************************************** +File Name : hi_common.h +Version : Initial Draft +Author : Hi3511 MPP Team +Created : 2006/11/09 +Last Modified : +Description : The common data type defination for VB module. +Function List : +History : + 1.Date : 2006/11/03 + Author : c42025 + Modification: Created file + + 2.Date : 2007/11/30 + Author : c42025 + Modification: modify according review comments + + 3.Date : 2008/06/18 + Author : c42025 + Modification: add VB_UID_PCIV + + 4.Date : 2008/10/31 + Author : z44949 + Modification : Translate the chinese comment + + 5.Date : 2008/10/31 + Author : p00123320 + Modification : change commentary of u32MaxPoolCnt in VB_CONF_S +******************************************************************************/ +#ifndef __HI_COMM_VB_H__ +#define __HI_COMM_VB_H__ + +#include "hi_type.h" +#include "hi_errno.h" +#include "hi_debug.h" + +#ifdef __cplusplus +#if __cplusplus +extern "C"{ +#endif +#endif /* End of #ifdef __cplusplus */ + + +#define VB_MAX_POOLS 256 +#define VB_MAX_COMM_POOLS 16 + + + +/* user ID for VB */ +#define VB_MAX_USER 19 + +#define VB_UID_VIU 0 +#define VB_UID_VOU 1 +#define VB_UID_DSU 2 +#define VB_UID_VENC 3 +#define VB_UID_VDEC 4 +#define VB_UID_VDA 5 +#define VB_UID_H264E 6 +#define VB_UID_JPEGE 7 +#define VB_UID_MPEG4E 8 +#define VB_UID_H264D 9 +#define VB_UID_JPEGD 10 +#define VB_UID_MPEG4D 11 +#define VB_UID_VPSS 12 +#define VB_UID_GRP 13 +#define VB_UID_MPI 14 +#define VB_UID_PCIV 15 +#define VB_UID_AI 16 +#define VB_UID_AENC 17 +#define VB_UID_RC 18 + +#define VB_INVALID_POOLID (-1UL) +#define VB_INVALID_HANDLE (-1UL) + +typedef HI_U32 VB_POOL; +typedef HI_U32 VB_BLK; + +#define RESERVE_MMZ_NAME "window" + + +typedef struct hiVB_CONF_S +{ + HI_U32 u32MaxPoolCnt; /* max count of pools, (0,VB_MAX_POOLS] */ + struct hiVB_CPOOL_S + { + HI_U32 u32BlkSize; + HI_U32 u32BlkCnt; + HI_CHAR acMmzName[MAX_MMZ_NAME_LEN]; + }astCommPool[VB_MAX_COMM_POOLS]; +} VB_CONF_S; + + +typedef struct hiVB_POOL_STATUS_S +{ + HI_U32 bIsCommPool; + HI_U32 u32BlkCnt; + HI_U32 u32FreeBlkCnt; +}VB_POOL_STATUS_S; + +#define HI_ERR_VB_NULL_PTR HI_DEF_ERR(HI_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR) +#define HI_ERR_VB_NOMEM HI_DEF_ERR(HI_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_NOMEM) +#define HI_ERR_VB_NOBUF HI_DEF_ERR(HI_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_NOBUF) +#define HI_ERR_VB_UNEXIST HI_DEF_ERR(HI_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_UNEXIST) +#define HI_ERR_VB_ILLEGAL_PARAM HI_DEF_ERR(HI_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM) +#define HI_ERR_VB_NOTREADY HI_DEF_ERR(HI_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY) +#define HI_ERR_VB_BUSY HI_DEF_ERR(HI_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_BUSY) +#define HI_ERR_VB_NOT_PERM HI_DEF_ERR(HI_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM) + +#define HI_ERR_VB_2MPOOLS HI_DEF_ERR(HI_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_BUTT + 1) + +#define HI_TRACE_VB(level,fmt...) HI_TRACE(level, HI_ID_VB,##fmt) + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif /* __cplusplus */ + +#endif /* __HI_COMm_VB_H_ */ + diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_vda.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_vda.h new file mode 100644 index 0000000000..b9833457ec --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_vda.h @@ -0,0 +1,288 @@ +/****************************************************************************** +* +* Copyright (C), 2001-2011, Huawei Tech. Co., Ltd. +* +******************************************************************************* +* File Name : hi_comm_vda.h +* Version : Initial Draft +* Author : j00169368,l64467 +* Created : 2011/1/7 +* Last Modified : +* Description : include VDA struct , Marco and Error information +* Function List : +* +* +* History: +* +* 1. Date : 2011/1/7 +* Author : j00169368,l64467 +* Modification : Created file +* +******************************************************************************/ + +#ifndef __HI_COMM_VDA_H__ +#define __HI_COMM_VDA_H__ + +#include "hi_type.h" +#include "hi_debug.h" +#include "hi_comm_video.h" +#include "hi_common.h" +#include "hi_errno.h" +#include "hi_defines.h" + +#ifdef __cplusplus +#if __cplusplus +extern "C"{ +#endif +#endif /* End of #ifdef __cplusplus */ + + +/*Motion Region Data*/ +typedef struct hiVDA_OBJ_S +{ + HI_U16 u16Left; + HI_U16 u16Top; + HI_U16 u16Right; + HI_U16 u16Bottom; +}VDA_OBJ_S; + +/*reference pictrue mode*/ +typedef enum hiVDA_REF_MODE_E +{ + VDA_REF_MODE_DYNAMIC = 0, /*reference pictrue dynamic*/ + VDA_REF_MODE_STATIC, /*reference pictrue static*/ + VDA_REF_MODE_USER, /*reference pictrue user*/ + VDA_REF_MODE_BUTT /*reserve*/ +}VDA_REF_MODE_E; + +/*VDA algorithm*/ +typedef enum hiVDA_ALG_E +{ + VDA_ALG_BG = 0, /*base on background pictrue*/ + VDA_ALG_REF, /*base on reference pictrue*/ + VDA_ALG_BUTT +}VDA_ALG_E; + +/*MB size*/ +typedef enum hiVDA_MB_SIZE_E +{ + VDA_MB_8PIXEL, /* 8*8 */ + VDA_MB_16PIXEL, /* 16*16 */ + VDA_MB_BUTT +}VDA_MB_SIZE_E; + +/*SAD bits*/ +typedef enum hiVDA_MB_SADBITS_E +{ + VDA_MB_SAD_8BIT = 0, /*SAD precision 8bits*/ + VDA_MB_SAD_16BIT, /*SAD precision 16bits*/ + VDA_MB_SAD_BUTT /*reserve*/ +} VDA_MB_SADBITS_E; + + +/*OD region attribute*/ +typedef struct hiVDA_OD_RGN_ATTR_S +{ + /*static attribute*/ + RECT_S stRect; /*region rect + *X:[0,VDA_MAX_WIDTH),align:16 + *Y:[0,VDA_MAX_HEIGHT) + *W:[16,VDA_MAX_WIDTH],align:16 + *H:[16,VDA_MAX_HEIGHT],align:16 + *X+W <= chunnel wight + *Y+H <= chunnel height + */ + + /*dynamic attribute*/ + HI_U32 u32SadTh; /*SAD threshold,range:[0,4080]*/ + HI_U32 u32AreaTh; /*alarm area threshold,range:[0,100]*/ + HI_U32 u32OccCntTh; /*alarm frame count threshold,range:[1,256]*/ + HI_U32 u32UnOccCntTh; /*The max uncover count,range:[0,256]*/ +}VDA_OD_RGN_ATTR_S; + +/*MD attribute*/ +typedef struct hiVDA_MD_ATTR_S +{ + /*static attribute*/ + VDA_ALG_E enVdaAlg; /*arithmetic*/ + VDA_MB_SIZE_E enMbSize; /*MB size*/ + VDA_MB_SADBITS_E enMbSadBits; /*MB SAD size*/ + VDA_REF_MODE_E enRefMode; /*reference picture mode*/ + HI_U32 u32MdBufNum; /*Result buffer number,range:[1,16]*/ + + /*dynamic attribute*/ + HI_U32 u32VdaIntvl; /*VDA interval,range:[0,256]*/ + + HI_U32 u32BgUpSrcWgt; /*the source picture weight, + *back ground updata totle weight 256, + *range:[1,255],recommendatory value:128 + */ + + HI_U32 u32SadTh; /*SAD threshold,range:[0,4080],recommendatory value:100*/ + HI_U32 u32ObjNumMax; /*max OBJ number,range:[1,128]*/ +}VDA_MD_ATTR_S; + + +#define VDA_OD_RGN_NUM_MAX 4 + +/*OD attribute*/ +typedef struct hiVDA_OD_ATTR_S +{ + HI_U32 u32RgnNum; /*region number*/ + VDA_OD_RGN_ATTR_S astOdRgnAttr[VDA_OD_RGN_NUM_MAX]; /*region attribute*/ + + /*static attribute*/ + VDA_ALG_E enVdaAlg; /*arithmetic*/ + VDA_MB_SIZE_E enMbSize; /*MB size*/ + VDA_MB_SADBITS_E enMbSadBits; /*MB SAD size*/ + VDA_REF_MODE_E enRefMode; /*reference picture mode*/ + + /*dynamic attribute*/ + HI_U32 u32VdaIntvl; /*VDA interval,[0,256]*/ + HI_U32 u32BgUpSrcWgt; /*back ground updata totle weight 256,the source picture weight,[1,255]*/ + + +}VDA_OD_ATTR_S; + + +/*work mode*/ +typedef enum hiVDA_WORK_MODE_E +{ + VDA_WORK_MODE_MD = 0, /*motion detection*/ + VDA_WORK_MODE_OD, /*Occlusion detection*/ + VDA_WORK_MODE_BUTT +}VDA_WORK_MODE_E; + + +/*work mode attribute*/ +typedef union hiVDA_WORK_MODE_ATTR_U +{ + VDA_MD_ATTR_S stMdAttr; /*MD attribute*/ + VDA_OD_ATTR_S stOdAttr; /*OD attribute*/ +}VDA_WORK_MODE_ATTR_U; + + +/*VDA CHN attribute*/ +typedef struct hiVDA_CHN_ATTR_S +{ + VDA_WORK_MODE_E enWorkMode; /*work mode*/ + VDA_WORK_MODE_ATTR_U unAttr; /*work mode attribute*/ + HI_U32 u32Width; /*the width of CHNL,[16,VDA_MAX_WIDTH]*/ + HI_U32 u32Height; /*the height of CHNL,[16,VDA_MAX_HEIGHT]*/ +}VDA_CHN_ATTR_S; + + +/*MB SAD data*/ +typedef struct hiVDA_MB_SAD_DATA_S +{ + HI_VOID *pAddr; /*address*/ + HI_U32 u32Stride; /*stride*/ + VDA_MB_SADBITS_E enMbSadBits; /*the MB SAD size*/ +}VDA_MB_SAD_DATA_S; + +/*OBJ data*/ +typedef struct hiVDA_OBJ_DATA_S +{ + HI_U32 u32ObjNum; /*OBJ number*/ + VDA_OBJ_S *pstAddr; /*OBJ data address*/ + + HI_U32 u32IndexOfMaxObj; /*index of max OBJ*/ + HI_U32 u32SizeOfMaxObj; /*size of max OBJ*/ + HI_U32 u32SizeOfTotalObj; /*total size of all OBJ*/ +}VDA_OBJ_DATA_S; + + +/*MD data*/ +typedef struct hiVDA_MD_DATA_S +{ + HI_BOOL bMbSadValid; /*SAD data is valid?*/ + VDA_MB_SAD_DATA_S stMbSadData; /*MB SAD data*/ + + HI_BOOL bObjValid; /*OBJ data is valid?*/ + VDA_OBJ_DATA_S stObjData; /*OBJ data*/ + + HI_BOOL bPelsNumValid; /*alarm pixel number data is valid?*/ + HI_U32 u32AlarmPixCnt;/*motion pix of picture*/ +}VDA_MD_DATA_S; + + +/*OD data*/ +typedef struct hiVDA_OD_DATA_S +{ + HI_U32 u32RgnNum; /*region number*/ + HI_BOOL abRgnAlarm[VDA_OD_RGN_NUM_MAX]; /*HI_TRUE:alarm*/ +}VDA_OD_DATA_S; + + + +typedef union hiVDA_DATA_U +{ + VDA_MD_DATA_S stMdData; /*MD data*/ + VDA_OD_DATA_S stOdData; /*OD data*/ +}VDA_DATA_U; + + +/*VDA data*/ +typedef struct hiVDA_DATA_S +{ + VDA_WORK_MODE_E enWorkMode; /*work mode*/ + VDA_DATA_U unData; /*VDA data*/ + VDA_MB_SIZE_E enMbSize; /*MB size*/ + HI_U32 u32MbWidth; /*VDA channle width in MB*/ + HI_U32 u32MbHeight; /*VDA channle height in MB*/ + HI_U64 u64Pts; /*time*/ +}VDA_DATA_S; + + +/*chnnel state*/ +typedef struct hiVDA_CHN_STAT_S +{ + HI_BOOL bStartRecvPic; /*start receive picture*/ + HI_U32 u32LeftPic; /*left picture*/ + HI_U32 u32LeftRst; /*left data*/ +}VDA_CHN_STAT_S; + +/* invlalid device ID */ +#define HI_ERR_VDA_INVALID_DEVID HI_DEF_ERR(HI_ID_VDA, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_DEVID) +/* invlalid channel ID */ +#define HI_ERR_VDA_INVALID_CHNID HI_DEF_ERR(HI_ID_VDA, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_CHNID) +/* at lease one parameter is illagal ,eg, an illegal enumeration value */ +#define HI_ERR_VDA_ILLEGAL_PARAM HI_DEF_ERR(HI_ID_VDA, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM) +/* channel exists */ +#define HI_ERR_VDA_EXIST HI_DEF_ERR(HI_ID_VDA, EN_ERR_LEVEL_ERROR, EN_ERR_EXIST) +/*UN exist*/ +#define HI_ERR_VDA_UNEXIST HI_DEF_ERR(HI_ID_VDA, EN_ERR_LEVEL_ERROR, EN_ERR_UNEXIST) +/* using a NULL point */ +#define HI_ERR_VDA_NULL_PTR HI_DEF_ERR(HI_ID_VDA, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR) +/* try to enable or initialize system,device or channel, before configing attribute */ +#define HI_ERR_VDA_NOT_CONFIG HI_DEF_ERR(HI_ID_VDA, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_CONFIG) +/* operation is not supported by NOW */ +#define HI_ERR_VDA_NOT_SUPPORT HI_DEF_ERR(HI_ID_VDA, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_SUPPORT) +/* operation is not permitted ,eg, try to change stati attribute */ +#define HI_ERR_VDA_NOT_PERM HI_DEF_ERR(HI_ID_VDA, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM) +/* failure caused by malloc memory */ +#define HI_ERR_VDA_NOMEM HI_DEF_ERR(HI_ID_VDA, EN_ERR_LEVEL_ERROR, EN_ERR_NOMEM) +/* failure caused by malloc buffer */ +#define HI_ERR_VDA_NOBUF HI_DEF_ERR(HI_ID_VDA, EN_ERR_LEVEL_ERROR, EN_ERR_NOBUF) +/* no data in buffer */ +#define HI_ERR_VDA_BUF_EMPTY HI_DEF_ERR(HI_ID_VDA, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_EMPTY) +/* no buffer for new data */ +#define HI_ERR_VDA_BUF_FULL HI_DEF_ERR(HI_ID_VDA, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_FULL) +/* bad address, eg. used for copy_from_user & copy_to_user */ +#define HI_ERR_VDA_BADADDR HI_DEF_ERR(HI_ID_VDA, EN_ERR_LEVEL_ERROR, EN_ERR_BADADDR) +/* resource is busy, eg. destroy a venc chn without unregistering it */ +#define HI_ERR_VDA_BUSY HI_DEF_ERR(HI_ID_VDA, EN_ERR_LEVEL_ERROR, EN_ERR_BUSY) + +/* System is not ready,maybe not initialed or loaded. + * Returning the error code when opening a device file failed. + */ +#define HI_ERR_VDA_NOTREADY HI_DEF_ERR(HI_ID_VDA, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY) + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif /* End of #ifdef __cplusplus */ + + +#endif /* End of #ifndef __HI_COMM_VDA_H__ */ diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_vdec.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_vdec.h new file mode 100644 index 0000000000..9b0f96dd61 --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_vdec.h @@ -0,0 +1,287 @@ +/****************************************************************************** + + Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. + + ****************************************************************************** + File Name : hi_comm_vdec.h + Version : Initial Draft + Author : Hisilicon multimedia software group + Created : 2006/12/15 + Description : Common Def Of aio + History : + 1.Date : 2006/12/15 + Author : z50825 + Modification: Created file + 2.Date : 2007/5/10 + Author : z50825 + Modification: add err code + 3.Date : 2008/1/8 + Author : l59217 + Modification: add "hi_comm_video.h" and "buf reserved length 64byte"macro + 4.Date : 2008/3/4 + Author : l59217 + Modification: (1)add VDEC_CAPABILITY_S for user learn decoder capabilitys + (2)define max nalu size 0x80000 for h264 + define max ecs size 0x100000 for jpeg, mjpeg + 5.Date : 2008/3/6 + Author : l59217 + Modification: change "HI_LOG_LEVEL_ERROR" to "EN_ERR_LEVEL_ERROR" + 6.Date : 2008/3/7 + Author : l59217 + Modification: added "HI_ERR_VDEC_BUSY" errno + 7.Date : 2009/10/12 + Author : c55300 + Modification: VDEC_CHN_STAT_S add two var. +******************************************************************************/ + + +#ifndef __HI_COMM_VDEC_H__ +#define __HI_COMM_VDEC_H__ +#include "hi_type.h" +#include "hi_common.h" +#include "hi_errno.h" +#include "hi_comm_video.h" +#include "hi_defines.h" + +#ifdef __cplusplus +#if __cplusplus +extern "C"{ +#endif +#endif /* End of #ifdef __cplusplus */ + +/*vdec channel attr(user interface)*/ + +#define HI_IO_BLOCK HI_TRUE +#define HI_IO_NOBLOCK HI_FALSE + +typedef enum hiVIDEO_MODE_E +{ + VIDEO_MODE_STREAM = 0, /*send by stream*/ + VIDEO_MODE_FRAME , /*send by frame*/ + VIDEO_MODE_BUTT +}VIDEO_MODE_E; + + +typedef struct hiVDEC_ATTR_JPEG_S +{ + VIDEO_MODE_E enMode; /* video stream mode select */ +}VDEC_ATTR_JPEG_S,*PTR_VDEC_ATTR_JPEG_S; + + +typedef struct hiVDEC_ATTR_VIDEO_S +{ + HI_U32 u32RefFrameNum; /*ref pic num [1,16]*/ + VIDEO_MODE_E enMode; /*send by stream or by frame*/ + HI_S32 s32SupportBFrame; /*enable chnl to support BFrame decode, 0: disable support BFrame decode,1: enable support BFrame*/ +}VDEC_ATTR_VIDEO_S,*PTR_VDEC_ATTR_VIDEO_S; + + +typedef union +{ + struct + { + HI_S32 IsAdvProfile; + HI_S32 CodecVersion; + } Vc1Ext; + + struct + { + HI_S32 bReversed; /*whether image need to reversed, 1: need resversed,0: none */ + } Vp6Ext; +} VDEC_STD_EXTENSION_U; + + +typedef struct hiVDEC_CHN_ATTR_S +{ + PAYLOAD_TYPE_E enType; /*video type to be decoded*/ + HI_U32 u32BufSize; /*stream buf size(Byte)*/ + HI_U32 u32Priority; /*priority*/ + HI_U32 u32PicWidth; /*max pic width*/ + HI_U32 u32PicHeight; /*max pic height*/ + union + { + VDEC_ATTR_JPEG_S stVdecJpegAttr; /* structure with jpeg or mjpeg type */ + VDEC_ATTR_VIDEO_S stVdecVideoAttr; /* structure with video ( h264/mpeg4/mpeg2/...) */ + }; +}VDEC_CHN_ATTR_S; + + +typedef struct hiVDEC_STREAM_S +{ + HI_U8* pu8Addr; /*stream address*/ + HI_U32 u32Len; /*stream len*/ + HI_U64 u64PTS; /*time stamp*/ +}VDEC_STREAM_S,*PTR_VDEC_STREAM_S; + +typedef struct hiVDEC_USERDATA_S{ + HI_U8* pu8Addr; /* userdata data vir address*/ + HI_U32 u32PhyAddr; /* userdata data phy address */ + HI_U32 u32Len; /* userdata data len*/ + HI_BOOL bValid; /* is valid?*/ +}VDEC_USERDATA_S, *PTR_VDEC_USERDATA_S; + + +typedef struct hi_VDEC_DECODE_ERROR_S +{ + HI_S32 s32FormatErr; /* format error. eg: do not support filed */ + HI_S32 s32PicSizeErrSet; /* picture width or height is larger than chnnel width or height*/ + HI_S32 s32StreamUnsprt; /* unsupport the stream specification */ + HI_S32 s32PackErr; /* stream package error */ + HI_S32 s32PrtclNumErrSet; /* protocol num is not enough. eg: slice, pps, sps */ + HI_S32 s32RefErrSet; /* refrence num is not enough */ + HI_S32 s32PicBufSizeErrSet; /* the buffer size of picture is not enough */ + +}VDEC_DECODE_ERROR_S; + + +typedef struct hiVDEC_CHN_STAT_S +{ + PAYLOAD_TYPE_E enType; /*video type to be decoded*/ + HI_U32 u32LeftStreamBytes;/*left stream bytes waiting for decode*/ + HI_U32 u32LeftStreamFrames;/*left frames waiting for decode,only valid for H264D_MODE_FRAME*/ + HI_U32 u32LeftPics;/*pics waiting for output*/ + HI_BOOL bStartRecvStream;/*had started recv stream?*/ + HI_U32 u32RecvStreamFrames; /* how many frames of stream has been received. valid when send by frame.*/ + HI_U32 u32DecodeStreamFrames; /* how many frames of stream has been decoded. valid when send by frame.*/ + VDEC_DECODE_ERROR_S stVdecDecErr; /* information about decode error */ +}VDEC_CHN_STAT_S; + +/* + * static parameter: must set after stop sending stream and all stream is decoded. + * dynamic parameter: can be set at any time. + */ +typedef struct hiVDEC_CHN_PARAM_S +{ +// HI_U32 u32FrameSizeMax; /* static parameter. +// * range: [bufSize/2, bufSize*3/4] */ + VDEC_STD_EXTENSION_U StdExt; /*extend info for VC1 video stream, with ap and version info */ + HI_S32 s32ChanErrThr; /* threshold for stream error process, 0: discard with any error, 100 : keep data with any error*/ + HI_S32 s32ChanStrmOFThr; /* threshold for stream overflow, 0~ , 0: nothing to do when stream is overflow */ + HI_S32 s32DecMode; /*decode mode , 0: deocde IPB frames, 1: only decode I frame & P frame , 2: only decode I frame */ + HI_S32 s32DecOrderOutput; /*frames output order ,0: the same with display order , 1: the same width decoder order */ + HI_S32 s32DnrTfEnable; /* reserved */ + HI_S32 s32DnrDispOutEnable; /* reserved */ +}VDEC_CHN_PARAM_S; + +typedef struct hiVDEC_PRTCL_PARAM_S +{ + HI_S32 s32MaxSliceNum; /*max slice num support */ + HI_S32 s32MaxSpsNum; /* max sps num support */ + HI_S32 s32MaxPpsNum; /* max pps num support */ + HI_S32 s32SCDBufSize; /* scd buffer size */ + HI_S32 s32DisplayFrameNum; /*display frame num */ +}VDEC_PRTCL_PARAM_S; + + +typedef enum hiVDEC_EVNT_E +{ + VDEC_EVNT_STREAM_ERR = 1, + VDEC_EVNT_UNSUPPORT, + VDEC_EVNT_OVER_REFTHR, + VDEC_EVNT_REF_NUM_OVER, + VDEC_EVNT_SLICE_NUM_OVER, + VDEC_EVNT_SPS_NUM_OVER, + VDEC_EVNT_PPS_NUM_OVER, + VDEC_EVNT_PICBUF_SIZE_ERR, + VDEC_EVNT_SIZE_OVER, + VDEC_EVNT_IMG_SIZE_CHANGE, + VDEC_EVNT_BUTT +} VDEC_EVNT_E; + + +//structure & varibale for jpegd decoder lib +/*********************************************************************************************************/ +/* stream packet for jpeg */ +typedef struct hiJPEGD_STREAM_PACKET_S +{ + HI_U32 PhyAddr; + HI_VOID* VirAddr; + HI_U32 Length; + HI_U64 Pts; + HI_U32 Index; + +} USR_STREAM_PACKET_S; + +/* description structure for memory record */ +typedef struct hiUSR_MEM_DESC_S +{ + HI_S32 PhyAddr; + HI_S32 Length; +} USR_MEM_DESC_S; + +typedef enum hiVDEC_JPG_COLOR_FMT_E +{ + JPG_COLOR_FMT_YCBCR400 = 0, /*YUV400*/ + JPG_COLOR_FMT_YCBCR420 = 1, /*YUV420*/ + JPG_COLOR_FMT_YCBCR422BHP, /*YUV 422 2x1*/ + JPG_COLOR_FMT_YCBCR422BVP, /*YUV 422 1x2*/ + JPG_COLOR_FMT_YCBCR444, /*YUV 444*/ + JPG_COLOR_FMT_BUTT +} VDEC_JPG_COLOR_FMT_E; + +typedef enum hiJPEGD_DECODE_ERROR_E +{ + JPEGD_ERR_NONE = 0, + JPEGD_ERR_STREAM, + JPEGD_ERR_PIC_SIZE, + JPEGD_ERR_PICBUF_SIZE, + JPEGD_ERR_FORMAT, + VIDEO_ERR_BULL +}JPEGD_DECODE_ERROR_E; + + +typedef struct hiVDEC_SKIPREF_PARAM_S +{ + HI_BOOL bEnableGap; +} VDEC_SKIPREF_PARAM_S; + +/************************************************************************************************************************/ + +/* invlalid device ID */ +#define HI_ERR_VDEC_INVALID_DEVID HI_DEF_ERR(HI_ID_VDEC, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_DEVID) +/* invlalid channel ID */ +#define HI_ERR_VDEC_INVALID_CHNID HI_DEF_ERR(HI_ID_VDEC, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_CHNID) +/* at lease one parameter is illagal ,eg, an illegal enumeration value */ +#define HI_ERR_VDEC_ILLEGAL_PARAM HI_DEF_ERR(HI_ID_VDEC, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM) +/* channel exists */ +#define HI_ERR_VDEC_EXIST HI_DEF_ERR(HI_ID_VDEC, EN_ERR_LEVEL_ERROR, EN_ERR_EXIST) +/* using a NULL point */ +#define HI_ERR_VDEC_NULL_PTR HI_DEF_ERR(HI_ID_VDEC, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR) +/* try to enable or initialize system,device or channel, before configing attribute */ +#define HI_ERR_VDEC_NOT_CONFIG HI_DEF_ERR(HI_ID_VDEC, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_CONFIG) +/* operation is not supported by NOW */ +#define HI_ERR_VDEC_NOT_SURPPORT HI_DEF_ERR(HI_ID_VDEC, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_SUPPORT) +/* operation is not permitted ,eg, try to change stati attribute */ +#define HI_ERR_VDEC_NOT_PERM HI_DEF_ERR(HI_ID_VDEC, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM) +/* the channle is not existed */ +#define HI_ERR_VDEC_UNEXIST HI_DEF_ERR(HI_ID_VDEC, EN_ERR_LEVEL_ERROR, EN_ERR_UNEXIST) +/* failure caused by malloc memory */ +#define HI_ERR_VDEC_NOMEM HI_DEF_ERR(HI_ID_VDEC, EN_ERR_LEVEL_ERROR, EN_ERR_NOMEM) +/* failure caused by malloc buffer */ +#define HI_ERR_VDEC_NOBUF HI_DEF_ERR(HI_ID_VDEC, EN_ERR_LEVEL_ERROR, EN_ERR_NOBUF) +/* no data in buffer */ +#define HI_ERR_VDEC_BUF_EMPTY HI_DEF_ERR(HI_ID_VDEC, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_EMPTY) +/* no buffer for new data */ +#define HI_ERR_VDEC_BUF_FULL HI_DEF_ERR(HI_ID_VDEC, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_FULL) +/* system is not ready,had not initialed or loaded*/ +#define HI_ERR_VDEC_SYS_NOTREADY HI_DEF_ERR(HI_ID_VDEC, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY) +/*system busy*/ +#define HI_ERR_VDEC_BUSY HI_DEF_ERR(HI_ID_VDEC, EN_ERR_LEVEL_ERROR, EN_ERR_BUSY) + +/* bad address, eg. used for copy_from_user & copy_to_user */ +#define HI_ERR_VDEC_BADADDR HI_DEF_ERR(HI_ID_VDEC, EN_ERR_LEVEL_ERROR, EN_ERR_BADADDR) + + + + + + + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif /* End of #ifdef __cplusplus */ + +#endif /* End of #ifndef __HI_COMM_VDEC_H__ */ + diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_venc.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_venc.h new file mode 100644 index 0000000000..8acc56aaf4 --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_venc.h @@ -0,0 +1,570 @@ +/****************************************************************************** + + Copyright (C), 2001-2012, Hisilicon Tech. Co., Ltd. + + ****************************************************************************** + File Name : hi_comm_venc.h + Version : + Author : Hisilicon Hi35xx MPP Team + Created : 2006/11/24 + Last Modified : + Description : common struct definition for VENC + Function List : + History : +******************************************************************************/ +#ifndef __HI_COMM_VENC_H__ +#define __HI_COMM_VENC_H__ + +#ifdef __cplusplus +#if __cplusplus +extern "C"{ +#endif +#endif /* __cplusplus */ + +#include "hi_type.h" +#include "hi_common.h" +#include "hi_errno.h" +#include "hi_comm_video.h" +#include "hi_comm_rc.h" + +/* invlalid device ID */ +#define HI_ERR_VENC_INVALID_DEVID HI_DEF_ERR(HI_ID_VENC, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_DEVID) +/* invlalid channel ID */ +#define HI_ERR_VENC_INVALID_CHNID HI_DEF_ERR(HI_ID_VENC, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_CHNID) +/* at lease one parameter is illagal ,eg, an illegal enumeration value */ +#define HI_ERR_VENC_ILLEGAL_PARAM HI_DEF_ERR(HI_ID_VENC, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM) +/* channel exists */ +#define HI_ERR_VENC_EXIST HI_DEF_ERR(HI_ID_VENC, EN_ERR_LEVEL_ERROR, EN_ERR_EXIST) +/* channel exists */ +#define HI_ERR_VENC_UNEXIST HI_DEF_ERR(HI_ID_VENC, EN_ERR_LEVEL_ERROR, EN_ERR_UNEXIST) +/* using a NULL point */ +#define HI_ERR_VENC_NULL_PTR HI_DEF_ERR(HI_ID_VENC, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR) +/* try to enable or initialize system,device or channel, before configing attribute */ +#define HI_ERR_VENC_NOT_CONFIG HI_DEF_ERR(HI_ID_VENC, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_CONFIG) +/* operation is not supported by NOW */ +#define HI_ERR_VENC_NOT_SUPPORT HI_DEF_ERR(HI_ID_VENC, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_SUPPORT) +/* operation is not permitted ,eg, try to change stati attribute */ +#define HI_ERR_VENC_NOT_PERM HI_DEF_ERR(HI_ID_VENC, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM) +/* failure caused by malloc memory */ +#define HI_ERR_VENC_NOMEM HI_DEF_ERR(HI_ID_VENC, EN_ERR_LEVEL_ERROR, EN_ERR_NOMEM) +/* failure caused by malloc buffer */ +#define HI_ERR_VENC_NOBUF HI_DEF_ERR(HI_ID_VENC, EN_ERR_LEVEL_ERROR, EN_ERR_NOBUF) +/* no data in buffer */ +#define HI_ERR_VENC_BUF_EMPTY HI_DEF_ERR(HI_ID_VENC, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_EMPTY) +/* no buffer for new data */ +#define HI_ERR_VENC_BUF_FULL HI_DEF_ERR(HI_ID_VENC, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_FULL) +/* system is not ready,had not initialed or loaded*/ +#define HI_ERR_VENC_SYS_NOTREADY HI_DEF_ERR(HI_ID_VENC, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY) +/* system is busy*/ +#define HI_ERR_VENC_BUSY HI_DEF_ERR(HI_ID_VENC, EN_ERR_LEVEL_ERROR, EN_ERR_BUSY) + +/*main stream*/ +#define TYPE_MAIN_STREAM (1) + +/*minor stream*/ +#define TYPE_MINOR_STREAM (0) + +/*the nalu type of H264E*/ +typedef enum hiH264E_NALU_TYPE_E +{ + H264E_NALU_PSLICE = 1, /*PSLICE types*/ + H264E_NALU_ISLICE = 5, /*ISLICE types*/ + H264E_NALU_SEI = 6, /*SEI types*/ + H264E_NALU_SPS = 7, /*SPS types*/ + H264E_NALU_PPS = 8, /*PPS types*/ + H264E_NALU_BUTT +} H264E_NALU_TYPE_E; + +/*the reference type of H264E slice*/ +typedef enum hiH264E_REFSLICE_TYPE_E +{ + H264E_REFSLICE_FOR_1X = 1, /*Reference slice for H264E_REF_MODE_1X*/ + H264E_REFSLICE_FOR_2X = 2, /*Reference slice for H264E_REF_MODE_2X*/ + H264E_REFSLICE_FOR_4X = 5, /*Reference slice for H264E_REF_MODE_4X*/ + H264E_REFSLICE_FOR_BUTT /* slice not for reference*/ +} H264E_REFSLICE_TYPE_E; + +/*the pack type of JPEGE*/ +typedef enum hiJPEGE_PACK_TYPE_E +{ + JPEGE_PACK_ECS = 5, /*ECS types*/ + JPEGE_PACK_APP = 6, /*APP types*/ + JPEGE_PACK_VDO = 7, /*VDO types*/ + JPEGE_PACK_PIC = 8, /*PIC types*/ + JPEGE_PACK_BUTT +} JPEGE_PACK_TYPE_E; + +/*the pack type of MPEG4*/ +typedef enum hiMPEG4E_PACK_TYPE_E +{ + MPEG4E_PACK_VOP_P = 1, /*P VOP packet types*/ + MPEG4E_PACK_VOP_I = 5, /*I VOP packet types*/ + MPEG4E_PACK_VOS = 6, /*VOS types*/ + MPEG4E_PACK_VO = 7, /*VO types*/ + MPEG4E_PACK_VOL = 8, /*VOL types*/ + MPEG4E_PACK_GVOP = 9 /*GROUP of vop types */ +} MPEG4E_PACK_TYPE_E; + +/*the data type of VENC*/ +typedef union hiVENC_DATA_TYPE_U +{ + H264E_NALU_TYPE_E enH264EType; /*H264E NALU types*/ + JPEGE_PACK_TYPE_E enJPEGEType; /*JPEGE pack types*/ + MPEG4E_PACK_TYPE_E enMPEG4EType;/*MPEG4E pack types*/ +}VENC_DATA_TYPE_U; + +typedef struct hiVENC_PACK_S +{ + HI_U32 u32PhyAddr[2]; /*the physics address of stream*/ + HI_U8 *pu8Addr[2]; /*the virtual address of stream*/ + HI_U32 u32Len[2]; /*the length of stream*/ + + HI_U64 u64PTS; /*PTS*/ + HI_BOOL bFieldEnd; /*field end£¿*/ + HI_BOOL bFrameEnd; /*frame end£¿*/ + + VENC_DATA_TYPE_U DataType; /*the type of stream*/ + HI_U32 u32Offset; +}VENC_PACK_S; + +typedef enum hiH264E_REF_TYPE_E +{ + BASE_IDRSLICE = 0, //base²ãÖеÄIDRÖ¡ + BASE_PSLICE_REFBYBASE, //base²ãÖеÄPÖ¡£¬ÓÃÓÚbase²ãÖÐÆäËûÖ¡µÄ²Î¿¼ + BASE_PSLICE_REFBYENHANCE, //base²ãÖеÄPÖ¡£¬ÓÃÓÚenhance²ãÖеÄÖ¡µÄ²Î¿¼ + ENHANCE_PSLICE_REFBYENHANCE, //enhance²ãÖеÄPÖ¡£¬ÓÃÓÚenhance²ãÖÐÆäËûÖ¡µÄ²Î¿¼ + ENHANCE_PSLICE_NOTFORREF, //enhance²ãÖеÄPÖ¡£¬²»ÓÃÓڲο¼ + ENHANCE_PSLICE_BUTT +} H264E_REF_TYPE_E; + +typedef struct hiVENC_STREAM_INFO_H264_S +{ + HI_U32 u32PicBytesNum; /* the coded picture stream byte number */ + HI_U32 u32PSkipMbNum; /* the skip macroblock num */ + HI_U32 u32IpcmMbNum; /* the ipcm macroblock num */ + HI_U32 u32Inter16x8MbNum; /* the inter16x8 macroblock num */ + HI_U32 u32Inter16x16MbNum; /* the inter16x16 macroblock num */ + HI_U32 u32Inter8x16MbNum; /* the inter8x16 macroblock num */ + HI_U32 u32Inter8x8MbNum; /* the inter8x8 macroblock num */ + HI_U32 u32Intra16MbNum; /* the intra16x16 macroblock num */ + HI_U32 u32Intra8MbNum; /* the intra8x8 macroblock num */ + HI_U32 u32Intra4MbNum; /* the inter4x4 macroblock num */ + + H264E_REFSLICE_TYPE_E enRefSliceType; /*the reference type of H264E slice*/ + H264E_REF_TYPE_E enRefType; + HI_U32 u32UpdateAttrCnt; +}VENC_STREAM_INFO_H264_S; + +typedef struct hiVENC_STREAM_INFO_JPEG_S +{ + HI_U32 u32PicBytesNum; /* the coded picture stream byte number */ + HI_U32 u32UpdateAttrCnt; + HI_U32 u32Qfactor; +}VENC_STREAM_INFO_JPEG_S; + +typedef struct hiVENC_STREAM_INFO_MPEG4_S +{ + HI_U32 u32PicBytesNum; /* the coded picture stream byte number */ + HI_U32 u32UpdateAttrCnt; +}VENC_STREAM_INFO_MPEG4_S; + +typedef struct hiVENC_STREAM_S +{ + VENC_PACK_S *pstPack; /*stream pack attribute*/ + HI_U32 u32PackCount; /*the pack number of one frame stream*/ + HI_U32 u32Seq; /*the list number of stream*/ + + union + { + VENC_STREAM_INFO_H264_S stH264Info; /*the stream info of h264*/ + VENC_STREAM_INFO_JPEG_S stJpegInfo; /*the stream info of jpeg*/ + VENC_STREAM_INFO_MPEG4_S stMpeg4Info; /*the stream info of mpeg4*/ + }; +}VENC_STREAM_S; + +typedef struct hiVENC_ATTR_H264_S +{ + HI_U32 u32MaxPicWidth; /*maximum width of a picture to be encoded, in pixel*/ + HI_U32 u32MaxPicHeight; /*maximum height of a picture to be encoded, in pixel*/ + + HI_U32 u32BufSize; /*stream buffer size*/ + HI_U32 u32Profile; /*0: baseline; 1:MP; 2:HP; 3: SVC-T [0,3]; */ + HI_BOOL bByFrame; /*get stream mode is slice mode or frame mode*/ + + HI_S32 bField; /* surpport frame code only for hi3516, bfield = HI_FALSE */ + HI_S32 bMainStream; /* surpport main stream only for hi3516, bMainStream = HI_TRUE */ + HI_U32 u32Priority; /*channels precedence level. invalidate for hi3516*/ + HI_BOOL bVIField; /*the sign of the VI picture is field or frame. Invalidate for hi3531*/ + + HI_U32 u32PicWidth; /*width of a picture to be encoded, in pixel*/ + HI_U32 u32PicHeight; /*height of a picture to be encoded, in pixel*/ +}VENC_ATTR_H264_S; + +typedef struct hiVENC_ATTR_MJPEG_S +{ + HI_U32 u32MaxPicWidth; /*maximum width of a picture to be encoded, in pixel*/ + HI_U32 u32MaxPicHeight; /*maximum height of a picture to be encoded, in pixel*/ + HI_U32 u32BufSize; /*stream buffer size*/ + HI_BOOL bByFrame; /*get stream mode is field mode or frame mode*/ + + HI_BOOL bMainStream; /*main stream or minor stream types?*/ + HI_BOOL bVIField; /*the sign of the VI picture is field or frame*/ + HI_U32 u32Priority; /*channels precedence level*/ + + HI_U32 u32PicWidth; /*width of a picture to be encoded, in pixel*/ + HI_U32 u32PicHeight; /*height of a picture to be encoded, in pixel*/ + +}VENC_ATTR_MJPEG_S; + +typedef struct hiVENC_ATTR_JPEG_S +{ + HI_U32 u32MaxPicWidth; /*maximum width of a picture to be encoded, in pixel*/ + HI_U32 u32MaxPicHeight; /*maximum height of a picture to be encoded, in pixel*/ + HI_U32 u32BufSize; /*stream buffer size*/ + HI_BOOL bByFrame; /*get stream mode is field mode or frame mode*/ + + HI_BOOL bVIField; /*the sign of the VI picture is field or frame*/ + HI_U32 u32Priority; /*channels precedence level*/ + + HI_U32 u32PicWidth; /*width of a picture to be encoded, in pixel*/ + HI_U32 u32PicHeight; /*height of a picture to be encoded, in pixel*/ + +}VENC_ATTR_JPEG_S; + +/* attribute of MPEG4*/ +typedef struct hiVENC_ATTR_MPEG4_S +{ + HI_U32 u32MaxPicWidth; /*maximum width of a picture to be encoded, in pixel*/ + HI_U32 u32MaxPicHeight; /*maximum height of a picture to be encoded, in pixel*/ + + HI_U32 u32BufSize; /*buffer size*/ + HI_BOOL bByFrame; /*get stream mode is pack or frame*/ + + HI_S32 bField; /* surpport frame code only for hi3516, bfield = HI_FALSE */ + HI_S32 bMainStream; /* surpport main stream only for hi3516, bMainStream = HI_TRUE */ + HI_BOOL bVIField; /*the sign of the VI picture is field or frame*/ + HI_U32 u32Priority; /*channels precedence level*/ + + HI_U32 u32PicWidth; /*width of a picture to be encoded, in pixel*/ + HI_U32 u32PicHeight; /*height of a picture to be encoded, in pixel*/ +}VENC_ATTR_MPEG4_S; + +typedef struct hiVENC_ATTR_S +{ + PAYLOAD_TYPE_E enType; /*the type of payload*/ + union + { + VENC_ATTR_H264_S stAttrH264e; /*attributes of h264*/ + VENC_ATTR_MJPEG_S stAttrMjpeg; /*attributes of mjpeg*/ + VENC_ATTR_JPEG_S stAttrJpeg; /*attributes of jpeg*/ + VENC_ATTR_MPEG4_S stAttrMpeg4; /*attributes of mpeg4*/ + }; +}VENC_ATTR_S; + +typedef struct hiVENC_CHN_ATTR_S +{ + VENC_ATTR_S stVeAttr; /*the attribute of video encoder*/ + VENC_RC_ATTR_S stRcAttr; /*the attribute of rate ctrl*/ +}VENC_CHN_ATTR_S; + +typedef struct hiVENC_CHN_STAT_S +{ + HI_BOOL bRegistered; /*registered ?*/ + HI_U32 u32LeftPics; /*left picture number */ + HI_U32 u32LeftStreamBytes; /*left stream bytes*/ + HI_U32 u32LeftStreamFrames; /*left stream frames*/ + HI_U32 u32CurPacks; /*pack number of current frame*/ + HI_U32 u32LeftRecvPics; + HI_U32 u32LeftEncPics; +}VENC_CHN_STAT_S; + +typedef struct hiVENC_H264_CAPABILITY_S +{ + HI_U8 u8Profile ; /*0:baseline 1:mainprofile 2:high profile*/ + HI_U8 u8Level ; /*eg: 22 denote level2.2*/ + HI_U8 u8BaseAttr ; /*bit0¡«bit5 denote MBAFF, PAFF£¬B SLICE£¬FMO£¬ ASO£¬PARTITION */ + HI_U8 u8ViFormat ; /*format£¬ bit.0: PAL(25)£¬bit.1:NTSC(30) */ + HI_U16 u16MaxWInMb ; /*the max width of input picture*/ + HI_U16 u16MaxHInMb ; /*the max height of input picture*/ + HI_U16 u16MaxCifNum ; /*the max coding capability */ + HI_U16 u16MaxBitrate ; /*the max bit rate output*/ + HI_U16 upperbandwidth ; /*upper band*/ + HI_U16 lowerbandwidth ; /*lower band*/ + HI_U8 palfps ; /*PAL: frame per second*/ + HI_U8 ntscfps ; /*NTSC: frame per second*/ +}VENC_H264_CAPABILITY_S; + +typedef struct hiVENC_JPEG_CAPABILITY_S +{ + HI_U8 u8Profile ; /*0:baseline 1:extened profile 2:loseless profile 3:hierarchical profile*/ + HI_U8 u8ViFormat ; /*format£¬ bit.0: PAL(25)£¬bit.1:NTSC(30) */ + HI_U16 u16MaxWInMb ; /*the max width of input picture*/ + HI_U16 u16MaxHInMb ; /*the max height of input picture*/ + HI_U16 u16MaxCifNum ; /*the max coding capability */ + HI_U16 u16MaxBitrate ; /*the max bit rate output*/ + HI_U16 upperbandwidth ; /*upper band*/ + HI_U16 lowerbandwidth ; /*lower band*/ + HI_U8 palfps ; /*PAL: frame per second*/ + HI_U8 ntscfps ; /*NTSC: frame per second*/ +}VENC_JPEG_CAPABILITY_S; + +typedef struct hiVENC_MPEG4_CAPABILITY_S +{ + HI_BOOL IVOP_En; /* I-VOP Enable */ + HI_BOOL PVOP_En; /* P-VOP Enable */ + HI_BOOL BVOP_En; /* B-VOP Enable*/ + HI_BOOL DCPred_En; /* DC Prediction Enable*/ + HI_BOOL ACPred_En; /*AC Prediction Enable*/ + HI_BOOL M4V_En; /*M4V Enable*/ + HI_BOOL Resyn_En; /*GOB Resynchronization Enable*/ + HI_BOOL DataPart_En; /*Data Partitioning Enable*/ + HI_BOOL RVLC_En; /*Reversible VLC Enable*/ + HI_BOOL ShortHead_En; /*Short Header Enable*/ + HI_BOOL Interlace_En; /*Interlace Enable*/ + HI_BOOL GMC_En; /*Global Motion Compensation Enable*/ + HI_BOOL QMC_En; /*Quarter-pel Motion Compensation Enable*/ + HI_BOOL HalfPel_En; /* I-VOP Enable*/ + HI_BOOL DBlock_En; /*Deblocking Enable*/ + HI_BOOL DRing_En; /*Deringing Enable*/ + +// M4QType QuantType; /*Method 1/Method 2 Quantisation*/ + HI_U32 SearchWin; /*Search Window*/ +}VENC_MPEG4_CAPABILITY_S; + +typedef struct hiVENC_CAPABILITY_S +{ + PAYLOAD_TYPE_E enType; /*the type of payload*/ + union + { + VENC_H264_CAPABILITY_S stH264Cap; + VENC_JPEG_CAPABILITY_S stJpegCap; + VENC_MPEG4_CAPABILITY_S stMpegCap; + }; +}VENC_CAPABILITY_S; + +typedef struct hiVENC_PARAM_H264_SLICE_SPLIT_S +{ + HI_BOOL bSplitEnable; /*slice split enable, HI_TRUE:enable, HI_FALSE:diable, default value:HI_FALSE*/ + HI_U32 u32SplitMode; /*0:bit number, 1:mb line number, >=2:no meaning*/ + HI_U32 u32SliceSize; /*when the splitmode is 0, this value presents the bitsnum of one slice average, + when the splitmode is 1, this value presents the mb num of one slice*/ +} VENC_PARAM_H264_SLICE_SPLIT_S; + +typedef struct hiVENC_PARAM_H264_MCTF_S +{ + HI_BOOL bIframeEnable; + HI_BOOL bStaticEnable; + HI_U32 u32StaticStrength; + HI_BOOL bMoveEnable; + HI_U32 u32MoveStrength; +}VENC_PARAM_H264_MCTF_S; + +typedef struct hiVENC_PARAM_H264_INTER_PRED_S +{ + /* search window */ + HI_U32 u32HWSize; /* size of horizontal search window. + default value: differ with the picture size */ + HI_U32 u32VWSize; /* size of vertical search window. + default value: differ with the picture size */ + + /* inter pred, one of the following 4 kinds of inter prediction mode must be enable */ + HI_BOOL bInter16x16PredEn; /*default: HI_TRUE, enable 16x16 prediction*/ + HI_BOOL bInter16x8PredEn; /*default: HI_TRUE*/ + HI_BOOL bInter8x16PredEn; /*default: HI_TRUE*/ + HI_BOOL bInter8x8PredEn; /*default: HI_TRUE*/ + HI_BOOL bExtedgeEn; /*default: HI_TRUE*/ +} VENC_PARAM_H264_INTER_PRED_S; + +typedef struct hiVENC_PARAM_H264_INTRA_PRED_S +{ + /* intra pred, one of following 2 kinds of intra pred mode must be enable */ + HI_BOOL bIntra16x16PredEn; /*default: HI_TRUE, enable 16x16 intra prediction*/ + HI_BOOL bIntraNxNPredEn; /*default: HI_TRUE, enable 4x4 and/or 8x8 prediction + Notes: this value must work with IntraTransMode*/ + HI_U32 constrained_intra_pred_flag; + HI_BOOL bIpcmEn; +}VENC_PARAM_H264_INTRA_PRED_S; + +typedef struct hiVENC_PARAM_H264E_TRANS_S +{ + HI_U32 u32IntraTransMode; /* 0: trans4x4, trans8x8; 1: trans4x4, 2: trans8x8 */ + HI_U32 u32InterTransMode; /* 0: trans4x4, trans8x8; 1: trans4x4, 2: trans8x8 */ + + HI_BOOL bScalingListValid; /* default: HI_FALSE */ + /* Notes: Enable IntraScalingList8X8 and InterScalingList8X8 while bScalingListValid is HI_TRUE */ + HI_U8 InterScalingList8X8[64]; + HI_U8 IntraScalingList8X8[64]; + + HI_S32 chroma_qp_index_offset; /* [-12,12],default value: 0*/ +}VENC_PARAM_H264_TRANS_S; + +typedef struct hiVENC_PARAM_H264E_ENTROPY_S +{ + HI_U32 u32EntropyEncModeI; /* 0:cavlc, 1:cabac */ + HI_U32 u32EntropyEncModeP; /* 0:cavlc, 1:cabac */ + HI_U32 cabac_stuff_en; /* default: 0*/ + HI_U32 Cabac_init_idc; /* 0~2 */ +}VENC_PARAM_H264_ENTROPY_S; + +typedef struct hiVENC_PARAM_H264_POC_S +{ + HI_U32 pic_order_cnt_type; /* default value: 2. {0,1,2} */ + +}VENC_PARAM_H264_POC_S; + +typedef struct hiVENC_PARAM_H264E_DBLK_S +{ + HI_U32 disable_deblocking_filter_idc; /* default value: 0. {0,1,2} */ + HI_S32 slice_alpha_c0_offset_div2; /* default value: 5. [-6,+6] */ + HI_S32 slice_beta_offset_div2; /* default value: 5. [-6,+6] */ +}VENC_PARAM_H264_DBLK_S; + + +typedef struct hiVENC_PARAM_H264E_RDO_S +{ + HI_U16 u16H264ERDOS[12]; +}VENC_PARAM_H264E_RDO_S; + + +typedef struct hiVENC_PARAM_H264E_VUI_S +{ + HI_S32 timing_info_present_flag; /* default value: 0. If 1, timing info belows will be encoded into vui. {0,1} */ + HI_S32 num_units_in_tick; /* default value: n/a. > 0. */ + HI_S32 time_scale; /* default value: n/a. > 0. */ + HI_S32 fixed_frame_rate_flag; /* default value: n/a. {0,1} */ +}VENC_PARAM_H264_VUI_S; + +typedef struct hiVENC_PARAM_H264E_VIDEO_SIGNAL_S +{ + HI_U8 video_signal_type_present_flag ; /* default value: 0. If 1, video singnal info will be encoded into vui. {0,1} */ + HI_U8 video_format ; /* default value: n/a. [0,5]. */ + HI_U8 video_full_range_flag; /* default value: n/a. [0,1}. */ + HI_U8 colour_description_present_flag ; /* default value: n/a. [0,1} */ + HI_U8 colour_primaries ; /* default value: n/a. [1,9], 0/10~255 is reserved */ + HI_U8 transfer_characteristics; /* default value: n/a. [1,15],0/16~255 is reserved */ + HI_U8 matrix_coefficients; /* default value: n/a. [0,10],11~255 is reserved */ +}VENC_PARAM_H264_VIDEO_SIGNAL_S; + + + +typedef struct hiVENC_PARAM_JPEG_S +{ + HI_U32 u32Qfactor; /*image quality :[1,99]*/ + + HI_U8 u8YQt[64]; /* y qt value */ + HI_U8 u8CbQt[64]; /* cb qt value */ + HI_U8 u8CrQt[64]; /* cr qt value */ + + HI_U32 u32MCUPerECS; /*default value: 0, MCU number of one ECS*/ +} VENC_PARAM_JPEG_S; + +typedef struct hiVENC_PARAM_MJPEG_S +{ + HI_U8 u8YQt[64]; /* y qt value */ + HI_U8 u8CbQt[64]; /* cb qt value */ + HI_U8 u8CrQt[64]; /* cr qt value */ + + HI_U32 u32MCUPerECS; /*default value: 0, MCU number of one ECS*/ +} VENC_PARAM_MJPEG_S; + +typedef struct hiVENC_PARAM_MPEG4_S +{ + HI_BOOL bSplitEnable; /*slice split enable, HI_TRUE:enable, HI_FALSE:diable, default value:HI_FALSE*/ + HI_U32 u32SplitMode; /*0:bit number, 1:mb line number, >=2:no meaning*/ + HI_U32 u32PacketSize; /*when the splitmode is 0, this value presents the bitsnum of one packet average, + when the splitmode is 1, this value presents the mb num of one packet*/ + + /* search window */ + HI_U32 u32HWSize; /* size of horizontal search window. + * default value: differ with the picture size + * 0000: [-16, +15] + * 0001: [-32, +31] + */ + HI_U32 u32VWSize; /* size of vertical search window. + * default value: differ with the picture size + * 000: [-16, +15] + * >000: no meaning. + */ +} VENC_PARAM_MPEG4_S; + + +/* ROI struct */ +typedef struct hiVENC_ROI_CFG_S +{ + HI_U32 u32Index; /* Index of an ROI. The system supports indexes ranging from 0 to 7 */ + HI_BOOL bEnable; /* Whether to enable this ROI */ + HI_BOOL bAbsQp; /* QP mode of an ROI.HI_FALSE: relative QP.HI_TURE: absolute QP.*/ + HI_S32 s32Qp; /* QP value. */ + RECT_S stRect; /* Region of an ROI*/ +}VENC_ROI_CFG_S; + +typedef struct hiGROUP_COLOR2GREY_S +{ + HI_BOOL bColor2Grey; /* Whether to enable Color2Grey.*/ +}GROUP_COLOR2GREY_S; + +typedef struct hiGROUP_COLOR2GREY_CONF_S +{ + HI_BOOL bEnable; + HI_U32 u32MaxWidth; + HI_U32 u32MaxHeight; +}GROUP_COLOR2GREY_CONF_S; + + +typedef struct hiGROUP_CROP_CFG_S +{ + HI_BOOL bEnable; /* Crop region enable */ + RECT_S stRect; /* Crop region, note: s32X must be multi of 16 */ +}GROUP_CROP_CFG_S; + + +typedef struct hiGROUP_FRAME_RATE_S +{ + HI_S32 s32ViFrmRate; /* Input frame rate of a group*/ + HI_S32 s32VpssFrmRate; /* Output frame rate of a channel group */ +} GROUP_FRAME_RATE_S; + +typedef struct hiVENC_ATTR_H264_REF_PARAM_S +{ + HI_U32 u32Base; + HI_U32 u32Enhance; + HI_BOOL bEnablePred; +} VENC_ATTR_H264_REF_PARAM_S; + +typedef enum hiVENC_ATTR_H264_REF_MODE_E +{ + H264E_REF_MODE_1X = 1, + H264E_REF_MODE_2X = 2, + H264E_REF_MODE_4X = 5, + H264E_REF_MODE_BUTT, +}VENC_ATTR_H264_REF_MODE_E; + +/* Jpeg snap mode */ +typedef enum hiVENC_JPEG_SNAP_MODE_E +{ + JPEG_SNAP_ALL = 0, /* Jpeg channel snap all the pictures when started. */ + JPEG_SNAP_FLASH = 1, /* Jpeg channel snap the flashed pictures when started. */ + JPEG_SNAP_BUTT, + +}VENC_JPEG_SNAP_MODE_E; + +typedef struct hiVENC_RECV_PIC_PARAM_S +{ + HI_S32 s32RecvPicNum; /**/ +} VENC_RECV_PIC_PARAM_S; + +typedef struct hiVENC_STREAM_BUF_INFO_S +{ + HI_U32 u32PhyAddr; + HI_U32 u32Size; +} VENC_STREAM_BUF_INFO_S; + + + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif /* __cplusplus */ + +#endif /* __HI_COMM_VENC_H__ */ diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_vi.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_vi.h new file mode 100644 index 0000000000..276fbd0054 --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_vi.h @@ -0,0 +1,510 @@ +/****************************************************************************** + +Copyright (C), 2004-2020, Hisilicon Tech. Co., Ltd. + +****************************************************************************** +File Name : hi_comm_vi.h +Version : Initial Draft +Author : Hisilicon multimedia software group +Created : 2009/3/9 +Last Modified : +Description : +Function List : +History : +1.Date : 2010/11/16 + Author : p00123320/w54723/n168968 + Modification: Created file + +2.Date : 2011/06/16 + Author : w54723/l00181524/c00186004 + Modification: Created file + + +******************************************************************************/ + +#ifndef __HI_COMM_VI_H__ +#define __HI_COMM_VI_H__ + +#include "hi_common.h" +#include "hi_errno.h" +#include "hi_comm_video.h" + + +#ifdef __cplusplus +#if __cplusplus +extern "C" +{ +#endif +#endif /* __cplusplus */ + +#define VI_INVALID_FRMRATE (-1UL) +#define VIU_MAX_USER_FRAME_DEPTH 8 + +typedef enum hiEN_VIU_ERR_CODE_E +{ + ERR_VI_FAILED_NOTENABLE = 64, /* device or channel not enable*/ + ERR_VI_FAILED_NOTDISABLE, /* device not disable*/ + ERR_VI_FAILED_CHNOTDISABLE, /* channel not disable*/ + ERR_VI_CFG_TIMEOUT, /* config timeout*/ + ERR_VI_NORM_UNMATCH, /* video norm of ADC and VIU is unmatch*/ + ERR_VI_INVALID_WAYID, /* invlalid way ID */ + ERR_VI_INVALID_PHYCHNID, /* invalid phychn id*/ + ERR_VI_FAILED_NOTBIND, /* device or channel not bind */ + ERR_VI_FAILED_BINDED, /* device or channel not unbind */ +} EN_VIU_ERR_CODE_E; + +#define HI_ERR_VI_INVALID_PARA HI_DEF_ERR(HI_ID_VIU, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM) +#define HI_ERR_VI_INVALID_DEVID HI_DEF_ERR(HI_ID_VIU, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_DEVID) +#define HI_ERR_VI_INVALID_CHNID HI_DEF_ERR(HI_ID_VIU, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_CHNID) +#define HI_ERR_VI_INVALID_NULL_PTR HI_DEF_ERR(HI_ID_VIU, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR) +#define HI_ERR_VI_FAILED_NOTCONFIG HI_DEF_ERR(HI_ID_VIU, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_CONFIG) +#define HI_ERR_VI_SYS_NOTREADY HI_DEF_ERR(HI_ID_VIU, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY) +#define HI_ERR_VI_BUF_EMPTY HI_DEF_ERR(HI_ID_VIU, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_EMPTY) +#define HI_ERR_VI_BUF_FULL HI_DEF_ERR(HI_ID_VIU, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_FULL) +#define HI_ERR_VI_NOMEM HI_DEF_ERR(HI_ID_VIU, EN_ERR_LEVEL_ERROR, EN_ERR_NOMEM) +#define HI_ERR_VI_NOT_SUPPORT HI_DEF_ERR(HI_ID_VIU, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_SUPPORT) +#define HI_ERR_VI_BUSY HI_DEF_ERR(HI_ID_VIU, EN_ERR_LEVEL_ERROR, EN_ERR_BUSY) +#define HI_ERR_VI_NOT_PERM HI_DEF_ERR(HI_ID_VIU, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM) + +#define HI_ERR_VI_FAILED_NOTENABLE HI_DEF_ERR(HI_ID_VIU, EN_ERR_LEVEL_ERROR, ERR_VI_FAILED_NOTENABLE)/* 0xA0108040*/ +#define HI_ERR_VI_FAILED_NOTDISABLE HI_DEF_ERR(HI_ID_VIU, EN_ERR_LEVEL_ERROR, ERR_VI_FAILED_NOTDISABLE)/* 0xA0108041*/ +#define HI_ERR_VI_FAILED_CHNOTDISABLE HI_DEF_ERR(HI_ID_VIU, EN_ERR_LEVEL_ERROR, ERR_VI_FAILED_CHNOTDISABLE)/* 0xA0108042*/ +#define HI_ERR_VI_CFG_TIMEOUT HI_DEF_ERR(HI_ID_VIU, EN_ERR_LEVEL_ERROR, ERR_VI_CFG_TIMEOUT)/* 0xA0108043*/ +#define HI_ERR_VI_NORM_UNMATCH HI_DEF_ERR(HI_ID_VIU, EN_ERR_LEVEL_ERROR, ERR_VI_NORM_UNMATCH)/* 0xA0108044*/ +#define HI_ERR_VI_INVALID_WAYID HI_DEF_ERR(HI_ID_VIU, EN_ERR_LEVEL_ERROR, ERR_VI_INVALID_WAYID)/* 0xA0108045*/ +#define HI_ERR_VI_INVALID_PHYCHNID HI_DEF_ERR(HI_ID_VIU, EN_ERR_LEVEL_ERROR, ERR_VI_INVALID_PHYCHNID)/* 0xA0108046*/ +#define HI_ERR_VI_FAILED_NOTBIND HI_DEF_ERR(HI_ID_VIU, EN_ERR_LEVEL_ERROR, ERR_VI_FAILED_NOTBIND)/* 0xA0108047*/ +#define HI_ERR_VI_FAILED_BINDED HI_DEF_ERR(HI_ID_VIU, EN_ERR_LEVEL_ERROR, ERR_VI_FAILED_BINDED)/* 0xA0108048*/ + + +/*get the subchn index by main chn */ +#define SUBCHN(ViChn) (ViChn + 16) + +/* define cascade chn */ +#define VI_CAS_CHN_1 32 +#define VI_CAS_CHN_2 33 + + +/* interface mode of video input */ +typedef enum hiVI_INTF_MODE_E +{ + VI_MODE_BT656 = 0, /* ITU-R BT.656 YUV4:2:2 */ + VI_MODE_BT601, /* ITU-R BT.601 YUV4:2:2 */ + VI_MODE_DIGITAL_CAMERA, /* digatal camera mode */ + VI_MODE_BT1120_STANDARD, /* BT.1120 progressive mode */ + VI_MODE_BT1120_INTERLEAVED, /* BT.1120 interstage mode */ + + VI_MODE_BUTT +} VI_INTF_MODE_E; + + +/* Input mode */ +typedef enum hiVI_INPUT_MODE_E +{ + VI_INPUT_MODE_BT656 = 0, /* ITU-R BT.656 YUV4:2:2 */ + VI_INPUT_MODE_BT601, /* ITU-R BT.601 YUV4:2:2 */ + VI_INPUT_MODE_DIGITAL_CAMERA, /* digatal camera mode */ + VI_INPUT_MODE_INTERLEAVED, + + VI_INPUT_MODE_BUTT +} VI_INPUT_MODE_E; + +typedef enum hiVI_WORK_MODE_E +{ + VI_WORK_MODE_1Multiplex = 0, /* 1 Multiplex mode */ + VI_WORK_MODE_2Multiplex, /* 2 Multiplex mode */ + VI_WORK_MODE_4Multiplex, /* 4 Multiplex mode */ + + VI_WORK_MODE_BUTT +} VI_WORK_MODE_E; + + + +/* whether an input picture is interlaced or progressive */ +typedef enum hiVI_SCAN_MODE_E +{ + VI_SCAN_INTERLACED = 0, + VI_SCAN_PROGRESSIVE, + + VI_SCAN_BUTT, +} VI_SCAN_MODE_E; + +typedef enum hiVI_DATA_YUV_SEQ_E +{ + /*The input sequence of the second component(only contains u and v) in BT.1120 mode */ + VI_INPUT_DATA_VUVU = 0, + VI_INPUT_DATA_UVUV, + + /* The input sequence for yuv */ + VI_INPUT_DATA_UYVY = 0, + VI_INPUT_DATA_VYUY, + VI_INPUT_DATA_YUYV, + VI_INPUT_DATA_YVYU, + + VI_DATA_YUV_BUTT +} VI_DATA_YUV_SEQ_E; + +typedef enum hiVI_CLK_EDGE_E +{ + VI_CLK_EDGE_SINGLE_UP = 0, /* single-edge mode and in rising edge */ + VI_CLK_EDGE_SINGLE_DOWN, /* single-edge mode and in falling edge */ + //VI_CLK_EDGE_DOUBLE , /* Double edge mode */ + + VI_CLK_EDGE_BUTT +} VI_CLK_EDGE_E; + +typedef enum hiVI_COMP_MODE_E +{ + VI_COMP_MODE_SINGLE = 0, /* in single component mode */ + VI_COMP_MODE_DOUBLE = 1, /* in double component mode */ + VI_COMP_MODE_BUTT, +}VI_COMP_MODE_E; + +/* Y/C composite or separation mode */ +typedef enum hiVI_COMBINE_MODE_E +{ + VI_COMBINE_COMPOSITE = 0, /* Composite mode */ + VI_COMBINE_SEPARATE, /* Separate mode */ + VI_COMBINE_BUTT, +} VI_COMBINE_MODE_E; + +/* Attribute of the vertical synchronization signal */ +typedef enum hiVI_VSYNC_E +{ + VI_VSYNC_FIELD = 0, /* Field/toggle mode:a signal reversal means a new frame or a field */ + VI_VSYNC_PULSE, /* Pusle/effective mode:a pusle or an effective signal means a new frame or a field */ +} VI_VSYNC_E; + +/* Polarity of the vertical synchronization signal */ +typedef enum hiVI_VSYNC_NEG_E +{ + VI_VSYNC_NEG_HIGH = 0, /*if VIU_VSYNC_E = VIU_VSYNC_FIELD,then the vertical synchronization signal of even field is high-level, + if VIU_VSYNC_E = VIU_VSYNC_PULSE,then the vertical synchronization pulse is positive pulse.*/ + VI_VSYNC_NEG_LOW /*if VIU_VSYNC_E = VIU_VSYNC_FIELD,then the vertical synchronization signal of even field is low-level, + if VIU_VSYNC_E = VIU_VSYNC_PULSE,then the vertical synchronization pulse is negative pulse.*/ +} VI_VSYNC_NEG_E; + +/* Attribute of the horizontal synchronization signal */ +typedef enum hiVI_HSYNC_E +{ + VI_HSYNC_VALID_SINGNAL = 0, /* the horizontal synchronization is valid signal mode */ + VI_HSYNC_PULSE, /* the horizontal synchronization is pulse mode, a new pulse means the beginning of a new line */ +} VI_HSYNC_E; + +/* Polarity of the horizontal synchronization signal */ +typedef enum hiVI_HSYNC_NEG_E +{ + VI_HSYNC_NEG_HIGH = 0, /*if VI_HSYNC_E = VI_HSYNC_VALID_SINGNAL,then the valid horizontal synchronization signal is high-level; + if VI_HSYNC_E = VI_HSYNC_PULSE,then the horizontal synchronization pulse is positive pulse */ + VI_HSYNC_NEG_LOW /*if VI_HSYNC_E = VI_HSYNC_VALID_SINGNAL,then the valid horizontal synchronization signal is low-level; + if VI_HSYNC_E = VI_HSYNC_PULSE,then the horizontal synchronization pulse is negative pulse */ +} VI_HSYNC_NEG_E; + +/* Attribute of the valid vertical synchronization signal */ +typedef enum hiVI_VSYNC_VALID_E +{ + VI_VSYNC_NORM_PULSE = 0, /* the vertical synchronization is pusle mode, a pusle means a new frame or field */ + VI_VSYNC_VALID_SINGAL, /* the vertical synchronization is effective mode, a effective signal means a new frame or field */ +} VI_VSYNC_VALID_E; + +/* Polarity of the valid vertical synchronization signal */ +typedef enum hiVI_VSYNC_VALID_NEG_E +{ + VI_VSYNC_VALID_NEG_HIGH = 0, /*if VI_VSYNC_VALID_E = VI_VSYNC_NORM_PULSE,a positive pulse means vertical synchronization pulse; + if VI_VSYNC_VALID_E = VI_VSYNC_VALID_SINGAL,the valid vertical synchronization signal is high-level */ + VI_VSYNC_VALID_NEG_LOW /*if VI_VSYNC_VALID_E = VI_VSYNC_NORM_PULSE,a negative pulse means vertical synchronization pulse; + if VI_VSYNC_VALID_E = VI_VSYNC_VALID_SINGAL,the valid vertical synchronization signal is low-level */ +} VI_VSYNC_VALID_NEG_E; + + + +/* Blank information of the input timing */ +typedef struct hiVI_TIMING_BLANK_S +{ + HI_U32 u32HsyncHfb ; /* Horizontal front blanking width */ + HI_U32 u32HsyncAct ; /* Horizontal effetive width */ + HI_U32 u32HsyncHbb ; /* Horizontal back blanking width */ + HI_U32 u32VsyncVfb ; /* Vertical front blanking height of one frame or odd-field frame picture */ + HI_U32 u32VsyncVact ; /* Vertical effetive width of one frame or odd-field frame picture */ + HI_U32 u32VsyncVbb ; /* Vertical back blanking height of one frame or odd-field frame picture */ + HI_U32 u32VsyncVbfb ; /* Even-field vertical front blanking height when input mode is interlace (invalid when progressive input mode) */ + HI_U32 u32VsyncVbact ; /* Even-field vertical effetive width when input mode is interlace (invalid when progressive input mode) */ + HI_U32 u32VsyncVbbb ; /* Even-field vertical back blanking height when input mode is interlace (invalid when progressive input mode) */ +}VI_TIMING_BLANK_S; + +/* synchronization information about the BT.601 or DC timing */ +typedef struct hiVI_SYNC_CFG_S +{ + VI_VSYNC_E enVsync; + VI_VSYNC_NEG_E enVsyncNeg; + VI_HSYNC_E enHsync; + VI_HSYNC_NEG_E enHsyncNeg; + VI_VSYNC_VALID_E enVsyncValid; + VI_VSYNC_VALID_NEG_E enVsyncValidNeg; + VI_TIMING_BLANK_S stTimingBlank; +} VI_SYNC_CFG_S; + +/* the highest bit of the BT.656 timing reference code*/ +typedef enum hiBT656_FIXCODE_E +{ + BT656_FIXCODE_1 = 0, /* The highest bit of the EAV/SAV data over the BT.656 protocol is always 1.*/ + BT656_FIXCODE_0 /* The highest bit of the EAV/SAV data over the BT.656 protocol is always 0.*/ +}BT656_FIXCODE_E; + +/* Polarity of the field indicator bit (F) of the BT.656 timing reference code */ +typedef enum hiBT656_FIELD_POLAR_E +{ + BT656_FIELD_POLAR_STD = 0, /* the standard BT.656 mode,the first filed F=0,the second filed F=1*/ + BT656_FIELD_POLAR_NSTD /* the non-standard BT.656 mode,the first filed F=1,the second filed F=0*/ +}BT656_FIELD_POLAR_E; + +typedef struct hiVI_BT656_SYNC_CFG_S +{ + BT656_FIXCODE_E enFixCode; + BT656_FIELD_POLAR_E enFieldPolar; +}VI_BT656_SYNC_CFG_S; + +typedef enum hiVI_VBI_LOCAL_E +{ + VI_VBI_LOCAL_ODD_FRONT = 0, + VI_VBI_LOCAL_ODD_END, + VI_VBI_LOCAL_EVEN_FRONT, + VI_VBI_LOCAL_EVEN_END, + VI_VBI_LOCAL_BUTT +} VI_VBI_LOCAL_E; + +typedef struct hiVI_VBI_ATTR_S +{ + VI_VBI_LOCAL_E enLocal; /* location of VBI */ + HI_S32 s32X; /* horizontal original position of the VBI data */ + HI_S32 s32Y; /* vertical original position of the VBI data */ + HI_U32 u32Len; /* length of VBI data, by word(4 Bytes) */ +} VI_VBI_ATTR_S; + +typedef enum hiVI_DATA_TYPE_E +{ + VI_DATA_TYPE_YUV = 0, + VI_DATA_TYPE_RGB = 1, + VI_DATA_TYPE_BUTT +} VI_DATA_TYPE_E; + +typedef enum hiVI_DATA_PATH_E +{ + VI_PATH_BYPASS = 0, /* ISP bypass */ + VI_PATH_ISP = 1, /* ISP enable */ + VI_PATH_RAW = 2, /* Capture raw data, for debug */ + VI_PATH_BUTT +}VI_DATA_PATH_E; + +/* the extended attributes of VI device */ +typedef struct hiVI_DEV_ATTR_EX_S +{ + VI_INPUT_MODE_E enInputMode; /* Input mode */ + VI_WORK_MODE_E enWorkMode; /*1-, 2-, or 4-channel multiplexed work mode */ + + VI_COMBINE_MODE_E enCombineMode; /* Y/C composite or separation mode */ + VI_COMP_MODE_E enCompMode; /* Component mode (single-component or dual-component) */ + VI_CLK_EDGE_E enClkEdge; /* Clock edge mode (sampling on the rising or falling edge) */ + + HI_U32 au32CompMask[2]; /* Component mask */ + + VI_SCAN_MODE_E enScanMode; /* Input scanning mode (progressive or interlaced) */ + HI_S32 s32AdChnId[4]; /* AD channel ID. Typically, the default value -1 is recommended */ + + VI_DATA_YUV_SEQ_E enDataSeq; /* Input data sequence (only the YUV format is supported) */ + VI_SYNC_CFG_S stSynCfg; /* Sync timing. This member must be configured in BT.601 mode or DC mode */ + + VI_BT656_SYNC_CFG_S stBT656SynCfg; /* Sync timing. This member must be configured in BT.656 mode */ + + VI_DATA_PATH_E enDataPath; /* ISP enable or bypass */ + VI_DATA_TYPE_E enInputDataType; /* RGB: CSC-709 or CSC-601, PT YUV444 disable; YUV: default yuv CSC coef PT YUV444 enable. */ + + HI_BOOL bDataRev; /* Data reverse */ +} VI_DEV_ATTR_EX_S; + +/* the attributes of a VI device */ +typedef struct hiVI_DEV_ATTR_S +{ + VI_INTF_MODE_E enIntfMode; /* Interface mode */ + VI_WORK_MODE_E enWorkMode; /*1-, 2-, or 4-channel multiplexed work mode */ + + HI_U32 au32CompMask[2]; /* Component mask */ + VI_SCAN_MODE_E enScanMode; /* Input scanning mode (progressive or interlaced) */ + HI_S32 s32AdChnId[4]; /* AD channel ID. Typically, the default value -1 is recommended */ + + /* The below members must be configured in BT.601 mode or DC mode and are invalid in other modes */ + VI_DATA_YUV_SEQ_E enDataSeq; /* Input data sequence (only the YUV format is supported) */ + VI_SYNC_CFG_S stSynCfg; /* Sync timing. This member must be configured in BT.601 mode or DC mode */ + + VI_DATA_PATH_E enDataPath; /* ISP enable or bypass */ + VI_DATA_TYPE_E enInputDataType; /* RGB: CSC-709 or CSC-601, PT YUV444 disable; YUV: default yuv CSC coef PT YUV444 enable. */ + + HI_BOOL bDataRev; /* Data reverse */ +} VI_DEV_ATTR_S; + + +typedef struct hiVI_CHN_BIND_ATTR_S +{ + VI_DEV ViDev; + VI_WAY ViWay; +} VI_CHN_BIND_ATTR_S; + + +/* the attributes of a VI way */ +typedef struct hiVI_WAY_ATTR_S +{ + HI_S32 s32AdChnId; +} VI_WAY_ATTR_S; + + +/* captrue selection of video input */ +typedef enum hiVI_CAPSEL_E +{ + VI_CAPSEL_TOP = 0, /* top field */ + VI_CAPSEL_BOTTOM, /* bottom field */ + VI_CAPSEL_BOTH, /* top and bottom field */ + VI_CAPSEL_BUTT +} VI_CAPSEL_E; + + +/* the attributes of a VI channel */ +typedef struct hiVI_CHN_ATTR_S +{ + RECT_S stCapRect; /* the capture rect (corresponding to the size of the picture captured by a VI device). + For primary channels, the stCapRect's u32Width and u32Height are static attributes. That is, + the value of them can be changed only after primary and secondary channels are disabled. + For secondary channels, stCapRect is an invalid attribute */ + SIZE_S stDestSize; /* Target picture size. + For primary channels, stDestSize must be equal to stCapRect's u32Width and u32Height, + because primary channel doesn't have scale capability. Additionally, it is a static + attribute, That is, the value of stDestSize can be changed only after primary and + secondary channels are disabled. + For secondary channels, stDestSize is a dynamic attribute */ + + VI_CAPSEL_E enCapSel; /* Frame/field select. It is used only in interlaced mode. + For primary channels, enCapSel is a static attribute */ + + PIXEL_FORMAT_E enPixFormat; /* Pixel storage format. Only the formats semi-planar420 and semi-planar422 are supported */ + HI_BOOL bMirror; /* Whether to mirror */ + HI_BOOL bFlip; /* Whether to flip */ + HI_BOOL bChromaResample; /* Whether to perform chrominance resampling. It is valid only for primary channels */ + HI_S32 s32SrcFrameRate; /* Source frame rate. The value -1 indicates that the frame rate is not controlled */ + HI_S32 s32FrameRate; /* Target frame rate. The value -1 indicates that the frame rate is not controlled */ +} VI_CHN_ATTR_S; + + +typedef struct hiVI_CHN_STAT_S +{ + HI_BOOL bEnable; /* Whether this channel is enabled */ + HI_U32 u32IntCnt; /* The video frame interrupt count */ + HI_U32 u32FrmRate; /* current frame rate */ + HI_U32 u32LostInt; /* The interrupt is received but nobody care */ + HI_U32 u32VbFail; /* Video buffer malloc failure */ + HI_U32 u32PicWidth; /* curren pic width */ + HI_U32 u32PicHeight; /* current pic height */ + HI_U32 u32AutoDisInt; /* auto disable interrupt count, when VIU detected too many interrupts */ +} VI_CHN_STAT_S; + +typedef enum hi_VI_USERPIC_MODE_E +{ + VI_USERPIC_MODE_PIC = 0, /* YUV picture */ + VI_USERPIC_MODE_BGC, /* Background picture only with a color */ + VI_USERPIC_MODE_BUTT, +} VI_USERPIC_MODE_E; + +typedef struct hiVI_USERPIC_BGC_S +{ + HI_U32 u32BgColor; +} VI_USERPIC_BGC_S; + +typedef struct hiVI_USERPIC_ATTR_S +{ + HI_BOOL bPub; /* Whether the user picture information is shared by all VI devices and channels*/ + VI_USERPIC_MODE_E enUsrPicMode; /* User picture mode */ + union + { + VIDEO_FRAME_INFO_S stUsrPicFrm; /* Information about a YUV picture */ + VI_USERPIC_BGC_S stUsrPicBg; /* Information about a background picture only with a color */ + }unUsrPic; +} VI_USERPIC_ATTR_S; + +typedef struct hiVI_USR_GET_FRM_TIMEOUT_S +{ + VIDEO_FRAME_INFO_S *pstVFrame; + HI_U32 u32MilliSec; +} VI_USR_GET_FRM_TIMEOUT_S; + + +typedef enum hiVI_FLASH_MODE_E +{ + VI_FLASH_ONCE = 0, /* Flash one time */ + VI_FLASH_FREQ = 1, /* Flash frequently */ + VI_FLASH_MODE_BUTT +}VI_FLASH_MODE_E; + +typedef struct hiVI_FlASH_CONFIG_S +{ + VI_FLASH_MODE_E enFlashMode; /* Flash one time, flash frequently*/ + + HI_U32 u32StartTime; /* Flash start time£¬unit: sensor pix clk.*/ + HI_U32 u32Duration; /* Flash high duration, unit: sensor pix clk.*/ + HI_U32 u32CapFrmIndex; /* Set which vframe will be bFlashed after flashing, default is 0. */ + HI_U32 u32Interval; /* Flash frequently interval, unit: frame*/ +}VI_FLASH_CONFIG_S; + +typedef struct hiVI_EXT_CHN_ATTR_S +{ + VI_CHN s32BindChn; /* The channel num which extend channel will bind to*/ + SIZE_S stDestSize; /* Target size*/ + + HI_S32 s32SrcFrameRate; /* Source frame rate. The value -1 indicates that the frame rate is not controlled */ + HI_S32 s32FrameRate; /* Target frame rate. The value -1 indicates that the frame rate is not controlled */ + PIXEL_FORMAT_E enPixFormat; /* Pixel storage format. Only the formats semi-planar420 and semi-planar422 are supported */ +}VI_EXT_CHN_ATTR_S; + + +typedef struct hiVI_LDC_ATTR_S +{ + HI_BOOL bEnable; /* Whether LDC is enbale */ + LDC_ATTR_S stAttr; /* LDC Attribute */ +}VI_LDC_ATTR_S; + +typedef struct hiVI_CHN_LUM_S +{ + HI_U32 u32Lum; /* Luma sum of current frame */ + HI_U64 u64Pts; /* PTS of current frame */ +} VI_CHN_LUM_S; + +typedef enum hiVI_CSC_TYPE_E +{ + VI_CSC_TYPE_601 = 0, /* CSC Type: 601 */ + VI_CSC_TYPE_709, /* CSC Type: 709 */ + VI_CSC_TYPE_BUTT, +} VI_CSC_TYPE_E; + +typedef struct hiVI_CSC_ATTR_S +{ + VI_CSC_TYPE_E enViCscType; /* 601 or 709 */ + HI_U32 u32LumaVal; /* Luminance: [0 ~ 100] */ + HI_U32 u32ContrVal; /* Contrast: [0 ~ 100] */ + HI_U32 u32HueVal; /* Hue: [0 ~ 100] */ + HI_U32 u32SatuVal; /* Satuature: [0 ~ 100] */ +} VI_CSC_ATTR_S; + +typedef enum hiVI_PORTMODE_E +{ + VI_PORTMODE_D1 = 0, /* D1/960H mode */ + VI_PORTMODE_720P, /* 720P mode */ + VI_PORTMODE_BUTT, +} VI_PORTMODE_E; + + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif /* __cplusplus */ + +#endif /* End of #ifndef__HI_COMM_VIDEO_IN_H__ */ + + diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_video.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_video.h new file mode 100644 index 0000000000..eee71a0461 --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_video.h @@ -0,0 +1,327 @@ +/******************************************************************************* + Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. + + ****************************************************************************** + File Name : hi_comm_video.h + Version : Initial Draft + Author : c42025 + Created : 2006/11/09 + Description : + History : + 1.Date : 2006/11/03 + Author : c42025 + Modification: Created file + + 2.Date : 2007/12/11 + Author : c42025 + Modification: delelte all about digital watermark + + 3.Date : 2008/10/31 + Author : z44949 + Modification: Translate the chinese comment +******************************************************************************/ + +#ifndef __HI_COMM_VIDEO_H__ +#define __HI_COMM_VIDEO_H__ + +#include "hi_type.h" +#include "hi_common.h" + +#ifdef __cplusplus +#if __cplusplus +extern "C"{ +#endif +#endif /* __cplusplus */ + + +typedef enum hiPIC_SIZE_E +{ + PIC_QCIF = 0, + PIC_CIF, + PIC_2CIF, + PIC_HD1, + PIC_D1, + PIC_960H, + + PIC_QVGA, /* 320 * 240 */ + PIC_VGA, /* 640 * 480 */ + PIC_XGA, /* 1024 * 768 */ + PIC_SXGA, /* 1400 * 1050 */ + PIC_UXGA, /* 1600 * 1200 */ + PIC_QXGA, /* 2048 * 1536 */ + + PIC_WVGA, /* 854 * 480 */ + PIC_WSXGA, /* 1680 * 1050 */ + PIC_WUXGA, /* 1920 * 1200 */ + PIC_WQXGA, /* 2560 * 1600 */ + + PIC_HD720, /* 1280 * 720 */ + PIC_HD1080, /* 1920 * 1080 */ + + PIC_BUTT +}PIC_SIZE_E; + +typedef enum hiVIDEO_NORM_E +{ + VIDEO_ENCODING_MODE_PAL=0, + VIDEO_ENCODING_MODE_NTSC, + VIDEO_ENCODING_MODE_AUTO, + VIDEO_ENCODING_MODE_BUTT +} VIDEO_NORM_E; + +typedef enum hiVIDEO_CONTROL_MODE_E +{ + VIDEO_CONTROL_MODE_SLAVER=0, + VIDEO_CONTROL_MODE_MASTER, + VIDEO_CONTROL_MODE_BUTT +}VIDEO_CONTROL_MODE_E; + + +/* we ONLY define picture format used, all unused will be deleted!*/ +typedef enum hiPIXEL_FORMAT_E +{ + PIXEL_FORMAT_RGB_1BPP = 0, + PIXEL_FORMAT_RGB_2BPP, + PIXEL_FORMAT_RGB_4BPP, + PIXEL_FORMAT_RGB_8BPP, + PIXEL_FORMAT_RGB_444, + PIXEL_FORMAT_RGB_4444, + PIXEL_FORMAT_RGB_555, + PIXEL_FORMAT_RGB_565, + PIXEL_FORMAT_RGB_1555, + + /* 9 reserved */ + PIXEL_FORMAT_RGB_888, + PIXEL_FORMAT_RGB_8888, + PIXEL_FORMAT_RGB_PLANAR_888, + PIXEL_FORMAT_RGB_BAYER, + + PIXEL_FORMAT_YUV_A422, + PIXEL_FORMAT_YUV_A444, + + PIXEL_FORMAT_YUV_PLANAR_422, + PIXEL_FORMAT_YUV_PLANAR_420, + PIXEL_FORMAT_YUV_PLANAR_444, + + PIXEL_FORMAT_YUV_SEMIPLANAR_422, + PIXEL_FORMAT_YUV_SEMIPLANAR_420, + PIXEL_FORMAT_YUV_SEMIPLANAR_444, + + PIXEL_FORMAT_UYVY_PACKAGE_422, + PIXEL_FORMAT_YUYV_PACKAGE_422, + PIXEL_FORMAT_VYUY_PACKAGE_422, + PIXEL_FORMAT_YCbCr_PLANAR, + + PIXEL_FORMAT_RGB_422, + PIXEL_FORMAT_RGB_420, + + PIXEL_FORMAT_BUTT +} PIXEL_FORMAT_E; + +typedef struct hiVIDEO_VBI_INFO_S +{ + HI_U32 au32Data[VIU_MAX_VBI_LEN]; + HI_U32 u32Len; +}VIDEO_VBI_INFO_S; + +typedef enum hiVIDEO_FIELD_E +{ + VIDEO_FIELD_TOP = 0x01, /* even field */ + VIDEO_FIELD_BOTTOM = 0x02, /* odd field */ + VIDEO_FIELD_INTERLACED = 0x03, /* two interlaced fields */ + VIDEO_FIELD_FRAME = 0x04, /* frame */ + + VIDEO_FIELD_BUTT +} VIDEO_FIELD_E; + +typedef struct hiVIDEO_FRAME_S +{ + HI_U32 u32Width; + HI_U32 u32Height; + VIDEO_FIELD_E u32Field; + PIXEL_FORMAT_E enPixelFormat; + + HI_U32 u32PhyAddr[3]; + HI_VOID *pVirAddr[3]; + HI_U32 u32Stride[3]; + + HI_U16 u16OffsetTop; /* top offset of show area */ + HI_U16 u16OffsetBottom; /* bottom offset of show area */ + HI_U16 u16OffsetLeft; /* left offset of show area */ + HI_U16 u16OffsetRight; /* right offset of show area */ + + HI_U64 u64pts; + HI_U32 u32TimeRef; + + HI_U32 u32PrivateData; + //VIDEO_VBI_INFO_S astVbiInfo[VIU_MAX_VBI_NUM]; +}VIDEO_FRAME_S; + +typedef struct hiVIDEO_FRAME_INFO_S +{ + VIDEO_FRAME_S stVFrame; + HI_U32 u32PoolId; +} VIDEO_FRAME_INFO_S; + +typedef struct hiBITMAP_S +{ + PIXEL_FORMAT_E enPixelFormat; /* Bitmap's pixel format */ + + HI_U32 u32Width; /* Bitmap's width */ + HI_U32 u32Height; /* Bitmap's height */ + HI_VOID *pData; /* Address of Bitmap's data */ +} BITMAP_S; + +typedef struct HI_VPP_CFG_S +{ + HI_BOOL bVppEn; + + HI_BOOL bIeEn; + HI_BOOL bDnEn; + HI_BOOL bSpEn; + HI_BOOL bIencEn; + + HI_S32 s32IeSth; /* IE Strength [0,10] */ + HI_S32 s32SpSth; /* SP Strength [-4,5] */ + HI_S32 s32DnSfCosSth; /* coarse DN sf Strength [0,3] */ + HI_S32 s32DnSfIncSth; /* Inching of DN sf Strength [0,255] */ + HI_S32 s32DnTfSth; /* DN tf Strength [0,4] */ + +} VPP_CFG_S; + +typedef struct hiSCALE_CFG_S +{ + HI_BOOL bScaleEn; + + HI_S32 s32DstWidth; /* the dest width after scale */ + HI_S32 s32DstHeight; /* the dest height after scale */ +} SCALE_CFG_S; + +/* Ie */ +typedef struct HI_VPP_IE_EX_S +{ + HI_U32 u32RefRange;// + HI_U32 u32IeStrength;// + HI_U32 u32Black; + HI_U32 u32White; +} VPP_IE_EX_S; + +/*dn*/ +typedef struct +{ + HI_U16 saMask[2]; + HI_U16 weight[2]; + +} tVppCalcWnd; + +typedef struct +{ + HI_U8 wWndX, hWndX; + HI_U8 wWndY, hWndY; + HI_U8 wWndC, hWndC; + HI_U8 wWndD, hWndD; // + + HI_U16 sfyMask[2]; + HI_U8 sfyRange[2]; // + HI_U8 sfyStrength; // + HI_U8 sfyLimitedFlag; // + + HI_U8 MADpExDirectSub : 1; + HI_U8 MADpExMask : 4; + HI_U8 _reserved_ : 3; + + HI_U8 sfcStrength; + HI_U8 sfyMADpThresh, sfyMADpRate;/**/ + HI_U16 sfyMSEiThresh[8]; + + HI_U8 rsfyThresh, rsfyRate, rsfyStrength, tfyStrength; + HI_U8 rsfcThresh, rsfcRate, rsfcStrength, tfcStrength;/**/ + + HI_U8 tfyMADpThresh, tfyMADpRate; + HI_U8 tfySNRpThresh, tfySNRpRate; + + HI_U16 tfyMSEiThresh[8]; + HI_U16 tfyMSEpThresh[8]; + + HI_U8 tfyMaxStrength;// + HI_U8 tfcMaxStrength;/**/ + + HI_U8 tfcMADpThresh, tfcMADpRate; + HI_U16 tfcMSEiThresh[8]; + + HI_U16 diyMSEiThresh[8]; + + HI_U8 tfyLimit; + HI_U8 noiseMADpThresh; + HI_U16 noiseMSDpThresh; + + HI_U8 log2hStepMADp, log2hStepMSEi; + + HI_U8 histMinMADp, histMaxMADp; + HI_U16 histMinMSEi, histMaxMSEi; + + /*---------------------------------------------*/ + tVppCalcWnd yWnd[2]; + tVppCalcWnd cWnd[2]; +} tVppDnCfg; +typedef tVppDnCfg VPP_DN_EX_S; + +/* Sp */ +typedef struct +{ + HI_U8 strength;// + HI_U8 limit;// + HI_U8 black; + HI_U8 white; +} tVppSharpenCfg; +typedef tVppSharpenCfg VPP_SP_EX_S; + + +typedef struct hiVPP_CFG_EX_S +{ + VPP_IE_EX_S stIE_Ex; + VPP_DN_EX_S stDN_Ex; + VPP_SP_EX_S stSP_Ex; +} VPP_CFG_EX_S; + + +/* VI Mix-Capture info. */ +typedef struct hiVI_MIXCAP_STAT_S +{ + HI_BOOL bMixCapMode; /* In mix-capture mode or not. */ + HI_BOOL bHasDownScale; /* VI Frame is downscaled or not. */ +} VI_MIXCAP_STAT_S; + +/* VI output frame info. */ +typedef struct hiVI_FRAME_INFO_S +{ + VI_MIXCAP_STAT_S stMixCapState; /* VI Mix-Capture info. */ + VIDEO_FRAME_INFO_S stViFrmInfo; /* Video frame info. */ + HI_BOOL bFlashed; /* Flashed Video frame or not. */ +}VI_FRAME_INFO_S; + +typedef enum hiLDC_VIEW_TYPE_E +{ + LDC_VIEW_TYPE_ALL = 0, /* View scale all but x and y independtly, this will keep both x and y axis ,but corner maybe lost*/ + LDC_VIEW_TYPE_CROP, /* Not use view scale, this will lost some side and corner */ + + LDC_VIEW_TYPE_BUTT, +} LDC_VIEW_TYPE_E; + +typedef struct hiLDC_ATTR_S +{ + LDC_VIEW_TYPE_E enViewType; + + HI_S32 s32CenterXOffset; /* Horizontal offset of the image distortion center relative to image center. [-28,28]. */ + HI_S32 s32CenterYOffset; /* Vertical offset of the image distortion center relative to image center. [-14,14]. */ + HI_S32 s32Ratio; /* Distortion ratio. [0, 511]. */ +} LDC_ATTR_S; + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif /* __cplusplus */ + + +#endif /* _HI_COMM_VIDEO_H_ */ diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_vo.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_vo.h new file mode 100644 index 0000000000..ac718bc4f2 --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_vo.h @@ -0,0 +1,493 @@ +/****************************************************************************** + + Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. + + ****************************************************************************** + File Name : hi_comm_vo.h + Version : Initial Draft + Author : Hisilicon multimedia software group + Created : 2009/03/18 + Description : + History : + 1.Date : 2009/03/18 + Author : x00100808 + Modification: Created file + +******************************************************************************/ + +#ifndef __HI_COMM_VO_H__ +#define __HI_COMM_VO_H__ + +#include "hi_type.h" +#include "hi_common.h" +#include "hi_comm_video.h" + +#define VO_DEF_CHN_BUF_LEN 8 +#define VO_DEF_DISP_BUF_LEN 5 +#define VO_DEF_VIRT_BUF_LEN 3 +#define VO_DEF_WBC_DEPTH_LEN 8 + +#ifdef __cplusplus +#if __cplusplus +extern "C"{ +#endif +#endif /* End of #ifdef __cplusplus */ + +typedef enum hiEN_VOU_ERR_CODE_E +{ + EN_ERR_VO_DEV_NOT_CONFIG = 0x40, + EN_ERR_VO_DEV_NOT_ENABLE = 0x41, + EN_ERR_VO_DEV_HAS_ENABLED = 0x42, + EN_ERR_VO_DEV_HAS_BINDED = 0x43, + EN_ERR_VO_DEV_NOT_BINDED = 0x44, + + ERR_VO_NOT_ENABLE = 0x45, + ERR_VO_NOT_DISABLE = 0x46, + ERR_VO_NOT_CONFIG = 0x47, + + ERR_VO_CHN_NOT_DISABLE = 0x48, + ERR_VO_CHN_NOT_ENABLE = 0x49, + ERR_VO_CHN_NOT_CONFIG = 0x4a, + ERR_VO_CHN_NOT_ALLOC = 0x4b, + + ERR_VO_CCD_INVALID_PAT = 0x4c, + ERR_VO_CCD_INVALID_POS = 0x4d, + + ERR_VO_WAIT_TIMEOUT = 0x4e, + ERR_VO_INVALID_VFRAME = 0x4f, + ERR_VO_INVALID_RECT_PARA = 0x50, + ERR_VO_SETBEGIN_ALREADY = 0x51, + ERR_VO_SETBEGIN_NOTYET = 0x52, + ERR_VO_SETEND_ALREADY = 0x53, + ERR_VO_SETEND_NOTYET = 0x54, + + ERR_VO_GRP_INVALID_ID = 0x55, + ERR_VO_GRP_NOT_CREATE = 0x56, + ERR_VO_GRP_HAS_CREATED = 0x57, + ERR_VO_GRP_NOT_DESTROY = 0x58, + ERR_VO_GRP_CHN_FULL = 0x59, + ERR_VO_GRP_CHN_EMPTY = 0x5a, + ERR_VO_GRP_CHN_NOT_EMPTY = 0x5b, + ERR_VO_GRP_INVALID_SYN_MODE = 0x5c, + ERR_VO_GRP_INVALID_BASE_PTS = 0x5d, + ERR_VO_GRP_NOT_START = 0x5e, + ERR_VO_GRP_NOT_STOP = 0x5f, + ERR_VO_GRP_INVALID_FRMRATE = 0x60, + ERR_VO_GRP_CHN_HAS_REG = 0x61, + ERR_VO_GRP_CHN_NOT_REG = 0x62, + ERR_VO_GRP_CHN_NOT_UNREG = 0x63, + ERR_VO_GRP_BASE_NOT_CFG = 0x64, + + ERR_GFX_NOT_DISABLE = 0x65, + ERR_GFX_NOT_BIND = 0x66, + ERR_GFX_NOT_UNBIND = 0x67, + ERR_GFX_INVALID_ID = 0x68, + + ERR_VO_WBC_NOT_DISABLE = 0x69, + ERR_VO_WBC_NOT_CONFIG = 0x6a, + + ERR_VO_CHN_AREA_OVERLAP = 0x6b, + + /* new added */ + ERR_VO_BUTT + +}EN_VOU_ERR_CODE_E; + +/* System define error code */ +#define HI_ERR_VO_BUSY HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, EN_ERR_BUSY) +#define HI_ERR_VO_NO_MEM HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, EN_ERR_NOMEM) +#define HI_ERR_VO_NULL_PTR HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR) +#define HI_ERR_VO_SYS_NOTREADY HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY) +#define HI_ERR_VO_INVALID_DEVID HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_DEVID) +#define HI_ERR_VO_INVALID_CHNID HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_CHNID) +#define HI_ERR_VO_ILLEGAL_PARAM HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM) +#define HI_ERR_VO_NOT_SUPPORT HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_SUPPORT) +#define HI_ERR_VO_NOT_PERMIT HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM) + +/* device relative error code */ +#define HI_ERR_VO_DEV_NOT_CONFIG HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, EN_ERR_VO_DEV_NOT_CONFIG) +#define HI_ERR_VO_DEV_NOT_ENABLE HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, EN_ERR_VO_DEV_NOT_ENABLE) +#define HI_ERR_VO_DEV_HAS_ENABLED HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, EN_ERR_VO_DEV_HAS_ENABLED) +#define HI_ERR_VO_DEV_HAS_BINDED HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, EN_ERR_VO_DEV_HAS_BINDED) +#define HI_ERR_VO_DEV_NOT_BINDED HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, EN_ERR_VO_DEV_NOT_BINDED) + +/* video relative error code */ +#define HI_ERR_VO_VIDEO_NOT_ENABLE HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, ERR_VO_NOT_ENABLE) +#define HI_ERR_VO_VIDEO_NOT_DISABLE HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, ERR_VO_NOT_DISABLE) +#define HI_ERR_VO_VIDEO_NOT_CONFIG HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, ERR_VO_NOT_CONFIG) + +/*wbc error code*/ +#define HI_ERR_VO_WBC_NOT_DISABLE HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, ERR_VO_WBC_NOT_DISABLE) +#define HI_ERR_VO_WBC_NOT_CONFIG HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, ERR_VO_WBC_NOT_CONFIG) + + +/* channel relative error code */ +#define HI_ERR_VO_CHN_NOT_DISABLE HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, ERR_VO_CHN_NOT_DISABLE) +#define HI_ERR_VO_CHN_NOT_ENABLE HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, ERR_VO_CHN_NOT_ENABLE) +#define HI_ERR_VO_CHN_NOT_CONFIG HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, ERR_VO_CHN_NOT_CONFIG) +#define HI_ERR_VO_CHN_NOT_ALLOC HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, ERR_VO_CHN_NOT_ALLOC) +#define HI_ERR_VO_CHN_AREA_OVERLAP HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, ERR_VO_CHN_AREA_OVERLAP) + + +/* cascade relatvie error code */ +#define HI_ERR_VO_INVALID_PATTERN HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, ERR_VO_CCD_INVALID_PAT) +#define HI_ERR_VO_INVALID_POSITION HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, ERR_VO_CCD_INVALID_POS) + +/* misc */ +#define HI_ERR_VO_WAIT_TIMEOUT HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, ERR_VO_WAIT_TIMEOUT) +#define HI_ERR_VO_INVALID_VFRAME HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, ERR_VO_INVALID_VFRAME) +#define HI_ERR_VO_INVALID_RECT_PARA HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, ERR_VO_INVALID_RECT_PARA) +#define HI_ERR_VO_SETBEGIN_ALREADY HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, ERR_VO_SETBEGIN_ALREADY) +#define HI_ERR_VO_SETBEGIN_NOTYET HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, ERR_VO_SETBEGIN_NOTYET) +#define HI_ERR_VO_SETEND_ALREADY HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, ERR_VO_SETEND_ALREADY) +#define HI_ERR_VO_SETEND_NOTYET HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, ERR_VO_SETEND_NOTYET) + +/* sync group relative error code */ +#define HI_ERR_VO_GRP_INVALID_ID HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, ERR_VO_GRP_INVALID_ID) +#define HI_ERR_VO_GRP_NOT_CREATE HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, ERR_VO_GRP_NOT_CREATE) +#define HI_ERR_VO_GRP_HAS_CREATED HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, ERR_VO_GRP_HAS_CREATED) +#define HI_ERR_VO_GRP_NOT_DESTROY HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, ERR_VO_GRP_NOT_DESTROY) +#define HI_ERR_VO_GRP_CHN_FULL HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, ERR_VO_GRP_CHN_FULL) +#define HI_ERR_VO_GRP_CHN_EMPTY HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, ERR_VO_GRP_CHN_EMPTY) +#define HI_ERR_VO_GRP_CHN_NOT_EMPTY HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, ERR_VO_GRP_CHN_NOT_EMPTY) +#define HI_ERR_VO_GRP_INVALID_SYN_MODE HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, ERR_VO_GRP_INVALID_SYN_MODE) +#define HI_ERR_VO_GRP_INVALID_BASE_PTS HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, ERR_VO_GRP_INVALID_BASE_PTS) +#define HI_ERR_VO_GRP_NOT_START HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, ERR_VO_GRP_NOT_START) +#define HI_ERR_VO_GRP_NOT_STOP HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, ERR_VO_GRP_NOT_STOP) +#define HI_ERR_VO_GRP_INVALID_FRMRATE HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, ERR_VO_GRP_INVALID_FRMRATE) +#define HI_ERR_VO_GRP_CHN_HAS_REG HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, ERR_VO_GRP_CHN_HAS_REG) +#define HI_ERR_VO_GRP_CHN_NOT_REG HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, ERR_VO_GRP_CHN_NOT_REG) +#define HI_ERR_VO_GRP_CHN_NOT_UNREG HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, ERR_VO_GRP_CHN_NOT_UNREG) +#define HI_ERR_VO_GRP_BASE_NOT_CFG HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, ERR_VO_GRP_BASE_NOT_CFG) + + +/* graphics relative error code */ +#define HI_ERR_VO_GFX_NOT_DISABLE HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, ERR_GFX_NOT_DISABLE) +#define HI_ERR_VO_GFX_NOT_BIND HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, ERR_GFX_NOT_BIND) +#define HI_ERR_VO_GFX_NOT_UNBIND HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, ERR_GFX_NOT_UNBIND) +#define HI_ERR_VO_GFX_INVALID_ID HI_DEF_ERR(HI_ID_VOU, EN_ERR_LEVEL_ERROR, ERR_GFX_INVALID_ID) + +/* vo inteface type */ +#define VO_INTF_CVBS (0x01L<<0) +#define VO_INTF_YPBPR (0x01L<<1) +#define VO_INTF_VGA (0x01L<<2) +#define VO_INTF_BT656 (0x01L<<3) +#define VO_INTF_BT1120 (0x01L<<4) +#define VO_INTF_HDMI (0x01L<<5) +#define VO_INTF_LCD (0x01L<<6) +#define VO_INTF_BT656_H (0x01L<<7) +#define VO_INTF_BT656_L (0x01L<<8) + + +/* WBC channel id*/ +#define VO_WBC_CHN_ID (VO_MAX_CHN_NUM + 1) + +#define VO_DEFAULT_CHN -1 /* use vo buffer as pip buffer */ + +/***************************************************************************** + * 3520 ADDed + *****************************************************************************/ +typedef HI_S32 VO_INTF_TYPE_E; + +typedef HI_S32 VO_WBC_CHN; + +typedef enum hiVO_INTF_SYNC_E +{ + VO_OUTPUT_PAL = 0, + VO_OUTPUT_NTSC, + + VO_OUTPUT_1080P24, + VO_OUTPUT_1080P25, + VO_OUTPUT_1080P30, + + VO_OUTPUT_720P50, + VO_OUTPUT_720P60, + VO_OUTPUT_1080I50, + VO_OUTPUT_1080I60, + VO_OUTPUT_1080P50, + VO_OUTPUT_1080P60, + + VO_OUTPUT_576P50, + VO_OUTPUT_480P60, + + VO_OUTPUT_800x600_60, /* VESA 800 x 600 at 60 Hz (non-interlaced) */ + VO_OUTPUT_1024x768_60, /* VESA 1024 x 768 at 60 Hz (non-interlaced) */ + VO_OUTPUT_1280x1024_60, /* VESA 1280 x 1024 at 60 Hz (non-interlaced) */ + VO_OUTPUT_1366x768_60, /* VESA 1366 x 768 at 60 Hz (non-interlaced) */ + VO_OUTPUT_1440x900_60, /* VESA 1440 x 900 at 60 Hz (non-interlaced) CVT Compliant */ + VO_OUTPUT_1280x800_60, /* 1280*800@60Hz VGA@60Hz*/ + VO_OUTPUT_1600x1200_60, /* VESA 1600 x 1200 at 60 Hz (non-interlaced) */ + VO_OUTPUT_1680x1050_60, /* VESA 1680 x 1050 at 60 Hz (non-interlaced) */ + VO_OUTPUT_1920x1200_60, /* VESA 1920 x 1600 at 60 Hz (non-interlaced) CVT (Reduced Blanking)*/ + VO_OUTPUT_640x480_60, /* VESA 640 x 480 at 60 Hz (non-interlaced) CVT */ + VO_OUTPUT_1920x2160_30, /* 1920x2160_30 */ + VO_OUTPUT_2560x1440_30, /* 2560x1440_30 */ + VO_OUTPUT_USER, + VO_OUTPUT_BUTT + +} VO_INTF_SYNC_E; + +typedef enum hiVO_SCREEN_HFILTER_E +{ + VO_SCREEN_HFILTER_DEF = 0, + VO_SCREEN_HFILTER_8M, + VO_SCREEN_HFILTER_6M, + VO_SCREEN_HFILTER_5M, + VO_SCREEN_HFILTER_4M, + VO_SCREEN_HFILTER_3M, + VO_SCREEN_HFILTER_2M, + VO_SCREEN_HFILTER_BUTT + +} VO_SCREEN_HFILTER_E; + +typedef enum hiVO_SCREEN_VFILTER_E +{ + VO_SCREEN_VFILTER_DEF = 0, + VO_SCREEN_VFILTER_8M, + VO_SCREEN_VFILTER_6M, + VO_SCREEN_VFILTER_5M, + VO_SCREEN_VFILTER_4M, + VO_SCREEN_VFILTER_3M, + VO_SCREEN_VFILTER_2M, + VO_SCREEN_VFILTER_BUTT + +} VO_SCREEN_VFILTER_E; + +typedef enum hiVO_DISPLAY_FIELD_E +{ + VO_FIELD_TOP, /* top field*/ + VO_FIELD_BOTTOM, /* bottom field*/ + VO_FIELD_BOTH, /* top and bottom field*/ + VO_FIELD_BUTT +} VO_DISPLAY_FIELD_E; + +typedef enum hiVOU_LAYER_DDR_E +{ + VOU_LAYER_DDR0 = 0, + VOU_LAYER_DDR1 = 1, + VOU_LAYER_DDR_BUTT +}VOU_LAYER_DDR_E; + +typedef enum hiVOU_ZOOM_IN_E +{ + VOU_ZOOM_IN_RECT = 0, /* zoom in by rect */ + VOU_ZOOM_IN_RATIO, /* zoom in by ratio */ + VOU_ZOOM_IN_BUTT +} VOU_ZOOM_IN_E; + +typedef enum hiVO_CSC_MATRIX_E +{ + VO_CSC_MATRIX_IDENTITY = 0, + + VO_CSC_MATRIX_BT601_TO_BT709, + VO_CSC_MATRIX_BT709_TO_BT601, + + VO_CSC_MATRIX_BT601_TO_RGB_PC, + VO_CSC_MATRIX_BT709_TO_RGB_PC, + + VO_CSC_MATRIX_RGB_TO_BT601_PC, + VO_CSC_MATRIX_RGB_TO_BT709_PC, + + VO_CSC_MATRIX_BUTT +} VO_CSC_MATRIX_E; + +typedef struct hiVO_CHN_ATTR_S +{ + HI_U32 u32Priority; /* video out overlay pri */ + RECT_S stRect; /* rect of video out chn */ + HI_BOOL bDeflicker; /* deflicker or not */ +}VO_CHN_ATTR_S; + +typedef struct hiVO_QUERY_STATUS_S +{ + HI_U32 u32ChnBufUsed; /* channel buffer that been occupied */ +} VO_QUERY_STATUS_S; + +typedef struct hiVO_SRC_ATTR_S +{ + HI_BOOL bInterlaced; /* interlaced source */ +} VO_SRC_ATTR_S; + +typedef struct hiVO_SCALE_FILTER_S +{ + VO_SCREEN_HFILTER_E enHFilter; + VO_SCREEN_VFILTER_E enVFilter; + +} VO_SCREEN_FILTER_S; + +typedef struct tagVO_SYNC_INFO_S +{ + HI_BOOL bSynm; /* sync mode(0:timing,as BT.656; 1:signal,as LCD) */ + HI_BOOL bIop; /* interlaced or progressive display(0:i; 1:p) */ + HI_U8 u8Intfb; /* interlace bit width while output */ + + HI_U16 u16Vact ; /* vertical active area */ + HI_U16 u16Vbb; /* vertical back blank porch */ + HI_U16 u16Vfb; /* vertical front blank porch */ + + HI_U16 u16Hact; /* herizontal active area */ + HI_U16 u16Hbb; /* herizontal back blank porch */ + HI_U16 u16Hfb; /* herizontal front blank porch */ + HI_U16 u16Hmid; /* bottom herizontal active area */ + + HI_U16 u16Bvact; /* bottom vertical active area */ + HI_U16 u16Bvbb; /* bottom vertical back blank porch */ + HI_U16 u16Bvfb; /* bottom vertical front blank porch */ + + HI_U16 u16Hpw; /* horizontal pulse width */ + HI_U16 u16Vpw; /* vertical pulse width */ + + HI_BOOL bIdv; /* inverse data valid of output */ + HI_BOOL bIhs; /* inverse horizontal synch signal */ + HI_BOOL bIvs; /* inverse vertical synch signal */ + +} VO_SYNC_INFO_S; + +typedef struct hiVO_PUB_ATTR_S +{ + HI_U32 u32BgColor; /* Background color of a device, in RGB format. */ + VO_INTF_TYPE_E enIntfType; /* Type of a VO interface */ + VO_INTF_SYNC_E enIntfSync; /* Type of a VO interface timing */ + VO_SYNC_INFO_S stSyncInfo; /* Information about VO interface timings */ + HI_BOOL bDoubleFrame; /* Whether to double frames */ +} VO_PUB_ATTR_S; + +typedef enum hiVO_WBC_DATASOURCE_E +{ + VO_WBC_DATASOURCE_MIXER = 0, /* WBC data source is a mixer of layer and graphics*/ + VO_WBC_DATASOURCE_VIDEO, /* WBC data source only from layer*/ + VO_WBC_DATASOURCE_BUTT, +} VO_WBC_DATASOURCE_E; + + +typedef struct hiVO_WBC_ATTR_S +{ + SIZE_S stTargetSize; /* WBC Zoom target size */ + PIXEL_FORMAT_E enPixelFormat; /* the pixel format of WBC output */ + HI_U32 u32FrameRate; /* frame rate control */ + VO_WBC_DATASOURCE_E enDataSource; /* WBC data source*/ +} VO_WBC_ATTR_S; + +typedef enum hiVO_WBC_MODE_E +{ + VO_WBC_MODE_NOMAL = 0, /* In this mode, wbc will capture frames according to dev frame rate + and wbc frame rate */ + VO_WBC_MODE_DROP_REPEAT, /* In this mode, wbc will drop dev repeat frame, and capture the real frame + according to video layer's display rate and wbc frame rate */ + VO_WBC_MODE_PROG_TO_INTL, /* In this mode, wbc will drop dev repeat frame which repeats more than 3 times, + and change two progressive frames to one interlace frame */ + + VO_WBC_MODE_BUTT, +} VO_WBC_MODE_E; + +typedef enum hiVO_CAS_MODE_E +{ + VO_CAS_MODE_SINGLE = 0, + VO_CAS_MODE_DUAL, + VO_CAS_MODE_BUTT, +} VO_CAS_MODE_E; + +typedef enum hiVO_CAS_RGN_E +{ + VO_CAS_64_RGN = 0, + VO_CAS_32_RGN, + VO_CAS_RGN_BUTT, +} VO_CAS_RGN_E; + +typedef struct hiVO_CAS_ATTR_S +{ + HI_BOOL bSlave; + VO_CAS_RGN_E enCasRgn; + VO_CAS_MODE_E enCasMode; +} VO_CAS_ATTR_S; + +typedef struct hiVO_WBC_ATTR_S_1 +{ + VO_DEV VoSourceDev; /* WBC source is from which Dev */ + SIZE_S stTargetSize; /* WBC Zoom target size */ + PIXEL_FORMAT_E enPixelFormat; /* the pixel format of WBC output */ +} VO_WBC_ATTR_S_1; + + +typedef struct hiVO_WBC_ATTR_S_2 +{ + VO_CHN VoWbcChn; /* Wbc Channel id */ + SIZE_S stTargetSize; /* WBC Zoom target size */ + PIXEL_FORMAT_E enPixelFormat; /* the pixel format of WBC output */ +} VO_WBC_ATTR_S_2; + +typedef struct hiVO_WBC_ATTR_S_3 +{ + SIZE_S stTargetSize; /* WBC Zoom target size */ + PIXEL_FORMAT_E enPixelFormat; /* the pixel format of WBC output */ +} VO_WBC_ATTR_TEMP_S_3; + +typedef struct hiVO_VIDEO_LAYER_ATTR_S +{ + RECT_S stDispRect; /* Display resolution */ + SIZE_S stImageSize; /* Canvas size of the video layer */ + HI_U32 u32DispFrmRt; /* Display frame rate */ + PIXEL_FORMAT_E enPixFormat; /* Pixel format of the video layer */ +} VO_VIDEO_LAYER_ATTR_S; + +typedef struct hiVO_ZOOM_RATIO_S +{ + HI_U32 u32XRatio; + HI_U32 u32YRatio; + HI_U32 u32WRatio; + HI_U32 u32HRatio; +} VO_ZOOM_RATIO_S; + +typedef struct hiVO_ZOOM_ATTR_S +{ + VOU_ZOOM_IN_E enZoomType; /* choose the type of zoom in */ + union + { + RECT_S stZoomRect; /* zoom in by rect */ + VO_ZOOM_RATIO_S stZoomRatio; /* zoom in by ratio */ + }; +} VO_ZOOM_ATTR_S; + +typedef struct hiVO_CSC_S +{ + VO_CSC_MATRIX_E enCscMatrix; + HI_U32 u32Luma; /* luminance: 0 ~ 100 */ + HI_U32 u32Contrast; /* contrast : 0 ~ 100 */ + HI_U32 u32Hue; /* hue : 0 ~ 100 */ + HI_U32 u32Satuature; /* satuature: 0 ~ 100 */ +} VO_CSC_S; + +typedef struct hiVO_VGA_PARAM_S +{ + VO_CSC_MATRIX_E enCscMatrix; + HI_U32 u32Luma; /* luminance: 0 ~ 100 */ + HI_U32 u32Contrast; /* contrast : 0 ~ 100 */ + HI_U32 u32Hue; /* hue : 0 ~ 100 */ + HI_U32 u32Satuature; /* satuature: 0 ~ 100 */ + HI_U32 u32Gain; /* current gain of VGA signals. [0, 64). */ +} VO_VGA_PARAM_S; + +typedef struct hiVO_USR_SEND_TIMEOUT_S +{ + VIDEO_FRAME_INFO_S stVFrame; + HI_U32 u32MilliSec; +} VO_USR_SEND_TIMEOUT_S; + +typedef enum hiVOU_GFX_BIND_LAYER_E +{ + GRAPHICS_LAYER_G4 = 0, + GRAPHICS_LAYER_HC0, + GRAPHICS_LAYER_HC1, + GRAPHICS_LAYER_BUTT +}VOU_GFX_BIND_LAYER_E; + + + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif /* End of #ifdef __cplusplus */ + +#endif /* End of #ifndef __HI_COMM_VO_H__ */ + diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_vpss.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_vpss.h new file mode 100644 index 0000000000..fabc9e8f03 --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_comm_vpss.h @@ -0,0 +1,284 @@ + +/****************************************************************************** + + Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. + + ****************************************************************************** + File Name : hi_comm_vpss.h + Version : Initial Draft + Author : Hisilicon multimedia software group + Created : + Last Modified : + Description : common struct definition for vpss + Function List : + History : + 1.Date : 2011/6/16 + Author : h105449/l183122/w63830 + Modification: Create + + +******************************************************************************/ + +#ifndef __HI_COMM_VPSS_H__ +#define __HI_COMM_VPSS_H__ + + +#ifdef __cplusplus +#if __cplusplus +extern "C"{ +#endif +#endif /* __cplusplus */ + +#include "hi_type.h" +#include "hi_common.h" +#include "hi_errno.h" +#include "hi_comm_video.h" + +#define HI_ERR_VPSS_NULL_PTR HI_DEF_ERR(HI_ID_VPSS, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR) +#define HI_ERR_VPSS_NOTREADY HI_DEF_ERR(HI_ID_VPSS, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY) +#define HI_ERR_VPSS_INVALID_DEVID HI_DEF_ERR(HI_ID_VPSS, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_DEVID) +#define HI_ERR_VPSS_INVALID_CHNID HI_DEF_ERR(HI_ID_VPSS, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_CHNID) +#define HI_ERR_VPSS_EXIST HI_DEF_ERR(HI_ID_VPSS, EN_ERR_LEVEL_ERROR, EN_ERR_EXIST) +#define HI_ERR_VPSS_UNEXIST HI_DEF_ERR(HI_ID_VPSS, EN_ERR_LEVEL_ERROR, EN_ERR_UNEXIST) +#define HI_ERR_VPSS_NOT_SUPPORT HI_DEF_ERR(HI_ID_VPSS, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_SUPPORT) +#define HI_ERR_VPSS_NOT_PERM HI_DEF_ERR(HI_ID_VPSS, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM) +#define HI_ERR_VPSS_NOMEM HI_DEF_ERR(HI_ID_VPSS, EN_ERR_LEVEL_ERROR, EN_ERR_NOMEM) +#define HI_ERR_VPSS_NOBUF HI_DEF_ERR(HI_ID_VPSS, EN_ERR_LEVEL_ERROR, EN_ERR_NOBUF) +#define HI_ERR_VPSS_ILLEGAL_PARAM HI_DEF_ERR(HI_ID_VPSS, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM) +#define HI_ERR_VPSS_BUSY HI_DEF_ERR(HI_ID_VPSS, EN_ERR_LEVEL_ERROR, EN_ERR_BUSY) + +typedef HI_S32 VPSS_GRP; +typedef HI_S32 VPSS_CHN; + +/*Define 4 video frame*/ +typedef enum HI_VPSS_FRAME_WORK_E +{ + VPSS_FRAME_WORK_LEFT = 0, + VPSS_FRAME_WORK_RIGHT = 1, + VPSS_FRAME_WORK_BOTTOM = 2, + VPSS_FRAME_WORK_TOP = 3, + VPSS_FRAME_WORK_BUTT +}VPSS_FRAME_WORK_E; + +/*Define de-interlace mode*/ +typedef enum HI_VPSS_DIE_MODE_E +{ + VPSS_DIE_MODE_AUTO = 0, + VPSS_DIE_MODE_NODIE = 1, + VPSS_DIE_MODE_DIE = 2, + VPSS_DIE_MODE_BUTT +}VPSS_DIE_MODE_E; + +/*Define size of space filter window */ +typedef enum HI_VPSS_SF_WINDOW_E +{ + VPSS_SF_WINDOW_3X3 = 0, + VPSS_SF_WINDOW_5X5 = 1, + VPSS_SF_WINDOW_7X7 = 2, + VPSS_SF_WINDOW_9X9 = 3, + VPSS_SF_WINDOW_BUTT +}VPSS_SF_WINDOW_E; + +/*Define display mode*/ +typedef enum HI_VPSS_DISPLAY_MODE_E +{ + VPSS_DISPLAY_MODE_TV = 0, + VPSS_DISPLAY_MODE_PC = 1, + VPSS_DISPLAY_MODE +}VPSS_DISPLAY_MODE_E; + +/*Define attributes of video frame*/ +typedef struct HI_VPSS_FRAME_S +{ + HI_U32 u32Width[VPSS_FRAME_WORK_BUTT]; /*Width of 4 frames,0:L,1:R,2:B,3:T*/ + HI_U32 u32Color[VPSS_FRAME_WORK_BUTT]; /*Color of 4 frames,R/G/B*/ +}VPSS_FRAME_S; + +/*Define attributes of vpss channel*/ +typedef struct HI_VPSS_CHN_ATTR_S +{ + HI_BOOL bSpEn; + HI_BOOL bFrameEn; + VPSS_FRAME_S stFrame; +}VPSS_CHN_ATTR_S; + +/*Defined detailed image quality debug param*/ +typedef struct HI_VPSS_IMG_QUALITY_PARAM_S +{ + HI_U32 u32SfStrength0; + HI_U32 u32SfStrength1; + HI_U32 u32SfStrength2; + HI_U32 u32TfStrength; + HI_U32 u32SfPostFlag; + HI_U32 u32TfyProfile; + HI_U32 u32CStrength; + HI_U32 u32CMADSlope; + HI_U32 u32CMADThresh; + HI_U32 u32Reserved[6]; +}VPSS_IMG_QUALITY_PARAM_S; + +/*Defined private image quality debug config struct*/ +typedef struct HI_VPSS_IMG_QUALITY_CFG_S +{ + HI_BOOL bEnable; + VPSS_IMG_QUALITY_PARAM_S stImageQualityParam; +}VPSS_IMG_QUALITY_CFG_S; + +/*Define detailed params for group image process*/ +typedef struct HI_VPSS_GRP_PARAM_S +{ + HI_U32 u32Luminance; /*Luminance*/ + HI_U32 u32Contrast; /*Contrast*/ + HI_U32 u32DarkEnhance; /*Dark region enhancement*/ + HI_U32 u32BrightEnhance;/*Light region enhancement*/ + HI_U32 u32IeStrength; /*IE strength*/ + HI_U32 u32IeSharp; /*IE sharpness*/ + HI_U32 u32SfStrength; /*Strength of space filter*/ + HI_U32 u32TfStrength; /*Strength of space filter*/ + HI_U32 u32MotionThresh; /*Motion judgment threshold*/ + HI_U32 u32DiStrength; /*de-interlace strength*/ + HI_U32 u32ChromaRange; /*Chrominance amplitude*/ + HI_U32 u32NrWforTsr; /*Time filtering weight*/ + VPSS_SF_WINDOW_E enSfWindow; /*Size of the space filter window*/ + VPSS_DISPLAY_MODE_E enDisMode;/*Display mode*/ +}VPSS_GRP_PARAM_S; + +/* Define image feild select mode */ +typedef enum hiVPSS_CAPSEL_E +{ + VPSS_CAPSEL_BOTH = 0, /* top and bottom field */ + VPSS_CAPSEL_TOP, /* top field */ + VPSS_CAPSEL_BOTTOM, /* bottom field */ + + VPSS_CAPSEL_BUTT +} VPSS_CAPSEL_E; +/*Define coordinate mode*/ +typedef enum HI_VPSS_CROP_COORDINATE_E +{ + VPSS_CROP_RITIO_COOR = 0, /*Ratio coordinate*/ + VPSS_CROP_ABS_COOR /*Absolute coordinate*/ +}VPSS_CROP_COORDINATE_E; + +/*Define attributes of CLIP function*/ +typedef struct HI_VPSS_CROP_INFO_S +{ + HI_BOOL bEnable; /*CROP enable*/ + VPSS_CROP_COORDINATE_E enCropCoordinate; /*Coordinate mode of the crop start point*/ + RECT_S stCropRect; /*CROP rectangular*/ + VPSS_CAPSEL_E enCapSel; /*field select*/ +}VPSS_CROP_INFO_S; + +/*Define attributes of vpss GROUP*/ +typedef struct HI_VPSS_GRP_ATTR_S +{ + /*statistic attributes*/ + HI_U32 u32MaxW; + HI_U32 u32MaxH; + PIXEL_FORMAT_E enPixFmt; + + /*dynamic attributes*/ + HI_BOOL bDrEn; + HI_BOOL bDbEn; + HI_BOOL bIeEn; + HI_BOOL bNrEn; + HI_BOOL bHistEn; + VPSS_DIE_MODE_E enDieMode; +}VPSS_GRP_ATTR_S; + +/*Define vpss channel's work mode*/ +typedef enum HI_VPSS_CHN_MODE_E +{ + VPSS_CHN_MODE_AUTO = 0, /*Auto mode*/ + VPSS_CHN_MODE_USER /*User mode*/ +}VPSS_CHN_MODE_E; + +/*Define attributes of vpss channel's work mode*/ +typedef struct HI_VPSS_CHN_MODE_S +{ + VPSS_CHN_MODE_E enChnMode; /*Vpss channel's work mode*/ + HI_U32 u32Width; /*Width of target image*/ + HI_U32 u32Height; /*Height of target image*/ + HI_BOOL bDouble; /*Field-frame transfer£¬only valid for VPSS_PRE0_CHN*/ + PIXEL_FORMAT_E enPixelFormat;/*Pixel format of target image*/ +}VPSS_CHN_MODE_S; + +typedef struct HI_VPSS_FRAME_TIMEOUT_S +{ + VIDEO_FRAME_INFO_S stVideoFrame; + HI_U32 u32MilliSec; +}VPSS_FRAME_TIMEOUT_S; + +typedef struct HI_VPSS_GET_GRP_FRAME_S +{ + HI_U32 u32FrameIndex; + VIDEO_FRAME_INFO_S *pstVideoFrame; +}VPSS_GET_GRP_FRAME_S; + +/*********************************************************************************************/ + +/*Define detailed NR params for channel image process*/ +typedef struct +{ + HI_U32 u32SfStrength; /*Strength of space filter*/ + HI_U32 u32TfStrength; /*Strength of space filter*/ + HI_U32 u32MotionThresh; /*Motion judgment threshold*/ + HI_U32 u32ChromaRange; /*Chrominance amplitude*/ + HI_U32 u32NrWforTsr; /*Time filtering weight*/ +}VPSS_CHN_NR_PARAM_S; + +/*Define detailed SP params for channel image process*/ +typedef struct +{ + HI_U32 u32LumaGain; /*Luma gain of sharp function*/ +}VPSS_CHN_SP_PARAM_S; + +/*Define detailed params for channel image process*/ +typedef struct +{ + VPSS_CHN_SP_PARAM_S stVpssChnSpParam; /*Luma gain of sharp function*/ + VPSS_CHN_NR_PARAM_S stVpssChnNrParam; +} VPSS_CHN_PARAM_S; + +/*Define vpss prescale info*/ +typedef struct +{ + HI_BOOL bPreScale; /*prescale enable*/ + VPSS_CAPSEL_E enCapSel; /*feild select*/ + SIZE_S stDestSize; /*destination size*/ +}VPSS_PRESCALE_INFO_S; + +/*Define vpss filter info*/ +typedef struct +{ + HI_BOOL bSizer; + SIZE_S stSize; +}VPSS_SIZER_INFO_S; + +/*Define vpss frame control info*/ +typedef struct +{ + HI_S32 s32SrcFrmRate; /* Input frame rate of a group*/ + HI_S32 s32DstFrmRate; /* Output frame rate of a channel group */ +} VPSS_FRAME_RATE_S; + +/*********************************************************************************************/ + +/*Define attributes of vpss extend channel*/ +typedef struct HI_VPSS_EXT_CHN_ATTR_S +{ + VPSS_CHN s32BindChn; /*channel bind to*/ + HI_U32 u32Width; /*Width of target image*/ + HI_U32 u32Height; /*Height of target image*/ + HI_S32 s32SrcFrameRate; /*Frame rate of source*/ + HI_S32 s32DstFrameRate; /*Frame rate of extend chn input&output*/ + PIXEL_FORMAT_E enPixelFormat; /*Pixel format of target image*/ +}VPSS_EXT_CHN_ATTR_S; + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif /* __cplusplus */ +#endif /* __HI_COMM_VPSS_H__ */ + + diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_common.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_common.h new file mode 100644 index 0000000000..5a0cfc38cb --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_common.h @@ -0,0 +1,452 @@ +/****************************************************************************** +Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. +****************************************************************************** +File Name : hi_common.h +Version : Initial Draft +Author : Hi3511 MPP Team +Created : 2006/11/09 +Last Modified : +Description : The common defination +Function List : +History : + 1.Date : 2009/03/03 + Author : z44949 + Modification: Created file +2.Date : 2009/07/01 + Author : z44949 + Modification: Move MPP_VER_PRIX to hi_defines.h +3.Date : 2009/08/13 + Author : y45339 + Modification: add some proc define + +4.Date : 2010/11/03 + Author : z44949 + Modification: Remove some unnecessary typedef + +******************************************************************************/ +#ifndef __HI_COMMON_H__ +#define __HI_COMMON_H__ + +#include "hi_type.h" +#include "hi_math.h" +#include "hi_defines.h" +#include "hi_comm_video.h" + +#ifdef __cplusplus +#if __cplusplus +extern "C"{ +#endif +#endif /* End of #ifdef __cplusplus */ + +#ifndef VER_X + #define VER_X 1 +#endif + +#ifndef VER_Y + #define VER_Y 0 +#endif + +#ifndef VER_Z + #define VER_Z 0 +#endif + +#ifndef VER_P + #define VER_P 0 +#endif + +#ifdef HI_DEBUG + #define VER_D " " +#else + #define VER_D " Release" +#endif + +#define __MK_VERSION(x,y,z,p) #x"."#y"."#z"."#p +#define MK_VERSION(x,y,z,p) __MK_VERSION(x,y,z,p) +#define MPP_VERSION CHIP_NAME MPP_VER_PRIX MK_VERSION(VER_X,VER_Y,VER_Z,VER_P) VER_D +#define COM_VERSION MPP_VER_PRIX MK_VERSION(VER_X,VER_Y,VER_Z,VER_P) VER_D + +#define VERSION_NAME_MAXLEN 64 +typedef struct hiMPP_VERSION_S +{ + HI_CHAR aVersion[VERSION_NAME_MAXLEN]; +}MPP_VERSION_S; + +typedef struct hiPOINT_S +{ + HI_S32 s32X; + HI_S32 s32Y; +}POINT_S; + +typedef struct hiSIZE_S +{ + HI_U32 u32Width; + HI_U32 u32Height; +} SIZE_S; + +typedef struct hiRECT_S +{ + HI_S32 s32X; + HI_S32 s32Y; + HI_U32 u32Width; + HI_U32 u32Height; +}RECT_S; + +typedef enum hiROTATE_E +{ + ROTATE_NONE = 0, + ROTATE_90 = 1, + ROTATE_180 = 2, + ROTATE_270 = 3, + ROTATE_BUTT +} ROTATE_E; + +typedef HI_S32 AI_CHN; +typedef HI_S32 AO_CHN; +typedef HI_S32 AENC_CHN; +typedef HI_S32 ADEC_CHN; +typedef HI_S32 AUDIO_DEV; +typedef HI_S32 AVENC_CHN; +typedef HI_S32 VI_DEV; +typedef HI_S32 VI_WAY; +typedef HI_S32 VI_CHN; +typedef HI_S32 VO_DEV; +typedef HI_S32 VO_LAYER; +typedef HI_S32 VO_CHN; +typedef HI_S32 VENC_CHN; +typedef HI_S32 VDEC_CHN; +typedef HI_S32 VENC_GRP; +typedef HI_S32 VO_GRP; +typedef HI_S32 VDA_CHN; +typedef HI_S32 IVE_HANDLE; +typedef HI_S32 ISP_DEV; +typedef HI_S32 SENSOR_ID; + +#define HI_INVALID_CHN (-1) +#define HI_INVALID_WAY (-1) +#define HI_INVALID_LAYER (-1) +#define HI_INVALID_DEV (-1) +#define HI_INVALID_HANDLE (-1) + +#define HI_INVALID_VALUE (-1) +#define HI_INVALID_TYPE (-1) + +typedef enum hiMOD_ID_E +{ + HI_ID_CMPI = 0, + HI_ID_VB = 1, + HI_ID_SYS = 2, + HI_ID_VALG = 3, + +#if 1 + /* + VDECÄÚ²¿»á´´½¨VB Pool, VDECÏú»ÙµÄʱºòÏú»ÙVB Pool, + µ«ÊÇÈç¹ûÆäËûÄ£¿éʹÓÃÁËÕâ¸öͼÏñ, Ïú»ÙµÄʱºòVB--»á±¨´í; + ËùÒÔVDECÄ£¿éÒªµÈÆäËûÄ£¿éÏú»ÙÖ®ºóÔÙÏú»Ù f65132×¢ + + ctrl+cÍ˳öʱÈç¹ûÏÈÏú»ÙCHNLÔÙÍ˳öVDEC,ÔòVDECÍ˳öʱ»áunregister CHNL£¬ + Òò´ËʱCHNLÒѱ»Ïú»Ù£¬ËùÒÔunregister²»³É¹¦£¬´òÓ¡³ö´íÐÅÏ¢¡£ + Ϊ½â¾öÕâ¸öÎÊÌ⣬ÐèÒª°ÑCHNLºÍVDECµÄid˳Ðò»¥»» + */ + HI_ID_CHNL = 4, + HI_ID_VDEC = 5, + HI_ID_GROUP = 6, + HI_ID_VENC = 7, + HI_ID_VPSS = 8, + HI_ID_VDA = 9, + + HI_ID_H264E = 10, + HI_ID_JPEGE = 11, + HI_ID_MPEG4E = 12, +#else + + HI_ID_CHNL = 4, + HI_ID_GROUP = 5, + HI_ID_VENC = 6, + HI_ID_VPSS = 7, + HI_ID_VDA = 8, + + HI_ID_H264E = 9, + HI_ID_JPEGE = 10, + HI_ID_MPEG4E = 11, + + HI_ID_VDEC = 12, +#endif + HI_ID_H264D = 13, + HI_ID_JPEGD = 14, + HI_ID_VOU = 15, + + HI_ID_VIU = 16, + HI_ID_DSU = 17, + HI_ID_RGN = 18, + HI_ID_RC = 19, + + HI_ID_SIO = 20, + HI_ID_AI = 21, + HI_ID_AO = 22, + HI_ID_AENC = 23, + HI_ID_ADEC = 24, + + HI_ID_AVENC = 25, + + HI_ID_PCIV = 26, + HI_ID_PCIVFMW = 27, + + HI_ID_ISP = 28, + + HI_ID_IVE = 29, + /* there is a hole */ + + HI_ID_DCCM = 31, + HI_ID_DCCS = 32, + + HI_ID_PROC = 33, + HI_ID_LOG = 34, + HI_ID_MST_LOG = 35, + HI_ID_VD = 36, + + HI_ID_VCMP = 38, + HI_ID_FB = 39, + + + HI_ID_HDMI = 40, + HI_ID_VOIE = 41, + HI_ID_TDE = 42, + + HI_ID_USR = 43, + + HI_ID_VEDU = 44, + + HI_ID_BUTT, +} MOD_ID_E; + +typedef struct hiMPP_CHN_S +{ + MOD_ID_E enModId; + HI_S32 s32DevId; + HI_S32 s32ChnId; +} MPP_CHN_S; + +#define MPP_MOD_VIU "vi" +#define MPP_MOD_VOU "vo" +#define MPP_MOD_HDMI "hdmi" +#define MPP_MOD_DSU "dsu" + +#define MPP_MOD_CHNL "chnl" +#define MPP_MOD_VENC "venc" +#define MPP_MOD_GRP "grp" +#define MPP_MOD_VDA "vda" +#define MPP_MOD_VPSS "vpss" +#define MPP_MOD_RGN "rgn" +#define MPP_MOD_IVE "ive" + +#define MPP_MOD_H264E "h264e" +#define MPP_MOD_JPEGE "jpege" +#define MPP_MOD_MPEG4E "mpeg4e" + +#define MPP_MOD_VDEC "vdec" +#define MPP_MOD_H264D "h264d" +#define MPP_MOD_JPEGD "jpegd" + +#define MPP_MOD_AI "ai" +#define MPP_MOD_AO "ao" +#define MPP_MOD_AENC "aenc" +#define MPP_MOD_ADEC "adec" +#define MPP_MOD_SIO "sio" + +#define MPP_MOD_VB "vb" +#define MPP_MOD_SYS "sys" +#define MPP_MOD_CMPI "cmpi" + +#define MPP_MOD_PCIV "pciv" +#define MPP_MOD_PCIVFMW "pcivfmw" + +#define MPP_MOD_PROC "proc" +#define MPP_MOD_LOG "logmpp" +#define MPP_MOD_MST_LOG "mstlog" + +#define MPP_MOD_DCCM "dccm" +#define MPP_MOD_DCCS "dccs" + +#define MPP_MOD_VCMP "vcmp" +#define MPP_MOD_FB "fb" + +#define MPP_MOD_RC "rc" + +#define MPP_MOD_VOIE "voie" + +#define MPP_MOD_TDE "tde" +#define MPP_MOD_ISP "isp" +#define MPP_MOD_ACODEC "acodec" + +/* We just coyp this value of payload type from RTP/RTSP definition */ +typedef enum +{ + PT_PCMU = 0, + PT_1016 = 1, + PT_G721 = 2, + PT_GSM = 3, + PT_G723 = 4, + PT_DVI4_8K = 5, + PT_DVI4_16K = 6, + PT_LPC = 7, + PT_PCMA = 8, + PT_G722 = 9, + PT_S16BE_STEREO = 10, + PT_S16BE_MONO = 11, + PT_QCELP = 12, + PT_CN = 13, + PT_MPEGAUDIO = 14, + PT_G728 = 15, + PT_DVI4_3 = 16, + PT_DVI4_4 = 17, + PT_G729 = 18, + PT_G711A = 19, + PT_G711U = 20, + PT_G726 = 21, + PT_G729A = 22, + PT_LPCM = 23, + PT_CelB = 25, + PT_JPEG = 26, + PT_CUSM = 27, + PT_NV = 28, + PT_PICW = 29, + PT_CPV = 30, + PT_H261 = 31, + PT_MPEGVIDEO = 32, + PT_MPEG2TS = 33, + PT_H263 = 34, + PT_SPEG = 35, + PT_MPEG2VIDEO = 36, + PT_AAC = 37, + PT_WMA9STD = 38, + PT_HEAAC = 39, + PT_PCM_VOICE = 40, + PT_PCM_AUDIO = 41, + PT_AACLC = 42, + PT_MP3 = 43, + PT_ADPCMA = 49, + PT_AEC = 50, + PT_X_LD = 95, + PT_H264 = 96, + PT_D_GSM_HR = 200, + PT_D_GSM_EFR = 201, + PT_D_L8 = 202, + PT_D_RED = 203, + PT_D_VDVI = 204, + PT_D_BT656 = 220, + PT_D_H263_1998 = 221, + PT_D_MP1S = 222, + PT_D_MP2P = 223, + PT_D_BMPEG = 224, + PT_MP4VIDEO = 230, + PT_MP4AUDIO = 237, + PT_VC1 = 238, + PT_JVC_ASF = 255, + PT_D_AVI = 256, + PT_DIVX3 = 257, + PT_AVS = 258, + PT_REAL8 = 259, + PT_REAL9 = 260, + PT_VP6 = 261, + PT_VP6F = 262, + PT_VP6A = 263, + PT_SORENSON =264, + PT_MAX = 265, + /* add by hisilicon */ + PT_AMR = 1001, + PT_MJPEG = 1002, + PT_AMRWB = 1003, + PT_BUTT +}PAYLOAD_TYPE_E; + +typedef enum hiVOU_WHO_SENDPIC_E +{ + VOU_WHO_SENDPIC_VIU = 0, + VOU_WHO_SENDPIC_VDEC = 1, + VOU_WHO_SENDPIC_PCIV = 2, + VOU_WHO_SENDPIC_VPP = 3, + VOU_WHO_SENDPIC_USR = 4, + VOU_WHO_SENDPIC_BUTT +} VOU_WHO_SENDPIC_E; + +#if 1 +//Â˲¨ÏµÊýµÄ¶¨Òå¿ÉÄÜÓëоƬÓйأ¬¾ßÌåʵÏÖʱÔÙ¿¼ÂÇ·ÅÔÚÄÄÀï +/* horizontal scale filter coefficient of dsu +** which affect image quality of encoding and preview. + +** normally the filter can be set be DSU_HSCALE_FILTER_DEFAULT +** which means sdk will choose filter automatically.Otherwise, +** you can choose other filter + +** Notes:65M means 6.5 +*/ +typedef enum hiDSU_HSCALE_FILTER_E +{ + DSU_HSCALE_FILTER_DEFAULT = 0, + DSU_HSCALE_FILTER_C_65M, + DSU_HSCALE_FILTER_CG_56M, + DSU_HSCALE_FILTER_LC_45M, + DSU_HSCALE_FILTER_CG_3M, + DSU_HSCALE_FILTER_CG_2M, + DSU_HSCALE_FILTER_CG_1M, + DSU_HSCALE_FILTER_BUTT +}DSU_HSCALE_FILTER_E; + + +/* vertical scale filter coefficient of dsu +** which affect image quality of encoding and preview. + +** normally the filter can be set be DSU_VSCALE_FILTER_DEFAULT +** which means sdk will choose filter automatically.Otherwise, +** you can choose other filter + +** Notes:38M means 3.8 +*/ +typedef enum hiDSU_VSCALE_FILTER_E +{ + DSU_VSCALE_FILTER_DEFAULT = 0, + DSU_VSCALE_FILTER_S_6M, + DSU_VSCALE_FILTER_S_5M, + DSU_VSCALE_FILTER_S_4M, + DSU_VSCALE_FILTER_S_38M, + DSU_VSCALE_FILTER_S_37M, + DSU_VSCALE_FILTER_S_36M, + DSU_VSCALE_FILTER_S_25M, + DSU_VSCALE_FILTER_S_2M, + DSU_VSCALE_FILTER_S_15M, + DSU_VSCALE_FILTER_S_12M, + DSU_VSCALE_FILTER_S_11M, + DSU_VSCALE_FILTER_S_1M, + DSU_VSCALE_FILTER_BUTT +}DSU_VSCALE_FILTER_E; + +/*DSU filter param type*/ +typedef enum hiDSU_FILTER_PARAM_TYPE +{ + FILTER_PARAM_TYPE_NORM = 0, + FILTER_PARAM_TYPE_EX, + FILTER_PARAM_TYPE_EX2, + FILTER_PARAM_TYPE_USER1, + FILTER_PARAM_TYPE_USER2, + FILTER_PARAM_TYPE_BUTT +}DSU_FILTER_PARAM_TYPE; + +#define DSU_HFILTER_PARAM_NUM 792 +#define DSU_VFILTER_PARAM_NUM 480 +typedef struct hiDSU_FILTER_PARAM_S +{ + DSU_FILTER_PARAM_TYPE enFiltType; + HI_U8 au8HParamTable[DSU_HFILTER_PARAM_NUM]; + HI_U8 au8VParamTable[DSU_VFILTER_PARAM_NUM]; +}DSU_FILTER_PARAM_S; + +#endif + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif /* __cplusplus */ + +#endif /* _HI_COMMON_H_ */ + diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_debug.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_debug.h new file mode 100644 index 0000000000..5c77fedcb4 --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_debug.h @@ -0,0 +1,145 @@ +/****************************************************************************** +Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. +****************************************************************************** +File Name : hi_debug.h +Version : Initial Draft +Author : Hisilicon multimedia software group +Created : 2006/12/09 +Last Modified : +Description : all struct and maro definition for debug +Function List : +History : + 1.Date : 2006/11/03 + Author : c42025 + Modification: Created file + +2.Date : 2008/03/03 + Author : c42025 + Modification: 1. mv definition LOG_ERRLEVEL_E to here form file "hi_errno.h", + but it will be obsolete in next version. + 2. add new macro definition for debug levle. + 3. change macro defintion HI_TRACE + +3.Date : 2008/03/05 + Author : c42025 + Modification: Change the definition of LOG_ERRLEVEL_E + +4.Date : 2008/10/31 + Author : z44949 + Modification: Delete the definition of LOG_ERRLEVEL_E + +5.Date : 2010/11/03 + Author : z44949 + Modification: Remove some unnecessary typedef + +******************************************************************************/ +#ifndef __HI_DEBUG_H__ +#define __HI_DEBUG_H__ + +#ifndef __KERNEL__ +#include +#endif + +#include "hi_type.h" +#include "hi_common.h" + +#ifdef __cplusplus +#if __cplusplus +extern "C"{ +#endif +#endif /* __cplusplus */ + +#define _EX__FILE_LINE(fxx,lxx) "[File]:"fxx"\n[Line]:"#lxx"\n[Info]:" +#define EX__FILE_LINE(fxx,lxx) _EX__FILE_LINE(fxx,lxx) +#define __FILE_LINE__ EX__FILE_LINE(__FILE__, __LINE__) + +#define HI_DBG_EMERG 0 /* system is unusable */ +#define HI_DBG_ALERT 1 /* action must be taken immediately */ +#define HI_DBG_CRIT 2 /* critical conditions */ +#define HI_DBG_ERR 3 /* error conditions */ +#define HI_DBG_WARN 4 /* warning conditions */ +#define HI_DBG_NOTICE 5 /* normal but significant condition */ +#define HI_DBG_INFO 6 /* informational */ +#define HI_DBG_DEBUG 7 /* debug-level messages */ + +typedef struct hiLOG_LEVEL_CONF_S +{ + MOD_ID_E enModId; + HI_S32 s32Level; + HI_CHAR cModName[16]; +} LOG_LEVEL_CONF_S; + +#ifndef __KERNEL__ +/****************************************************************************** +** For User Mode : HI_PRINT, HI_ASSERT, HI_TRACE +******************************************************************************/ + +#define HI_PRINT printf + +#ifdef HI_DEBUG + /* Using samples: HI_ASSERT(x>y); */ + #define HI_ASSERT(expr) \ + do{ \ + if (!(expr)) { \ + printf("\nASSERT failed at:\n"\ + " >File name: %s\n" \ + " >Function : %s\n" \ + " >Line No. : %d\n" \ + " >Condition: %s\n", \ + __FILE__,__FUNCTION__, __LINE__, #expr);\ + _exit(-1);\ + } \ + }while(0) + + /* Using samples: + ** HI_TRACE(HI_DBG_DEBUG, HI_ID_CMPI, "Test %d, %s\n", 12, "Test"); + **/ + #define HI_TRACE(level, enModId, fmt...) fprintf(stderr,##fmt) +#else + #define HI_ASSERT(expr) + #define HI_TRACE(level, enModId, fmt...) +#endif + +#else +/****************************************************************************** +** For Linux Kernel : HI_PRINT, HI_ASSERT, HI_TRACE +******************************************************************************/ + +#define HI_PRINT printk + +extern HI_S32 HI_ChkLogLevel(HI_S32 s32Levle, MOD_ID_E enModId); +asmlinkage int HI_LOG(HI_S32 level, MOD_ID_E enModId,const char *fmt, ...); + +#ifdef HI_DEBUG + /* Using samples: HI_ASSERT(x>y); */ + #define HI_ASSERT(expr) \ + do{ \ + if (!(expr)) { \ + panic("\nASSERT failed at:\n" \ + " >File name: %s\n" \ + " >Function : %s\n" \ + " >Line No. : %d\n" \ + " >Condition: %s\n", \ + __FILE__,__FUNCTION__, __LINE__, #expr);\ + } \ + }while(0) + + /* Using samples: + ** HI_TRACE(HI_DBG_DEBUG, HI_ID_CMPI, "Test %d, %s\n", 12, "Test"); + **/ + #define HI_TRACE HI_LOG +#else + #define HI_ASSERT(expr) + #define HI_TRACE(level, enModId, fmt...) +#endif + +#endif /* end of __KERNEL__ */ + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif /* __cplusplus */ + +#endif /* __HI_DEBUG_H__ */ + diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_defines.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_defines.h new file mode 100644 index 0000000000..afb8e93639 --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_defines.h @@ -0,0 +1,293 @@ +/****************************************************************************** + Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. +****************************************************************************** +File Name : hi_defines.h +Version : Initial Draft +Author : Hisilicon multimedia software group +Created : 2005/4/23 +Last Modified : +Description : The common data type defination +Function List : +History : +******************************************************************************/ +#ifndef __HI_DEFINES_H__ +#define __HI_DEFINES_H__ + +#ifdef __cplusplus +#if __cplusplus +extern "C"{ +#endif +#endif /* __cplusplus */ + +#define HI3511_V100 0x35110100 +#define HI3511_V110 0x35110110 +#define HI3520_V100 0x35200100 +#define HI3515_V100 0x35150100 +#define HI3516_V100 0x35160100 +#define HI3531_V100 0x35310100 +#define HI3532_V100 0x35320100 +#define HI3521_V100 0x35210100 +#define HI3520A_V100 0x3520A100 +#define HI3520D_V100 0x3520D100 +#define HI3518_V100 0x35180100 +#define HI3518A_V100 0x3518A100 +#define HI3518C_V100 0x3518C100 +#define HI3516C_V100 0x3516C100 +#define HI3518E_V100 0x3518E100 +#define HI35xx_Vxxx 0x35000000 + +#ifndef HICHIP + #define HICHIP HI3520D_V100 +#endif + + +#if HICHIP==HI3520D_V100 + #define CHIP_NAME "Hi3520D" + #define MPP_VER_PRIX "_MPP_V" +#elif HICHIP==HI35xx_Vxxx + #error HuHu, I am an dummy chip +#else + #error HICHIP define may be error +#endif + + +#define LINE_LEN_BIT 5 +#define LINE_LEN (1<>= LINE_LEN_BIT; + end = addr + len*LINE_LEN; + + while(addr != end) + { + asm("mcr p15, 0, %0, c7, c6, 1"::"r"(addr)); + addr += LINE_LEN; + } + return; +} + +static inline void FlushDcache(unsigned long addr, unsigned long len) +{ + unsigned long end; + + //TODO: cacheË¢ÐÂÐèÒªÖØÐ´ + return ; + + addr &= LINE_BASE_MASK; + len >>= LINE_LEN_BIT; + end = addr + len*LINE_LEN; + + while(addr != end) + { + asm("mcr p15, 0, %0, c7, c10, 1"::"r"(addr)); + addr += LINE_LEN; + } + return; +} + +#define DEFAULT_ALIGN 16 +#define MAX_MMZ_NAME_LEN 16 + +#define MAX_NODE_NUM 16 + +/* For VDA */ +#define VDA_MAX_NODE_NUM 32 +#define VDA_MAX_INTERNAL 256 +#define VDA_CHN_NUM_MAX 32 +#define VDA_MAX_WIDTH 960 +#define VDA_MAX_HEIGHT 576 + + +/* For VENC */ +#define VENC_MAX_NAME_LEN 16 +#define VENC_PIC_ALIGN 16 +#define VENC_MAX_CHN_NUM 64 +#define VENC_MAX_GRP_NUM 64 +#define H264E_MAX_WIDTH 1920 +#define H264E_MAX_HEIGHT 2048 +#define H264E_MIN_WIDTH 160 +#define H264E_MIN_HEIGHT 64 +#define JPEGE_MAX_WIDTH 8192 +#define JPEGE_MAX_HEIGHT 8192 +#define JPEGE_MIN_WIDTH 64 +#define JPEGE_MIN_HEIGHT 64 +#define VENC_MAX_ROI_NUM 8 /* ×î´óÖ§³Ö8¸öROIÇøÓò */ +#define H264E_MIN_HW_INDEX 0 +#define H264E_MAX_HW_INDEX 5 +#define H264E_MIN_VW_INDEX 0 +#define H264E_MAX_VW_INDEX 2 +#define MPEG4E_MAX_HW_INDEX 1 +#define MPEG4E_MAX_VW_INDEX 0 + + +/* For VDEC */ +/*hi3521 vdecͨµÀ·¶Î§[0,63],ÆäÖÐ[0,31]ͨµÀΪvdh½âÂ룬[32,63]ͨµÀΪvedu½âÂ룬*/ +#define VDH_VEDU_CHN 0 /*VDH ÓëVEDUÁÙ½çͨµÀ*/ +#define VDEC_MAX_CHN_NUM 64 +#define VEDU_MAX_CHN_NUM (VDEC_MAX_CHN_NUM-VDH_VEDU_CHN) +#define MAX_VDEC_CHN VDEC_MAX_CHN_NUM +#define BUF_RESERVE_LENTH 64 /*reserve 64byte for hardware*/ +#define MAX_JPEG_TOTAL (2048*1536) +#define H264D_MAX_SLICENUM 137 +#define VEDU_H264D_ERRRATE 10 +#define VEDU_H264D_FULLERR 100 + +/* for VEDU-H264 */ +#define VEDU_H264D_MAX_WIDTH 1920 +#define VEDU_H264D_MAX_HEIGHT 2048 +#define VEDU_H264D_MIN_WIDTH 80 +#define VEDU_H264D_MIN_HEIGHT 64 + +/* for JPEG */ +#define JPEGD_MAX_WIDTH 4096 +#define JPEGD_MAX_HEIGHT 4080 +#define JPEGD_MIN_WIDTH 64 +#define JPEGD_MIN_HEIGHT 64 + + + + + +/* For VPP */ +#define RGN_HANDLE_MAX 1024 +#define OVERLAY_MAX_NUM 8 +#define COVEREX_MAX_NUM 16 +#define COVER_MAX_NUM 4 +#define OVERLAYEX_MAX_NUM 16 + + +#if 0 +#define MAX_COVER_NUM 4 +#define MAX_VIOVERLAY_NUM 8 +#define MAX_COVEREX_REGION_NUM 16 +#define MAX_REGION_NUM 8 +#define OVERLAY_START_X_ALIGN 8 +#define OVERLAY_START_Y_ALIGN 2 +#define MAX_VIOVERLAY_ALPHA 255 +#endif + + +/* number of channle and device on video input unit of chip + * Note! VIU_MAX_CHN_NUM is NOT equal to VIU_MAX_DEV_NUM + * multiplied by VIU_MAX_CHN_NUM, because all VI devices + * can't work at mode of 4 channles at the same time. + */ +#define VIU_MAX_DEV_NUM 2 +#define VIU_MAX_WAY_NUM_PER_DEV 4 +#define VIU_MAX_CHN_NUM_PER_DEV 4 +#define VIU_MAX_PHYCHN_NUM 8 +#define VIU_EXT_CHN_START (VIU_MAX_PHYCHN_NUM + VIU_MAX_CAS_CHN_NUM) +#define VIU_MAX_EXT_CHN_NUM 0 +#define VIU_MAX_EXTCHN_BIND_PER_CHN 0 + +#define VIU_MAX_CHN_NUM (VIU_MAX_PHYCHN_NUM + VIU_MAX_EXT_CHN_NUM) +#define VIU_CHNID_DEV_FACTOR 2 + +/* 3521±¾²»Ö§³Ö¼¶Áª£¬ÕâÀïºê¶¨ÒåÕâЩÐÅÏ¢£¬Ö»ÊÇΪÁ˱àÒëͨ¹ý */ +#define VIU_MAX_CAS_CHN_NUM 0 +#define VIU_SUB_CHN_START 16 /* ¶¨Òå´ÎͨµÀÆðʼºê*/ +#define VIU_CAS_CHN_START 32 /* ¶¨Òå¼¶ÁªÍ¨µÀÆðʼºê*/ + + +/* max number of VBI region*/ +#define VIU_MAX_VBI_NUM 2 +/* max length of one VBI region (by word)*/ +#define VIU_MAX_VBI_LEN 8 + +#define VO_MIN_CHN_WIDTH 32 /* channel minimal width */ +#define VO_MIN_CHN_HEIGHT 32 /* channel minimal height */ + +#define VO_MAX_ZOOM_RATIO 1000 /* max zoom ratio, 1000 means 100% scale */ + +#if 0 +/* For VOU */ +#define VO_MAX_DEV_NUM 6 /* we have three VO physical device(HD,AD,SD) and three virtual device(VD1,VD2,VD3) */ +#define VO_MAX_PHY_DEV 3 /* max physical device number(HD,AD,SD) */ +#define VO_MAX_CHN_NUM 64 /* max channel number of each device */ +#define VO_SYNC_MAX_GRP 16 /* we limit total sync group as 16 on three device */ +#define VO_SYNC_MAX_CHN 64 /* each sync group can accommodate 64 channels */ +#define VO_MIN_TOLERATE 1 /* min play toleration 1ms */ +#define VO_MAX_TOLERATE 100000 /* max play toleration 100s */ +#define VO_MAX_SOLIDDRAW 128 /* max draw region number */ +#define VO_MIN_DISP_BUF 5 /* min display buffer number */ +#define VO_MAX_DISP_BUF 15 /* max display buffer number */ +#define VO_MIN_VIRT_BUF 3 /* min virtual device buffer number */ +#define VO_MAX_VIRT_BUF 15 /* max virtual device buffer number */ + +#define VIVO_CSCD_VBI_ID 0 +#define VIVO_CSCD_VBI_X 0 +#define VIVO_CSCD_VBI_Y 0 +#define VIVO_CSCD_VBI_LEN 2 +#define VIVO_CSCD_VBI_LOC VI_VBI_LOCAL_ODD_FRONT +#define VIVO_CSCD_VBI_DATA_WORD 0 +#define VIVO_CSCD_VBI_DATA_BIT (0x01 << 31) +#endif +#define VO_MAX_DEV_NUM 7 /* max dev num */ +#define VO_MAX_LAYER_NUM 7 /* max layer num */ +#define VO_MAX_CHN_NUM 32 /* max chn num */ +#define PIP_MAX_CHN_NUM 1 +#define VHD_MAX_CHN_NUM 16 /* max VHD chn num */ +#define VO_MAX_LAYER_IN_DEV 2 /* max layer num of each dev */ + +//#define VO_MAX_CAS_DEV_NUM 2 /* max cascade dev num*/ +//#define VO_CAS_DEV_1 4 /* cascade display device 1 */ +//#define VO_CAS_DEV_2 5 /* cascade display device 2 */ +#define VO_CAS_MAX_PAT 128 /* cascade pattern max number */ +#define VO_CAS_MAX_POS_32RGN 32 /* cascade position max number */ +#define VO_CAS_MAX_POS_64RGN 64 /* cascade position max number */ + +#define VO_MAX_VIRT_DEV_NUM 4 /* max virtual dev num*/ +#define VO_VIRT_DEV_0 3 /* virtual display device 1 */ +#define VO_VIRT_DEV_1 4 /* virtual display device 2 */ +#define VO_VIRT_DEV_2 5 /* virtual display device 3 */ +#define VO_VIRT_DEV_3 6 /* virtual display device 4 */ + +#define VO_MAX_GFX_LAYER_PER_DEV 3 +#define VOU_GRAPHICS_LAYER_NUM 4 + +#define VO_MIN_TOLERATE 1 /* min play toleration 1ms */ +#define VO_MAX_TOLERATE 100000 /* max play toleration 100s */ + +#define AI_DEV_MAX_NUM 1 +#define AO_DEV_MIN_NUM 0 +#define AO_DEV_MAX_NUM 2 +#define SIO_MAX_NUM 2 + + +#define AIO_MAX_CHN_NUM 16 +#define AENC_MAX_CHN_NUM 32 +#define ADEC_MAX_CHN_NUM 32 + +#define VPSS_MAX_GRP_NUM 128 + +#define VPSS_MAX_PHY_CHN_NUM 4 +#define VPSS_MAX_EXT_CHN_NUM 0 +#define VPSS_MAX_CHN_NUM (VPSS_MAX_PHY_CHN_NUM + VPSS_MAX_EXT_CHN_NUM + 1) + +#define VPSS_BSTR_CHN 0 +#define VPSS_LSTR_CHN 1 +#define VPSS_PRE0_CHN 2 +#define VPSS_PRE1_CHN 3 +#define VPSS_BYPASS_CHN 4 + +#define RC_MAD_HIST_SIZE 64 +#define RC_MSE_HIST_SIZE 8 +#define RC_MAX_BLINK_QP 32 + +/* hi3520D not support pciv */ +#define PCIV_MAX_CHN_NUM 0 /* max pciv channel number in each pciv device */ + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif /* __cplusplus */ + +#endif /* __HI_DEFINES_H__ */ + diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_errno.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_errno.h new file mode 100644 index 0000000000..8ab3aa042a --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_errno.h @@ -0,0 +1,131 @@ +/****************************************************************************** +Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. +****************************************************************************** +File Name : hi_common.h +Version : Initial Draft +Author : Hi3511 MPP Team +Created : 2006/11/09 +Last Modified : +Description : define the format of error code +Function List : +History : + 1.Date : 2007/02/14 + Author : c42025 + Modification: Created file + + 2.Date : 2007/12/11 + Author : c42025 + Modification: add some MOD_ID for several modules + + 3.Date : 2008/02/03 + Author : c42025 + Modification: reoorder MOD_ID to cleanup modules at specified order + + 4.Date : 2008/03/01 + Author : c42025 + Modification: move LOG_ERRLEVEL_E to hi_debug.h, and add new definion + ERR_LEVLE_E, we should use this enumeration in our error code. + + 5.Date : 2008/04/30 + Author : c42025 + Modification: delete two error code "EN_ERR_NOCHN" and "EN_ERR_NODEV". + +******************************************************************************/ +#ifndef __HI_ERRNO_H__ +#define __HI_ERRNO_H__ + +#include "hi_debug.h" + +#ifdef __cplusplus +#if __cplusplus +extern "C"{ +#endif +#endif /* End of #ifdef __cplusplus */ + + +/* 1010 0000b + * VTOP use APPID from 0~31 + * so, hisilicon use APPID based on 32 + */ +#define HI_ERR_APPID (0x80000000L + 0x20000000L) + +typedef enum hiERR_LEVEL_E +{ + EN_ERR_LEVEL_DEBUG = 0, /* debug-level */ + EN_ERR_LEVEL_INFO, /* informational */ + EN_ERR_LEVEL_NOTICE, /* normal but significant condition */ + EN_ERR_LEVEL_WARNING, /* warning conditions */ + EN_ERR_LEVEL_ERROR, /* error conditions */ + EN_ERR_LEVEL_CRIT, /* critical conditions */ + EN_ERR_LEVEL_ALERT, /* action must be taken immediately */ + EN_ERR_LEVEL_FATAL, /* just for compatibility with previous version */ + EN_ERR_LEVEL_BUTT +}ERR_LEVEL_E; + + +/****************************************************************************** +|----------------------------------------------------------------| +| 1 | APP_ID | MOD_ID | ERR_LEVEL | ERR_ID | +|----------------------------------------------------------------| +|<--><--7bits----><----8bits---><--3bits---><------13bits------->| +******************************************************************************/ + +#define HI_DEF_ERR( module, level, errid) \ + ((HI_S32)( (HI_ERR_APPID) | ((module) << 16 ) | ((level)<<13) | (errid) )) + +/* NOTE! the following defined all common error code, +** all module must reserved 0~63 for their common error code +*/ +typedef enum hiEN_ERR_CODE_E +{ + EN_ERR_INVALID_DEVID = 1, /* invlalid device ID */ + EN_ERR_INVALID_CHNID = 2, /* invlalid channel ID */ + EN_ERR_ILLEGAL_PARAM = 3, /* at lease one parameter is illagal + * eg, an illegal enumeration value */ + EN_ERR_EXIST = 4, /* resource exists */ + EN_ERR_UNEXIST = 5, /* resource unexists */ + + EN_ERR_NULL_PTR = 6, /* using a NULL point */ + + EN_ERR_NOT_CONFIG = 7, /* try to enable or initialize system, device + ** or channel, before configing attribute */ + + EN_ERR_NOT_SUPPORT = 8, /* operation or type is not supported by NOW */ + EN_ERR_NOT_PERM = 9, /* operation is not permitted + ** eg, try to change static attribute */ + + EN_ERR_NOMEM = 12,/* failure caused by malloc memory */ + EN_ERR_NOBUF = 13,/* failure caused by malloc buffer */ + + EN_ERR_BUF_EMPTY = 14,/* no data in buffer */ + EN_ERR_BUF_FULL = 15,/* no buffer for new data */ + + EN_ERR_SYS_NOTREADY = 16,/* System is not ready,maybe not initialed or + ** loaded. Returning the error code when opening + ** a device file failed. */ + + EN_ERR_BADADDR = 17,/* bad address, + ** eg. used for copy_from_user & copy_to_user */ + + EN_ERR_BUSY = 18,/* resource is busy, + ** eg. destroy a venc chn without unregister it */ + + EN_ERR_BUTT = 63,/* maxium code, private error code of all modules + ** must be greater than it */ +}EN_ERR_CODE_E; + + +/* +** following is an example for defining error code of VDA module +** #define HI_ERR_MD_INVALID_CHNID HI_DEF_ERR(HI_ID_VDA, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_CHNID) +** +*/ + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif /* __cplusplus */ + +#endif /* __HI_ERRNO_H__ */ + diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_io.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_io.h new file mode 100644 index 0000000000..67b24396a0 --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_io.h @@ -0,0 +1,50 @@ +#ifndef __HI_IO_H__ +#define __HI_IO_H__ + +#include "hi_type.h" + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +/* user and kernel are different. */ +HI_U8 IO_READ8(HI_U32 u32Addr); +HI_S32 IO_WRITE8(HI_U32 u32Addr, HI_U32 u32Value); +HI_U16 IO_READ16(HI_U32 u32Addr); +HI_S32 IO_WRITE16(HI_U32 u32Addr, HI_U32 u32Value); +HI_U32 IO_READ32(HI_U32 u32Addr); +HI_S32 IO_WRITE32(HI_U32 u32Addr, HI_U32 u32Value); +HI_U32 ISP_Mmap(void); +HI_U32 ISP_Munmap(void); +HI_U32 ISP_GetExtRegAddr(void); + +#define REG_ACCESS_WIDTH 0 // 1: 16bit 2: 8bit +#define EXT_REG_BASE 0x10200 +#define ISP_REG_BASE_ADDR 0x205a0000 + +#define EXT_REG_BASE_ISP 0x8000 +#define EXT_REG_BASE_VIU 0x8400 +#define EXT_REG_BASE_VPP 0x8600 +#define EXT_REG_BASE_VEDU 0x8800 +#define EXT_REG_BASE_VOU 0x8A00 + +/* Dynamic bus access functions, 4 byte align access */ +//TODO: allocate dev addr (such as ISP_REG_BASE_ADDR) according to devId. +#define __IO_CALC_ADDRESS_DYNAMIC(BASE, OFFSET) ((HI_U32)(((BASE >= EXT_REG_BASE)? 0 : ISP_REG_BASE_ADDR) + ((((BASE >= EXT_REG_BASE)? (BASE - EXT_REG_BASE) : BASE) + OFFSET)<y; -1 if x= 0 ? (x) : (-(x)) ) +#define SIGN(x) ( (x) >= 0 ? 1 : -1 ) +#define CMP(x,y) (((x) == (y)) ? 0 : (((x) > (y)) ? 1 : -1)) + +/****************************************************************************** +** MAX2(x,y) maximum of x and y +** MIN2(x,y) minimum of x and y +** MAX3(x,y,z) maximum of x, y and z +** MIN3(x,y,z) minimun of x, y and z +** MEDIAN(x,y,z) median of x,y,z +** MEAN2(x,y) mean of x,y +******************************************************************************/ +#define MAX2(x,y) ( (x)>(y) ? (x):(y) ) +#define MIN2(x,y) ( (x)<(y) ? (x):(y) ) +#define MAX3(x,y,z) ( (x)>(y) ? MAX2(x,z) : MAX2(y,z) ) +#define MIN3(x,y,z) ( (x)<(y) ? MIN2(x,z) : MIN2(y,z) ) +#define MEDIAN(x,y,z) (((x)+(y)+(z) - MAX3(x,y,z)) - MIN3(x,y,z) ) +#define MEAN2(x,y) (((x)+(y)) >> 1 ) + +/****************************************************************************** +** CLIP3(x,min,max) clip x within [min,max] +** WRAP_MAX(x,max,min) wrap to min if x equal max +** WRAP_MIN(x,min,max) wrap to max if x equal min +** VALUE_BETWEEN(x,min.max) True if x is between [min,max] inclusively. +******************************************************************************/ +#define CLIP3(x,min,max) ( (x)< (min) ? (min) : ((x)>(max)?(max):(x)) ) +#define WRAP_MAX(x,max,min) ( (x)>=(max) ? (min) : (x) ) +#define WRAP_MIN(x,min,max) ( (x)<=(min) ? (max) : (x) ) +#define VALUE_BETWEEN(x,min,max) (((x)>=(min)) && ((x) <= (max))) + +/****************************************************************************** +** MULTI_OF_2_POWER(x,a) whether x is multiple of a(a must be power of 2) +** CEILING_2_POWER(x,a) ceiling x to multiple of a(a must be power of 2) +** FLOOR_2_POWER(x,a) floor x to multiple of a(a must be power of 2) +** HIALIGN(x, a) align x to multiple of a +** +** Example: +** CEILING_2_POWER(5,4) = 8 +** FLOOR_2_POWER(5,4) = 4 +******************************************************************************/ +#define MULTI_OF_2_POWER(x,a) (!((x) & ((a) - 1) ) ) +#define CEILING_2_POWER(x,a) ( ((x) + ((a) - 1) ) & ( ~((a) - 1) ) ) +#define FLOOR_2_POWER(x,a) ( (x) & (~((a) - 1) ) ) +#define HIALIGN(x, a) ((a) * (((x) + (a) - 1) / (a))) +#define HICEILING(x, a) (((x)+(a)-1)/(a)) + +/****************************************************************************** +** Get the span between two unsinged number, such as +** SPAN(HI_U32, 100, 200) is 200 - 100 = 100 +** SPAN(HI_U32, 200, 100) is 0xFFFFFFFF - 200 + 100 +** SPAN(HI_U64, 200, 100) is 0xFFFFFFFFFFFFFFFF - 200 + 100 +******************************************************************************/ +#define SPAN(type, begin, end)\ +({ \ + type b = (begin); \ + type e = (end); \ + (type)((b >= e) ? (b - e) : (b + ((~((type)0))-e))); \ +}) + +/****************************************************************************** +** ENDIAN32(x,y) little endian <---> big endian +** IS_LITTLE_END() whether the system is little end mode +******************************************************************************/ +#define ENDIAN32( x ) \ + ( ( (x) << 24 ) | \ + ( ( (x) & 0x0000ff00 ) << 8 ) | \ + ( ( (x) & 0x00ff0000 ) >> 8 ) | \ + ( ( (x) >> 24 ) & 0x000000ff ) ) + +__inline static HI_BOOL IS_LITTLE_END(void) +{ + union unEND_TEST_U + { + HI_CHAR cTest[4]; + HI_U32 u32Test; + } unEndTest; + + unEndTest.cTest[0] = 0x01; + unEndTest.cTest[1] = 0x02; + unEndTest.cTest[2] = 0x03; + unEndTest.cTest[3] = 0x04; + + return (unEndTest.u32Test > 0x01020304) ? (HI_TRUE) : (HI_FALSE); +} + + +/****************************************************************************** +** FRACTION32(de,nu) fraction: nu(minator) / de(nominator). +** NUMERATOR32(x) of x(x is fraction) +** DENOMINATOR32(x) Denominator of x(x is fraction) + +** represent fraction in 32 bit. LSB 16 is numerator, MSB 16 is denominator +** It is integer if denominator is 0. +******************************************************************************/ +#define FRACTION32(de,nu) ( ((de) << 16) | (nu) ) +#define NUMERATOR32(x) ( (x) & 0xffff) +#define DENOMINATOR32(x) ( (x) >> 16 ) + +/****************************************************************************** +** RGB(r,g,b) assemble the r,g,b to 24bit color +** RGB_R(c) get RED from 24bit color +** RGB_G(c) get GREEN from 24bit color +** RGB_B(c) get BLUE from 24bit color +******************************************************************************/ +#define RGB(r,g,b) ((((r) & 0xff) << 16) | (((g) & 0xff) << 8) | ((b) & 0xff)) +#define RGB_R(c) ( ((c) & 0xff0000) >> 16) +#define RGB_G(c) ( ((c) & 0xff00) >> 8) +#define RGB_B(c) ( (c) & 0xff) + +/****************************************************************************** +** YUV(y,u,v) assemble the y,u,v to 24bit color +** YUV_Y(c) get Y from 24bit color +** YUV_U(c) get U from 24bit color +** YUV_V(c) get V from 24bit color +******************************************************************************/ +#define YUV(y,u,v) ((((y) & 0xff) << 16) | (((u) & 0xff) << 8) | ((v) & 0xff)) +#define YUV_Y(c) ( ((c) & 0xff0000) >> 16) +#define YUV_U(c) ( ((c) & 0xff00) >> 8) +#define YUV_V(c) ( (c) & 0xff) + +/****************************************************************************** +** Rgb2Yc(r, g, b, *y, *u, *u) convert r,g,b to y,u,v +** Rgb2Yuv(rgb, *yuv) convert rgb to yuv +******************************************************************************/ +__inline static HI_VOID Rgb2Yc(HI_U8 r, HI_U8 g, HI_U8 b, HI_U8 * py, HI_U8 * pcb, HI_U8 * pcr) +{ + /* Y */ + *py = (HI_U8)(((r*66+g*129+b*25) >> 8) + 16); + + /* Cb */ + *pcb = (HI_U8)((((b*112-r*38)-g*74) >> 8) + 128); + + /* Cr */ + *pcr = (HI_U8)((((r*112-g*94)-b*18) >> 8) + 128); +} + +__inline static HI_U32 Rgb2Yuv(HI_U32 u32Rgb) +{ + HI_U8 y,u,v; + + Rgb2Yc(RGB_R(u32Rgb), RGB_G(u32Rgb), RGB_B(u32Rgb), &y, &u, &v); + + return YUV(y,u,v); +} + +/****************************************************************************** +** GetYCFromRGB(rgb, *y, *cbcr) convert rgb to yyyy, uvuv, +******************************************************************************/ +__inline static HI_VOID GetYCFromRGB(HI_U32 rgb, HI_U32 * pY, HI_U32 * pC) +{ + HI_U8 y, cb, cr; + HI_U32 color_y, color_c, tmp; + + Rgb2Yc(RGB_R(rgb), RGB_G(rgb), RGB_B(rgb), &y, &cb, &cr); + + tmp = y & 0xFF; + color_y = (tmp<<24) + (tmp<<16) + (tmp<<8) + tmp; + + tmp = cb & 0xFF; + color_c = (tmp<<24) + (tmp<<8); + + tmp = cr & 0xFF; + color_c = color_c + (tmp<<16) + tmp; + + *pY = color_y; + *pC = color_c; +} + +/******************************************************************************* +** FpsControl Useing Sample: +** FPS_CTRL_S g_stFpsCtrl; +** +** Take 12 frame uniform in 25. +** InitFps(&g_stFpsCtrl, 25, 12); +** +** { +** if(FpsControl(&g_stFpsCtrl)) printf("Yes, this frmae should be token"); +** } +** +*******************************************************************************/ +typedef struct hiFPS_CTRL_S +{ + HI_U32 u32Ffps; /* Full frame rate */ + HI_U32 u32Tfps; /* Target frame rate */ + HI_U32 u32FrmKey; /* update key frame */ +} FPS_CTRL_S; + +__inline static HI_VOID InitFps(FPS_CTRL_S *pFrmCtrl, HI_U32 u32FullFps, + HI_U32 u32TagFps) +{ + pFrmCtrl->u32Ffps = u32FullFps; + pFrmCtrl->u32Tfps = u32TagFps; + pFrmCtrl->u32FrmKey = 0; +} + +__inline static HI_BOOL FpsControl(FPS_CTRL_S *pFrmCtrl) +{ + HI_BOOL bReturn = HI_FALSE; + + pFrmCtrl->u32FrmKey += pFrmCtrl->u32Tfps; + if (pFrmCtrl->u32FrmKey >= pFrmCtrl->u32Ffps) + { + pFrmCtrl->u32FrmKey -= pFrmCtrl->u32Ffps; + bReturn = HI_TRUE; + } + + return bReturn; +} + +/******************************************************************************* +** GetSysTimeBySec +** GetSysTimeByUsec +*******************************************************************************/ +#ifdef __KERNEL__ + #include +#else + #include +#endif +__inline static HI_U32 GetSysTimeBySec(void) +{ + struct timeval stTime; + #ifdef __KERNEL__ + do_gettimeofday(&stTime); + #else + gettimeofday(&stTime, NULL); + #endif + return stTime.tv_sec; +} + +__inline static HI_U64 GetSysTimeByUsec(void) +{ + struct timeval stTime; + #ifdef __KERNEL__ + do_gettimeofday(&stTime); + #else + gettimeofday(&stTime, NULL); + #endif + return (stTime.tv_sec * 1000000LLU) + stTime.tv_usec; +} + + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif /* __cplusplus */ + + +#endif /* __HI_MATH_H__ */ + diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_mem.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_mem.h new file mode 100644 index 0000000000..a305635da0 --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_mem.h @@ -0,0 +1,33 @@ +#ifndef __HI_MEM_H__ +#define __HI_MEM_H__ + + +#ifdef __cplusplus +#if __cplusplus +extern "C"{ +#endif +#endif /* __cplusplus */ + +void *memcpy1(void *dest, const void *src, size_t n); +void *memcpy_back(void *dest, const void *src, size_t n); +void *memset1(void *s, int c, size_t n); +int memcmp1(const void *s1, const void *s2, size_t n); +char *strcpy1(char *dest, const char *src); +int strcmp1(const char *s1, const char *s2); +size_t strlen1(const char *s); + +#define memcpy memcpy_back +#define memset memset1 +#define memcmp memcmp1 +#define strcpy strcpy1 +#define strcmp strcmp1 +#define strlen strlen1 + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif /* __cplusplus */ + +#endif /* __HI_MEM_H__ */ + diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_tde_api.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_tde_api.h new file mode 100644 index 0000000000..297fa18988 --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_tde_api.h @@ -0,0 +1,458 @@ +/***************************************************************************** +* Copyright 2006 - 2050, Hisilicon Tech. Co., Ltd. +* ALL RIGHTS RESERVED +* FileName: hi_api_tde.h +* Description:TDE2 API define +* +* History: +* Version Date Author DefectNum Description +* +*****************************************************************************/ + +#ifndef _HI_API_TDE2_H_ +#define _HI_API_TDE2_H_ + +#ifdef __cplusplus + #if __cplusplus +extern "C" { + #endif /* __cplusplus */ +#endif /* __cplusplus */ + +#include "hi_type.h" +#include "hi_tde_type.h" + +#define HI_TDE_Open HI_TDE2_Open +#define HI_TDE_Close HI_TDE2_Close +#define HI_TDE_BeginJob HI_TDE2_BeginJob + +/****************************************************************************/ +/* TDE2 API define */ +/****************************************************************************/ + +/***************************************************************************** +* Function: HI_TDE2_Open +* Description: Opens the TDE device +* Input: None +* Output: None +* Return: Success / Error code +* Others: None +*****************************************************************************/ +HI_S32 HI_TDE2_Open(HI_VOID); + +/***************************************************************************** +* Function: HI_TDE2_Close +* Description: Closes the TDE device +* Input: None +* Output: None +* Return: None +* Others: None +*****************************************************************************/ +HI_VOID HI_TDE2_Close(HI_VOID); + +/***************************************************************************** +* Function: HI_TDE2_BeginJob +* Description: Creates a TDE job, get a TDE2 job handle +* Input: None +* Output: None +* Return: tde handle / Error code +* Others: None +*****************************************************************************/ +TDE_HANDLE HI_TDE2_BeginJob(HI_VOID); + +/***************************************************************************** +* Function: HI_TDE2_EndJob +* Description: Submits a TDE2 job +* Input: s32Handle: job handle +* bSync: if synchronous +* bBlock: if blocked +* u32TimeOut: timeout value(in 10ms) +* Output: None +* Return: Success / Error code +* Others: None +*****************************************************************************/ +HI_S32 HI_TDE2_EndJob(TDE_HANDLE s32Handle, HI_BOOL bSync, HI_BOOL bBlock, HI_U32 u32TimeOut); + +/***************************************************************************** +* Function: HI_TDE2_CancelJob +* Description: Cancels a specific TDE job, only successful before calling EndJob +* Input: s32Handle: job handle +* Output: None +* Return: Success / Error code +* Others: None +*****************************************************************************/ +HI_S32 HI_TDE2_CancelJob(TDE_HANDLE s32Handle); + +/***************************************************************************** +* Function: HI_TDE2_WaitForDone +* Description: Waits for a submitted job to finish +* Input: s32Handle: job handle +* Output: None +* Return: Success / Error code +* Others: None +*****************************************************************************/ +HI_S32 HI_TDE2_WaitForDone(TDE_HANDLE s32Handle); + +/***************************************************************************** +* Function: HI_TDE2_WaitAllDone +* Description: Waits for all submitted jobs to finish +* Input: None +* Output: None +* Return: Success / Error code +* Others: None +*****************************************************************************/ +HI_S32 HI_TDE2_WaitAllDone(HI_VOID); + + +/***************************************************************************** +* Function: HI_TDE2_Reset +* Description: Reset tde +* Input: None +* Output: None +* Return: Success / Error code +* Others: None +*****************************************************************************/ +HI_S32 HI_TDE2_Reset(HI_VOID); + +/***************************************************************************** +* Function: HI_TDE2_QuickCopy +* Description: Just quick copy, the size of source region and destination region should be the same, so is the color format +* Input: s32Handle: job handle +* pSrc: the source picture information +* pstSrcRect: the source picture operation region +* pDst: the destination picture information +* pstDstRect: the destination picture operation region +* Output: None +* Return: Success / Error code +* Others: None +*****************************************************************************/ +HI_S32 HI_TDE2_QuickCopy(TDE_HANDLE s32Handle, TDE2_SURFACE_S* pstSrc, TDE2_RECT_S *pstSrcRect, + TDE2_SURFACE_S* pstDst, TDE2_RECT_S *pstDstRect); + +/***************************************************************************** +* Function: HI_TDE2_QuickFill +* Description: Quick fill +* Input: s32Handle: job handle +* pDst: the destination picture information +* pstDstRect: the destination picture operation region +* u32FillData: the color value,its format should be the same to the destination picture +* Output: None +* Return: Success / Error code +* Others: None +*****************************************************************************/ +HI_S32 HI_TDE2_QuickFill(TDE_HANDLE s32Handle, TDE2_SURFACE_S* pstDst, TDE2_RECT_S *pstDstRect, + HI_U32 u32FillData); + +/***************************************************************************** +* Function: HI_TDE2_QuickResize +* Description: Adds the raster bitmap scaling operation to a TDE job +* Input: s32Handle: job handle +* pSrc: the source picture information +* pstSrcRect: the source picture operation region +* pDst: the destination picture information +* pstDstRect: the destination picture operation region +* Output: None +* Return: Success / Error code +* Others: None +*****************************************************************************/ +HI_S32 HI_TDE2_QuickResize(TDE_HANDLE s32Handle, TDE2_SURFACE_S* pstSrc, TDE2_RECT_S *pstSrcRect, + TDE2_SURFACE_S* pstDst, TDE2_RECT_S *pstDstRect); + +/***************************************************************************** +* Function: HI_TDE2_QuickFlicker +* Description: Adds the anti-flicker operation to a TDE job +* Input: s32Handle: job handle +* pSrc: the source picture information +* pstSrcRect: the source picture operation region +* pDst: the destination picture information +* pstDstRect: the destination picture operation region +* Output: None +* Return: Success / Error code +* Others: None +*****************************************************************************/ +HI_S32 HI_TDE2_QuickDeflicker(TDE_HANDLE s32Handle, TDE2_SURFACE_S* pstSrc, TDE2_RECT_S *pstSrcRect, + TDE2_SURFACE_S* pstDst, TDE2_RECT_S *pstDstRect); + +/***************************************************************************** +* Function: HI_TDE2_Blit +* Description: Adds the transfer operation with additional functions performed on + the raster bitmap to a TDE task +* Input: s32Handle: job handle +* pstBackGround: the background picture information +* pstBackGroundRect: the background picture operation region +* pstForeGround: the foreground picture information +* pstForeGroundRect: the foreground picture operation region +* pstDst: the destination picture information +* pstDstRect: the destination picture operation region +* pOpt: operation parameter settings +* Output: None +* Return: Success / Error code +* Others: None +*****************************************************************************/ +HI_S32 HI_TDE2_Bitblit(TDE_HANDLE s32Handle, TDE2_SURFACE_S* pstBackGround, TDE2_RECT_S *pstBackGroundRect, + TDE2_SURFACE_S* pstForeGround, TDE2_RECT_S *pstForeGroundRect, TDE2_SURFACE_S* pstDst, + TDE2_RECT_S *pstDstRect, TDE2_OPT_S* pstOpt); + +/***************************************************************************** +* Function: HI_TDE2_SolidDraw +* Description: Adds the filling operation with additional functions performed on + the raster bitmap to a TDE task +* Input: s32Handle: job handle +* pstForeGround: the foreground picture information +* pstForeGroundRect: the source picture operation region +* pstDst: the background picture information +* pstDstRect: the destination picture operation region +* pstFillColor: the color value +* pstOpt: operation parameter settings +* Output: None +* Return: Success / Error code +* Others: None +*****************************************************************************/ +HI_S32 HI_TDE2_SolidDraw(TDE_HANDLE s32Handle, TDE2_SURFACE_S* pstForeGround, TDE2_RECT_S *pstForeGroundRect, + TDE2_SURFACE_S *pstDst, + TDE2_RECT_S *pstDstRect, TDE2_FILLCOLOR_S *pstFillColor, + TDE2_OPT_S *pstOpt); + +/***************************************************************************** +* Function: HI_TDE2_MbBlit +* Description: Adds the transfer operation with additional functions performed on + the macroblock bitmap to a TDE task +* Input: s32Handle: job handle +* pstMB: Surface of the macroblock +* pstDst: Operating region of the macroblock +* pstDstRect: the destination picture operation region +* pstMbOpt: operation parameter settings +* Output: None +* Return: Success / Error code +* Others: None +*****************************************************************************/ +HI_S32 HI_TDE2_MbBlit(TDE_HANDLE s32Handle, TDE2_MB_S* pstMB, TDE2_RECT_S *pstMbRect, TDE2_SURFACE_S* pstDst, TDE2_RECT_S *pstDstRect, + TDE2_MBOPT_S* pstMbOpt); + +/***************************************************************************** +* Function: HI_TDE2_BitmapMaskRop +* Description: Adds the mask raster operation (ROP) operation performed + on the raster bitmap to a TDE task. +* Input: s32Handle: job handle +* pstBackGround: the background picture information +* pstBackGroundRect: the background picture operation region +* pstForeGround: the foreground picture information +* pstForeGroundRect: the source picture operation region +* pstMask: mask picture information +* pstMaskRect: operating region of the mask picture +* pstDst: the destination picture information +* pstDstRect: the destination picture operation region +* enRopCode_Color: ROP operation code of the color component +* enRopCode_Alpha: ROP operation code of the alpha component +* Output: None +* Return: Success / Error code +* Others: None +*****************************************************************************/ +HI_S32 HI_TDE2_BitmapMaskRop(TDE_HANDLE s32Handle, + TDE2_SURFACE_S* pstBackGround, TDE2_RECT_S *pstBackGroundRect, + TDE2_SURFACE_S* pstForeGround, TDE2_RECT_S *pstForeGroundRect, + TDE2_SURFACE_S* pstMask, TDE2_RECT_S *pstMaskRect, + TDE2_SURFACE_S* pstDst, TDE2_RECT_S *pstDstRect, + TDE2_ROP_CODE_E enRopCode_Color, TDE2_ROP_CODE_E enRopCode_Alpha); + +/***************************************************************************** +* Function: HI_TDE2_BitmapMaskBlend +* Description: Adds the mask blending operation performed on the raster + bitmap to a TDE task +* Input: s32Handle: job handle +* pstBackGround: the background picture information +* pstBackGroundRect: the background picture operation region +* pstForeGround: the foreground picture information +* pstForeGroundRect: the foreground picture operation region +* pstMask: mask picture information +* pstMaskRect: operating region of the mask picture +* pstDst: the destination picture information +* pstDstRect: the destination picture operation region +* u8Alpha: global alpha value during alpha blending +* enBlendMode: alpha blending mode +* Output: None +* Return: Success / Error code +* Others: None +*****************************************************************************/ +HI_S32 HI_TDE2_BitmapMaskBlend(TDE_HANDLE s32Handle, + TDE2_SURFACE_S* pstBackGround, TDE2_RECT_S *pstBackGroundRect, + TDE2_SURFACE_S* pstForeGround, TDE2_RECT_S *pstForeGroundRect, + TDE2_SURFACE_S* pstMask, TDE2_RECT_S *pstMaskRect, + TDE2_SURFACE_S* pstDst, TDE2_RECT_S *pstDstRect, + HI_U8 u8Alpha, TDE2_ALUCMD_E enBlendMode); + + +HI_S32 HI_TDE2_Rotate(TDE_HANDLE s32Handle, + TDE2_SURFACE_S *pstSrc, TDE2_RECT_S *pstSrcRect, + TDE2_SURFACE_S *pstDst, HI_S32 s32DstPointX, HI_S32 s32DstPointY, + TDE_ROTATE_ANGLE_E enRotateAngle); + +/***************************************************************************** +* Function: HI_TDE2_SetDeflickerLevel +* Description: To set the anti-flicker level +* Input: enDeflickerLevel: anti-flicker level +* Output: None +* Return: Success / Error code +* Others: None +*****************************************************************************/ +HI_S32 HI_TDE2_SetDeflickerLevel(TDE_DEFLICKER_LEVEL_E enDeflickerLevel); + +/***************************************************************************** +* Function: HI_TDE2_GetDeflickerLevel +* Description: To get the anti-flicker level +* Input: pDeflickerLevel: to save the anti-flicker level +* Output: None +* Return: Success / Error code +* Others: None +*****************************************************************************/ +HI_S32 HI_TDE2_GetDeflickerLevel(TDE_DEFLICKER_LEVEL_E *pDeflickerLevel); + +/***************************************************************************** +* Function: HI_TDE2_SetAlphaThresholdValue +* Description: To set the anti-flicker level +* Input: u8ThresholdValue: Alpha threshold +* Output: None +* Return: Success / Error code +* Others: None +*****************************************************************************/ +HI_S32 HI_TDE2_SetAlphaThresholdValue(HI_U8 u8ThresholdValue); + +/***************************************************************************** +* Function: HI_TDE2_GetAlphaThresholdValue +* Description: To get the anti-flicker level +* Input: pu8ThresholdValue: to save the alpha threshold +* Output: None +* Return: Success / Error code +* Others: None +*****************************************************************************/ +HI_S32 HI_TDE2_GetAlphaThresholdValue(HI_U8 *pu8ThresholdValue); + +/***************************************************************************** +* Function: HI_TDE2_GetAlphaThresholdValue +* Description: To enable or disable alpha judgment +* Input: bEnAlphaThreshold: whether to enable alpha judgment +* Output: None +* Return: Success / Error code +* Others: None +*****************************************************************************/ +HI_S32 HI_TDE2_SetAlphaThresholdState(HI_BOOL bEnAlphaThreshold); + +/***************************************************************************** +* Function: HI_TDE2_GetAlphaThresholdState +* Description: To get alpha judgment state +* Input: p_bEnAlphaThreshold: To save the alpha judgment state +* Output: None +* Return: Success / Error code +* Others: None +*****************************************************************************/ +HI_S32 HI_TDE2_GetAlphaThresholdState(HI_BOOL * p_bEnAlphaThreshold); + +/***************************************************************************** +* Function: HI_TDE2_PatternFill +* Description: Pattern fill +Input: s32Handle: job handle +* pstBackGround: the background picture information +* pstBackGroundRect: the background picture operation region +* pstForeGround: the foreground picture information +* pstForeGroundRect: the foreground picture operation region +* pstDst: the destination picture information +* pstDstRect: the destination picture operation region +* pstOpt: operation parameter settings +* Output: None +* Return: Success / Error code +* Others: None +*****************************************************************************/ +HI_S32 HI_TDE2_PatternFill(TDE_HANDLE s32Handle, TDE2_SURFACE_S *pstBackGround, + TDE2_RECT_S *pstBackGroundRect, TDE2_SURFACE_S *pstForeGround, + TDE2_RECT_S *pstForeGroundRect, TDE2_SURFACE_S *pstDst, + TDE2_RECT_S *pstDstRect, TDE2_PATTERN_FILL_OPT_S *pstOpt); + +/***************************************************************************** +* Function: HI_TDE2_EnableRegionDeflicker +* Description: To enable or disable the regional anti-flicker function +* Input: bRegionDeflicker: enable flag +* Output: None +* Return: Success / Error code +* Others: None +*****************************************************************************/ +HI_S32 HI_TDE2_EnableRegionDeflicker(HI_BOOL bRegionDeflicker); + +/***************************************************************************** +* Function: HI_TDE2_BeginVideoJob +* Description: Creates a TDE video task +* Input: None +* Output: None +* Return: Success / Error code +* Others: None +*****************************************************************************/ +TDE_HANDLE HI_TDE2_BeginVideoJob(HI_VOID); + +/***************************************************************************** +* Function: HI_TDE2_Mb2Mb +* Description: Adds the transfer operation with additional functions performed on the + macroblock bitmap to a TDE video task +* Input: s32Handle: job handle +* pstMBIn: input surface (macroblock picture) +* pstInRect: operating region of the input surface +* pstMbOut: target surface (macroblock picture) +* pstMbOutRect : target operating region +* pstMbOpt: operation parameter settings +* Output: None +* Return: Success / Error code +* Others: None +*****************************************************************************/ +HI_S32 HI_TDE2_Mb2Mb(TDE_HANDLE s32Handle, TDE2_MB_S* pstMBIn, TDE2_RECT_S *pstInRect, TDE2_MB_S* pstMbOut, TDE2_RECT_S *pstOutRect, + TDE2_MBOPT_S* pstMbOpt); + + +/***************************************************************************** +* Function: HI_TDE2_Osd2Mb +* Description: Adds the operation of blending raster data to the macroblock + bitmap to a task +* Input: s32Handle: job handle +* pstBackGround: background surface (macroblock picture) +* pstBackGroundRect: operating region of the background +* pstForeGround: the foreground picture information(raster picture) +* pstForeGroundRect: the foreground picture operation region +* pstMbOut: target surface (macroblock picture) +* pstMbOutRect : target operating region +* pOpt: operation parameter settings +* Output: None +* Return: Success / Error code +* Others: None +*****************************************************************************/ +HI_S32 HI_TDE2_Osd2Mb(TDE_HANDLE s32Handle, TDE2_MB_S* pstBackGround, TDE2_RECT_S *pstBackGroundRect, TDE2_SURFACE_S* pstForeGround, TDE2_RECT_S *pstForeGroundRect, + TDE2_MB_S* pstMbOut, TDE2_RECT_S *pstMbOutRect, TDE2_OPT_S* pstOpt); + +/***************************************************************************** +* Function: HI_TDE2_MbFill +* Description: Adds a macroblock filling operation to a task +* Input: s32Handle: job handle +* pstMb: the MB picture information +* pstRect: the MB picture operation region +* u32YFill: Filling value of the luminance component +* u32CFill: Filling value of the chrominance component +* eMbFill: Macroblock filling mode +* Output: None +* Return: Success / Error code +* Others: None +*****************************************************************************/ +HI_S32 HI_TDE2_MbFill(TDE_HANDLE s32Handle, TDE2_MB_S *pstMb, TDE2_RECT_S *pstRect, HI_U32 u32YFill, HI_U32 u32CFill, TDE2_MBFILL_E eMbFill); + +HI_S32 HI_TDE2_MbQuickCopy(TDE_HANDLE s32Handle, TDE2_MB_S* pstSrc, + TDE2_RECT_S *pstSrcRect, TDE2_MB_S* pstDst, TDE2_RECT_S *pstDstRect); + +HI_S32 HI_TDE2_MbRotate(TDE_HANDLE s32Handle, TDE2_MB_S *pstSrc, + TDE2_RECT_S *pstSrcRect, TDE2_MB_S *pstDst, TDE2_RECT_S *pstDstRect, + TDE_ROTATE_ANGLE_E enRotateAngle); + +HI_S32 HI_TDE2_MbLDC(TDE_HANDLE s32Handle, TDE2_MB_S *pstSrc, + TDE2_RECT_S *pstSrcRect, TDE2_MB_S *pstDst, TDE2_RECT_S *pstDstRect, + LDC_ATTR_S *pstLDCAttr); + +#ifdef __cplusplus + #if __cplusplus +} + #endif /* __cplusplus */ +#endif /* __cplusplus */ + +#endif /* _HI_API_TDE2_H_ */ diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_tde_errcode.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_tde_errcode.h new file mode 100644 index 0000000000..cdeb76a714 --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_tde_errcode.h @@ -0,0 +1,54 @@ +/****************************************************************************** + Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. + ****************************************************************************** + File Name : tde_errcode.h +Version : Initial Draft +Author : Hisilicon multimedia software group +Created : 2005/4/23 +Last Modified : +Description : err code define +Function List : +History : May modify the code to errcode.h FOR hi3110 + ******************************************************************************/ +#ifndef __TDE_ERRCODE_H__ +#define __TDE_ERRCODE_H__ + +//#include "hi_debug.h" +#include "hi_common.h" + +#ifdef __cplusplus +#if __cplusplus +extern "C"{ +#endif +#endif /* __cplusplus */ + +//#define HI_ID_TDE 100 +/* tde start err no. */ +#define HI_ERR_TDE_BASE ((HI_S32)( ((0x80UL + 0x20UL)<<24) | (100 << 16 ) | (4 << 13) | 1 )) + +enum +{ + HI_ERR_TDE_DEV_NOT_OPEN = HI_ERR_TDE_BASE, /**< tde device not open yet */ + HI_ERR_TDE_DEV_OPEN_FAILED, /**< open tde device failed */ + HI_ERR_TDE_NULL_PTR, /**< input parameters contain null ptr */ + HI_ERR_TDE_NO_MEM, /**< malloc failed */ + HI_ERR_TDE_INVALID_HANDLE, /**< invalid job handle */ + HI_ERR_TDE_INVALID_PARA, /**< invalid parameter */ + HI_ERR_TDE_NOT_ALIGNED, /**< aligned error for position, stride, width */ + HI_ERR_TDE_MINIFICATION, /**< invalid minification */ + HI_ERR_TDE_CLIP_AREA, /**< clip area and operation area have no intersection */ + HI_ERR_TDE_JOB_TIMEOUT, /**< blocked job wait timeout */ + HI_ERR_TDE_UNSUPPORTED_OPERATION, /**< unsupported operation */ + HI_ERR_TDE_QUERY_TIMEOUT /**< query time out */ +}; + + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif /* __cplusplus */ + +#endif /* __TDE_ERRCODE_H__*/ + + diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_tde_type.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_tde_type.h new file mode 100644 index 0000000000..9fdc0385c9 --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/hi_tde_type.h @@ -0,0 +1,657 @@ + /****************************************************************************** + + Copyright (C), 2001-2011, Huawei Tech. Co., Ltd. + + ****************************************************************************** + File Name : tde_type.h +Version : Initial Draft +Author : w54130 +Created : 2007/5/21 +Last Modified : +Description : TDE public type +Function List : +History : +1.Date : 2007/5/21 +Author : w54130 +Modification: Created file + + ******************************************************************************/ +#ifndef __TDE_TYPE_H__ +#define __TDE_TYPE_H__ + + +#ifdef __cplusplus +#if __cplusplus +extern "C"{ +#endif +#endif /* End of #ifdef __cplusplus */ + +#include "hi_tde_errcode.h" + +/****************************************************************************/ +/* TDE2 types define */ +/****************************************************************************/ +/** TDE handle */ +typedef HI_S32 TDE_HANDLE; + +/** TDE callback */ +typedef HI_VOID (* TDE_FUNC_CB) (HI_VOID *pParaml, HI_VOID *pParamr); + +typedef HI_U32 (* TDE_CB_MALLOC) (HI_U32 size, HI_U32* pu32PrvData); + +typedef HI_VOID (* TDE_CB_FREE) (HI_U32 phyAddr,HI_U32 u32PrvData); + +/* color format */ +typedef enum hiTDE2_COLOR_FMT_E +{ + TDE2_COLOR_FMT_RGB444 = 0, /**< RGB444 format */ + TDE2_COLOR_FMT_BGR444, /**< BGR444 format */ + TDE2_COLOR_FMT_RGB555, /**< RGB555 format */ + TDE2_COLOR_FMT_BGR555, /**< BGR555 format */ + TDE2_COLOR_FMT_RGB565, /**< RGB565 format */ + TDE2_COLOR_FMT_BGR565, /**< BGR565 format */ + TDE2_COLOR_FMT_RGB888, /**< RGB888 format */ + TDE2_COLOR_FMT_BGR888, /**< BGR888 format */ + TDE2_COLOR_FMT_ARGB4444, /**< ARGB4444 format */ + TDE2_COLOR_FMT_ABGR4444, /**< ABGR4444 format */ + TDE2_COLOR_FMT_RGBA4444, /**< RGBA4444 format */ + TDE2_COLOR_FMT_BGRA4444, /**< BGRA4444 format */ + TDE2_COLOR_FMT_ARGB1555, /**< ARGB1555 format */ + TDE2_COLOR_FMT_ABGR1555, /**< ABGR1555 format */ + TDE2_COLOR_FMT_RGBA1555, /**< RGBA1555 format */ + TDE2_COLOR_FMT_BGRA1555, /**< BGRA1555 format */ + TDE2_COLOR_FMT_ARGB8565, /**< ARGB8565 format */ + TDE2_COLOR_FMT_ABGR8565, /**< ABGR8565 format */ + TDE2_COLOR_FMT_RGBA8565, /**< RGBA8565 format */ + TDE2_COLOR_FMT_BGRA8565, /**< BGRA8565 format */ + TDE2_COLOR_FMT_ARGB8888, /**< ARGB8888 format */ + TDE2_COLOR_FMT_ABGR8888, /**< ABGR8888 format */ + TDE2_COLOR_FMT_RGBA8888, /**< RGBA8888 format */ + TDE2_COLOR_FMT_BGRA8888, /**< BGRA8888 format */ + TDE2_COLOR_FMT_CLUT1, /**CLUT1 */ + TDE2_COLOR_FMT_CLUT2, /**CLUT2 */ + TDE2_COLOR_FMT_CLUT4, /**CLUT4 */ + TDE2_COLOR_FMT_CLUT8, /**CLUT8 */ + TDE2_COLOR_FMT_ACLUT44, /**CLUT44 */ + TDE2_COLOR_FMT_ACLUT88, /**CLUT88 */ + TDE2_COLOR_FMT_A1, /** +/*************************** Structure Definition ****************************/ + +#define IOC_TYPE_HIFB 'F' +/** To obtain the colorkey of an overlay layer */ +#define FBIOGET_COLORKEY_HIFB _IOR(IOC_TYPE_HIFB, 90, HIFB_COLORKEY_S) +/** To set the colorkey of an overlay layer */ +#define FBIOPUT_COLORKEY_HIFB _IOW(IOC_TYPE_HIFB, 91, HIFB_COLORKEY_S) +/** To get the alpha of an overlay layer */ +#define FBIOGET_ALPHA_HIFB _IOR(IOC_TYPE_HIFB, 92, HIFB_ALPHA_S) +/** To set the alpha of an overlay layer */ +#define FBIOPUT_ALPHA_HIFB _IOW(IOC_TYPE_HIFB, 93, HIFB_ALPHA_S) +/** To get the origin of an overlay layer on the screen */ +#define FBIOGET_SCREEN_ORIGIN_HIFB _IOR(IOC_TYPE_HIFB, 94, HIFB_POINT_S) +/** To set the origin of an overlay layer on the screen */ +#define FBIOPUT_SCREEN_ORIGIN_HIFB _IOW(IOC_TYPE_HIFB, 95, HIFB_POINT_S) +/** To obtain the anti-flicker setting of an overlay layer */ +#define FBIOGET_DEFLICKER_HIFB _IOR(IOC_TYPE_HIFB, 98, HIFB_DEFLICKER_S) +/** To set the anti-flicker setting of an overlay layer */ +#define FBIOPUT_DEFLICKER_HIFB _IOW(IOC_TYPE_HIFB, 99, HIFB_DEFLICKER_S) +/** To wait for the vertical blanking region of an overlay layer */ +#define FBIOGET_VBLANK_HIFB _IO(IOC_TYPE_HIFB, 100) +/** To set the display state of an overlay layer */ +#define FBIOPUT_SHOW_HIFB _IOW(IOC_TYPE_HIFB, 101, HI_BOOL) +/** To obtain the display state of an overlay layer */ +#define FBIOGET_SHOW_HIFB _IOR(IOC_TYPE_HIFB, 102, HI_BOOL) +/** to obtain the capability of an overlay layer */ +#define FBIOGET_CAPABILITY_HIFB _IOR(IOC_TYPE_HIFB, 103, HIFB_CAPABILITY_S) +/** set the screen output size */ +#define FBIOPUT_SCREENSIZE _IOW(IOC_TYPE_HIFB, 130, HIFB_SIZE_S*) +/** get the screen output size */ +#define FBIOGET_SCREENSIZE _IOR(IOC_TYPE_HIFB, 131, HIFB_SIZE_S*) + +/** To display multiple surfaces in turn and set the alpha and colorkey attributes */ +#define FBIOFLIP_SURFACE _IOW(IOC_TYPE_HIFB, 132, HIFB_SURFACEEX_S) + +/**To set the compression function status of an overlay layer*/ +#define FBIOPUT_COMPRESSION_HIFB _IOW(IOC_TYPE_HIFB, 133, HI_BOOL) +/**To obtain the compression function status of an overlay layer*/ +#define FBIOGET_COMPRESSION_HIFB _IOR(IOC_TYPE_HIFB, 134, HI_BOOL) + + +typedef struct +{ + HI_U32 u32Width; + HI_U32 u32Height; +}HIFB_SIZE_S; + +static inline HI_U8 hifb_rgb(const struct fb_bitfield* pBit, HI_S32 color) +{ + return ((HI_U8)((((HI_U32)color)>>pBit->offset) << (8-pBit->length)) + + ((HI_U8)(((HI_U32)(color)>>pBit->offset) << (8-pBit->length)) >> pBit->length)); +} + +static inline HI_S32 hifb_color2key(const struct fb_var_screeninfo* pVar, HI_S32 color) +{ + if (pVar->bits_per_pixel <= 8) + { + return color; + } + else + { + HI_U8 r, g, b; + r = hifb_rgb(&pVar->red, color); + g = hifb_rgb(&pVar->green, color); + b = hifb_rgb(&pVar->blue, color); + return (r<<16) + (g<<8) + b; + } +} + +typedef struct +{ + HI_BOOL bKeyEnable; /* colorkey enable flag */ + HI_U32 u32Key; /* colorkey value, maybe contains alpha */ +}HIFB_COLORKEY_S; + +typedef struct +{ + HI_S32 x, y; + HI_S32 w, h; +} HIFB_RECT; + +typedef struct +{ + HI_S32 s32XPos; /**< horizontal position */ + HI_S32 s32YPos; /**< vertical position */ +}HIFB_POINT_S; + +typedef struct hiHIFB_DEFLICKER_S +{ + HI_U32 u32HDfLevel; /**< horizontal deflicker level */ + HI_U32 u32VDfLevel; /**< vertical deflicker level */ + HI_U8 *pu8HDfCoef; /**< horizontal deflicker coefficient */ + HI_U8 *pu8VDfCoef; /**< vertical deflicker coefficient */ +}HIFB_DEFLICKER_S; + +/** Alpha info */ +typedef struct +{ + HI_BOOL bAlphaEnable; /**< alpha enable flag */ + HI_BOOL bAlphaChannel; /**< alpha channel enable flag */ + HI_U8 u8Alpha0; /**< alpha0 value, used in ARGB1555 */ + HI_U8 u8Alpha1; /**< alpha1 value, used in ARGB1555 */ + HI_U8 u8GlobalAlpha; /**< global alpha value */ + HI_U8 u8Reserved; +}HIFB_ALPHA_S; + +typedef enum +{ + HIFB_FMT_RGB565 = 0, + HIFB_FMT_RGB888, /**< RGB888 24bpp */ + + HIFB_FMT_KRGB444, /**< RGB444 16bpp */ + HIFB_FMT_KRGB555, /**< RGB555 16bpp */ + HIFB_FMT_KRGB888, /**< RGB888 32bpp */ + + HIFB_FMT_ARGB4444, /**< ARGB4444 */ + HIFB_FMT_ARGB1555, /**< ARGB1555 */ + HIFB_FMT_ARGB8888, /**< ARGB8888 */ + HIFB_FMT_ARGB8565, /**< ARGB8565 */ + + HIFB_FMT_RGBA4444, /**< ARGB4444 */ + HIFB_FMT_RGBA5551, /**< RGBA5551 */ + HIFB_FMT_RGBA5658, /**< RGBA5658 */ + HIFB_FMT_RGBA8888, /**< RGBA8888 */ + + HIFB_FMT_BGR565, /**< BGR565 */ + HIFB_FMT_BGR888, /**< BGR888 */ + HIFB_FMT_ABGR4444, /**< ABGR4444 */ + HIFB_FMT_ABGR1555, /**< ABGR1555 */ + HIFB_FMT_ABGR8888, /**< ABGR8888 */ + HIFB_FMT_ABGR8565, /**< ABGR8565 */ + HIFB_FMT_KBGR444, /**< BGR444 16bpp */ + HIFB_FMT_KBGR555, /**< BGR555 16bpp */ + HIFB_FMT_KBGR888, /**< BGR888 32bpp */ + + HIFB_FMT_1BPP, /**< clut1 */ + HIFB_FMT_2BPP, /**< clut2 */ + HIFB_FMT_4BPP, /**< clut4 */ + HIFB_FMT_8BPP, /**< clut8 */ + HIFB_FMT_ACLUT44, /**< AClUT44*/ + HIFB_FMT_ACLUT88, /**< ACLUT88 */ + HIFB_FMT_PUYVY, /**< UYVY */ + HIFB_FMT_PYUYV, /**< YUYV */ + HIFB_FMT_PYVYU, /**< YVYU */ + HIFB_FMT_YUV888, /**< YUV888 */ + HIFB_FMT_AYUV8888, /**< AYUV8888 */ + HIFB_FMT_YUVA8888, /**< YUVA8888 */ + HIFB_FMT_BUTT +}HIFB_COLOR_FMT_E; + +typedef struct +{ + HI_BOOL bKeyRgb; + HI_BOOL bKeyAlpha; /**< whether support colorkey alpha */ + HI_BOOL bGlobalAlpha; /**< whether support global alpha */ + HI_BOOL bCmap; /**< whether support color map */ + HI_BOOL bHasCmapReg; /**< whether has color map register*/ + HI_BOOL bColFmt[HIFB_FMT_BUTT]; /**< support which color format */ + HI_BOOL bVoScale; /**< support vo scale*/ + HI_BOOL bLayerSupported; /**< whether support a certain layer, for example:x5 HD support HIFB_SD_0 not support HIFB_SD_1*/ + HI_U32 u32MaxWidth; /**< the max pixels per line */ + HI_U32 u32MaxHeight; /**< the max lines */ + HI_U32 u32MinWidth; /**< the min pixels per line */ + HI_U32 u32MinHeight; /**< the min lines */ + HI_U32 u32VDefLevel; /**< vertical deflicker level, 0 means vertical deflicker is unsupported */ + HI_U32 u32HDefLevel; /**< horizontal deflicker level, 0 means horizontal deflicker is unsupported */ + HI_BOOL bDcmp; + HI_BOOL bPreMul; +}HIFB_CAPABILITY_S; + +/*refresh mode*/ +typedef enum +{ + HIFB_LAYER_BUF_DOUBLE = 0x0, /**< 2 display buf in fb */ + HIFB_LAYER_BUF_ONE = 0x1, /**< 1 display buf in fb */ + HIFB_LAYER_BUF_NONE = 0x2, /**< no display buf in fb,the buf user refreshed will be directly set to VO*/ + HIFB_LAYER_BUF_DOUBLE_IMMEDIATE=0x3, /**< 2 display buf in fb, each refresh will be displayed*/ + HIFB_LAYER_BUF_BUTT +} HIFB_LAYER_BUF_E; + +/* surface info */ +typedef struct +{ + HI_U32 u32PhyAddr; /**< start physical address */ + HI_U32 u32Width; /**< width pixels */ + HI_U32 u32Height; /**< height pixels */ + HI_U32 u32Pitch; /**< line pixels */ + HIFB_COLOR_FMT_E enFmt; /**< color format */ +}HIFB_SURFACE_S; + +typedef struct +{ + HI_U32 u32PhyAddr; + HIFB_ALPHA_S stAlpha; + HIFB_COLORKEY_S stColorkey; +}HIFB_SURFACEEX_S; + +/* refresh surface info */ +typedef struct +{ + HIFB_SURFACE_S stCanvas; + HIFB_RECT UpdateRect; /* refresh region*/ +}HIFB_BUFFER_S; + +/* cursor info */ +typedef struct +{ + HIFB_SURFACE_S stCursor; + HIFB_POINT_S stHotPos; +} HIFB_CURSOR_S; + +/* crusor handle */ +/* Attention:surface in cursor will be released by user*/ +#define FBIOPUT_CURSOR_INFO _IOW(IOC_TYPE_HIFB, 104, HIFB_CURSOR_S *) +#define FBIOGET_CURSOR_INFO _IOW(IOC_TYPE_HIFB, 105, HIFB_CURSOR_S *) + +#define FBIOPUT_CURSOR_STATE _IOW(IOC_TYPE_HIFB, 106, HI_BOOL *) +#define FBIOGET_CURSOR_STATE _IOW(IOC_TYPE_HIFB, 107, HI_BOOL *) + +#define FBIOPUT_CURSOR_POS _IOW(IOC_TYPE_HIFB, 108, HIFB_POINT_S *) +#define FBIOGET_CURSOR_POS _IOR(IOC_TYPE_HIFB, 109, HIFB_POINT_S *) + +#define FBIOPUT_CURSOR_COLORKEY _IOR(IOC_TYPE_HIFB, 110, HIFB_COLORKEY_S *) +#define FBIOGET_CURSOR_COLORKEY _IOW(IOC_TYPE_HIFB, 111, HIFB_COLORKEY_S *) +#define FBIOPUT_CURSOR_ALPHA _IOR(IOC_TYPE_HIFB, 112, HIFB_ALPHA_S *) +#define FBIOGET_CURSOR_ALPHA _IOW(IOC_TYPE_HIFB, 113, HIFB_ALPHA_S *) + +/** cursor will be separated from attached layer automatically if you attach cursor to another layer,that means +cursor can be attached to only one layer at any time*/ +#define FBIOPUT_CURSOR_ATTCHCURSOR _IOW(IOC_TYPE_HIFB, 114, HI_U32 *) +#define FBIOPUT_CURSOR_DETACHCURSOR _IOW(IOC_TYPE_HIFB, 115, HI_U32 *) + +/**antiflicker level*/ +/**Auto means fb will choose a appropriate antiflicker level automatically according to the color info of map*/ +typedef enum +{ + HIFB_LAYER_ANTIFLICKER_NONE = 0x0, /**< no antiflicker*/ + HIFB_LAYER_ANTIFLICKER_LOW = 0x1, /**< low level*/ + HIFB_LAYER_ANTIFLICKER_MIDDLE = 0x2,/**< middle level*/ + HIFB_LAYER_ANTIFLICKER_HIGH = 0x3, /**< high level*/ + HIFB_LAYER_ANTIFLICKER_AUTO = 0x4, /**< auto*/ + HIFB_LAYER_ANTIFLICKER_BUTT +}HIFB_LAYER_ANTIFLICKER_LEVEL_E; + +/*layer info maskbit*/ +typedef enum +{ + HIFB_LAYERMASK_BUFMODE = 0x1, /**< BUFMODE bitmask */ + HIFB_LAYERMASK_ANTIFLICKER_MODE = 0x2, /**< ANTIFLICKER_MODE bitmask */ + HIFB_LAYERMASK_POS = 0x4, /**< the position bitmask */ + HIFB_LAYERMASK_CANVASSIZE = 0x8, /**< canvassize bitmask */ + HIFB_LAYERMASK_DISPSIZE = 0x10, /**< displaysize bitmask */ + HIFB_LAYERMASK_SCREENSIZE = 0x20, /**< screensize bitmask */ + HIFB_LAYERMASK_BMUL = 0x40, /**< pre-mult bitmask */ + HIFB_LAYERMASK_BUTT +}HIFB_LAYER_INFO_MASKBIT; + +/**layer info*/ +typedef struct +{ + HIFB_LAYER_BUF_E BufMode; + HIFB_LAYER_ANTIFLICKER_LEVEL_E eAntiflickerLevel; + HI_S32 s32XPos; /**< the x pos of origion point in screen */ + HI_S32 s32YPos; /**< the y pos of origion point in screen */ + HI_S32 u32CanvasWidth; /**< the width of canvas buffer */ + HI_S32 u32CanvasHeight; /**< the height of canvas buffer */ + HI_U32 u32DisplayWidth; /**< the width of display buf in fb.for 0 buf ,there is no display buf in fb, so it's effectless*/ + HI_U32 u32DisplayHeight; /**< the height of display buf in fb. */ + HI_U32 u32ScreenWidth; /**< the width of screen */ + HI_U32 u32ScreenHeight; /**< the height of screen */ + HI_BOOL bPreMul; /**< The data drawed in buf is premul data or not*/ + HI_U32 u32Mask; /**< param modify mask bit*/ +}HIFB_LAYER_INFO_S; + +/** To set the layer information */ +#define FBIOPUT_LAYER_INFO _IOW(IOC_TYPE_HIFB, 120, HIFB_LAYER_INFO_S*) +/** To get the layer information */ +#define FBIOGET_LAYER_INFO _IOR(IOC_TYPE_HIFB, 121, HIFB_LAYER_INFO_S*) +/** To get canvas buf */ +#define FBIOGET_CANVAS_BUFFER _IOR(IOC_TYPE_HIFB, 123, HIFB_BUFFER_S*) +/** To refresh the displayed contents in extended mode */ +#define FBIO_REFRESH _IOW(IOC_TYPE_HIFB, 124, HIFB_BUFFER_S*) + +/**sync refresh*/ +#define FBIO_WAITFOR_FREFRESH_DONE _IO(IOC_TYPE_HIFB, 125) + + + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif /* __cplusplus */ + + +#endif /* __HIFB_H__ */ + diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/jconfig.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/jconfig.h new file mode 100644 index 0000000000..9594ec56bb --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/jconfig.h @@ -0,0 +1,45 @@ +/* jconfig.h. Generated automatically by configure. */ +/* jconfig.cfg --- source file edited by configure script */ +/* see jconfig.doc for explanations */ + +#define HAVE_PROTOTYPES +#define HAVE_UNSIGNED_CHAR +#define HAVE_UNSIGNED_SHORT +#undef void +#undef const +#undef CHAR_IS_UNSIGNED +#define HAVE_STDDEF_H +#define HAVE_STDLIB_H +#undef NEED_BSD_STRINGS +#undef NEED_SYS_TYPES_H +#undef NEED_FAR_POINTERS +#undef NEED_SHORT_EXTERNAL_NAMES +/* Define this if you get warnings about undefined structures. */ +#undef INCOMPLETE_TYPES_BROKEN + +#ifdef JPEG_INTERNALS + +#undef RIGHT_SHIFT_IS_UNSIGNED +#define INLINE __inline__ +/* These are for configuring the JPEG memory manager. */ +#undef DEFAULT_MAX_MEM +#undef NO_MKTEMP + +#endif /* JPEG_INTERNALS */ + +#ifdef JPEG_CJPEG_DJPEG + +#define BMP_SUPPORTED /* BMP image file format */ +#define GIF_SUPPORTED /* GIF image file format */ +#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ +#undef RLE_SUPPORTED /* Utah RLE image file format */ +#define TARGA_SUPPORTED /* Targa image file format */ + +#undef TWO_FILE_COMMANDLINE +#undef NEED_SIGNAL_CATCHER +#undef DONT_USE_B_MODE + +/* Define this if you want percent-done progress reports from cjpeg/djpeg. */ +#undef PROGRESS_REPORT + +#endif /* JPEG_CJPEG_DJPEG */ diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/jerror.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/jerror.h new file mode 100644 index 0000000000..e2106874d4 --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/jerror.h @@ -0,0 +1,451 @@ +/* + * jerror.h + * + * Copyright (C) 1994-1997, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file defines the error and message codes for the JPEG library. + * Edit this file to add new codes, or to translate the message strings to + * some other language. + * A set of error-reporting macros are defined too. Some applications using + * the JPEG library may wish to include this file to get the error codes + * and/or the macros. + */ + +/* + * To define the enum list of message codes, include this file without + * defining macro JMESSAGE. To create a message string table, include it + * again with a suitable JMESSAGE definition (see jerror.c for an example). + */ +#ifndef JMESSAGE +#ifndef JERROR_H +/* First time through, define the enum list */ +#define JMAKE_ENUM_LIST +#else +/* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */ +#define JMESSAGE(code,string) +#endif /* JERROR_H */ +#endif /* JMESSAGE */ + +#ifdef JMAKE_ENUM_LIST + +typedef enum { + +#define JMESSAGE(code,string) code , + +#endif /* JMAKE_ENUM_LIST */ + + +#ifdef HI_ADVCA_FUNCTION_RELEASE +/** ¸ß°²°æ±¾²»ÄÜÓе÷ÊÔ×Ö·û´® **/ +JMESSAGE(JMSG_NOMESSAGE, "") +JMESSAGE(JERR_ARITH_NOTIMPL, "") +JMESSAGE(JERR_BAD_ALIGN_TYPE, "") +JMESSAGE(JERR_BAD_ALLOC_CHUNK, "") +JMESSAGE(JERR_BAD_BUFFER_MODE, "") +JMESSAGE(JERR_BAD_COMPONENT_ID, "") +JMESSAGE(JERR_BAD_DCT_COEF, "") +JMESSAGE(JERR_BAD_DCTSIZE, "") +JMESSAGE(JERR_BAD_HUFF_TABLE, "") +JMESSAGE(JERR_BAD_IN_COLORSPACE, "") +JMESSAGE(JERR_BAD_J_COLORSPACE, "") +JMESSAGE(JERR_BAD_LENGTH, "") +JMESSAGE(JERR_BAD_LIB_VERSION, "") +JMESSAGE(JERR_BAD_MCU_SIZE, "") +JMESSAGE(JERR_BAD_POOL_ID, "") +JMESSAGE(JERR_BAD_PRECISION, "") +JMESSAGE(JERR_BAD_PROGRESSION, "") +JMESSAGE(JERR_BAD_PROG_SCRIPT, "") +JMESSAGE(JERR_BAD_SAMPLING, "") +JMESSAGE(JERR_BAD_SCAN_SCRIPT, "") +JMESSAGE(JERR_BAD_STATE, "") +JMESSAGE(JERR_BAD_STRUCT_SIZE, "") +JMESSAGE(JERR_BAD_VIRTUAL_ACCESS, "") +JMESSAGE(JERR_BUFFER_SIZE, "") +JMESSAGE(JERR_CANT_SUSPEND, "") +JMESSAGE(JERR_CCIR601_NOTIMPL, "") +JMESSAGE(JERR_COMPONENT_COUNT, "") +JMESSAGE(JERR_CONVERSION_NOTIMPL, "") +JMESSAGE(JERR_DAC_INDEX, "") +JMESSAGE(JERR_DAC_VALUE, "") +JMESSAGE(JERR_DHT_INDEX, "") +JMESSAGE(JERR_DQT_INDEX, "") +JMESSAGE(JERR_EMPTY_IMAGE, "") +JMESSAGE(JERR_EMS_READ, "") +JMESSAGE(JERR_EMS_WRITE, "") +JMESSAGE(JERR_EOI_EXPECTED, "") +JMESSAGE(JERR_FILE_READ, "") +JMESSAGE(JERR_FILE_WRITE, "") +JMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL,"") +JMESSAGE(JERR_HUFF_CLEN_OVERFLOW, "") +JMESSAGE(JERR_HUFF_MISSING_CODE, "") +JMESSAGE(JERR_IMAGE_TOO_BIG, "") +JMESSAGE(JERR_INPUT_EMPTY, "") +JMESSAGE(JERR_INPUT_EOF, "") +JMESSAGE(JERR_MISMATCHED_QUANT_TABLE,"") +JMESSAGE(JERR_MISSING_DATA, "") +JMESSAGE(JERR_MODE_CHANGE, "") +JMESSAGE(JERR_NOTIMPL, "") +JMESSAGE(JERR_NOT_COMPILED, "") +JMESSAGE(JERR_NO_BACKING_STORE, "") +JMESSAGE(JERR_NO_HUFF_TABLE, "") +JMESSAGE(JERR_NO_IMAGE, "") +JMESSAGE(JERR_NO_QUANT_TABLE, "") +JMESSAGE(JERR_NO_SOI, "") +JMESSAGE(JERR_OUT_OF_MEMORY, "") +JMESSAGE(JERR_QUANT_COMPONENTS, "") +JMESSAGE(JERR_QUANT_FEW_COLORS, "") +JMESSAGE(JERR_QUANT_MANY_COLORS, "") +JMESSAGE(JERR_SOF_DUPLICATE, "") +JMESSAGE(JERR_SOF_NO_SOS, "") +JMESSAGE(JERR_SOF_UNSUPPORTED, "") +JMESSAGE(JERR_SOI_DUPLICATE, "") +JMESSAGE(JERR_SOS_NO_SOF, "") +JMESSAGE(JERR_TFILE_CREATE, "") +JMESSAGE(JERR_TFILE_READ, "") +JMESSAGE(JERR_TFILE_SEEK, "") +JMESSAGE(JERR_TFILE_WRITE, "") +JMESSAGE(JERR_TOO_LITTLE_DATA, "") +JMESSAGE(JERR_UNKNOWN_MARKER, "") +JMESSAGE(JERR_VIRTUAL_BUG, "") +JMESSAGE(JERR_WIDTH_OVERFLOW, "") +JMESSAGE(JERR_XMS_READ, "") +JMESSAGE(JERR_XMS_WRITE, "") +JMESSAGE(JMSG_COPYRIGHT, "") +JMESSAGE(JMSG_VERSION, "") +JMESSAGE(JTRC_16BIT_TABLES, "") +JMESSAGE(JTRC_ADOBE, "") +JMESSAGE(JTRC_APP0, "") +JMESSAGE(JTRC_APP14, "") +JMESSAGE(JTRC_DAC, "") +JMESSAGE(JTRC_DHT, "") +JMESSAGE(JTRC_DQT, "") +JMESSAGE(JTRC_DRI, "") +JMESSAGE(JTRC_EMS_CLOSE, "") +JMESSAGE(JTRC_EMS_OPEN, "") +JMESSAGE(JTRC_EOI, "") +JMESSAGE(JTRC_HUFFBITS, "") +JMESSAGE(JTRC_JFIF, "") +JMESSAGE(JTRC_JFIF_BADTHUMBNAILSIZE,"") +JMESSAGE(JTRC_JFIF_EXTENSION, "") +JMESSAGE(JTRC_JFIF_THUMBNAIL, "") +JMESSAGE(JTRC_MISC_MARKER, "") +JMESSAGE(JTRC_PARMLESS_MARKER, "") +JMESSAGE(JTRC_QUANTVALS, "") +JMESSAGE(JTRC_QUANT_3_NCOLORS, "") +JMESSAGE(JTRC_QUANT_NCOLORS, "") +JMESSAGE(JTRC_QUANT_SELECTED, "") +JMESSAGE(JTRC_RECOVERY_ACTION, "") +JMESSAGE(JTRC_RST, "") +JMESSAGE(JTRC_SMOOTH_NOTIMPL, "") +JMESSAGE(JTRC_SOF, "") +JMESSAGE(JTRC_SOF_COMPONENT, "") +JMESSAGE(JTRC_SOI, "") +JMESSAGE(JTRC_SOS, "") +JMESSAGE(JTRC_SOS_COMPONENT, "") +JMESSAGE(JTRC_SOS_PARAMS, "") +JMESSAGE(JTRC_TFILE_CLOSE, "") +JMESSAGE(JTRC_TFILE_OPEN, "") +JMESSAGE(JTRC_THUMB_JPEG, "") +JMESSAGE(JTRC_THUMB_PALETTE, "") +JMESSAGE(JTRC_THUMB_RGB, "") +JMESSAGE(JTRC_UNKNOWN_IDS, "") +JMESSAGE(JTRC_XMS_CLOSE, "") +JMESSAGE(JTRC_XMS_OPEN, "") +JMESSAGE(JWRN_ADOBE_XFORM, "") +JMESSAGE(JWRN_BOGUS_PROGRESSION, "") +JMESSAGE(JWRN_EXTRANEOUS_DATA, "") +JMESSAGE(JWRN_HIT_MARKER, "") +JMESSAGE(JWRN_HUFF_BAD_CODE, "") +JMESSAGE(JWRN_JFIF_MAJOR, "") +JMESSAGE(JWRN_JPEG_EOF, "") +JMESSAGE(JWRN_MUST_RESYNC, "") +JMESSAGE(JWRN_NOT_SEQUENTIAL, "") +JMESSAGE(JWRN_TOO_MUCH_DATA, "") +/* add some error message by y00181162 */ +JMESSAGE(JERR_HDEC_INIT_FAILURE, "") +JMESSAGE(JERR_MMZ_STREAM_MEM_LACK, "") +JMESSAGE(JERR_MMZ_YUV_MEM_LACK, "") +JMESSAGE(JERR_MMZ_OUT_MEM_LACK, "") +JMESSAGE(JERR_CLIENT_DATA_ERR, "") +JMESSAGE(JWRN_IS_YCCK_CMYK_PIC, "") +JMESSAGE(JERR_STREAM_BACK_FAILURE, "") +JMESSAGE(JERR_HARD_CSC_FAILURE, "") +JMESSAGE(JERR_CROP_CANNOT_SUPPORT, "") + +JMESSAGE(JERR_HENC_INIT_FAILURE, "") +JMESSAGE(JERR_HENC_COLOR_NOSUPPORT, "") + +#else + +JMESSAGE(JMSG_NOMESSAGE, "Bogus message code %d") /* Must be first entry! */ + +/* For maintenance convenience, list is alphabetical by message code name */ +JMESSAGE(JERR_ARITH_NOTIMPL, + "Sorry, there are legal restrictions on arithmetic coding") +JMESSAGE(JERR_BAD_ALIGN_TYPE, "ALIGN_TYPE is wrong, please fix") +JMESSAGE(JERR_BAD_ALLOC_CHUNK, "MAX_ALLOC_CHUNK is wrong, please fix") +JMESSAGE(JERR_BAD_BUFFER_MODE, "Bogus buffer control mode") +JMESSAGE(JERR_BAD_COMPONENT_ID, "Invalid component ID %d in SOS") +JMESSAGE(JERR_BAD_DCT_COEF, "DCT coefficient out of range") +JMESSAGE(JERR_BAD_DCTSIZE, "IDCT output block size %d not supported") +JMESSAGE(JERR_BAD_HUFF_TABLE, "Bogus Huffman table definition") +JMESSAGE(JERR_BAD_IN_COLORSPACE, "Bogus input colorspace") +JMESSAGE(JERR_BAD_J_COLORSPACE, "Bogus JPEG colorspace") +JMESSAGE(JERR_BAD_LENGTH, "Bogus marker length") +JMESSAGE(JERR_BAD_LIB_VERSION, + "Wrong JPEG library version: library is %d, caller expects %d") +JMESSAGE(JERR_BAD_MCU_SIZE, "Sampling factors too large for interleaved scan") +JMESSAGE(JERR_BAD_POOL_ID, "Invalid memory pool code %d") +JMESSAGE(JERR_BAD_PRECISION, "Unsupported JPEG data precision %d") +JMESSAGE(JERR_BAD_PROGRESSION, + "Invalid progressive parameters Ss=%d Se=%d Ah=%d Al=%d") +JMESSAGE(JERR_BAD_PROG_SCRIPT, + "Invalid progressive parameters at scan script entry %d") +JMESSAGE(JERR_BAD_SAMPLING, "Bogus sampling factors") +JMESSAGE(JERR_BAD_SCAN_SCRIPT, "Invalid scan script at entry %d") +JMESSAGE(JERR_BAD_STATE, "Improper call to JPEG library in state %d") +JMESSAGE(JERR_BAD_STRUCT_SIZE, + "JPEG parameter struct mismatch: library thinks size is %u, caller expects %u") +JMESSAGE(JERR_BAD_VIRTUAL_ACCESS, "Bogus virtual array access") +JMESSAGE(JERR_BUFFER_SIZE, "Buffer passed to JPEG library is too small") +JMESSAGE(JERR_CANT_SUSPEND, "Suspension not allowed here") +JMESSAGE(JERR_CCIR601_NOTIMPL, "CCIR601 sampling not implemented yet") +JMESSAGE(JERR_COMPONENT_COUNT, "Too many color components: %d, max %d") +JMESSAGE(JERR_CONVERSION_NOTIMPL, "Unsupported color conversion request") +JMESSAGE(JERR_DAC_INDEX, "Bogus DAC index %d") +JMESSAGE(JERR_DAC_VALUE, "Bogus DAC value 0x%x") +JMESSAGE(JERR_DHT_INDEX, "Bogus DHT index %d") +JMESSAGE(JERR_DQT_INDEX, "Bogus DQT index %d") +JMESSAGE(JERR_EMPTY_IMAGE, "Empty JPEG image (DNL not supported)") +JMESSAGE(JERR_EMS_READ, "Read from EMS failed") +JMESSAGE(JERR_EMS_WRITE, "Write to EMS failed") +JMESSAGE(JERR_EOI_EXPECTED, "Didn't expect more than one scan") +JMESSAGE(JERR_FILE_READ, "Input file read error") +JMESSAGE(JERR_FILE_WRITE, "Output file write error --- out of disk space?") +JMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, "Fractional sampling not implemented yet") +JMESSAGE(JERR_HUFF_CLEN_OVERFLOW, "Huffman code size table overflow") +JMESSAGE(JERR_HUFF_MISSING_CODE, "Missing Huffman code table entry") +JMESSAGE(JERR_IMAGE_TOO_BIG, "Maximum supported image dimension is %u pixels") +JMESSAGE(JERR_INPUT_EMPTY, "Empty input file") +JMESSAGE(JERR_INPUT_EOF, "Premature end of input file") +JMESSAGE(JERR_MISMATCHED_QUANT_TABLE, + "Cannot transcode due to multiple use of quantization table %d") +JMESSAGE(JERR_MISSING_DATA, "Scan script does not transmit all data") +JMESSAGE(JERR_MODE_CHANGE, "Invalid color quantization mode change") +JMESSAGE(JERR_NOTIMPL, "Not implemented yet") +JMESSAGE(JERR_NOT_COMPILED, "Requested feature was omitted at compile time") +JMESSAGE(JERR_NO_BACKING_STORE, "Backing store not supported") +JMESSAGE(JERR_NO_HUFF_TABLE, "Huffman table 0x%02x was not defined") +JMESSAGE(JERR_NO_IMAGE, "JPEG datastream contains no image") +JMESSAGE(JERR_NO_QUANT_TABLE, "Quantization table 0x%02x was not defined") +JMESSAGE(JERR_NO_SOI, "Not a JPEG file: starts with 0x%02x 0x%02x") +JMESSAGE(JERR_OUT_OF_MEMORY, "Insufficient memory (case %d)") +JMESSAGE(JERR_QUANT_COMPONENTS, + "Cannot quantize more than %d color components") +JMESSAGE(JERR_QUANT_FEW_COLORS, "Cannot quantize to fewer than %d colors") +JMESSAGE(JERR_QUANT_MANY_COLORS, "Cannot quantize to more than %d colors") +JMESSAGE(JERR_SOF_DUPLICATE, "Invalid JPEG file structure: two SOF markers") +JMESSAGE(JERR_SOF_NO_SOS, "Invalid JPEG file structure: missing SOS marker") +JMESSAGE(JERR_SOF_UNSUPPORTED, "Unsupported JPEG process: SOF type 0x%02x") +JMESSAGE(JERR_SOI_DUPLICATE, "Invalid JPEG file structure: two SOI markers") +JMESSAGE(JERR_SOS_NO_SOF, "Invalid JPEG file structure: SOS before SOF") +JMESSAGE(JERR_TFILE_CREATE, "Failed to create temporary file %s") +JMESSAGE(JERR_TFILE_READ, "Read failed on temporary file") +JMESSAGE(JERR_TFILE_SEEK, "Seek failed on temporary file") +JMESSAGE(JERR_TFILE_WRITE, + "Write failed on temporary file --- out of disk space?") +JMESSAGE(JERR_TOO_LITTLE_DATA, "Application transferred too few scanlines") +JMESSAGE(JERR_UNKNOWN_MARKER, "Unsupported marker type 0x%02x") +JMESSAGE(JERR_VIRTUAL_BUG, "Virtual array controller messed up") +JMESSAGE(JERR_WIDTH_OVERFLOW, "Image too wide for this implementation") +JMESSAGE(JERR_XMS_READ, "Read from XMS failed") +JMESSAGE(JERR_XMS_WRITE, "Write to XMS failed") +JMESSAGE(JMSG_COPYRIGHT, JCOPYRIGHT) +JMESSAGE(JMSG_VERSION, JVERSION) +JMESSAGE(JTRC_16BIT_TABLES, + "Caution: quantization tables are too coarse for baseline JPEG") +JMESSAGE(JTRC_ADOBE, + "Adobe APP14 marker: version %d, flags 0x%04x 0x%04x, transform %d") +JMESSAGE(JTRC_APP0, "Unknown APP0 marker (not JFIF), length %u") +JMESSAGE(JTRC_APP14, "Unknown APP14 marker (not Adobe), length %u") +JMESSAGE(JTRC_DAC, "Define Arithmetic Table 0x%02x: 0x%02x") +JMESSAGE(JTRC_DHT, "Define Huffman Table 0x%02x") +JMESSAGE(JTRC_DQT, "Define Quantization Table %d precision %d") +JMESSAGE(JTRC_DRI, "Define Restart Interval %u") +JMESSAGE(JTRC_EMS_CLOSE, "Freed EMS handle %u") +JMESSAGE(JTRC_EMS_OPEN, "Obtained EMS handle %u") +JMESSAGE(JTRC_EOI, "End Of Image") +JMESSAGE(JTRC_HUFFBITS, " %3d %3d %3d %3d %3d %3d %3d %3d") +JMESSAGE(JTRC_JFIF, "JFIF APP0 marker: version %d.%02d, density %dx%d %d") +JMESSAGE(JTRC_JFIF_BADTHUMBNAILSIZE, + "Warning: thumbnail image size does not match data length %u") +JMESSAGE(JTRC_JFIF_EXTENSION, + "JFIF extension marker: type 0x%02x, length %u") +JMESSAGE(JTRC_JFIF_THUMBNAIL, " with %d x %d thumbnail image") +JMESSAGE(JTRC_MISC_MARKER, "Miscellaneous marker 0x%02x, length %u") +JMESSAGE(JTRC_PARMLESS_MARKER, "Unexpected marker 0x%02x") +JMESSAGE(JTRC_QUANTVALS, " %4u %4u %4u %4u %4u %4u %4u %4u") +JMESSAGE(JTRC_QUANT_3_NCOLORS, "Quantizing to %d = %d*%d*%d colors") +JMESSAGE(JTRC_QUANT_NCOLORS, "Quantizing to %d colors") +JMESSAGE(JTRC_QUANT_SELECTED, "Selected %d colors for quantization") +JMESSAGE(JTRC_RECOVERY_ACTION, "At marker 0x%02x, recovery action %d") +JMESSAGE(JTRC_RST, "RST%d") +JMESSAGE(JTRC_SMOOTH_NOTIMPL, + "Smoothing not supported with nonstandard sampling ratios") +JMESSAGE(JTRC_SOF, "Start Of Frame 0x%02x: width=%u, height=%u, components=%d") +JMESSAGE(JTRC_SOF_COMPONENT, " Component %d: %dhx%dv q=%d") +JMESSAGE(JTRC_SOI, "Start of Image") +JMESSAGE(JTRC_SOS, "Start Of Scan: %d components") +JMESSAGE(JTRC_SOS_COMPONENT, " Component %d: dc=%d ac=%d") +JMESSAGE(JTRC_SOS_PARAMS, " Ss=%d, Se=%d, Ah=%d, Al=%d") +JMESSAGE(JTRC_TFILE_CLOSE, "Closed temporary file %s") +JMESSAGE(JTRC_TFILE_OPEN, "Opened temporary file %s") +JMESSAGE(JTRC_THUMB_JPEG, + "JFIF extension marker: JPEG-compressed thumbnail image, length %u") +JMESSAGE(JTRC_THUMB_PALETTE, + "JFIF extension marker: palette thumbnail image, length %u") +JMESSAGE(JTRC_THUMB_RGB, + "JFIF extension marker: RGB thumbnail image, length %u") +JMESSAGE(JTRC_UNKNOWN_IDS, + "Unrecognized component IDs %d %d %d, assuming YCbCr") +JMESSAGE(JTRC_XMS_CLOSE, "Freed XMS handle %u") +JMESSAGE(JTRC_XMS_OPEN, "Obtained XMS handle %u") +JMESSAGE(JWRN_ADOBE_XFORM, "Unknown Adobe color transform code %d") +JMESSAGE(JWRN_BOGUS_PROGRESSION, + "Inconsistent progression sequence for component %d coefficient %d") +JMESSAGE(JWRN_EXTRANEOUS_DATA, + "Corrupt JPEG data: %u extraneous bytes before marker 0x%02x") +JMESSAGE(JWRN_HIT_MARKER, "Corrupt JPEG data: premature end of data segment") +JMESSAGE(JWRN_HUFF_BAD_CODE, "Corrupt JPEG data: bad Huffman code") +JMESSAGE(JWRN_JFIF_MAJOR, "Warning: unknown JFIF revision number %d.%02d") +JMESSAGE(JWRN_JPEG_EOF, "Premature end of JPEG file") +JMESSAGE(JWRN_MUST_RESYNC, + "Corrupt JPEG data: found marker 0x%02x instead of RST%d") +JMESSAGE(JWRN_NOT_SEQUENTIAL, "Invalid SOS parameters for sequential JPEG") +JMESSAGE(JWRN_TOO_MUCH_DATA, "Application transferred too many scanlines") + +/* add some error message by y00181162 */ +JMESSAGE(JERR_HDEC_INIT_FAILURE, "JPEG_HDEC_Init failure") +JMESSAGE(JERR_MMZ_STREAM_MEM_LACK, "lack of mem to alloc stream memory") +JMESSAGE(JERR_MMZ_YUV_MEM_LACK, "lack of mem to alloc yuv middle memory") +JMESSAGE(JERR_MMZ_OUT_MEM_LACK, "lack of mem to alloc output memory") +JMESSAGE(JERR_CLIENT_DATA_ERR, "the client data is different with our data") +JMESSAGE(JWRN_IS_YCCK_CMYK_PIC, "this picture is ycck or cmyk picture") +JMESSAGE(JERR_STREAM_BACK_FAILURE, "this stream back failure,no soft dec again") +JMESSAGE(JERR_HARD_CSC_FAILURE, "the hard color convert failure,so the dec failure") +JMESSAGE(JERR_CROP_CANNOT_SUPPORT, "can not support crop") + +JMESSAGE(JERR_HENC_INIT_FAILURE, "JPGE_HENC_Init failure") +JMESSAGE(JERR_HENC_COLOR_NOSUPPORT, "jpeg encode input colorspace is not support") + +#endif + + +#ifdef JMAKE_ENUM_LIST + + JMSG_LASTMSGCODE +} J_MESSAGE_CODE; + +#undef JMAKE_ENUM_LIST +#endif /* JMAKE_ENUM_LIST */ + +/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */ +#undef JMESSAGE + + +#ifndef JERROR_H +#define JERROR_H + +/* Macros to simplify using the error and trace message stuff */ +/* The first parameter is either type of cinfo pointer */ + +/* Fatal errors (print message and exit) */ +#define ERREXIT(cinfo,code) \ + ((cinfo)->err->msg_code = (code), \ + (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) +#define ERREXIT1(cinfo,code,p1) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) +#define ERREXIT2(cinfo,code,p1,p2) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (cinfo)->err->msg_parm.i[1] = (p2), \ + (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) +#define ERREXIT3(cinfo,code,p1,p2,p3) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (cinfo)->err->msg_parm.i[1] = (p2), \ + (cinfo)->err->msg_parm.i[2] = (p3), \ + (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) +#define ERREXIT4(cinfo,code,p1,p2,p3,p4) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (cinfo)->err->msg_parm.i[1] = (p2), \ + (cinfo)->err->msg_parm.i[2] = (p3), \ + (cinfo)->err->msg_parm.i[3] = (p4), \ + (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) +#define ERREXITS(cinfo,code,str) \ + ((cinfo)->err->msg_code = (code), \ + strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \ + (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) + +#define MAKESTMT(stuff) do { stuff } while (0) + +/* Nonfatal errors (we can keep going, but the data is probably corrupt) */ +#define WARNMS(cinfo,code) \ + ((cinfo)->err->msg_code = (code), \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) +#define WARNMS1(cinfo,code,p1) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) +#define WARNMS2(cinfo,code,p1,p2) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (cinfo)->err->msg_parm.i[1] = (p2), \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) + +/* Informational/debugging messages */ +#define TRACEMS(cinfo,lvl,code) \ + ((cinfo)->err->msg_code = (code), \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) +#define TRACEMS1(cinfo,lvl,code,p1) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) +#define TRACEMS2(cinfo,lvl,code,p1,p2) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (cinfo)->err->msg_parm.i[1] = (p2), \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) +#define TRACEMS3(cinfo,lvl,code,p1,p2,p3) \ + MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ + _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); \ + (cinfo)->err->msg_code = (code); \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) +#define TRACEMS4(cinfo,lvl,code,p1,p2,p3,p4) \ + MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ + _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ + (cinfo)->err->msg_code = (code); \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) +#define TRACEMS5(cinfo,lvl,code,p1,p2,p3,p4,p5) \ + MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ + _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ + _mp[4] = (p5); \ + (cinfo)->err->msg_code = (code); \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) +#define TRACEMS8(cinfo,lvl,code,p1,p2,p3,p4,p5,p6,p7,p8) \ + MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ + _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ + _mp[4] = (p5); _mp[5] = (p6); _mp[6] = (p7); _mp[7] = (p8); \ + (cinfo)->err->msg_code = (code); \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) +#define TRACEMSS(cinfo,lvl,code,str) \ + ((cinfo)->err->msg_code = (code), \ + strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) + +#endif /* JERROR_H */ diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/jmorecfg.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/jmorecfg.h new file mode 100644 index 0000000000..02e5dc4079 --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/jmorecfg.h @@ -0,0 +1,373 @@ +/* + * jmorecfg.h + * + * Copyright (C) 1991-1997, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains additional configuration options that customize the + * JPEG software for special applications or support machine-dependent + * optimizations. Most users will not need to touch this file. + */ + + +#define PACK_SHORT2_565(r,g,b) ((((r) >> 3) << 11)|(((g)>> 2) << 5)|(((b)>>3))) +#define PACK_SHORT_1555(a,r,g,b) (((a)<<15) | (((r) >> 3) << 10)|(((g)>> 3) << 5)|(((b)>>3))) +#define PACK_SHORT_565(r,g,b) ((((r)<<8)&0xf800)|(((g)<<3)&0x7E0)|((b)>>3)) +#define PACK_TWO_PIXELS(l,r) ((r<<16) | l) +#define PACK_NEED_ALIGNMENT(ptr) (((int)(ptr))&3) +#define WRITE_TWO_ALIGNED_PIXELS(addr, pixels) ((*(INT32*)(addr)) = pixels) +#define DITHER_565_R(r, dither) ((r) + ((dither)&0xFF)) +#define DITHER_565_G(g, dither) ((g) + (((dither)&0xFF)>>1)) +#define DITHER_565_B(b, dither) ((b) + ((dither)&0xFF)) + +/* + * Define BITS_IN_JSAMPLE as either + * 8 for 8-bit sample values (the usual setting) + * 12 for 12-bit sample values + * Only 8 and 12 are legal data precisions for lossy JPEG according to the + * JPEG standard, and the IJG code does not support anything else! + * We do not support run-time selection of data precision, sorry. + */ + +#define BITS_IN_JSAMPLE 8 /* use 8 or 12 */ + + +/* + * Maximum number of components (color channels) allowed in JPEG image. + * To meet the letter of the JPEG spec, set this to 255. However, darn + * few applications need more than 4 channels (maybe 5 for CMYK + alpha + * mask). We recommend 10 as a reasonable compromise; use 4 if you are + * really short on memory. (Each allowed component costs a hundred or so + * bytes of storage, whether actually used in an image or not.) + */ + +#define MAX_COMPONENTS 10 /* maximum number of image components */ + + +/* + * Basic data types. + * You may need to change these if you have a machine with unusual data + * type sizes; for example, "char" not 8 bits, "short" not 16 bits, + * or "long" not 32 bits. We don't care whether "int" is 16 or 32 bits, + * but it had better be at least 16. + */ + +/* Representation of a single sample (pixel element value). + * We frequently allocate large arrays of these, so it's important to keep + * them small. But if you have memory to burn and access to char or short + * arrays is very slow on your hardware, you might want to change these. + */ + +#if BITS_IN_JSAMPLE == 8 +/* JSAMPLE should be the smallest type that will hold the values 0..255. + * You can use a signed char by having GETJSAMPLE mask it with 0xFF. + */ + +#ifdef HAVE_UNSIGNED_CHAR + +typedef unsigned char JSAMPLE; +#define GETJSAMPLE(value) ((int) (value)) + +#else /* not HAVE_UNSIGNED_CHAR */ + +typedef char JSAMPLE; +#ifdef CHAR_IS_UNSIGNED +#define GETJSAMPLE(value) ((int) (value)) +#else +#define GETJSAMPLE(value) ((int) (value) & 0xFF) +#endif /* CHAR_IS_UNSIGNED */ + +#endif /* HAVE_UNSIGNED_CHAR */ + +#define MAXJSAMPLE 255 +#define CENTERJSAMPLE 128 + +#endif /* BITS_IN_JSAMPLE == 8 */ + + +#if BITS_IN_JSAMPLE == 12 +/* JSAMPLE should be the smallest type that will hold the values 0..4095. + * On nearly all machines "short" will do nicely. + */ + +typedef short JSAMPLE; +#define GETJSAMPLE(value) ((int) (value)) + +#define MAXJSAMPLE 4095 +#define CENTERJSAMPLE 2048 + +#endif /* BITS_IN_JSAMPLE == 12 */ + + +/* Representation of a DCT frequency coefficient. + * This should be a signed value of at least 16 bits; "short" is usually OK. + * Again, we allocate large arrays of these, but you can change to int + * if you have memory to burn and "short" is really slow. + */ + +typedef short JCOEF; + + +/* Compressed datastreams are represented as arrays of JOCTET. + * These must be EXACTLY 8 bits wide, at least once they are written to + * external storage. Note that when using the stdio data source/destination + * managers, this is also the data type passed to fread/fwrite. + */ + +#ifdef HAVE_UNSIGNED_CHAR + +typedef unsigned char JOCTET; +#define GETJOCTET(value) (value) + +#else /* not HAVE_UNSIGNED_CHAR */ + +typedef char JOCTET; +#ifdef CHAR_IS_UNSIGNED +#define GETJOCTET(value) (value) +#else +#define GETJOCTET(value) ((value) & 0xFF) +#endif /* CHAR_IS_UNSIGNED */ + +#endif /* HAVE_UNSIGNED_CHAR */ + + +/* These typedefs are used for various table entries and so forth. + * They must be at least as wide as specified; but making them too big + * won't cost a huge amount of memory, so we don't provide special + * extraction code like we did for JSAMPLE. (In other words, these + * typedefs live at a different point on the speed/space tradeoff curve.) + */ + +/* UINT8 must hold at least the values 0..255. */ + +#ifdef HAVE_UNSIGNED_CHAR +typedef unsigned char UINT8; +#else /* not HAVE_UNSIGNED_CHAR */ +#ifdef CHAR_IS_UNSIGNED +typedef char UINT8; +#else /* not CHAR_IS_UNSIGNED */ +typedef short UINT8; +#endif /* CHAR_IS_UNSIGNED */ +#endif /* HAVE_UNSIGNED_CHAR */ + +/* UINT16 must hold at least the values 0..65535. */ + +#ifdef HAVE_UNSIGNED_SHORT +typedef unsigned short UINT16; +#else /* not HAVE_UNSIGNED_SHORT */ +typedef unsigned int UINT16; +#endif /* HAVE_UNSIGNED_SHORT */ + +/* INT16 must hold at least the values -32768..32767. */ + +#ifndef XMD_H /* X11/xmd.h correctly defines INT16 */ +typedef short INT16; +#endif + +/* INT32 must hold at least signed 32-bit values. */ + +#ifndef XMD_H /* X11/xmd.h correctly defines INT32 */ +typedef long INT32; +#endif + +/* Datatype used for image dimensions. The JPEG standard only supports + * images up to 64K*64K due to 16-bit fields in SOF markers. Therefore + * "unsigned int" is sufficient on all machines. However, if you need to + * handle larger images and you don't mind deviating from the spec, you + * can change this datatype. + */ + +typedef unsigned int JDIMENSION; + +#define JPEG_MAX_DIMENSION 65500L /* a tad under 64K to prevent overflows */ + + +/* These macros are used in all function definitions and extern declarations. + * You could modify them if you need to change function linkage conventions; + * in particular, you'll need to do that to make the library a Windows DLL. + * Another application is to make all functions global for use with debuggers + * or code profilers that require it. + */ + +/* a function called through method pointers: */ +#define METHODDEF(type) static type +/* a function used only in its module: */ +#define LOCAL(type) static type +/* a function referenced thru EXTERNs: */ +#define GLOBAL(type) type +/* a reference to a GLOBAL function: */ +#define EXTERN(type) extern type + + +/* This macro is used to declare a "method", that is, a function pointer. + * We want to supply prototype parameters if the compiler can cope. + * Note that the arglist parameter must be parenthesized! + * Again, you can customize this if you need special linkage keywords. + */ + +#ifdef HAVE_PROTOTYPES +#define JMETHOD(type,methodname,arglist) type (*methodname) arglist +#else +#define JMETHOD(type,methodname,arglist) type (*methodname) () +#endif + + +/* Here is the pseudo-keyword for declaring pointers that must be "far" + * on 80x86 machines. Most of the specialized coding for 80x86 is handled + * by just saying "FAR *" where such a pointer is needed. In a few places + * explicit coding is needed; see uses of the NEED_FAR_POINTERS symbol. + */ + +#ifdef NEED_FAR_POINTERS +#define FAR far +#else +#define FAR +#endif + + +/* + * On a few systems, type boolean and/or its values FALSE, TRUE may appear + * in standard header files. Or you may have conflicts with application- + * specific header files that you want to include together with these files. + * Defining HAVE_BOOLEAN before including jpeglib.h should make it work. + */ + +#ifndef HAVE_BOOLEAN +typedef int boolean; +#endif +#ifndef FALSE /* in case these macros already exist */ +#define FALSE 0 /* values of boolean */ +#endif +#ifndef TRUE +#define TRUE 1 +#endif + + +/* + * The remaining options affect code selection within the JPEG library, + * but they don't need to be visible to most applications using the library. + * To minimize application namespace pollution, the symbols won't be + * defined unless JPEG_INTERNALS or JPEG_INTERNAL_OPTIONS has been defined. + */ + +#ifdef JPEG_INTERNALS +#define JPEG_INTERNAL_OPTIONS +#endif + +#ifdef JPEG_INTERNAL_OPTIONS + + +/* + * These defines indicate whether to include various optional functions. + * Undefining some of these symbols will produce a smaller but less capable + * library. Note that you can leave certain source files out of the + * compilation/linking process if you've #undef'd the corresponding symbols. + * (You may HAVE to do that if your compiler doesn't like null source files.) + */ + +/* Arithmetic coding is unsupported for legal reasons. Complaints to IBM. */ + +/* Capability options common to encoder and decoder: */ + +#define DCT_ISLOW_SUPPORTED /* slow but accurate integer algorithm */ +#define DCT_IFAST_SUPPORTED /* faster, less accurate integer method */ +#define DCT_FLOAT_SUPPORTED /* floating-point: accurate, fast on fast HW */ + +/* Encoder capability options: */ + +#undef C_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */ +#define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */ +#define C_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/ +#define ENTROPY_OPT_SUPPORTED /* Optimization of entropy coding parms? */ +/* Note: if you selected 12-bit data precision, it is dangerous to turn off + * ENTROPY_OPT_SUPPORTED. The standard Huffman tables are only good for 8-bit + * precision, so jchuff.c normally uses entropy optimization to compute + * usable tables for higher precision. If you don't want to do optimization, + * you'll have to supply different default Huffman tables. + * The exact same statements apply for progressive JPEG: the default tables + * don't work for progressive mode. (This may get fixed, however.) + */ +#define INPUT_SMOOTHING_SUPPORTED /* Input image smoothing option? */ + +/* Decoder capability options: */ + +#undef D_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */ +#define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */ +#define D_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/ +#define SAVE_MARKERS_SUPPORTED /* jpeg_save_markers() needed? */ +#define BLOCK_SMOOTHING_SUPPORTED /* Block smoothing? (Progressive only) */ +#define IDCT_SCALING_SUPPORTED /* Output rescaling via IDCT? */ +#undef UPSAMPLE_SCALING_SUPPORTED /* Output rescaling at upsample stage? */ +#define UPSAMPLE_MERGING_SUPPORTED /* Fast path for sloppy upsampling? */ +#define QUANT_1PASS_SUPPORTED /* 1-pass color quantization? */ +#define QUANT_2PASS_SUPPORTED /* 2-pass color quantization? */ + +/* more capability options later, no doubt */ + + +/* + * Ordering of RGB data in scanlines passed to or from the application. + * If your application wants to deal with data in the order B,G,R, just + * change these macros. You can also deal with formats such as R,G,B,X + * (one extra byte per pixel) by changing RGB_PIXELSIZE. Note that changing + * the offsets will also change the order in which colormap data is organized. + * RESTRICTIONS: + * 1. The sample applications cjpeg,djpeg do NOT support modified RGB formats. + * 2. These macros only affect RGB<=>YCbCr color conversion, so they are not + * useful if you are using JPEG color spaces other than YCbCr or grayscale. + * 3. The color quantizer modules will not behave desirably if RGB_PIXELSIZE + * is not 3 (they don't understand about dummy color components!). So you + * can't use color quantization if you change that value. + */ +#define RGB_ALPHA 3 /* Offset of Alpha */ +#define RGB_RED 0 /* Offset of Red in an RGB scanline element */ +#define RGB_GREEN 1 /* Offset of Green */ +#define RGB_BLUE 2 /* Offset of Blue */ +#define RGB_PIXELSIZE 3 /* JSAMPLEs per RGB scanline element */ + + +/* Definitions for speed-related optimizations. */ + + +/* If your compiler supports inline functions, define INLINE + * as the inline keyword; otherwise define it as empty. + */ + +#ifndef INLINE +#ifdef __GNUC__ /* for instance, GNU C knows about inline */ +#define INLINE __inline__ +#endif +#ifndef INLINE +#define INLINE /* default is to define it as empty */ +#endif +#endif + + +/* On some machines (notably 68000 series) "int" is 32 bits, but multiplying + * two 16-bit shorts is faster than multiplying two ints. Define MULTIPLIER + * as short on such a machine. MULTIPLIER must be at least 16 bits wide. + */ + +#ifndef MULTIPLIER +#define MULTIPLIER int /* type for fastest integer multiply */ +#endif + + +/* FAST_FLOAT should be either float or double, whichever is done faster + * by your compiler. (Note that this type is only used in the floating point + * DCT routines, so it only matters if you've defined DCT_FLOAT_SUPPORTED.) + * Typically, float is faster in ANSI C compilers, while double is faster in + * pre-ANSI compilers (because they insist on converting to double anyway). + * The code below therefore chooses float if we have ANSI-style prototypes. + */ + +#ifndef FAST_FLOAT +#ifdef HAVE_PROTOTYPES +#define FAST_FLOAT float +#else +#define FAST_FLOAT double +#endif +#endif + +#endif /* JPEG_INTERNAL_OPTIONS */ diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/jpeglib.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/jpeglib.h new file mode 100644 index 0000000000..325b904271 --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/jpeglib.h @@ -0,0 +1,1117 @@ +/* + * jpeglib.h + * + * Copyright (C) 1991-1998, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file defines the application interface for the JPEG library. + * Most applications using the library need only include this file, + * and perhaps jerror.h if they want to know the exact error codes. + */ + +#ifndef JPEGLIB_H +#define JPEGLIB_H + +/* + * First we include the configuration files that record how this + * installation of the JPEG library is set up. jconfig.h can be + * generated automatically for many systems. jmorecfg.h contains + * manual configuration options that most people need not worry about. + */ + +#ifndef JCONFIG_INCLUDED /* in case jinclude.h already did */ +#include "jconfig.h" /* widely used configuration options */ +#endif +#include "jmorecfg.h" /* seldom changed options */ + + +/* Version ID for the JPEG library. + * Might be useful for tests like "#if JPEG_LIB_VERSION >= 60". + */ + +#define JPEG_LIB_VERSION 62 /* Version 6b */ + + +/* Various constants determining the sizes of things. + * All of these are specified by the JPEG standard, so don't change them + * if you want to be compatible. + */ + +#define DCTSIZE 8 /* The basic DCT block is 8x8 samples */ +#define DCTSIZE2 64 /* DCTSIZE squared; # of elements in a block */ +#define NUM_QUANT_TBLS 4 /* Quantization tables are numbered 0..3 */ +#define NUM_HUFF_TBLS 4 /* Huffman tables are numbered 0..3 */ +#define NUM_ARITH_TBLS 16 /* Arith-coding tables are numbered 0..15 */ +#define MAX_COMPS_IN_SCAN 4 /* JPEG limit on # of components in one scan */ +#define MAX_SAMP_FACTOR 4 /* JPEG limit on sampling factors */ +/* Unfortunately, some bozo at Adobe saw no reason to be bound by the standard; + * the PostScript DCT filter can emit files with many more than 10 blocks/MCU. + * If you happen to run across such a file, you can up D_MAX_BLOCKS_IN_MCU + * to handle it. We even let you do this from the jconfig.h file. However, + * we strongly discourage changing C_MAX_BLOCKS_IN_MCU; just because Adobe + * sometimes emits noncompliant files doesn't mean you should too. + */ +#define C_MAX_BLOCKS_IN_MCU 10 /* compressor's limit on blocks per MCU */ +#ifndef D_MAX_BLOCKS_IN_MCU +#define D_MAX_BLOCKS_IN_MCU 10 /* decompressor's limit on blocks per MCU */ +#endif + + +/* Data structures for images (arrays of samples and of DCT coefficients). + * On 80x86 machines, the image arrays are too big for near pointers, + * but the pointer arrays can fit in near memory. + */ + +typedef JSAMPLE FAR *JSAMPROW; /* ptr to one image row of pixel samples. */ +typedef JSAMPROW *JSAMPARRAY; /* ptr to some rows (a 2-D sample array) */ +typedef JSAMPARRAY *JSAMPIMAGE; /* a 3-D sample array: top index is color */ + +typedef JCOEF JBLOCK[DCTSIZE2]; /* one block of coefficients */ +typedef JBLOCK FAR *JBLOCKROW; /* pointer to one row of coefficient blocks */ +typedef JBLOCKROW *JBLOCKARRAY; /* a 2-D array of coefficient blocks */ +typedef JBLOCKARRAY *JBLOCKIMAGE; /* a 3-D array of coefficient blocks */ + +typedef JCOEF FAR *JCOEFPTR; /* useful in a couple of places */ + + +/* Types for JPEG compression parameters and working tables. */ + + +/* DCT coefficient quantization tables. */ + +typedef struct { + /* This array gives the coefficient quantizers in natural array order + * (not the zigzag order in which they are stored in a JPEG DQT marker). + * CAUTION: IJG versions prior to v6a kept this array in zigzag order. + */ + UINT16 quantval[DCTSIZE2]; /* quantization step for each coefficient */ + /* This field is used only during compression. It's initialized FALSE when + * the table is created, and set TRUE when it's been output to the file. + * You could suppress output of a table by setting this to TRUE. + * (See jpeg_suppress_tables for an example.) + */ + boolean sent_table; /* TRUE when table has been output */ +} JQUANT_TBL; + + +/* Huffman coding tables. */ + +typedef struct { + /* These two fields directly represent the contents of a JPEG DHT marker */ + UINT8 bits[17]; /* bits[k] = # of symbols with codes of */ + /* length k bits; bits[0] is unused */ + UINT8 huffval[256]; /* The symbols, in order of incr code length */ + /* This field is used only during compression. It's initialized FALSE when + * the table is created, and set TRUE when it's been output to the file. + * You could suppress output of a table by setting this to TRUE. + * (See jpeg_suppress_tables for an example.) + */ + boolean sent_table; /* TRUE when table has been output */ +} JHUFF_TBL; + + +/* Basic info about one component (color channel). */ + +typedef struct { + /* These values are fixed over the whole image. */ + /* For compression, they must be supplied by parameter setup; */ + /* for decompression, they are read from the SOF marker. */ + int component_id; /* identifier for this component (0..255) */ + int component_index; /* its index in SOF or cinfo->comp_info[] */ + int h_samp_factor; /* horizontal sampling factor (1..4) */ + int v_samp_factor; /* vertical sampling factor (1..4) */ + int quant_tbl_no; /* quantization table selector (0..3) */ + /* These values may vary between scans. */ + /* For compression, they must be supplied by parameter setup; */ + /* for decompression, they are read from the SOS marker. */ + /* The decompressor output side may not use these variables. */ + int dc_tbl_no; /* DC entropy table selector (0..3) */ + int ac_tbl_no; /* AC entropy table selector (0..3) */ + + /* Remaining fields should be treated as private by applications. */ + + /* These values are computed during compression or decompression startup: */ + /* Component's size in DCT blocks. + * Any dummy blocks added to complete an MCU are not counted; therefore + * these values do not depend on whether a scan is interleaved or not. + */ + JDIMENSION width_in_blocks; + JDIMENSION height_in_blocks; + /* Size of a DCT block in samples. Always DCTSIZE for compression. + * For decompression this is the size of the output from one DCT block, + * reflecting any scaling we choose to apply during the IDCT step. + * Values of 1,2,4,8 are likely to be supported. Note that different + * components may receive different IDCT scalings. + */ + int DCT_scaled_size; + /* The downsampled dimensions are the component's actual, unpadded number + * of samples at the main buffer (preprocessing/compression interface), thus + * downsampled_width = ceil(image_width * Hi/Hmax) + * and similarly for height. For decompression, IDCT scaling is included, so + * downsampled_width = ceil(image_width * Hi/Hmax * DCT_scaled_size/DCTSIZE) + */ + JDIMENSION downsampled_width; /* actual width in samples */ + JDIMENSION downsampled_height; /* actual height in samples */ + /* This flag is used only for decompression. In cases where some of the + * components will be ignored (eg grayscale output from YCbCr image), + * we can skip most computations for the unused components. + */ + boolean component_needed; /* do we need the value of this component? */ + + /* These values are computed before starting a scan of the component. */ + /* The decompressor output side may not use these variables. */ + int MCU_width; /* number of blocks per MCU, horizontally */ + int MCU_height; /* number of blocks per MCU, vertically */ + int MCU_blocks; /* MCU_width * MCU_height */ + int MCU_sample_width; /* MCU width in samples, MCU_width*DCT_scaled_size */ + int last_col_width; /* # of non-dummy blocks across in last MCU */ + int last_row_height; /* # of non-dummy blocks down in last MCU */ + + /* Saved quantization table for component; NULL if none yet saved. + * See jdinput.c comments about the need for this information. + * This field is currently used only for decompression. + */ + JQUANT_TBL * quant_table; + + /* Private per-component storage for DCT or IDCT subsystem. */ + void * dct_table; +} jpeg_component_info; + + +/* The script for encoding a multiple-scan file is an array of these: */ + +typedef struct { + int comps_in_scan; /* number of components encoded in this scan */ + int component_index[MAX_COMPS_IN_SCAN]; /* their SOF/comp_info[] indexes */ + int Ss, Se; /* progressive JPEG spectral selection parms */ + int Ah, Al; /* progressive JPEG successive approx. parms */ +} jpeg_scan_info; + +/* The decompressor can save APPn and COM markers in a list of these: */ + +typedef struct jpeg_marker_struct FAR * jpeg_saved_marker_ptr; + +struct jpeg_marker_struct { + jpeg_saved_marker_ptr next; /* next in list, or NULL */ + UINT8 marker; /* marker code: JPEG_COM, or JPEG_APP0+n */ + unsigned int original_length; /* # bytes of data in the file */ + unsigned int data_length; /* # bytes of data saved at data[] */ + JOCTET FAR * data; /* the data contained in the marker */ + /* the marker length word is not counted in data_length or original_length */ +}; + +/* Known color spaces. */ + +typedef enum { + JCS_UNKNOWN, /** error/unspecified **/ + JCS_GRAYSCALE, /** monochrome **/ + JCS_RGB, /** red/green/blue **/ + JCS_YCbCr, /** Y/Cb/Cr (also known as YUV) **/ + JCS_CMYK, /** C/M/Y/K **/ + JCS_YCCK, /** Y/Cb/Cr/K **/ + /** add color space output by y00181162 **/ + JCS_CrCbY, /** Y(8bits)/Cb(8bits)/Cr(8bits) (also known as YUV) **/ + JCS_BGR, /** red((at 16~24)8bits)/green((at 8~15)8bits)/blue((at 0~7)8bits) **/ + JCS_ABGR_8888, /** alpha((at 25~32)8bits)/red((at 16~24)8bits)/green((at 8~15)8bits)/blue((at 0~7)8bits) **/ + JCS_ARGB_8888, /** alpha((at 25~32)8bits)/blue((at 16~24)8bits)/green((at 8~15)8bits)/red((at 0~7)8bits) **/ + JCS_ABGR_1555, /** alpha((at 16)1bit)/red((at 10~15)5bits)/green((at 5~9)5bits)/blue((at 0~4)5bits) **/ + JCS_ARGB_1555, /** alpha((at 16)1bit)/blue((at 10~15)5bits)/green((at 5~9)5bits)/red((at 0~4)5bits) **/ + JCS_RGB_565, /** blue((at 11~16)5bits)/green((at 5~10)6bits)/red((at 0~4)5bits) **/ + JCS_BGR_565, /** red((at 11~16)5bits)/green((at 5~10)6bits)/blue((at 0~4)5bits) **/ + JCS_YUV400_SP, /** output color space yuv400 semi-planer **/ + JCS_YUV420_SP, /** output color space yuv420 semi-planer **/ + JCS_YUV422_SP_21, /** output color space yuv422 2*1 semi-planer **/ + JCS_YUV422_SP_12, /** output color space yuv422 1*2 semi-planer **/ + JCS_YUV444_SP, /** output color space yuv444 semi-planer **/ + JCS_YUV422_PACKAGE +} J_COLOR_SPACE; + +/* DCT/IDCT algorithm options. */ + +typedef enum { + JDCT_ISLOW, /* slow but accurate integer algorithm */ + JDCT_IFAST, /* faster, less accurate integer method */ + JDCT_FLOAT /* floating-point: accurate, fast on fast HW */ +} J_DCT_METHOD; + +#ifndef JDCT_DEFAULT /* may be overridden in jconfig.h */ +#define JDCT_DEFAULT JDCT_ISLOW +#endif +#ifndef JDCT_FASTEST /* may be overridden in jconfig.h */ +#define JDCT_FASTEST JDCT_IFAST +#endif + +/* Dithering options for decompression. */ + +typedef enum { + JDITHER_NONE, /* no dithering */ + JDITHER_ORDERED, /* simple ordered dither */ + JDITHER_FS /* Floyd-Steinberg error diffusion dither */ +} J_DITHER_MODE; + + +/* Common fields between JPEG compression and decompression master structs. */ + +#define jpeg_common_fields \ + struct jpeg_error_mgr * err; /* Error handler module */\ + struct jpeg_memory_mgr * mem; /* Memory manager module */\ + struct jpeg_progress_mgr * progress; /* Progress monitor, or NULL if none */\ + void * client_data; /* Available for use by application */\ + boolean is_decompressor; /* So common code can tell which is which */\ + int global_state /* For checking call sequence validity */ + +/* Routines that are to be used by both halves of the library are declared + * to receive a pointer to this structure. There are no actual instances of + * jpeg_common_struct, only of jpeg_compress_struct and jpeg_decompress_struct. + */ +struct jpeg_common_struct { + jpeg_common_fields; /* Fields common to both master struct types */ + /* Additional fields follow in an actual jpeg_compress_struct or + * jpeg_decompress_struct. All three structs must agree on these + * initial fields! (This would be a lot cleaner in C++.) + */ +}; + +typedef struct jpeg_common_struct * j_common_ptr; +typedef struct jpeg_compress_struct * j_compress_ptr; +typedef struct jpeg_decompress_struct * j_decompress_ptr; + + +/* Master record for a compression instance */ + +struct jpeg_compress_struct { + jpeg_common_fields; /* Fields shared with jpeg_decompress_struct */ + + /* Destination for compressed data */ + struct jpeg_destination_mgr * dest; + + /* Description of source image --- these fields must be filled in by + * outer application before starting compression. in_color_space must + * be correct before you can even call jpeg_set_defaults(). + */ + + JDIMENSION image_width; /* input image width */ + JDIMENSION image_height; /* input image height */ + int input_components; /* # of color components in input image */ + J_COLOR_SPACE in_color_space; /* colorspace of input image */ + + double input_gamma; /* image gamma of input image */ + + /* Compression parameters --- these fields must be set before calling + * jpeg_start_compress(). We recommend calling jpeg_set_defaults() to + * initialize everything to reasonable defaults, then changing anything + * the application specifically wants to change. That way you won't get + * burnt when new parameters are added. Also note that there are several + * helper routines to simplify changing parameters. + */ + + int data_precision; /* bits of precision in image data */ + + int num_components; /* # of color components in JPEG image */ + J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */ + + jpeg_component_info * comp_info; + /* comp_info[i] describes component that appears i'th in SOF */ + + JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS]; + /* ptrs to coefficient quantization tables, or NULL if not defined */ + + JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS]; + JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS]; + /* ptrs to Huffman coding tables, or NULL if not defined */ + + UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */ + UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */ + UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */ + + int num_scans; /* # of entries in scan_info array */ + const jpeg_scan_info * scan_info; /* script for multi-scan file, or NULL */ + /* The default value of scan_info is NULL, which causes a single-scan + * sequential JPEG file to be emitted. To create a multi-scan file, + * set num_scans and scan_info to point to an array of scan definitions. + */ + + boolean raw_data_in; /* TRUE=caller supplies downsampled data */ + boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */ + boolean optimize_coding; /* TRUE=optimize entropy encoding parms */ + boolean CCIR601_sampling; /* TRUE=first samples are cosited */ + int smoothing_factor; /* 1..100, or 0 for no input smoothing */ + J_DCT_METHOD dct_method; /* DCT algorithm selector */ + + /* The restart interval can be specified in absolute MCUs by setting + * restart_interval, or in MCU rows by setting restart_in_rows + * (in which case the correct restart_interval will be figured + * for each scan). + */ + unsigned int restart_interval; /* MCUs per restart, or 0 for no restart */ + int restart_in_rows; /* if > 0, MCU rows per restart interval */ + + /* Parameters controlling emission of special markers. */ + + boolean write_JFIF_header; /* should a JFIF marker be written? */ + UINT8 JFIF_major_version; /* What to write for the JFIF version number */ + UINT8 JFIF_minor_version; + /* These three values are not used by the JPEG code, merely copied */ + /* into the JFIF APP0 marker. density_unit can be 0 for unknown, */ + /* 1 for dots/inch, or 2 for dots/cm. Note that the pixel aspect */ + /* ratio is defined by X_density/Y_density even when density_unit=0. */ + UINT8 density_unit; /* JFIF code for pixel size units */ + UINT16 X_density; /* Horizontal pixel density */ + UINT16 Y_density; /* Vertical pixel density */ + boolean write_Adobe_marker; /* should an Adobe marker be written? */ + + /* State variable: index of next scanline to be written to + * jpeg_write_scanlines(). Application may use this to control its + * processing loop, e.g., "while (next_scanline < image_height)". + */ + + JDIMENSION next_scanline; /* 0 .. image_height-1 */ + + /* Remaining fields are known throughout compressor, but generally + * should not be touched by a surrounding application. + */ + + /* + * These fields are computed during compression startup + */ + boolean progressive_mode; /* TRUE if scan script uses progressive mode */ + int max_h_samp_factor; /* largest h_samp_factor */ + int max_v_samp_factor; /* largest v_samp_factor */ + + JDIMENSION total_iMCU_rows; /* # of iMCU rows to be input to coef ctlr */ + /* The coefficient controller receives data in units of MCU rows as defined + * for fully interleaved scans (whether the JPEG file is interleaved or not). + * There are v_samp_factor * DCTSIZE sample rows of each component in an + * "iMCU" (interleaved MCU) row. + */ + + /* + * These fields are valid during any one scan. + * They describe the components and MCUs actually appearing in the scan. + */ + int comps_in_scan; /* # of JPEG components in this scan */ + jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN]; + /* *cur_comp_info[i] describes component that appears i'th in SOS */ + + JDIMENSION MCUs_per_row; /* # of MCUs across the image */ + JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */ + + int blocks_in_MCU; /* # of DCT blocks per MCU */ + int MCU_membership[C_MAX_BLOCKS_IN_MCU]; + /* MCU_membership[i] is index in cur_comp_info of component owning */ + /* i'th block in an MCU */ + + int Ss, Se, Ah, Al; /* progressive JPEG parameters for scan */ + + /* + * Links to compression subobjects (methods and private variables of modules) + */ + struct jpeg_comp_master * master; + struct jpeg_c_main_controller * main; + struct jpeg_c_prep_controller * prep; + struct jpeg_c_coef_controller * coef; + struct jpeg_marker_writer * marker; + struct jpeg_color_converter * cconvert; + struct jpeg_downsampler * downsample; + struct jpeg_forward_dct * fdct; + struct jpeg_entropy_encoder * entropy; + jpeg_scan_info * script_space; /* workspace for jpeg_simple_progression */ + int script_space_size; +}; + + +/* Master record for a decompression instance */ + +struct jpeg_decompress_struct { + jpeg_common_fields; /* Fields shared with jpeg_compress_struct */ + + /* Source of compressed data */ + struct jpeg_source_mgr * src; + + /* Basic description of image --- filled in by jpeg_read_header(). */ + /* Application may inspect these values to decide how to process image. */ + + JDIMENSION image_width; /* nominal image width (from SOF marker) */ + JDIMENSION image_height; /* nominal image height */ + int num_components; /* # of color components in JPEG image */ + J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */ + + /* Decompression processing parameters --- these fields must be set before + * calling jpeg_start_decompress(). Note that jpeg_read_header() initializes + * them to default values. + */ + + J_COLOR_SPACE out_color_space; /* colorspace for output */ + + unsigned int scale_num, scale_denom; /* fraction by which to scale image */ + + double output_gamma; /* image gamma wanted in output */ + + boolean buffered_image; /* TRUE=multiple output passes */ + boolean raw_data_out; /* TRUE=downsampled data wanted */ + + J_DCT_METHOD dct_method; /* IDCT algorithm selector */ + boolean do_fancy_upsampling; /* TRUE=apply fancy upsampling */ + boolean do_block_smoothing; /* TRUE=apply interblock smoothing */ + + boolean quantize_colors; /* TRUE=colormapped output wanted */ + /* the following are ignored if not quantize_colors: */ + J_DITHER_MODE dither_mode; /* type of color dithering to use */ + boolean two_pass_quantize; /* TRUE=use two-pass color quantization */ + int desired_number_of_colors; /* max # colors to use in created colormap */ + /* these are significant only in buffered-image mode: */ + boolean enable_1pass_quant; /* enable future use of 1-pass quantizer */ + boolean enable_external_quant;/* enable future use of external colormap */ + boolean enable_2pass_quant; /* enable future use of 2-pass quantizer */ + + /* Description of actual output image that will be returned to application. + * These fields are computed by jpeg_start_decompress(). + * You can also use jpeg_calc_output_dimensions() to determine these values + * in advance of calling jpeg_start_decompress(). + */ + + JDIMENSION output_width; /* scaled image width */ + JDIMENSION output_height; /* scaled image height */ + int out_color_components; /* # of color components in out_color_space */ + int output_components; /* # of color components returned */ + /* output_components is 1 (a colormap index) when quantizing colors; + * otherwise it equals out_color_components. + */ + int rec_outbuf_height; /* min recommended height of scanline buffer */ + /* If the buffer passed to jpeg_read_scanlines() is less than this many rows + * high, space and time will be wasted due to unnecessary data copying. + * Usually rec_outbuf_height will be 1 or 2, at most 4. + */ + + /* When quantizing colors, the output colormap is described by these fields. + * The application can supply a colormap by setting colormap non-NULL before + * calling jpeg_start_decompress; otherwise a colormap is created during + * jpeg_start_decompress or jpeg_start_output. + * The map has out_color_components rows and actual_number_of_colors columns. + */ + int actual_number_of_colors; /* number of entries in use */ + JSAMPARRAY colormap; /* The color map as a 2-D pixel array */ + + /* State variables: these variables indicate the progress of decompression. + * The application may examine these but must not modify them. + */ + + /* Row index of next scanline to be read from jpeg_read_scanlines(). + * Application may use this to control its processing loop, e.g., + * "while (output_scanline < output_height)". + */ + JDIMENSION output_scanline; /* 0 .. output_height-1 */ + + /* Current input scan number and number of iMCU rows completed in scan. + * These indicate the progress of the decompressor input side. + */ + int input_scan_number; /* Number of SOS markers seen so far */ + JDIMENSION input_iMCU_row; /* Number of iMCU rows completed */ + + /* The "output scan number" is the notional scan being displayed by the + * output side. The decompressor will not allow output scan/row number + * to get ahead of input scan/row, but it can fall arbitrarily far behind. + */ + int output_scan_number; /* Nominal scan number being displayed */ + JDIMENSION output_iMCU_row; /* Number of iMCU rows read */ + + /* Current progression status. coef_bits[c][i] indicates the precision + * with which component c's DCT coefficient i (in zigzag order) is known. + * It is -1 when no data has yet been received, otherwise it is the point + * transform (shift) value for the most recent scan of the coefficient + * (thus, 0 at completion of the progression). + * This pointer is NULL when reading a non-progressive file. + */ + int (*coef_bits)[DCTSIZE2]; /* -1 or current Al value for each coef */ + + /* Internal JPEG parameters --- the application usually need not look at + * these fields. Note that the decompressor output side may not use + * any parameters that can change between scans. + */ + + /* Quantization and Huffman tables are carried forward across input + * datastreams when processing abbreviated JPEG datastreams. + */ + + JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS]; + /* ptrs to coefficient quantization tables, or NULL if not defined */ + + JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS]; + JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS]; + /* ptrs to Huffman coding tables, or NULL if not defined */ + + /* These parameters are never carried across datastreams, since they + * are given in SOF/SOS markers or defined to be reset by SOI. + */ + + int data_precision; /* bits of precision in image data */ + + jpeg_component_info * comp_info; + /* comp_info[i] describes component that appears i'th in SOF */ + + boolean progressive_mode; /* TRUE if SOFn specifies progressive mode */ + boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */ + + UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */ + UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */ + UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */ + + unsigned int restart_interval; /* MCUs per restart interval, or 0 for no restart */ + + /* These fields record data obtained from optional markers recognized by + * the JPEG library. + */ + boolean saw_JFIF_marker; /* TRUE iff a JFIF APP0 marker was found */ + /* Data copied from JFIF marker; only valid if saw_JFIF_marker is TRUE: */ + UINT8 JFIF_major_version; /* JFIF version number */ + UINT8 JFIF_minor_version; + UINT8 density_unit; /* JFIF code for pixel size units */ + UINT16 X_density; /* Horizontal pixel density */ + UINT16 Y_density; /* Vertical pixel density */ + boolean saw_Adobe_marker; /* TRUE iff an Adobe APP14 marker was found */ + UINT8 Adobe_transform; /* Color transform code from Adobe marker */ + + boolean CCIR601_sampling; /* TRUE=first samples are cosited */ + + /* Aside from the specific data retained from APPn markers known to the + * library, the uninterpreted contents of any or all APPn and COM markers + * can be saved in a list for examination by the application. + */ + jpeg_saved_marker_ptr marker_list; /* Head of list of saved markers */ + + /* Remaining fields are known throughout decompressor, but generally + * should not be touched by a surrounding application. + */ + + /* + * These fields are computed during decompression startup + */ + int max_h_samp_factor; /* largest h_samp_factor */ + int max_v_samp_factor; /* largest v_samp_factor */ + + int min_DCT_scaled_size; /* smallest DCT_scaled_size of any component */ + + JDIMENSION total_iMCU_rows; /* # of iMCU rows in image */ + /* The coefficient controller's input and output progress is measured in + * units of "iMCU" (interleaved MCU) rows. These are the same as MCU rows + * in fully interleaved JPEG scans, but are used whether the scan is + * interleaved or not. We define an iMCU row as v_samp_factor DCT block + * rows of each component. Therefore, the IDCT output contains + * v_samp_factor*DCT_scaled_size sample rows of a component per iMCU row. + */ + + JSAMPLE * sample_range_limit; /* table for fast range-limiting */ + + /* + * These fields are valid during any one scan. + * They describe the components and MCUs actually appearing in the scan. + * Note that the decompressor output side must not use these fields. + */ + int comps_in_scan; /* # of JPEG components in this scan */ + jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN]; + /* *cur_comp_info[i] describes component that appears i'th in SOS */ + + JDIMENSION MCUs_per_row; /* # of MCUs across the image */ + JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */ + + int blocks_in_MCU; /* # of DCT blocks per MCU */ + int MCU_membership[D_MAX_BLOCKS_IN_MCU]; + /* MCU_membership[i] is index in cur_comp_info of component owning */ + /* i'th block in an MCU */ + + int Ss, Se, Ah, Al; /* progressive JPEG parameters for scan */ + + /* This field is shared between entropy decoder and marker parser. + * It is either zero or the code of a JPEG marker that has been + * read from the data source, but has not yet been processed. + */ + int unread_marker; + + /* + * Links to decompression subobjects (methods, private variables of modules) + */ + struct jpeg_decomp_master * master; + struct jpeg_d_main_controller * main; + struct jpeg_d_coef_controller * coef; + struct jpeg_d_post_controller * post; + struct jpeg_input_controller * inputctl; + struct jpeg_marker_reader * marker; + struct jpeg_entropy_decoder * entropy; + struct jpeg_inverse_dct * idct; + struct jpeg_upsampler * upsample; + struct jpeg_color_deconverter * cconvert; + struct jpeg_color_quantizer * cquantize; +}; + + +/* "Object" declarations for JPEG modules that may be supplied or called + * directly by the surrounding application. + * As with all objects in the JPEG library, these structs only define the + * publicly visible methods and state variables of a module. Additional + * private fields may exist after the public ones. + */ + + +/* Error handler object */ + +struct jpeg_error_mgr { + /* Error exit handler: does not return to caller */ + JMETHOD(void, error_exit, (j_common_ptr cinfo)); + /* Conditionally emit a trace or warning message */ + JMETHOD(void, emit_message, (j_common_ptr cinfo, int msg_level)); + /* Routine that actually outputs a trace or error message */ + JMETHOD(void, output_message, (j_common_ptr cinfo)); + /* Format a message string for the most recent JPEG error or message */ + JMETHOD(void, format_message, (j_common_ptr cinfo, char * buffer)); +#define JMSG_LENGTH_MAX 200 /* recommended size of format_message buffer */ + /* Reset error state variables at start of a new image */ + JMETHOD(void, reset_error_mgr, (j_common_ptr cinfo)); + + /* The message ID code and any parameters are saved here. + * A message can have one string parameter or up to 8 int parameters. + */ + int msg_code; +#define JMSG_STR_PARM_MAX 80 + union { + int i[8]; + char s[JMSG_STR_PARM_MAX]; + } msg_parm; + + /* Standard state variables for error facility */ + + int trace_level; /* max msg_level that will be displayed */ + + /* For recoverable corrupt-data errors, we emit a warning message, + * but keep going unless emit_message chooses to abort. emit_message + * should count warnings in num_warnings. The surrounding application + * can check for bad data by seeing if num_warnings is nonzero at the + * end of processing. + */ + long num_warnings; /* number of corrupt-data warnings */ + + /* These fields point to the table(s) of error message strings. + * An application can change the table pointer to switch to a different + * message list (typically, to change the language in which errors are + * reported). Some applications may wish to add additional error codes + * that will be handled by the JPEG library error mechanism; the second + * table pointer is used for this purpose. + * + * First table includes all errors generated by JPEG library itself. + * Error code 0 is reserved for a "no such error string" message. + */ + const char * const * jpeg_message_table; /* Library errors */ + int last_jpeg_message; /* Table contains strings 0..last_jpeg_message */ + /* Second table can be added by application (see cjpeg/djpeg for example). + * It contains strings numbered first_addon_message..last_addon_message. + */ + const char * const * addon_message_table; /* Non-library errors */ + int first_addon_message; /* code for first string in addon table */ + int last_addon_message; /* code for last string in addon table */ +}; + + +/* Progress monitor object */ + +struct jpeg_progress_mgr { + JMETHOD(void, progress_monitor, (j_common_ptr cinfo)); + + long pass_counter; /* work units completed in this pass */ + long pass_limit; /* total number of work units in this pass */ + int completed_passes; /* passes completed so far */ + int total_passes; /* total number of passes expected */ +}; + + +/* Data destination object for compression */ + +struct jpeg_destination_mgr { + JOCTET * next_output_byte; /* => next byte to write in buffer */ + size_t free_in_buffer; /* # of byte spaces remaining in buffer */ + + JMETHOD(void, init_destination, (j_compress_ptr cinfo)); + JMETHOD(boolean, empty_output_buffer, (j_compress_ptr cinfo)); + JMETHOD(void, term_destination, (j_compress_ptr cinfo)); +}; + + +/* Data source object for decompression */ + +struct jpeg_source_mgr { + const JOCTET * next_input_byte; /* => next byte to read from buffer */ + size_t bytes_in_buffer; /* # of bytes remaining in buffer */ + + JMETHOD(void, init_source, (j_decompress_ptr cinfo)); + JMETHOD(boolean, fill_input_buffer, (j_decompress_ptr cinfo)); + JMETHOD(void, skip_input_data, (j_decompress_ptr cinfo, long num_bytes)); + JMETHOD(boolean, resync_to_restart, (j_decompress_ptr cinfo, int desired)); + JMETHOD(void, term_source, (j_decompress_ptr cinfo)); + //JMETHOD(boolean, seek_input_data, (j_decompress_ptr cinfo, long byte_offset)); +}; + + +/* Memory manager object. + * Allocates "small" objects (a few K total), "large" objects (tens of K), + * and "really big" objects (virtual arrays with backing store if needed). + * The memory manager does not allow individual objects to be freed; rather, + * each created object is assigned to a pool, and whole pools can be freed + * at once. This is faster and more convenient than remembering exactly what + * to free, especially where malloc()/free() are not too speedy. + * NB: alloc routines never return NULL. They exit to error_exit if not + * successful. + */ + +#define JPOOL_PERMANENT 0 /* lasts until master record is destroyed */ +#define JPOOL_IMAGE 1 /* lasts until done with image/datastream */ +#define JPOOL_NUMPOOLS 2 + +typedef struct jvirt_sarray_control * jvirt_sarray_ptr; +typedef struct jvirt_barray_control * jvirt_barray_ptr; + + +struct jpeg_memory_mgr { + /* Method pointers */ + JMETHOD(void *, alloc_small, (j_common_ptr cinfo, int pool_id, + size_t sizeofobject)); + JMETHOD(void FAR *, alloc_large, (j_common_ptr cinfo, int pool_id, + size_t sizeofobject)); + JMETHOD(JSAMPARRAY, alloc_sarray, (j_common_ptr cinfo, int pool_id, + JDIMENSION samplesperrow, + JDIMENSION numrows)); + JMETHOD(JBLOCKARRAY, alloc_barray, (j_common_ptr cinfo, int pool_id, + JDIMENSION blocksperrow, + JDIMENSION numrows)); + JMETHOD(jvirt_sarray_ptr, request_virt_sarray, (j_common_ptr cinfo, + int pool_id, + boolean pre_zero, + JDIMENSION samplesperrow, + JDIMENSION numrows, + JDIMENSION maxaccess)); + JMETHOD(jvirt_barray_ptr, request_virt_barray, (j_common_ptr cinfo, + int pool_id, + boolean pre_zero, + JDIMENSION blocksperrow, + JDIMENSION numrows, + JDIMENSION maxaccess)); + JMETHOD(void, realize_virt_arrays, (j_common_ptr cinfo)); + JMETHOD(JSAMPARRAY, access_virt_sarray, (j_common_ptr cinfo, + jvirt_sarray_ptr ptr, + JDIMENSION start_row, + JDIMENSION num_rows, + boolean writable)); + JMETHOD(JBLOCKARRAY, access_virt_barray, (j_common_ptr cinfo, + jvirt_barray_ptr ptr, + JDIMENSION start_row, + JDIMENSION num_rows, + boolean writable)); + JMETHOD(void, free_pool, (j_common_ptr cinfo, int pool_id)); + JMETHOD(void, self_destruct, (j_common_ptr cinfo)); + + /* Limit on memory allocation for this JPEG object. (Note that this is + * merely advisory, not a guaranteed maximum; it only affects the space + * used for virtual-array buffers.) May be changed by outer application + * after creating the JPEG object. + */ + long max_memory_to_use; + + /* Maximum allocation request accepted by alloc_large. */ + long max_alloc_chunk; +}; + + +/* Routine signature for application-supplied marker processing methods. + * Need not pass marker code since it is stored in cinfo->unread_marker. + */ +typedef JMETHOD(boolean, jpeg_marker_parser_method, (j_decompress_ptr cinfo)); + + +/* Declarations for routines called by application. + * The JPP macro hides prototype parameters from compilers that can't cope. + * Note JPP requires double parentheses. + */ + +#ifdef HAVE_PROTOTYPES +#define JPP(arglist) arglist +#else +#define JPP(arglist) () +#endif + + +/* Short forms of external names for systems with brain-damaged linkers. + * We shorten external names to be unique in the first six letters, which + * is good enough for all known systems. + * (If your compiler itself needs names to be unique in less than 15 + * characters, you are out of luck. Get a better compiler.) + */ + +#ifdef NEED_SHORT_EXTERNAL_NAMES +#define jpeg_std_error jStdError +#define jpeg_CreateCompress jCreaCompress +#define jpeg_CreateDecompress jCreaDecompress +#define jpeg_destroy_compress jDestCompress +#define jpeg_destroy_decompress jDestDecompress +#define jpeg_stdio_dest jStdDest +#define jpeg_stdio_src jStdSrc +/** add dec the stream by y00181162**/ +#define jpeg_mem_src jMemSrc +#define jpeg_set_defaults jSetDefaults +#define jpeg_set_colorspace jSetColorspace +#define jpeg_default_colorspace jDefColorspace +#define jpeg_set_quality jSetQuality +#define jpeg_set_linear_quality jSetLQuality +#define jpeg_add_quant_table jAddQuantTable +#define jpeg_quality_scaling jQualityScaling +#define jpeg_simple_progression jSimProgress +#define jpeg_suppress_tables jSuppressTables +#define jpeg_alloc_quant_table jAlcQTable +#define jpeg_alloc_huff_table jAlcHTable +#define jpeg_start_compress jStrtCompress +#define jpeg_write_scanlines jWrtScanlines +#define jpeg_finish_compress jFinCompress +#define jpeg_write_raw_data jWrtRawData +#define jpeg_write_marker jWrtMarker +#define jpeg_write_m_header jWrtMHeader +#define jpeg_write_m_byte jWrtMByte +#define jpeg_write_tables jWrtTables +#define jpeg_read_header jReadHeader +#define jpeg_start_decompress jStrtDecompress +#define jpeg_read_scanlines jReadScanlines +#define jpeg_finish_decompress jFinDecompress +#define jpeg_read_raw_data jReadRawData +#define jpeg_has_multiple_scans jHasMultScn +#define jpeg_start_output jStrtOutput +#define jpeg_finish_output jFinOutput +#define jpeg_input_complete jInComplete +#define jpeg_new_colormap jNewCMap +#define jpeg_consume_input jConsumeInput +#define jpeg_calc_output_dimensions jCalcDimensions +#define jpeg_save_markers jSaveMarkers +#define jpeg_set_marker_processor jSetMarker +#define jpeg_read_coefficients jReadCoefs +#define jpeg_write_coefficients jWrtCoefs +#define jpeg_copy_critical_parameters jCopyCrit +#define jpeg_abort_compress jAbrtCompress +#define jpeg_abort_decompress jAbrtDecompress +#define jpeg_abort jAbort +#define jpeg_destroy jDestroy +#define jpeg_resync_to_restart jResyncRestart +#endif /* NEED_SHORT_EXTERNAL_NAMES */ + + +/* Default error-management setup */ +EXTERN(struct jpeg_error_mgr *) jpeg_std_error + JPP((struct jpeg_error_mgr * err)); + +/* Initialization of JPEG compression objects. + * jpeg_create_compress() and jpeg_create_decompress() are the exported + * names that applications should call. These expand to calls on + * jpeg_CreateCompress and jpeg_CreateDecompress with additional information + * passed for version mismatch checking. + * NB: you must set up the error-manager BEFORE calling jpeg_create_xxx. + */ +#define jpeg_create_compress(cinfo) \ + jpeg_CreateCompress((cinfo), JPEG_LIB_VERSION, \ + (size_t) sizeof(struct jpeg_compress_struct)) +#define jpeg_create_decompress(cinfo) \ + jpeg_CreateDecompress((cinfo), JPEG_LIB_VERSION, \ + (size_t) sizeof(struct jpeg_decompress_struct)) +EXTERN(void) jpeg_CreateCompress JPP((j_compress_ptr cinfo, + int version, size_t structsize)); +EXTERN(void) jpeg_CreateDecompress JPP((j_decompress_ptr cinfo, + int version, size_t structsize)); +/* Destruction of JPEG compression objects */ +EXTERN(void) jpeg_destroy_compress JPP((j_compress_ptr cinfo)); +EXTERN(void) jpeg_destroy_decompress JPP((j_decompress_ptr cinfo)); + +/* Standard data source and destination managers: stdio streams. */ +/* Caller is responsible for opening the file before and closing after. */ +EXTERN(void) jpeg_stdio_dest JPP((j_compress_ptr cinfo, FILE * outfile)); +EXTERN(void) jpeg_stdio_src JPP((j_decompress_ptr cinfo, FILE * infile)); +/** add dec the stream by y00181162**/ +EXTERN(void) jpeg_mem_src JPP((j_decompress_ptr cinfo, + unsigned char * inbuffer, + unsigned long insize)); +/* Default parameter setup for compression */ +EXTERN(void) jpeg_set_defaults JPP((j_compress_ptr cinfo)); +/* Compression parameter setup aids */ +EXTERN(void) jpeg_set_colorspace JPP((j_compress_ptr cinfo, + J_COLOR_SPACE colorspace)); +EXTERN(void) jpeg_default_colorspace JPP((j_compress_ptr cinfo)); +EXTERN(void) jpeg_set_quality JPP((j_compress_ptr cinfo, int quality, + boolean force_baseline)); +EXTERN(void) jpeg_set_linear_quality JPP((j_compress_ptr cinfo, + int scale_factor, + boolean force_baseline)); +EXTERN(void) jpeg_add_quant_table JPP((j_compress_ptr cinfo, int which_tbl, + const unsigned int *basic_table, + int scale_factor, + boolean force_baseline)); +EXTERN(int) jpeg_quality_scaling JPP((int quality)); +EXTERN(void) jpeg_simple_progression JPP((j_compress_ptr cinfo)); +EXTERN(void) jpeg_suppress_tables JPP((j_compress_ptr cinfo, + boolean suppress)); +EXTERN(JQUANT_TBL *) jpeg_alloc_quant_table JPP((j_common_ptr cinfo)); +EXTERN(JHUFF_TBL *) jpeg_alloc_huff_table JPP((j_common_ptr cinfo)); + +/* Main entry points for compression */ +EXTERN(void) jpeg_start_compress JPP((j_compress_ptr cinfo, + boolean write_all_tables)); +EXTERN(JDIMENSION) jpeg_write_scanlines JPP((j_compress_ptr cinfo, + JSAMPARRAY scanlines, + JDIMENSION num_lines)); +EXTERN(void) jpeg_finish_compress JPP((j_compress_ptr cinfo)); + +/* Replaces jpeg_write_scanlines when writing raw downsampled data. */ +EXTERN(JDIMENSION) jpeg_write_raw_data JPP((j_compress_ptr cinfo, + JSAMPIMAGE data, + JDIMENSION num_lines)); + +/* Write a special marker. See libjpeg.doc concerning safe usage. */ +EXTERN(void) jpeg_write_marker + JPP((j_compress_ptr cinfo, int marker, + const JOCTET * dataptr, unsigned int datalen)); +/* Same, but piecemeal. */ +EXTERN(void) jpeg_write_m_header + JPP((j_compress_ptr cinfo, int marker, unsigned int datalen)); +EXTERN(void) jpeg_write_m_byte + JPP((j_compress_ptr cinfo, int val)); + +/* Alternate compression function: just write an abbreviated table file */ +EXTERN(void) jpeg_write_tables JPP((j_compress_ptr cinfo)); + +/* Decompression startup: read start of JPEG datastream to see what's there */ +EXTERN(int) jpeg_read_header JPP((j_decompress_ptr cinfo, + boolean require_image)); +/* Return value is one of: */ +#define JPEG_SUSPENDED 0 /* Suspended due to lack of input data */ +#define JPEG_HEADER_OK 1 /* Found valid image datastream */ +#define JPEG_HEADER_TABLES_ONLY 2 /* Found valid table-specs-only datastream */ +/* If you pass require_image = TRUE (normal case), you need not check for + * a TABLES_ONLY return code; an abbreviated file will cause an error exit. + * JPEG_SUSPENDED is only possible if you use a data source module that can + * give a suspension return (the stdio source module doesn't). + */ + +/* Main entry points for decompression */ +EXTERN(boolean) jpeg_start_decompress JPP((j_decompress_ptr cinfo)); +EXTERN(JDIMENSION) jpeg_read_scanlines JPP((j_decompress_ptr cinfo, + JSAMPARRAY scanlines, + JDIMENSION max_lines)); +EXTERN(boolean) jpeg_finish_decompress JPP((j_decompress_ptr cinfo)); + +/* Replaces jpeg_read_scanlines when reading raw downsampled data. */ +EXTERN(JDIMENSION) jpeg_read_raw_data JPP((j_decompress_ptr cinfo, + JSAMPIMAGE data, + JDIMENSION max_lines)); + +/* Additional entry points for buffered-image mode. */ +EXTERN(boolean) jpeg_has_multiple_scans JPP((j_decompress_ptr cinfo)); +EXTERN(boolean) jpeg_start_output JPP((j_decompress_ptr cinfo, + int scan_number)); +EXTERN(boolean) jpeg_finish_output JPP((j_decompress_ptr cinfo)); +EXTERN(boolean) jpeg_input_complete JPP((j_decompress_ptr cinfo)); +EXTERN(void) jpeg_new_colormap JPP((j_decompress_ptr cinfo)); +EXTERN(int) jpeg_consume_input JPP((j_decompress_ptr cinfo)); +/* Return value is one of: */ +/* #define JPEG_SUSPENDED 0 Suspended due to lack of input data */ +#define JPEG_REACHED_SOS 1 /* Reached start of new scan */ +#define JPEG_REACHED_EOI 2 /* Reached end of image */ +#define JPEG_ROW_COMPLETED 3 /* Completed one iMCU row */ +#define JPEG_SCAN_COMPLETED 4 /* Completed last iMCU row of a scan */ + +/* Precalculate output dimensions for current decompression parameters. */ +EXTERN(void) jpeg_calc_output_dimensions JPP((j_decompress_ptr cinfo)); + +/* Control saving of COM and APPn markers into marker_list. */ +EXTERN(void) jpeg_save_markers + JPP((j_decompress_ptr cinfo, int marker_code, + unsigned int length_limit)); + +/* Install a special processing method for COM or APPn markers. */ +EXTERN(void) jpeg_set_marker_processor + JPP((j_decompress_ptr cinfo, int marker_code, + jpeg_marker_parser_method routine)); + +/* Read or write raw DCT coefficients --- useful for lossless transcoding. */ +EXTERN(jvirt_barray_ptr *) jpeg_read_coefficients JPP((j_decompress_ptr cinfo)); +EXTERN(void) jpeg_write_coefficients JPP((j_compress_ptr cinfo, + jvirt_barray_ptr * coef_arrays)); +EXTERN(void) jpeg_copy_critical_parameters JPP((j_decompress_ptr srcinfo, + j_compress_ptr dstinfo)); + +/* If you choose to abort compression or decompression before completing + * jpeg_finish_(de)compress, then you need to clean up to release memory, + * temporary files, etc. You can just call jpeg_destroy_(de)compress + * if you're done with the JPEG object, but if you want to clean it up and + * reuse it, call this: + */ +EXTERN(void) jpeg_abort_compress JPP((j_compress_ptr cinfo)); +EXTERN(void) jpeg_abort_decompress JPP((j_decompress_ptr cinfo)); + +/* Generic versions of jpeg_abort and jpeg_destroy that work on either + * flavor of JPEG object. These may be more convenient in some places. + */ +EXTERN(void) jpeg_abort JPP((j_common_ptr cinfo)); +EXTERN(void) jpeg_destroy JPP((j_common_ptr cinfo)); + +/* Default restart-marker-resync procedure for use by data source modules */ +EXTERN(boolean) jpeg_resync_to_restart JPP((j_decompress_ptr cinfo, + int desired)); + + +/* These marker codes are exported since applications and data source modules + * are likely to want to use them. + */ + +#define JPEG_RST0 0xD0 /* RST0 marker code */ +#define JPEG_EOI 0xD9 /* EOI marker code */ +#define JPEG_APP0 0xE0 /* APP0 marker code */ +#define JPEG_COM 0xFE /* COM marker code */ + + +/* If we have a brain-damaged compiler that emits warnings (or worse, errors) + * for structure definitions that are never filled in, keep it quiet by + * supplying dummy definitions for the various substructures. + */ + +#ifdef INCOMPLETE_TYPES_BROKEN +#ifndef JPEG_INTERNALS /* will be defined in jpegint.h */ +struct jvirt_sarray_control { long dummy; }; +struct jvirt_barray_control { long dummy; }; +struct jpeg_comp_master { long dummy; }; +struct jpeg_c_main_controller { long dummy; }; +struct jpeg_c_prep_controller { long dummy; }; +struct jpeg_c_coef_controller { long dummy; }; +struct jpeg_marker_writer { long dummy; }; +struct jpeg_color_converter { long dummy; }; +struct jpeg_downsampler { long dummy; }; +struct jpeg_forward_dct { long dummy; }; +struct jpeg_entropy_encoder { long dummy; }; +struct jpeg_decomp_master { long dummy; }; +struct jpeg_d_main_controller { long dummy; }; +struct jpeg_d_coef_controller { long dummy; }; +struct jpeg_d_post_controller { long dummy; }; +struct jpeg_input_controller { long dummy; }; +struct jpeg_marker_reader { long dummy; }; +struct jpeg_entropy_decoder { long dummy; }; +struct jpeg_inverse_dct { long dummy; }; +struct jpeg_upsampler { long dummy; }; +struct jpeg_color_deconverter { long dummy; }; +struct jpeg_color_quantizer { long dummy; }; +#endif /* JPEG_INTERNALS */ +#endif /* INCOMPLETE_TYPES_BROKEN */ + + +/* + * The JPEG library modules define JPEG_INTERNALS before including this file. + * The internal structure declarations are read only when that is true. + * Applications using the library should not include jpegint.h, but may wish + * to include jerror.h. + */ + +#ifdef JPEG_INTERNALS +#include "jpegint.h" /* fetch private declarations */ +#include "jerror.h" /* fetch error codes too */ +#endif + +#endif /* JPEGLIB_H */ diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/list.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/list.h new file mode 100644 index 0000000000..8bf3653916 --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/list.h @@ -0,0 +1,149 @@ +/* + * Copyright (c) HighPoint Technologies, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/sys/dev/hptrr/list.h,v 1.2.2.1.4.1 2010/06/14 02:09:06 kensmith Exp $ + */ +/* + * $Id: list.h,v 1.6 2006/10/31 06:25:28 gmm Exp $ + * Copyright (C) 2004-2005 HighPoint Technologies, Inc. All rights reserved. + */ +#ifndef _HPT_LIST_H_ +#define _HPT_LIST_H_ + +#ifndef _LINUX_LIST_H + +#ifndef HPT_INLINE +#define HPT_INLINE __inline +#endif + +typedef unsigned long HPT_UPTR; + +struct list_head { + struct list_head *next, *prev; +}; + +#define LIST_HEAD_INIT(name) { &(name), &(name) } + +#define INIT_LIST_HEAD(ptr) do { (ptr)->next = (ptr); (ptr)->prev = (ptr); } while (0) + +static HPT_INLINE void __list_add(struct list_head * _new, struct list_head * prev, struct list_head * next) +{ + next->prev = _new; + _new->next = next; + _new->prev = prev; + prev->next = _new; +} + +static HPT_INLINE void list_add(struct list_head *_new, struct list_head *head) +{ + __list_add(_new, head, head->next); +} + +static HPT_INLINE void list_add_tail(struct list_head *_new, struct list_head *head) +{ + __list_add(_new, head->prev, head); +} + +static HPT_INLINE void __list_del(struct list_head * prev, struct list_head * next) +{ + next->prev = prev; + prev->next = next; +} + +static HPT_INLINE void list_del(struct list_head *entry) +{ + __list_del(entry->prev, entry->next); +} + +static HPT_INLINE void list_del_init(struct list_head *entry) +{ + __list_del(entry->prev, entry->next); + INIT_LIST_HEAD(entry); +} + +static inline void list_move(struct list_head *list, struct list_head *head) +{ + __list_del(list->prev, list->next); + list_add(list, head); +} + +static inline void list_move_tail(struct list_head *list, + struct list_head *head) +{ + __list_del(list->prev, list->next); + list_add_tail(list, head); +} + +static HPT_INLINE int list_empty(struct list_head *head) +{ + return head->next == head; +} + +static HPT_INLINE void __list_splice(struct list_head *list, + struct list_head *head) +{ + struct list_head *first = list->next; + struct list_head *last = list->prev; + struct list_head *at = head->next; + + first->prev = head; + head->next = first; + + last->next = at; + at->prev = last; +} + +static HPT_INLINE void list_splice(struct list_head *list, struct list_head *head) +{ + if (!list_empty(list)) + __list_splice(list, head); +} + +static HPT_INLINE void list_splice_init(struct list_head *list, struct list_head *head) +{ + if (!list_empty(list)) { + __list_splice(list, head); + INIT_LIST_HEAD(list); + } +} + +/*#define list_entry(ptr, type, member) \ + ((type *)((char *)(ptr)-(HPT_UPTR)(&((type *)0)->member))) */ +#define list_entry(ptr, type, member) \ + ((type *)((unsigned long)(ptr)-((unsigned long)(&((type *)1)->member) - 1))) + +#define list_for_each(pos, head) \ + for (pos = (head)->next; pos != (head); pos = pos->next) + +#define list_for_each_safe(pos, n, head) \ + for (pos = (head)->next, n = pos->next; pos != (head); \ + pos = n, n = pos->next) + +#define get_first_item(attached, type, member) \ + ((type *)((char *)((attached)->next)-(HPT_UPTR)(&((type *)0)->member))) + +#endif + +#endif diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/mkp/mod_ext.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/mkp/mod_ext.h new file mode 100644 index 0000000000..1fe3b443b8 --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/mkp/mod_ext.h @@ -0,0 +1,101 @@ +/****************************************************************************** + + Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. + + ****************************************************************************** + File Name : hi3511_ext.h + Version : Initial Draft + Author : Hisilicon multimedia software group + Created : 2006/12/22 + Description : + History : + 1.Date : 2006/12/22 + Author : c42025 + Modification: Created file + + 2.Date : 2008/02/21 + Author : c42025 + Modification: add function CMPI_QueryModules, for solving AE6D02922 + + 3.Date : 2008/02/26 + Author : c42025 + Modification: Defect Form : AE6D02922, add two functions "FN_MOD_Notify" + and "FN_MOD_QueryState" . + + 4.Date : 2008/03/03 + Author : c42025 + Modification: add structure definition "MOD_NAME_S" + +******************************************************************************/ +#include +#include +#include + +#include "hi_type.h" +#include "hi_errno.h" + + +#ifndef __MOD_EXT_H__ +#define __MOD_EXT_H__ + +#define MAX_MPP_MODULES HI_ID_BUTT + +#define VERSION_MAGIC 20150403 + +typedef struct hiMOD_NAME_S +{ + MOD_ID_E enModId; + HI_CHAR aModName[16]; +}MOD_NAME_S; + +typedef enum hiMOD_NOTICE_ID_E +{ + MOD_NOTICE_STOP = 0x11, +}MOD_NOTICE_ID_E; + +typedef enum hiMOD_STATE_E +{ + MOD_STATE_FREE = 0x11, + MOD_STATE_BUSY = 0X22, +}MOD_STATE_E; + +typedef HI_S32 FN_MOD_Init(HI_VOID *); +typedef HI_VOID FN_MOD_Exit(HI_VOID); +typedef HI_VOID FN_MOD_Notify(MOD_NOTICE_ID_E enNoticeId); +typedef HI_VOID FN_MOD_QueryState(MOD_STATE_E *pstState); +typedef HI_U32 FN_MOD_VerChecker(HI_VOID); + +typedef struct hiMPP_MODULE_S +{ + struct module *pstOwner; + MOD_ID_E enModId; + + FN_MOD_Init *pfnInit; + FN_MOD_Exit *pfnExit; + FN_MOD_QueryState *pfnQueryState; + FN_MOD_Notify *pfnNotify; + FN_MOD_VerChecker *pfnVerChecker; + + HI_VOID *pstExportFuncs; + HI_VOID *pData; + + HI_CHAR *pVersion; +}UMAP_MODULE_S; + +extern UMAP_MODULE_S g_astModules[MAX_MPP_MODULES]; +extern MOD_NAME_S g_aModName[MAX_MPP_MODULES]; + +extern HI_VOID CMPI_StopModules(HI_VOID); +extern HI_S32 CMPI_QueryModules(HI_VOID); +extern HI_S32 CMPI_InitModules(HI_VOID); +extern HI_VOID CMPI_ExitModules(HI_VOID); +extern HI_S32 CMPI_RegisterMod(UMAP_MODULE_S *pstModules); +extern HI_VOID CMPI_UnRegisterMod(MOD_ID_E enModId); + + + +#define CHECK_FUNC_ENTRY(id) (NULL != (g_astModules[id].pstExportFuncs)) +#define FUNC_ENTRY(type,id) ((type*)(g_astModules[id].pstExportFuncs)) + +#endif /* __MOD_EXT_H__ */ + diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_adec.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_adec.h new file mode 100644 index 0000000000..e4238f5050 --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_adec.h @@ -0,0 +1,54 @@ +/****************************************************************************** + + Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. + + ****************************************************************************** + File Name : ai.c + Version : Initial Draft + Author : Hisilicon multimedia software group + Created : 2009/6/15 + Description : + History : + 1.Date : 2009/6/19 + Author : p00123320 + Modification: Created file +******************************************************************************/ + + +#ifndef _MPI_ADEC_H__ +#define _MPI_ADEC_H__ + +#include "hi_common.h" +#include "hi_comm_aio.h" +#include "hi_comm_adec.h" + +#ifdef __cplusplus +#if __cplusplus +extern "C" +{ +#endif +#endif /* __cplusplus */ + +HI_S32 HI_MPI_ADEC_CreateChn(ADEC_CHN AdChn, ADEC_CHN_ATTR_S *pstAttr); +HI_S32 HI_MPI_ADEC_DestroyChn(ADEC_CHN AdChn); + +HI_S32 HI_MPI_ADEC_SendStream(ADEC_CHN AdChn, const AUDIO_STREAM_S *pstStream, HI_BOOL bBlock); + +HI_S32 HI_MPI_ADEC_ClearChnBuf(ADEC_CHN AdChn); + +HI_S32 HI_MPI_ADEC_RegeisterDecoder(HI_S32 *ps32Handle, ADEC_DECODER_S *pstDecoder); +HI_S32 HI_MPI_ADEC_UnRegisterDecoder(HI_S32 s32Handle); + +HI_S32 HI_MPI_ADEC_GetFrame(ADEC_CHN AdChn, AUDIO_FRAME_INFO_S *pstFrmInfo, HI_BOOL bBlock); +HI_S32 HI_MPI_ADEC_ReleaseFrame(ADEC_CHN AdChn, AUDIO_FRAME_INFO_S *pstFrmInfo); + + + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif /* __cplusplus */ + +#endif + diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_aenc.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_aenc.h new file mode 100644 index 0000000000..d2cc2beffb --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_aenc.h @@ -0,0 +1,58 @@ +/****************************************************************************** + + Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. + + ****************************************************************************** + File Name : ai.c + Version : Initial Draft + Author : Hisilicon multimedia software group + Created : 2009/6/15 + Description : + History : + 1.Date : 2009/6/15 + Author : p00123320 + Modification: Created file +******************************************************************************/ + + +#ifndef _MPI_AENC_H__ +#define _MPI_AENC_H__ + +#include "hi_common.h" +#include "hi_comm_aio.h" +#include "hi_comm_aenc.h" + +#ifdef __cplusplus +#if __cplusplus +extern "C" +{ +#endif +#endif /* __cplusplus */ + +#define AENC_ADAPT_MAGIC 0Xfcfcfcfc + +HI_S32 HI_MPI_AENC_CreateChn(AENC_CHN AeChn, const AENC_CHN_ATTR_S *pstAttr); +HI_S32 HI_MPI_AENC_DestroyChn(AENC_CHN AeChn); + +HI_S32 HI_MPI_AENC_SendFrame(AENC_CHN AeChn, + const AUDIO_FRAME_S *pstFrm, const AEC_FRAME_S *pstAecFrm); + +HI_S32 HI_MPI_AENC_GetStream(AENC_CHN AeChn, AUDIO_STREAM_S *pstStream, HI_BOOL bBlock); +HI_S32 HI_MPI_AENC_ReleaseStream(AENC_CHN AeChn, const AUDIO_STREAM_S *pstStream); + +HI_S32 HI_MPI_AENC_GetFd(AENC_CHN AeChn); + +HI_S32 HI_MPI_AENC_Save_File(AENC_CHN AeChn, AUDIO_SAVE_FILE_INFO_S *pstSaveFileInfo); + +HI_S32 HI_MPI_AENC_RegeisterEncoder(HI_S32 *ps32Handle, AENC_ENCODER_S *pstEncoder); +HI_S32 HI_MPI_AENC_UnRegisterEncoder(HI_S32 s32Handle); + + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif /* __cplusplus */ + +#endif + diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_ai.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_ai.h new file mode 100644 index 0000000000..13c9dd0d35 --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_ai.h @@ -0,0 +1,81 @@ +/****************************************************************************** + + Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. + + ****************************************************************************** + File Name : sio.c + Version : Initial Draft + Author : Hisilicon multimedia software group + Created : 2009/5/5 + Description : + History : + 1.Date : 2009/5/5 + Author : p00123320 + Modification: Created file +******************************************************************************/ + + +#ifndef _MPI_AI_H__ +#define _MPI_AI_H__ + +#include "hi_type.h" +#include "hi_common.h" +#include "hi_comm_aio.h" + +#ifdef __cplusplus +#if __cplusplus +extern "C" +{ +#endif +#endif /* __cplusplus */ + +HI_S32 HI_MPI_AI_SetPubAttr(AUDIO_DEV AudioDevId, const AIO_ATTR_S *pstAttr); +HI_S32 HI_MPI_AI_GetPubAttr(AUDIO_DEV AudioDevId, AIO_ATTR_S *pstAttr); + +HI_S32 HI_MPI_AI_Enable(AUDIO_DEV AudioDevId); +HI_S32 HI_MPI_AI_Disable(AUDIO_DEV AudioDevId); + +HI_S32 HI_MPI_AI_EnableChn(AUDIO_DEV AudioDevId, AI_CHN AiChn); +HI_S32 HI_MPI_AI_DisableChn(AUDIO_DEV AudioDevId, AI_CHN AiChn); + +HI_S32 HI_MPI_AI_GetFrame(AUDIO_DEV AudioDevId, AI_CHN AiChn, + AUDIO_FRAME_S *pstFrm, AEC_FRAME_S *pstAecFrm, HI_BOOL bBlock); +HI_S32 HI_MPI_AI_ReleaseFrame(AUDIO_DEV AudioDevId, AI_CHN AiChn, + AUDIO_FRAME_S *pstFrm, AEC_FRAME_S *pstAecFrm); +HI_S32 HI_MPI_AI_SetChnParam(AUDIO_DEV AudioDevId, AI_CHN AiChn, AI_CHN_PARAM_S *pstChnParam); +HI_S32 HI_MPI_AI_GetChnParam(AUDIO_DEV AudioDevId, AI_CHN AiChn, AI_CHN_PARAM_S *pstChnParam); + +HI_S32 HI_MPI_AI_EnableAec(AUDIO_DEV AiDevId, AI_CHN AiChn, AUDIO_DEV AoDevId, AO_CHN AoChn); +HI_S32 HI_MPI_AI_DisableAec(AUDIO_DEV AiDevId, AI_CHN AiChn); + +HI_S32 HI_MPI_AI_EnableReSmp(AUDIO_DEV AudioDevId, AI_CHN AiChn, AUDIO_RESAMPLE_ATTR_S *pstAttr); +HI_S32 HI_MPI_AI_DisableReSmp(AUDIO_DEV AudioDevId, AI_CHN AiChn); + +HI_S32 HI_MPI_AI_EnableAnr(AUDIO_DEV AudioDevId, AI_CHN AiChn); +HI_S32 HI_MPI_AI_DisableAnr(AUDIO_DEV AudioDevId, AI_CHN AiChn); + +HI_S32 HI_MPI_AI_GetFd(AUDIO_DEV AudioDevId, AI_CHN AiChn); + +HI_S32 HI_MPI_AI_SetHpfAttr(AUDIO_DEV AiDevId, AI_CHN AiChn, AI_HPF_ATTR_S *pstHpfAttr); +HI_S32 HI_MPI_AI_GetHpfAttr(AUDIO_DEV AiDevId, AI_CHN AiChn, AI_HPF_ATTR_S *pstHpfAttr); + +HI_S32 HI_MPI_AI_SetVqeAttr(AUDIO_DEV AiDevId, AI_CHN AiChn, AUDIO_DEV AoDevId, AO_CHN AoChn, AI_VQE_CONFIG_S *pstVqeConfig); +HI_S32 HI_MPI_AI_GetVqeAttr(AUDIO_DEV AiDevId, AI_CHN AiChn, AI_VQE_CONFIG_S *pstVqeConfig); +HI_S32 HI_MPI_AI_EnableVqe(AUDIO_DEV AiDevId, AI_CHN AiChn); +HI_S32 HI_MPI_AI_DisableVqe(AUDIO_DEV AiDevId, AI_CHN AiChn); + +HI_S32 HI_MPI_AI_EnableReSmpEx(AUDIO_DEV AudioDevId, AI_CHN AiChn, AUDIO_RESAMPLE_ATTR_EX_S *pstAttr); +HI_S32 HI_MPI_AI_DisableReSmpEx(AUDIO_DEV AudioDevId, AI_CHN AiChn); + +HI_S32 HI_MPI_AI_Save_File(AUDIO_DEV AudioDevId, AI_CHN AiChn,AUDIO_SAVE_FILE_INFO_S *pstSaveFileInfo); + +HI_S32 HI_MPI_AI_ClrPubAttr(AUDIO_DEV AudioDevId); + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif /* __cplusplus */ + +#endif + diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_ao.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_ao.h new file mode 100644 index 0000000000..3fc98ee6a3 --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_ao.h @@ -0,0 +1,71 @@ +/****************************************************************************** + + Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. + + ****************************************************************************** + File Name : mpi_ao.h + Version : Initial Draft + Author : Hisilicon multimedia software group + Created : 2009/5/5 + Description : + History : + 1.Date : 2009/5/5 + Author : p00123320 + Modification: Created file +******************************************************************************/ + + +#ifndef _MPI_AO_H__ +#define _MPI_AO_H__ + +#include "hi_type.h" +#include "hi_common.h" +#include "hi_comm_aio.h" + +#ifdef __cplusplus +#if __cplusplus +extern "C" +{ +#endif +#endif /* __cplusplus */ + + +HI_S32 HI_MPI_AO_SetPubAttr(AUDIO_DEV AudioDevId, const AIO_ATTR_S *pstAttr); +HI_S32 HI_MPI_AO_GetPubAttr(AUDIO_DEV AudioDevId, AIO_ATTR_S *pstAttr); + +HI_S32 HI_MPI_AO_Enable(AUDIO_DEV AudioDevId); +HI_S32 HI_MPI_AO_Disable(AUDIO_DEV AudioDevId); + +HI_S32 HI_MPI_AO_EnableChn(AUDIO_DEV AudioDevId, AO_CHN AoChn); +HI_S32 HI_MPI_AO_DisableChn(AUDIO_DEV AudioDevId, AO_CHN AoChn); + +HI_S32 HI_MPI_AO_SendFrame(AUDIO_DEV AudioDevId, AO_CHN AoChn, + const AUDIO_FRAME_S *pstData, HI_BOOL bBlock); + +HI_S32 HI_MPI_AO_EnableReSmp(AUDIO_DEV AudioDevId, AO_CHN AoChn, AUDIO_RESAMPLE_ATTR_S *pstAttr); +HI_S32 HI_MPI_AO_DisableReSmp(AUDIO_DEV AudioDevId, AO_CHN AoChn); + +HI_S32 HI_MPI_AO_EnableReSmpEx(AUDIO_DEV AudioDevId, AO_CHN AoChn, AUDIO_RESAMPLE_ATTR_EX_S *pstAttr); +HI_S32 HI_MPI_AO_DisableReSmpEx(AUDIO_DEV AudioDevId, AO_CHN AoChn); + +HI_S32 HI_MPI_AO_ClearChnBuf(AUDIO_DEV AudioDevId ,AO_CHN AoChn); +HI_S32 HI_MPI_AO_QueryChnStat(AUDIO_DEV AudioDevId ,AO_CHN AoChn, AO_CHN_STATE_S *pstStatus); + +HI_S32 HI_MPI_AO_PauseChn(AUDIO_DEV AudioDevId, AO_CHN AoChn); +HI_S32 HI_MPI_AO_ResumeChn(AUDIO_DEV AudioDevId, AO_CHN AoChn); + +HI_S32 HI_MPI_AO_SetVolume(AUDIO_DEV AudioDevId, AO_CHN AoChn, HI_S32 s32VolumeDb); +HI_S32 HI_MPI_AO_GetVolume(AUDIO_DEV AudioDevId, AO_CHN AoChn, HI_S32 *ps32VolumeDb); + +HI_S32 HI_MPI_AO_GetFd(AUDIO_DEV AudioDevId, AO_CHN AoChn); + +HI_S32 HI_MPI_AO_ClrPubAttr(AUDIO_DEV AudioDevId); + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif /* __cplusplus */ + +#endif + diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_hdmi.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_hdmi.h new file mode 100644 index 0000000000..104f32b828 --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_hdmi.h @@ -0,0 +1,60 @@ +/****************************************************************************** + + Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. + + ****************************************************************************** + File Name : mpi_hdmi.h + Version : Initial Draft + Author : Hisilicon multimedia software group + Created : 2011/12/28 + Description : + History : + 1.Date : 2011/12/28 + Author : n00168968/q46153/l00168554 + Modification: Created file + +******************************************************************************/ + +#ifndef __MPI_HDMI_H__ +#define __MPI_HDMI_H__ + +#include "hi_comm_hdmi.h" + +#ifdef __cplusplus +#if __cplusplus +extern "C"{ +#endif +#endif /* End of #ifdef __cplusplus */ + +HI_S32 HI_MPI_HDMI_Init(HI_HDMI_INIT_PARA_S *pstHdmiPara); +HI_S32 HI_MPI_HDMI_DeInit(void); +HI_S32 HI_MPI_HDMI_Open(HI_HDMI_ID_E enHdmi); +HI_S32 HI_MPI_HDMI_Close(HI_HDMI_ID_E enHdmi); +HI_S32 HI_MPI_HDMI_GetSinkCapability(HI_HDMI_ID_E enHdmi, +HI_HDMI_SINK_CAPABILITY_S *pstSinkCap); +HI_S32 HI_MPI_HDMI_SetAttr(HI_HDMI_ID_E enHdmi, HI_HDMI_ATTR_S *pstAttr); +HI_S32 HI_MPI_HDMI_GetAttr(HI_HDMI_ID_E enHdmi, HI_HDMI_ATTR_S *pstAttr); +HI_S32 HI_MPI_HDMI_Start(HI_HDMI_ID_E enHdmi); +HI_S32 HI_MPI_HDMI_Stop(HI_HDMI_ID_E enHdmi); +HI_S32 HI_MPI_HDMI_SetAVMute(HI_HDMI_ID_E enHdmi, HI_BOOL bAvMute); +HI_S32 HI_MPI_HDMI_Force_GetEDID(HI_HDMI_ID_E enHdmi, HI_HDMI_EDID_S *pstEdidData); + +/* Normally, these functions are not necessary */ +HI_S32 HI_MPI_HDMI_SetDeepColor(HI_HDMI_ID_E enHdmi, HI_HDMI_DEEP_COLOR_E enDeepColor); +HI_S32 HI_MPI_HDMI_GetDeepColor(HI_HDMI_ID_E enHdmi, HI_HDMI_DEEP_COLOR_E *penDeepColor); + +HI_S32 HI_MPI_HDMI_SetCsc(HI_HDMI_ID_E enHdmi, HI_HDMI_CSC_S *pstCsc); +HI_S32 HI_MPI_HDMI_GetCsc(HI_HDMI_ID_E enHdmi, HI_HDMI_CSC_S *pstCsc); + +HI_S32 HI_MPI_HDMI_SetInfoFrame(HI_HDMI_ID_E enHdmi, HI_HDMI_INFOFRAME_S *pstInfoFrame); +HI_S32 HI_MPI_HDMI_GetInfoFrame(HI_HDMI_ID_E enHdmi, + HI_HDMI_INFOFRAME_TYPE_E enInfoFrameType, HI_HDMI_INFOFRAME_S *pstInfoFrame); + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif /* End of #ifdef __cplusplus */ + +#endif /*__MPI_HDMI_H__ */ + diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_ive.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_ive.h new file mode 100644 index 0000000000..3d3a13fbc1 --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_ive.h @@ -0,0 +1,460 @@ +/****************************************************************************** + + Copyright (C), 2001-2011, HiSilicon Technologies Co., Ltd. + + ****************************************************************************** + File Name : mpi_ive.h + Version : Initial Draft + Author : HiSilicon multimedia software group + Created : 2011-04-11 + Description : Intelligent video engine (IVE) function declarations + History : + 1.Date : 2010-04-11 + Author : Gong Xiongliang (employee ID: 00181683) + Modification: This file is created. + ******************************************************************************/ + +#ifndef __MPI_IVE_H__ +#define __MPI_IVE_H__ + +#include "hi_comm_ive.h" + +#ifdef __cplusplus +#if __cplusplus +extern "C"{ +#endif +#endif + + +/***************************************************************************** +* Prototype : HI_MPI_IVE_DMA +* Description: Describes the information about direct memory access (DMA). Only the single-component input format is supported. +* Input : IVE_HANDLE *pIveHandle Returned handle ID of a task +* IVE_SRC_INFO_S *pstSrc Input source data +* IVE_MEM_INFO_S *pstDst Output result +* HI_BOOL bInstant Flag indicating whether to generate an interrupt. +* If the output result blocks the next operation, +* set bInstant to HI_TRUE. +* Output : IVE_HANDLE *pIveHandle +* Return Value : HI_SUCCESS: Success;Error codes: Failure. +* Spec : The size of the input data ranges from 32x1 pixels to 1920x1080 pixels. +* The physical addresses of the input data and output data must be aligned by byte. +* The stride must be 8-byte-aligned. +* Calls : +* Called By : +* +* History: +* +* 1. Date : 2011-05-16 +* Author : Jiang Xiaohua (employee ID: 00169368) +* Modification : Created function +* +*****************************************************************************/ +HI_S32 HI_MPI_IVE_DMA(IVE_HANDLE *pIveHandle, IVE_SRC_INFO_S *pstSrc, + IVE_MEM_INFO_S *pstDst, HI_BOOL bInstant); + + + +/***************************************************************************** +* Prototype : HI_MPI_IVE_FILTER +* Description: Describes the information about the 3x3 template filter.The single-component,SP420 and SP422 input formats are supported. +* Input : IVE_HANDLE *pIveHandle Returned handle ID of a task +* IVE_SRC_INFO_S *pstSrc Input source data +* IVE_MEM_INFO_S *pstDst Output result +* IVE_FILTER_CTRL_S *pstFilterCtrl Control parameters of filter +* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. +* Output : IVE_HANDLE *pIveHandle +* Return Value : HI_SUCCESS: Success;Error codes: Failure. +* Spec : The size of the input data ranges from 64x64 pixels to 1920x1024 pixels. +* The physical addresses of the input data and output data must be 8-byte-aligned. +* The stride must be 8-byte-aligned. +* Calls : +* Called By : +* +* History: +* +* 1. Date : 2011-05-16 +* Author : Jiang Xiaohua (employee ID: 00169368) +* Modification : Created function +* +*****************************************************************************/ +HI_S32 HI_MPI_IVE_FILTER(IVE_HANDLE *pIveHandle, IVE_SRC_INFO_S *pstSrc, + IVE_MEM_INFO_S *pstDst, IVE_FILTER_CTRL_S *pstFilterCtrl,HI_BOOL bInstant); + + + +/***************************************************************************** +* Prototype : HI_MPI_IVE_CSC +* Description: Describes the information about color space conversion (CSC). Only the conversion from YUV to RGB is supported. The SP420 and SP422 input format is supported. +* Input : IVE_HANDLE *pIveHandle Returned handle ID of a task +* IVE_SRC_INFO_S *pstSrc Input source data +* IVE_MEM_INFO_S *pstDst Output result +* IVE_CSC_CTRL_S *pstCscCtrl Control parameters for CSC +* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. +* Output : IVE_HANDLE *pIveHandle +* Return Value : HI_SUCCESS: Success;Error codes: Failure. +* Spec : The size of the input data ranges from 64x64 pixels to 1920x1080 pixels. +* The physical addresses of the input data and output data must be 8-byte-aligned. +* The stride must be 8-byte-aligned. +* Calls : +* Called By : +* +* History: +* +* 1. Date : 2011-05-16 +* Author : Jiang Xiaohua (employee ID: 00169368) +* Modification : Created function +* +*****************************************************************************/ +HI_S32 HI_MPI_IVE_CSC(IVE_HANDLE *pIveHandle, IVE_SRC_INFO_S *pstSrc, + IVE_MEM_INFO_S *pstDst, IVE_CSC_CTRL_S *pstCscCtrl,HI_BOOL bInstant); + + + +/***************************************************************************** +* Prototype : HI_MPI_IVE_FILTER_AND_CSC +* Description: Describes the information about 3x3 template filter+CSC. The SP420 and SP422 input format is supported. +* Input : IVE_HANDLE *pIveHandle Returned handle ID of a task +* IVE_SRC_INFO_S *pstSrc Input source data +* IVE_MEM_INFO_S *pstDst Output result +* IVE_FILTER_AND_CSC_CTRL_S *pstFltCscCtrl Control parameters +* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. +* Output : IVE_HANDLE *pIveHandle +* Return Value : HI_SUCCESS: Success;Error codes: Failure. +* Spec : The size of the input data ranges from 64x64 pixels to 1920x1024 pixels. +* The physical addresses of the input data and output data must be 8-byte-aligned. +* The stride must be 8-byte-aligned. +* Calls : +* Called By : +* +* History: +* +* 1. Date : 2011-05-16 +* Author : Jiang Xiaohua (employee ID: 00169368) +* Modification : Created function +* +*****************************************************************************/ +HI_S32 HI_MPI_IVE_FILTER_AND_CSC(IVE_HANDLE *pIveHandle, IVE_SRC_INFO_S *pstSrc, + IVE_MEM_INFO_S *pstDst, IVE_FILTER_AND_CSC_CTRL_S *pstFltCscCtrl,HI_BOOL bInstant); + + + +/***************************************************************************** +* Prototype : HI_MPI_IVE_SOBEL +* Description: Describes the information about SOBEL. HI_MPI_IVE_SOBEL is used to extract the edge information. Only the single-component input format is supported. +* Input : IVE_HANDLE *pIveHandle Returned handle ID of a task +* IVE_SRC_INFO_S *pstSrc Input source data +* IVE_MEM_INFO_S *pstDstH Output horizontal result +* IVE_MEM_INFO_S *pstDstV Output vertical result +* IVE_SOBEL_CTRL_S *pstSobelCtrl Control parameters +* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. +* Output : IVE_HANDLE *pIveHandle +* Return Value : HI_SUCCESS: Success;Error codes: Failure. +* Spec : The size of the input data ranges from 64x64 pixels to 1920x1024 pixels. +* The physical addresses of the input data and output data must be 8-byte-aligned. +* The stride must be 8-byte-aligned. +* Calls : +* Called By : +* +* History: +* +* 1. Date : 2011-05-16 +* Author : Jiang Xiaohua (employee ID: 00169368) +* Modification : Created function +* +*****************************************************************************/ +HI_S32 HI_MPI_IVE_SOBEL(IVE_HANDLE *pIveHandle, IVE_SRC_INFO_S *pstSrc, + IVE_MEM_INFO_S *pstDstH, IVE_MEM_INFO_S *pstDstV, + IVE_SOBEL_CTRL_S *pstSobelCtrl,HI_BOOL bInstant); + + +/***************************************************************************** +* Prototype : HI_MPI_IVE_CANNY +* Description: Describes the information about CANNY. HI_MPI_IVE_CANNY is used to extract the edge information and is more complicated than HI_MPI_IVE_SOBEL. HI_MPI_IVE_CANNY does not provide comprehensive functions. Only the single-component input format is supported. +* Input : IVE_HANDLE *pIveHandle Returned handle ID of a task +* IVE_SRC_INFO_S *pstSrc Input source data +* IVE_MEM_INFO_S *pstDstMag Output magnitude +* IVE_MEM_INFO_S *pstDstAng Output angle +* If the output mode is set to magnitude only, this item can be set to null. +* IVE_CANNY_CTRL_S *pstCannyCtrl Control parameters +* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. +* Output : IVE_HANDLE *pIveHandle +* Return Value : HI_SUCCESS: Success;Error codes: Failure. +* Spec : The size of the input data ranges from 64x64 pixels to 1920x1024 pixels. +* The physical addresses of the input data and output data must be 8-byte-aligned. +* The stride must be 8-byte-aligned. +* Calls : +* Called By : +* +* History: +* +* 1. Date : 2011-05-16 +* Author : Jiang Xiaohua (employee ID: 00169368) +* Modification : Created function +* +*****************************************************************************/ +HI_S32 HI_MPI_IVE_CANNY(IVE_HANDLE *pIveHandle, IVE_SRC_INFO_S *pstSrc, + IVE_MEM_INFO_S *pstDstMag, IVE_MEM_INFO_S *pstDstAng, + IVE_CANNY_CTRL_S *pstCannyCtrl,HI_BOOL bInstant); + + + +/***************************************************************************** +* Prototype : HI_MPI_IVE_DILATE +* Description: Describes the information about dilate. This API can be used to implement bold characters and fault offset. Only the single-component input format is supported. +* Input : IVE_HANDLE *pIveHandle Returned handle ID of a task +* IVE_SRC_INFO_S *pstSrc Input source data +* IVE_MEM_INFO_S *pstDst Output result +* IVE_DILATE_CTRL_S *pstDilateCtrl Control parameters +* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. +* Output : IVE_HANDLE *pIveHandle +* Return Value : HI_SUCCESS: Success;Error codes: Failure. +* Spec : The size of the input data ranges from 64x64 pixels to 1920x1024 pixels. +* The physical addresses of the input data and output data must be 8-byte-aligned. +* The stride must be 8-byte-aligned. +* The input value, output value, and mask value must be 0 or 255. +* Calls : +* Called By : +* +* History: +* +* 1. Date : 2011-05-16 +* Author : Jiang Xiaohua (employee ID: 00169368) +* Modification : Created function +* +*****************************************************************************/ +HI_S32 HI_MPI_IVE_DILATE(IVE_HANDLE *pIveHandle, IVE_SRC_INFO_S *pstSrc, + IVE_MEM_INFO_S *pstDst, IVE_DILATE_CTRL_S *pstDilateCtrl,HI_BOOL bInstant); + + + +/***************************************************************************** +* Prototype : HI_MPI_IVE_ERODE +* Description: Describes the information about erode. This MPI can be used to remove tiny points. Only the single-component input format is supported. +* Input : IVE_HANDLE *pIveHandle Returned handle ID of a task +* IVE_SRC_INFO_S *pstSrc Input source data +* IVE_MEM_INFO_S *pstDst Output result +* IVE_ERODE_CTRL_S *pstErodeCtrl Control parameters +* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. +* Output : IVE_HANDLE *pIveHandle +* Return Value : HI_SUCCESS: Success;Error codes: Failure. +* Spec : The size of the input data ranges from 64x64 pixels to 1920x1024 pixels. +* The physical addresses of the input data and output data must be 8-byte-aligned. +* The stride must be 8-byte-aligned. +* The input value, output value, and mask value must be 0 or 255. +* Calls : +* Called By : +* +* History: +* +* 1. Date : 2011-05-16 +* Author : Jiang Xiaohua (employee ID: 00169368) +* Modification : Created function +* +*****************************************************************************/ + +HI_S32 HI_MPI_IVE_ERODE(IVE_HANDLE *pIveHandle, IVE_SRC_INFO_S *pstSrc, + IVE_MEM_INFO_S *pstDst, IVE_ERODE_CTRL_S *pstErodeCtrl,HI_BOOL bInstant); + + + +/***************************************************************************** +* Prototype : HI_MPI_IVE_THRESH +* Description: Describes the information about thresh. Only the single-component input format is supported. +* Input : IVE_HANDLE *pIveHandle Returned handle ID of a task +* IVE_SRC_INFO_S *pstSrc Input source data +* IVE_MEM_INFO_S *pstDst Output result +* IVE_THRESH_CTRL_S *pstThreshCtrl Control parameters +* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. +* Output : IVE_HANDLE *pIveHandle +* Return Value : HI_SUCCESS: Success;Error codes: Failure. +* Spec : The size of the input data ranges from 64x64 pixels to 1920x1080 pixels. +* The physical addresses of the input data and output data must be aligned by byte. +* The stride must be 8-byte-aligned. +* Calls : +* Called By : +* +* History: +* +* 1. Date : 2011-05-16 +* Author : Jiang Xiaohua (employee ID: 00169368) +* Modification : Created function +* +*****************************************************************************/ +HI_S32 HI_MPI_IVE_THRESH(IVE_HANDLE *pIveHandle, IVE_SRC_INFO_S *pstSrc, + IVE_MEM_INFO_S *pstDst, IVE_THRESH_CTRL_S *pstThreshCtrl,HI_BOOL bInstant); + + + +/***************************************************************************** +* Prototype : HI_MPI_IVE_AND +* Description: Describes the information about AND. The pixel points at mapping positions of two input sources are ANDed. Only the single-component input format is supported. +* Input : IVE_HANDLE *pIveHandle Returned handle ID of a task +* IVE_SRC_INFO_S *pstSrc1 Augend of the input source +* IVE_SRC_INFO_S *pstSrc2 Addend of the input source +* IVE_MEM_INFO_S *pstDst Output result of src1 plus src2 +* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. +* Output : IVE_HANDLE *pIveHandle +* Return Value : HI_SUCCESS: Success;Error codes: Failure. +* Spec : The size of the input data ranges from 64x64 pixels to 1920x1080 pixels. +* The physical addresses of the input data and output data must be aligned by byte. +* The stride must be 8-byte-aligned. +* The types, widths, heights of two input sources must be the same. +* Calls : +* Called By : +* +* History: +* +* 1. Date : 2011-05-16 +* Author : Jiang Xiaohua (employee ID: 00169368) +* Modification : Created function +* +*****************************************************************************/ +HI_S32 HI_MPI_IVE_AND(IVE_HANDLE *pIveHandle, IVE_SRC_INFO_S *pstSrc1, + IVE_SRC_INFO_S *pstSrc2,IVE_MEM_INFO_S *pstDst, HI_BOOL bInstant); + + +/***************************************************************************** +* Prototype : HI_MPI_IVE_SUB +* Description: Describes the information about SUB. The pixel points of an input source are subtracted from the pixel points at the mapping positions of another input source. Only the single-component input format is supported. +* Input : IVE_HANDLE *pIveHandle Returned handle ID of a task +* IVE_SRC_INFO_S *pstSrc1 Minuend of the input source +* IVE_SRC_INFO_S *pstSrc2 Subtrahend of the input source +* IVE_MEM_INFO_S *pstDst Output result of src1 minus src2 +* IVE_SUB_OUT_FMT_E enOutFmt Output result format +* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. +* Output : IVE_HANDLE *pIveHandle +* Return Value : HI_SUCCESS: Success;Error codes: Failure. +* Spec : The size of the input data ranges from 64x64 pixels to 1920x1080 pixels. +* The physical addresses of the input data and output data must be aligned by byte. +* The stride must be 8-byte-aligned. +* The types, widths, heights of two input sources must be the same. +* Calls : +* Called By : +* +* History: +* +* 1. Date : 2011-05-16 +* Author : Jiang Xiaohua (employee ID: 00169368) +* Modification : Created function +* +*****************************************************************************/ +HI_S32 HI_MPI_IVE_SUB(IVE_HANDLE *pIveHandle, IVE_SRC_INFO_S *pstSrc1, + IVE_SRC_INFO_S *pstSrc2,IVE_MEM_INFO_S *pstDst, + IVE_SUB_OUT_FMT_E enOutFmt,HI_BOOL bInstant); + + + +/***************************************************************************** +* Prototype : HI_MPI_IVE_OR +* Description: Describes the information about OR. The pixel points at mapping positions of two input sources are ORed. Only the single-component input format is supported. +* Input : IVE_HANDLE *pIveHandle Returned handle ID of a task +* IVE_SRC_INFO_S *pstSrc1 Input source 1 +* IVE_SRC_INFO_S *pstSrc2 Input source 2 +* IVE_MEM_INFO_S *pstDst Output result src1 or src2 +* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. +* Output : IVE_HANDLE *pIveHandle +* Return Value : HI_SUCCESS: Success;Error codes: Failure. +* Spec : The size of the input data ranges from 64x64 pixels to 1920x1080 pixels. +* The physical addresses of the input data and output data must be aligned by byte. +* The stride must be 8-byte-aligned. +* The types, widths, heights of two input sources must be the same. +* Calls : +* Called By : +* +* History: +* +* 1. Date : 2011-05-16 +* Author : Jiang Xiaohua (employee ID: 00169368) +* Modification : Created function +* +*****************************************************************************/ +HI_S32 HI_MPI_IVE_OR(IVE_HANDLE *pIveHandle, IVE_SRC_INFO_S *pstSrc1, + IVE_SRC_INFO_S *pstSrc2,IVE_MEM_INFO_S *pstDst, HI_BOOL bInstant); + + + +/***************************************************************************** +* Prototype : HI_MPI_IVE_INTEG +* Description: Describes the information about integral statistics. This API is used to collect statistics on the single-component data in the form of integrogram. Only the single-component input format is supported. +* Input : IVE_HANDLE *pIveHandle Returned handle ID of a task +* IVE_SRC_INFO_S *pstSrc Input source data +* IVE_MEM_INFO_S *pstDst Output result +* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. +* Output : IVE_HANDLE *pIveHandle +* Return Value : HI_SUCCESS: Success;Error codes: Failure. +* Spec : The size of the input data ranges from 64x64 pixels to 1920x1080 pixels. +* The physical addresses of the input data and output data must be 8-byte-aligned. +* The stride must be 8-byte-aligned. +* The types, widths, heights of two input sources must be the same. +* Calls : +* Called By : +* +* History: +* +* 1. Date : 2011-05-16 +* Author : Jiang Xiaohua (employee ID: 00169368) +* Modification : Created function +* +*****************************************************************************/ +HI_S32 HI_MPI_IVE_INTEG(IVE_HANDLE *pIveHandle, IVE_SRC_INFO_S *pstSrc, + IVE_MEM_INFO_S *pstDst, HI_BOOL bInstant); + + + +/***************************************************************************** +* Prototype : HI_MPI_IVE_HIST +* Description: Describes the information about histogram statistics. This API is used to collect statistics on the single-component data in the form of histogram. Only the single-component input format is supported. +* Input : IVE_HANDLE *pIveHandle Returned handle ID of a task +* IVE_SRC_INFO_S *pstSrc Input source data +* IVE_MEM_INFO_S *pstDst Output result +* HI_BOOL bInstant For details, see HI_MPI_IVE_DMA. +* Output : IVE_HANDLE *pIveHandle +* Return Value : HI_SUCCESS: Success;Error codes: Failure. +* Spec : The size of the input data ranges from 64x64 pixels to 1920x1080 pixels. +* The physical addresses of the input data and output data must be 8-byte-aligned. +* The stride must be 8-byte-aligned. +* The types, widths, heights of two input sources must be the same. +* Calls : +* Called By : +* +* History: +* +* 1. Date : 2011-05-16 +* Author : Jiang Xiaohua (employee ID: 00169368) +* Modification : Created function +* +*****************************************************************************/ +HI_S32 HI_MPI_IVE_HIST(IVE_HANDLE *pIveHandle, IVE_SRC_INFO_S *pstSrc, + IVE_MEM_INFO_S *pstDst, HI_BOOL bInstant); + + +/***************************************************************************** +* Prototype : HI_MPI_IVE_Query +* Description: This API is used to query the status of a called function by using the returned IveHandle of the function. + In block mode, the system waits until the function that is being queried is called. + In non-block mode, the current status is queried and no action is taken. +* Input : IVE_HANDLE IveHandle IveHandle of a called function. It is entered by users. +* HI_BOOL *pbFinish Returned status +* HI_BOOL bBlock Flag indicating the block mode or non-block mode +* Output : HI_BOOL *pbFinish +* Return Value : HI_SUCCESS: Success;Error codes: Failure. +* Calls : +* Called By : +* +* History: +* +* 1. Date : 2011-05-16 +* Author : Jiang Xiaohua (employee ID: 00169368) +* Modification : Created function +* +*****************************************************************************/ +HI_S32 HI_MPI_IVE_Query(IVE_HANDLE IveHandle, HI_BOOL *pbFinish, HI_BOOL bBlock); + + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif +#endif/*__MPI_IVE_H__*/ diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_pciv.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_pciv.h new file mode 100644 index 0000000000..fe8c413342 --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_pciv.h @@ -0,0 +1,247 @@ +/****************************************************************************** + + Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. + + ****************************************************************************** + File Name : mpi_pciv.h + Version : Initial Draft + Author : Hisilicon Hi3511 MPP Team + Created : 2009/06/23 + Last Modified : + Description : mpi functions declaration + Function List : + History : + 1.Date : 2009/06/23 + Author : z44949 + Modification: Create +******************************************************************************/ +#ifndef __MPI_PCIV_H__ +#define __MPI_PCIV_H__ + +#include "hi_common.h" +#include "hi_comm_video.h" +#include "hi_comm_pciv.h" + +#ifdef __cplusplus +#if __cplusplus +extern "C"{ +#endif +#endif /* __cplusplus */ + +/***************************************************************************** + Description : Create and initialize the pciv channel. + Input : pcivChn ** The pciv channel id between [0, PCIV_MAX_CHN_NUM) + pPcivAttr ** The attribute of pciv channel + Output : None + Return Value : HI_SUCCESS if success. + HI_FAILURE if failure + + See Also : HI_MPI_PCIV_Destroy +*****************************************************************************/ +HI_S32 HI_MPI_PCIV_Create(PCIV_CHN pcivChn, PCIV_ATTR_S *pPcivAttr); + +/***************************************************************************** + Description : Destroy the pciv channel + Input : pcivChn ** The pciv channel id + Output : None + Return Value : HI_SUCCESS if success. + HI_FAILURE if failure + + See Also : HI_MPI_PCIV_Create +*****************************************************************************/ +HI_S32 HI_MPI_PCIV_Destroy(PCIV_CHN pcivChn); + +/***************************************************************************** + Description : Set the attribute of pciv channel + Input : pcivChn ** The pciv channel id + pPcivAttr ** The attribute of pciv channel + Output : None + Return Value : HI_SUCCESS if success. + HI_FAILURE if failure + + See Also : HI_MPI_PCIV_GetAttr +*****************************************************************************/ +HI_S32 HI_MPI_PCIV_SetAttr(PCIV_CHN pcivChn, PCIV_ATTR_S *pPcivAttr); + +/***************************************************************************** + Description : Get the attribute of pciv channel + Input : pcivChn ** The pciv channel id + Output : pPcivAttr ** The attribute of pciv channel + Return Value : HI_SUCCESS if success. + HI_FAILURE if failure + + See Also : HI_MPI_PCIV_SetAttr +*****************************************************************************/ +HI_S32 HI_MPI_PCIV_GetAttr(PCIV_CHN pcivChn, PCIV_ATTR_S *pPcivAttr); + + +/***************************************************************************** + Description : Start to send or receive video frame + Input : pcivChn ** The pciv channel id + Output : None + Return Value : HI_SUCCESS if success. + HI_FAILURE if failure + + See Also : HI_MPI_PCIV_Stop +*****************************************************************************/ +HI_S32 HI_MPI_PCIV_Start(PCIV_CHN pcivChn); + +/***************************************************************************** + Description : Stop send or receive video frame + Input : pcivChn ** The pciv channel id + Output : None + Return Value : HI_SUCCESS if success. + HI_FAILURE if failure + + See Also : HI_MPI_PCIV_Start +*****************************************************************************/ +HI_S32 HI_MPI_PCIV_Stop(PCIV_CHN pcivChn); + +/***************************************************************************** + Description : Create a series of dma task + Input : pTask ** The task list to create + Output : None + Return Value : HI_SUCCESS if success. + HI_FAILURE if failure + + See Also : None +*****************************************************************************/ +HI_S32 HI_MPI_PCIV_DmaTask(PCIV_DMA_TASK_S *pTask); + +/***************************************************************************** + Description : Alloc 'u32BlkSize' bytes memory and give the physical address + The memory used by PCI must be located within the PCI window, + So you should call this function to alloc it. + Input : u32BlkSize ** The size of each memory block + u32BlkCnt ** The count of memory block + Output : u32PhyAddr ** The physical address of the memory + Return Value : HI_SUCCESS if success. + HI_FAILURE if failure + + See Also : HI_MPI_PCIV_Free +*****************************************************************************/ +HI_U32 HI_MPI_PCIV_Malloc(HI_U32 u32BlkSize, HI_U32 u32BlkCnt, HI_U32 u32PhyAddr[]); +HI_S32 HI_MPI_PCIV_Free(HI_U32 u32BlkCnt, HI_U32 u32PhyAddr[]); + + +/***************************************************************************** + Description : Get the board ID of this board + Input : None + Output : None + Return Value : The board ID if success + HI_FAILURE or HI_ERR_PCIV_SYS_NOTREADY if failure + + See Also : HI_MPI_PCIV_GetBaseWindow +*****************************************************************************/ +HI_S32 HI_MPI_PCIV_GetLocalId(HI_VOID); + +/***************************************************************************** + Description : Enum all the connected chip.Call this function as follow. + { + HI_S32 s32ChipID[PCIV_MAX_CHIPNUM], i, s32Ret; + + s32Ret = HI_MPI_PCIV_EnumChip(s32ChipID); + HI_ASSERT(HI_SUCCESS == s32Ret); + + for(i=0; iu32NpWinBase, + pBase->u32PfWinBase, + pBase->u32CfgWinBase + On Slave pBase->u32PfAHBAddr + Return Value : HI_SUCCESS if success. + HI_FAILURE if failure + + See Also : HI_MPI_PCIV_GetLocalId +*****************************************************************************/ +HI_S32 HI_MPI_PCIV_GetBaseWindow(HI_S32 s32ChipId, PCIV_BASEWINDOW_S *pBase); + +/***************************************************************************** + Description : Only on the slave chip, you need to create some VB Pool. + Those pool will bee created on the PCI Window Zone. + Input : pCfg.u32PoolCount ** The total number of pool want to create + pCfg.u32BlkSize[] ** The size of each VB block + pCfg.u32BlkCount[]** The number of each VB block + + Output : None + Return Value : HI_SUCCESS if success. + HI_ERR_PCIV_SYS_NOTREADY + HI_ERR_PCIV_NULL_PTR + HI_ERR_PCIV_NOMEM + HI_ERR_PCIV_BUSY + HI_ERR_PCIV_NOT_SUPPORT + HI_FAILURE + + See Also : HI_MPI_PCIV_GetLocalId +*****************************************************************************/ +HI_S32 HI_MPI_PCIV_WinVbCreate(PCIV_WINVBCFG_S *pCfg); + +/***************************************************************************** + Description : Destroy the pools which's size is equal to the pCfg.u32BlkSize[] + Input : pCfg.u32PoolCount ** The total number of pool want to destroy + pCfg.u32BlkSize[] ** The size of each VB block + pCfg.u32BlkCount[]** Don't care this parament + + Output : None + Return Value : HI_SUCCESS if success. + HI_ERR_PCIV_SYS_NOTREADY + HI_ERR_PCIV_NOT_SUPPORT + HI_FAILURE + + See Also : HI_MPI_PCIV_GetLocalId +*****************************************************************************/ +HI_S32 HI_MPI_PCIV_WinVbDestroy(HI_VOID); + + +/***************************************************************************** + Description : Show the image in VO device from PCI + Input : pcivChn ** The pciv channel id + Output : None + Return Value : +*****************************************************************************/ +HI_S32 HI_MPI_PCIV_Show(PCIV_CHN pcivChn); + + +/***************************************************************************** + Description : Hide the image in VO device from PCI + Input : pcivChn ** The pciv channel id + Output : None + Return Value : +*****************************************************************************/ +HI_S32 HI_MPI_PCIV_Hide(PCIV_CHN pcivChn); + + + +HI_S32 HI_MPI_PCIV_GetPreProcCfg(PCIV_CHN pcivChn, PCIV_PREPROC_CFG_S *pstCfg); + +HI_S32 HI_MPI_PCIV_SetPreProcCfg(PCIV_CHN pcivChn, PCIV_PREPROC_CFG_S *pstCfg); + + + + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif /* __cplusplus */ + +#endif /* __MPI_VENC_H__ */ diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_region.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_region.h new file mode 100644 index 0000000000..002be0e030 --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_region.h @@ -0,0 +1,62 @@ +/****************************************************************************** +* +* Copyright (C), 2001-2011, Huawei Tech. Co., Ltd. +* +******************************************************************************* +* File Name : mpi_region.h +* Version : Initial Draft +* Author : j00169368 +* Created : 2010/12/13 +* Last Modified : +* Description : REGION MPI +* Function List : +* +* +* History: +* +* 1. Date : 2010/12/13 +* Author : j00169368 +* Modification : Created file +* +******************************************************************************/ + +#ifndef __MPI_REGION_H__ +#define __MPI_REGION_H__ + +#ifdef __cplusplus +#if __cplusplus +extern "C"{ +#endif +#endif /* End of #ifdef __cplusplus */ + + +#include "hi_comm_region.h" + + +HI_S32 HI_MPI_RGN_Create(RGN_HANDLE Handle,const RGN_ATTR_S *pstRegion); +HI_S32 HI_MPI_RGN_Destroy(RGN_HANDLE Handle); + +HI_S32 HI_MPI_RGN_GetAttr(RGN_HANDLE Handle,RGN_ATTR_S *pstRegion); +HI_S32 HI_MPI_RGN_SetAttr(RGN_HANDLE Handle,const RGN_ATTR_S *pstRegion); + +HI_S32 HI_MPI_RGN_SetBitMap(RGN_HANDLE Handle,const BITMAP_S *pstBitmap); + +HI_S32 HI_MPI_RGN_SetAttachField(RGN_HANDLE Handle, RGN_ATTACH_FIELD_E enAttachField); +HI_S32 HI_MPI_RGN_GetAttachField(RGN_HANDLE Handle, RGN_ATTACH_FIELD_E *penAttachField); + +HI_S32 HI_MPI_RGN_AttachToChn(RGN_HANDLE Handle,const MPP_CHN_S *pstChn,const RGN_CHN_ATTR_S *pstChnAttr); +HI_S32 HI_MPI_RGN_DetachFrmChn(RGN_HANDLE Handle,const MPP_CHN_S *pstChn); + +HI_S32 HI_MPI_RGN_SetDisplayAttr(RGN_HANDLE Handle,const MPP_CHN_S *pstChn,const RGN_CHN_ATTR_S *pstChnAttr); +HI_S32 HI_MPI_RGN_GetDisplayAttr(RGN_HANDLE Handle,const MPP_CHN_S *pstChn,RGN_CHN_ATTR_S *pstChnAttr); + + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif /* End of #ifdef __cplusplus */ + +#endif /* End of #ifndef __MPI_REGION_H__ */ + + diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_sys.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_sys.h new file mode 100644 index 0000000000..98b0df5bec --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_sys.h @@ -0,0 +1,116 @@ +/****************************************************************************** + + Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. + + ****************************************************************************** + File Name : mpi_sys.h + Version : Initial Draft + Author : Hisilicon multimedia software group + Created : 2007/1/31 + Description : + History : + 1.Date : 2006/1/31 + Author : c42025 + Modification: Created file + + 2.Date : 2008/03/03 + Author : c42025 + Modification: add a new funtion "HI_MPI_SYS_GetVersion" + +******************************************************************************/ + +#include "hi_type.h" +#include "hi_common.h" +#include "hi_comm_sys.h" + +#ifndef __MPI_SYS_H__ +#define __MPI_SYS_H__ + +/******************************************/ +#ifdef __cplusplus +#if __cplusplus +extern "C" +{ +#endif +#endif /* __cplusplus */ +/******************************************/ + +HI_S32 HI_MPI_SYS_Init(); +HI_S32 HI_MPI_SYS_Exit(); + +HI_S32 HI_MPI_SYS_SetConf(const MPP_SYS_CONF_S *pstSysConf); +HI_S32 HI_MPI_SYS_GetConf(MPP_SYS_CONF_S *pstSysConf); + +HI_S32 HI_MPI_SYS_Bind(MPP_CHN_S *pstSrcChn, MPP_CHN_S *pstDestChn); + +HI_S32 HI_MPI_SYS_UnBind(MPP_CHN_S *pstSrcChn, MPP_CHN_S *pstDestChn); + +HI_S32 HI_MPI_SYS_GetBindbyDest(MPP_CHN_S *pstDestChn, MPP_CHN_S *pstSrcChn); + + +HI_S32 HI_MPI_SYS_GetVersion(MPP_VERSION_S *pstVersion); + +/* Get the current PTS of this system */ +HI_S32 HI_MPI_SYS_GetCurPts(HI_U64 *pu64CurPts); + +/* +** u64Base is the global PTS of the system. +** ADVICE: +** 1. Bester to call HI_MPI_SYS_GetCurPts on the host board to get the u64Base. +** 2. When the linux start up, call HI_MPI_SYS_InitPtsBase to set the init pts. +** 3. When media bussines is running, synchronize the PTS one time per minute. +** And should call HI_MPI_SYS_SyncPts. +*/ +HI_S32 HI_MPI_SYS_InitPtsBase(HI_U64 u64PtsBase); +HI_S32 HI_MPI_SYS_SyncPts(HI_U64 u64PtsBase); + +/* alloc mmz memory in user context */ +HI_S32 HI_MPI_SYS_MmzAlloc(HI_U32 *pu32PhyAddr, HI_VOID **ppVirtAddr, + const HI_CHAR *strMmb, const HI_CHAR *strZone, HI_U32 u32Len); + +/* alloc mmz memory with cache */ +HI_S32 HI_MPI_SYS_MmzAlloc_Cached(HI_U32 *pu32PhyAddr, HI_VOID **ppVitAddr, + const HI_CHAR *pstrMmb, const HI_CHAR *pstrZone, HI_U32 u32Len); + +/* free mmz memory in user context */ +HI_S32 HI_MPI_SYS_MmzFree(HI_U32 u32PhyAddr, HI_VOID *pVirtAddr); + +/* fulsh cache */ +HI_S32 HI_MPI_SYS_MmzFlushCache(HI_U32 u32PhyAddr, HI_VOID *pVitAddr, HI_U32 u32Size); + +/* +** Call the mmap function to map physical address to virtual address +** The system function mmap is too complicated, so we packge it. +*/ +HI_VOID * HI_MPI_SYS_Mmap(HI_U32 u32PhyAddr, HI_U32 u32Size); +HI_S32 HI_MPI_SYS_Munmap(HI_VOID* pVirAddr, HI_U32 u32Size); + +/* +** Access the physical address. +** You can use this function to access memory address or register address. +*/ +HI_S32 HI_MPI_SYS_SetReg(HI_U32 u32Addr, HI_U32 u32Value); +HI_S32 HI_MPI_SYS_GetReg(HI_U32 u32Addr, HI_U32 *pu32Value); + + +HI_S32 HI_MPI_SYS_SetMemConf(MPP_CHN_S *pstMppChn,const HI_CHAR *pcMmzName); +HI_S32 HI_MPI_SYS_GetMemConf(MPP_CHN_S *pstMppChn,HI_CHAR *pcMmzName); + +/* Get address of virtual register */ +HI_S32 HI_MPI_SYS_GetVRegAddr(HI_U32 *pu32Addr); + + +/* Close all the FD which is used by sys module */ +HI_S32 HI_MPI_SYS_CloseFd(HI_VOID); + + +/******************************************/ +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif /* __cplusplus */ +/******************************************/ +#endif /*__MPI_SYS_H__ */ + + diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_vb.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_vb.h new file mode 100644 index 0000000000..3b28e8c07e --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_vb.h @@ -0,0 +1,57 @@ +/****************************************************************************** + + Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. + + ****************************************************************************** + File Name : mpi_vb.h + Version : Initial Draft + Author : Hisilicon multimedia software group + Created : 2007/10/15 + Description : + History : + 1.Date : 2007/10/15 + Author : c42025 + Modification: Created file +******************************************************************************/ +#ifndef __MPI_VB_H__ +#define __MPI_VB_H__ + +#include "hi_comm_vb.h" + +/******************************************/ +#ifdef __cplusplus +#if __cplusplus +extern "C" +{ +#endif +#endif /* __cplusplus */ +/******************************************/ + + +VB_POOL HI_MPI_VB_CreatePool(HI_U32 u32BlkSize,HI_U32 u32BlkCnt,const HI_CHAR *pcMmzName); + +HI_S32 HI_MPI_VB_DestroyPool(VB_POOL Pool); +VB_BLK HI_MPI_VB_GetBlock(VB_POOL Pool, HI_U32 u32BlkSize,const HI_CHAR *pcMmzName); +HI_S32 HI_MPI_VB_ReleaseBlock(VB_BLK Block); + +HI_U32 HI_MPI_VB_Handle2PhysAddr(VB_BLK Block); +VB_POOL HI_MPI_VB_Handle2PoolId(VB_BLK Block); + +HI_S32 HI_MPI_VB_Init (HI_VOID); +HI_S32 HI_MPI_VB_Exit (HI_VOID); +HI_S32 HI_MPI_VB_SetConf (const VB_CONF_S *pstVbConf); +HI_S32 HI_MPI_VB_GetConf (VB_CONF_S *pstVbConf); + +HI_S32 HI_MPI_VB_MmapPool(VB_POOL Pool); +HI_S32 HI_MPI_VB_MunmapPool(VB_POOL Pool); +HI_S32 HI_MPI_VB_GetBlkVirAddr(VB_POOL Pool, HI_U32 u32PhyAddr, HI_VOID **ppVirAddr); + + +/******************************************/ +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif /* __cplusplus */ +/******************************************/ +#endif /*__MPI_VI_H__ */ diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_vda.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_vda.h new file mode 100644 index 0000000000..f266f0f6c1 --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_vda.h @@ -0,0 +1,307 @@ +/****************************************************************************** +* +* Copyright (C), 2001-2011, Huawei Tech. Co., Ltd. +* +******************************************************************************* +* File Name : mpi_vda.h +* Version : Initial Draft +* Author : j00169368,l64467 +* Created : 2011/1/7 +* Last Modified : +* Description : mpi functions declaration +* Function List : +* +* +* History: +* +* 1. Date : 2011/1/7 +* Author : j00169368,l64467 +* Modification : Created file +* +******************************************************************************/ + +#ifndef __MPI_VDA_H__ +#define __MPI_VDA_H__ + +#include "hi_comm_vda.h" + +#ifdef __cplusplus +#if __cplusplus +extern "C"{ +#endif +#endif /* End of #ifdef __cplusplus */ + + +/***************************************************************************** + Prototype : HI_MPI_VDA_CreateChn + Description : Create the vda channel. + Input : VdaChn + pstAttr + Output : None + Return Value : + Process : + + Note : + + History + 1.Date : 2011/1/10 + Author : l64467,j00169368 + Modification : Created function + +*****************************************************************************/ +HI_S32 HI_MPI_VDA_CreateChn(VDA_CHN VdaChn, const VDA_CHN_ATTR_S *pstAttr); + + + + +/***************************************************************************** + Prototype : HI_MPI_VDA_DestroyChn + Description : Destroy the vda channel. + Input : VdaChn + Output : None + Return Value : + Process : Firstly,stop to receive image,and then unbind to vi,lastly,destroy the channel. + Note : + + History + 1.Date : 2011/1/10 + Author : l64467,j00169368 + Modification : Created function + +*****************************************************************************/ +HI_S32 HI_MPI_VDA_DestroyChn(VDA_CHN VdaChn); + + + + + +/***************************************************************************** + Prototype : HI_MPI_VDA_GetChnAttr + Description : Get the channel's attribute. + Input : VdaChn + Output : pstAttr + Return Value : + Process : Return the chanel's attribute. + Note : + + History + 1.Date : 2011/1/10 + Author : l64467,j00169368 + Modification : Created function + +*****************************************************************************/ +HI_S32 HI_MPI_VDA_GetChnAttr(VDA_CHN VdaChn, VDA_CHN_ATTR_S *pstAttr); + + + + +/***************************************************************************** + Prototype : HI_MPI_VDA_SetChnAttr + Description : Set the channel's attribute,it must be used after calling HI_MPI_VDA_CreateChn. + Input : VdaChn + pstAttr + Output : None + Return Value : + Process : + Note : Only the dynamic attribute can be changed. + + History + 1.Date : 2011/1/10 + Author : l64467,j00169368 + Modification : Created function + +*****************************************************************************/ +HI_S32 HI_MPI_VDA_SetChnAttr(VDA_CHN VdaChn, const VDA_CHN_ATTR_S *pstAttr); + + + + + + +/***************************************************************************** + Prototype : HI_MPI_VDA_StartRecvPic + Description : The VDA channel start to receive image. + Input : VdaChn + Output : None + Return Value : + Process : Set the flag which indicates whether the channel start to receive image to true. + Note : + + History + 1.Date : 2011/1/10 + Author : l64467,j00169368 + Modification : Created function + +*****************************************************************************/ +HI_S32 HI_MPI_VDA_StartRecvPic(VDA_CHN VdaChn); + + + + +/***************************************************************************** + Prototype : HI_MPI_VDA_StopRecvPic + Description : The VDA channel stop to receive image. + Input : VdaChn + Output : None + Return Value : + Process : Set the flag which indicates whether the channel start to receive image to false. + Note : + + History + 1.Date : 2011/1/10 + Author : l64467,j00169368 + Modification : Created function + +*****************************************************************************/ +HI_S32 HI_MPI_VDA_StopRecvPic(VDA_CHN VdaChn); + + + + +/***************************************************************************** + Prototype : HI_MPI_VDA_GetData + Description : Get the the result. + Input : VdaChn + u32BlockFlag + Output : pstVDAData + Return Value : + Process : + Note : + + History + 1.Date : 2011/1/10 + Author : l64467,j00169368 + Modification : Created function + +*****************************************************************************/ +HI_S32 HI_MPI_VDA_GetData(VDA_CHN VdaChn, VDA_DATA_S *pstVdaData, HI_BOOL bBlock); + + + + +/***************************************************************************** + Prototype : HI_MPI_VDA_ReleaseData + Description : Release the result. + Input : VdaChn + pstVDAData + Output : None + Return Value : + Process : + Note : + + History + 1.Date : 2011/1/10 + Author : l64467,j00169368 + Modification : Created function + +*****************************************************************************/ +HI_S32 HI_MPI_VDA_ReleaseData(VDA_CHN VdaChn, const VDA_DATA_S* pstVdaData); + + + +/***************************************************************************** + Prototype : HI_MPI_VDA_Reset + Description : Reset OD region. + Input : VdaChn + s32RgnIndex + Output : None + Return Value : + Process : + Note : + + History + 1.Date : 2011/1/10 + Author : l64467,j00169368 + Modification : Created function + +*****************************************************************************/ +HI_S32 HI_MPI_VDA_ResetOdRegion(VDA_CHN VdaChn, HI_S32 s32RgnIndex); + + + +/***************************************************************************** + Prototype : HI_MPI_VDA_Query + Description : Query the state of VDA channel. + Input : VdaChn + Output : stChnStat + Return Value : + Process : + Note : + + History + 1.Date : 2011/1/10 + Author : l64467,j00169368 + Modification : Created function + +*****************************************************************************/ +HI_S32 HI_MPI_VDA_Query(VDA_CHN VdaChn, VDA_CHN_STAT_S *pstChnStat); + + + + +/***************************************************************************** + Prototype : HI_MPI_VDA_GetFd + Description : Get the file handle. + Input : VdaChn + Output : None + Return Value : + Process : + Note : + + History + 1.Date : 2011/1/10 + Author : l64467,j00169368 + Modification : Created function + +*****************************************************************************/ +HI_S32 HI_MPI_VDA_GetFd(VDA_CHN VdaChn); + + +/***************************************************************************** + Prototype : HI_MPI_VDA_UpdateRef + Description : Update the reference image. + Input : VdaChn + pstRefFrame + Output : None + Return Value : + Process : + Note : 1,Only be used when the reference mode is user mode. + + History + 1.Date : 2011/1/10 + Author : l64467,j00169368 + Modification : Created function + +*****************************************************************************/ +HI_S32 HI_MPI_VDA_UpdateRef(VDA_CHN VdaChn, const VIDEO_FRAME_INFO_S *pstRefFrame); + + +/***************************************************************************** + Prototype : HI_MPI_VDA_UserSendPic + Description :User send image + Input : VdaChn + pstRefFrame + bBlock + u32MilliSec + Output : None + Return Value : + Process : + Note : + + History + 1.Date : 2012/05/08 + Author : s00187460 + Modification : Created function + +*****************************************************************************/ +HI_S32 HI_MPI_VDA_UserSendPic(VDA_CHN VdaChn, const VIDEO_FRAME_INFO_S *pstUserFrame, HI_BOOL bBlock, HI_U32 u32MilliSec); + + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif /* End of #ifdef __cplusplus */ + + +#endif /* End of #ifndef __MPI_VDA_H__ */ diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_vdec.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_vdec.h new file mode 100644 index 0000000000..9b9a3cd819 --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_vdec.h @@ -0,0 +1,87 @@ +/****************************************************************************** + + Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. + + ****************************************************************************** + File Name : mpi_vdec.h + Version : Initial Draft + Author : Hisilicon multimedia software group + Created : 2007/01/18 + Description : + History : + 1.Date : 2007/01/18 + Author : z50825 + Modification: Created file + 2.Date : 2008/1/8 + Author : l59217 + Modification: Delete get wm attr interface + 3.Date : 2008/3/4 + Author : l59217 + Modification: modified HI_MPI_VDEC_GetCapability interface + 4.Date : 2008/7/19 + Author : c55300 + Modification: CR20080716007£¬HI_MPI_VDEC_ResetChn() is added. +******************************************************************************/ +#ifndef __MPI_VDEC_H__ +#define __MPI_VDEC_H__ + +#include "hi_common.h" +#include "hi_comm_video.h" +#include "hi_comm_vdec.h" + +#ifdef __cplusplus +#if __cplusplus +extern "C"{ +#endif +#endif /* End of #ifdef __cplusplus */ + + +HI_S32 HI_MPI_VDEC_CreateChn(VDEC_CHN VdChn, const VDEC_CHN_ATTR_S *pstAttr); +HI_S32 HI_MPI_VDEC_DestroyChn(VDEC_CHN VdChn); + +HI_S32 HI_MPI_VDEC_GetChnAttr(VDEC_CHN VdChn, VDEC_CHN_ATTR_S *pstAttr); +HI_S32 HI_MPI_VDEC_SendStream(VDEC_CHN VdChn, const VDEC_STREAM_S *pstStream, HI_U32 u32BlockFlag); + +HI_S32 HI_MPI_VDEC_StartRecvStream(VDEC_CHN VdChn); +HI_S32 HI_MPI_VDEC_StopRecvStream(VDEC_CHN VdChn); +HI_S32 HI_MPI_VDEC_Query(VDEC_CHN VdChn,VDEC_CHN_STAT_S *pstStat); + +HI_S32 HI_MPI_VDEC_GetFd(VDEC_CHN VdChn); + +HI_S32 HI_MPI_VDEC_ResetChn(VDEC_CHN VdChn); +HI_S32 HI_MPI_VDEC_QueryData(VDEC_CHN VdChn,HI_BOOL *pbIsData); + +HI_S32 HI_MPI_VDEC_SetChnParam(VDEC_CHN VdChn, VDEC_CHN_PARAM_S* pstParam); +HI_S32 HI_MPI_VDEC_GetChnParam(VDEC_CHN VdChn, VDEC_CHN_PARAM_S* pstParam); + +HI_S32 HI_MPI_VDEC_SetChnPrevMode(VDEC_CHN VdChn, const HI_BOOL bPrevMode); +HI_S32 HI_MPI_VDEC_GetChnPrevMode(VDEC_CHN VdChn, HI_BOOL *pbPrevMode); + +//param about memory allocation and protocol type +HI_S32 HI_MPI_VDEC_SetPrtclParam(VDEC_CHN VdChn,VDEC_PRTCL_PARAM_S *pstParam); +HI_S32 HI_MPI_VDEC_GetPrtclParam(VDEC_CHN VdChn,VDEC_PRTCL_PARAM_S *pstParam); + +HI_S32 HI_MPI_VDEC_SetDisplayFrameNum(VDEC_CHN VdChn, HI_S32 s32DisplayFrameNum); +HI_S32 HI_MPI_VDEC_GetDisplayFrameNum(VDEC_CHN VdChn, HI_S32 *ps32DisplayFrameNum); + + +// list of modified function +//separate userdata and image interface +HI_S32 HI_MPI_VDEC_GetImage(VDEC_CHN VdChn, VIDEO_FRAME_INFO_S *pstFrameInfo, HI_U32 u32BlockFlag); +HI_S32 HI_MPI_VDEC_ReleaseImage(VDEC_CHN VdChn, VIDEO_FRAME_INFO_S *pstFrameInfo); +HI_S32 HI_MPI_VDEC_GetUserData(VDEC_CHN VdChn, VDEC_USERDATA_S *pstUserData, HI_U32 u32BlockFlag); +HI_S32 HI_MPI_VDEC_ReleaseUserData(VDEC_CHN VdChn, VDEC_USERDATA_S *pstUserData); + +HI_S32 HI_MPI_VDEC_SendStream_TimeOut(VDEC_CHN VdChn, const VDEC_STREAM_S *pstStream, HI_U32 u32MilliSec); +HI_S32 HI_MPI_VDEC_GetImage_TimeOut(VDEC_CHN VdChn, VIDEO_FRAME_INFO_S *pstFrameInfo,HI_U32 u32MilliSec); +HI_S32 HI_MPI_VDEC_GetUserData_TimeOut(VDEC_CHN VdChn, VDEC_USERDATA_S *pstUserData, HI_U32 u32MilliSec); + + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif /* End of #ifdef __cplusplus */ + +#endif /* End of #ifndef __MPI_VDEC_H__ */ + diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_venc.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_venc.h new file mode 100644 index 0000000000..710935da1c --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_venc.h @@ -0,0 +1,143 @@ +/****************************************************************************** + + Copyright (C), 2001-2012, Hisilicon Tech. Co., Ltd. + + ****************************************************************************** + File Name : mpi_venc.h + Version : Initial Draft + Author : Hisilicon Hi35xx MPP Team + Created : 2006/11/22 + Last Modified : + Description : mpi functions declaration + Function List : + History : +******************************************************************************/ +#ifndef __MPI_VENC_H__ +#define __MPI_VENC_H__ + +#include "hi_common.h" +#include "hi_comm_video.h" +#include "hi_comm_venc.h" +#include "hi_comm_vb.h" + +#ifdef __cplusplus +#if __cplusplus +extern "C"{ +#endif +#endif /* __cplusplus */ + +HI_S32 HI_MPI_VENC_CreateGroup(VENC_GRP VeGroup); +HI_S32 HI_MPI_VENC_DestroyGroup(VENC_GRP VeGroup); + +HI_S32 HI_MPI_VENC_CreateChn(VENC_CHN VeChn, const VENC_CHN_ATTR_S *pstAttr); +HI_S32 HI_MPI_VENC_DestroyChn(VENC_CHN VeChn); + +HI_S32 HI_MPI_VENC_RegisterChn(VENC_GRP VeGroup, VENC_CHN VeChn ); +HI_S32 HI_MPI_VENC_UnRegisterChn(VENC_CHN VeChn); + +HI_S32 HI_MPI_VENC_StartRecvPic(VENC_CHN VeChn); +HI_S32 HI_MPI_VENC_StartRecvPicEx(VENC_CHN VeChn, VENC_RECV_PIC_PARAM_S *pstRecvParam); +HI_S32 HI_MPI_VENC_StopRecvPic(VENC_CHN VeChn); + +HI_S32 HI_MPI_VENC_Query(VENC_CHN VeChn, VENC_CHN_STAT_S *pstStat); + +HI_S32 HI_MPI_VENC_SetChnAttr( VENC_CHN VeChn, const VENC_CHN_ATTR_S *pstAttr); +HI_S32 HI_MPI_VENC_GetChnAttr( VENC_CHN VeChn, VENC_CHN_ATTR_S *pstAttr); + +HI_S32 HI_MPI_VENC_GetStream(VENC_CHN VeChn, VENC_STREAM_S *pstStream, HI_BOOL bBlockFlag); +HI_S32 HI_MPI_VENC_ReleaseStream(VENC_CHN VeChn, VENC_STREAM_S *pstStream); + +HI_S32 HI_MPI_VENC_InsertUserData(VENC_CHN VeChn, HI_U8 *pu8Data, HI_U32 u32Len); + +HI_S32 HI_MPI_VENC_SendFrame(VENC_GRP VeGroup, VIDEO_FRAME_INFO_S *pstFrame); + +HI_S32 HI_MPI_VENC_SetMaxStreamCnt(VENC_CHN VeChn, HI_U32 u32MaxStrmCnt); +HI_S32 HI_MPI_VENC_GetMaxStreamCnt(VENC_CHN VeChn, HI_U32 *pu32MaxStrmCnt); + +HI_S32 HI_MPI_VENC_RequestIDR(VENC_CHN VeChn); +HI_S32 HI_MPI_VENC_RequestIDRInst(VENC_CHN VeChn); + +HI_S32 HI_MPI_VENC_GetFd(VENC_CHN VeChn); + +HI_S32 HI_MPI_VENC_SetRoiCfg(VENC_CHN VeChn, VENC_ROI_CFG_S *pstVencRoiCfg); +HI_S32 HI_MPI_VENC_GetRoiCfg(VENC_CHN VeChn, HI_U32 u32Index, VENC_ROI_CFG_S *pstVencRoiCfg); + +HI_S32 HI_MPI_VENC_SetH264SliceSplit(VENC_CHN VeChn, const VENC_PARAM_H264_SLICE_SPLIT_S *pstSliceSplit); +HI_S32 HI_MPI_VENC_GetH264SliceSplit(VENC_CHN VeChn, VENC_PARAM_H264_SLICE_SPLIT_S *pstSliceSplit); + +HI_S32 HI_MPI_VENC_SetH264InterPred(VENC_CHN VeChn, const VENC_PARAM_H264_INTER_PRED_S *pstH264InterPred); +HI_S32 HI_MPI_VENC_GetH264InterPred(VENC_CHN VeChn, VENC_PARAM_H264_INTER_PRED_S *pstH264InterPred); + +HI_S32 HI_MPI_VENC_SetH264IntraPred(VENC_CHN VeChn, const VENC_PARAM_H264_INTRA_PRED_S *pstH264IntraPred); +HI_S32 HI_MPI_VENC_GetH264IntraPred(VENC_CHN VeChn, VENC_PARAM_H264_INTRA_PRED_S *pstH264IntraPred); + +HI_S32 HI_MPI_VENC_SetH264Trans(VENC_CHN VeChn, const VENC_PARAM_H264_TRANS_S *pstH264Trans); +HI_S32 HI_MPI_VENC_GetH264Trans(VENC_CHN VeChn, VENC_PARAM_H264_TRANS_S *pstH264Trans); + +HI_S32 HI_MPI_VENC_SetH264Entropy(VENC_CHN VeChn, const VENC_PARAM_H264_ENTROPY_S *pstH264EntropyEnc); +HI_S32 HI_MPI_VENC_GetH264Entropy(VENC_CHN VeChn, VENC_PARAM_H264_ENTROPY_S *pstH264EntropyEnc); + +HI_S32 HI_MPI_VENC_SetH264Poc(VENC_CHN VeChn, const VENC_PARAM_H264_POC_S *pstH264Poc); +HI_S32 HI_MPI_VENC_GetH264Poc(VENC_CHN VeChn, VENC_PARAM_H264_POC_S *pstH264Poc); + +HI_S32 HI_MPI_VENC_SetH264Dblk(VENC_CHN VeChn, const VENC_PARAM_H264_DBLK_S *pstH264Dblk); +HI_S32 HI_MPI_VENC_GetH264Dblk(VENC_CHN VeChn, VENC_PARAM_H264_DBLK_S *pstH264Dblk); + +HI_S32 HI_MPI_VENC_SetH264Vui(VENC_CHN VeChn, const VENC_PARAM_H264_VUI_S *pstH264Vui); +HI_S32 HI_MPI_VENC_GetH264Vui(VENC_CHN VeChn, VENC_PARAM_H264_VUI_S *pstH264Vui); + +HI_S32 HI_MPI_VENC_SetJpegParam(VENC_CHN VeChn, const VENC_PARAM_JPEG_S *pstJpegParam); +HI_S32 HI_MPI_VENC_GetJpegParam(VENC_CHN VeChn, VENC_PARAM_JPEG_S *pstJpegParam); + +HI_S32 HI_MPI_VENC_SetMpeg4Param(VENC_CHN VeChn, const VENC_PARAM_MPEG4_S *pstMpeg4Param); +HI_S32 HI_MPI_VENC_GetMpeg4Param(VENC_CHN VeChn, VENC_PARAM_MPEG4_S *pstMpeg4Param); + +HI_S32 HI_MPI_VENC_SetMjpegParam(VENC_CHN VeChn, const VENC_PARAM_MJPEG_S *pstMjpegParam); +HI_S32 HI_MPI_VENC_GetMjpegParam(VENC_CHN VeChn, VENC_PARAM_MJPEG_S *pstMjpegParam); + +HI_S32 HI_MPI_VENC_SetGrpFrmRate(VENC_GRP VeGroup, const GROUP_FRAME_RATE_S *pstGrpFrmRate); +HI_S32 HI_MPI_VENC_GetGrpFrmRate(VENC_GRP VeGroup, GROUP_FRAME_RATE_S *pstGrpFrmRate); + +HI_S32 HI_MPI_VENC_GetRcPara(VENC_CHN VeChn, VENC_RC_PARAM_S *pstRcPara); +HI_S32 HI_MPI_VENC_SetRcPara(VENC_CHN VeChn, VENC_RC_PARAM_S *pstRcPara); + +HI_S32 HI_MPI_VENC_SetH264eRefMode(VENC_CHN VeChn, VENC_ATTR_H264_REF_MODE_E enRefMode); +HI_S32 HI_MPI_VENC_GetH264eRefMode(VENC_CHN VeChn, VENC_ATTR_H264_REF_MODE_E *penRefMode); + +HI_S32 HI_MPI_VENC_SetH264eRefParam( VENC_CHN VeChn, VENC_ATTR_H264_REF_PARAM_S* pstRefParam ); +HI_S32 HI_MPI_VENC_GetH264eRefParam( VENC_CHN VeChn, VENC_ATTR_H264_REF_PARAM_S* pstRefParam ); + +HI_S32 HI_MPI_VENC_EnableIDR( VENC_CHN VeChn, HI_BOOL bEnableIDR ); + +HI_S32 HI_MPI_VENC_SetGrpColor2Grey(VENC_GRP VeGroup, const GROUP_COLOR2GREY_S *pstGrpColor2Grey); +HI_S32 HI_MPI_VENC_GetGrpColor2Grey(VENC_GRP VeGroup, GROUP_COLOR2GREY_S *pstGrpColor2Grey); + +HI_S32 HI_MPI_VENC_SetColor2GreyConf(const GROUP_COLOR2GREY_CONF_S *pstGrpColor2GreyConf); +HI_S32 HI_MPI_VENC_GetColor2GreyConf(GROUP_COLOR2GREY_CONF_S *pstGrpColor2GreyConf); + +HI_S32 HI_MPI_VENC_SetGrpCrop(VENC_GRP VeGroup, const GROUP_CROP_CFG_S *pstGrpCropCfg); +HI_S32 HI_MPI_VENC_GetGrpCrop(VENC_GRP VeGroup, GROUP_CROP_CFG_S *pstGrpCropCfg); + +HI_S32 HI_MPI_VENC_SetJpegSnapMode(VENC_CHN VeChn, VENC_JPEG_SNAP_MODE_E enJpegSnapMode); +HI_S32 HI_MPI_VENC_GetJpegSnapMode(VENC_CHN VeChn, VENC_JPEG_SNAP_MODE_E *penJpegSnapMode); + +HI_S32 HI_MPI_VENC_SetRcPriority(VENC_CHN VeChn, VENC_RC_PRIORITY_E enRcPriority); +HI_S32 HI_MPI_VENC_GetRcPriority(VENC_CHN VeChn, VENC_RC_PRIORITY_E *penRcPriority); + +HI_S32 HI_MPI_VENC_SetLostFrameStrategy(VENC_CHN VeChn, VENC_PARAM_LOSTFRM_S *pstLostFrmParam); +HI_S32 HI_MPI_VENC_GetLostFrameStrategy(VENC_CHN VeChn, VENC_PARAM_LOSTFRM_S *pstLostFrmParam); + +HI_S32 HI_MPI_VENC_AttachVbPool(VENC_CHN VeChn, VB_POOL hVbPool); +HI_S32 HI_MPI_VENC_DetachVbPool(VENC_CHN VeChn); + +HI_S32 HI_MPI_VENC_SetH264VideoSignal(VENC_CHN VeChn, const VENC_PARAM_H264_VIDEO_SIGNAL_S *pstH264VideoSignal); +HI_S32 HI_MPI_VENC_GetH264VideoSignal(VENC_CHN VeChn, VENC_PARAM_H264_VIDEO_SIGNAL_S *pstH264VideoSignal); + + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif /* __cplusplus */ + +#endif /* __MPI_VENC_H__ */ \ No newline at end of file diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_vi.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_vi.h new file mode 100644 index 0000000000..4d63da9958 --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_vi.h @@ -0,0 +1,99 @@ +#ifndef __MPI_VI_H__ +#define __MPI_VI_H__ + + +#ifdef __cplusplus +#if __cplusplus +extern "C" +{ +#endif +#endif /* __cplusplus */ + +#include "hi_comm_vi.h" + +HI_S32 HI_MPI_VI_SetDevAttr(VI_DEV ViDev, const VI_DEV_ATTR_S *pstDevAttr); +HI_S32 HI_MPI_VI_GetDevAttr(VI_DEV ViDev, VI_DEV_ATTR_S *pstDevAttr); + +HI_S32 HI_MPI_VI_EnableDev(VI_DEV ViDev); +HI_S32 HI_MPI_VI_DisableDev(VI_DEV ViDev); + +HI_S32 HI_MPI_VI_SetChnAttr(VI_CHN ViChn, const VI_CHN_ATTR_S *pstAttr); +HI_S32 HI_MPI_VI_GetChnAttr(VI_CHN ViChn, VI_CHN_ATTR_S *pstAttr); + +/* The following 3 functions are only for vichn minor attributes */ +HI_S32 HI_MPI_VI_SetChnMinorAttr(VI_CHN ViChn,const VI_CHN_ATTR_S *pstAttr); +HI_S32 HI_MPI_VI_GetChnMinorAttr(VI_CHN ViChn,VI_CHN_ATTR_S *pstAttr); +HI_S32 HI_MPI_VI_ClearChnMinorAttr(VI_CHN ViChn); + +HI_S32 HI_MPI_VI_EnableChn(VI_CHN ViChn); +HI_S32 HI_MPI_VI_DisableChn(VI_CHN ViChn); + +HI_S32 HI_MPI_VI_GetFrame(VI_CHN ViChn, VIDEO_FRAME_INFO_S *pstFrameInfo); +HI_S32 HI_MPI_VI_GetFrameTimeOut(VI_CHN ViChn, VIDEO_FRAME_INFO_S *pstFrameInfo, HI_U32 u32MilliSec); +HI_S32 HI_MPI_VI_ReleaseFrame(VI_CHN ViChn, VIDEO_FRAME_INFO_S *pstFrameInfo); +HI_S32 HI_MPI_VI_SetFrameDepth(VI_CHN ViChn, HI_U32 u32Depth); +HI_S32 HI_MPI_VI_GetFrameDepth(VI_CHN ViChn, HI_U32 *pu32Depth); + +HI_S32 HI_MPI_VI_SetUserPic(VI_CHN ViChn, VI_USERPIC_ATTR_S *pstUsrPic); +HI_S32 HI_MPI_VI_EnableUserPic(VI_CHN ViChn); +HI_S32 HI_MPI_VI_DisableUserPic(VI_CHN ViChn); + +/* These functions are used to start the cascade mode. VI cascade mode can work normally Only when they have been called */ +HI_S32 HI_MPI_VI_EnableCascade(VI_DEV ViDev); +HI_S32 HI_MPI_VI_DisableCascade(VI_DEV ViDev); +HI_S32 HI_MPI_VI_EnableCascadeChn(VI_CHN ViChn); +HI_S32 HI_MPI_VI_DisableCascadeChn(VI_CHN ViChn); + +/* Normally, these functions are not necessary in typical business */ +HI_S32 HI_MPI_VI_ChnBind(VI_CHN ViChn, const VI_CHN_BIND_ATTR_S *pstChnBindAttr); +HI_S32 HI_MPI_VI_ChnUnBind(VI_CHN ViChn); +HI_S32 HI_MPI_VI_GetChnBind(VI_CHN ViChn, VI_CHN_BIND_ATTR_S *pstChnBindAttr); + +HI_S32 HI_MPI_VI_SetDevAttrEx(VI_DEV ViDev, const VI_DEV_ATTR_EX_S *pstDevAttrEx); +HI_S32 HI_MPI_VI_GetDevAttrEx(VI_DEV ViDev, VI_DEV_ATTR_EX_S *pstDevAttrEx); + +HI_S32 HI_MPI_VI_GetFd(VI_CHN ViChn); + +HI_S32 HI_MPI_VI_Query(VI_CHN ViChn, VI_CHN_STAT_S *pstStat); + +HI_S32 HI_MPI_VI_EnableChnInterrupt(VI_CHN ViChn); +HI_S32 HI_MPI_VI_DisableChnInterrupt(VI_CHN ViChn); + +HI_S32 HI_MPI_VI_SetFlashConfig(VI_DEV ViDev, const VI_FLASH_CONFIG_S *pstFlashConfig); +HI_S32 HI_MPI_VI_GetFlashConfig(VI_DEV ViDev, VI_FLASH_CONFIG_S *pstFlashConfig); +HI_S32 HI_MPI_VI_FlashTrigger(VI_DEV ViDev, HI_BOOL bEnable); + +HI_S32 HI_MPI_VI_SetExtChnAttr(VI_CHN ViChn, const VI_EXT_CHN_ATTR_S *pstExtChnAttr); +HI_S32 HI_MPI_VI_GetExtChnAttr(VI_CHN ViChn, VI_EXT_CHN_ATTR_S *pstExtChnAttr); + +HI_S32 HI_MPI_VI_SetLDCAttr(VI_CHN ViChn, const VI_LDC_ATTR_S *pstLDCAttr); +HI_S32 HI_MPI_VI_GetLDCAttr(VI_CHN ViChn, VI_LDC_ATTR_S *pstLDCAttr); + +HI_S32 HI_MPI_VI_SetCSCAttr(VI_DEV ViDev, const VI_CSC_ATTR_S *pstCSCAttr); +HI_S32 HI_MPI_VI_GetCSCAttr(VI_DEV ViDev, VI_CSC_ATTR_S *pstCSCAttr); + +HI_S32 HI_MPI_VI_SetRotate(VI_CHN ViChn, const ROTATE_E enRotate); +HI_S32 HI_MPI_VI_GetRotate(VI_CHN ViChn, ROTATE_E *penRotate); + +HI_S32 HI_MPI_VI_GetChnLuma(VI_CHN ViChn, VI_CHN_LUM_S *pstLuma); + +HI_S32 HI_MPI_VI_EnableChn422to420(VI_CHN ViChn); +HI_S32 HI_MPI_VI_DisableChn422to420(VI_CHN ViChn); + +HI_S32 HI_MPI_VI_SetChnScanMode(VI_CHN ViChn, VI_SCAN_MODE_E enScanMode); +HI_S32 HI_MPI_VI_GetChnScanMode(VI_CHN ViChn, VI_SCAN_MODE_E *penScanMode); + +/* for 3520D use */ +HI_S32 HI_MPI_VI_SetPortMode(VI_DEV ViDev, const VI_PORTMODE_E enPortMode); +HI_S32 HI_MPI_VI_GetPortMode(VI_DEV ViDev, VI_PORTMODE_E *penPortMode); + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif /* __cplusplus */ + +#endif /*__MPI_VI_H__ */ + + + diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_vo.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_vo.h new file mode 100644 index 0000000000..b6de4d359a --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_vo.h @@ -0,0 +1,185 @@ +/****************************************************************************** + + Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. + + ****************************************************************************** + File Name : mpi_vo.h + Version : Initial Draft + Author : Hisilicon multimedia software group + Created : 2011/06/28 + Description : Vou API + History : + 1.Date : 2011/06/28 + Author : z00185248 + Modification: Created file + +******************************************************************************/ + +#ifndef __MPI_VO_H__ +#define __MPI_VO_H__ + +#include "hi_comm_vo.h" + +#ifdef __cplusplus +#if __cplusplus +extern "C" +{ +#endif +#endif /* __cplusplus */ + + +/* Device Settings */ + +HI_S32 HI_MPI_VO_Enable (VO_DEV VoDev); +HI_S32 HI_MPI_VO_Disable(VO_DEV VoDev); + +HI_S32 HI_MPI_VO_SetPubAttr(VO_DEV VoDev, const VO_PUB_ATTR_S *pstPubAttr); +HI_S32 HI_MPI_VO_GetPubAttr(VO_DEV VoDev, VO_PUB_ATTR_S *pstPubAttr); + +HI_S32 HI_MPI_VO_CloseFd(HI_VOID); + + +/* Video Settings */ +HI_S32 HI_MPI_VO_EnableVideoLayer (VO_DEV VoDev); +HI_S32 HI_MPI_VO_DisableVideoLayer(VO_DEV VoDev); + +HI_S32 HI_MPI_VO_SetVideoLayerAttr(VO_DEV VoDev, const VO_VIDEO_LAYER_ATTR_S *pstLayerAttr); +HI_S32 HI_MPI_VO_GetVideoLayerAttr(VO_DEV VoDev, VO_VIDEO_LAYER_ATTR_S *pstLayerAttr); + +/* PIP LAYER Setting */ + +HI_S32 HI_MPI_VO_PipLayerBindDev(VO_DEV VoTargetDev); +HI_S32 HI_MPI_VO_PipLayerUnBindDev(VO_DEV VoTargetDev); + +HI_S32 HI_MPI_VO_SetPipLayerAttr(const VO_VIDEO_LAYER_ATTR_S *pstLayerAttr); +HI_S32 HI_MPI_VO_GetPipLayerAttr(VO_VIDEO_LAYER_ATTR_S *pstLayerAttr); + +HI_S32 HI_MPI_VO_EnablePipLayer (HI_VOID); +HI_S32 HI_MPI_VO_DisablePipLayer(HI_VOID); + +/* General Operation of Channel */ + +HI_S32 HI_MPI_VO_EnableChn (VO_DEV VoDev, VO_CHN VoChn); +HI_S32 HI_MPI_VO_DisableChn(VO_DEV VoDev, VO_CHN VoChn); + + +/* These two interfaces only support for Hi3518 */ +HI_S32 HI_MPI_VO_EnableSdTdeBypass (VO_DEV VoDev); +HI_S32 HI_MPI_VO_DisableSdTdeBypass(VO_DEV VoDev); + + +HI_S32 HI_MPI_VO_SetChnAttr(VO_DEV VoDev, VO_CHN VoChn, const VO_CHN_ATTR_S *pstChnAttr); +HI_S32 HI_MPI_VO_GetChnAttr(VO_DEV VoDev, VO_CHN VoChn, VO_CHN_ATTR_S *pstChnAttr); + +HI_S32 HI_MPI_VO_SetChnDisplayWindow(VO_DEV VoDev, VO_CHN VoChn, const RECT_S *pstWindow); +HI_S32 HI_MPI_VO_GetChnDisplayWindow(VO_DEV VoDev, VO_CHN VoChn, RECT_S *pstWindow); + +HI_S32 HI_MPI_VO_SetChnDispPos(VO_DEV VoDev, VO_CHN VoChn, const POINT_S *pstDispPos); +HI_S32 HI_MPI_VO_GetChnDispPos(VO_DEV VoDev, VO_CHN VoChn, POINT_S *pstDispPos); + +HI_S32 HI_MPI_VO_SetChnField(VO_DEV VoDev, VO_CHN VoChn, const VO_DISPLAY_FIELD_E enField); +HI_S32 HI_MPI_VO_GetChnField(VO_DEV VoDev, VO_CHN VoChn, VO_DISPLAY_FIELD_E *pField); + +HI_S32 HI_MPI_VO_SetChnFrameRate(VO_DEV VoDev, VO_CHN VoChn, HI_S32 s32ChnFrmRate); +HI_S32 HI_MPI_VO_GetChnFrameRate(VO_DEV VoDev, VO_CHN VoChn, HI_S32 *ps32ChnFrmRate); + +HI_S32 HI_MPI_VO_GetChnFrame (VO_DEV VoDev, VO_CHN VoChn, VIDEO_FRAME_INFO_S *pstFrame); +HI_S32 HI_MPI_VO_ReleaseChnFrame(VO_DEV VoDev, VO_CHN VoChn, VIDEO_FRAME_INFO_S *pstFrame); + +HI_S32 HI_MPI_VO_ChnPause (VO_DEV VoDev, VO_CHN VoChn); +HI_S32 HI_MPI_VO_ChnResume(VO_DEV VoDev, VO_CHN VoChn); +HI_S32 HI_MPI_VO_ChnStep (VO_DEV VoDev, VO_CHN VoChn); +HI_S32 HI_MPI_VO_ChnRefresh(VO_DEV VoDev, VO_CHN VoChn); + +HI_S32 HI_MPI_VO_ChnShow(VO_DEV VoDev, VO_CHN VoChn); +HI_S32 HI_MPI_VO_ChnHide(VO_DEV VoDev, VO_CHN VoChn); + +HI_S32 HI_MPI_VO_SetZoomInWindow(VO_DEV VoDev, VO_CHN VoChn, const VO_ZOOM_ATTR_S *pstZoomAttr); +HI_S32 HI_MPI_VO_GetZoomInWindow(VO_DEV VoDev, VO_CHN VoChn, VO_ZOOM_ATTR_S *pstZoomAttr); + +HI_S32 HI_MPI_VO_GetChnPts (VO_DEV VoDev, VO_CHN VoChn, HI_U64 *pu64ChnPts); +HI_S32 HI_MPI_VO_QueryChnStat(VO_DEV VoDev, VO_CHN VoChn, VO_QUERY_STATUS_S *pstStatus); + +HI_S32 HI_MPI_VO_SendFrame(VO_DEV VoDev, VO_CHN VoChn, VIDEO_FRAME_INFO_S *pstVFrame); +HI_S32 HI_MPI_VO_SendFrameTimeOut(VO_DEV VoDev, VO_CHN VoChn, VIDEO_FRAME_INFO_S *pstVFrame, HI_U32 u32MilliSec); + +HI_S32 HI_MPI_VO_ClearChnBuffer(VO_DEV VoDev, VO_CHN VoChn, HI_BOOL bClrAll); + + +HI_S32 HI_MPI_VO_SetChnDispThreshold(VO_DEV VoDev, VO_CHN VoChn, HI_U32 u32Threshold); +HI_S32 HI_MPI_VO_GetChnDispThreshold(VO_DEV VoDev, VO_CHN VoChn, HI_U32 *pu32Threshold); + +HI_S32 HI_MPI_VO_EnableChnDoubleFrame(VO_DEV VoDev, VO_CHN VoChn); +HI_S32 HI_MPI_VO_DisableChnDoubleFrame(VO_DEV VoDev, VO_CHN VoChn); + +HI_S32 HI_MPI_VO_SetAttrBegin(VO_DEV VoDev); +HI_S32 HI_MPI_VO_SetAttrEnd (VO_DEV VoDev); + +HI_S32 HI_MPI_VO_SetPlayToleration(VO_DEV VoDev, HI_U32 u32Toleration); +HI_S32 HI_MPI_VO_GetPlayToleration(VO_DEV VoDev, HI_U32 *pu32Toleration); + +HI_S32 HI_MPI_VO_GetScreenFrame (VO_DEV VoDev, VIDEO_FRAME_INFO_S *pstVFrame); +HI_S32 HI_MPI_VO_ReleaseScreenFrame(VO_DEV VoDev, VIDEO_FRAME_INFO_S *pstVFrame); + +HI_S32 HI_MPI_VO_SetDispBufLen(VO_DEV VoDev, HI_U32 u32BufLen); +HI_S32 HI_MPI_VO_GetDispBufLen(VO_DEV VoDev, HI_U32 *pu32BufLen); + +HI_S32 HI_MPI_VO_EnableWbc(VO_DEV VoDev); +HI_S32 HI_MPI_VO_DisableWbc(VO_DEV VoDev); + +HI_S32 HI_MPI_VO_SetWbcAttr(VO_DEV VoDev, const VO_WBC_ATTR_S *pstWbcAttr); +HI_S32 HI_MPI_VO_GetWbcAttr(VO_DEV VoDev, VO_WBC_ATTR_S *pstWbcAttr); + +HI_S32 HI_MPI_VO_SetWbcMode(VO_DEV VoDev, VO_WBC_MODE_E enWbcMode); +HI_S32 HI_MPI_VO_GetWbcMode(VO_DEV VoDev, VO_WBC_MODE_E *penWbcMode); + +HI_S32 HI_MPI_VO_SetWbcDepth(VO_DEV VoDev, HI_U32 u32Depth); +HI_S32 HI_MPI_VO_GetWbcDepth(VO_DEV VoDev, HI_U32 *pu32Depth); +HI_S32 HI_MPI_VO_WbcGetScreenFrame(VO_DEV VoDev, VIDEO_FRAME_INFO_S *pstVFrame); +HI_S32 HI_MPI_VO_WbcReleaseScreenFrame(VO_DEV VoDev, VIDEO_FRAME_INFO_S *pstVFrame); + +HI_S32 HI_MPI_VO_GfxLayerBindDev(VOU_GFX_BIND_LAYER_E enGfxLayer, VO_DEV VoTargetDev); +HI_S32 HI_MPI_VO_GfxLayerUnBindDev(VOU_GFX_BIND_LAYER_E enGfxLayer, VO_DEV VoTargetDev); + +HI_S32 HI_MPI_VO_SetGfxLayerCSC(HI_U32 u32Layer, const VO_CSC_S *pstCSC); +HI_S32 HI_MPI_VO_GetGfxLayerCSC(HI_U32 u32Layer, VO_CSC_S *pstCSC); + +HI_S32 HI_MPI_VO_SetCascadeAttr(const VO_CAS_ATTR_S *pstCasAttr); +HI_S32 HI_MPI_VO_GetCascadeAttr(VO_CAS_ATTR_S *pstCasAttr); + +HI_S32 HI_MPI_VO_EnableCascadeDev (VO_DEV VoCasDev); +HI_S32 HI_MPI_VO_DisableCascadeDev(VO_DEV VoCasDev); + +HI_S32 HI_MPI_VO_SetCascadePattern(VO_DEV VoCasDev, HI_U32 u32Pattern); +HI_S32 HI_MPI_VO_GetCascadePattern(VO_DEV VoCasDev, HI_U32 *pu32Pattern); + +HI_S32 HI_MPI_VO_CascadePosBindChn (HI_U32 u32Pos, VO_DEV VoCasDev, VO_CHN VoChn); +HI_S32 HI_MPI_VO_CascadePosUnBindChn(HI_U32 u32Pos, VO_DEV VoCasDev, VO_CHN VoChn); + +HI_S32 HI_MPI_VO_EnableCascade (HI_VOID); +HI_S32 HI_MPI_VO_DisableCascade(HI_VOID); + +HI_S32 HI_MPI_VO_GetDevCSC(VO_DEV VoDev, VO_CSC_S *pstDevCSC); +HI_S32 HI_MPI_VO_SetDevCSC(VO_DEV VoDev, VO_CSC_S *pstDevCSC); + +HI_S32 HI_MPI_VO_GetVgaParam(VO_DEV VoDev, VO_VGA_PARAM_S *pstVgaParam); +HI_S32 HI_MPI_VO_SetVgaParam(VO_DEV VoDev, VO_VGA_PARAM_S *pstVgaParam); + +HI_S32 HI_MPI_VO_SetVtth(VO_DEV VoDev, HI_U32 u32Vtth); +HI_S32 HI_MPI_VO_GetVtth(VO_DEV VoDev, HI_U32 *pu32Vtth); + +HI_S32 HI_MPI_VO_SetDevFramerate(VO_DEV VoDev, HI_U32 u32Framerate); +HI_S32 HI_MPI_VO_GetDevFramerate(VO_DEV VoDev, HI_U32 *pu32Framerate); + + +HI_S32 HI_MPI_VO_EnableRecvFrameRateMatch (VO_DEV VoDev, VO_CHN VoChn); +HI_S32 HI_MPI_VO_DisableRecvFrameRateMatch (VO_DEV VoDev, VO_CHN VoChn); + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif /* __cplusplus */ +#endif /*__MPI_VO_H__ */ + + diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_vpss.h b/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_vpss.h new file mode 100644 index 0000000000..14d010f4e3 --- /dev/null +++ b/general/package/hisilicon-osdrv-hi3520dv200/files/include/mpi_vpss.h @@ -0,0 +1,123 @@ +/****************************************************************************** + + Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. + + ****************************************************************************** + File Name : mpi_vpss.h + Version : Initial Draft + Author : + Created : + Last Modified : + Description : mpi functions declaration + Function List : + History : + 1.Date : 20110616 + Author : l00183122 + Modification: Create +******************************************************************************/ +#ifndef __MPI_VPSS_H__ +#define __MPI_VPSS_H__ + +#include "hi_common.h" +#include "hi_comm_video.h" +#include "hi_comm_vpss.h" + +#ifdef __cplusplus +#if __cplusplus +extern "C"{ +#endif +#endif /* __cplusplus */ + + +HI_S32 HI_MPI_VPSS_CreateGrp(VPSS_GRP VpssGrp, VPSS_GRP_ATTR_S *pstGrpAttr); +HI_S32 HI_MPI_VPSS_DestroyGrp(VPSS_GRP VpssGrp); + +HI_S32 HI_MPI_VPSS_StartGrp(VPSS_GRP VpssGrp); +HI_S32 HI_MPI_VPSS_StopGrp(VPSS_GRP VpssGrp); + +HI_S32 HI_MPI_VPSS_ResetGrp(VPSS_GRP VpssGrp); + +HI_S32 HI_MPI_VPSS_EnableChn(VPSS_GRP VpssGrp, VPSS_CHN s32VpssChnl); +HI_S32 HI_MPI_VPSS_DisableChn(VPSS_GRP VpssGrp, VPSS_CHN s32VpssChnl); + +HI_S32 HI_MPI_VPSS_EnableBackupFrame(VPSS_GRP VpssGrp); +HI_S32 HI_MPI_VPSS_DisableBackupFrame(VPSS_GRP VpssGrp); + +HI_S32 HI_MPI_VPSS_GetGrpAttr(VPSS_GRP VpssGrp, VPSS_GRP_ATTR_S *pstGrpAttr); +HI_S32 HI_MPI_VPSS_SetGrpAttr(VPSS_GRP VpssGrp, VPSS_GRP_ATTR_S *pstGrpAttr); + +HI_S32 HI_MPI_VPSS_EnableBackupFrame(VPSS_GRP VpssGrp); +HI_S32 HI_MPI_VPSS_DisableBackupFrame(VPSS_GRP VpssGrp); + +HI_S32 HI_MPI_VPSS_GetChnAttr(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, VPSS_CHN_ATTR_S *pstChnAttr); +HI_S32 HI_MPI_VPSS_SetChnAttr(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, VPSS_CHN_ATTR_S *pstChnAttr); + +HI_S32 HI_MPI_VPSS_SetGrpParam(VPSS_GRP VpssGrp, VPSS_GRP_PARAM_S *pstVpssParam); +HI_S32 HI_MPI_VPSS_GetGrpParam(VPSS_GRP VpssGrp, VPSS_GRP_PARAM_S *pstVpssParam); + +HI_S32 HI_MPI_VPSS_SetCropCfg(VPSS_GRP VpssGrp, VPSS_CROP_INFO_S *pstCropInfo); +HI_S32 HI_MPI_VPSS_GetCropCfg(VPSS_GRP VpssGrp, VPSS_CROP_INFO_S *pstCropInfo); + +HI_S32 HI_MPI_VPSS_SetChnMode(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, VPSS_CHN_MODE_S *pstVpssMode); +HI_S32 HI_MPI_VPSS_GetChnMode(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, VPSS_CHN_MODE_S *pstVpssMode); + +HI_S32 HI_MPI_VPSS_SetDepth(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, HI_U32 u32Depth); +HI_S32 HI_MPI_VPSS_GetDepth(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, HI_U32 *pu32Depth); + +HI_S32 HI_MPI_VPSS_UserSendFrame(VPSS_GRP VpssGrp, VIDEO_FRAME_INFO_S *pstVideoFrame); +HI_S32 HI_MPI_VPSS_UserSendFrameTimeout(VPSS_GRP VpssGrp, VIDEO_FRAME_INFO_S *pstVideoFrame, HI_U32 u32MilliSec); + +HI_S32 HI_MPI_VPSS_UserGetFrame(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, VIDEO_FRAME_INFO_S *pstVideoFrame); +HI_S32 HI_MPI_VPSS_UserReleaseFrame(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, VIDEO_FRAME_INFO_S *pstVideoFrame); + +HI_S32 HI_MPI_VPSS_UserGetGrpFrame(VPSS_GRP VpssGrp, VIDEO_FRAME_INFO_S *pstVideoFrame, HI_U32 u32FrameIndex); +HI_S32 HI_MPI_VPSS_UserReleaseGrpFrame(VPSS_GRP VpssGrp, VIDEO_FRAME_INFO_S *pstVideoFrame); +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/*set&get vpss group prescale information.*/ +HI_S32 HI_MPI_VPSS_SetPreScale(VPSS_GRP VpssGrp,VPSS_PRESCALE_INFO_S *pstPreScaleInfo); +HI_S32 HI_MPI_VPSS_GetPreScale(VPSS_GRP VpssGrp,VPSS_PRESCALE_INFO_S *pstPreScaleInfo); + +/*set&get vpss group picture size filter information*/ +HI_S32 HI_MPI_VPSS_SetGrpSizer(VPSS_GRP VpssGrp, VPSS_SIZER_INFO_S *pstVpssSizerInfo); +HI_S32 HI_MPI_VPSS_GetGrpSizer(VPSS_GRP VpssGrp, VPSS_SIZER_INFO_S *pstVpssSizerInfo); + +HI_S32 HI_MPI_VPSS_SetDelay(VPSS_GRP VpssGrp, HI_U32 u32Delay); +HI_S32 HI_MPI_VPSS_GetDelay(VPSS_GRP VpssGrp, HI_U32 *pu32Delay); + +/*set&get vpss group source picture framerate ctrl information*/ +HI_S32 HI_MPI_VPSS_SetGrpFrameRate(VPSS_GRP VpssGrp, VPSS_FRAME_RATE_S *pstVpssFrameRate); +HI_S32 HI_MPI_VPSS_GetGrpFrameRate(VPSS_GRP VpssGrp, VPSS_FRAME_RATE_S *pstVpssFrameRate); + +/*set&get vpss channel Nr(Noise Reduction) parameters.*/ +HI_S32 HI_MPI_VPSS_SetChnNrParam(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, VPSS_CHN_NR_PARAM_S *pstChnNrParam); +HI_S32 HI_MPI_VPSS_GetChnNrParam(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, VPSS_CHN_NR_PARAM_S *pstChnNrParam); + +/*set&get vpss channel sharpen parameters.*/ +HI_S32 HI_MPI_VPSS_SetChnSpParam(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, VPSS_CHN_SP_PARAM_S *pstChnSpParam); +HI_S32 HI_MPI_VPSS_GetChnSpParam(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, VPSS_CHN_SP_PARAM_S *pstChnSpParam); + +/*set&get vpss channel field information.*/ +HI_S32 HI_MPI_VPSS_SetChnField(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, VPSS_CAPSEL_E enCapSel); +HI_S32 HI_MPI_VPSS_GetChnField(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, VPSS_CAPSEL_E *enCapSel); + +/*set&get vpss group field information.*/ +HI_S32 HI_MPI_VPSS_SetGrpField(VPSS_GRP VpssGrp, VPSS_CAPSEL_E enCapSel); +HI_S32 HI_MPI_VPSS_GetGrpField(VPSS_GRP VpssGrp, VPSS_CAPSEL_E *penCapSel); + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/*set&get vpss extend channel attributes*/ +HI_S32 HI_MPI_VPSS_SetExtChnAttr(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, VPSS_EXT_CHN_ATTR_S *pstExtChnAttr); +HI_S32 HI_MPI_VPSS_GetExtChnAttr(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, VPSS_EXT_CHN_ATTR_S *pstExtChnAttr); + +/*set&get vpss group picture rotate information*/ +//HI_S32 HI_MPI_VPSS_SetRotate(VPSS_GRP VpssGrp, ROTATE_E enRotate); +//HI_S32 HI_MPI_VPSS_GetRotate(VPSS_GRP VpssGrp, ROTATE_E *penRotate); + +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif /* __cplusplus */ + +#endif /* __MPI_VPSS_H__ */ + diff --git a/general/package/hisilicon-osdrv-hi3520dv200/files/lib/libhdmi.a b/general/package/hisilicon-osdrv-hi3520dv200/files/lib/libhdmi.a new file mode 100644 index 0000000000000000000000000000000000000000..71b4ce3511255b730dd2bb916572155379f2fab1 GIT binary patch literal 19518 zcmeI3ZE#fAea6qCU1_bz_Qn>m42rW(|v4~k7wTy3X(ATu;W5~igIPS+`uVN$oHEo~Lbv@3}%a?GS;%A{(C zDg8b7Wp#HEBz2wXbcQ=4{qA|W=lS1r&i$X4d-wi^_+VG!W95&83y*d6>z`N`i9GT6 zx^OsRC3*jc!;e2YCdxzq?`+7`q z{HFfpqIag^sl7u5nYZ+$D5q&)&z^XHcR|X|8>Va?80_ll@xj9SL1JSnb=`el7e~IG zz5SnWiYMc{d;5A*FBFv9)Hg6xD7`(|(_fHft>(N$Ae`bK2vL!LdMiTY{duaE!3I{bDO!maqV0Fjng?3i_ZBQzmjb^vu$oMI=%94 zV^&>>PUixVsf&T+Sk{=G^Y1n0+=bY5t~4`su{1W8^_hD&g+?=WLo<^MQL!5Eq{+_t2)Xj>~+O$FI-tSAP)$o<3OS^uYvWd;8#z)CXhgg9jbW{kfLdbnY~I&Gf+r&fPxvXT;T; z>0B*wZXf&}aUmYs68f6AAKsIw&Zs9|*AKU>eJd8{`oa=Eu>hu-rbliHrA1|uYMxHkl;hD{R zY0e)xaAA@A7lY=Ni=z8yA_sDfk%?S0f3c)puO=CtYtBrpxYL{r-f0d8%gmvmKa%#9 znJ)+3cKKWG-))oIvAf%8lc})l7sj)SSDT1#o7_H`o>hMdnsLiFs9m}}zJdBLH%Yb2 z*X(vlzMN}GPUrsEZ5Ph(FyoeQ_?Fu)#2F{<4~c7Erd{5bsL9YQ*SE{9e*TX7`O2Hr zXYDe6qv{5J!ymW%xOuM7Z!oT%yBsa_8xIxrarq$n;QW^!vB$8R`4NpRzYIU}cQ^1O zr`-PP@gslg_E(P|`3`a6W%}#AiQxBd)L&bdsow^V5ApitTE~af6xFZh2$hx(!7t;h zHAi?<^*g$M&K=J+r|{u#@FRDd$oR^zG39~Av24bS*<*P!JwJDodOeZ%1!LKp`R7&G zG8roL&(<8l@&k^4PVUbodCq@;p2iCK4YjxYi~QA$+JU}cLgP8t{_m1kzI+4MxxW05 zh?6g`AA@Sk#$=8S1%WbYiZIam}5FwK~3fzo(Af`xcc~byH@djHUKGEJmHRx?1>P z=26Z(>=kDoHlAyYPUrra`e>lu>N$7o?HqAysJAe2ZoSd>f4pc{iS_@zP90r0_T8#4 zYrHD1ud18WSCIZ?^(kk*?+;Dn-i`VG&+BXIXWsdK>pPt9d;8fhW4>Q`qq@5_p68$0 z|H-`dt{c@S&+e_hxa9MeTYKJpqq<|x->h*W`INPW()#HjN8QU98T|d}TsiBga^f^zM>L+KU!HTvR*ipctkd0jcaU-N zcE-rF_Y-d+1r~EzaGs=1+*T)?386W6g2m8kQNO??|*| zH27RM=HLgcx{ulG*F(-)tKKsYJ*0Yf)~{h_9$H;APtx3^!ks5M>(_OvchCB@xZX|V zm7IL2>NaR5Sby2;D$QHe9vSLJb$9zH^VitYT9-BHkK59PYu)AQ-fb(;Bs}sQWu_QumeW_s-a*y#pWj>Zfn7q3$$qvi7T-zP-|z zANrF^p||xyC-&+ z+OcRp77V9nQ%?I7?}_E-)z;osVL$$vTbJ}%w;%u1txMwEy1YbO1^w8&XP~~TeFXL6 zibQ3mVE>AKe5)?6z5Pz=^7dPGnR~bT<$a8CxBBJvW7Rw9m+vpG%Ug4-pS!;wy3rhq zx~tGw!@S0QFJc(W!}#{A^7qW4N=NNElsnG2a~o@%appE>Z!pey$JbKU(H~-*Ia)N% zRH4NfQ?SQ9$$t0>#vJWY<=>@5zREbTbG{^&_AN3dXOjEo+%c_`xq;T_#+i>wT&hxyNGH2HF z?XE3@jZ1sP^Y|inpZ=aYd!JtSt-W~H4{IIsZoJduos_em>FgOtd8daT`#yTbYfP-a6 z)oUH++G}TR&OM}gcfRB+OUa)}zLXy;^zJ@eGR3|K6a@u}yYb{UVZ{_eWmJ@5`IWt2ymW6~EVi zgSf^b{~IXszuvJcR8;p`U-G%q()!Y=XYHL_j#2lc_V*B46H>=_Ykc`hfY$=E+?&zlysMvtXuSKurBE2dX6&sk*#op*BSv8?7TpHMxn zo6ePF^D&s=)t1ROrgIgX)Bjf`UZlObUVbY;JGS#Y)H-uL?aOG-#_j)&lws0*%R=52 z#CL=ya_#)7?*=JD{z>P$NB7)EpVqnJbZ;uVI$~dQmNux(yp{`?j#=ua!1*5#7ot+V`xN_mvEF>tn9=X52N@Ik zCK-Oh-xug`o}<`LDoJzAzW8*m?>Y2iU&)s7J%i?(>Q`lr<5|X)b8Q>hr{sHv8KZe} zbpC$Y^b&JsUp752-?*6Fm-{v1BD8-Q-!bIp%Ax3-=HQCcz4|FnKGcM>^JU@ji|R)i z+T2f_&P2y@=lRR>cY(hJ{x0!%nZGOiE%K)_GR`~BfOCyIZ#}_t7clns2YUA@9X<2z zSf)O8{a7|$@Qsx6N+ZC#xiY?k2yyS)FZKFb-d)nJQ}*1;YS*z`3+-}Vn)K1j)RD^2 z`K8dloc2t$4sgGNsOJ2yiR<<>O^M?N)E?e8y38Ka5$fJuL$%Q^huA0GKwTfC&8#() z<4bw2&+VrT^?lDw=Abopv4>f*mb`j*?0v4>=S%I>66X1*ErTI@4a9oqo@SmgSk^#$ z>fT!-69E(XatN-p?v4FJ#?4hGt81R-c{SygZ`j%u;i-$44QmhTvNU4Xr_WFqWbVn&ds3AU5WU!J%yRWL-9SyzMjE&YU$dC9(u_8(X#i0-0(9fZ`{?qb$eJJ={{q9 zy?ebqn+JQI+uPIM^+Mhr%NF~))v%TSqmkhUhB0+ZQ`1MowJp6vd?DL4(BJv|`bebq z*{-hoy85;2pNKsCY+vv0uC?py)~$QEhtFsq?oX!r9(*uNa@{(!5m#*DiZ{LwavFH7 zZIdbW2Yt8s?($dqR{HKKsq)?HTeaf86>EH^Zs>(QsrYV~8nl^k&jx$?>QX(!DO1-S zPsL5$?x7)5H#nexa<8kaH+5ZniOpBFrjDlQsoV02U2BI@@vhICx{Xh5tBdnNaPMwD zCLU6Y{bI)l$R?Lp>SV8nHEdM42Xi>S(7d zw+w~dbA7U_{BFJu^648@_i*#^&dw@-y_2APehE5<@+rtTXVHl^v4@Po_vR1xk``jz zb0z*B`Migl)=nh0CEYaT!)NCYHy?Ab{5>e~&&ij_=UUQIexB+4QAuG@D&RfDe3C!i z2jiMm$8MbvG~JIG^PipwS66A?!yE56KfUHnD=D~R+3P8gj3ua7crPG7O>6YMrhWLV zbX-P0tn`-r4cX~QPgvcR(gcViW^q@wRyryPsr(5hh6@p zC#>}2)lRZge_2mh>G~axec0Ep@r14N<@~I}PM`9GmA(+RQ{DCn-M#(nn zdcsOi)i}wHeHl+!=^H*=nBL(DD?Lgc)FL}bczoo-(b}R)r^PA5);SBTe~Al=kmu!yE^u>5PxN&g)ve>&!bzX9bxBTo1fl)rSt|3p~+ zQQw?M@86;PpEgyqlN@P5Mb zUvBs{!tz&c_*;bKpIrUZgyoOi@Q(<~|G43|bv^#Zwf`Dn`4_jmyQxe0lZ0c>I>PcF zuDwl!ZV`t4uA6~yWnaKl9zndx5tdpYlq8j~sO zr)8acba7|j0Mp>!fv!}aDNNYgZzb*N*~5Co4D}}mS*bi@Ep|+o_4_xLB||1@Ep|-j zme%c0Zfxz`zIpS`O>LcR8=q|5)LHO@IGJ$k_mkF7O!;x)($6HR;I3rh&kMb)wt_n3 z!s6ddlD9aDT-Wyi@+}+r|LA9wP7n01Z=GLL7WUlk9+rIrFXa34Zw&Mn{x;M4!DZn! zz4}q68`Z^6FZI(>p1Wm!lDT)NkDtrp4>b0!{**mluWq;3FRMR|zgPTc*jW%6aF2=% z>Ze5VX?$J%Ib*JfPcvTNi&l5q>xO${_*cSJPx4zsaXVwNxY-^vs#^Hnrov1FG{#7O zN~GMhh`z=c>CcGhUl7s1Dw0oQiuBir=r@Y!Yh5D!D3pGih<=BNenLdQPegwPN`FD5 z+$$pbA$+9tYee)TBKj>N`8q`Oheh-ci0EtGBmFd#{$UaQqaykzMD$OJ=&xaVBK?F& zxd%k_4~yuZ5Yay+qMsFIr-*)taa{T}BKlfaNq+;BeuId9vxt6FM88c$KLe$IMx@;H zBKnIW`W2-R{VEath)BL>5&f8meo91N>o)1{htfYFqCX{Wrd~w!4~yuB%D4{wu!vqn zr2GaEJKCN2J`p>HMeLXq$#+=9j*N&MXGQGL`cQT(K-qCg#EvT>c4z}acKF3DjLlGX zOp53p6S3!%i0&B?-31Zdt0KBp%!?F`h+Nk!Vn@4(9a@LVjy@eGa{ltDWb1+uJjK<>8C~XkBI0W7tuc< zqOVN}>4!whtrm4(BKqwj`rRV>BO>`GMf8t~=x0RqwT_nln^5{^MD%Aw^e>3$FNo+j zRB#>ots>>Ni|CJt=ue919}>|&E|TxGi2el;{Y4Rdt<$9+gwn4N(XSNI4~yv6i0Ds3 z>8C}?Ju0GqT15Z6i2j0zzF}Uge3c^l5fS}n5q<3gNWUFQze7a7TSPx8qMs7cKMkcn zBU0`K5q*AKYUx*t=+}zqH;UwI6VXqK=#Po$Yo9^-Q&9Q`#qHdmi2hL#{bM5fVJ4)~ zkBHoFvq=}i!=Kz#F zlOpyU6tU;9h&@L{?70GEN09Z0bSg!3)`;lDMC?sE;Smx0rbP6QiRhma(bqnW^v^=+ z&xq(=5V7O3i2fB3{YG8_OTSG-KPI9-ETVr@ME|4{J}si3716&cq90N`W+(r+Gmn}AC!Jl zM1Mp?f4_+S0TKNfDE&(!`imm^p?e^D%_913PBsL|^+@(mw&Ee^NyM zw21y$5&anv{WVow_bKW{M6X4p{5}!8Mn&v8AY#{Hv7Pco^v{auFNo-CpG^9TQ2JLz zbp7{2>)nfP5=u8EqBkO< zzh6{)i|8*x=?AMJBN*m7?5Gkcw^qcCW)VBuMfAHx^hZSUO^WCr5xM?^6MtId`mET=^8jVf zWhi^Dh}d&g#GZ=#A$IgZl`|qz{sED4(hg6G*mFk2p7SF1ToK71{2;`h8WCOX<4U(4 zN_T^ZZlj29tBCGlxcYhQ5l83;AF|mlqL&h>-%+t2yF~II5x+pc63KT-#I8jVyFxV( zyTT%NHHehcCZdxNu~YlWvU3E=&QTFNC&gCoU;K6K6hDrxi2cV!+VO@4>}?UZ zQLo}=`i+P^$KdK0u~VddFN>;|Ux8mDpGZ5W9FBK=U$7Qp vm-f|VR~3|9)gpG)z*S$SJ`~