📄 macros.h
字号:
//*@@@+++@@@@******************************************************************//// Microsoft Windows Media// Copyright (C) Microsoft Corporation. All rights reserved.////*@@@---@@@@******************************************************************/*************************************************************************Copyright (C) Microsoft Corporation, 1996 - 1999Module Name: Macros.hAbstract: Processor-specific macros, defines, and data types.Author: Raymond Cheng (raych) Jul 29, 1999Revision History:*************************************************************************/#ifndef __COMMON_MACROS_H#define __COMMON_MACROS_H#ifdef _ARM_#undef DISABLE_OPT //O.K.#endif// ***********************************************************************// Arithmetic coding, and testing// **********************************************************************//#define DEFINE_ARITH_CODER// ***********************************************************************// If BUILD_INTEGER or BUILD_INT_FLOAT is not defined by project set default state#include "constants.h"#ifdef UNDER_CE#include <windef.h>#include <kfuncs.h>#include <dbgapi.h>//#define assert ASSERT//#include <assert.h> // If this doesn't exist, you must write an "assert" macro#ifdef DEBUG#undef _DEBUG#define _DEBUG#endif# undef assert#ifdef _DEBUG# define assert(exp) \ { \ if(!(exp)) \ { \ DebugBreak(); \ } \ }#else# define assert(exp) #endif#else// The following are ANSI C includes, and so should be safe for all platforms (end)// This is a walk around to turn on assert in build environment. Since we are// not allowed to have debug bits CRT, we don't have DEBUG_CRT defined and NDEBUG is // defined in makefile.def. Later in assert.h assert is defined as void. But since // v9 does not go into windows we can walk around the problem by turning off NDEBUG // temporarily. VC project does not have this problem (end)#if defined (NDEBUG) && ( defined (DBG) || defined (_DEBUG) || defined (DEBUG) )#undef NDEBUG#define DISABLE_NDEBUG_TEMP#endif #include <assert.h> // If this doesn't exist, you must write an "assert" macro#if !defined (NDEBUG) && ( defined (DBG) || defined (_DEBUG) || defined (DEBUG) ) && defined (DISABLE_NDEBUG_TEMP)#define NDEBUG#endif #endif#include <string.h>#include <stdlib.h>#include <stdio.h>#include <stdarg.h>#if !defined(BUILD_WMASTD) && !defined(BUILD_WMAPRO) && !defined(BUILD_WMALSL)// We must build for everything :)#define BUILD_WMASTD#define BUILD_WMAPRO #define BUILD_WMAPRO_PLLM#define BUILD_WMALSL#endif // !BUILD_WMASTD && !BUILD_WMAPRO && !BUILD_WMALSL#if defined (BUILD_WMAPRO) && !defined (BUILD_WMALSL)// Disable now.// #define SAVE_PCMBUFFER_IN_PLLM#endif// Must define one of following two modes. TRANSFORMED based is // more accurate but requires full size DCT in half transform.// FILTERBASED does not need full size DCT therefore save mem.// #define MLLM_HALFDCT_TRANSFORMBASED#define MLLM_HALFDCT_FILTERBASED// **************************************************************************// Platform-Specific #ifdefs// **************************************************************************#ifndef DISABLE_OPT // If this is defined, use the ANSI build#ifdef __QNX__#undef _M_IX86#endif#if defined(_M_IX86) && !defined(INTEGER_ENCODER)//#ifdef __QNX__//#define WMA_TARGET_QNX_X86//#else#define WMA_TARGET_X86//#endif#endif#ifdef _MIPS_#define WMA_TARGET_MIPS#endif#if defined(_SH3_) && !defined(_SH4_)#define WMA_TARGET_SH3#endif#ifdef _SH4_#define WMA_TARGET_SH4#endif#ifdef _Embedded_x86#define WMA_TARGET_Embedded_x86#endif#ifdef S_SUNOS5#define WMA_TARGET_S_SUNOS5#endif#ifdef _ARM_#define WMA_TARGET_ARM#endif// It's often nice to be able to compare the output between optimized versions// and the ANSI version, to verify that the optimizations are in sync. Alas,// some optimizations sacrifice reproducibility for speed. The following #define allows// us to disable those optimizations to verify the main algorithms.//#define WMA_ANSI_COMPATIBILITY_MODE#endif // !DISABLE_OPT// ======================================================// Intel x86 Platform// ======================================================#if defined(WMA_TARGET_X86) || defined(WMA_TARGET_WIN64)#undef USE_SIN_COS_TABLES //don't use it for now// Override the ROUNDF/ROUNDD macros below#ifndef LITTLE_ENDIAN#define LITTLE_ENDIAN#endif //LITTLE_ENDIAN#define PLATFORM_SPECIFIC_ROUND#define PLATFORM_SPECIFIC_DIVI64BYU32#define PLATFORM_SPECIFIC_CEILOFLOG2#define PLATFORM_SPECIFIC_BITCOPY#define PLATFORM_SPECIFIC_FNPTR //mmx, katmai#if defined (WMA_ANSI_COMPATIBILITY_MODE) || defined(WMA_TARGET_WIN64)#undef PLATFORM_SPECIFIC_ROUND#undef PLATFORM_SPECIFIC_DIVI64BYU32#undef PLATFORM_SPECIFIC_CEILOFLOG2#endif // WMA_ANSI_COMPATIBILITY_MODE// Do the fundamental typedefs: {U|I}{8|16|32|64}typedef unsigned __int64 U64;typedef __int64 I64;// Default all other typedefs to standard definitions (see below) // Do compiler directives#define PLATFORM_SPECIFIC_INLINE#if _MSC_VER >= 1200 /* VC6.0 == 1200, VC5.0 == 1100 */#define INLINE __forceinline#else /* _MSC_VER */#define INLINE __inline#endif /* _MSC_VER */// ======================================================// QNX in X86 Platform// ======================================================#elif defined(WMA_TARGET_QNX_X86)// Override the ROUNDF/ROUNDD macros below#define LITTLE_ENDIAN#define PLATFORM_SPECIFIC_ROUND#define PLATFORM_SPECIFIC_BITCOPY#ifdef WMA_ANSI_COMPATIBILITY_MODE#undef PLATFORM_SPECIFIC_ROUND#endif // WMA_ANSI_COMPATIBILITY_MODE// Do the fundamental typedefs: {U|I}{8|16|32|64}#ifdef __QNX__#include "../qnx/qnx.h"#elsetypedef __int64 U64;typedef __int64 I64;#endif// Default all other typedefs to standard definitions (see below)// Do compiler directives#define PLATFORM_SPECIFIC_INLINE #define INLINE __inline// ======================================================// MIPS (Casio) Platform// ======================================================#elif defined(WMA_TARGET_MIPS)#define LITTLE_ENDIAN// Do the fundamental typedefs: {U|I}{8|16|32|64}typedef unsigned __int64 U64;typedef __int64 I64;// Default all other typedefs to standard definitions (see below)// Do compiler directives#define PLATFORM_SPECIFIC_INLINE#define INLINE __forceinline// ======================================================//SH3 (HP WinCE and Hitachi) Platform// ======================================================#elif defined(WMA_TARGET_SH3)#define LITTLE_ENDIAN// Do the fundamental typedefs: {U|I}{8|16|32|64}#ifdef NOINT64 #include "int64.h"typedef UINT64 U64;typedef INT64 I64;#elsetypedef unsigned __int64 U64;typedef __int64 I64;#endif// Default all other typedefs to standard definitions (see below)// Do compiler directives#define PLATFORM_SPECIFIC_INLINE#ifdef HITACHI#pragma inline(quickRand, RandStateClear, LOG2, NormUInt, Align2FracBits, ROUNDF, ROUNDD, bitCpy)#define INLINE static#else#define INLINE __forceinline#endif// ======================================================//SH4 (HP WinCE and Hitachi) Platform// ======================================================#elif defined(WMA_TARGET_SH4)#define LITTLE_ENDIAN// Do the fundamental typedefs: {U|I}{8|16|32|64}#ifdef NOINT64 #include "int64.h"typedef UINT64 U64;typedef INT64 I64;#elsetypedef __int64 U64;typedef __int64 I64;#endif// Default all other typedefs to standard definitions (see below)// Do compiler directives#define PLATFORM_SPECIFIC_INLINE#ifdef HITACHI#pragma inline(quickRand, RandStateClear, LOG2, NormUInt, Align2FracBits, ROUNDF, ROUNDD, bitCpy)#define INLINE static#else#define INLINE __forceinline#endif// ======================================================//ARM Platform// ======================================================#elif defined(WMA_TARGET_ARM)#define LITTLE_ENDIAN#ifndef PACKED #ifdef __GNUCOMP_VERSION #define PACKED __attribute__((packed)) #else #define PACKED __packed #endif #endif/* moved to wmatypes.h // Do the fundamental typedefs: {U|I}{8|16|32|64}typedef unsigned long long U64;typedef long long I64;#define PLATFORM_SPECIFIC_U64#define PLATFORM_SPECIFIC_I64// Default all other typedefs to standard definitions (see below)// Do compiler directives#define PLATFORM_SPECIFIC_INLINE//#define INLINE __forceinline //O.K.#define INLINE inline __attribute__((always_inline)) */// ======================================================//EmbeddedUnix in X86 Platform// ======================================================#elif defined(WMA_TARGET_Embedded_x86)#undef BIG_ENDIAN#undef LITTLE_ENDIAN#define LITTLE_ENDIAN// Do the fundamental typedefs: {U|I}{8|16|32|64}typedef unsigned long long U64;typedef long long I64;// Default all other typedefs to standard definitions (see below)// // Do compiler directives#define PLATFORM_SPECIFIC_INLINE#define INLINE inline // ======================================================//Sun Solaris// ======================================================#elif defined(WMA_TARGET_S_SUNOS5)#undef LITTLE_ENDIAN#undef BIG_ENDIAN#define BIG_ENDIAN// Do the fundamental typedefs: {U|I}{8|16|32|64}typedef unsigned long long int U64 ;typedef long long int I64 ;#define PLATFORM_SPECIFIC_I32typedef unsigned int U32;typedef int I32;// Default all other typedefs to standard definitions (see below)// // Do compiler directives#define PLATFORM_SPECIFIC_INLINE#define INLINE inline // ======================================================//MacOS Platform// ======================================================#elif defined(WMA_TARGET_MACOS)#undef LITTLE_ENDIAN#undef BIG_ENDIAN#define BIG_ENDIAN#include <stdint.h>// Do the fundamental typedefs: {U|I}{8|16|32|64}typedef unsigned long long U64;typedef long long I64;// Default all other typedefs to standard definitions (see below)// // ======================================================// ANSI-C version (no platform-specific details// ======================================================#else#define WMA_TARGET_ANSI// Default endian#if !defined(LITTLE_ENDIAN) && !defined(BIG_ENDIAN)#define LITTLE_ENDIAN#endif// Do the fundamental typedefs: {U|I}{8|16|32|64}#ifdef NOINT64 #include "int64.h"typedef UINT64 U64;#else#ifdef __QNX__typedef unsigned long long int U64;typedef long long int I64;#else#ifdef macintoshtypedef unsigned long long U64;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -