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 #ifndef __IA_CSS_GC_TYPES_H
16 #define __IA_CSS_GC_TYPES_H
19 * CSS-API header file for Gamma Correction parameters.
22 #include "isp/kernels/ctc/ctc_1.0/ia_css_ctc_types.h" /* FIXME: Needed for ia_css_vamem_type */
24 /* Fractional bits for GAMMA gain */
25 #define IA_CSS_GAMMA_GAIN_K_SHIFT 13
27 /* Number of elements in the gamma table. */
28 #define IA_CSS_VAMEM_1_GAMMA_TABLE_SIZE_LOG2 10
29 #define IA_CSS_VAMEM_1_GAMMA_TABLE_SIZE (1U<<IA_CSS_VAMEM_1_GAMMA_TABLE_SIZE_LOG2)
31 /* Number of elements in the gamma table. */
32 #define IA_CSS_VAMEM_2_GAMMA_TABLE_SIZE_LOG2 8
33 #define IA_CSS_VAMEM_2_GAMMA_TABLE_SIZE ((1U<<IA_CSS_VAMEM_2_GAMMA_TABLE_SIZE_LOG2) + 1)
35 /* Gamma table, used for Y(Luma) Gamma Correction.
37 * ISP block: GC1 (YUV Gamma Correction)
39 * (ISP2: GC2(sRGB Gamma Correction) is used.)
41 /** IA_CSS_VAMEM_TYPE_1(ISP2300) or
42 IA_CSS_VAMEM_TYPE_2(ISP2400) */
43 union ia_css_gc_data
{
44 uint16_t vamem_1
[IA_CSS_VAMEM_1_GAMMA_TABLE_SIZE
];
45 /** Y(Luma) Gamma table on vamem type 1. u0.8, [0,255] */
46 uint16_t vamem_2
[IA_CSS_VAMEM_2_GAMMA_TABLE_SIZE
];
47 /** Y(Luma) Gamma table on vamem type 2. u0.8, [0,255] */
50 struct ia_css_gamma_table
{
51 enum ia_css_vamem_type vamem_type
;
52 union ia_css_gc_data data
;
55 /* Gamma Correction configuration (used only for YUV Gamma Correction).
57 * ISP block: GC1 (YUV Gamma Correction)
59 * (ISP2: GC2 (sRGB Gamma Correction) is used.)
61 struct ia_css_gc_config
{
62 uint16_t gain_k1
; /** Gain to adjust U after YUV Gamma Correction.
64 default/ineffective 19000(0.29) */
65 uint16_t gain_k2
; /** Gain to adjust V after YUV Gamma Correction.
67 default/ineffective 19000(0.29) */
70 /* Chroma Enhancement configuration.
72 * This parameter specifies range of chroma output level.
73 * The standard range is [0,255] or [16,240].
77 * (ISP2: CE1 is not used.)
79 struct ia_css_ce_config
{
80 uint8_t uv_level_min
; /** Minimum of chroma output level.
81 u0.8, [0,255], default/ineffective 0 */
82 uint8_t uv_level_max
; /** Maximum of chroma output level.
83 u0.8, [0,255], default/ineffective 255 */
86 /* Multi-Axes Color Correction (MACC) configuration.
88 * ISP block: MACC2 (MACC by matrix and exponent(ia_css_macc_config))
89 * (ISP1: MACC1 (MACC by only matrix) is used.)
90 * ISP2: MACC2 is used.
92 struct ia_css_macc_config
{
93 uint8_t exp
; /** Common exponent of ia_css_macc_table.
94 u8.0, [0,13], default 1, ineffective 1 */
97 #endif /* __IA_CSS_GC_TYPES_H */