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

📄 vicp_comp.h

📁 vicp做为dm6446上的硬件加速器
💻 H
📖 第 1 页 / 共 5 页
字号:
/* ======================================================================== *//*  TEXAS INSTRUMENTS, INC.                                                 *//*                                                                          *//*  VICP Signal Processing Library                                          *//*                                                                          *//*  This library contains proprietary intellectual property of Texas        *//*  Instruments, Inc.  The library and its source code are protected by     *//*  various copyrights, and portions may also be protected by patents or    *//*  other legal protections.                                                *//*                                                                          *//*  This software is licensed for use with Texas Instruments TMS320         *//*  family DSPs.  This license was provided to you prior to installing      *//*  the software.  You may review this license by consulting the file       *//*  TI_license.PDF which accompanies the files in this library.             *//*                                                                          *//* ------------------------------------------------------------------------ *//*                                                                          *//* NAME                                                                     *//*   vicp_comp.h -- vicp computation unit function header file              *//*                                                                          *//* DESCRIPTION                                                              *//*   This  file includes symbols definitions and function's interfaces      *//*   that the application needs to use in order to use the VICP processing  */
/*   unit                                                                   */
/*                                                                          *//* REV                                                                      */
/*                                                                          *//*   version 0.0.1:  3rd Feb                                                */
/*   Initial version                                                        */
/*                                                                          *//* ------------------------------------------------------------------------ *//*            Copyright (c) 2008 Texas Instruments, Incorporated.           *//*                           All Rights Reserved.                           *//* ======================================================================== */


#ifndef __VICP_COMP_H__
#define __VICP_COMP_H__

#include "tistdtypes.h"

/*
    Symbols used to specify input and output data types passed to imxenc_<..> functions
*/
/* These symbols must only be used to specify input data, not output data */
#define IMXTYPE_UBYTE   0       /* signed byte */
#define IMXTYPE_BYTE    1       /* unsigned byte */
#define IMXTYPE_USHORT  2       /* signed Int16 */
#define IMXTYPE_SHORT   3       /* usigned Int16 */

/* These symbols must only be used to specify output data, not input data */
#define IMXOTYPE_BYTE   0       /* byte (signed or unsigned, doesn't matter for output) */
#define IMXOTYPE_SHORT  1       /* Int16 (signed or unsiged, doesn't matter for output) */

/*
    Symbols used to specify mathematical operations carried out
    by processing functions such as array_op, array_scalar_op, etc
*/
#define IMXOP_MPY       0
#define IMXOP_ABDF      1
#define IMXOP_ADD       2
#define IMXOP_SUB       3
#define IMXOP_TLU       4
#define IMXOP_AND       5
#define IMXOP_OR        6
#define IMXOP_XOR       7
#define IMXOP_MIN       8
#define IMXOP_MAX       9
#define IMXOP_MINSAD    10
#define IMXOP_MAXSAD    11
#define IMXOP_MEDIAN    12
#define IMXOP_BINLOG    13
#define IMXOP_3DLUT     14
#define IMXOP_CONDWR    15                        

/* Set rounding on or off */
Int16 IMX_setRound(Int16 state);
/* Symbols used for rounding control, passed as input arguments to function IMX_setRound() */
#define IMX_ROUND_ON   0
#define IMX_ROUND_OFF  1

Int16 IMX_setSat(Int16 state);
/* Symbols used for saturation control, passed as input arguments to function IMX_setSat() */
#define IMX_SAT_ON     0
#define IMX_SAT_OFF    1

void IMX_setASAP(Int16 asap_enable);
/* Symbols used for ASAP mode, passed as input arguments to function IMX_setASAP() */
#define IMX_ASAP_ENABLE  1
#define IMX_ASAP_DISABLE 0

/*
 * Structure used to record current saturation values.
 * Each time imxenc_set_saturation() is called, the values passed as input parameters
 * are saved in this structure
 *
*/
typedef struct IMX_SatParams{
    Int16 sat_unsigned;    
    Int16 sat_high;   
    Int16 sat_high_set;  
    Int16 sat_low;       
    Int16 sat_low_set;   
} IMX_SatParamsStruct;

/* Encode 'set saturation parameters' command */
Int16 imxenc_set_saturation( 
  Int32 sat_high,        
  Int32 sat_high_set,    
  Int32 sat_low,         
  Int32 sat_low_set,     
  Int16 *cmd_ptr );

/* Encode 'set saturation parameters' command, legacy function, please use imxenc_set_saturation() */
Int16 imxenc_set_parameters_dav(
    Int16 sat_unsigned,    
    Int16 sat_high,        
    Int16 sat_high_set,    
    Int16 sat_low,         
    Int16 sat_low_set,     
    Int16 *cmd_ptr );

/* Encode 'set saturation parameters' command, legacy function, please use imxenc_set_saturation() */ 
#define imxenc_set_parameters(sat_h, sat_h_set, sat_l, sat_l_set, cmdptr)\
imxenc_set_parameters_dav(0, (sat_h), (sat_h_set), (sat_l), (sat_l_set), (cmdptr))
 
/* Save saturation parameters last used by  imxenc_set_saturation(), imxenc_set_parameters_dav() */
Int16 imxenc_save_sat_parameters(IMX_SatParamsStruct *imxsatparams);

/* Encode 'saturation command' using saturation parameters previously saved by imxenc_save_sat_parameters */
Int16 imxenc_restore_sat_parameters(IMX_SatParamsStruct *imxsatparams, Int16 *cmd_ptr);

/* Encode 'sleep' command */
Int16 imxenc_sleep(Int16 *cmdptr);

/* Encode 'call' command */
Int16 imxenc_call(Int16* cmdaddr, Int16 *cmd_p);

/* Encode' call until return' command */
Int16 imxenc_call_till_return( 
  Int16 *address,         
  Int16 *cmd_ptr );

/* Encode 'return' command */  
Int16 imxenc_return_cmd( 
  Int16 *cmd_ptr );

/* Encode 'command write' command */ 
Int16 imxenc_cmdwrite(Int16 *cmdaddr,
  Int16 *startaddr, Int16 number,
  Int16 *cmd_p);

/* Encode 'NOOP command' in command sequence pointed by cmd_p*/
Int16 imxenc_nop(Int16 *cmd_p);

/* Convert address in DSP memory map into VICP memory map.*/
Uint16 imxConvert_addr(Uint32 InitAddr, Int16 high_byte);

/* update input pointer given an address to command buffer*/
void imxUpdate_inputPtr(Int16 *data_init, Int16 highbyte_data, Int16 *cmdPtr);

/* update coef pointer given an address to command buffer  */
void imxUpdate_coefPtr(Int16 *coef_init, Int16 highbyte_coeff, Int16 *cmdPtr);

/* update output pointer given an address to cmd  buffer */
void imxUpdate_outputPtr(Int16 *outPtr, Int16 highbyte_out, Int16 *cmdPtr);

/* update shift value given an address to cmd  buffer */
void imxUpdate_shift(Int16 shiftval, Int16 *cmdPtr);

/* Update color format parameter of a pre-encoded sequence of commands previously generated */
/* by imxenc_alphaBlend() */
void imxUpdate_alphablend(Int16 *permScratch, Int16 colorformat, Int16 *cmdptr);

/* Update color format parameter of a pre-encoded sequence of commands previously generated */
/* by imxenc_rgbpack() */
void imxUpdate_rgbpack(Int16 *permScratch, Int16 colorformat);

/* Update color format parameter of a pre-encoded sequence of commands previously generated */
/* by imxenc_rgbunpack() */
void imxUpdate_rgbunpack(Int16 *scratch, Int16 colorformat, Int16 *cmdptr);

/* Update transparent parameter of a pre-encoded sequence of commands previously generated */
/* by imxenc_transparentblt() */
void imxUpdate_transparentblt(Int16 *permScratch, Uint16 transparentclr, Int16 *cmdptr);

/*============================================================================*/
/* Definitions of structure VICP_CheckPointStruct, global var VICP_checkpoint */
/* functions that can be used during debug process of VICP computation unit   */                                        
/*============================================================================*/

/*
 *  Structure that records name and location of checkpoints
 *  in command memory
 */
typedef struct {
 char label[32];
 Int16 *addr;
} VICP_CheckPointStruct;

/* If macro symbol _VICP_CHECK_POINT_ENABLED defined in project
then checkpoint/breakpoint capability is compiled in
*/
#ifdef _VICP_CHECK_POINT_ENABLED

/* Maximum of entries in checkpoint array IMX_checkpointList */
#define VICP_MAX_CHECKPOINTS 20

/*
 * Global array containing checkpoints in the VICP command memory
 *
 */
extern VICP_CheckPointStruct VICP_checkpoint[VICP_MAX_CHECKPOINTS];
/* Index of the next available entry in the check point list */
extern Uint16 VICP_checkPointIndex;

/* reset checkpoint index */
void IMX_resetCheckPointIndex();

/* return current index in the IMX_checkpointList */
Int16 IMX_getCheckPointIndex();

/* set current index in the IMX_checkpointList */
void IMX_setCheckPointIndex(Uint16 idx);

/* Add checkpoint in the checkpoint list and encode nop
at cmdptr location */
Int16 imxenc_addCheckPoint(char *label, Int16 *cmdptr);

#else

/* if the  _VICP_CHECK_POINT_ENABLED not defined then we redefine the
function as empty macro so they don't get compiled in
*/
#define IMX_resetCheckPointIndex() (0)
#define IMX_getCheckPointIndex() (0)
#define IMX_setCheckPointIndex(a) (0)
#define imxenc_addCheckPoint(a, b) (0)

#endif

/*============================================================================*/
/* End of symbols definition of debugging tools                               */
/*============================================================================*/

/* Symbols used for CFA interpolation */
#define VICP_CFA_HQ_5x5_COEFS 0


/*============================================================================*/
/* Start of imxenc_<...> prototypes declarations.                             */
/*============================================================================*/

Int16 imxenc_array_op(
  Int16 *input1_ptr,     /* starting address of 1st input */
  Int16 *input2_ptr,     /* starting address of 2nd input */
  Int16 *output_ptr,     /* starting address of output    */
  Int16  input1_width,   /* width/columns of 1st input    */
  Int16  input1_height,  /* height/rows of 1st input      */
  Int16  input2_width,   /* width/columns of 2nd input    */

⌨️ 快捷键说明

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