• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2 *
3 * SPDX-License-Identifier: GPL-2.0
4 *
5 * Copyright (C) 2011-2018 ARM or its affiliates
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 *
18 */
19 
20 #if !defined( __SHARPENING_FSM_H__ )
21 #define __SHARPENING_FSM_H__
22 
23 
24 
25 typedef struct _sharpening_fsm_t sharpening_fsm_t;
26 typedef struct _sharpening_fsm_t *sharpening_fsm_ptr_t;
27 typedef const struct _sharpening_fsm_t *sharpening_fsm_const_ptr_t;
28 
29 #define AU_BLACK_HISTORY_SIZE 10
30 #define SHARP_LUT_SIZE 256
31 
32 void sharpening_initialize( sharpening_fsm_ptr_t p_fsm );
33 void sharpening_update( sharpening_fsm_ptr_t p_fsm );
34 #define AU_NORMALIZE_VALUE 10000000
35 
36 struct _sharpening_fsm_t {
37     fsm_common_t cmn;
38 
39     acamera_fsm_mgr_t *p_fsm_mgr;
40     fsm_irq_mask_t mask;
41     uint32_t sharpening_target;
42     uint32_t med_strength;
43     uint32_t sys_gain;
44     uint8_t min_strength;
45     uint8_t max_strength;
46     uint32_t sharpening_mult;
47     uint8_t api_value;
48     uint32_t black_val_hist[10];
49 
50     uint32_t fullhist_cum_sum[ISP_FULL_HISTOGRAM_SIZE];
51 };
52 
53 struct sharpen_ext_param_t {
54     uint32_t gain;
55     uint32_t alpha_undershoot;
56     uint32_t luma_thresh_low;
57     uint32_t luma_slope_low;
58     uint32_t luma_thresh_high;
59     uint32_t luma_slope_high;
60 };
61 
62 struct demosaic_rgb_ext_param_t {
63     uint32_t gain;
64     uint32_t lum_thresh;
65     uint32_t sad_amp;
66     uint32_t uu_sh_slope;
67     uint32_t uu_sh_thresh;
68     uint32_t luma_thresh_low_d;
69     uint32_t luma_thresh_low_ud;
70     uint32_t luma_slope_low_d;
71     uint32_t luma_slope_low_ud;
72     uint32_t luma_thresh_high_d;
73     uint32_t luma_thresh_high_ud;
74     uint32_t luma_slope_high_d;
75     uint32_t luma_slope_high_ud;
76 };
77 
78 void sharpening_fsm_clear( sharpening_fsm_ptr_t p_fsm );
79 
80 void sharpening_fsm_init( void *fsm, fsm_init_param_t *init_param );
81 int sharpening_fsm_set_param( void *fsm, uint32_t param_id, void *input, uint32_t input_size );
82 int sharpening_fsm_get_param( void *fsm, uint32_t param_id, void *input, uint32_t input_size, void *output, uint32_t output_size );
83 
84 uint8_t sharpening_fsm_process_event( sharpening_fsm_ptr_t p_fsm, event_id_t event_id );
85 
86 void sharpening_fsm_process_interrupt( sharpening_fsm_const_ptr_t p_fsm, uint8_t irq_event );
87 
88 
89 #endif /* __SHARPENING_FSM_H__ */
90