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

📄 portab.h

📁 用MPEG-4对YUV视频文件编码压缩成divx视频文件
💻 H
字号:
/*
  在trimedia平台
  int,long,float: 4个字节
  double: 4个字节(缺省) 8个字节(使用 -fp64编译选项)  
*/


#ifndef _PORTAB_H_
#define _PORTAB_H_
#include "user_macro.h"
#include <stdio.h>
#include <stdarg.h>

/* debug level masks*/
#define DPRINTF_ERROR		0x00000001
#define DPRINTF_STARTCODE	0x00000002
#define DPRINTF_HEADER		0x00000004
#define DPRINTF_TIMECODE	0x00000008
#define DPRINTF_MB			0x00000010
#define DPRINTF_COEFF		0x00000020
#define DPRINTF_MV			0x00000040
#define DPRINTF_DEBUG		0x80000000

/* debug level*/
#define DPRINTF_LEVEL		0
#define DPRINTF_BUF_SZ  1024

static __inline void
DPRINTF(int level, char *fmt, ...)
{
	if ((DPRINTF_LEVEL & level)) {

		va_list args;
		char buf[DPRINTF_BUF_SZ];

		va_start(args, fmt);
		vsprintf(buf, fmt, args);
		fprintf(stdout, "%s\n", buf);
	}
}

#define DEBUG(S)
#define DEBUG1(S,I)
#define DEBUG2(X,A,B)
#define DEBUG3(X,A,B,C)
#define DEBUG8(X,A,B,C,D,E,F,G,H)
#define DEBUGCBR(A,B,C)

#define int8_t   char
#define uint8_t  unsigned char
#define int16_t  short
#define uint16_t unsigned short
#define int32_t  int
#define uint32_t unsigned int

#ifdef WIN32

#include <windows.h>
#define int64_t __int64
#define uint64_t unsigned __int64

#else

#define int64_t long 
#define uint64_t unsigned long 
#define BOOL int

#endif

#define TRUE   1
#define FALSE  0

#define ptr_t uint32_t
/*
2002.12.31 test tm1300
发现取8时程序效率最高
*/
/*#define CACHE_LINE  16*/
#define CACHE_LINE  8
/*#define CACHE_ALIGN*/
#define DECLARE_ALIGNED_MATRIX(name,sizex,sizey,type,alignment) \
	type name##_storage[(sizex)*(sizey)+(alignment)-1]; \
	type * name = (type *) (((ptr_t) name##_storage+(alignment - 1)) & ~((ptr_t)(alignment)-1))


/*#define EMMS()*/

/* needed for bitstream.h   */
#define BSWAP(a) \
	 ((a) = ( ((a)&0xff)<<24) | (((a)&0xff00)<<8) | (((a)>>8)&0xff00) | (((a)>>24)&0xff))

/* rdtsc command most likely not supported, */
/* so just dummy code here  */
/*
static __inline int64_t
read_counter()
{
	return 0;
}
*/

#endif							/* _PORTAB_H_*/

⌨️ 快捷键说明

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