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

📄 tvpvideo.h

📁 ti的数字电视芯片 tvp9000的源码
💻 H
字号:
/********************************************************************* 
*    Property of Texas Instruments Incorporated, Copyright 2004
*    All rights reserved
**********************************************************************/

/*********************************************************************
*
* Description:
*   public include file for the video decoder
*   It includes only the definitions that are needed for the API
*   
**********************************************************************/
/**********************************************************************
*  
* $Revision: $ 
* 
* $History: TvpVideo.h $   
* 
**********************************************************************/

#ifndef TVP_VIDEO_DOT_H_IS_DEFINED
#define TVP_VIDEO_DOT_H_IS_DEFINED

/***********************************************************************************
******************************* CONSTANTS DEFINES **********************************
***********************************************************************************/
#define TVP_COEF_LENGTH_WORDS  128  // 3 tables at 64 words each
#define TVP_NUM_COEF_TABLES    3
#define TVP_NUM_VC_INPUTS      18

#define TVP_MIN_PAL_DEINTERLACE_BUFFER_SIZE   0x32a000

/*-------------------------**
** Video Interrupt Events  **
**-------------------------*/
#define TVP_VID_VC_ERROR      0x1
#define TVP_VID_FMT_CHG       0x2
#define TVP_VID_GOP_HEADER    0x4
#define TVP_VID_PICT_HEADER   0x8
#define TVP_VID_PARSE_ERROR   0x10
#define TVP_VID_SKIP          0x20
#define TVP_VID_REPEAT        0x40
#define TVP_VID_COEF_ERROR    0x80
#define TVP_VID_SYNC_PRESENT  0x100
#define TVP_VID_INT_NONE      0x0

/*----------------------**
** Display Info Defines **
**----------------------*/
#define TVP_HOR_1920          1920
#define TVP_HOR_1280          1280
#define TVP_HOR_720           720
#define TVP_HOR_848           848
#define TVP_HOR_1360          1360
#define TVP_HOR_WXGA          1368			// was TVP_HOR_1360
#define TVP_HOR_WVGA          856			// was TVP_HOR_848

#define TVP_VER_480           480
#define TVP_VER_720           720
#define TVP_VER_576           576
#define TVP_VER_1080          1080
#define TVP_VER_768           768
#define TVP_VER_WXGA          TVP_VER_768
#define TVP_VER_WVGA          TVP_VER_480

#define TVP_VID_PROGRESSIVE   1
#define TVP_VID_INTERLACED    0

/*-------------**
** Frame Rates **
**-------------*/
#define TVP_VID_FR_23_976     1
#define TVP_VID_FR_24         2
#define TVP_VID_FR_25         3
#define TVP_VID_FR_29_97      4
#define TVP_VID_FR_30         5
#define TVP_VID_FR_50         6
#define TVP_VID_FR_59_94      7
#define TVP_VID_FR_60         8   

/***********************************************************************************
****************************** VIDEO ENUMERATIONS DEFINES **************************
***********************************************************************************/

// Max Height which goes away in future micrcode
#define TVP_1088_LINES_PER_FRAME          (0x3<<16)

typedef enum 
{
  TVP_VID_PLAY=3,     // Begins Normal decoding                                 
  TVP_VID_FREEZE=1,   // Freeze on last picture 
  TVP_VID_RESET=0    // Reset video command
} TvpVidCmd; // enumerates all video commands

typedef enum
{
  TVP_VID_AR4_3_DISPLAY=2,     //  4:3  
  TVP_VID_AR16_9_DISPLAY=3,    // 16:9 
  TVP_VID_AR2_21_1_DISPLAY=4,  // 2.21:1 
  TVP_VID_AR1_1_DISPLAY=1      // PAR 1:1
} TvpVidARDisplay;  // defines the aspect ratio of monitor being used

typedef enum 
{
  TVP_VID_FILL_SCREEN,     // Stretch or compress to fill screen                       
  TVP_VID_VERT_COMP,       // Letterbox - Vertical bars               
  TVP_VID_PAN_SCAN,        // Pan/Scan discard left/right                           
  TVP_VID_CURTAIN,         // Horizontal bars
  TVP_VID_OVERSCAN         // Discard top/bottom
} TvpVidARMethod;   // defines the preferred video output method for converted video source

typedef enum 
{
  TVP_VID_FULL_SCREEN,     // Full size.
  TVP_VID_HALF_SCREEN,     // Divide horizontal and vertical sizes by 2.
  TVP_VID_QUARTER_SCREEN   // Divide horizontal and vertical sizes by 4.
} TvpVidFraction;   // defines the preferred video output size fraction

typedef enum
{
   TVP_COEF_352_240 = 0,
   TVP_COEF_352_288,
   TVP_COEF_352_480,
   TVP_COEF_480_480,
   TVP_COEF_528_480,
   TVP_COEF_544_480,
   TVP_COEF_640_480,
   TVP_COEF_704_480,
   TVP_COEF_720_480,
   TVP_COEF_352_576,
   TVP_COEF_480_576,
   TVP_COEF_544_576,
   TVP_COEF_704_576,
   TVP_COEF_720_576,
   TVP_COEF_1280_720,
   TVP_COEF_1440_1080,
   TVP_COEF_1920_1080,
   TVP_COEF_NUM_INPUT_FORMATS
} TvpCoefTypes;

typedef enum
{
   TVP_VID_COMPRESS_NEVER = 0,
   TVP_VID_COMPRESS_GT_480 = (1<<16),
   TVP_VID_COMPRESS_GT_PAL = (2<<16),
   TVP_VID_COMPRESS_ALWAYS = (3<<16) 
} TvpVidCompThresh;

typedef enum
{
  TVP_VID_BLANK_EARLY,
  TVP_VID_HOLD_PICTURE
} TvpVidChangeBlank;

/***********************************************************************************
****************************** VIDEO STRUCTURES DEFINES ****************************
***********************************************************************************/

typedef struct
{
   unsigned short  horiSize;
   unsigned short  vertSize;
   unsigned char   progressiveFlag;
} TvpVidDisplayInfo;

typedef unsigned long TvpVidIntEvent;

typedef struct
{
   unsigned short sizeCoefTable0Words;
   unsigned short sizeCoefTable1Words;
   unsigned short sizeCoefTable2Words;
   unsigned short sizeVidContTableWords;
   unsigned long *videoControllerInputs;   
   unsigned long *coefDataTables;
} TvpVidCoefData;

typedef struct 
{
   TvpVidCoefData * inputInterlaced[2][TVP_COEF_NUM_INPUT_FORMATS];
   TvpVidCoefData * inputProgressive[2][TVP_COEF_NUM_INPUT_FORMATS];
} TvpVidCoefArray;

     
typedef struct 
{
   unsigned short horiSize;     // Horizontal size
   unsigned short vertSize;     // Vertical size 
   unsigned short horiPos;
   unsigned short vertPos;   
} TvpVidPicFormat;    // contains the picture size


/***********************************************************************************
****************************** OTHER TYPEDEF DEFINES *******************************
***********************************************************************************/

/***********************************************************************************
*********************************** API FUNCTIONS **********************************
***********************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif

TVP_FERROR tvpVidDrvrInit(unsigned char *coefBuffer, unsigned char *frameBuffer0,
                          unsigned char *frameBuffer1, unsigned char *frameBuffer2, 
                          unsigned char *frameBuffer3, unsigned int frameBufferSize);

TVP_FERROR tvpVidEnableStatInt(TvpVidIntEvent *pRetStatus, TvpIntNum intNum, TvpVidIntEvent intConfig);
TVP_FERROR tvpVidLoadUcode(unsigned long  *pCode, unsigned long codeSizeWords);
TVP_FERROR tvpVidCoefArrayAssign(TvpCoefTypes coefIndex, unsigned short interlacedFlag, TvpVidARDisplay aspectRatio, TvpVidCoefData * pCoefArray);

TVP_FERROR tvpVidSetParms(TvpVidARMethod prefOut, TvpVidARDisplay aspectRatio, TvpVidDisplayInfo *displayInfo);
TVP_FERROR tvpVidSetPicFormat(TvpVidPicFormat *pPicSize);

TVP_FERROR tvpVidCommand(TvpVidCmd command);
void tvpVidPictureSizeGet(unsigned long *inputHeight, unsigned long *inputWidth, 
                          unsigned long *inputAspectRatio, unsigned long *inputProgressiveFlag,
                          unsigned long *inputFrameRate);
void tvpVidDisplaySizeGet(unsigned long *displayHeight, unsigned long *displayWidth,
                          unsigned long *displayAspectRatio, unsigned long *displayProgressiveFlag);
TVP_FERROR tvpVidCoefReload(void);
void tvpVidParseErrorGet(unsigned long *error);

static void tvpVidCoefTableLoad(TvpVidCoefData *coefIData, TvpVidCoefData *coefPData, unsigned long *coefBuffer);
static TVP_FERROR tvpVidControlProgram(TvpVidCoefData * pCoefDataI, TvpVidCoefData * pCoefDataP);

static void tvpVidAdjustInOutSize(TvpVidARDisplay displayAspectRatio, TvpVidARDisplay inputAspectRatio,
                              TvpVidARMethod prefOut, unsigned short *inputHeight,
                              unsigned short *inputWidth,  unsigned short *outputHeight, 
                              unsigned short *outputWidth);
static void tvpVidIntSet (TvpVidIntEvent int_reason);
static TVP_FERROR tvpVcWrite(unsigned long address, unsigned long data);
static TVP_FERROR tvpVcWriteQueue(unsigned long address, unsigned long data);
TVP_FERROR tvpVidSetPicPosition(TvpVidPicFormat *pPicSize);
TVP_FERROR tvpVidGetPicPosition(TvpVidPicFormat *pPicSize);
void tvpResetVideo (void);
void tvpVidVbiFunc (void);
TVP_FERROR tvpVidModPrefOut(TvpVidARMethod prefOut);
TVP_FERROR tvpVidCompressionSet (TvpVidCompThresh thresh);

TVP_FERROR tvpVidSetBackGroundColor(TvpOsdColorCbYCr color);
TVP_FERROR tvpVidGetBackGroundColor(TvpOsdColorCbYCr *pBgColor);
void tvpVidChangeBlank (TvpVidChangeBlank flag);
TVP_FERROR tvpVidSetPicCrop(unsigned short horizCrop, unsigned short vertCrop);

TVP_FERROR tvpVidAdvancedDrvrInit( unsigned char *coefBuffer,   unsigned char *frameBuffer0, 
                                   unsigned char *frameBuffer1, unsigned char *frameBuffer2, 
                                   unsigned char *frameBuffer3, unsigned char *frameBuffer4, 
                                   unsigned char *frameBuffer5, unsigned char *frameBuffer6,
                                   unsigned char *frameBuffer7, Tvp_True_False palDeinterlaced);

#ifdef __cplusplus
}
#endif

#endif

⌨️ 快捷键说明

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