You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
213 lines
5.6 KiB
213 lines
5.6 KiB
#ifndef IMG_3A_STATiSTIC_H |
|
#define IMG_3A_STATiSTIC_H |
|
#include "datatype.h" |
|
//#include "AmbaDataType.h" |
|
|
|
#define AMBA_IK_CFA_HISTO_COUNT (64UL) |
|
#define AMBA_IK_RGB_HISTO_COUNT (64UL) |
|
#define AMBA_IK_HDR_HISTO_COUNT (128UL) |
|
|
|
#define AMBA_IK_3A_AWB_TILE_COLUMN_COUNT 32UL |
|
#define AMBA_IK_3A_AWB_TILE_ROW_COUNT 32UL |
|
|
|
#define AMBA_IK_3A_AE_TILE_COLUMN_COUNT 12UL |
|
#define AMBA_IK_3A_AE_TILE_ROW_COUNT 8UL |
|
|
|
#define AMBA_IK_3A_AF_TILE_COLUMN_COUNT 12UL |
|
#define AMBA_IK_3A_AF_TILE_ROW_COUNT 8UL |
|
|
|
#define AMBA_IK_3A_SLICE_MAX_COUNT 4UL |
|
|
|
|
|
typedef struct { |
|
//awb |
|
uint16 awb_tile_col_start; |
|
uint16 awb_tile_row_start; |
|
uint16 awb_tile_width; |
|
uint16 awb_tile_height; |
|
uint16 awb_tile_active_width; |
|
uint16 awb_tile_active_height; |
|
uint16 awb_rgb_shift; |
|
uint16 awb_y_shift; |
|
uint16 awb_min_max_shift; |
|
|
|
//ae |
|
uint16 ae_tile_col_start; |
|
uint16 ae_tile_row_start; |
|
uint16 ae_tile_width; |
|
uint16 ae_tile_height; |
|
uint16 ae_y_shift; |
|
uint16 ae_linear_y_shift; |
|
uint16 ae_min_max_shift; |
|
|
|
//af |
|
uint16 af_tile_col_start; |
|
uint16 af_tile_row_start; |
|
uint16 af_tile_width; |
|
uint16 af_tile_height; |
|
uint16 af_tile_active_width; |
|
uint16 af_tile_active_height; |
|
uint16 af_y_shift; |
|
uint16 af_cfa_y_shift; |
|
|
|
// AWB tiles |
|
uint8 awb_tile_num_col; |
|
uint8 awb_tile_num_row; |
|
// AE tiles |
|
uint8 ae_tile_num_col; |
|
uint8 ae_tile_num_row; |
|
// AF tiles |
|
uint8 af_tile_num_col; |
|
uint8 af_tile_num_row; |
|
|
|
// Strip info |
|
uint8 total_slices_x; |
|
uint8 total_slices_y; |
|
uint8 slice_index_x; |
|
uint8 slice_index_y; |
|
uint16 slice_width; |
|
uint16 slice_height; |
|
uint16 slice_start_x; |
|
uint16 slice_start_y; |
|
|
|
// Exposure |
|
uint16 exposure_index; |
|
uint16 total_exposures; |
|
|
|
// Black levels |
|
uint16 black_red; |
|
uint16 black_green; |
|
uint16 black_blue; |
|
|
|
uint32 raw_pic_seq_num; // sequence number of raw picture used in producing this block of AAA results |
|
uint32 iso_config_tag; |
|
|
|
uint32 is_rgbir_aaa : 1; |
|
uint32 chan_index : 3; |
|
uint32 reserved : 28; |
|
uint32 reserved1[10]; // max 128 bytes |
|
}__attribute__((packed)) ik_3a_header_t; |
|
|
|
// cfa awb |
|
typedef struct { |
|
uint16 sum_r; |
|
uint16 sum_g; |
|
uint16 sum_b; |
|
uint16 count_min; |
|
uint16 count_max; |
|
} __attribute__((packed)) ik_cfa_awb_t; |
|
// cfa ae |
|
typedef struct { |
|
uint16 lin_y; |
|
uint16 count_min; |
|
uint16 count_max; |
|
} __attribute__((packed)) ik_cfa_ae_t; |
|
// cfa af |
|
typedef struct { |
|
uint16 sum_y; |
|
uint16 sum_fv1; |
|
uint16 sum_fv2; |
|
} __attribute__((packed)) ik_cfa_af_t; |
|
//cfa histogram |
|
typedef struct { |
|
uint32 his_bin_r[AMBA_IK_CFA_HISTO_COUNT]; |
|
uint32 his_bin_g[AMBA_IK_CFA_HISTO_COUNT]; |
|
uint32 his_bin_b[AMBA_IK_CFA_HISTO_COUNT]; |
|
uint32 his_bin_y[AMBA_IK_CFA_HISTO_COUNT]; |
|
} __attribute__((packed)) ik_cfa_histo_t; |
|
|
|
typedef struct { |
|
uint16 sum_y; |
|
uint16 sum_fv1; |
|
uint16 sum_fv2; |
|
} __attribute__((packed)) ik_pg_af_t; |
|
|
|
// rgb ae |
|
typedef struct { |
|
uint16 sum_y; |
|
} __attribute__((packed)) ik_pg_ae_t; |
|
|
|
// rgb histo |
|
typedef struct { |
|
uint32 his_bin_y[AMBA_IK_RGB_HISTO_COUNT]; |
|
uint32 his_bin_r[AMBA_IK_RGB_HISTO_COUNT]; |
|
uint32 his_bin_g[AMBA_IK_RGB_HISTO_COUNT]; |
|
uint32 his_bin_b[AMBA_IK_RGB_HISTO_COUNT]; |
|
} __attribute__((packed)) ik_pg_histo_t; |
|
|
|
//cfa_aaa_stat_t |
|
typedef struct { |
|
ik_3a_header_t header; |
|
uint16 frame_id; |
|
ik_cfa_awb_t awb[AMBA_IK_3A_AWB_TILE_ROW_COUNT * AMBA_IK_3A_AWB_TILE_COLUMN_COUNT]; |
|
ik_cfa_ae_t ae[AMBA_IK_3A_AE_TILE_ROW_COUNT * AMBA_IK_3A_AE_TILE_COLUMN_COUNT]; |
|
ik_cfa_af_t af[AMBA_IK_3A_AF_TILE_ROW_COUNT * AMBA_IK_3A_AF_TILE_COLUMN_COUNT]; |
|
ik_cfa_histo_t histogram; |
|
} __attribute__((packed)) ik_cfa_3a_data_t; |
|
|
|
//pg_aaa_stat_t |
|
typedef struct { |
|
ik_3a_header_t header; |
|
uint16 frame_id; |
|
ik_pg_af_t af[AMBA_IK_3A_AF_TILE_ROW_COUNT * AMBA_IK_3A_AF_TILE_COLUMN_COUNT]; |
|
ik_pg_ae_t ae[AMBA_IK_3A_AE_TILE_ROW_COUNT * AMBA_IK_3A_AE_TILE_COLUMN_COUNT]; |
|
ik_pg_histo_t histogram; |
|
} __attribute__((packed)) ik_pg_3a_data_t; |
|
|
|
typedef struct { |
|
uint8 vin_stats_type; // 0: main; 1: hdr |
|
uint8 chan_index : 3; |
|
uint8 is_rgbir : 1; |
|
uint8 reserved_0 : 4; |
|
uint8 total_exposures; |
|
uint8 blend_index; // exposure no. |
|
|
|
uint8 total_slice_in_x; |
|
uint8 slice_index_x; |
|
uint8 total_slice_in_y; |
|
uint8 slice_index_y; |
|
|
|
uint16 vin_stats_slice_left; |
|
uint16 vin_stats_slice_width; |
|
|
|
uint16 vin_stats_slice_top; |
|
uint16 vin_stats_slice_height; |
|
|
|
uint32 reserved[24]; |
|
|
|
//NOTE: expanded by ARM to support PTS |
|
uint64 mono_pts; |
|
uint32 dsp_pts; |
|
uint32 reserved2; // max 128 bytes |
|
} __attribute__((packed)) ik_cfa_histo_cfg_info_t; |
|
|
|
typedef struct { |
|
uint32 histo_bin_r[AMBA_IK_HDR_HISTO_COUNT]; |
|
uint32 histo_bin_g[AMBA_IK_HDR_HISTO_COUNT]; |
|
uint32 histo_bin_b[AMBA_IK_HDR_HISTO_COUNT]; |
|
} __attribute__((packed)) ik_cfa_histogram_t; |
|
|
|
typedef struct { |
|
ik_cfa_histo_cfg_info_t cfg_info; |
|
ik_cfa_histogram_t cfa_hist; /* Address of histogram statistic DSP_IMG_HDR_HIST_STAT_s */ |
|
} __attribute__((packed)) ik_cfa_histogram_stat_t; |
|
|
|
|
|
typedef enum { |
|
DSP_3A_VIDEO = 0x00, |
|
DSP_3A_STILL, |
|
DSP_3A_DEC, |
|
} DSP_3A_TYPE_e; |
|
|
|
typedef struct { |
|
DSP_3A_TYPE_e Type; |
|
uint8 SrcSliceX; |
|
uint8 SrcSliceY; |
|
uint32 SrcAddr[AMBA_IK_3A_SLICE_MAX_COUNT]; |
|
uint32 SrcHistoAddr[AMBA_IK_3A_SLICE_MAX_COUNT]; |
|
uint32 DstAddr; |
|
uint16 ChannelIdx; |
|
} DSP_EVENT_3A_TRANSFER_s; |
|
|
|
|
|
#endif
|
|
|