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