2 * Support for Intel Camera Imaging ISP subsystem.
3 * Copyright (c) 2015, Intel Corporation.
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.
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
15 #include "ia_css_types.h"
16 #include "sh_css_defs.h"
17 #ifndef IA_CSS_NO_DEBUG
18 /* FIXME: See BZ 4427 */
19 #include "ia_css_debug.h"
22 #include "ia_css_csc.host.h"
24 const struct ia_css_cc_config default_cc_config = {
26 {255, 29, 120, 0, -374, -342, 0, -672, 301},
31 struct sh_css_isp_csc_params *to,
32 const struct ia_css_cc_config *from,
36 #ifndef IA_CSS_NO_DEBUG
37 ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, "ia_css_encode_cc() enter:\n");
40 to->m_shift = (int16_t) from->fraction_bits;
41 to->m00 = (int16_t) from->matrix[0];
42 to->m01 = (int16_t) from->matrix[1];
43 to->m02 = (int16_t) from->matrix[2];
44 to->m10 = (int16_t) from->matrix[3];
45 to->m11 = (int16_t) from->matrix[4];
46 to->m12 = (int16_t) from->matrix[5];
47 to->m20 = (int16_t) from->matrix[6];
48 to->m21 = (int16_t) from->matrix[7];
49 to->m22 = (int16_t) from->matrix[8];
51 #ifndef IA_CSS_NO_DEBUG
52 ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, "ia_css_encode_cc() leave:\n");
58 struct sh_css_isp_csc_params *to,
59 const struct ia_css_cc_config *from,
62 ia_css_encode_cc(to, from, size);
65 #ifndef IA_CSS_NO_DEBUG
68 const struct sh_css_isp_csc_params *csc,
73 ia_css_debug_dtrace(level, "%s\n", name);
74 ia_css_debug_dtrace(level, "\t%-32s = %d\n",
77 ia_css_debug_dtrace(level, "\t%-32s = %d\n",
80 ia_css_debug_dtrace(level, "\t%-32s = %d\n",
83 ia_css_debug_dtrace(level, "\t%-32s = %d\n",
86 ia_css_debug_dtrace(level, "\t%-32s = %d\n",
89 ia_css_debug_dtrace(level, "\t%-32s = %d\n",
92 ia_css_debug_dtrace(level, "\t%-32s = %d\n",
95 ia_css_debug_dtrace(level, "\t%-32s = %d\n",
98 ia_css_debug_dtrace(level, "\t%-32s = %d\n",
101 ia_css_debug_dtrace(level, "\t%-32s = %d\n",
108 const struct sh_css_isp_csc_params *csc,
111 ia_css_cc_dump(csc, level, "Color Space Conversion");
115 ia_css_cc_config_debug_dtrace(
116 const struct ia_css_cc_config *config,
119 ia_css_debug_dtrace(level,
121 "config.m[1]=%d, config.m[2]=%d, "
122 "config.m[3]=%d, config.m[4]=%d, "
123 "config.m[5]=%d, config.m[6]=%d, "
124 "config.m[7]=%d, config.m[8]=%d\n",
126 config->matrix[1], config->matrix[2],
127 config->matrix[3], config->matrix[4],
128 config->matrix[5], config->matrix[6],
129 config->matrix[7], config->matrix[8]);