⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 csl_prev.h

📁 TI的DM6446的硬件平台搭建的相关例子
💻 H
📖 第 1 页 / 共 3 页
字号:

/** @brief Enumeration for different tables which needs to written
 *
 * This is used to set the table which has to be written
 */
typedef enum {
	/** Noise filter threshold memory
		physically 256x8      */
	CSL_PREV_NOISE_FILTER = 1,
	/** Gamma Table
		Physically 3x1024x8   */
	CSL_PREV_GAMMA,
	/** Red Gamma Table
		Physically 1024x8   */
	CSL_PREV_RED_GAMMA,	
	/** Green Gamma Table
		Physically 1024x8   */
	CSL_PREV_GREEN_GAMMA,	
	/** Blue Gamma Table
		Physically 1024x8   */
	CSL_PREV_BLUE_GAMMA,	
	/** Non-linear luminisance enhancer
		physically 1x128x20   */
	CSL_PREV_NL_LUM,
	/** CFA Coefficient memory
		Physically 1x24x192   */
	CSL_PREV_CFA_COEF
					
} CSL_PrevTableSelect;

/** @brief Enumeration for error bit codes from the @a CSL_prevCheckSettings() API
 *
 * This is used to identify the error bit codes fron the @a CSL_prevCheckSettings() API
 */
typedef enum {
	/** Indicates that there are no errors, all restrictions are met		*/
	CSL_PREV_ERR_NO_ERRORS							= 0x00000000,
	/** Bit 0: Output Width is over the limit (max: 1280 pixels)			*/
	CSL_PREV_ERR_OUT_WIDTH_OVER_LIMIT				= 0x00000001,
	/** Bit 1: Output Width is not even										*/
	CSL_PREV_ERR_OUT_WIDTH_NOT_EVEN					= 0x00000002,
	/** Bit 2: Input Width is not a multiple of the AVE parameters			*/
	CSL_PREV_ERR_IN_WIDTH_NOT_MULT_OF_AVE_PARAMS	= 0x00000004,
	/** Bit 3. Input to the Horizontal Median filter is not even			*/
	CSL_PREV_ERR_HMED_INPUT_NOT_EVEN				= 0x00000008,
	/** Bit 4: Horizontal median filter is not supported for foveon formatted input     */
	CSL_PREV_ERR_HMED_NOT_SUPPORTED_FOR_FOVEON		= 0x00000010,
	/** Bit 5: Noise filter is not supported for foveon formatted input		*/
	CSL_PREV_ERR_NF_NOT_SUPPORTED_FOR_FOVEON		= 0x00000020,
 	/**	Bit 6: Input width is larger than CCDC output width					*/
	CSL_PREV_ERR_INPUT_WIDTH_LARGER_THAN_CCDC_OUT	= 0x00000040,
	/**	Bit 7: Input height is larger than CCDC output height				*/
	CSL_PREV_ERR_INPUT_HEIGHT_LARGER_THAN_CCDC_OUT	= 0x00000080

} CSL_PrevErrorBits;

/** @brief This object contains the reference to the instance of PREV opened
 *  using the @a CSL_prevOpen().
 *
 *  The pointer to this, is passed to all PREV CSL APIs.
 */
typedef struct CSL_PrevObj {
	/** This is the mode which the CSL instance is opened     */
	CSL_OpenMode openMode;
	/** This is a unique identifier to the instance of PREV being
	 *  referred to by this object
	 */
	CSL_Uid uid;
	/** This is the variable that contains the current state of a
	 *  resource being shared by current instance of PREV with
     *  other peripherals
     */
	CSL_Xio xio;
	/** This is a pointer to the registers of the instance of PREV
     *  referred to by this object
     */
	CSL_PrevRegsOvly regs;
	/** This is the instance of PREV being referred to by this object  */
	CSL_PrevNum perNum;
}CSL_PrevObj;

typedef struct CSL_PrevObj *CSL_PrevHandle;

/** @brief PREV Peripheral ID, Class, and Revision structure
*
*  This structure is used for querying the PREV peripheral ID, class, and revision 
*/
typedef struct CSL_PrevRevStatus_{
     /** PREV Peripheral ID */
     Uint16 peripheralID;
     /** Class Identification */
     Uint16 classID;
     /**  Revision Number*/
     Uint16 revNum;
}CSL_PrevRevStatus;	 

/** @brief This is used for enabling some sub blocks in the preview engine  
* 
* The pointer to this structure is given to the CSL APIs
*
*/
typedef struct CSL_PrevModeData_{
	/** Inverse A-law mode, CSL_PREV_INV_ALAW_ENABLE, CSL_PREV_INV_ALAW_DISABLE*/
	Uint8 alawEnable;
	/** Dark frame capture, CSL_PREV_DRKF_CAP_ENABLE, CSL_PREV_DRKF_CAP_DISABLE */
	Uint8 captureDFEnable;	
	/** Subtract dark frame, CSL_PREV_DRKF_SUB_ENABLE, CSL_PREV_DRKF_SUB_DISABLE */
	Uint8 subtractDFEnable;	
	/** Shading compensation enable instead of dark frame	
	 *  The 8-bit value loaded from SDRAM is multiplied with the current pixel
	 *  instead of subtracting it. Note that the dark frame subtract needs to be
	 *  enabled in addition to this bit being active to perform shading compensation", 
	 *	CSL_PREV_SHADE_COMP_ENABLE, CSL_PREV_SHADE_COMP_DISABLE
     */
	Uint8 shadingCompEnable;	
	/** Horizontal median filter enable, CSL_PREV_HMED_ENABLE, CSL_PREV_HMED_DISABLE*/
	Uint8 hMedEnable;	
	/** Noise filter enable, CSL_PREV_NF_ENABLE, CSL_PREV_NF_DISABLE*/
	Uint8 nfEnable;
	/** CFA enable, CSL_PREV_CFA_ENABLE, CSL_PREV_CFA_DISABLE */
	Uint8 cfaEnable;
	/** Non-linear enhancer enable, CSL_PREV_NL_YENH_ENABLE, CSL_PREV_NL_YENH_DISABLE*/
	Uint8 yenhEnable;	
	/** Color suppression enable, CSL_PREV_SUP_ENABLE, CSL_PREV_SUP_DISABLE*/
	Uint8 csupEnable;	
	/** Gamma table bypass, CSL_PREV_GAMMA_ENABLE, CSL_PREV_GAMMA_BYPASS */
	Uint8 gammaBypass;

} CSL_PrevModeData;

/** @brief PREV Horizontal & Verical Pixel Start & End Info structure.
*
* All fields needed for Horizontal & Vertical Pixel Start & End Info are present 
* in this structure.
*/
typedef struct CSL_PrevHorzVertData_{
	/** Start Pixel, horizontal */
	Uint16 startPixelHorz;
	/** End Pixel, horizontal */
	Uint16 endPixelHorz;
	/** Start Line, vertical */
	Uint16 startLineVert;
	/** End Lines, vertical */
	Uint16 endLineVert;
}CSL_PrevHorzVertData;

/** @brief This is used for setting the CFA values
* 
* The pointer to this structure is given to the CSL APIs
*
*/
typedef struct CSL_PrevCFAData_{
	/** @brief CFA format used 
	 *	CSL_PREV_CFAFMT_CONV_BAYER, 			Conventional Bayer pattern
	 *	CSL_PREV_CFAFMT_SONY_VGAMODE, 			Sony VGA mode, horizontal 2x downsample in CFA
	 * 	CSL_PREV_CFAFMT_RGBFOVEON_BYPASSCFA	RGB,Foveon (does not use coefficients)
	 *	CSL_PREV_CFAFMT_V_AND_H_2X_DNSAMPLE, 	Vertical and horizontal 2x downsample (does not use coefficients)
	 *	CSL_PREV_CFAFMT_FUJI_HONEYCOMB, 		Fuji Honeycomb movie mode sensor
	 *  CSL_PREV_CFAFMT_RRRGGGBBBFOVEON, 		RRRR GGGG BBBB Foveon mode (does not use coefficients)
	 */
	Uint8 cfaFormat;
	/** Gradient threshold vertical*/
	Uint8 vGradThres;
	/** Gradient threshold horizontal*/
	Uint8 hGradThres;
	/** CFA coefficient table data (if a null pointer is passed, no CFA coefficients will be loaded)  */
	Uint32 *cfaCoefTable;

} CSL_PrevCFAData;

/** @brief This structure is used for setting up the horizontal median filter 
*
*
*/
typedef struct CSL_PrevHMedData_{
	/** Distance between consecutive pixels of same color in the odd line 
		CSL_PREV_HMEDIAN_ODDDIST_1PIXEL, 	
		CSL_PREV_HMEDIAN_ODDDIST_2PIXELS	*/
	Uint8 oddDistHMed;
	/** Distance between consecutive pixels of same color in the even line 
		CSL_PREV_HMEDIAN_EVENDIST_1PIXEL, 
		CSL_PREV_HMEDIAN_EVENDIST_2PIXELS	*/
	Uint8 evenDistHMed;
	/** Horizontal median filter threshold */
	Uint8 thresHMed;
} CSL_PrevHMedData;

/** @brief This is used for setting the noise filter strength
* 
* The pointer to this structure is given to the CSL APIs
*
*/
typedef struct CSL_PrevNFData_{
	/** Strength to use for the noise filter
	 *  	x = ((x * (16-STRNGTH)) + (ave * STRNGTH)) >> 4 
	 */
	Uint8 nfStrength;
	/** Noise filter table data (if a null pointer is passed, no NF coefficients will be loaded) */
	Uint32 *nfTable;

} CSL_PrevNFData;

/** @brief This structure is used for setting up the Input formatter/Averager 
*
*
*/
typedef struct CSL_PrevAveData_{
	/** Distance between consecutive pixels of same color in the odd line 
		CSL_PREV_AVERAGE_ODDDIST_1PIXEL, 		
		CSL_PREV_AVERAGE_ODDDIST_2PIXELS,	
		CSL_PREV_AVERAGE_ODDDIST_3PIXELS, 	
		CSL_PREV_AVERAGE_ODDDIST_4PIXELS	*/
	Uint8 oddDistAve;
	/** Distance between consecutive pixels of same color in the even line 
		CSL_PREV_AVERAGE_EVENDIST_1PIXEL,	
		CSL_PREV_AVERAGE_EVENDIST_2PIXELS,	
		CSL_PREV_AVERAGE_EVENDIST_3PIXELS,	
		CSL_PREV_AVERAGE_EVENDIST_4PIXELS		*/
	Uint8 evenDistAve;
	/** Number of horizontal pixels to average
		CSL_PREV_AVE_NOAVERAGING,			
		CSL_PREV_AVE_2PIXEL_AVG,				
		CSL_PREV_AVE_4PIXEL_AVG,				
		CSL_PREV_AVE_8PIXEL_AVG			*/
	Uint8 numPixelsAve;
} CSL_PrevAveData;

/** @brief This structure is used for setting up the White balance coefficients
*
*
*/
typedef struct CSL_PrevWBalData_{
	/** Digital gain for the white balance (U10Q8) 
	 *  can change anytime following the start of a frame
	 *
	 */
    Uint16 dGain;
	/** White balance gain - COEF 3 (U8Q5)
	 *  can change anytime following the start of a frame
	 *
	 */
	Uint8 coef3;
	/** White balance gain - COEF 2 (U8Q5)
	 *  can change anytime following the start of a frame
	 *
	 */
    Uint8 coef2;
    /** White balance gain - COEF 1 (U8Q5)
	 * can change anytime following the start of a frame
	 *
	 */
    Uint8 coef1;
    /** White balance gain - COEF 0 (U8Q5)
	 *  can change anytime following the start of a frame
	 *
	 */
    Uint8 coef0;
} CSL_PrevWBalData;


/** @brief This structure is used for setting Black level adjustment offsets
*
*
*/
typedef struct CSL_PrevBlackAdjData_{
	/** Black level offset adjustment for Red in 2's complement format*/
	Uint8 red;
	/** Black level offset adjustment for Green in 2's complement format*/
	Uint8 green;
	/** Black level offset adjustment for Blue in 2's complement format*/
	Uint8 blue;

} CSL_PrevBlackAdjData;


/** @brief This structure is used for setting RGB2RGB blending gains and offsets
*
*
*/
typedef struct CSL_PrevRGB2RGBData_{
	/** Blending values(S12Q8 format)
     *		[RR] [GR] [BR]
	 *		[RG] [GG] [BG]
	 *		[RB] [GB] [BB]		
	 */
	Uint16 matrix[3][3];		
	/** Blending offset value for R,G and B in 2's complement integer format*/
	Uint16 offset[3];
} CSL_PrevRGB2RGBData;

/** @brief This structure is used for setting Color space converter parameters
*
*
*/
typedef struct CSL_PrevCSCData_{
	/** Color space conversion coefficients(S10Q8)
	 *		[CSCRY]  [CSCGY]  [CSCBY]
	 *		[CSCRCB] [CSCGCB] [CSCBCB]
	 *		[CSCRCR] [CSCGCR] [CSCBCR]
	 */
	Uint16 matrix[3][3];		
	/** CSC offset values for Y offset, CB offset and CR offset respectively
	 *	DC Offset value for Y
	 *		Yout = Yin + YOFST  ( -128:127 )
	 *	DC Offset value for Cb (S8Q7)
	 *		Cout = Cin + OFSTCB ( -128:127 )
	 *	DC Offset value for Cr (S8Q7)
	 *		Cout = Cin + OFSTCR ( -128:127 ) 
	 */ 
	Int8 offset[3];
} CSL_PrevCSCData;

/** @brief This structure is used for setting the brightness and contrast
*	values
*
*/
typedef struct CSL_PrevCntBrtData_{
	/** Contrast Adjustment Sets the contrast of the Y data.  
	 * Precision is U8Q4, i.e ( 0 to 15.9375 ).
	 * Applied after offset adjustments
	 */
	Uint8 contrast;
	/** Brightness Adjustment 
	 *  Sets the brightness of Y data ( 0 to 255 )
	 * Applied after contrast adjustments
	 */
	Uint8 brightness;
} CSL_PrevCntBrtData;

/** @brief This structure is used for setting the Chroma suppression 
*   values
*/
typedef struct CSL_PrevCSupData_{
	/** Use HPF of Luminance for chroma suppression: CSL_PREV_CSUP_HPF_ENABLE, CSL_PREV_CSUP_HPF_DISABLE*/
	Uint8 hpf;
	/** Chroma Suppression Threshold*/
	Uint8 threshold;
	/** Gain value for Chroma Suppression Function
	 *  Precision is U8Q8  i.e ( 0 to 0.99609375 )
	 *
	 */
	Uint8 gain;
} CSL_PrevCSupData;

/** @brief This structure is used for setting the YC values.
*
*/
typedef struct CSL_PrevYCData_{
	/** Maximum Y value, values greater than set value are clipped to the set value*/
	Uint8 maxY;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -