PDK API Guide for J721E
RAW FE Configuration

Introduction

This is VISS RAW FE Configuration file

Files

file  rawfe_cfg.h
 Interface file for RAW FE module, Defines the structures / control operations that could be used to configure / control RAW FE module in VISS.
 

Data Structures

struct  Rfe_Wb1Config
 White balance configuration structure There are two white balance modules in the RAW FE. This structure is used for configuring WB module, just before PWL. It is also used to configure DC offset and mask.. More...
 
struct  Rfe_PwlConfig
 PWL configuration Structure Used for configuring All three PWL modules one by one. Can be used even for configuring mask/shift and dc subtraction. More...
 
struct  Rfe_WdrConfig
 WDR Merge configuration Structure Used for configuring both the WDR Merge blocks in VPAC individually. More...
 
struct  Rfe_DpcOtfConfig
 DPC OTF configuration Structure When both DPC LUT and DPC OTF are enabled, this DPC OTF gets applied after DPC LUT. Automatically detecting the defects based on thresholds and slopes Preferred method when exact location of the defective pixels is not known. More...
 
struct  Rfe_DpcLutConfig
 DPC Lut configuration Structure When both DPC LUT and DPC OTF are enabled, this DPC LUT gets applied first. At max, 256 defective pixels can be corrected using DPC LUT. Used when exact location of the (typically manufacturing )defective pixels are known. More...
 
struct  Rfe_LscConfig
 LSC configuration Structure Lens shading corretion is applied after DPC. It uses loopup table containig gains for each color component, applies it to pixel. Lookup table is for the entire image. More...
 
struct  Rfe_GainOfstConfig
 White Balance configuration Structure Used for white balance correction Used for digital gain to be applied if the image is too dark even after analog gain and exposure time have been set to the maximum. Allows to set gain independently for each channel, the gain value can range from 0 to 31.996 in steps of 1/256. More...
 
struct  Rfe_H3aInConfig
 H3A Input Configuration structure Used to configure input modules for the H3A Used to select input to the H3A module and also Lut configuration for H3A input. More...
 
struct  Rfe_Control
 RAWFE control structure, passed as an argument to IOCTL_RFE_SET_CONFIG. More...
 

Functions

static void RfeControl_init (Rfe_Control *ctrl)
 

Macros

#define RFE_DPC_OTF_LUT_SIZE   (8U)
 
#define RFE_DPC_LUT_SIZE   (256U)
 
#define RFE_COMP_DECOMP_LUT_SIZE   (639U)
 
#define RFE_H3A_COMP_LUT_SIZE   (639U)
 
#define RFE_LSC_TBL_SIZE   (4758U)
 
#define RFE_MAX_COLOR_COMP   (4U)
 

Ioctls for the RAW FE module

Input/Output control MACRO's for RAW FE module

#define IOCTL_RFE_SET_CONFIG
 Used for setting individual RAWFE sub-module's configuration. Single ioctl for configuring all sub-module's configuration, by selecting module id and setting appropriate pointer in Rfe_Control. More...
 

LSE Gain Format

Lens Shading Correction Gain Format The 8bit gain applied in the LSC module could be in one of the below format. This enum is used for selecting this format.

#define RFE_LSC_GAIN_FMT_U8Q8   (0U)
 
#define RFE_LSC_GAIN_FMT_U8Q8_1   (1U)
 
#define RFE_LSC_GAIN_FMT_U8Q7   (2U)
 
#define RFE_LSC_GAIN_FMT_U8Q7_1   (3U)
 
#define RFE_LSC_GAIN_FMT_U8Q6   (4U)
 
#define RFE_LSC_GAIN_FMT_U8Q6_1   (5U)
 
#define RFE_LSC_GAIN_FMT_U8Q5   (6U)
 
#define RFE_LSC_GAIN_FMT_U8Q5_1   (7U)
 
#define RFE_LSC_GAIN_FMT_MAX   (0x8U)
 

LSC LUT Down Scaling Factor

Down Scaling factor for LSC LUT Used to select the downscaling factor for the LSC Lut.

Caution: The value of the macro is directly used in configuring LSC register.

#define RFE_LSC_DS_FACTOR_8   (3U)
 
#define RFE_LSC_DS_FACTOR_16   (4U)
 
#define RFE_LSC_DS_FACTOR_32   (5U)
 
#define RFE_LSC_DS_FACTOR_64   (6U)
 
#define RFE_LSC_DS_FACTOR_128   (7U)
 
#define RFE_LSC_DS_FACTOR_MAX   (8U)
 

H3A Input Select

Used for selecting input for the H3A module The input to the H3A module can come from either Long, or short or vshort or LSC output. This is used to select the input for the H3a module.

#define RFE_H3A_IN_SEL_LONG_FRAME   (0U)
 
#define RFE_H3A_IN_SEL_SHOFT_FRAME   (1U)
 
#define RFE_H3A_IN_SEL_VSHOFT_FRAME   (2U)
 
#define RFE_H3A_IN_SEL_LSC_OUT_FRAME   (3U)
 
#define RFE_H3A_IN_SEL_MAX   (4U)
 

RAW FE Submodule

Defines the sub-modules within RAWFE. RFE supports only one IOCTL, IOCTL_RFE_SET_CONFIG. Using this ioctl, the configuration for all modules can be set by selecting appropriate module in Rfe_Control and setting the correct pointer.

#define RFE_MODULE_WB1_DC_SUB_MASK   (0x0U)
 
#define RFE_MODULE_PWL1   (0x1U)
 
#define RFE_MODULE_PWL2   (0x2U)
 
#define RFE_MODULE_PWL3   (0x3U)
 
#define RFE_MODULE_DECOMP_LUT1   (0x4U)
 
#define RFE_MODULE_DECOMP_LUT2   (0x5U)
 
#define RFE_MODULE_DECOMP_LUT3   (0x6U)
 
#define RFE_MODULE_WDR_MERGE_MA1   (0x7U)
 
#define RFE_MODULE_WDR_MERGE_MA2   (0x8U)
 
#define RFE_MODULE_COMP_LUT   (0x9U)
 
#define RFE_MODULE_DPC_LUT   (0xAU)
 
#define RFE_MODULE_DPC_OTF   (0xBU)
 
#define RFE_MODULE_LSC   (0xCU)
 
#define RFE_MODULE_GAIN_OFST   (0xDU)
 
#define RFE_MODULE_H3A   (0xEU)
 
#define RFE_MODULE_H3A_LUT   (0xFU)
 

Macro Definition Documentation

◆ IOCTL_RFE_SET_CONFIG

#define IOCTL_RFE_SET_CONFIG
Value:
0x0U)
#define VHWA_IOCTL_RFE_IOCTL_BASE
Definition: vhwa_common.h:138

Used for setting individual RAWFE sub-module's configuration. Single ioctl for configuring all sub-module's configuration, by selecting module id and setting appropriate pointer in Rfe_Control.

Returns
FVID2_SOK on success, else error code.

◆ RFE_DPC_OTF_LUT_SIZE

#define RFE_DPC_OTF_LUT_SIZE   (8U)

◆ RFE_DPC_LUT_SIZE

#define RFE_DPC_LUT_SIZE   (256U)

◆ RFE_COMP_DECOMP_LUT_SIZE

#define RFE_COMP_DECOMP_LUT_SIZE   (639U)

◆ RFE_H3A_COMP_LUT_SIZE

#define RFE_H3A_COMP_LUT_SIZE   (639U)

◆ RFE_LSC_TBL_SIZE

#define RFE_LSC_TBL_SIZE   (4758U)

◆ RFE_MAX_COLOR_COMP

#define RFE_MAX_COLOR_COMP   (4U)

◆ RFE_LSC_GAIN_FMT_U8Q8

#define RFE_LSC_GAIN_FMT_U8Q8   (0U)

< Gain Format U8Q8, gain ranges from 0 to 0.996 Gain Format U8Q8, gain ranges from 1 to 1.996

◆ RFE_LSC_GAIN_FMT_U8Q8_1

#define RFE_LSC_GAIN_FMT_U8Q8_1   (1U)

Gain Format U8Q8, gain ranges from 0 to 1.992

◆ RFE_LSC_GAIN_FMT_U8Q7

#define RFE_LSC_GAIN_FMT_U8Q7   (2U)

Gain Format U8Q8, gain ranges from 1 to 2.992

◆ RFE_LSC_GAIN_FMT_U8Q7_1

#define RFE_LSC_GAIN_FMT_U8Q7_1   (3U)

Gain Format U8Q8, gain ranges from 0 to 2.984

◆ RFE_LSC_GAIN_FMT_U8Q6

#define RFE_LSC_GAIN_FMT_U8Q6   (4U)

Gain Format U8Q8, gain ranges from 1 to 3.984

◆ RFE_LSC_GAIN_FMT_U8Q6_1

#define RFE_LSC_GAIN_FMT_U8Q6_1   (5U)

Gain Format U8Q8, gain ranges from 0 to 6.968

◆ RFE_LSC_GAIN_FMT_U8Q5

#define RFE_LSC_GAIN_FMT_U8Q5   (6U)

Gain Format U8Q8, gain ranges from 1 to 7.968

◆ RFE_LSC_GAIN_FMT_U8Q5_1

#define RFE_LSC_GAIN_FMT_U8Q5_1   (7U)

Gain Format Max, used internally for error checking

◆ RFE_LSC_GAIN_FMT_MAX

#define RFE_LSC_GAIN_FMT_MAX   (0x8U)

◆ RFE_LSC_DS_FACTOR_8

#define RFE_LSC_DS_FACTOR_8   (3U)

< LSC Lut down scaling factor is 8 LSC Lut down scaling factor is 16

◆ RFE_LSC_DS_FACTOR_16

#define RFE_LSC_DS_FACTOR_16   (4U)

LSC Lut down scaling factor is 32

◆ RFE_LSC_DS_FACTOR_32

#define RFE_LSC_DS_FACTOR_32   (5U)

LSC Lut down scaling factor is 64

◆ RFE_LSC_DS_FACTOR_64

#define RFE_LSC_DS_FACTOR_64   (6U)

LSC Lut down scaling factor is 128

◆ RFE_LSC_DS_FACTOR_128

#define RFE_LSC_DS_FACTOR_128   (7U)

Last value, used for error checking

◆ RFE_LSC_DS_FACTOR_MAX

#define RFE_LSC_DS_FACTOR_MAX   (8U)

◆ RFE_H3A_IN_SEL_LONG_FRAME

#define RFE_H3A_IN_SEL_LONG_FRAME   (0U)

< Use Long input frame for H3A Use Short input frame for H3A

◆ RFE_H3A_IN_SEL_SHOFT_FRAME

#define RFE_H3A_IN_SEL_SHOFT_FRAME   (1U)

Use Very Short input frame for H3A

◆ RFE_H3A_IN_SEL_VSHOFT_FRAME

#define RFE_H3A_IN_SEL_VSHOFT_FRAME   (2U)

Use LSC Output as input frame for H3A

◆ RFE_H3A_IN_SEL_LSC_OUT_FRAME

#define RFE_H3A_IN_SEL_LSC_OUT_FRAME   (3U)

Last value, used error checking

◆ RFE_H3A_IN_SEL_MAX

#define RFE_H3A_IN_SEL_MAX   (4U)

◆ RFE_MODULE_WB1_DC_SUB_MASK

#define RFE_MODULE_WB1_DC_SUB_MASK   (0x0U)

< Lut based Defect Correction Module PWL Module used for the long exposure input, Used only for three exposure merge , Not used for two exposure merge or single exposure or linear mode

◆ RFE_MODULE_PWL1

#define RFE_MODULE_PWL1   (0x1U)

PWL Module used for

  • short exposure input for three exposure merge
  • long exposure input for two exposure merge Not used for single exposure or linear mode input

◆ RFE_MODULE_PWL2

#define RFE_MODULE_PWL2   (0x2U)

PWL Module used for

  • very short exposure input for three exposure merge
  • short exposure input for two exposure merge
  • Also used for single exposure or linear input frame

◆ RFE_MODULE_PWL3

#define RFE_MODULE_PWL3   (0x3U)

Lut based Decompanding module for Long input channel

◆ RFE_MODULE_DECOMP_LUT1

#define RFE_MODULE_DECOMP_LUT1   (0x4U)

Lut based Decompanding module for short and long input channel

◆ RFE_MODULE_DECOMP_LUT2

#define RFE_MODULE_DECOMP_LUT2   (0x5U)

Lut based Decompanding module for short and very short input channel

◆ RFE_MODULE_DECOMP_LUT3

#define RFE_MODULE_DECOMP_LUT3   (0x6U)

WDR Merge Module for MA1 block, This block is used only for three exposure merge, It must be bypassed for two exposure merge mode. The position of the exposure input channel is fixed, for three exposure merge, this block expects long and short channels as inputs.

◆ RFE_MODULE_WDR_MERGE_MA1

#define RFE_MODULE_WDR_MERGE_MA1   (0x7U)

WDR Merge Module for MA2 block, This module is used for both two and three exposure merge scenarios. In two exposure merge, it expects long and short channels as input channels. In three exposure merge, it expects very short and output of MA1 as input channnels.

◆ RFE_MODULE_WDR_MERGE_MA2

#define RFE_MODULE_WDR_MERGE_MA2   (0x8U)

Lut based companding module Used to convert 20bit merge input to 16bit Used after both WDR merge block

◆ RFE_MODULE_COMP_LUT

#define RFE_MODULE_COMP_LUT   (0x9U)

Lut based Defect Correction Module

◆ RFE_MODULE_DPC_LUT

#define RFE_MODULE_DPC_LUT   (0xAU)

On-the-fly Defect Correction Module

◆ RFE_MODULE_DPC_OTF

#define RFE_MODULE_DPC_OTF   (0xBU)

Lens Shading Correction Module

◆ RFE_MODULE_LSC

#define RFE_MODULE_LSC   (0xCU)

Gain and Offset/WhiteBalance Module

◆ RFE_MODULE_GAIN_OFST

#define RFE_MODULE_GAIN_OFST   (0xDU)

H3A Config Used to select input for the H3A, from Long, Short, VeryShort, LSC output Instead of LUT, shift can also be used for bit depth conversion. Lut based companding for H3A Input Bitdepth for this LUT cannot exceed 16 and the LUT entry size is only 10 bits, since the H3A logic works on 10 bit data

◆ RFE_MODULE_H3A

#define RFE_MODULE_H3A   (0xEU)

Used for configure H3A Lut for convert 16bit input to 10bit output

◆ RFE_MODULE_H3A_LUT

#define RFE_MODULE_H3A_LUT   (0xFU)

Function Documentation

◆ RfeControl_init()

static void RfeControl_init ( Rfe_Control ctrl)
inlinestatic