1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16#include "ia_css_types.h"
17#include "sh_css_defs.h"
18#ifndef IA_CSS_NO_DEBUG
19
20#include "ia_css_debug.h"
21#endif
22#include "sh_css_frac.h"
23#include "vamem.h"
24
25#include "ia_css_gc.host.h"
26
27const struct ia_css_gc_config default_gc_config = {
28 0,
29 0
30};
31
32const struct ia_css_ce_config default_ce_config = {
33 0,
34 255
35};
36
37void
38ia_css_gc_encode(
39 struct sh_css_isp_gc_params *to,
40 const struct ia_css_gc_config *from,
41 unsigned int size)
42{
43 (void)size;
44 to->gain_k1 =
45 uDIGIT_FITTING((int)from->gain_k1, 16,
46 IA_CSS_GAMMA_GAIN_K_SHIFT);
47 to->gain_k2 =
48 uDIGIT_FITTING((int)from->gain_k2, 16,
49 IA_CSS_GAMMA_GAIN_K_SHIFT);
50}
51
52void
53ia_css_ce_encode(
54 struct sh_css_isp_ce_params *to,
55 const struct ia_css_ce_config *from,
56 unsigned int size)
57{
58 (void)size;
59 to->uv_level_min = from->uv_level_min;
60 to->uv_level_max = from->uv_level_max;
61}
62
63void
64ia_css_gc_vamem_encode(
65 struct sh_css_isp_gc_vamem_params *to,
66 const struct ia_css_gamma_table *from,
67 unsigned int size)
68{
69 (void)size;
70 memcpy(&to->gc, &from->data, sizeof(to->gc));
71}
72
73#ifndef IA_CSS_NO_DEBUG
74void
75ia_css_gc_dump(
76 const struct sh_css_isp_gc_params *gc,
77 unsigned int level)
78{
79 if (!gc) return;
80 ia_css_debug_dtrace(level, "Gamma Correction:\n");
81 ia_css_debug_dtrace(level, "\t%-32s = %d\n",
82 "gamma_gain_k1", gc->gain_k1);
83 ia_css_debug_dtrace(level, "\t%-32s = %d\n",
84 "gamma_gain_k2", gc->gain_k2);
85}
86
87void
88ia_css_ce_dump(
89 const struct sh_css_isp_ce_params *ce,
90 unsigned int level)
91{
92 ia_css_debug_dtrace(level, "Chroma Enhancement:\n");
93 ia_css_debug_dtrace(level, "\t%-32s = %d\n",
94 "ce_uv_level_min", ce->uv_level_min);
95 ia_css_debug_dtrace(level, "\t%-32s = %d\n",
96 "ce_uv_level_max", ce->uv_level_max);
97}
98
99void
100ia_css_gc_debug_dtrace(
101 const struct ia_css_gc_config *config,
102 unsigned int level)
103{
104 ia_css_debug_dtrace(level,
105 "config.gain_k1=%d, config.gain_k2=%d\n",
106 config->gain_k1, config->gain_k2);
107}
108
109void
110ia_css_ce_debug_dtrace(
111 const struct ia_css_ce_config *config,
112 unsigned int level)
113{
114 ia_css_debug_dtrace(level,
115 "config.uv_level_min=%d, config.uv_level_max=%d\n",
116 config->uv_level_min, config->uv_level_max);
117}
118#endif
119