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

📄 h264_define.h

📁 自己在wince的环境下做的一移动数字电视驱动
💻 H
📖 第 1 页 / 共 4 页
字号:
 
#ifndef __H264_DEFINITION__
#define __H264_DEFINITION__

#if 0 // wince block

#ifndef MAKE_H264LIB //defines on preprocessor of arm compiler for generating lib.

//#define TCC78xx_SW_SIM_ONLY

#define		TCC_SWSIM_C_ONLY

#ifndef		ONLY_SW
#	define	ONLY_SW
#endif

#endif //MAKE_H264LIB

#if	!defined( TCC_78X ) && !defined(TCC_79X)
	ERROR in preprocessor : cannot find TCC_78X or TCC79X definition
	It must be defined TCC_78X or TCC79X in preprocess
//#	define		TCC_78X
//#	define		TCC_79X
#endif

#define		TCCXXX_ID 0
#define		TCC78X_ID 1
#define		TCC79X_ID 2

#if defined( TCC_78X )
#	define	TCC_CHIP_SELECT (TCC78X_ID)
#elif defined( TCC_79X )
#	define	TCC_CHIP_SELECT (TCC79X_ID)
#else
#	define	TCC_CHIP_SELECT (TCCXXX_ID)
#endif

//#define TCC78xx_BOARD_ON
#ifdef TCC_ONBOARD //preprocessor of compiler

#	ifdef IPROVE
#		undef IPROVE
#	endif

#	ifdef TCC_PC_SIMULATION
#		undef TCC_PC_SIMULATION
#	endif

#	ifdef NOT_USE_TL
#		undef NOT_USE_TL
#	endif

#	ifdef SW_COMP
#		undef SW_COMP
#	endif

#	ifndef NO_ONEFRMOUT
#		define NO_ONEFRMOUT
#	endif

#	ifndef TCC78xx_BOARD_ON
#	define TCC78xx_BOARD_ON
#	endif

#	ifdef TCC78xx_SW_SIM_ONLY
#		undef TCC78xx_SW_SIM_ONLY
#	endif

//#else //TCC_ONBOARD

#endif //TCC_ONBOARD

//
// Options
//
#endif

#define H264DEC_SUPPORT_VGA //added by soo 20070912
							//scatter loading is modified for SW RW region

//set cachalbe SDRAM region in initialization of vcore added by soo 20070911
//#define SET_CACHEABLE_SDRAM_CODE_MEM
//#ifdef


//DEBUG TCC7820 fail....
//#define DBG_SOO_DEC_SPS_PPS_ONLY //added by soo 20070713
//#define DBG_SOO_DEC_SPS_PPS_I_ONLY //added by soo 20071010

//#define END_OF_STREAM_RESET_IP_ONLY		//added by soo 20070613 DVB-H stream in south africa
										//when undef, reset SPS, PPS, I, and P
										//when def, reset I and P

//#define VLD_CGI_DYNAMIC_CLOCK_GATING_DISABLE	//added by soo 20070413
#	if defined(VLD_CGI_DYNAMIC_CLOCK_GATING_DISABLE) && defined(MAKE_LIB)
		// 傈眉 hardware俊 措茄 汲沥
#		define VLD_CGI_DYNAMIC_CLOCK_GATING_DISABLE_SET_GHW  ( *(volatile int *)0xf3000090 = ( *(int *)0xf3000090 ) & 0xfdffffff)  // bit25
		// 俺喊 video hardware俊 措茄 dynamic clock-gating enable 厚飘
#		define VLD_CGI_DYNAMIC_CLOCK_GATING_DISABLE_SET_IHW  ( *(volatile int *)0xf3000080 = ( *(int *)0xf3000080 ) & 0xfffbffff)  // bit18	

#		define VLD_CGI_DYNAMIC_CLOCK_GATING_DISABLE_SET  (VLD_CGI_DYNAMIC_CLOCK_GATING_DISABLE_SET_GHW;VLD_CGI_DYNAMIC_CLOCK_GATING_DISABLE_SET_IHW;)
#	else //defined(VLD_CGI_DYNAMIC_CLOCK_GATING_DISABLE) && defined(MAKE_LIB)
#		define VLD_CGI_DYNAMIC_CLOCK_GATING_DISABLE_SET
#	endif //defined(VLD_CGI_DYNAMIC_CLOCK_GATING_DISABLE) && defined(MAKE_LIB)

#define CHECK_STREAM_END //added by soo 20070327

#define LEADINGZERO_CHECK_OVER32 //added by soo 20070327

#define CHECK_MORE_DATA	//added by soo 20070326

#define ADD_PADDING_START_CODE //added by soo 20070326

#if !defined(DBG_SOO_DEC_SPS_PPS_I_ONLY)
#define SUPPORT_CROPPING //added by soo 20070126
#if defined(SUPPORT_CROPPING)
#	define SUPPORT_CROPPING_CRAY //if it defined, Picture (with size in SPS, replace by gray for cropped region) is displayed.
								 //if it undefined, real image(with cropped image size) is displayed
#endif
#endif //!defined(DBG_SOO_DEC_SPS_PPS_I_ONLY)

#define SUPPORT_TCC_GETANNEXB //Annex B stream format
//#define TEST_TCC_GETRTP20061205 //RTP stream format

#if !defined(DBG_SOO_DEC_SPS_PPS_I_ONLY)
#define ADD_SEI_PARSING20061030
//description : parse SEI messages
#ifdef ADD_SEI_PARSING20061030
	#if 1	//added by soo 20070807
	#define SEI_PARSING_ON_SUBCORE
	#else
	#define SEI_PARSING_ON_MAINCORE
	#endif
#endif
#endif //!defined(DBG_SOO_DEC_SPS_PPS_I_ONLY)

#if !defined(DBG_SOO_DEC_SPS_PPS_I_ONLY)
#define ADD_VUI_PARAMETER_PARSING //added by soo 20060905
//description : parse a VUI parameters header in SPS
#ifdef ADD_VUI_PARAMETER_PARSING
	#define VUI_PARAMETER_PARSING_ON
	#define VUI_PARAMETER_COLOR_CHROMA //added by soo (Brazilian ISDTV)
#endif
#endif //!defined(DBG_SOO_DEC_SPS_PPS_I_ONLY)

//#if !defined(DBG_SOO_DEC_SPS_PPS_I_ONLY)
#define ADD_POSTPROCESSING20060626
//description : use the post processing as y = ax + b
#	ifdef ADD_POSTPROCESSING20060626
#		define HW_POSTPROCESSING

#		define POSTPROCESSING_COPY_IN_FRAME20060906
		//description : use the copy function in the post processing in one frame
#		ifdef POSTPROCESSING_COPY_IN_FRAME20060906
#			define HW_POSTPROCESSING_COPY_IN_FRAME
#		endif
#	endif
//#endif //!defined(DBG_SOO_DEC_SPS_PPS_I_ONLY)

#define H264_DEFINE_GAPS_FRAME_NUM_PSLICE 3 //3(woo), 2(soo), 1(Jeiff)

//#define H264DEC_SUPPORT_POC_TYPE1
//description : support H.264 baselinse profile(POC type 1, SPS)
//              requirement a additional mem(33Kbyts : h264mem_sps.c).

#define H264DEC_SUPPORT_IPCM

#define PRINTF printf


//
// Debug
//

//#define DBG_SOO_DEBUG_INFO_TOMAIN //added by soo 20070328

//#define DBG_SOO_FIRST_MB_IN_SLICE

#ifndef MAKE_H264LIB

	#define DEBUG_DECODING_FRAME_INFO  
	//description : output messages are written to a log file.

	#define DBG_SOO_READBIT_READOVER_ZERO //added by soo 20070327

	//#define H264DEC_ERROR_MB_CONCEAL //added by soo 20070122

	//#define DBG_SOO_LOOPFILTER_LPQ_FILTER_FLAG_IGNORE // test added by soo 20070104	
	//#define DBG_SOO_LOOPFILTEROFF20070103 // test added by soo 20070104	
	//#define DBG_SOO_LOOPFILTER_EDGELOOP_LUMA_MOD

	//#define DBG_SOO_RESIDUAL_DATA //test added by soo

	//#define DBG_SOO_MV_REFIDX20070102 //test for subcore
	#	ifdef DBG_SOO_MV_REFIDX20070102
	#	define DBG_SOO_MV_REFIDX_N_FRAME 	23
	#	define DBG_SOO_MV_REFIDX_N_MB 	 	207
	#	endif //DBG_SOO_MV_REFIDX20070102

	//#define DBG_SOO_PRINTF_NEGATIVE_A_B_INCLUDED //test added by soo 20070115
	#	ifdef DBG_SOO_PRINTF_NEGATIVE_A_B_INCLUDED
	#	define DBG_SOO_PRINTF_NEGATIVE_A_B_INCLUDED_NOTATION 0x4000
	#	define DBG_SOO_PRINTF_NEGATIVE_A_INCLUDED_NOTATION   0x0100
	#	define DBG_SOO_PRINTF_NEGATIVE_B_INCLUDED_NOTATION   0x0200
	#	endif //DBG_SOO_PRINTF_NEGATIVE_A_B_INCLUDED

#endif //MAKE_H264LIB


//
// fix bugs
//

#define FIX_ERROR_SKIP_OPTION_FOR_MULTIPLE_SLICES //added by soo 20071206

//#define CHECK_REF_IDX_OVERFLOW_LIST_REORDER //added by soo 20070518

#define CHECK_SLICE_TYPE_ERROR	//added by soo 20070518

#define CHECK_REF_IDX_OVERFLOW //added by soo 20070222 (2nd 20070518 P_L0_16x16 mode in mb_predict())

#define FIX_INTRA_PRED_FLAG_REF //added by soo 20070227

#define FIX_BUG_REF_FRAME_LISTX_SIZE //added by soo 20070131

#define FIX_BUG_QP_DELTA_MOD //added by soo 20070130

#define FIX_BUG_SPSPPS_UPDATE20070126 //added by soo 20070126
#ifdef FIX_BUG_SPSPPS_UPDATE20070126
#	define REMOVE_CHECK_EQUALITY_SPSPPS //added by soo 20070126
#endif //FIX_BUG_SPSPPS_UPDATE20070126

/*********************************************************************/
/* Library Version                                                   */
/*********************************************************************/
#define TCC_H264DEC_LIB_VER	(18) //added by soo 20070605


/*********************************************************************/
/* Input information                                                 */
/*********************************************************************/

//#if defined(SIMULATION) || !defined(TCC_ONBOARD)
#if !defined(TCC_ONBOARD)
#	if defined(SIMULATION)
#		include "h264IOfileName.h"
#	endif
#endif //!defined(TCC_ONBOARD)


/*********************************************************************/
/* definitions and type                                              */
/*********************************************************************/

/* type */
//#if defined(TCC_78X)
//#	include "common.h"
//#elif defined(TCC_79X)
//#	include "79xx_common.h"
//#endif
#include "h264_types.h"

/* definitions */

#define H264CONFIGCONTROLAPP_DEFAULT	0
#define H264CONFIGCONTROLAPP_DVB_H		1
#define H264CONFIGCONTROLAPP_T_DMB		2

#define NAL_MODE_FILE_FORMAT			0	//NAL mode (0=Annex B, 1: RTP packets)
											// 0: Annex B for ATSC, for DMB
											// 1: RTP packets for communication application
//#define DECODED_PICTURE_BUFFER_SIZE	3	//Decoded Picture Buffer size
#define DECODED_PICTURE_BUFFER_SIZE		32//for baseline profile modified by soo 20060207 //3	//Decoded Picture Buffer size

#ifdef MAKE_H264LIB
#	define H264MAX_IMAGE_NUM		32//4
#else //MAKE_H264LIB
#	define H264MAX_IMAGE_NUM		32//for baseline profile modified by soo 20060207 4
#endif //MAKE_H264LIB

#define H264MAX_IMAGE_NUM_MASK	(H264MAX_IMAGE_NUM-1)
//#define H264POSTPROCESS_IMAGE_NUM_MASK 12
//#define H264_REF_FRAME_NUM_MAX  12 // T-DMB spec. //added by soo 20050531
#define H264_REF_FRAME_NUM_MAX  32 // T-DMB spec. //added by soo 20050531
#define H264_REF_FRAME_NUM_MAX_T_DMB 3

#define H264_DATA_BUFFER_SIZE   (41984) //(H264OFFSET_FOR_REF_FRAME_DATA_BYTETYPE + H264_MAX_SPSPPS_SIZE) //41384 = 7592+33792

#define H264MAXSPS				32
#define H264MAXPPS				256

//#define H264_MAX_SPSPPS_SIZE	(7592) // 33 PPS(12bytes) + 257 SPS (28 bytes)
//#define H264OFFSET_FOR_REF_FRAME_DATA_INTTYPE	(8448) //(32+1)*256 //added by soo 20060221
//#define H264OFFSET_FOR_REF_FRAME_DATA_BYTETYPE	(H264OFFSET_FOR_REF_FRAME_DATA_INTTYPE<<2) //33792(=8448*4)

#define H264DATA_SPS_SIZE						(36)
#define H264DATA_VUI_SIZE						(64)
#define H264DATA_REFOFSET_SIZE					(1024)
#define H264DATA_PPS_SIZE						(12)

#define H264INSTMEM_SPS_SIZE					( (H264MAXSPS+1) * H264DATA_SPS_SIZE )
#define H264INSTMEM_SPS_VUI_SIZE				( (H264MAXSPS+1) * H264DATA_VUI_SIZE )
#define H264INSTMEM_SPS_VUITMP_SIZE			( (H264MAXSPS+0) * H264DATA_VUI_SIZE )
#define H264INSTMEM_SPS_REFOFFSET_SIZE		( (H264MAXSPS+1) * H264DATA_REFOFSET_SIZE )
#define H264INSTMEM_SPS_REFOFFSETTMP_SIZE	( (H264MAXSPS+0) * H264DATA_REFOFSET_SIZE )

#define H264INSTMEM_PPS_SIZE					( (H264MAXPPS+1) *    H264DATA_PPS_SIZE )

#define H264INSTMEM_DEC_INFO_SIZE				( 512 )

#define H264INSTMEM_DUMMY_SIZE			( H264_DATA_BUFFER_SIZE - (H264INSTMEM_SPS_SIZE+H264INSTMEM_SPS_VUI_SIZE+H264INSTMEM_SPS_REFOFFSET_SIZE+H264INSTMEM_PPS_SIZE) )

#define H264INSTMEM_DEC_INFO_OFFSET		( 0 )
#define H264INSTMEM_PPS_OFFSET			( H264INSTMEM_DEC_INFO_OFFSET + H264INSTMEM_DUMMY_SIZE )
#define H264INSTMEM_SPS_OFFSET			( H264INSTMEM_PPS_OFFSET + H264INSTMEM_PPS_SIZE )
#define H264INSTMEM_VUI_OFFSET			( H264INSTMEM_SPS_OFFSET + H264INSTMEM_SPS_SIZE )
#define H264INSTMEM_REFOFFSET_OFFSET		( H264INSTMEM_VUI_OFFSET + H264INSTMEM_SPS_VUI_SIZE )
		/* instance buffer
			TCC_H264DEC_Info 		:  512 bytes
			dummy					: 1428 bytes
			PPS[257]					: 3084 bytes
			SPS [33] 					: 1056 bytes
			VUIinSPS[33] 				: 2112 bytes
			offset_for_ref_frameinSPS	:33792 bytes
		*/

#define INT_MAX					2147483647    // maximum (signed) int value in limits.h

#define H264BLOCK_SIZE			4
#define H264BLOCK_SIZE_SHIFT	2
#define H264MBS_SIZE			16

⌨️ 快捷键说明

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