📄 csl_prev.h
字号:
/** @mainpage PREV CSL 3.x
*
* @section Introduction
*
* @subsection xxx Purpose and Scope
* The purpose of this document is to identify a set of common CSL APIs for
* the PREV module across various devices. The CSL developer is expected to
* refer to this document while designing APIs for these modules. Some of the
* listed APIs may not be applicable to a given PREV module. While other cases
* this list of APIs may not be sufficient to cover all the features of a
* particular PREV Module. The CSL developer should use his discretion designing
* new APIs or extending the existing ones to cover these.
*
* @subsection aaa Terms and Abbreviations
* -# CSL: Chip Support Library
* -# API: Application Programmer Interface
*
* @subsection References
* -# CSL-001-DES, CSL 3.x Design Specification DocumentVersion 1.02
* -# PREV_SPEC, PREV Detailed Design Specification, Version 1.00.w.31
*
*/
/** @file csl_prev.h
*
* @brief Header file for functional layer of CSL
*
* Description
* - The different enumerations, structure definitions
* and function declarations
*
* @date 8th October,2004
* @author Vignesh LA.
*
*/
#ifndef _CSL_PREV_H_
#define _CSL_PREV_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <cslr.h>
#include <csl_error.h>
#include <csl_sysData.h>
#include <csl_types.h>
#include <cslr_prev.h>
/**************************************************************************\
* PREV global macro declarations
\**************************************************************************/
/* the Field INSert and Fail NonReset macro */
#define CSL_FINSFNR(reg, PER_REG_FIELD, PER_FAIL_FIELD, val) \
((reg) = (((reg) & ~CSL_##PER_REG_FIELD##_MASK) \
| CSL_FMK(PER_REG_FIELD, val)) & ~CSL_FMK(PER_FAIL_FIELD, 1))
/** Constants for passing parameters to the PREV Hardware Setup function
*/
/** For indicating that the PREV module is enabled */
#define CSL_PREV_ENABLE (CSL_PREV_PCR_ENABLE_PREV_ENABLE)
/** For indicating that the PREV module is disabled */
#define CSL_PREV_DISABLE (CSL_PREV_PCR_ENABLE_PREV_DISABLE)
/** For indicating that the PREV module is busy */
#define CSL_PREV_BUSY (CSL_PREV_PCR_BUSY_BUSY)
/** For indicating that the PREV module is not busy */
#define CSL_PREV_NOT_BUSY (CSL_PREV_PCR_BUSY_NOTBUSY)
/** For indicating that the darkframe subtract was sucessful */
#define CSL_PREV_DRK_FRAME_PASS (CSL_PREV_PCR_DRK_FAIL_PASS)
/** For indicating that the darkframe subtract failed */
#define CSL_PREV_DRK_FRAME_FAIL (CSL_PREV_PCR_DRK_FAIL_FAIL)
/** For indicating that the gamma correction is enabled */
#define CSL_PREV_GAMMA_ENABLE (CSL_PREV_PCR_GAMMA_BYPASS_NO_BYPASS)
/** For indicating that the gamma correction is bypassed */
#define CSL_PREV_GAMMA_BYPASS (CSL_PREV_PCR_GAMMA_BYPASS_BYPASS)
/** For indicating that the shading compensation is enabled */
#define CSL_PREV_SHADE_COMP_ENABLE (CSL_PREV_PCR_SHADE_COMP_ENABLE)
/** For indicating that the shading compensation is disabled */
#define CSL_PREV_SHADE_COMP_DISABLE (CSL_PREV_PCR_SHADE_COMP_DISABLE)
/** For indicating that the output port to sdram is enabled */
#define CSL_PREV_SDRPORT_ENABLE (CSL_PREV_PCR_SDRPORT_ENABLE)
/** For indicating that the output port to sdram is disabled */
#define CSL_PREV_SDRPORT_DISABLE (CSL_PREV_PCR_SDRPORT_DISABLE)
/** For indicating that the output port to resizer is enabled */
#define CSL_PREV_RSZPORT_ENABLE (CSL_PREV_PCR_RSZPORT_ENABLE)
/** For indicating that the output port to sdram is disabled */
#define CSL_PREV_RSZPORT_DISABLE (CSL_PREV_PCR_RSZPORT_DISABLE)
/** For indicating that the YC position is: Y1(31:24) Cr0(23:16) Y0(15:8) Cb0(7:0) */
#define CSL_PREV_YCPOS_YCRYCB (CSL_PREV_PCR_YCPOS_YCRYCB)
/** For indicating that the YC position is: Y1(31:24) Cb0(23:16) Y0(15:8) Cr0(7:0) */
#define CSL_PREV_YCPOS_YCBYCR (CSL_PREV_PCR_YCPOS_YCBYCR)
/** For indicating that the YC position is: Cb0(31:24) Y1(23:16) Cr(15:8) Y0(7:0) */
#define CSL_PREV_YCPOS_CBYCRY (CSL_PREV_PCR_YCPOS_CBYCRY)
/** For indicating that the YC position is: Cr0(31:24) Y1(23:16) Cb0(15:8) Y0(7:0) */
#define CSL_PREV_YCPOS_CRYCBY (CSL_PREV_PCR_YCPOS_CRYCBY)
/** For indicating that the color suppression is enabled */
#define CSL_PREV_SUP_ENABLE (CSL_PREV_PCR_SUPEN_ENABLE)
/** For indicating that the color suppression is disabled */
#define CSL_PREV_SUP_DISABLE (CSL_PREV_PCR_SUPEN_DISABLE)
/** For indicating that the non-linear luminance enhancer is enabled */
#define CSL_PREV_NL_YENH_ENABLE (CSL_PREV_PCR_YNENHEN_ENABLE)
/** For indicating that the non-linear luminance enhancer is disabled */
#define CSL_PREV_NL_YENH_DISABLE (CSL_PREV_PCR_YNENHEN_DISABLE)
/** For indicating that the CFA format is conventional bayer pattern */
#define CSL_PREV_CFAFMT_CONV_BAYER (CSL_PREV_PCR_CFAFMT_CONV_BAYER)
/** For indicating that the CFA format is Sony VGA mode, horz 2x downsample in CFA */
#define CSL_PREV_CFAFMT_SONY_VGAMODE (CSL_PREV_PCR_CFAFMT_SONY_VGAMODE)
/** For indicating that the CFA format is RGB Foveon (bypass CFA) */
#define CSL_PREV_CFAFMT_RGBFOVEON_BYPASSCFA (CSL_PREV_PCR_CFAFMT_RGBFOVEON_BYPASSCFA)
/** For indicating that the CFA format is vertical & horizontal 2x downsample */
#define CSL_PREV_CFAFMT_V_AND_H_2X_DNSAMPLE (CSL_PREV_PCR_CFAFMT_V_AND_H_2X_DNSAMPLE)
/** For indicating that the CFA format is Fuji Honeycomb movie mode sensor */
#define CSL_PREV_CFAFMT_FUJI_HONEYCOMB (CSL_PREV_PCR_CFAFMT_FUJI_HONEYCOMB)
/** For indicating that the CFA format is RRR GGG BBB Foveon (bypass CFA) */
#define CSL_PREV_CFAFMT_RRRGGGBBBFOVEON (CSL_PREV_PCR_CFAFMT_RRRGGGBBBFOVEON)
/** For indicating that the color filter array is enabled */
#define CSL_PREV_CFA_ENABLE (CSL_PREV_PCR_CFAEN_ENABLE)
/** For indicating that the color filter array is disabled */
#define CSL_PREV_CFA_DISABLE (CSL_PREV_PCR_CFAEN_DISABLE)
/** For indicating that the noise filter is enabled */
#define CSL_PREV_NF_ENABLE (CSL_PREV_PCR_NFEN_ENABLE)
/** For indicating that the noise filter is disabled */
#define CSL_PREV_NF_DISABLE (CSL_PREV_PCR_NFEN_DISABLE)
/** For indicating that the horizontal median filter is enabled */
#define CSL_PREV_HMED_ENABLE (CSL_PREV_PCR_HMEDEN_ENABLE)
/** For indicating that the horizontal median filter is disabled */
#define CSL_PREV_HMED_DISABLE (CSL_PREV_PCR_HMEDEN_DISABLE)
/** For indicating that the darkframe capture is enabled */
#define CSL_PREV_DRKF_CAP_ENABLE (CSL_PREV_PCR_DRKFCAP_CAPT_DK_FRM)
/** For indicating that the darkframe capture is disabled */
#define CSL_PREV_DRKF_CAP_DISABLE (CSL_PREV_PCR_DRKFCAP_NORMAL)
/** For indicating that the darkframe subtract is enabled */
#define CSL_PREV_DRKF_SUB_ENABLE (CSL_PREV_PCR_DRKFEN_ENABLE)
/** For indicating that the darkframe subtract is disabled */
#define CSL_PREV_DRKF_SUB_DISABLE (CSL_PREV_PCR_DRKFEN_DISABLE)
/** For indicating that the inverse A-law is enabled */
#define CSL_PREV_INV_ALAW_ENABLE (CSL_PREV_PCR_INVALAW_ENABLE)
/** For indicating that the inverse A-law is disabled */
#define CSL_PREV_INV_ALAW_DISABLE (CSL_PREV_PCR_INVALAW_DISABLE)
/** For indicating that the input data width is 10 bits wide */
#define CSL_PREV_IN_WIDTH_10_BITWIDE (0) //(CSL_PREV_PCR_WIDTH_10_BITWIDE)
/** For indicating that the input data width is 8 bits wide */
#define CSL_PREV_IN_WIDTH_8_BITWIDE (1) //(CSL_PREV_PCR_WIDTH_8_BITWIDE)
/** For indicating that the PREV operates in continuous mode via the video port */
#define CSL_PREV_CONTINUOUS_VIA_VPORT (CSL_PREV_PCR_ONESHOT_CONTINUOUS_VIA_VPORT)
/** For indicating that the PREV operates in one shot mode via the video port */
#define CSL_PREV_ONESHOTMODE (CSL_PREV_PCR_ONESHOT_ONESHOTMODE)
/** For indicating that the source of data to the PREV is the CCDC via the video port */
#define CSL_PREV_SOURCE_CCDC (CSL_PREV_PCR_SOURCE_VPORT_VIA_CCDC)
/** For indicating that the source of data to the PREV is SDRAM */
#define CSL_PREV_SOURCE_SDRAM (CSL_PREV_PCR_SOURCE_SDRAM)
/** For indicating that the distance between consecutive pixels of same color in odd line is 1 */
#define CSL_PREV_AVERAGE_ODDDIST_1PIXEL (CSL_PREV_AVE_ODDDIST_1PIXEL)
/** For indicating that the distance between consecutive pixels of same color in odd line is 2 */
#define CSL_PREV_AVERAGE_ODDDIST_2PIXELS (CSL_PREV_AVE_ODDDIST_2PIXELS)
/** For indicating that the distance between consecutive pixels of same color in odd line is 3 */
#define CSL_PREV_AVERAGE_ODDDIST_3PIXELS (CSL_PREV_AVE_ODDDIST_3PIXELS)
/** For indicating that the distance between consecutive pixels of same color in odd line is 4 */
#define CSL_PREV_AVERAGE_ODDDIST_4PIXELS (CSL_PREV_AVE_ODDDIST_4PIXELS)
/** For indicating that the distance between consecutive pixels of same color in even line is 1 */
#define CSL_PREV_AVERAGE_EVENDIST_1PIXEL (CSL_PREV_AVE_EVENDIST_1PIXEL)
/** For indicating that the distance between consecutive pixels of same color in even line is 2 */
#define CSL_PREV_AVERAGE_EVENDIST_2PIXELS (CSL_PREV_AVE_EVENDIST_2PIXELS)
/** For indicating that the distance between consecutive pixels of same color in even line is 3 */
#define CSL_PREV_AVERAGE_EVENDIST_3PIXELS (CSL_PREV_AVE_EVENDIST_3PIXELS)
/** For indicating that the distance between consecutive pixels of same color in even line is 4 */
#define CSL_PREV_AVERAGE_EVENDIST_4PIXELS (CSL_PREV_AVE_EVENDIST_4PIXELS)
/** For indicating that no averaging should be done */
#define CSL_PREV_AVE_NOAVERAGING (CSL_PREV_AVE_COUNT_NOAVERAGING)
/** For indicating that 2 pixels should be averaged */
#define CSL_PREV_AVE_2PIXEL_AVG (CSL_PREV_AVE_COUNT_2PIXEL_AVG)
/** For indicating that 4 pixels should be averaged */
#define CSL_PREV_AVE_4PIXEL_AVG (CSL_PREV_AVE_COUNT_4PIXEL_AVG)
/** For indicating that 8 pixels should be averaged */
#define CSL_PREV_AVE_8PIXEL_AVG (CSL_PREV_AVE_COUNT_8PIXEL_AVG)
/** For indicating that the distance between consecutive pixels of same color in odd line is 1 */
#define CSL_PREV_HMEDIAN_ODDDIST_1PIXEL (CSL_PREV_HMED_ODDDIST_1PIXEL)
/** For indicating that the distance between consecutive pixels of same color in odd line is 2 */
#define CSL_PREV_HMEDIAN_ODDDIST_2PIXELS (CSL_PREV_HMED_ODDDIST_2PIXELS)
/** For indicating that the distance between consecutive pixels of same color in even line is 1 */
#define CSL_PREV_HMEDIAN_EVENDIST_1PIXEL (CSL_PREV_HMED_EVENDIST_1PIXEL)
/** For indicating that the distance between consecutive pixels of same color in even line is 2 */
#define CSL_PREV_HMEDIAN_EVENDIST_2PIXELS (CSL_PREV_HMED_EVENDIST_2PIXELS)
/** For indicating that the chroma suppression should use luminance with the high pass filter */
#define CSL_PREV_CSUP_HPF_ENABLE (CSL_PREV_CSUP_HPFY_ENABLE)
/** For indicating that the chroma suppression should use luminance without the high pass filter */
#define CSL_PREV_CSUP_HPF_DISABLE (CSL_PREV_CSUP_HPFY_DISABLE)
/**************************************************************************\
* PREV global typedef declarations
\**************************************************************************/
/** @brief Enumeration for queries passed to @a CSL_prevGetHwStatus()
*
* This is used to get the status of different operations or to get the
* existing setup of PREV.
*/
typedef enum {
/** Get the PREV module ID and revision numbers (response type: @a (CSL_PrevRevStatus*)) */
CSL_PREV_QUERY_REV_ID = 1,
/** Get the PREV busy status (response type: @a Uint16 *) */
CSL_PREV_QUERY_IS_BUSY,
/** Get the Dark frame subtract fail status and clears the flag if failed (response type: @a Uint16 *)*/
CSL_PREV_QUERY_DRK_FAIL,
/** Gets the output size of the preview engine, after all other registers are set, except the preview
enable (response type: @a (CSL_PrevOutSizeData *) */
CSL_PREV_QUERY_OUT_SIZE,
/** Called after settings are set, checks to see if any interdependant
setting restrictions are violated (response type: @a (Uint32*) )
If there are no violations, the function will return a CSL_SOK condition
and the response value will be equal to 0. If there are any violations,
the function will return the CSL_ESYS_FAIL error and the response value will
have bits set which indicate any violations found. The following are the
violation codes for the bits of the response variable:
0: Output Width is over the limit (max: 1280 pixels)
1: Output Width is not even
2: Input Width is not a multiple of the AVE parameters
3. Input to the Horizontal Median filter is not even
4: Horizontal median filter is not supported for foveon formatted input
5: Noise filter is not supported for foveon formatted input
6: Input width is larger than CCDC output width
7: Input height is larger than CCDC output height
8 - 31: RESERVED
*/
CSL_PREV_QUERY_CHECK_SETTINGS
} CSL_PrevHwStatusQuery;
/** @brief Enumeration for cmd passed to @a CSL_prevHwControl()
*
* This is used to select the commands to control the operations
* existing setup of PREV. The arguments to be passed with each
* enumeration if any are specified next to the enumeration.
*/
typedef enum {
/** Enable/Disable the preview engine : argument @a (Uint16*)
CSL_PREV_DISABLE, CSL_PREV_ENABLE */
CSL_PREV_CMD_ENABLE = 1,
/** Enable sublocks in the preview engine : argument @a (CSL_PrevModeData *) */
CSL_PREV_CMD_SET_MODE,
/** Set the CFA : argument @a (CSL_PrevCFAData *) */
CSL_PREV_CMD_SET_CFA,
/** Set the input formatter/averager : argument @a (CSL_PrevAveData *)
(If darkframe is enabled when this command is called,
the CSL_ESYS_NOTSUPPORTED error will be returned) */
CSL_PREV_CMD_SET_AVG,
/** Set the Noise filter : argument @a (CSL_PrevNFData *) */
CSL_PREV_CMD_SET_NOISE_FILTER,
/** Set the Horizontal median filter : argument @a (CSL_PrevHMedData *)*/
CSL_PREV_CMD_SET_HORIZ_MEDIAN_FILTER,
/** Set the Shading compensation right shift after multiplication
: argument @a (Uint8*) shadingShift
valid range for shadingShift (0:7) bits*/
CSL_PREV_CMD_SET_SHADING_COMP,
/** Set White balance coefficients : argument @a (CSL_PrevWBalData *) */
CSL_PREV_CMD_SET_WHITE_BALANCE,
/** Select the White balance coefficients for the matrix : argument @a (Uint8*) coefMatrix[4][4]
(matrix[line#(0:3)][pixel#(0:3)])*/
CSL_PREV_CMD_WB_COEF_SELECT,
/** Set the black level adjustment values : argument @a (CSL_PrevBlackAdjData *)*/
CSL_PREV_CMD_SET_BLACK_LEVEL_ADJUSTMENT,
/** Set the RGB2RGB blending values : argument @a (CSL_PrevRGB2RGBData *) */
CSL_PREV_CMD_SET_RGB2RGB,
/** Set the color space converter : argument @a (CSL_PrevCSCData *)*/
CSL_PREV_CMD_SET_CSC,
/** Set the brightness and contrast : argument @a (CSL_PrevCntBrtData *) */
CSL_PREV_CMD_SET_CONTRAST_BRIGHNESS,
/** Set the Chroma suppression : argument @a (CSL_PrevCSupData *)*/
CSL_PREV_CMD_SET_CHROMA_SUPPRESSION,
/** Set the YC values : argument @a (CSL_PrevYCData *) */
CSL_PREV_CMD_SET_YC,
/** Enable the Gamma correction using gamma tables written : argument @a (Uint16*)
CSL_PREV_GAMMA_ENABLE, CSL_PREV_GAMMA_BYPASS*/
CSL_PREV_CMD_ENABLE_GAMMA,
/** Write a table to the embedded memory of the preview engine : argument @a (CSL_PrevWriteTableData *)*/
CSL_PREV_CMD_WRITE_TABLE,
/** Set the Read address : argument @a (Uint32*)
(If the value is not on a 32 byte boundary,
the CSL_ESYS_INVPARAMS error will be returned) */
CSL_PREV_CMD_SET_READ_ADDRESS,
/** Set the Dark frame address : argument @a (Uint32*)
(If the value is not on a 32 byte boundary,
the CSL_ESYS_INVPARAMS error will be returned)*/
CSL_PREV_CMD_SET_DF_ADDRESS,
/** Set the Write address : argument @a (Uint32*)
(If the value is not on a 32 byte boundary,
the CSL_ESYS_INVPARAMS error will be returned)*/
CSL_PREV_CMD_SET_WRITE_ADDRESS,
/** Set the Read offset : argument @a (Uint16*)
(If the value is not on a 32 byte boundary,
the CSL_ESYS_INVPARAMS error will be returned)*/
CSL_PREV_CMD_SET_READ_OFFSET,
/** Set the Dark frame offset argument @a (Uint16*)
(If the value is not on a 32 byte boundary,
the CSL_ESYS_INVPARAMS error will be returned)*/
CSL_PREV_CMD_SET_DF_OFFSET,
/** Set the Write offset argument @a (Uint16*)
(If the value is not on a 32 byte boundary,
the CSL_ESYS_INVPARAMS error will be returned)*/
CSL_PREV_CMD_SET_WRITE_OFFSET,
/** Enable/Disable one shot mode: argument @a (Uint16*)
CSL_PREV_CONTINUOUS_VIA_VPORT, CSL_PREV_ONESHOTMODE */
CSL_PREV_CMD_ONE_SHOT_ENABLE,
/** Enable/Disable the SDRAM output port: argument @a (Uint16*)
CSL_PREV_SDRPORT_ENABLE, CSL_PREV_SDRPORT_DISABLE */
CSL_PREV_CMD_SDRAM_OUTPUT_ENABLE,
/** Enable/Disable the Reszier output port: argument @a (Uint16*)
CSL_PREV_RESZPORT_ENABLE, CSL_PREV_SDRPORT_DISABLE */
CSL_PREV_CMD_RSZ_OUTPUT_ENABLE,
/** Set the input source : argument @a (Uint16*)
CSL_PREV_SOURCE_CCDC, CSL_PREV_SOURCE_SDRAM */
CSL_PREV_CMD_SET_INPUT_SOURCE,
/** Set the input bit width : argument @a (Uint16*)
CSL_PREV_IN_WIDTH_10_BITWIDE, CSL_PREV_IN_WIDTH_8_BITWIDE */
CSL_PREV_CMD_SET_INPUT_BIT_WIDTH,
/** Set the horizontal and vertical information: argument @a
(CSL_PrevHorzVertData *) */
CSL_PREV_CMD_SET_HORZ_VERT,
/** Set the input and output port related information: argument @a
(CSL_PrevPortData *) */
CSL_PREV_CMD_SET_PORTS
} CSL_PrevHwControlCmd;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -