1 /*
2  * Support for Intel Camera Imaging ISP subsystem.
3  * Copyright (c) 2015, Intel Corporation.
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms and conditions of the GNU General Public License,
7  * version 2, as published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
12  * more details.
13  */
14 
15 #ifndef __IA_CSS_SDIS2_HOST_H
16 #define __IA_CSS_SDIS2_HOST_H
17 
18 #include "ia_css_sdis2_types.h"
19 #include "ia_css_binary.h"
20 #include "ia_css_stream.h"
21 #include "sh_css_params.h"
22 
23 extern const struct ia_css_dvs2_coefficients default_sdis2_config;
24 
25 /* Opaque here, since size is binary dependent. */
26 struct sh_css_isp_sdis_hori_coef_tbl;
27 struct sh_css_isp_sdis_vert_coef_tbl;
28 struct sh_css_isp_sdis_hori_proj_tbl;
29 struct sh_css_isp_sdis_vert_proj_tbl;
30 
31 void ia_css_sdis2_horicoef_vmem_encode(
32     struct sh_css_isp_sdis_hori_coef_tbl *to,
33     const struct ia_css_dvs2_coefficients *from,
34     unsigned int size);
35 
36 void ia_css_sdis2_vertcoef_vmem_encode(
37     struct sh_css_isp_sdis_vert_coef_tbl *to,
38     const struct ia_css_dvs2_coefficients *from,
39     unsigned int size);
40 
41 void ia_css_sdis2_horiproj_encode(
42     struct sh_css_isp_sdis_hori_proj_tbl *to,
43     const struct ia_css_dvs2_coefficients *from,
44     unsigned int size);
45 
46 void ia_css_sdis2_vertproj_encode(
47     struct sh_css_isp_sdis_vert_proj_tbl *to,
48     const struct ia_css_dvs2_coefficients *from,
49     unsigned int size);
50 
51 void ia_css_get_isp_dvs2_coefficients(
52     struct ia_css_stream *stream,
53     short *hor_coefs_odd_real,
54     short *hor_coefs_odd_imag,
55     short *hor_coefs_even_real,
56     short *hor_coefs_even_imag,
57     short *ver_coefs_odd_real,
58     short *ver_coefs_odd_imag,
59     short *ver_coefs_even_real,
60     short *ver_coefs_even_imag);
61 
62 void ia_css_sdis2_clear_coefficients(
63     struct ia_css_dvs2_coefficients *dvs2_coefs);
64 
65 int
66 ia_css_get_dvs2_statistics(
67     struct ia_css_dvs2_statistics	       *host_stats,
68     const struct ia_css_isp_dvs_statistics *isp_stats);
69 
70 void
71 ia_css_translate_dvs2_statistics(
72     struct ia_css_dvs2_statistics              *host_stats,
73     const struct ia_css_isp_dvs_statistics_map *isp_stats);
74 
75 struct ia_css_isp_dvs_statistics *
76 ia_css_isp_dvs2_statistics_allocate(
77     const struct ia_css_dvs_grid_info *grid);
78 
79 void
80 ia_css_isp_dvs2_statistics_free(
81     struct ia_css_isp_dvs_statistics *me);
82 
83 void ia_css_sdis2_horicoef_debug_dtrace(
84     const struct ia_css_dvs2_coefficients *config, unsigned int level);
85 
86 void ia_css_sdis2_vertcoef_debug_dtrace(
87     const struct ia_css_dvs2_coefficients *config, unsigned int level);
88 
89 void ia_css_sdis2_horiproj_debug_dtrace(
90     const struct ia_css_dvs2_coefficients *config, unsigned int level);
91 
92 void ia_css_sdis2_vertproj_debug_dtrace(
93     const struct ia_css_dvs2_coefficients *config, unsigned int level);
94 
95 #endif /* __IA_CSS_SDIS2_HOST_H */
96