1/*
2 * Copyright (c) 2022 HiSilicon (Shanghai) Technologies CO., LIMITED.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16#ifndef __HI_COMM_VIDEO_H__
17#define __HI_COMM_VIDEO_H__
18
19#include "hi_type.h"
20#include "hi_common.h"
21
22#ifdef __cplusplus
23#if __cplusplus
24extern "C" {
25#endif
26#endif /* __cplusplus */
27
28#define SRC_LENS_COEF_SEG       2
29#define DST_LENS_COEF_SEG       3
30#define SRC_LENS_COEF_NUM       4
31#define DST_LENS_COEF_NUM       4
32#define DST_LENS_COEF_SEG_POINT (DST_LENS_COEF_SEG - 1)
33
34#define ISP_BAYER_CHN           (4)
35
36typedef enum hiOPERATION_MODE_E {
37    OPERATION_MODE_AUTO   = 0,
38    OPERATION_MODE_MANUAL = 1,
39    OPERATION_MODE_BUTT
40} OPERATION_MODE_E;
41
42/* Angle of rotation */
43typedef enum hiROTATION_E {
44    ROTATION_0   = 0,
45    ROTATION_90  = 1,
46    ROTATION_180 = 2,
47    ROTATION_270 = 3,
48    ROTATION_BUTT
49} ROTATION_E;
50
51typedef enum hiVB_SOURCE_E {
52    VB_SOURCE_COMMON  = 0,
53    VB_SOURCE_MODULE  = 1,
54    VB_SOURCE_PRIVATE = 2,
55    VB_SOURCE_USER    = 3,
56    VB_SOURCE_BUTT
57} VB_SOURCE_E;
58
59typedef enum hiDATA_RATE_E {
60    DATA_RATE_X1 = 0,         /* RW; output 1 pixel per clock */
61    DATA_RATE_X2 = 1,         /* RW; output 2 pixel per clock */
62
63    DATA_RATE_BUTT
64} DATA_RATE_E;
65
66typedef struct hiBORDER_S {
67    HI_U32 u32TopWidth;
68    HI_U32 u32BottomWidth;
69    HI_U32 u32LeftWidth;
70    HI_U32 u32RightWidth;
71    HI_U32 u32Color;
72} BORDER_S;
73
74typedef struct hiPOINT_S {
75    HI_S32 s32X;
76    HI_S32 s32Y;
77} POINT_S;
78
79typedef struct hiSIZE_S {
80    HI_U32 u32Width;
81    HI_U32 u32Height;
82} SIZE_S;
83
84typedef struct hiRECT_S {
85    HI_S32 s32X;
86    HI_S32 s32Y;
87    HI_U32 u32Width;
88    HI_U32 u32Height;
89} RECT_S;
90
91typedef struct hiVIDEO_REGION_INFO_S {
92    HI_U32           u32RegionNum;       /* W; count of the region */
93    RECT_S ATTRIBUTE *pstRegion;         /* W; region attribute */
94} VIDEO_REGION_INFO_S;
95
96typedef struct hiCROP_INFO_S {
97    HI_BOOL bEnable;
98    RECT_S  stRect;
99} CROP_INFO_S;
100
101typedef struct hiFRAME_RATE_CTRL_S {
102    HI_S32  s32SrcFrameRate;        /* RW; source frame rate */
103    HI_S32  s32DstFrameRate;        /* RW; dest frame rate */
104} FRAME_RATE_CTRL_S;
105
106typedef enum hiASPECT_RATIO_E {
107    ASPECT_RATIO_NONE   = 0,        /* full screen */
108    ASPECT_RATIO_AUTO   = 1,        /* ratio no change, 1:1 */
109    ASPECT_RATIO_MANUAL = 2,        /* ratio manual set */
110    ASPECT_RATIO_BUTT
111} ASPECT_RATIO_E;
112
113typedef struct hiASPECT_RATIO_S {
114    ASPECT_RATIO_E enMode;          /* aspect ratio mode: none/auto/manual */
115    HI_U32         u32BgColor;      /* background color, RGB 888 */
116    RECT_S         stVideoRect;     /* valid in ASPECT_RATIO_MANUAL mode */
117} ASPECT_RATIO_S;
118
119/* we ONLY define picture format used, all unused will be deleted! */
120typedef enum hiPIXEL_FORMAT_E {
121    PIXEL_FORMAT_RGB_444 = 0,
122    PIXEL_FORMAT_RGB_555,
123    PIXEL_FORMAT_RGB_565,
124    PIXEL_FORMAT_RGB_888,
125
126    PIXEL_FORMAT_BGR_444,
127    PIXEL_FORMAT_BGR_555,
128    PIXEL_FORMAT_BGR_565,
129    PIXEL_FORMAT_BGR_888,
130
131    PIXEL_FORMAT_ARGB_1555,
132    PIXEL_FORMAT_ARGB_4444,
133    PIXEL_FORMAT_ARGB_8565,
134    PIXEL_FORMAT_ARGB_8888,
135    PIXEL_FORMAT_ARGB_2BPP,
136
137    PIXEL_FORMAT_ABGR_1555,
138    PIXEL_FORMAT_ABGR_4444,
139    PIXEL_FORMAT_ABGR_8565,
140    PIXEL_FORMAT_ABGR_8888,
141
142    PIXEL_FORMAT_RGB_BAYER_8BPP,
143    PIXEL_FORMAT_RGB_BAYER_10BPP,
144    PIXEL_FORMAT_RGB_BAYER_12BPP,
145    PIXEL_FORMAT_RGB_BAYER_14BPP,
146    PIXEL_FORMAT_RGB_BAYER_16BPP,
147
148    PIXEL_FORMAT_YVU_PLANAR_422,
149    PIXEL_FORMAT_YVU_PLANAR_420,
150    PIXEL_FORMAT_YVU_PLANAR_444,
151
152    PIXEL_FORMAT_YVU_SEMIPLANAR_422,
153    PIXEL_FORMAT_YVU_SEMIPLANAR_420,
154    PIXEL_FORMAT_YVU_SEMIPLANAR_444,
155
156    PIXEL_FORMAT_YUV_SEMIPLANAR_422,
157    PIXEL_FORMAT_YUV_SEMIPLANAR_420,
158    PIXEL_FORMAT_YUV_SEMIPLANAR_444,
159
160    PIXEL_FORMAT_YUYV_PACKAGE_422,
161    PIXEL_FORMAT_YVYU_PACKAGE_422,
162    PIXEL_FORMAT_UYVY_PACKAGE_422,
163    PIXEL_FORMAT_VYUY_PACKAGE_422,
164    PIXEL_FORMAT_YYUV_PACKAGE_422,
165    PIXEL_FORMAT_YYVU_PACKAGE_422,
166    PIXEL_FORMAT_UVYY_PACKAGE_422,
167    PIXEL_FORMAT_VUYY_PACKAGE_422,
168    PIXEL_FORMAT_VY1UY0_PACKAGE_422,
169
170    PIXEL_FORMAT_YUV_400,
171    PIXEL_FORMAT_UV_420,
172
173    /* SVP data format */
174    PIXEL_FORMAT_BGR_888_PLANAR,
175    PIXEL_FORMAT_HSV_888_PACKAGE,
176    PIXEL_FORMAT_HSV_888_PLANAR,
177    PIXEL_FORMAT_LAB_888_PACKAGE,
178    PIXEL_FORMAT_LAB_888_PLANAR,
179    PIXEL_FORMAT_S8C1,
180    PIXEL_FORMAT_S8C2_PACKAGE,
181    PIXEL_FORMAT_S8C2_PLANAR,
182    PIXEL_FORMAT_S8C3_PLANAR,
183    PIXEL_FORMAT_S16C1,
184    PIXEL_FORMAT_U8C1,
185    PIXEL_FORMAT_U16C1,
186    PIXEL_FORMAT_S32C1,
187    PIXEL_FORMAT_U32C1,
188    PIXEL_FORMAT_U64C1,
189    PIXEL_FORMAT_S64C1,
190
191    PIXEL_FORMAT_BUTT
192} PIXEL_FORMAT_E;
193
194typedef enum hiVIDEO_FIELD_E {
195    VIDEO_FIELD_TOP         = 0x1,    /* even field */
196    VIDEO_FIELD_BOTTOM      = 0x2,    /* odd field */
197    VIDEO_FIELD_INTERLACED  = 0x3,    /* two interlaced fields */
198    VIDEO_FIELD_FRAME       = 0x4,    /* frame */
199
200    VIDEO_FIELD_BUTT
201} VIDEO_FIELD_E;
202
203typedef enum hiVIDEO_FORMAT_E {
204    VIDEO_FORMAT_LINEAR = 0,       /* nature video line */
205    VIDEO_FORMAT_TILE_64x16,       /* tile cell: 64pixel x 16line */
206    VIDEO_FORMAT_TILE_16x8,        /* tile cell: 16pixel x 8line */
207    VIDEO_FORMAT_LINEAR_DISCRETE,  /* The data bits are aligned in bytes */
208    VIDEO_FORMAT_BUTT
209} VIDEO_FORMAT_E;
210
211typedef enum hiCOMPRESS_MODE_E {
212    COMPRESS_MODE_NONE = 0,   /* no compress */
213    COMPRESS_MODE_SEG,        /* compress unit is 256x1 bytes as a segment. */
214    COMPRESS_MODE_TILE,       /* compress unit is a tile. */
215    COMPRESS_MODE_LINE,       /* compress unit is the whole line.  raw for VI */
216    COMPRESS_MODE_FRAME,      /* compress unit is the whole frame. YUV for VI(3DNR), RGB for TDE(write)/VO(read) */
217
218    COMPRESS_MODE_BUTT
219} COMPRESS_MODE_E;
220
221typedef enum hiVIDEO_DISPLAY_MODE_E {
222    VIDEO_DISPLAY_MODE_PREVIEW  = 0x0,
223    VIDEO_DISPLAY_MODE_PLAYBACK = 0x1,
224
225    VIDEO_DISPLAY_MODE_BUTT
226} VIDEO_DISPLAY_MODE_E;
227
228typedef struct hiLUMA_INFO_S {
229    HI_U64 u64LumaPixSum;      /* Luma sum of current frame */
230    HI_U32 u32LumaPixAverage;  /* Luma average of current frame */
231    HI_U64 u64PTS;             /* PTS of current frame  */
232} LUMA_INFO_S;
233
234#define LDCI_STAT_WND_X         24
235#define LDCI_STAT_WND_Y         16
236
237#define DCF_DESCRIPTION_LENGTH  32
238#define DCF_CAPTURE_TIME_LENGTH 20
239
240typedef struct hiISP_DCF_CONST_INFO_S {
241    HI_U8       au8ImageDescription[DCF_DESCRIPTION_LENGTH];    /* Describes image */
242    HI_U8       au8Make[DCF_DESCRIPTION_LENGTH];                /* Shows manufacturer of digital cameras */
243    HI_U8       au8Model[DCF_DESCRIPTION_LENGTH];           /* Shows model number of digital cameras */
244    HI_U8       au8Software[DCF_DESCRIPTION_LENGTH];       /* Shows firmware (internal software of digital cameras)
245                                                            * version number */
246
247    HI_U8       u8LightSource;     /* Light source, actually this means white balance setting. '0' means unknown,
248                                    '1' daylight, '2' fluorescent, '3' tungsten, '10' flash, '17' standard light A,
249                                    '18' standard light B, '19' standard light C, '20' D55, '21' D65, '22' D75,
250                                    '255' other */
251    HI_U32      u32FocalLength;        /* Focal length of lens used to take image. Unit is millimeter */
252    HI_U8       u8SceneType;          /* Indicates the type of scene. Value '0x01'
253                                        means that the image was directly photographed. */
254    HI_U8       u8CustomRendered;        /* Indicates the use of special processing on image data, such as rendering
255                                            geared to output. 0 = Normal process  1 = Custom process */
256    HI_U8       u8FocalLengthIn35mmFilm;  /* Indicates the equivalent focal length assuming a 35mm film camera, in mm */
257    HI_U8       u8SceneCaptureType;  /* Indicates the type of scene that was shot. 0 = Standard, 1 = Landscape,
258                                        2 = Portrait,3 = Night scene. */
259    HI_U8       u8GainControl;     /* Indicates the degree of overall image gain adjustment. 0 = None, 1 = Low gain up,
260                                    2 = High gain up,3 = Low gain down,4 = High gain down. */
261    HI_U8       u8Contrast;    /* Indicates the direction of contrast processing applied by the camera when the image
262                                was shot. 0 = Normal,1 = Soft,2 = Hard */
263    HI_U8       u8Saturation;   /* Indicates the direction of saturation processing applied by the camera when the image
264                                was shot. 0 = Normal,1 = Low saturation,2 = High saturation */
265    HI_U8       u8Sharpness;    /* Indicates the direction of sharpness processing applied by the camera when the image
266                                    was shot. 0 = Normal,1 = Soft,2 = Hard . */
267    HI_U8       u8MeteringMode;     /* Exposure metering method. '0' means unknown, '1' average, '2' center weighted
268                                    average, '3' spot, '4' multi-spot, '5' multi-segment, '6' partial, '255' other */
269} ISP_DCF_CONST_INFO_S;
270
271typedef struct hiISP_DCF_UPDATE_INFO_S {
272    HI_U32      u32ISOSpeedRatings;      /* CCD sensitivity equivalent to Ag-Hr film speedrate */
273    HI_U32      u32ExposureTime;         /* Exposure time (reciprocal of shutter speed). */
274    HI_U32      u32ExposureBiasValue;    /* Exposure bias (compensation) value of taking picture */
275    HI_U8       u8ExposureProgram;       /* Exposure program that the camera used when image was taken.
276                                         '1' means manual control, '2' program normal, '3' aperture priority,
277                                         '4' shutter priority, '5' program creative (slow program),
278                                         '6' program action(high-speed program), '7' portrait mode,
279                                         '8' landscape mode */
280    HI_U32      u32FNumber;              /* The actual F-number (F-stop) of lens when the image was taken */
281    HI_U32      u32MaxApertureValue;     /* Maximum aperture value of lens. */
282    HI_U8       u8ExposureMode;          /* Indicates the exposure mode set when the image was shot.
283                                                   0 = Auto exposure,1 = Manual exposure, 2 = Auto bracket */
284    HI_U8       u8WhiteBalance;          /* Indicates the white balance mode set when the image was shot.
285                                                     0 = Auto white balance ,1 = Manual white balance */
286} ISP_DCF_UPDATE_INFO_S;
287
288typedef struct hiISP_DCF_INFO_S {
289    ISP_DCF_CONST_INFO_S  stIspDCFConstInfo;
290    ISP_DCF_UPDATE_INFO_S stIspDCFUpdateInfo;
291} ISP_DCF_INFO_S;
292
293typedef struct hiJPEG_DCF_S {
294    HI_U8     au8CaptureTime[DCF_CAPTURE_TIME_LENGTH];     /* The date and time when the picture data was generated */
295    HI_BOOL   bFlash;                                      /* whether the picture is captured when a flash lamp is on */
296    HI_U32    u32DigitalZoomRatio;                         /* Indicates the digital zoom ratio when the image was shot.
297                                                            If the numerator of the recorded value is 0, this indicates
298                                                            that digital zoom was not used. */
299    ISP_DCF_INFO_S  stIspDCFInfo;
300} JPEG_DCF_S;
301
302typedef struct hiISP_FRAME_INFO_S {
303    HI_U32      u32ISO;                    /* ISP internal ISO : Again*Dgain*ISPgain */
304    HI_U32      u32ExposureTime;           /* Exposure time (reciprocal of shutter speed),unit is us */
305    HI_U32      u32IspDgain;
306    HI_U32      u32Again;
307    HI_U32      u32Dgain;
308    HI_U32      au32Ratio[3];
309    HI_U32      u32IspNrStrength;
310    HI_U32      u32FNumber;                /* The actual F-number (F-stop) of lens when the image was taken */
311    HI_U32      u32SensorID;               /* which sensor is used */
312    HI_U32      u32SensorMode;
313    HI_U32      u32HmaxTimes;              /* Sensor HmaxTimes,unit is ns */
314    HI_U32      u32Vmax;                   /* Sensor Vmax,unit is line */
315    HI_U32      u32VcNum;                  /* when dump wdr frame, which is long or short  exposure frame. */
316} ISP_FRAME_INFO_S;
317
318#define CFACOLORPLANE     (3)
319#define DNG_NP_SIZE       (6)
320
321typedef struct hiDNG_RATIONAL_S {
322    HI_U32 u32Numerator;    /* represents the numerator of a fraction, */
323    HI_U32 u32Denominator;  /* the denominator. */
324} DNG_RATIONAL_S;
325
326/*
327Defines the structure of DNG image dynamic information
328*/
329typedef struct hiDNG_IMAGE_DYNAMIC_INFO_S {
330    HI_U32 au32BlackLevel[ISP_BAYER_CHN];           /* RO;Range: [0x0, 0xFFFF]; black level */
331    DNG_RATIONAL_S astAsShotNeutral[CFACOLORPLANE]; /* specifies the selected white balance at time of capture,
332                                                        encoded as the coordinates of a perfectly neutral color
333                                                        in linear reference space values. */
334    HI_DOUBLE adNoiseProfile[DNG_NP_SIZE];          /* RO;describes the amount of noise in a raw image */
335} DNG_IMAGE_DYNAMIC_INFO_S;
336
337typedef struct hiISP_HDR_INFO_S {
338    HI_U32 u32ColorTemp;
339    HI_U16 au16CCM[9];
340    HI_U8  u8Saturation;
341} ISP_HDR_INFO_S;
342
343typedef struct hiISP_ATTACH_INFO_S {
344    ISP_HDR_INFO_S     stIspHdr;
345    HI_U32 u32ISO;
346    HI_U32 u32InitISO;
347    HI_U8 u8SnsWDRMode;
348} ISP_ATTACH_INFO_S;
349
350typedef enum hiFRAME_FLAG_E {
351    FRAME_FLAG_SNAP_FLASH  = 0x1 << 0,
352    FRAME_FLAG_SNAP_CUR      = 0x1 << 1,
353    FRAME_FLAG_SNAP_REF       = 0x1 << 2,
354    FRAME_FLAG_SNAP_END      = 0x1 << 31,
355    FRAME_FLAG_BUTT
356} FRAME_FLAG_E;
357
358/* RGGB=4 */
359#define ISP_WB_GAIN_NUM         4
360/* 3*3=9 matrix */
361#define ISP_CAP_CCM_NUM         9
362typedef struct hiISP_CONFIG_INFO_S {
363    HI_U32 u32ISO;
364    HI_U32 u32IspDgain;
365    HI_U32 u32ExposureTime;
366    HI_U32 au32WhiteBalanceGain[ISP_WB_GAIN_NUM];
367    HI_U32 u32ColorTemperature;
368    HI_U16 au16CapCCM[ISP_CAP_CCM_NUM];
369} ISP_CONFIG_INFO_S;
370
371typedef struct hiVIDEO_SUPPLEMENT_S {
372    HI_U64   u64JpegDCFPhyAddr;
373    HI_U64   u64IspInfoPhyAddr;
374    HI_U64   u64LowDelayPhyAddr;
375    HI_U64   u64MotionDataPhyAddr;
376    HI_U64   u64FrameDNGPhyAddr;
377
378    HI_VOID *ATTRIBUTE pJpegDCFVirAddr;        /* JPEG_DCF_S, used in JPEG DCF */
379    HI_VOID *ATTRIBUTE pIspInfoVirAddr;        /* ISP_FRAME_INFO_S, used in ISP debug, when get raw and send raw */
380    HI_VOID *ATTRIBUTE pLowDelayVirAddr;       /* used in low delay */
381    HI_VOID *ATTRIBUTE pMotionDataVirAddr;     /* vpss 3dnr use: gme motion data, Filter motion data, gyro data. */
382    HI_VOID *ATTRIBUTE pFrameDNGVirAddr;
383} VIDEO_SUPPLEMENT_S;
384
385typedef enum hiCOLOR_GAMUT_E {
386    COLOR_GAMUT_BT601 = 0,
387    COLOR_GAMUT_BT709,
388    COLOR_GAMUT_BT2020, /* Only used for Hi3559AV100 */
389    COLOR_GAMUT_USER,
390    COLOR_GAMUT_BUTT
391} COLOR_GAMUT_E;
392
393typedef struct hiISP_COLORGAMMUT_INFO_S {
394    COLOR_GAMUT_E enColorGamut;
395} ISP_COLORGAMMUT_INFO_S;
396
397typedef enum hiDYNAMIC_RANGE_E {
398    DYNAMIC_RANGE_SDR8 = 0,
399    DYNAMIC_RANGE_SDR10,
400    DYNAMIC_RANGE_HDR10,
401    DYNAMIC_RANGE_HLG,
402    DYNAMIC_RANGE_SLF,
403    DYNAMIC_RANGE_XDR,
404    DYNAMIC_RANGE_BUTT
405} DYNAMIC_RANGE_E;
406
407typedef enum hiDATA_BITWIDTH_E {
408    DATA_BITWIDTH_8 = 0,
409    DATA_BITWIDTH_10,
410    DATA_BITWIDTH_12,
411    DATA_BITWIDTH_14,
412    DATA_BITWIDTH_16,
413    DATA_BITWIDTH_BUTT
414} DATA_BITWIDTH_E;
415
416typedef struct hiVIDEO_FRAME_S {
417    HI_U32              u32Width;
418    HI_U32              u32Height;
419    VIDEO_FIELD_E       enField;
420    PIXEL_FORMAT_E      enPixelFormat;
421    VIDEO_FORMAT_E      enVideoFormat;
422    COMPRESS_MODE_E     enCompressMode;
423    DYNAMIC_RANGE_E     enDynamicRange;
424    COLOR_GAMUT_E       enColorGamut;
425    HI_U32              u32HeaderStride[3];
426    HI_U32              u32Stride[3];
427    HI_U32              u32ExtStride[3];
428
429    HI_U64              u64HeaderPhyAddr[3];
430    HI_U64              u64HeaderVirAddr[3];
431    HI_U64              u64PhyAddr[3];
432    HI_U64              u64VirAddr[3];
433    HI_U64              u64ExtPhyAddr[3];
434    HI_U64              u64ExtVirAddr[3];
435
436    HI_S16              s16OffsetTop;        /* top offset of show area */
437    HI_S16              s16OffsetBottom;    /* bottom offset of show area */
438    HI_S16              s16OffsetLeft;        /* left offset of show area */
439    HI_S16              s16OffsetRight;        /* right offset of show area */
440
441    HI_U32              u32MaxLuminance;
442    HI_U32              u32MinLuminance;
443
444    HI_U32              u32TimeRef;
445    HI_U64              u64PTS;
446
447    HI_U64              u64PrivateData;
448    HI_U32              u32FrameFlag;     /* FRAME_FLAG_E, can be OR operation. */
449    VIDEO_SUPPLEMENT_S  stSupplement;
450} VIDEO_FRAME_S;
451
452typedef struct hiVIDEO_FRAME_INFO_S {
453    VIDEO_FRAME_S stVFrame;
454    HI_U32        u32PoolId;
455    MOD_ID_E      enModId;
456} VIDEO_FRAME_INFO_S;
457
458typedef struct hiVB_CAL_CONFIG_S {
459    HI_U32 u32VBSize;
460
461    HI_U32 u32HeadStride;
462    HI_U32 u32HeadSize;
463    HI_U32 u32HeadYSize;
464
465    HI_U32 u32MainStride;
466    HI_U32 u32MainSize;
467    HI_U32 u32MainYSize;
468
469    HI_U32 u32ExtStride;
470    HI_U32 u32ExtYSize;
471} VB_CAL_CONFIG_S;
472
473typedef struct hiBITMAP_S {
474    PIXEL_FORMAT_E enPixelFormat;  /* Bitmap's pixel format */
475    HI_U32 u32Width;               /* Bitmap's width */
476    HI_U32 u32Height;              /* Bitmap's height */
477    HI_VOID *ATTRIBUTE pData;      /* Address of Bitmap's data */
478} BITMAP_S;
479
480typedef struct hiLDC_ATTR_S {
481    HI_BOOL    bAspect;             /* RW;Range: [0, 1];Whether aspect ration  is keep */
482    HI_S32     s32XRatio;           /* RW; Range: [0, 100]; field angle ration of  horizontal,valid when bAspect=0. */
483    HI_S32     s32YRatio;           /* RW; Range: [0, 100]; field angle ration of  vertical,valid when bAspect=0. */
484    HI_S32     s32XYRatio;          /* RW; Range: [0, 100]; field angle ration of  all,valid when bAspect=1. */
485    HI_S32 s32CenterXOffset;        /* RW; Range: [-511, 511]; horizontal offset of the image distortion center
486                                     * relative to image center. */
487    HI_S32 s32CenterYOffset;        /* RW; Range: [-511, 511]; vertical offset of the image distortion center
488                                       relative to image center. */
489    HI_S32 s32DistortionRatio;      /* RW; Range: [-300, 500]; LDC Distortion ratio.When spread on, s32DistortionRatio
490                                       range should be [0, 500] */
491} LDC_ATTR_S;
492
493typedef struct hiLDCV2_ATTR_S {
494    HI_S32 s32FocalLenX;              /* RW; focal length in horizontal direction, with 2 decimal numbers */
495    HI_S32 s32FocalLenY;              /* RW; focal length in vertical direction, with 2 decimal numbers */
496    HI_S32 s32CoorShiftX;             /* RW; coordinate of image center, with 2 decimal numbers */
497    HI_S32 s32CoorShiftY;             /* RW; Y coordinate of image center, with 2 decimal numbers */
498    HI_S32 as32SrcCaliRatio[SRC_LENS_COEF_SEG][SRC_LENS_COEF_NUM];  /* RW; lens distortion coefficients of the source
499                                                                        image, with 5 decimal numbers */
500    HI_S32 s32SrcJunPt;                                             /* RW; Junction Point of the two segments */
501    HI_S32 as32DstCaliRatio[DST_LENS_COEF_SEG][DST_LENS_COEF_NUM];  /* RW; lens distortion coefficients, with 5 decimal
502                                                                        numbers */
503    HI_S32 as32DstJunPt[DST_LENS_COEF_SEG_POINT];                   /* RW; Junction Point of the three segments */
504    HI_S32 s32MaxDu;                                                /* RW; max undistorted distance before 3rd
505                                                                        polynomial drop, with 16bits decimal */
506} LDCV2_ATTR_S;
507
508typedef enum hiLDC_VIEW_TYPE_E {
509    LDC_VIEW_TYPE_ALL = 0,  /* View scale all but x and y independently, this will keep both x and y axis,
510                                but corner maybe lost */
511    LDC_VIEW_TYPE_CROP = 1,  /* Not use view scale, this will lost some side and corner */
512
513    LDC_VIEW_TYPE_BUTT,
514} LDC_VIEW_TYPE_E;
515
516typedef struct hiLDCV3_ATTR_S {
517    LDC_VIEW_TYPE_E enViewType; /* RW; Range: [0, 1], 0: all mode, 1: crop mode. */
518    HI_S32 s32CenterXOffset;    /* RW; Range: ABS(s32CenterXOffset)->[0, min(128, width*0.08)], horizontal offset of
519                                    the image distortion center relative to image center. */
520    HI_S32 s32CenterYOffset;    /* RW; Range: ABS(s32CenterXOffset)->[0, min(128, height*0.08)], vertical offset of
521                                    the image distortion center relative to image center. */
522    HI_S32 s32DistortionRatio;  /* RW; Range: [-300, 300], LDC Distortion ratio. */
523    HI_S32 s32MinRatio;         /* RW; Range: [-300, 300], to remove the black region around when performing
524                                    pinchusion distortion correction with crop mode. */
525} LDCV3_ATTR_S;
526
527typedef enum hiROTATION_VIEW_TYPE_E {
528    ROTATION_VIEW_TYPE_ALL      = 0, /* View all source Image,no lose */
529    ROTATION_VIEW_TYPE_TYPICAL  = 1, /* View from rotation Image with source size,same lose */
530    ROTATION_VIEW_TYPE_INSIDE   = 2, /* View with no black section,all  in dest Image */
531    ROTATION_VIEW_TYPE_BUTT,
532} ROTATION_VIEW_TYPE_E;
533
534typedef struct hiROTATION_EX_S {
535    ROTATION_VIEW_TYPE_E enViewType;       /* RW;Range: [0, 2];Rotation mode */
536    HI_U32               u32Angle;         /* RW;Range: [0,360];Rotation Angle:[0,360] */
537    HI_S32               s32CenterXOffset; /* RW;Range: [-511, 511];Horizontal offset of the image distortion center
538                                            relative to image center. */
539    HI_S32               s32CenterYOffset; /* RW;Range: [-511, 511];Vertical offset of the image distortion center
540                                            relative to image center. */
541    SIZE_S               stDestSize;       /* RW;Dest size of any angle rotation */
542} ROTATION_EX_S;
543
544typedef enum hiWDR_MODE_E {
545    WDR_MODE_NONE = 0,
546    WDR_MODE_BUILT_IN,
547    WDR_MODE_QUDRA,
548
549    WDR_MODE_2To1_LINE,
550    WDR_MODE_2To1_FRAME,
551    WDR_MODE_2To1_FRAME_FULL_RATE,
552
553    WDR_MODE_3To1_LINE,
554    WDR_MODE_3To1_FRAME,
555    WDR_MODE_3To1_FRAME_FULL_RATE,
556
557    WDR_MODE_4To1_LINE,
558    WDR_MODE_4To1_FRAME,
559    WDR_MODE_4To1_FRAME_FULL_RATE,
560
561    WDR_MODE_BUTT,
562} WDR_MODE_E;
563
564typedef enum hiFRAME_INTERRUPT_TYPE_E {
565    FRAME_INTERRUPT_START,
566    FRAME_INTERRUPT_EARLY,
567    FRAME_INTERRUPT_EARLY_END,
568    FRAME_INTERRUPT_EARLY_ONE_BUF,
569    FRAME_INTERRUPT_EARLY_END_ONE_BUF,
570    FRAME_INTERRUPT_BUTT,
571} FRAME_INTERRUPT_TYPE_E;
572
573typedef struct hiFRAME_INTERRUPT_ATTR_S {
574    FRAME_INTERRUPT_TYPE_E enIntType;
575    HI_U32 u32EarlyLine;
576} FRAME_INTERRUPT_ATTR_S;
577
578#ifdef __cplusplus
579#if __cplusplus
580}
581#endif
582#endif /* __cplusplus */
583
584#endif /* _HI_COMM_VIDEO_H_ */
585
586