diff options
Diffstat (limited to 'drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/ynr/ynr_1.0')
5 files changed, 0 insertions, 435 deletions
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/ynr/ynr_1.0/ia_css_ynr.host.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/ynr/ynr_1.0/ia_css_ynr.host.c deleted file mode 100644 index d8dccce772a9..000000000000 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/ynr/ynr_1.0/ia_css_ynr.host.c +++ /dev/null @@ -1,219 +0,0 @@ -/* - * Support for Intel Camera Imaging ISP subsystem. - * Copyright (c) 2015, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - */ - -#include "ia_css_types.h" -#include "sh_css_defs.h" -#include "ia_css_debug.h" -#include "sh_css_frac.h" - -#include "bnr/bnr_1.0/ia_css_bnr.host.h" -#include "ia_css_ynr.host.h" - -const struct ia_css_nr_config default_nr_config = { - 16384, - 8192, - 1280, - 0, - 0 -}; - -const struct ia_css_ee_config default_ee_config = { - 8192, - 128, - 2048 -}; - -void -ia_css_nr_encode( - struct sh_css_isp_ynr_params *to, - const struct ia_css_nr_config *from, - unsigned size) -{ - (void)size; - /* YNR (Y Noise Reduction) */ - to->threshold = - uDIGIT_FITTING((unsigned)8192, 16, SH_CSS_BAYER_BITS); - to->gain_all = - uDIGIT_FITTING(from->ynr_gain, 16, SH_CSS_YNR_GAIN_SHIFT); - to->gain_dir = - uDIGIT_FITTING(from->ynr_gain, 16, SH_CSS_YNR_GAIN_SHIFT); - to->threshold_cb = - uDIGIT_FITTING(from->threshold_cb, 16, SH_CSS_BAYER_BITS); - to->threshold_cr = - uDIGIT_FITTING(from->threshold_cr, 16, SH_CSS_BAYER_BITS); -} - -void -ia_css_yee_encode( - struct sh_css_isp_yee_params *to, - const struct ia_css_yee_config *from, - unsigned size) -{ - int asiWk1 = (int) from->ee.gain; - int asiWk2 = asiWk1 / 8; - int asiWk3 = asiWk1 / 4; - - (void)size; - /* YEE (Y Edge Enhancement) */ - to->dirthreshold_s = - min((uDIGIT_FITTING(from->nr.direction, 16, SH_CSS_BAYER_BITS) - << 1), - SH_CSS_BAYER_MAXVAL); - to->dirthreshold_g = - min((uDIGIT_FITTING(from->nr.direction, 16, SH_CSS_BAYER_BITS) - << 4), - SH_CSS_BAYER_MAXVAL); - to->dirthreshold_width_log2 = - uFRACTION_BITS_FITTING(8); - to->dirthreshold_width = - 1 << to->dirthreshold_width_log2; - to->detailgain = - uDIGIT_FITTING(from->ee.detail_gain, 11, - SH_CSS_YEE_DETAIL_GAIN_SHIFT); - to->coring_s = - (uDIGIT_FITTING((unsigned)56, 16, SH_CSS_BAYER_BITS) * - from->ee.threshold) >> 8; - to->coring_g = - (uDIGIT_FITTING((unsigned)224, 16, SH_CSS_BAYER_BITS) * - from->ee.threshold) >> 8; - /* 8; // *1.125 ->[s4.8] */ - to->scale_plus_s = - (asiWk1 + asiWk2) >> (11 - SH_CSS_YEE_SCALE_SHIFT); - /* 8; // ( * -.25)->[s4.8] */ - to->scale_plus_g = - (0 - asiWk3) >> (11 - SH_CSS_YEE_SCALE_SHIFT); - /* 8; // *0.875 ->[s4.8] */ - to->scale_minus_s = - (asiWk1 - asiWk2) >> (11 - SH_CSS_YEE_SCALE_SHIFT); - /* 8; // ( *.25 ) ->[s4.8] */ - to->scale_minus_g = - (asiWk3) >> (11 - SH_CSS_YEE_SCALE_SHIFT); - to->clip_plus_s = - uDIGIT_FITTING((unsigned)32760, 16, SH_CSS_BAYER_BITS); - to->clip_plus_g = 0; - to->clip_minus_s = - uDIGIT_FITTING((unsigned)504, 16, SH_CSS_BAYER_BITS); - to->clip_minus_g = - uDIGIT_FITTING((unsigned)32256, 16, SH_CSS_BAYER_BITS); - to->Yclip = SH_CSS_BAYER_MAXVAL; -} - -void -ia_css_nr_dump( - const struct sh_css_isp_ynr_params *ynr, - unsigned level) -{ - if (!ynr) return; - ia_css_debug_dtrace(level, - "Y Noise Reduction:\n"); - ia_css_debug_dtrace(level, "\t%-32s = %d\n", - "ynr_threshold", ynr->threshold); - ia_css_debug_dtrace(level, "\t%-32s = %d\n", - "ynr_gain_all", ynr->gain_all); - ia_css_debug_dtrace(level, "\t%-32s = %d\n", - "ynr_gain_dir", ynr->gain_dir); - ia_css_debug_dtrace(level, "\t%-32s = %d\n", - "ynr_threshold_cb", ynr->threshold_cb); - ia_css_debug_dtrace(level, "\t%-32s = %d\n", - "ynr_threshold_cr", ynr->threshold_cr); -} - -void -ia_css_yee_dump( - const struct sh_css_isp_yee_params *yee, - unsigned level) -{ - ia_css_debug_dtrace(level, - "Y Edge Enhancement:\n"); - ia_css_debug_dtrace(level, "\t%-32s = %d\n", - "ynryee_dirthreshold_s", - yee->dirthreshold_s); - ia_css_debug_dtrace(level, "\t%-32s = %d\n", - "ynryee_dirthreshold_g", - yee->dirthreshold_g); - ia_css_debug_dtrace(level, "\t%-32s = %d\n", - "ynryee_dirthreshold_width_log2", - yee->dirthreshold_width_log2); - ia_css_debug_dtrace(level, "\t%-32s = %d\n", - "ynryee_dirthreshold_width", - yee->dirthreshold_width); - ia_css_debug_dtrace(level, "\t%-32s = %d\n", - "yee_detailgain", - yee->detailgain); - ia_css_debug_dtrace(level, "\t%-32s = %d\n", - "yee_coring_s", - yee->coring_s); - ia_css_debug_dtrace(level, "\t%-32s = %d\n", - "yee_coring_g", - yee->coring_g); - ia_css_debug_dtrace(level, "\t%-32s = %d\n", - "yee_scale_plus_s", - yee->scale_plus_s); - ia_css_debug_dtrace(level, "\t%-32s = %d\n", - "yee_scale_plus_g", - yee->scale_plus_g); - ia_css_debug_dtrace(level, "\t%-32s = %d\n", - "yee_scale_minus_s", - yee->scale_minus_s); - ia_css_debug_dtrace(level, "\t%-32s = %d\n", - "yee_scale_minus_g", - yee->scale_minus_g); - ia_css_debug_dtrace(level, "\t%-32s = %d\n", - "yee_clip_plus_s", - yee->clip_plus_s); - ia_css_debug_dtrace(level, "\t%-32s = %d\n", - "yee_clip_plus_g", - yee->clip_plus_g); - ia_css_debug_dtrace(level, "\t%-32s = %d\n", - "yee_clip_minus_s", - yee->clip_minus_s); - ia_css_debug_dtrace(level, "\t%-32s = %d\n", - "yee_clip_minus_g", - yee->clip_minus_g); - ia_css_debug_dtrace(level, "\t%-32s = %d\n", - "ynryee_Yclip", - yee->Yclip); -} - -void -ia_css_nr_debug_dtrace( - const struct ia_css_nr_config *config, - unsigned level) -{ - ia_css_debug_dtrace(level, - "config.direction=%d, " - "config.bnr_gain=%d, config.ynr_gain=%d, " - "config.threshold_cb=%d, config.threshold_cr=%d\n", - config->direction, - config->bnr_gain, config->ynr_gain, - config->threshold_cb, config->threshold_cr); -} - -void -ia_css_ee_debug_dtrace( - const struct ia_css_ee_config *config, - unsigned level) -{ - ia_css_debug_dtrace(level, - "config.threshold=%d, config.gain=%d, config.detail_gain=%d\n", - config->threshold, config->gain, config->detail_gain); -} - -void -ia_css_init_ynr_state( - void/*struct sh_css_isp_ynr_vmem_state*/ *state, - size_t size) -{ - memset(state, 0, size); -} diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/ynr/ynr_1.0/ia_css_ynr.host.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/ynr/ynr_1.0/ia_css_ynr.host.h deleted file mode 100644 index b5730df313ef..000000000000 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/ynr/ynr_1.0/ia_css_ynr.host.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Support for Intel Camera Imaging ISP subsystem. - * Copyright (c) 2015, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - */ - -#ifndef __IA_CSS_YNR_HOST_H -#define __IA_CSS_YNR_HOST_H - -#include "ia_css_ynr_types.h" -#include "ia_css_ynr_param.h" - -extern const struct ia_css_nr_config default_nr_config; -extern const struct ia_css_ee_config default_ee_config; - -void -ia_css_nr_encode( - struct sh_css_isp_ynr_params *to, - const struct ia_css_nr_config *from, - unsigned size); - -void -ia_css_yee_encode( - struct sh_css_isp_yee_params *to, - const struct ia_css_yee_config *from, - unsigned size); - -void -ia_css_nr_dump( - const struct sh_css_isp_ynr_params *ynr, - unsigned level); - -void -ia_css_yee_dump( - const struct sh_css_isp_yee_params *yee, - unsigned level); - -void -ia_css_nr_debug_dtrace( - const struct ia_css_nr_config *config, - unsigned level); - -void -ia_css_ee_debug_dtrace( - const struct ia_css_ee_config *config, - unsigned level); - -void -ia_css_init_ynr_state( - void/*struct sh_css_isp_ynr_vmem_state*/ *state, - size_t size); -#endif /* __IA_CSS_YNR_HOST_H */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/ynr/ynr_1.0/ia_css_ynr_param.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/ynr/ynr_1.0/ia_css_ynr_param.h deleted file mode 100644 index ad61ec1211e8..000000000000 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/ynr/ynr_1.0/ia_css_ynr_param.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Support for Intel Camera Imaging ISP subsystem. - * Copyright (c) 2015, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - */ - -#ifndef __IA_CSS_YNR_PARAM_H -#define __IA_CSS_YNR_PARAM_H - -#include "type_support.h" - -/* YNR (Y Noise Reduction) */ -struct sh_css_isp_ynr_params { - int32_t threshold; - int32_t gain_all; - int32_t gain_dir; - int32_t threshold_cb; - int32_t threshold_cr; -}; - -/* YEE (Y Edge Enhancement) */ -struct sh_css_isp_yee_params { - int32_t dirthreshold_s; - int32_t dirthreshold_g; - int32_t dirthreshold_width_log2; - int32_t dirthreshold_width; - int32_t detailgain; - int32_t coring_s; - int32_t coring_g; - int32_t scale_plus_s; - int32_t scale_plus_g; - int32_t scale_minus_s; - int32_t scale_minus_g; - int32_t clip_plus_s; - int32_t clip_plus_g; - int32_t clip_minus_s; - int32_t clip_minus_g; - int32_t Yclip; -}; - -#endif /* __IA_CSS_YNR_PARAM_H */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/ynr/ynr_1.0/ia_css_ynr_state.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/ynr/ynr_1.0/ia_css_ynr_state.h deleted file mode 100644 index b2348b19c3cd..000000000000 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/ynr/ynr_1.0/ia_css_ynr_state.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Support for Intel Camera Imaging ISP subsystem. - * Copyright (c) 2015, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - */ - -#ifndef __IA_CSS_YNR_STATE_H -#define __IA_CSS_YNR_STATE_H - -#include "type_support.h" -#include "vmem.h" - -/* YNR (luminance noise reduction) */ -struct sh_css_isp_ynr_vmem_state { - VMEM_ARRAY(ynr_buf[4], MAX_VECTORS_PER_BUF_LINE*ISP_NWAY); -}; - -#endif /* __IA_CSS_YNR_STATE_H */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/ynr/ynr_1.0/ia_css_ynr_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/ynr/ynr_1.0/ia_css_ynr_types.h deleted file mode 100644 index 3f8589a5a43a..000000000000 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/ynr/ynr_1.0/ia_css_ynr_types.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Support for Intel Camera Imaging ISP subsystem. - * Copyright (c) 2015, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - */ - -#ifndef __IA_CSS_YNR_TYPES_H -#define __IA_CSS_YNR_TYPES_H - -/* @file -* CSS-API header file for Noise Reduction (BNR) and YCC Noise Reduction (YNR,CNR). -*/ - -/* Configuration used by Bayer Noise Reduction (BNR) and - * YCC Noise Reduction (YNR,CNR). - * - * ISP block: BNR1, YNR1, CNR1 - * ISP1: BNR1,YNR1,CNR1 are used. - * ISP2: BNR1,YNR1,CNR1 are used for Preview/Video. - * BNR1,YNR2,CNR2 are used for Still. - */ -struct ia_css_nr_config { - ia_css_u0_16 bnr_gain; /** Strength of noise reduction (BNR). - u0.16, [0,65535], - default 14336(0.21875), ineffective 0 */ - ia_css_u0_16 ynr_gain; /** Strength of noise reduction (YNR). - u0.16, [0,65535], - default 14336(0.21875), ineffective 0 */ - ia_css_u0_16 direction; /** Sensitivity of edge (BNR). - u0.16, [0,65535], - default 512(0.0078125), ineffective 0 */ - ia_css_u0_16 threshold_cb; /** Coring threshold for Cb (CNR). - This is the same as - de_config.c1_coring_threshold. - u0.16, [0,65535], - default 0(0), ineffective 0 */ - ia_css_u0_16 threshold_cr; /** Coring threshold for Cr (CNR). - This is the same as - de_config.c2_coring_threshold. - u0.16, [0,65535], - default 0(0), ineffective 0 */ -}; - -/* Edge Enhancement (sharpen) configuration. - * - * ISP block: YEE1 - * ISP1: YEE1 is used. - * ISP2: YEE1 is used for Preview/Video. - * (YEE2 is used for Still.) - */ -struct ia_css_ee_config { - ia_css_u5_11 gain; /** The strength of sharpness. - u5.11, [0,65535], - default 8192(4.0), ineffective 0 */ - ia_css_u8_8 threshold; /** The threshold that divides noises from - edge. - u8.8, [0,65535], - default 256(1.0), ineffective 65535 */ - ia_css_u5_11 detail_gain; /** The strength of sharpness in pell-mell - area. - u5.11, [0,65535], - default 2048(1.0), ineffective 0 */ -}; - -/* YNR and YEE (sharpen) configuration. - */ -struct ia_css_yee_config { - struct ia_css_nr_config nr; /** The NR configuration. */ - struct ia_css_ee_config ee; /** The EE configuration. */ -}; - -#endif /* __IA_CSS_YNR_TYPES_H */ - |