1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Support for Intel Camera Imaging ISP subsystem.
4  * Copyright (c) 2015, Intel Corporation.
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms and conditions of the GNU General Public License,
8  * version 2, as published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
13  * more details.
14  */
15 
16 #ifndef __IA_CSS_SDIS2_TYPES_H
17 #define __IA_CSS_SDIS2_TYPES_H
18 
19 /* @file
20 * CSS-API header file for DVS statistics parameters.
21 */
22 
23 /* Number of DVS coefficient types */
24 #define IA_CSS_DVS2_NUM_COEF_TYPES     4
25 
26 #ifndef PIPE_GENERATION
27 #include "isp/kernels/sdis/common/ia_css_sdis_common_types.h"
28 #endif
29 
30 /* DVS 2.0 Coefficient types. This structure contains 4 pointers to
31  *  arrays that contain the coeffients for each type.
32  */
33 struct ia_css_dvs2_coef_types {
34 	s16 *odd_real; /** real part of the odd coefficients*/
35 	s16 *odd_imag; /** imaginary part of the odd coefficients*/
36 	s16 *even_real;/** real part of the even coefficients*/
37 	s16 *even_imag;/** imaginary part of the even coefficients*/
38 };
39 
40 /* DVS 2.0 Coefficients. This structure describes the coefficients that are needed for the dvs statistics.
41  *  e.g. hor_coefs.odd_real is the pointer to int16_t[grid.num_hor_coefs] containing the horizontal odd real
42  *  coefficients.
43  */
44 struct ia_css_dvs2_coefficients {
45 	struct ia_css_dvs_grid_info
46 		grid;        /** grid info contains the dimensions of the dvs grid */
47 	struct ia_css_dvs2_coef_types
48 		hor_coefs; /** struct with pointers that contain the horizontal coefficients */
49 	struct ia_css_dvs2_coef_types
50 		ver_coefs; /** struct with pointers that contain the vertical coefficients */
51 };
52 
53 /* DVS 2.0 Statistic types. This structure contains 4 pointers to
54  *  arrays that contain the statistics for each type.
55  */
56 struct ia_css_dvs2_stat_types {
57 	s32 *odd_real; /** real part of the odd statistics*/
58 	s32 *odd_imag; /** imaginary part of the odd statistics*/
59 	s32 *even_real;/** real part of the even statistics*/
60 	s32 *even_imag;/** imaginary part of the even statistics*/
61 };
62 
63 /* DVS 2.0 Statistics. This structure describes the statistics that are generated using the provided coefficients.
64  *  e.g. hor_prod.odd_real is the pointer to int16_t[grid.aligned_height][grid.aligned_width] containing
65  *  the horizontal odd real statistics. Valid statistics data area is int16_t[0..grid.height-1][0..grid.width-1]
66  */
67 struct ia_css_dvs2_statistics {
68 	struct ia_css_dvs_grid_info
69 		grid;       /** grid info contains the dimensions of the dvs grid */
70 	struct ia_css_dvs2_stat_types
71 		hor_prod; /** struct with pointers that contain the horizontal statistics */
72 	struct ia_css_dvs2_stat_types
73 		ver_prod; /** struct with pointers that contain the vertical statistics */
74 };
75 
76 #endif /* __IA_CSS_SDIS2_TYPES_H */
77