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 #if !defined(HAS_NO_HMEM)
17 #include "memory_access.h"
18 #include "ia_css_types.h"
19 #include "sh_css_internal.h"
20 #include "assert_support.h"
21 #include "sh_css_frac.h"
23 #include "ia_css_bh.host.h"
26 ia_css_bh_hmem_decode(
27 struct ia_css_3a_rgby_output *out_ptr,
28 const struct ia_css_bh_table *hmem_buf)
33 * No weighted histogram, hence no grid definition
37 assert(sizeof_hmem(HMEM0_ID) == sizeof(*hmem_buf));
40 for (i = 0; i < HMEM_UNIT_SIZE; i++) {
41 out_ptr[i].r = hmem_buf->hmem[BH_COLOR_R][i];
42 out_ptr[i].g = hmem_buf->hmem[BH_COLOR_G][i];
43 out_ptr[i].b = hmem_buf->hmem[BH_COLOR_B][i];
44 out_ptr[i].y = hmem_buf->hmem[BH_COLOR_Y][i];
45 /* sh_css_print ("hmem[%d] = %d, %d, %d, %d\n",
46 i, out_ptr[i].r, out_ptr[i].g, out_ptr[i].b, out_ptr[i].y); */
52 struct sh_css_isp_bh_params *to,
53 const struct ia_css_3a_config *from,
57 /* coefficients to calculate Y */
59 uDIGIT_FITTING(from->ae_y_coef_r, 16, SH_CSS_AE_YCOEF_SHIFT);
61 uDIGIT_FITTING(from->ae_y_coef_g, 16, SH_CSS_AE_YCOEF_SHIFT);
63 uDIGIT_FITTING(from->ae_y_coef_b, 16, SH_CSS_AE_YCOEF_SHIFT);