📄 vutil.h
字号:
/******************************************************************************
* Filename : Utilities.h
* Start : 2002. 11. 11
* By : Taejin Kwon
* Contact : eric.kwon@samsung.com
* Description :
******************************************************************************
*/
#ifndef _VUTIL_H_
#define _VUTIL_H_
#define FBM_FRAME_COUNT 3
#define FR_QUART_PAL_SIZE 0x25200 //PAL : 352*(288+144)
#define FR_QUART_NTSC_SIZE 0x1EF00 //NTSC: 352*(240+120)
#define INVALID_FRAME_INDEX 0xf
/* defines for Frame.state */
#define FB_USED_FOR_NOTHING_NOW 0x00000000
#define FB_USED_FOR_DECODING_NOW 0x00000001
#define FB_USED_FOR_SDOUT_NOW 0x00000002
#define FB_USED_FOR_3DIPC_NOW 0x00000004
#define FBM_DISPLAY_NOT_YET_COMPLETED 0x00002100
#define FBM_WAITING_FOR_FREE_PICTURE 0x00000100
#define FBM_SUCCESS_FOR_GET_WRITE_PICTURE 0x00000400
#define PT_FREE_PICTURE 0x00000010 /* Free Buffer */
#define PT_USED_FOR_WRITE 0x00000040 /* Buffer filled */
#define PT_VALID_PICTURE 0x00000100 /* Valid Buffer */
#define PT_WAITING_TO_BE_SHOWN 0x00004000 /* Waiting to be shown */
#define PT_USED_FOR_READING 0x00010000 /* Buffer Read */
#define V_BUFF_CURR_REF 0
#define V_BUFF_PREV_REF 1
#define PICTURE_TYPE_I 0x01
#define PICTURE_TYPE_P 0x02
#define PICTURE_TYPE_B 0x03
typedef enum {
FB_PLAY_ALL_FRAME,
FB_PLAY_REF_FRAME,
FB_PLAY_I_FRAME
}FB_MODE;
typedef void (*FBM_CALLBACK)(void);
typedef struct {
/*
This structure manages 1 Decoded Frame
*/
#if 1
ULONG FRAME_BUFF_Y_ADDR; //9908俊辑绰 top bottom捞 狼固啊 绝绊 y point客 c point父阑
ULONG FRAME_BUFF_C_ADDR; //9908俊辑绰 top bottom捞 狼固啊 绝绊 y point客 c point父阑
ULONG state;
UINT picType; /* KBA #2805@2005#: Added */ //reserved1;
UINT TempRef; /* KBA #2805@2005#: Added */ //reserved1;
BOOL bDecComplete;
BOOL bDispComplete;
UINT bSequenceFlag; // 0 or 1
#else
UCHAR *Y_TE_PTR; //9908俊辑绰 top bottom捞 狼固啊 绝绊 y point客 c point父阑
UCHAR *Y_TO_PTR; //荤侩茄促.
UCHAR *Y_BE_PTR;
UCHAR *Y_BO_PTR;
UINT state;
#endif
} FrameBufferElement_t;
typedef struct {
/*
common feature for Buffer Manager
*/
ULONG p_StartAddress; /* start address of first BE (word aligned) */
ULONG p_StopAddress; /* start address of first BE (word aligned) */
#if 1
/* sz_TotalBuffer must be (sz_Chunk*n_Chunk) */
ULONG sz_TotalBuffer; /* size of Total buffer */
ULONG nValidRef;
ULONG iCurWriting; /* index of Reference Frame 1 */
ULONG iCurReading; /* index of Reference Frame 1 */
BOOL bLastWrittenRef;
UINT validBPic; /* Valid B Picture */
UINT iRef0; /* index of Reference Frame 0 */
UINT iRef1; /* index of Reference Frame 1 */
#if 0
ULONG toggleRef;
ULONG toggleNoRef;
#endif
BOOL gSeqFlag;
UINT uiSeqArray[ 2 ];
/*
current status of Buffer Manager
*/
ULONG status;
FrameBufferElement_t F[FBM_FRAME_COUNT];
#else
/* sz_TotalBuffer must be (sz_Chunk*n_Chunk) */
UINT sz_TotalBuffer; /* size of Total buffer */
FrameBufferElement_t F[FBM_FRAME_COUNT];
UINT nValidRef;
UINT iCurWriting; /* index of Reference Frame 1 */
UINT iCurReading; /* index of Reference Frame 1 */
UINT iRef0; /* index of Reference Frame 0 */
UINT iRef1; /* index of Reference Frame 1 */
UINT toggleRef;
UINT toggleNoRef;
/*
current status of Buffer Manager
*/
UINT status;
#endif
FBM_CALLBACK ReadFrameBufferAvailCallback;
FBM_CALLBACK WriteFrameBufferAvailCallback;
} FrameBufferManager_t;
void InitFrameBufferManager(FrameBufferManager_t *fbm, ULONG p, ULONG n, ULONG szChunk);
ULONG GetReadFrameBuffer(FrameBufferManager_t *fbm, FrameBufferElement_t **fb);
ULONG PutReadFrameBuffer(FrameBufferManager_t *fbm, UINT uiReleasePicType );
ULONG GetWriteFrameBuffer(FrameBufferManager_t *fbm, FrameBufferElement_t **fb, UINT picture_type, UINT TempRef );
ULONG PutWriteFrameBuffer(FrameBufferManager_t *fbm, UINT picture_type, BOOL bPrevFlag );
void ResetFrameBufferState(FrameBufferManager_t *fbm);
void SetFrameReadAvailCallback(FrameBufferManager_t *fbm, FBM_CALLBACK func);
void SetFrameWriteAvailCallback(FrameBufferManager_t *fbm, FBM_CALLBACK func);
#endif /* _UTIL_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -