[x265] [PATCH] types: use stdint.h data types for UChar, UShort, UInt64, Pel, TCoeff
Steve Borho
steve at borho.org
Thu Sep 19 06:18:17 CEST 2013
# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1379564281 18000
# Wed Sep 18 23:18:01 2013 -0500
# Node ID a5aad9315eae594d23f814c69b181a2e9ebf8c13
# Parent 2531c630739e2df585aea1451c22ae92b053a3a1
types: use stdint.h data types for UChar, UShort, UInt64, Pel, TCoeff
diff -r 2531c630739e -r a5aad9315eae source/Lib/TLibCommon/TypeDef.h
--- a/source/Lib/TLibCommon/TypeDef.h Wed Sep 18 21:02:49 2013 -0500
+++ b/source/Lib/TLibCommon/TypeDef.h Wed Sep 18 23:18:01 2013 -0500
@@ -38,6 +38,8 @@
#ifndef X265_TYPEDEF_H
#define X265_TYPEDEF_H
+#include <stdint.h>
+
namespace x265 {
// private namespace
@@ -45,35 +47,25 @@
// Basic type redefinition
// ====================================================================================================================
-typedef unsigned char UChar;
-typedef unsigned short UShort;
-typedef unsigned int UInt;
-
-// ====================================================================================================================
-// 64-bit integer type
-// ====================================================================================================================
-
-#ifdef _MSC_VER
-typedef __int64 Int64;
-typedef unsigned __int64 UInt64;
-#else
-typedef long long Int64;
-typedef unsigned long long UInt64;
-#endif // ifdef _MSC_VER
+typedef uint8_t UChar;
+typedef uint16_t UShort;
+typedef unsigned int UInt;
+typedef int64_t Int64;
+typedef uint64_t UInt64;
// ====================================================================================================================
// Type definition
// ====================================================================================================================
#if HIGH_BIT_DEPTH
-typedef UShort Pel; // 16-bit pixel type
+typedef uint16_t Pel; // 16-bit pixel type
#define X265_DEPTH x265::g_bitDepth // runtime configurable bit depth
extern int g_bitDepth;
#else
-typedef UChar Pel; // 8-bit pixel type
+typedef uint8_t Pel; // 8-bit pixel type
#define X265_DEPTH 8 // compile time configurable bit depth
#endif
-typedef int TCoeff; // transform coefficient
+typedef int32_t TCoeff; // transform coefficient
// ====================================================================================================================
// Enumeration
More information about the x265-devel
mailing list