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

📄 csl_resz.h

📁 TI达芬奇dm644x各硬件模块测试代码
💻 H
📖 第 1 页 / 共 2 页
字号:
 * This structure is used to obtain the input starting information of
 * RESZ @ CSL_reszHwControl() function
 */

 typedef struct CSL_ReszStartInfo {
         /** horizontal starting location (in bytes if not from memory) */
         Uint16 hStart;
		 /** vertical starting line */
         Uint16 vStart;
 }CSL_ReszStartInfo;

/**
 * This structure is used to obtain the all luminance enhancer
 * paramaters of
 * RESZ @ CSL_reszHwControl() function
 */

 typedef struct CSL_ReszLumEnhance {
         /** luminance algo:
			CSL_RESZ_YENH_DISABLE
			CSL_RESZ_YENH_HPF_3TAP
			CSL_RESZ_YENH_HPF_5TAP */
         Uint16 lumAlgo;
         /** max gain*/
         Uint16 lumMaxGain;
         /** slope */
         Uint16 lumSlope;
         /**coring offset */
         Uint16 lumOffset;
}CSL_ReszLumEnhance;

/**
 * This structure is used to obtain the all paramaters of
 * RESZ @ CSL_reszCalcReszValue() function
 */

 typedef struct CSL_ReszCalcReszVal_ {
         /** input size			(value optional)*/
         Uint16 *input;
         /** output size		(value required)*/
         Uint16 *output;
         /** starting phase		(value adjusted)*/
         Uint8 *phase;
         /** resize ratio		(value optional)*/
         Uint16 *ratio;
         /** start pixel adjust (value returned)*/
         Int16  stPix;
		 /** Is this in the horizontal direction? TRUE, FALSE*/
		 Bool horzDir;
		 /** If the input is specified, is this in the maximum input available? TRUE, FALSE
		 (This is used since the resizer filter requires extra input at the end of each line and 
		  the frame.  The case where this has to be TRUE, is where the input is from the PREV engine
		  and the entire image must be resized (there is no extra padding available from the PREV)
		  If TRUE, then the resizer calculates the ratio in such a way that the input remains <= the
		  requested input.
		  If FALSE, then the resizer calculates the ratio assuming the input has extra or padded data,
		  and will return the input size with pad added which is required for the register setting)*/
		 Bool inMax;
		 /** If the input is specified, horzDir is TRUE, and inMax is TRUE, is the input from SDRAM? TRUE, FALSE
		 (When the input is specified, the calculation is in the horizontal direction, the inMax is 
		  TRUE, and the input source is not from SDRAM, a certain harware implementation of the filter
		  alingment requires additional input pixels at the end of each line which must be accounted for. 
		  */
		 Bool inSdram;
}CSL_ReszCalcReszVal;

/**
 * This structure is used to obtain the all paramaters of
 * RESZ @ CSL_reszCalcSlicing() function
 */

 typedef struct CSL_ReszSliceInfo_ {
         /** input width		*/
         Uint16 inWidth;
         /** output width		*/
         Uint16 outWidth;
         /** starting phase		*/
         Uint8 stPhase;
         /** starting pixel		*/
         Uint8 stPix;
         /** input starting address */
         Uint32 *inAddr;
         /** output starting address */
         Uint32 *outAddr;
}CSL_ReszSliceInfo;


/** @brief This has all the fields required to configure RESZ at Power Up
 *  (After a Hardware Reset) or a Soft Reset
 *
 *  This structure is used to setup the RESZ using @a CSL_reszHwSetup()
 *	or can be used to calculate the inputSize or resize ratios or resizer 
 *  coefficients using the @a CSL_reszCalcHwSetup() function.
 */
typedef struct CSL_ReszHwSetup_ {

	/** The following parameters are REQUIRED. If a NULL pointer is passed to the 
	 *	following paramters, then an error will be returned.  Default structures 
	 *	are available in the csl_resz_defaults.h for use here.
	 */

		/** Input Source 
			CSL_RESZ_INPUT_PREVIEW, 
			CSL_RESZ_INPUT_SDRAM, 
			CSL_RESZ_INPUT_CCDC */
		CSL_ReszInputSource inputSource;
		/** Input type: CSL_RESZ_TYPE_INTERLEAVED, CSL_RESZ_TYPE_SEPARATE*/
		Uint16 inputType;
		/** Position of Y & C in 16 bit word: CSL_RESZ_POS_YC, CSL_RESZ_POS_CY*/
		Uint16 ycPosition;
		/** Chrominance algorithm: CSL_RESZ_CHROM_ALGO_SAME_AS_LUMA, CSL_RESZ_CHROM_ALGO_BILINEAR*/
		Uint16 algorithm;

		/** Input horizontal & vertical starting position */
		CSL_ReszStartInfo		startPos;

		/** Input sizes before resizing */
		CSL_ReszSize			inputSize;
		/** Output sizes after resizing */
		CSL_ReszSize			outputSize;
		/** Horizontal & vertical resizing ratios */
		CSL_ReszResizeValue		ratios;
		/** Horizontal & vertical starting phases */   
		CSL_ReszStartPhase		startPhase;
		/** If the input is specified and the ratios will be calculated, 
		    is this in the maximum input available? TRUE, FALSE  (See comment in 
			CSL_ReszCalcReszVal struct) */
		Bool inMax;
		/** The number of slices required when resizing from SDRAM. This field can
			initialized to anything, the CSL_reszCalcHwSetup() function returns this field
			for use when determining if slicing is required (>1).  If slicing is required, 
			this field can also be used for allocating memory for assigning to the sliceInfo[]
			array, and indicating how many slice resize operations are needed for a whole image. */
		Uint8					numSlices;

		/** SDRAM byte address offset for the input line
			(must be 0 if source is not SDRAM) */
		Uint16 inputLineOffset;
		/** Input SDRAM byte address (must be on a 32 byte boundary)
			(must be 0 if source is not SDRAM) */
		Uint32 *inputAddr;
		/** SDRAM byte address offset for the output line */
		Uint16 outputLineOffset;
		/** Output SDRAM byte address (must be on a 32 byte boundary) */
		Uint32 *outputAddr;

	/** The following parameters are not required. If a NULL pointer is passed to the 
	 *	following paramters, then the data for these parameters will not be set.
	 */

		/** Horizontal & vertical filter coeffs */
		CSL_ReszFilterConfig	*filterCoeffs;
		/** Luminance Enhancement Configuration */
		CSL_ReszLumEnhance		*lumEnhance;
		/** Slice information (if necessary) */
		CSL_ReszSliceInfo		*sliceInfo;

}CSL_ReszHwSetup;


/**************************************************************************\
* RESZ global function declarations
\**************************************************************************/

/**  This function is idempotent in that calling it many times is same as
 *   calling it once. This function initializes the RESZ CSL data structures.
 *
 * <b> Usage Constraints: </b>
 * CSL system initialization must be successfully completed by invoking
 * @a CSL_sysInit() before calling this function. This function should be
 * called before using any of the CSL APIs
 *
 * @b Example:
 * @verbatim


   ...
   CSL_sysInit();
   if (CSL_SOK != CSL_reszInit()) {
       return;
   }
   @endverbatim
 *
 * @return returns the status of the operation
 *
 */
CSL_Status  CSL_reszInit(
   void
);


/** The open call sets up the data structures for the particular instance of
 *  RESZ device. The device can be re-opened anytime after it has been normally
 *  closed if so required. RESZ Hardware setup will be performed at the end of
 *  the open call only if the HwSetup Pointer supplied was non- NULL. The handle
 *  returned by this call is input as an essential argument for rest of the APIs
 *  described for this module.
 *
 *  <b> Usage Constraints: </b>
 *  The CSL system as well as resz must be successfully initialized
 *  via @a CSL_sysInit() and @a CSL_reszInit() before calling this
 *  function. Memory for the @a CSL_reszObj must be allocated outside
 *  this call. This object must be retained while usage of this peripheral.
 *
 *  @b Example:
 *  @verbatim

	  CSL_ReszObj     reszObj;
	  CSL_ReszHwSetup reszSetup;
	  CSL_Status       status;
 		...
	  hResz = CSL_reszOpen(&reszObj,
                          CSL_RESZ_0,
                          CSL_EXCLUSIVE,
                          &reszSetup,
                          &status);
   @endverbatim
 *
 * @return returns a handle @a CSL_ReszHandle to the requested instance of
 * RESZ if the call is successful, otherwise, a @a NULL is returned.
 *
 */
CSL_ReszHandle CSL_reszOpen (
    /** Pointer to the object that holds reference to the
     *  instance of RESZ requested after the call
     */
    CSL_ReszObj              *hReszObj,
    /** Instance of RESZ to which a handle is requested
     */
    CSL_ReszNum               reszNum,
    /** Specifies if RESZ should be opened with exclusive or
     *  shared access to the associate pins
     */
    CSL_OpenMode                openMode,
    /** This returns the status (success/errors) of the call
     */
    CSL_Status                  *status
);

/**  The Close call releases the resource and appropriate shared pins.
 *
 * <b> Usage Constraints: </b>
 * Both @a CSL_reszInit() and @a CSL_reszOpen() must be called successfully
 * in that order before @a CSL_reszClose() can be called.
 *
 * @b Example:
 * @verbatim


   CSL_ReszHandle hResz;
   ...
   CSL_reszClose(hResz);
   @endverbatim
 *
 * @return returns the status of the operation (see @a CSL_Status)
 *
 */
CSL_Status  CSL_reszClose(
    /** Pointer to the object that holds reference to the
     *  instance of RESZ requested after the call
     */
    CSL_ReszHandle                         hResz
);


/** This function initializes the device registers with the appropriate values
 *  provided through the HwSetup Data structure. This function needs to be called
 *  only if the HwSetup Structure was not previously passed through the Open call.
 *  After the Setup is completed, the serial device is ready for data transfer.
 *  For information passed through the HwSetup Data structure refer
 *  @a CSL_ReszHwSetup.
 *
 *  <b> Usage Constraints: </b>
 *  Both @a CSL_reszInit() and @a CSL_reszOpen() must be called
 *  successfully in that order before this function can be called. The user
 *  has to allocate space for & fill in the main setup structure appropriately
 *  before calling this function
 *
 * @b Example:
 * @verbatim
     CSL_ReszHandle hResz;
     CSL_ReszHwSetup hwSetup = CSL_RESZ_HWSETUP_DEFAULTS;
     CSL_reszHwSetup(hResz, &hwSetup);
  @endverbatim
 *
 * @return Returns the status of the setup operation
 *
 */
CSL_Status  CSL_reszHwSetup(
    /** Pointer to the object that holds reference to the
     *  instance of RESZ requested after the call
     */
    CSL_ReszHandle                         hResz,
    /** Pointer to setup structure which contains the
     *  information to program RESZ to a useful state
     */
    CSL_ReszHwSetup                        *setup
);

/** Control operations for the RESZ.  For a particular control operation, the
 *  pointer to the corresponding data type needs to be passed as argument HwControl
 *  function Call. All the arguments (Structure elements included) passed to  the
 *  HwControl function are inputs. For the list of commands supported and argument
 *  type that can be @a void* casted & passed with a particular command refer to
 *  @a CSL_ReszHwControlCmd.
 *
 *  <b> Usage Constraints: </b>
 *  Both @a CSL_reszInit() and @a CSL_reszOpen() must be called successfully
 *  in that order before @a CSL_reszHwControl() can be called. For the
 *  argument type that can be @a void* casted & passed with a particular command
 *  refer to @a CSL_ReszHwControlCmd
 *
 * @b Example:
 * @verbatim
       CSL_ReszHandle hResz;
       CSL_Status status;
       ...
       status = CSL_reszHwControl(hResz,
                                    CSL_RESZ_CMD_ENABLE,
                                   &command);
   @endverbatim
 *
 *  @return returns the status of the operation (see @a CSL_Status)
 *
 */
CSL_Status  CSL_reszHwControl(
    /** Pointer to the object that holds reference to the
     *  instance of RESZ requested after the call
     */
    CSL_ReszHandle                        hResz,
    /** The command to this API indicates the action to be taken
     */
    CSL_ReszHwControlCmd                  cmd,
    /** An optional argument @a void* casted
     */
    void                                 *arg
);

/** This function is used to read the current device configuration, status flags
 *  and the value present associated registers. Following table details the various
 *  status queries supported and the associated data structure to record the response.
 *  User should allocate memory for the said data type and pass its pointer as an
 *  unadorned void* argument to the status query call. For details about the various
 *  status queries supported and the associated data structure to record the response,
 *  refer to @a CSL_ReszHwStatusQuery
 *
 *  <b> Usage Constraints: </b>
 *  Both @a CSL_reszInit() and @a CSL_reszOpen() must be called successfully
 *  in that order before @a CSL_reszGetHwStatus() can be called. For the
 *  argument type that can be @a void* casted & passed with a particular command
 *  refer to @a CSL_ReszHwStatusQuery
 *
 * @b Example:
 * @verbatim
	  CSL_ReszHandle hResz;
	  CSL_Status status;
	  Uint16  response;
	   ...
	  status = CSL_reszGetHwStatus(hResz,
                           CSL_RESZ_QUERY_IS_BUSY,
                                  &response);
   @endverbatim
 *
 * @return Returns the status of the operation (see @a CSL_Status)
 *
 */
CSL_Status  CSL_reszGetHwStatus(
    /** Pointer to the object that holds reference to the
     *  instance of RESZ requested after the call
     */
    CSL_ReszHandle                         hResz,
    /** The query to this API which indicates the status
     *  to be returned
     */
    CSL_ReszHwStatusQuery                  query,
    /** Placeholder to return the status. @a void* casted */
    void                                    *response
);

#ifdef __cplusplus
}
#endif


#endif

⌨️ 快捷键说明

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