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 24 extern "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 36 typedef 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 */ 43 typedef 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 51 typedef 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 59 typedef 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 66 typedef 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 74 typedef struct hiPOINT_S { 75 HI_S32 s32X; 76 HI_S32 s32Y; 77 } POINT_S; 78 79 typedef struct hiSIZE_S { 80 HI_U32 u32Width; 81 HI_U32 u32Height; 82 } SIZE_S; 83 84 typedef struct hiRECT_S { 85 HI_S32 s32X; 86 HI_S32 s32Y; 87 HI_U32 u32Width; 88 HI_U32 u32Height; 89 } RECT_S; 90 91 typedef 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 96 typedef struct hiCROP_INFO_S { 97 HI_BOOL bEnable; 98 RECT_S stRect; 99 } CROP_INFO_S; 100 101 typedef 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 106 typedef 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 113 typedef 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! */ 120 typedef 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 194 typedef 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 203 typedef 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 211 typedef 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 221 typedef 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 228 typedef 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_DRSCRIPTION_LENGTH 32 238 #define DCF_CAPTURE_TIME_LENGTH 20 239 240 typedef struct hiISP_DCF_CONST_INFO_S { 241 HI_U8 au8ImageDescription[DCF_DRSCRIPTION_LENGTH]; /*Describes image*/ 242 HI_U8 au8Make[DCF_DRSCRIPTION_LENGTH]; /*Shows manufacturer of digital cameras*/ 243 HI_U8 au8Model[DCF_DRSCRIPTION_LENGTH]; /*Shows model number of digital cameras*/ 244 HI_U8 au8Software[DCF_DRSCRIPTION_LENGTH]; /*Shows firmware (internal software of digital cameras) version number*/ 245 246 HI_U8 u8LightSource; /* Light source, actually this means white balance setting. '0' means unknown, 247 '1' daylight, '2' fluorescent, '3' tungsten, '10' flash, '17' standard light A, 248 '18' standard light B, '19' standard light C, '20' D55, '21' D65, '22' D75, 249 '255' other */ 250 HI_U32 u32FocalLength; /* Focal length of lens used to take image. Unit is millimeter */ 251 HI_U8 u8SceneType; /* Indicates the type of scene. Value '0x01' 252 means that the image was directly photographed. */ 253 HI_U8 u8CustomRendered; /* Indicates the use of special processing on image data, such as rendering 254 geared to output. 0 = Normal process 1 = Custom process */ 255 HI_U8 u8FocalLengthIn35mmFilm; /* Indicates the equivalent focal length assuming a 35mm film camera, in mm */ 256 HI_U8 u8SceneCaptureType; /* Indicates the type of scene that was shot. 0 = Standard, 1 = Landscape, 257 2 = Portrait,3 = Night scene. */ 258 HI_U8 u8GainControl; /* Indicates the degree of overall image gain adjustment. 0 = None, 1 = Low gain up, 259 2 = High gain up,3 = Low gain down,4 = High gain down. */ 260 HI_U8 u8Contrast; /* Indicates the direction of contrast processing applied by the camera when the image 261 was shot. 0 = Normal,1 = Soft,2 = Hard */ 262 HI_U8 u8Saturation; /* Indicates the direction of saturation processing applied by the camera when the image 263 was shot. 0 = Normal,1 = Low saturation,2 = High saturation */ 264 HI_U8 u8Sharpness; /* Indicates the direction of sharpness processing applied by the camera when the image 265 was shot. 0 = Normal,1 = Soft,2 = Hard . */ 266 HI_U8 u8MeteringMode; /* Exposure metering method. '0' means unknown, '1' average, '2' center weighted 267 average, '3' spot, '4' multi-spot, '5' multi-segment, '6' partial, '255' other */ 268 } ISP_DCF_CONST_INFO_S; 269 270 typedef struct hiISP_DCF_UPDATE_INFO_S { 271 HI_U32 u32ISOSpeedRatings; /* CCD sensitivity equivalent to Ag-Hr film speedrate */ 272 HI_U32 u32ExposureTime; /* Exposure time (reciprocal of shutter speed). */ 273 HI_U32 u32ExposureBiasValue; /* Exposure bias (compensation) value of taking picture */ 274 HI_U8 u8ExposureProgram; /* Exposure program that the camera used when image was taken. 275 '1' means manual control, '2' program normal, '3' aperture priority, 276 '4' shutter priority, '5' program creative (slow program), 277 '6' program action(high-speed program), '7' portrait mode, 278 '8' landscape mode */ 279 HI_U32 u32FNumber; /* The actual F-number (F-stop) of lens when the image was taken */ 280 HI_U32 u32MaxApertureValue; /* Maximum aperture value of lens. */ 281 HI_U8 u8ExposureMode; /* Indicates the exposure mode set when the image was shot. 282 0 = Auto exposure,1 = Manual exposure, 2 = Auto bracket */ 283 HI_U8 u8WhiteBalance; /* Indicates the white balance mode set when the image was shot. 284 0 = Auto white balance ,1 = Manual white balance */ 285 } ISP_DCF_UPDATE_INFO_S; 286 287 typedef struct hiISP_DCF_INFO_S { 288 ISP_DCF_CONST_INFO_S stIspDCFConstInfo; 289 ISP_DCF_UPDATE_INFO_S stIspDCFUpdateInfo; 290 } ISP_DCF_INFO_S; 291 292 typedef struct hiJPEG_DCF_S { 293 HI_U8 au8CaptureTime[DCF_CAPTURE_TIME_LENGTH]; /* The date and time when the picture data was generated */ 294 HI_BOOL bFlash; /* whether the picture is captured when a flash lamp is on */ 295 HI_U32 u32DigitalZoomRatio; /* Indicates the digital zoom ratio when the image was shot. 296 If the numerator of the recorded value is 0, this indicates 297 that digital zoom was not used. */ 298 ISP_DCF_INFO_S stIspDCFInfo; 299 } JPEG_DCF_S; 300 301 typedef struct hiISP_FRAME_INFO_S { 302 HI_U32 u32ISO; /* ISP internal ISO : Again*Dgain*ISPgain */ 303 HI_U32 u32ExposureTime; /* Exposure time (reciprocal of shutter speed),unit is us */ 304 HI_U32 u32IspDgain; 305 HI_U32 u32Again; 306 HI_U32 u32Dgain; 307 HI_U32 au32Ratio[3]; 308 HI_U32 u32IspNrStrength; 309 HI_U32 u32FNumber; /* The actual F-number (F-stop) of lens when the image was taken */ 310 HI_U32 u32SensorID; /* which sensor is used */ 311 HI_U32 u32SensorMode; 312 HI_U32 u32HmaxTimes; /* Sensor HmaxTimes,unit is ns */ 313 HI_U32 u32Vmax; /* Sensor Vmax,unit is line */ 314 HI_U32 u32VcNum; /* when dump wdr frame, which is long or short exposure frame. */ 315 } ISP_FRAME_INFO_S; 316 317 #define CFACOLORPLANE (3) 318 #define DNG_NP_SIZE (6) 319 320 typedef struct hiDNG_RATIONAL_S { 321 HI_U32 u32Numerator; /* represents the numerator of a fraction, */ 322 HI_U32 u32Denominator; /* the denominator. */ 323 } DNG_RATIONAL_S; 324 325 /* 326 Defines the structure of DNG image dynamic information 327 */ 328 typedef struct hiDNG_IMAGE_DYNAMIC_INFO_S { 329 HI_U32 au32BlackLevel[ISP_BAYER_CHN]; /* RO;Range: [0x0, 0xFFFF]; black level */ 330 DNG_RATIONAL_S astAsShotNeutral[CFACOLORPLANE]; /* specifies the selected white balance at time of capture, 331 encoded as the coordinates of a perfectly neutral color 332 in linear reference space values. */ 333 HI_DOUBLE adNoiseProfile[DNG_NP_SIZE]; /* RO;describes the amount of noise in a raw image */ 334 } DNG_IMAGE_DYNAMIC_INFO_S; 335 336 typedef struct hiISP_HDR_INFO_S { 337 HI_U32 u32ColorTemp; 338 HI_U16 au16CCM[9]; 339 HI_U8 u8Saturation; 340 } ISP_HDR_INFO_S; 341 342 typedef struct hiISP_ATTACH_INFO_S { 343 ISP_HDR_INFO_S stIspHdr; 344 HI_U32 u32ISO; 345 HI_U32 u32InitISO; 346 HI_U8 u8SnsWDRMode; 347 } ISP_ATTACH_INFO_S; 348 349 typedef enum hiFRAME_FLAG_E { 350 FRAME_FLAG_SNAP_FLASH = 0x1 << 0, 351 FRAME_FLAG_SNAP_CUR = 0x1 << 1, 352 FRAME_FLAG_SNAP_REF = 0x1 << 2, 353 FRAME_FLAG_SNAP_END = 0x1 << 31, 354 FRAME_FLAG_BUTT 355 } FRAME_FLAG_E; 356 357 /* RGGB=4 */ 358 #define ISP_WB_GAIN_NUM 4 359 /* 3*3=9 matrix */ 360 #define ISP_CAP_CCM_NUM 9 361 typedef struct hiISP_CONFIG_INFO_S { 362 HI_U32 u32ISO; 363 HI_U32 u32IspDgain; 364 HI_U32 u32ExposureTime; 365 HI_U32 au32WhiteBalanceGain[ISP_WB_GAIN_NUM]; 366 HI_U32 u32ColorTemperature; 367 HI_U16 au16CapCCM[ISP_CAP_CCM_NUM]; 368 } ISP_CONFIG_INFO_S; 369 370 typedef struct hiVIDEO_SUPPLEMENT_S { 371 HI_U64 u64JpegDCFPhyAddr; 372 HI_U64 u64IspInfoPhyAddr; 373 HI_U64 u64LowDelayPhyAddr; 374 HI_U64 u64MotionDataPhyAddr; 375 HI_U64 u64FrameDNGPhyAddr; 376 377 HI_VOID *ATTRIBUTE pJpegDCFVirAddr; /* JPEG_DCF_S, used in JPEG DCF */ 378 HI_VOID *ATTRIBUTE pIspInfoVirAddr; /* ISP_FRAME_INFO_S, used in ISP debug, when get raw and send raw */ 379 HI_VOID *ATTRIBUTE pLowDelayVirAddr; /* used in low delay */ 380 HI_VOID *ATTRIBUTE pMotionDataVirAddr; /* vpss 3dnr use: gme motion data, Filter motion data, gyro data. */ 381 HI_VOID *ATTRIBUTE pFrameDNGVirAddr; 382 } VIDEO_SUPPLEMENT_S; 383 384 typedef enum hiCOLOR_GAMUT_E { 385 COLOR_GAMUT_BT601 = 0, 386 COLOR_GAMUT_BT709, 387 COLOR_GAMUT_BT2020, /* Only used for Hi3559AV100 */ 388 COLOR_GAMUT_USER, 389 COLOR_GAMUT_BUTT 390 } COLOR_GAMUT_E; 391 392 typedef struct hiISP_COLORGAMMUT_INFO_S { 393 COLOR_GAMUT_E enColorGamut; 394 } ISP_COLORGAMMUT_INFO_S; 395 396 typedef enum hiDYNAMIC_RANGE_E { 397 DYNAMIC_RANGE_SDR8 = 0, 398 DYNAMIC_RANGE_SDR10, 399 DYNAMIC_RANGE_HDR10, 400 DYNAMIC_RANGE_HLG, 401 DYNAMIC_RANGE_SLF, 402 DYNAMIC_RANGE_XDR, 403 DYNAMIC_RANGE_BUTT 404 } DYNAMIC_RANGE_E; 405 406 typedef enum hiDATA_BITWIDTH_E { 407 DATA_BITWIDTH_8 = 0, 408 DATA_BITWIDTH_10, 409 DATA_BITWIDTH_12, 410 DATA_BITWIDTH_14, 411 DATA_BITWIDTH_16, 412 DATA_BITWIDTH_BUTT 413 } DATA_BITWIDTH_E; 414 415 typedef struct hiVIDEO_FRAME_S { 416 HI_U32 u32Width; 417 HI_U32 u32Height; 418 VIDEO_FIELD_E enField; 419 PIXEL_FORMAT_E enPixelFormat; 420 VIDEO_FORMAT_E enVideoFormat; 421 COMPRESS_MODE_E enCompressMode; 422 DYNAMIC_RANGE_E enDynamicRange; 423 COLOR_GAMUT_E enColorGamut; 424 HI_U32 u32HeaderStride[3]; 425 HI_U32 u32Stride[3]; 426 HI_U32 u32ExtStride[3]; 427 428 HI_U64 u64HeaderPhyAddr[3]; 429 HI_U64 u64HeaderVirAddr[3]; 430 HI_U64 u64PhyAddr[3]; 431 HI_U64 u64VirAddr[3]; 432 HI_U64 u64ExtPhyAddr[3]; 433 HI_U64 u64ExtVirAddr[3]; 434 435 HI_S16 s16OffsetTop; /* top offset of show area */ 436 HI_S16 s16OffsetBottom; /* bottom offset of show area */ 437 HI_S16 s16OffsetLeft; /* left offset of show area */ 438 HI_S16 s16OffsetRight; /* right offset of show area */ 439 440 HI_U32 u32MaxLuminance; 441 HI_U32 u32MinLuminance; 442 443 HI_U32 u32TimeRef; 444 HI_U64 u64PTS; 445 446 HI_U64 u64PrivateData; 447 HI_U32 u32FrameFlag; /* FRAME_FLAG_E, can be OR operation. */ 448 VIDEO_SUPPLEMENT_S stSupplement; 449 } VIDEO_FRAME_S; 450 451 typedef struct hiVIDEO_FRAME_INFO_S { 452 VIDEO_FRAME_S stVFrame; 453 HI_U32 u32PoolId; 454 MOD_ID_E enModId; 455 } VIDEO_FRAME_INFO_S; 456 457 typedef struct hiVB_CAL_CONFIG_S { 458 HI_U32 u32VBSize; 459 460 HI_U32 u32HeadStride; 461 HI_U32 u32HeadSize; 462 HI_U32 u32HeadYSize; 463 464 HI_U32 u32MainStride; 465 HI_U32 u32MainSize; 466 HI_U32 u32MainYSize; 467 468 HI_U32 u32ExtStride; 469 HI_U32 u32ExtYSize; 470 } VB_CAL_CONFIG_S; 471 472 typedef struct hiBITMAP_S { 473 PIXEL_FORMAT_E enPixelFormat; /* Bitmap's pixel format */ 474 HI_U32 u32Width; /* Bitmap's width */ 475 HI_U32 u32Height; /* Bitmap's height */ 476 HI_VOID *ATTRIBUTE pData; /* Address of Bitmap's data */ 477 } BITMAP_S; 478 479 typedef struct hiLDC_ATTR_S { 480 HI_BOOL bAspect; /* RW;Range: [0, 1];Whether aspect ration is keep */ 481 HI_S32 s32XRatio; /* RW; Range: [0, 100]; field angle ration of horizontal,valid when bAspect=0. */ 482 HI_S32 s32YRatio; /* RW; Range: [0, 100]; field angle ration of vertical,valid when bAspect=0. */ 483 HI_S32 s32XYRatio; /* RW; Range: [0, 100]; field angle ration of all,valid when bAspect=1. */ 484 HI_S32 s32CenterXOffset; /* RW; Range: [-511, 511]; horizontal offset of the image distortion center 485 * relative to image center. */ 486 HI_S32 s32CenterYOffset; /* RW; Range: [-511, 511]; vertical offset of the image distortion center 487 relative to image center. */ 488 HI_S32 s32DistortionRatio; /* RW; Range: [-300, 500]; LDC Distortion ratio.When spread on, s32DistortionRatio 489 range should be [0, 500] */ 490 } LDC_ATTR_S; 491 492 typedef struct hiLDCV2_ATTR_S { 493 HI_S32 s32FocalLenX; /* RW; focal length in horizontal direction, with 2 decimal numbers */ 494 HI_S32 s32FocalLenY; /* RW; focal length in vertical direction, with 2 decimal numbers */ 495 HI_S32 s32CoorShiftX; /* RW; coordinate of image center, with 2 decimal numbers */ 496 HI_S32 s32CoorShiftY; /* RW; Y coordinate of image center, with 2 decimal numbers */ 497 HI_S32 as32SrcCaliRatio[SRC_LENS_COEF_SEG][SRC_LENS_COEF_NUM]; /* RW; lens distortion coefficients of the source 498 image, with 5 decimal numbers */ 499 HI_S32 s32SrcJunPt; /* RW; Junction Point of the two segments */ 500 HI_S32 as32DstCaliRatio[DST_LENS_COEF_SEG][DST_LENS_COEF_NUM]; /* RW; lens distortion coefficients, with 5 decimal 501 numbers */ 502 HI_S32 as32DstJunPt[DST_LENS_COEF_SEG_POINT]; /* RW; Junction Point of the three segments */ 503 HI_S32 s32MaxDu; /* RW; max undistorted distance before 3rd 504 polynomial drop, with 16bits decimal */ 505 } LDCV2_ATTR_S; 506 507 typedef enum hiLDC_VIEW_TYPE_E { 508 LDC_VIEW_TYPE_ALL = 0, /* View scale all but x and y independently, this will keep both x and y axis, 509 but corner maybe lost */ 510 LDC_VIEW_TYPE_CROP = 1, /* Not use view scale, this will lost some side and corner */ 511 512 LDC_VIEW_TYPE_BUTT, 513 } LDC_VIEW_TYPE_E; 514 515 typedef struct hiLDCV3_ATTR_S { 516 LDC_VIEW_TYPE_E enViewType; /* RW; Range: [0, 1], 0: all mode, 1: crop mode. */ 517 HI_S32 s32CenterXOffset; /* RW; Range: ABS(s32CenterXOffset)->[0, min(128, width*0.08)], horizontal offset of 518 the image distortion center relative to image center. */ 519 HI_S32 s32CenterYOffset; /* RW; Range: ABS(s32CenterXOffset)->[0, min(128, height*0.08)], vertical offset of 520 the image distortion center relative to image center. */ 521 HI_S32 s32DistortionRatio; /* RW; Range: [-300, 300], LDC Distortion ratio. */ 522 HI_S32 s32MinRatio; /* RW; Range: [-300, 300], to remove the black region around when performing 523 pinchusion distortion correction with crop mode. */ 524 } LDCV3_ATTR_S; 525 526 typedef enum hiROTATION_VIEW_TYPE_E { 527 ROTATION_VIEW_TYPE_ALL = 0, /* View all source Image,no lose */ 528 ROTATION_VIEW_TYPE_TYPICAL = 1, /* View from rotation Image with source size,same lose */ 529 ROTATION_VIEW_TYPE_INSIDE = 2, /* View with no black section,all in dest Image */ 530 ROTATION_VIEW_TYPE_BUTT, 531 } ROTATION_VIEW_TYPE_E; 532 533 typedef struct hiROTATION_EX_S { 534 ROTATION_VIEW_TYPE_E enViewType; /* RW;Range: [0, 2];Rotation mode */ 535 HI_U32 u32Angle; /* RW;Range: [0,360];Rotation Angle:[0,360] */ 536 HI_S32 s32CenterXOffset; /* RW;Range: [-511, 511];Horizontal offset of the image distortion center 537 relative to image center. */ 538 HI_S32 s32CenterYOffset; /* RW;Range: [-511, 511];Vertical offset of the image distortion center 539 relative to image center. */ 540 SIZE_S stDestSize; /* RW;Dest size of any angle rotation */ 541 } ROTATION_EX_S; 542 543 typedef enum hiWDR_MODE_E { 544 WDR_MODE_NONE = 0, 545 WDR_MODE_BUILT_IN, 546 WDR_MODE_QUDRA, 547 548 WDR_MODE_2To1_LINE, 549 WDR_MODE_2To1_FRAME, 550 WDR_MODE_2To1_FRAME_FULL_RATE, 551 552 WDR_MODE_3To1_LINE, 553 WDR_MODE_3To1_FRAME, 554 WDR_MODE_3To1_FRAME_FULL_RATE, 555 556 WDR_MODE_4To1_LINE, 557 WDR_MODE_4To1_FRAME, 558 WDR_MODE_4To1_FRAME_FULL_RATE, 559 560 WDR_MODE_BUTT, 561 } WDR_MODE_E; 562 563 typedef enum hiFRAME_INTERRUPT_TYPE_E { 564 FRAME_INTERRUPT_START, 565 FRAME_INTERRUPT_EARLY, 566 FRAME_INTERRUPT_EARLY_END, 567 FRAME_INTERRUPT_EARLY_ONE_BUF, 568 FRAME_INTERRUPT_EARLY_END_ONE_BUF, 569 FRAME_INTERRUPT_BUTT, 570 } FRAME_INTERRUPT_TYPE_E; 571 572 typedef struct hiFRAME_INTERRUPT_ATTR_S { 573 FRAME_INTERRUPT_TYPE_E enIntType; 574 HI_U32 u32EarlyLine; 575 } FRAME_INTERRUPT_ATTR_S; 576 577 #ifdef __cplusplus 578 #if __cplusplus 579 } 580 #endif 581 #endif /* __cplusplus */ 582 583 #endif /* _HI_COMM_VIDEO_H_ */ 584 585