1/* 2 * Support for Intel Camera Imaging ISP subsystem. 3 * Copyright (c) 2015, Intel Corporation. 4 * 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. 8 * 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 12 * more details. 13 */ 14 15#ifndef __IA_CSS_MACC1_5_TYPES_H 16#define __IA_CSS_MACC1_5_TYPES_H 17 18/* @file 19* CSS-API header file for Multi-Axis Color Conversion algorithm parameters. 20*/ 21 22/* Multi-Axis Color Conversion configuration 23 * 24 * ISP2.6.1: MACC1_5 is used. 25 */ 26 27 28/* Number of axes in the MACC table. */ 29#define IA_CSS_MACC_NUM_AXES 16 30/* Number of coefficients per MACC axes. */ 31#define IA_CSS_MACC_NUM_COEFS 4 32 33/* Multi-Axes Color Correction (MACC) table. 34 * 35 * ISP block: MACC (MACC by only matrix) 36 * MACC1_5 (MACC by matrix and exponent(ia_css_macc_config)) 37 * ISP1: MACC is used. 38 * ISP2: MACC1_5 is used. 39 * 40 * [MACC] 41 * OutU = (data00 * InU + data01 * InV) >> 13 42 * OutV = (data10 * InU + data11 * InV) >> 13 43 * 44 * default/ineffective: 45 * OutU = (8192 * InU + 0 * InV) >> 13 46 * OutV = ( 0 * InU + 8192 * InV) >> 13 47 * 48 * [MACC1_5] 49 * OutU = (data00 * InU + data01 * InV) >> (13 - exp) 50 * OutV = (data10 * InU + data11 * InV) >> (13 - exp) 51 * 52 * default/ineffective: (exp=1) 53 * OutU = (4096 * InU + 0 * InV) >> (13 - 1) 54 * OutV = ( 0 * InU + 4096 * InV) >> (13 - 1) 55 */ 56struct ia_css_macc1_5_table { 57 int16_t data[IA_CSS_MACC_NUM_COEFS * IA_CSS_MACC_NUM_AXES]; 58 /** 16 of 2x2 matix 59 MACC1_5: s[macc_config.exp].[13-macc_config.exp], [-8192,8191] 60 default/ineffective: (s1.12) 61 16 of "identity 2x2 matix" {4096,0,0,4096} */ 62}; 63 64/* Multi-Axes Color Correction (MACC) configuration. 65 * 66 * ISP block: MACC1_5 (MACC by matrix and exponent(ia_css_macc_config)) 67 * ISP2: MACC1_5 is used. 68 */ 69struct ia_css_macc1_5_config { 70 uint8_t exp; /** Common exponent of ia_css_macc_table. 71 u8.0, [0,13], default 1, ineffective 1 */ 72}; 73 74#endif /* __IA_CSS_MACC1_5_TYPES_H */ 75