Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
libisp.h
Go to the documentation of this file.
1 #ifndef _LIBISP_H
2 #define _LIBISP_H
3 
4 #include "reg_avi.h"
6 
7 #define AVI_DEFINE_NODE(EXPANDER) \
8  EXPANDER(chain_bayer_inter) \
9  EXPANDER(vlformat_32to40) \
10  EXPANDER(pedestal) \
11  EXPANDER(green_imbalance) \
12  EXPANDER(green_imbalance_green_red_coeff_mem) \
13  EXPANDER(green_imbalance_green_blue_coeff_mem) \
14  EXPANDER(dead_pixel_correction) \
15  EXPANDER(dead_pixel_correction_list_mem) \
16  EXPANDER(denoising) \
17  EXPANDER(statistics_bayer) \
18  EXPANDER(lens_shading_correction) \
19  EXPANDER(lens_shading_correction_red_coeff_mem) \
20  EXPANDER(lens_shading_correction_green_coeff_mem) \
21  EXPANDER(lens_shading_correction_blue_coeff_mem) \
22  EXPANDER(chromatic_aberration) \
23  EXPANDER(bayer) \
24  EXPANDER(color_correction) \
25  EXPANDER(vlformat_40to32) \
26  EXPANDER(gamma_corrector) \
27  EXPANDER(gamma_corrector_ry_lut) \
28  EXPANDER(gamma_corrector_gu_lut) \
29  EXPANDER(gamma_corrector_bv_lut) \
30  EXPANDER(chroma) \
31  EXPANDER(statistics_yuv) \
32  EXPANDER(statistics_yuv_ae_histogram_y) \
33  EXPANDER(chain_yuv_inter) \
34  EXPANDER(edge_enhancement_color_reduction_filter) \
35  EXPANDER(edge_enhancement_color_reduction_filter_ee_lut) \
36  EXPANDER(i3d_lut) \
37  EXPANDER(i3d_lut_lut_outside) \
38  EXPANDER(i3d_lut_lut_inside) \
39  EXPANDER(drop)
40 
41 #define EXPAND_AS_ENUM(_node) \
42  _node,
43 
44 enum {
47 };
48 
49 /* ISP Context */
51  int devmem;
52  unsigned long avi_base;
53  unsigned offsets[ISP_NODE_NR];
54 };
55 
56 /* Configuration of ISP */
57 struct libisp_config {
74  /*struct avi_isp_chromatic_aberration_regs chromatic_aberration;*/
86  eecrf_lut;
88 };
89 
90 /* Output YUV statistics */
98 };
99 
100 extern int configure_isp(struct v4l2_device *dev);
101 extern int isp_get_statistics_yuv(struct isp_yuv_stats_t *yuv_stats);
102 extern int isp_request_statistics_yuv_window(uint16_t x_start, uint16_t x_end, uint16_t y_start, uint16_t y_end,
103  uint16_t x_odd_inc, uint16_t y_odd_inc);
104 
105 /* Registers access */
106 #define EXPAND_AS_PROTOTYPE(_node) \
107  void avi_isp_ ## _node ## _set_registers(struct libisp_context *, \
108  struct avi_isp_ ## _node ## _regs const *regs); \
109  void avi_isp_ ## _node ## _get_registers(struct libisp_context *, \
110  struct avi_isp_ ## _node ## _regs *regs);
111 
113 
114 #endif /* _LIBISP_H */
avi_isp_bayer_regs
Definition: avi_isp_bayer.h:48
libisp_context::avi_base
unsigned long avi_base
Definition: libisp.h:52
libisp_config::chain_yuv_inter
struct avi_isp_chain_yuv_inter_regs chain_yuv_inter
YUV chain bypass configuration (enable/disable features)
Definition: libisp.h:87
avi_isp_gamma_corrector_bv_lut_regs
Definition: avi_isp_gamma_corrector.h:78
uint16_t
unsigned short uint16_t
Definition: types.h:16
libisp_config::gc_ry_lut
struct avi_isp_gamma_corrector_ry_lut_regs gc_ry_lut
Gamma corrector RY lut.
Definition: libisp.h:79
avi_isp_chain_yuv_inter_regs
Definition: avi_isp_chain_yuv_inter.h:30
libisp_config::eecrf
struct avi_isp_edge_enhancement_color_reduction_filter_regs eecrf
Edge enhancement + Color reduction.
Definition: libisp.h:84
avi_isp_pedestal_regs
Definition: avi_isp_pedestal.h:68
libisp_config
Definition: libisp.h:57
isp_yuv_stats_t::awb_sum_U
uint32_t awb_sum_U
Definition: libisp.h:93
avi_isp_chroma_regs
Definition: avi_isp_chroma.h:148
isp_yuv_stats_t::nb_valid_Y
uint32_t nb_valid_Y
Definition: libisp.h:96
avi_isp_chain_bayer_inter_regs
Definition: avi_isp_chain_bayer_inter.h:35
avi_isp_green_imbalance_regs
Definition: avi_isp_green_imbalance.h:112
avi_isp_gamma_corrector_regs
Definition: avi_isp_gamma_corrector.h:30
uint32_t
unsigned long uint32_t
Definition: types.h:18
avi_isp_lens_shading_correction_green_coeff_mem_regs
Definition: avi_isp_lens_shading_correction.h:178
libisp_config::lsc_red_coeffs
struct avi_isp_lens_shading_correction_red_coeff_mem_regs lsc_red_coeffs
Lens shade correction red coefficients.
Definition: libisp.h:68
isp_yuv_stats_t::awb_nb_grey_pixels
uint32_t awb_nb_grey_pixels
Definition: libisp.h:95
libisp_config::statistics_bayer
struct avi_isp_statistics_bayer_regs statistics_bayer
Statistics bayer parameters.
Definition: libisp.h:66
avi_isp_vlformat_32to40_regs
Definition: avi_isp_vlformat_32to40.h:28
avi_isp_statistics_bayer_regs
Definition: avi_isp_statistics_bayer.h:146
avi_isp_statistics_yuv_regs
Definition: avi_isp_statistics_yuv.h:186
reg_avi.h
isp_yuv_stats_t::awb_sum_Y
uint32_t awb_sum_Y
Definition: libisp.h:92
libisp_config::color_correction
struct avi_isp_color_correction_regs color_correction
Color correction parameters.
Definition: libisp.h:76
ISP_NODE_NR
@ ISP_NODE_NR
Definition: libisp.h:46
dev
static const struct usb_device_descriptor dev
Definition: usb_ser_hw.c:74
avi_isp_denoising_regs
Definition: avi_isp_denoising.h:178
v4l2.h
libisp_config::gamma_corrector
struct avi_isp_gamma_corrector_regs gamma_corrector
Gamma corrector (Curves)
Definition: libisp.h:78
libisp_config::gc_bv_lut
struct avi_isp_gamma_corrector_bv_lut_regs gc_bv_lut
Gamma corrector BV lut.
Definition: libisp.h:81
EXPAND_AS_ENUM
#define EXPAND_AS_ENUM(_node)
Definition: libisp.h:41
isp_yuv_stats_t::awb_sum_V
uint32_t awb_sum_V
Definition: libisp.h:94
libisp_config::bayer
struct avi_isp_bayer_regs bayer
< Chromatic abberation (Disabled for now)
Definition: libisp.h:75
libisp_config::vlformat_32to40
struct avi_isp_vlformat_32to40_regs vlformat_32to40
Conversion factor (10bit to 10bit default)
Definition: libisp.h:58
avi_isp_edge_enhancement_color_reduction_filter_regs
Definition: avi_isp_edge_enhancement_color_reduction_filter.h:74
libisp_config::denoising
struct avi_isp_denoising_regs denoising
Denoising parameters.
Definition: libisp.h:65
libisp_config::chroma
struct avi_isp_chroma_regs chroma
Color space conversion.
Definition: libisp.h:82
configure_isp
int configure_isp(struct v4l2_device *dev)
Definition: libisp.c:177
libisp_config::bayer_inter
struct avi_isp_chain_bayer_inter_regs bayer_inter
Enable or disable bayer ISP functions by bypassing them.
Definition: libisp.h:59
libisp_config::grim_gr
struct avi_isp_green_imbalance_green_red_coeff_mem_regs grim_gr
Green imbalance GR coefficients.
Definition: libisp.h:62
libisp_config::vlformat_40to32
struct avi_isp_vlformat_40to32_regs vlformat_40to32
Conversion factor (10bit to 10bit default)
Definition: libisp.h:77
libisp_config::lens_shading_correction
struct avi_isp_lens_shading_correction_regs lens_shading_correction
Lens shade correction.
Definition: libisp.h:67
avi_isp_lens_shading_correction_blue_coeff_mem_regs
Definition: avi_isp_lens_shading_correction.h:194
libisp_config::gc_gu_lut
struct avi_isp_gamma_corrector_gu_lut_regs gc_gu_lut
Gamma corrector GU lut.
Definition: libisp.h:80
isp_yuv_stats_t
Definition: libisp.h:91
libisp_config::statistics_yuv
struct avi_isp_statistics_yuv_regs statistics_yuv
YUV statistics parameters.
Definition: libisp.h:83
libisp_config::pedestal
struct avi_isp_pedestal_regs pedestal
Pedestral parameters (substract from pixels)
Definition: libisp.h:60
libisp_context
Definition: libisp.h:50
avi_isp_green_imbalance_green_red_coeff_mem_regs
Definition: avi_isp_green_imbalance.h:136
libisp_config::eecrf_lut
struct avi_isp_edge_enhancement_color_reduction_filter_ee_lut_regs eecrf_lut
Edge enhancement + Color correction lut.
Definition: libisp.h:85
libisp_config::green_imbalance
struct avi_isp_green_imbalance_regs green_imbalance
Green imbalance correction.
Definition: libisp.h:61
EXPAND_AS_PROTOTYPE
#define EXPAND_AS_PROTOTYPE(_node)
Definition: libisp.h:106
avi_isp_dead_pixel_correction_regs
Definition: avi_isp_dead_pixel_correction.h:91
isp_yuv_stats_t::ae_histogram_Y
uint32_t ae_histogram_Y[256]
Definition: libisp.h:97
isp_get_statistics_yuv
int isp_get_statistics_yuv(struct isp_yuv_stats_t *yuv_stats)
Definition: libisp.c:261
libisp_config::lsc_blue_coeffs
struct avi_isp_lens_shading_correction_blue_coeff_mem_regs lsc_blue_coeffs
Lens shade correction blue coefficients.
Definition: libisp.h:72
AVI_DEFINE_NODE
#define AVI_DEFINE_NODE(EXPANDER)
Definition: libisp.h:7
avi_isp_color_correction_regs
Definition: avi_isp_color_correction.h:148
libisp_config::dead_pixel_correction
struct avi_isp_dead_pixel_correction_regs dead_pixel_correction
Dead pixel correction (disabled)
Definition: libisp.h:64
avi_isp_edge_enhancement_color_reduction_filter_ee_lut_regs
Definition: avi_isp_edge_enhancement_color_reduction_filter.h:28
v4l2_device
Definition: v4l2.h:50
isp_request_statistics_yuv_window
int isp_request_statistics_yuv_window(uint16_t x_start, uint16_t x_end, uint16_t y_start, uint16_t y_end, uint16_t x_odd_inc, uint16_t y_odd_inc)
Definition: libisp.c:214
avi_isp_gamma_corrector_ry_lut_regs
Definition: avi_isp_gamma_corrector.h:46
libisp_context::devmem
int devmem
Definition: libisp.h:51
avi_isp_vlformat_40to32_regs
Definition: avi_isp_vlformat_40to32.h:28
avi_isp_lens_shading_correction_red_coeff_mem_regs
Definition: avi_isp_lens_shading_correction.h:162
avi_isp_lens_shading_correction_regs
Definition: avi_isp_lens_shading_correction.h:136
libisp_config::lsc_green_coeffs
struct avi_isp_lens_shading_correction_green_coeff_mem_regs lsc_green_coeffs
Lens shade correction green coefficients.
Definition: libisp.h:70
avi_isp_green_imbalance_green_blue_coeff_mem_regs
Definition: avi_isp_green_imbalance.h:152
avi_isp_gamma_corrector_gu_lut_regs
Definition: avi_isp_gamma_corrector.h:62
libisp_config::grim_gb
struct avi_isp_green_imbalance_green_blue_coeff_mem_regs grim_gb
Green imbalance GB coefficients.
Definition: libisp.h:63