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

📄 mae_pass_thru.h

📁 au1200 linux2.6.11 硬件解码mae驱动和maiplayer播放器源码
💻 H
字号:
/* <LIC_AMD_STD> * Copyright (C) 2003-2005 Advanced Micro Devices, Inc.  All Rights Reserved. *  * Unless otherwise designated in writing, this software and any related  * documentation are the confidential proprietary information of AMD.  * THESE MATERIALS ARE PROVIDED "AS IS" WITHOUT ANY * UNLESS OTHERWISE NOTED IN WRITING, EXPRESS OR IMPLIED WARRANTY OF ANY  * KIND, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,  * NONINFRINGEMENT, TITLE, FITNESS FOR ANY PARTICULAR PURPOSE AND IN NO  * EVENT SHALL AMD OR ITS LICENSORS BE LIABLE FOR ANY DAMAGES WHATSOEVER.  *  * AMD does not assume any responsibility for any errors which may appear  * in the Materials nor any responsibility to support or update the * Materials.  AMD retains the right to modify the Materials at any time,  * without notice, and is not obligated to provide such modified  * Materials to you. AMD is not obligated to furnish, support, or make * any further information available to you. * </LIC_AMD_STD>  *//* <CTL_AMD_STD> * </CTL_AMD_STD>  *//* <DOC_AMD_STD> * </DOC_AMD_STD>  */// ***************************************************************************//  avoid multiple inclusion (entry)// ***************************************************************************#ifndef _MAE_PASS_THRU_H_#define _MAE_PASS_THRU_H_// ***************************************************************************//  includes// ***************************************************************************#include <codehead.h>#include <header.h>#include "types.h"#include "mae_fe.h"#include "mai_types.h" /* for MAITimeStamp_t */#ifdef DRV_ENABLED    #include <mae_interface.h>    #include <driverif.h>#endif#ifdef UNDER_CE#define NO_ASM#endif// ***************************************************************************//  definitions// ***************************************************************************#define TRUE					1#define FALSE					0#define	FROM_MPEG4_REF_HPEL		1#define	FROM_MPEG4_REF_QPEL		2#define	FROM_MAE_CMODEL			3#define CODEC_H263				0#define CODEC_MPEG				1// Clip Type#define CLIP_MPEG4				1#define CLIP_XVID				2#define NUM_VOPS_FOR_PRE_INIT	10// Code Style#define CODSTYL_MPEG			0#define CODSTYL_WMV9			1// Decode types (for trick mode support)      #ifndef DECODE_NORMAL#define DECODE_NORMAL          0x00#define DECODE_I_ONLY          0x01#define DECODE_P_ONLY          0x02#define DECODE_IP_ONLY         0x03#define DECODE_WAITFORI        0x10#define DECODE_WAITFORI_IPONLY 0x20#endif  // picked up from type\basic.hpp#define	IFRAME					0	//IVOP#define	PFRAME					1	//PVOP#define	BFRAME					2	//BVOP#define IQUANT_DONE         1 // 32 Bit#define IQUANT_DONE_16_BIT  2#define IDCT_DONE_8_BIT     3#define IDCT_DONE_16_BIT    4#define IDCT_DONE_32_BIT    5#define IDCT_ERROR          6#define MOTION_COMP_DONE    7#define IDCT_MIN_VAL			0#define IDCT_MAX_VAL			255#define Y1_LUMA_BLOCK			1#define Y2_LUMA_BLOCK			2#define Y3_LUMA_BLOCK			3#define Y4_LUMA_BLOCK			4#define U_CHROMA_BLOCK			5#define V_CHROMA_BLOCK			6#define ROW1					1#define ROW2					2#define ROW3					3#define ROW4					4#define ROW5					5#define ROW6					6#define ROW7					7#define ROW8					8#define OFFSET_32				32#define TOTAL_420_BYTES			384#define GET_FRAME_SIZE(x, y)	(x * y * sizeof(unsigned char))#define GET_WIDTH(x)			(x * sizeof(unsigned char))#define CBP_FOR_420	            0xFC // masking off Cb1/Cr1#define MACROBLOCK_CODED		1#define MACROBLOCK_SKIPPED		2#define INTER_CODED_AS_INTER	3#define INTER_CODED_AS_INTRA	4// Interlacing stuff#define PROGRESSIVE_SCAN		0#define INTERLACED_SCAN			1// Context stuff#define PROGRESSIVE_ONLY		1#define FIRST_FIELD				1#define FORWARD_TOP				1#define BACKWARD_TOP			2#define FORWARD_BOTTOM			3#define BACKWARD_BOTTOM			4#define DUMP_CHROMA_IC_BLKS		1#define NO_DUMP_CHROMA_IC_BLKS	0// INTRA REFERENCES#define MBMODE_INTRA_Y0			0x0000#define MBMODE_INTRA_Y1			0x0000#define MBMODE_INTRA_Y2			0x0000#define MBMODE_INTRA_Y3			0x0000#define MBMODE_INTRA_CB			0x0000#define MBMODE_INTRA_CR			0x0000#define MBMODE_INTRA_ALL		0x0000#define FORWARD_REFERENCES		1#define BACKWARD_REFERENCES		2// ALL THE MAE INTER CHECKERS (while doing MC)#define	FILE_QPEL_INTERP_CHECKS	"QPELIntersP"#define	FILE_QPEL_INTERB_CHECKS	"QPELIntersB"#define A_FWD_INTER_CHECKS		1#define A_BWD_INTER_CHECKS		2#define B_FWD_INTER_CHECKS		3#define B_BWD_INTER_CHECKS		4#define C_FWD_INTER_CHECKS		5#define C_BWD_INTER_CHECKS		6#define O_FWD_INTER_CHECKS		7#define O_BWD_INTER_CHECKS		8#define MPEG4_REF_BLOCKS		9// FORWARD REFERENCES#define MBMODE_FWD_Y0			0x00004000#define MBMODE_FWD_Y1			0x00001000#define MBMODE_FWD_Y2			0x00000400#define MBMODE_FWD_Y3			0x00000100#define MBMODE_FWD_CB0			0x00000040#define MBMODE_FWD_CR0			0x00000010#define MBMODE_FWD_CB1			0x00000004#define MBMODE_FWD_CR1			0x00000001#define MBMODE_FWD_ALL_420		0x00005550//#define MBMODE_FWD_ALL_420		(MBMODE_FWD_Y0  | MBMODE_FWD_Y1  |  MBMODE_FWD_Y2  | MBMODE_FWD_Y3  |  MBMODE_FWD_CB0 | MBMODE_FWD_CR0)#define MBMODE_FWD_ALL_422		(MBMODE_FWD_Y0  | MBMODE_FWD_Y1  |  MBMODE_FWD_Y2  | MBMODE_FWD_Y3  |  MBMODE_FWD_CB0 | MBMODE_FWD_CR0 |  MBMODE_FWD_CB1 | MBMODE_FWD_CR1) // BACKWARD REFERENCES#define MBMODE_BWD_Y0			0x00008000#define MBMODE_BWD_Y1			0x00002000#define MBMODE_BWD_Y2			0x00000800#define MBMODE_BWD_Y3			0x00000200#define MBMODE_BWD_CB0			0x00000080#define MBMODE_BWD_CR0			0x00000020#define MBMODE_BWD_CB1			0x00000008#define MBMODE_BWD_CR1			0x00000002#define MBMODE_BWD_ALL_420		0x0000AAA0//#define MBMODE_BWD_ALL_420		(MBMODE_BWD_Y0  | MBMODE_BWD_Y1  |  MBMODE_BWD_Y2  | MBMODE_BWD_Y3  |  MBMODE_BWD_CB0 | MBMODE_BWD_CR0)#define MBMODE_BWD_ALL_422		(MBMODE_BWD_Y0  | MBMODE_BWD_Y1  |  MBMODE_BWD_Y2  | MBMODE_BWD_Y3  |  MBMODE_BWD_CB0 | MBMODE_BWD_CR0 |  MBMODE_BWD_CB1 | MBMODE_BWD_CR1)// BI-DIRECTIONAL REFERENCES#define MBMODE_BID_Y0			0x0000C000#define MBMODE_BID_Y1			0x00003000#define MBMODE_BID_Y2			0x00000C00#define MBMODE_BID_Y3			0x00000300#define MBMODE_BID_CB0			0x000000C0#define MBMODE_BID_CR0			0x00000030#define MBMODE_BID_CB1			0x0000000C#define MBMODE_BID_CR1			0x00000003#define MBMODE_BID_ALL_420		0x0000FFF0//#define MBMODE_BID_ALL_420		(MBMODE_BID_Y0  | MBMODE_BID_Y1  |  MBMODE_BID_Y2  | MBMODE_BID_Y3  |  MBMODE_BID_CB0 | MBMODE_BID_CR0)#define MBMODE_BID_ALL_422		(MBMODE_BID_Y0  | MBMODE_BID_Y1  |  MBMODE_BID_Y2  | MBMODE_BID_Y3  |  MBMODE_BID_CB0 | MBMODE_BID_CR0 |  MBMODE_BID_CB1 | MBMODE_BID_CR1) #define TOTAL_BYTES_FOR_420		(64 * 6) // 4 luma + 1 CbCr pair#define TOTAL_BYTES_FOR_422		(64 * 8) // 4 luma + 2 CbCr pairs#define MAX_FILE_SIZE				256#define MAX_FRAME_NUM_SIZE			10#ifndef COPY_FRAME_FROM_CMODEL#define EXPAND						1#define RESTORE						2#endif#define FILE_AFTER_INTRA_IQUANT		"IQUANTIntra"#define FILE_AFTER_INTRA_IDCT		"IDCTIntra"#define FILE_AFTER_INTER_P_IQUANT	"IQUANTInterP"#define FILE_AFTER_INTER_P_IDCT		"IDCTInterP"#define FILE_INTER_P_REF_BLOCKS_MV	"RefBlocksMVP"#define FILE_AFTER_INTER_P_MCOMP	"MCInterP"#define FILE_AFTER_INTER_B_IQUANT	"IQUANTInterB"#define FILE_AFTER_INTER_B_IDCT		"IDCTInterB"#define FILE_INTER_B_REF_BLOCKS_MV	"RefBlocksMVB"#define FILE_AFTER_INTER_B_MCOMP	"MCInterB"#define FILE_INTRA_FINAL			"FinalIntra"#define FILE_INTER_P_FINAL			"FinalInterP"#define FILE_INTER_B_FINAL			"FinalInterB"#define FILE_REF_FRAME_Y_FOR_P		"RefFrameYForP"#define FILE_REF_FRAME_U_FOR_P		"RefFrameUForP"#define FILE_REF_FRAME_V_FOR_P		"RefFrameVForP"#define FILE_OOF_REF_FRAME_Y_FOR_P	"RefFrameOOFYForP"#define FILE_OOF_REF_FRAME_U_FOR_P	"RefFrameOOFUForP"#define FILE_OOF_REF_FRAME_V_FOR_P	"RefFrameOOFVForP"#define FILE_REF_FRAME_Y_FOR_B		"RefFrameYForB"#define FILE_REF_FRAME_U_FOR_B		"RefFrameUForB"#define FILE_REF_FRAME_V_FOR_B		"RefFrameVForB"#define FILE_OOF_REF_FRAME_Y_FOR_B	"RefFrameOOFYForB"#define FILE_OOF_REF_FRAME_U_FOR_B	"RefFrameOOFUForB"#define FILE_OOF_REF_FRAME_V_FOR_B	"RefFrameOOFVForB"#define REF_FILE_EXTENSION			".ref"#define MAE_FILE_EXTENSION			".mae"// All File Dump Command-Line Options#define CMD_DUMP_ALL				"DUMP_ALL"				// Default#define CMD_NO_DUMP_ALL				"NO_DUMP_ALL"#define CMD_NO_DUMP_IQUANT			"NO_DUMP_IQUANT"#define CMD_NO_DUMP_IDCT			"NO_DUMP_IDCT"#define CMD_NO_DUMP_REFBLKS_MV		"NO_DUMP_REFBLKS_MV"#define CMD_NO_DUMP_REF_FRAME		"NO_DUMP_REF_FRAME"#define CMD_NO_DUMP_MC				"NO_DUMP_MC"#define CMD_NO_DUMP_FINAL			"NO_DUMP_FINAL"#define CMD_USE_REF					"USE_REF"				// Default#define CMD_USE_MAE					"USE_MAE"//	Begin: GW, 4/14/04//	Add SHORT_RUN command#define	CMD_SHORT_RUN				"SHORT_RUN="//	End: GW, 4/14/04// All File Dump Options#define DUMP_ALL						0 // Default#define NO_DUMP_ALL						1#define NO_DUMP_IQUANT					2#define NO_DUMP_IDCT					3#define NO_DUMP_REFBLKS_MV				4#define NO_DUMP_REF_FRAME				5#define NO_DUMP_MC						6#define NO_DUMP_FINAL					7#define USE_REF							8 // Default#define USE_MAE							9// Flipping to reference mode options#define NO_FLIP							0 // Default#define FLIP_TO_REF						1#define WM_FOR_INTRA_Y      wm0#define WM_FOR_INTRA_C      wm1#define WM_FOR_INTER_Y      wm2#define WM_FOR_INTER_C      wm3#define BLOCKS_FOR_420_FORMAT 6#define BLOCKS_FOR_422_FORMAT 8// Block offsets (in memory for MAE). 64 int16s for each block#define BLOCK_DATA_SIZE_32    (sizeof(int32) * BLOCK_SQUARE_SIZE)#define BLOCK_DATA_SIZE_16    128 // 64*2 = (sizeof(int16) * BLOCK_SQUARE_SIZE)#define OFFSET_TO_BLOCK(n)    (n * BLOCK_DATA_SIZE_16)#define OFFSET_TO_Y0		  (0 * BLOCK_DATA_SIZE_16)#define OFFSET_TO_Y1		  (1 * BLOCK_DATA_SIZE_16)#define OFFSET_TO_Y2		  (2 * BLOCK_DATA_SIZE_16)#define OFFSET_TO_Y3		  (3 * BLOCK_DATA_SIZE_16)#define OFFSET_TO_U			  (4 * BLOCK_DATA_SIZE_16)#define OFFSET_TO_V			  (5 * BLOCK_DATA_SIZE_16)#define WM_DATA_SIZE			(BLOCK_SQUARE_SIZE)// Total Weighting Matrices#define TWO_WMS				  2#define MAX_WMS				  4// Total MVs for different cases#define TOTAL_INTRA_MVS				0#define TOTAL_16x16_FWD_BWD_MVS		5   //(4 + 1)#define TOTAL_16x8_FWD_BWD_MVS		6   //(4 + 2)#define TOTAL_8x8_FWD_BWD_MVS		5   //(4 + 1)#define TOTAL_16x16_BID_MVS			6   //(4 + 2)#define TOTAL_16x8_BID_MVS			8   //(4 + 4)#define TOTAL_8x8_BID_MVS			10  //(8 + 2)#define XFORMSIZE_8_8         0#define XFORMSIZE_8_4         1#define XFORMSIZE_4_8         2#define XFORMSIZE_4_4         3//#define DUMP_REF_FRAME 1// Usage options// Begin: GW, 4/14/04// Update usage to reflect current options#define MAE_USAGE "Usage: \tDECODER bitstream_file output_file width height\n\or:\tDECODER bitstream_file output_file width height NO_DUMP_ALL\n\or:\tDECODER bitstream_file output_file width height USE_MAE\n\or:\tDECODER bitstream_file output_file width height USE_REF\n\or:\tDECODER bitstream_file output_file width height NO_DUMP_ALL USE_MAE\n\or:\tDECODER bitstream_file output_file width height NO_DUMP_ALL USE_REF\n\or:\tDECODER bitstream_file output_file width height NO_DUMP_ALL shapes_file\n\or:\tDECODER bitstream_file output_file width height USE_MAE shapes_file\n\or:\tDECODER bitstream_file output_file width height USE_REF shapes_file\n\or:\tDECODER bitstream_file output_file width height NO_DUMP_ALL SHORT_RUN=n\n\or:\tDECODER bitstream_file output_file width height USE_MAE SHORT_RUN=n\n\or:\tDECODER bitstream_file output_file width height USE_REF SHORT_RUN=n\n\or:\tDECODER bitstream_file output_file width height NO_DUMP_ALL USE_MAE shapes_file\n\or:\tDECODER bitstream_file output_file width height NO_DUMP_ALL USE_REF shapes_file\n\or:\tDECODER bitstream_file output_file width height NO_DUMP_ALL USE_MAE SHORT_RUN=n\n\or:\tDECODER bitstream_file output_file width height NO_DUMP_ALL USE_REF SHORT_RUN=n\n\or:\tDECODER bitstream_file output_file width height NO_DUMP_ALL SHORT_RUN=n shapes_file\n\or:\tDECODER bitstream_file output_file width height USE_MAE SHORT_RUN=n shapes_file\n\or:\tDECODER bitstream_file output_file width height USE_REF SHORT_RUN=n shapes_file\n\or:\tDECODER bitstream_file output_file width height NO_DUMP_ALL USE_MAE SHORT_RUN=n shapes_file\n\or:\tDECODER bitstream_file output_file width height NO_DUMP_ALL USE_REF SHORT_RUN=n shapes_file"// End: GW, 4/14/04// Chroma MV Configuration Selectors#define MAEMB_CONFIG_MV_NONE	0#define MAEMB_CONFIG_MV_UV		1#define MAEMB_CONFIG_MV_UV1		2// Display stuff (mae_renderer)#define MPEG4_ENABLE_VIDEO	1#define MPEG4_DISABLE_VIDEO	0// Custom memcpy & memset routines (in clear_copy.S) #if !defined(NO_ASM) && (defined(MIPS) || defined(__mips__))                                             #define COPY_128B_16A(_src_, _dst_)    copy_32_aligned_words(_src_, _dst_)#define ZERO_128B(_src_)               zero_128b_32a(_src_)#define ZERO_256B(_src_)               zero_256b_32a(_src_)#else#define COPY_128B_16A(_src_, _dst_)    memcpy(_dst_, _src_,128)#define ZERO_128B(_src_)                        memset(_src_, 0, 128)#define ZERO_256B(_src_)                        memset(_src_, 0, 256)#endif// ***************************************************************************//  types// ***************************************************************************#ifdef __cplusplusextern "C" {#endif#ifdef DRV_ENABLEDvoid open_mae_driver(void);uint32 get_cur_buffer(void);#ifdef UNDER_CEvoid QueueMB(void);#else //!UNDER_CEINLINE void QueueMB ();#endif //UNDER_CE#define ClearBlockDataPointer(nBlocksUsed)\{\  xBlockData = (int8 *) pMAEContext->pDataBlock;\\  xBlockData +=	OFFSET_TO_BLOCK(nBlocksUsed);\\  ZERO_128B(xBlockData);\\  g_pIQOutput = (int16 *)xBlockData;\}INLINE void UpdateDisplaySizes (int*, int*);void zero_128b_32a(int8 *_src_);													void zero_256b_32a(int8 *_src_);#endifextern char                          gFileName[MAX_FILE_SIZE];extern const char                   *gFileExt;extern int                           nFileUpdates;extern int                           nBldOpt;extern int                           nFlipToRef;#ifdef DRV_ENABLEDextern int m_iSizeYPlane, m_iSizeUVPlane;#endifextern int8 *xBlockData;extern int nCodedBlocks;extern int g_NumWMs, g_NumMVs;extern int BITS_FOR_CBP[V_CHROMA_BLOCK];#ifdef MP4V_DEBUGextern int g_nGlobMB;#endif//	Begin: GW, 4/14/04//	Add int for whether to decode only the first N frames of the sourceextern int							 nShortRun;// HV For Travisextern char							 *nFlipArray;// ~HV For Travis//	End: GW, 4/14/04 // HV - Perf Changesextern int16 *g_pIQOutput;extern wrap_context *pMAEContext;#ifndef NEW_MAE_DRIVERextern reg_info *pMAERegs;#endifextern _header_word0 *g_pHeader0;extern _header_word1 *g_pHeader1;extern _header_word2 *g_pHeader2;extern _header_word3 *g_pHeader3;extern unsigned char bFirstIntraBlock;extern unsigned char *m_pMAERef0Y, *m_pMAERef1Y;#ifdef MP4_STANDALONEextern FILE* g_InFile;#endifextern int g_UVMVId, g_UVMVId2;extern uint32 *g_pMV;extern int m_iTemporalNumber, m_iNumBFrames;extern int MP4V_iFrameNumber, MP4V_nBytesUsed, g_iVOPIncFactor;extern int iPicWidth, iPicHeight, iChoppedHeight;extern int nIFYLoc, nIFUVLoc;// ~HV - Perf Changes#ifdef __cplusplus}#endif#endif

⌨️ 快捷键说明

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