digiKam
util.h File Reference

Go to the source code of this file.

Macros

#define abs_value(a)   (((a)<0) ? -(a) : (a))
 
#define ALIGNED_16(var)   LIBDE265_DECLARE_ALIGNED( var, 16 )
 
#define ALIGNED_32(var)   LIBDE265_DECLARE_ALIGNED( var, 32 )
 
#define ALIGNED_4(var)   LIBDE265_DECLARE_ALIGNED( var, 4 )
 
#define ALIGNED_8(var)   LIBDE265_DECLARE_ALIGNED( var, 8 )
 
#define Clip1_8bit(value)   ((value)<0 ? 0 : (value)>255 ? 255 : (value))
 
#define Clip3(low, high, value)   ((value)<(low) ? (low) : (value)>(high) ? (high) : (value))
 
#define Clip_BitDepth(value, bit_depth)   ((value)<0 ? 0 : (value)>((1<<bit_depth)-1) ? ((1<<bit_depth)-1) : (value))
 
#define disable_logging(x)   { }
 
#define enable_logging(x)   { }
 
#define FOR_LOOP(type, var, list)   for (type var : list)
 
#define FOR_LOOP_AUTO_SUPPORT   1
 
#define LIBDE265_CHECK_RESULT
 
#define LIBDE265_DECLARE_ALIGNED(var, n)   var __attribute__((aligned(n)))
 
#define libde265_max(a, b)   (((a)>(b)) ? (a) : (b))
 
#define libde265_min(a, b)   (((a)<(b)) ? (a) : (b))
 
#define likely(x)   __builtin_expect(!!(x), 1)
 
#define log_set_current_POC(poc)   { }
 
#define logdebug(a, b, ...)   { }
 
#define logerror(a, b, ...)   { }
 
#define loginfo(a, b, ...)   { }
 
#define logtrace(a, b, ...)   { }
 
#define Sign(value)   (((value)<0) ? -1 : ((value)>0) ? 1 : 0)
 
#define unlikely(x)   __builtin_expect(!!(x), 0)
 

Enumerations

enum  LogModule {
  LogHighlevel , LogHeaders , LogSlice , LogDPB ,
  LogMotion , LogTransform , LogDeblock , LogSAO ,
  LogSEI , LogIntraPred , LogPixels , LogSymbols ,
  LogCABAC , LogEncoder , LogEncoderMetadata , NUMBER_OF_LogModules
}
 

Functions

void copy_subimage (uint8_t *dst, int dststride, const uint8_t *src, int srcstride, int w, int h)
 
void debug_set_image_output (void(*)(const struct de265_image *, int slot))
 
void debug_show_image (const struct de265_image *, int slot)
 
void log2fh (FILE *fh, const char *string,...)
 
bool logdebug_enabled (enum LogModule module)
 
void printBlk (const char *title, const int16_t *data, int blksize, int stride, const std::string &prefix=" ")
 
void printBlk (const char *title, const int32_t *data, int blksize, int stride, const std::string &prefix=" ")
 
void printBlk (const char *title, const uint8_t *data, int blksize, int stride, const std::string &prefix=" ")
 

Macro Definition Documentation

◆ abs_value

#define abs_value (   a)    (((a)<0) ? -(a) : (a))

◆ ALIGNED_16

#define ALIGNED_16 (   var)    LIBDE265_DECLARE_ALIGNED( var, 16 )

◆ ALIGNED_32

#define ALIGNED_32 (   var)    LIBDE265_DECLARE_ALIGNED( var, 32 )

◆ ALIGNED_4

#define ALIGNED_4 (   var)    LIBDE265_DECLARE_ALIGNED( var, 4 )

◆ ALIGNED_8

#define ALIGNED_8 (   var)    LIBDE265_DECLARE_ALIGNED( var, 8 )

◆ Clip1_8bit

#define Clip1_8bit (   value)    ((value)<0 ? 0 : (value)>255 ? 255 : (value))

◆ Clip3

#define Clip3 (   low,
  high,
  value 
)    ((value)<(low) ? (low) : (value)>(high) ? (high) : (value))

◆ Clip_BitDepth

#define Clip_BitDepth (   value,
  bit_depth 
)    ((value)<0 ? 0 : (value)>((1<<bit_depth)-1) ? ((1<<bit_depth)-1) : (value))

◆ disable_logging

#define disable_logging (   x)    { }

◆ enable_logging

#define enable_logging (   x)    { }

◆ FOR_LOOP

#define FOR_LOOP (   type,
  var,
  list 
)    for (type var : list)

◆ FOR_LOOP_AUTO_SUPPORT

#define FOR_LOOP_AUTO_SUPPORT   1

◆ LIBDE265_CHECK_RESULT

#define LIBDE265_CHECK_RESULT

◆ LIBDE265_DECLARE_ALIGNED

#define LIBDE265_DECLARE_ALIGNED (   var,
 
)    var __attribute__((aligned(n)))

◆ libde265_max

#define libde265_max (   a,
 
)    (((a)>(b)) ? (a) : (b))

◆ libde265_min

#define libde265_min (   a,
 
)    (((a)<(b)) ? (a) : (b))

◆ likely

#define likely (   x)    __builtin_expect(!!(x), 1)

◆ log_set_current_POC

#define log_set_current_POC (   poc)    { }

◆ logdebug

#define logdebug (   a,
  b,
  ... 
)    { }

◆ logerror

#define logerror (   a,
  b,
  ... 
)    { }

◆ loginfo

#define loginfo (   a,
  b,
  ... 
)    { }

◆ logtrace

#define logtrace (   a,
  b,
  ... 
)    { }

◆ Sign

#define Sign (   value)    (((value)<0) ? -1 : ((value)>0) ? 1 : 0)

◆ unlikely

#define unlikely (   x)    __builtin_expect(!!(x), 0)

Enumeration Type Documentation

◆ LogModule

enum LogModule
Enumerator
LogHighlevel 
LogHeaders 
LogSlice 
LogDPB 
LogMotion 
LogTransform 
LogDeblock 
LogSAO 
LogSEI 
LogIntraPred 
LogPixels 
LogSymbols 
LogCABAC 
LogEncoder 
LogEncoderMetadata 
NUMBER_OF_LogModules 

Function Documentation

◆ copy_subimage()

void copy_subimage ( uint8_t *  dst,
int  dststride,
const uint8_t *  src,
int  srcstride,
int  w,
int  h 
)

◆ debug_set_image_output()

void debug_set_image_output ( void(*)(const struct de265_image *, int slot)  )

◆ debug_show_image()

void debug_show_image ( const struct de265_image ,
int  slot 
)

◆ log2fh()

void log2fh ( FILE *  fh,
const char *  string,
  ... 
)

◆ logdebug_enabled()

bool logdebug_enabled ( enum LogModule  module)
inline

◆ printBlk() [1/3]

void printBlk ( const char *  title,
const int16_t *  data,
int  blksize,
int  stride,
const std::string &  prefix = "  " 
)

◆ printBlk() [2/3]

void printBlk ( const char *  title,
const int32_t *  data,
int  blksize,
int  stride,
const std::string &  prefix = "  " 
)

◆ printBlk() [3/3]

void printBlk ( const char *  title,
const uint8_t *  data,
int  blksize,
int  stride,
const std::string &  prefix = "  " 
)