38 #define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
42 #define LIBDE265_DECLARE_ALIGNED( var, n ) __declspec(align(n)) var
44 #define unlikely(x) (x)
46 #define LIBDE265_DECLARE_ALIGNED( var, n ) var __attribute__((aligned(n)))
47 #define likely(x) __builtin_expect(!!(x), 1)
48 #define unlikely(x) __builtin_expect(!!(x), 0)
51 #if defined(__GNUC__) && (__GNUC__ >= 4)
52 #define LIBDE265_CHECK_RESULT __attribute__ ((warn_unused_result))
53 #elif defined(_MSC_VER) && (_MSC_VER >= 1700)
54 #define LIBDE265_CHECK_RESULT _Check_return_
56 #define LIBDE265_CHECK_RESULT
62 #define ALIGNED_32( var ) LIBDE265_DECLARE_ALIGNED( var, 32 )
63 #define ALIGNED_16( var ) LIBDE265_DECLARE_ALIGNED( var, 16 )
64 #define ALIGNED_8( var ) LIBDE265_DECLARE_ALIGNED( var, 8 )
65 #define ALIGNED_4( var ) LIBDE265_DECLARE_ALIGNED( var, 4 )
68 #if defined(_MSC_VER) || (!__clang__ && __GNUC__ && GCC_VERSION < 40600)
69 #define FOR_LOOP(type, var, list) for each (type var in list)
70 #undef FOR_LOOP_AUTO_SUPPORT
72 #define FOR_LOOP(type, var, list) for (type var : list)
73 #define FOR_LOOP_AUTO_SUPPORT 1
76 #ifdef USE_STD_TR1_NAMESPACE
78 namespace std {
using namespace std::tr1; }
81 #ifdef NEED_STD_MOVE_FALLBACK
86 template<
typename _Tp>
87 inline typename std::remove_reference<_Tp>::type&& move(_Tp&& __t) {
88 return static_cast<typename std::remove_reference<_Tp>::type&&
>(__t);
94 #ifdef NEED_NULLPTR_FALLBACK
111 #define Clip1_8bit(value) ((value)<0 ? 0 : (value)>255 ? 255 : (value))
112 #define Clip_BitDepth(value, bit_depth) ((value)<0 ? 0 : (value)>((1<<bit_depth)-1) ? ((1<<bit_depth)-1) : (value))
113 #define Clip3(low,high,value) ((value)<(low) ? (low) : (value)>(high) ? (high) : (value))
114 #define Sign(value) (((value)<0) ? -1 : ((value)>0) ? 1 : 0)
115 #define abs_value(a) (((a)<0) ? -(a) : (a))
116 #define libde265_min(a,b) (((a)<(b)) ? (a) : (b))
117 #define libde265_max(a,b) (((a)>(b)) ? (a) : (b))
128 while (val > (1<<n)) {
152 const uint8_t* src,
int srcstride,
178 #if defined(DE265_LOG_ERROR) || defined(DE265_LOG_INFO) || defined(DE265_LOG_DEBUG) || defined(DE265_LOG_TRACE)
179 # define DE265_LOGGING 1
183 #define enable_logging(x) { }
184 #define disable_logging(x) { }
190 #define log_set_current_POC(poc) { }
193 #ifdef DE265_LOG_ERROR
196 #define logerror(a,b, ...) { }
199 #ifdef DE265_LOG_INFO
202 #define loginfo(a,b, ...) { }
205 #ifdef DE265_LOG_DEBUG
209 #define logdebug(a,b, ...) { }
213 #ifdef DE265_LOG_TRACE
216 #define logtrace(a,b, ...) { }
219 void log2fh(FILE* fh,
const char*
string, ...);
222 void printBlk(
const char* title,
const int32_t* data,
int blksize,
int stride,
const std::string&
prefix=
" ");
223 void printBlk(
const char* title,
const int16_t* data,
int blksize,
int stride,
const std::string&
prefix=
" ");
224 void printBlk(
const char* title,
const uint8_t* data,
int blksize,
int stride,
const std::string&
prefix=
" ");
#define LIBDE265_INLINE
Definition: de265.h:66
QStringView prefix
Definition: itemviewutilities.cpp:593
void copy_subimage(uint8_t *dst, int dststride, const uint8_t *src, int srcstride, int w, int h)
#define enable_logging(x)
Definition: util.h:183
#define loginfo(a, b,...)
Definition: util.h:202
#define logtrace(a, b,...)
Definition: util.h:216
#define log_set_current_POC(poc)
Definition: util.h:190
#define disable_logging(x)
Definition: util.h:184
#define logerror(a, b,...)
Definition: util.h:196
void log2fh(FILE *fh, const char *string,...)
void debug_set_image_output(void(*)(const struct de265_image *, int slot))
LogModule
Definition: util.h:158
@ LogSAO
Definition: util.h:166
@ LogIntraPred
Definition: util.h:168
@ LogDPB
Definition: util.h:162
@ LogSymbols
Definition: util.h:170
@ LogHighlevel
Definition: util.h:159
@ LogSlice
Definition: util.h:161
@ LogPixels
Definition: util.h:169
@ LogSEI
Definition: util.h:167
@ LogDeblock
Definition: util.h:165
@ LogEncoderMetadata
Definition: util.h:173
@ LogTransform
Definition: util.h:164
@ LogCABAC
Definition: util.h:171
@ LogEncoder
Definition: util.h:172
@ LogMotion
Definition: util.h:163
@ NUMBER_OF_LogModules
Definition: util.h:174
@ LogHeaders
Definition: util.h:160
void printBlk(const char *title, const int32_t *data, int blksize, int stride, const std::string &prefix=" ")
void debug_show_image(const struct de265_image *, int slot)
#define logdebug(a, b,...)
Definition: util.h:209
bool logdebug_enabled(enum LogModule module)
Definition: util.h:210