/src/libde265/libde265/util.h
Line | Count | Source |
1 | | /* |
2 | | * H.265 video codec. |
3 | | * Copyright (c) 2013-2014 struktur AG, Dirk Farin <farin@struktur.de> |
4 | | * |
5 | | * This file is part of libde265. |
6 | | * |
7 | | * libde265 is free software: you can redistribute it and/or modify |
8 | | * it under the terms of the GNU Lesser General Public License as |
9 | | * published by the Free Software Foundation, either version 3 of |
10 | | * the License, or (at your option) any later version. |
11 | | * |
12 | | * libde265 is distributed in the hope that it will be useful, |
13 | | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | | * GNU Lesser General Public License for more details. |
16 | | * |
17 | | * You should have received a copy of the GNU Lesser General Public License |
18 | | * along with libde265. If not, see <http://www.gnu.org/licenses/>. |
19 | | */ |
20 | | |
21 | | #ifndef DE265_UTIL_H |
22 | | #define DE265_UTIL_H |
23 | | |
24 | | #ifdef HAVE_CONFIG_H |
25 | | #include "config.h" |
26 | | #endif |
27 | | |
28 | | #ifndef _MSC_VER |
29 | | #include <inttypes.h> |
30 | | #endif |
31 | | |
32 | | #include <stdio.h> |
33 | | #include <string> |
34 | | #include <cstdlib> |
35 | | |
36 | | #include "libde265/de265.h" |
37 | | |
38 | | #ifdef __GNUC__ |
39 | | #define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) |
40 | | #endif |
41 | | |
42 | | #ifdef _MSC_VER |
43 | | #define LIBDE265_DECLARE_ALIGNED( var, n ) __declspec(align(n)) var |
44 | | #define likely(x) (x) |
45 | | #define unlikely(x) (x) |
46 | | #else |
47 | 10.3M | #define LIBDE265_DECLARE_ALIGNED( var, n ) var __attribute__((aligned(n))) |
48 | 19.6M | #define likely(x) __builtin_expect(!!(x), 1) |
49 | 4.49M | #define unlikely(x) __builtin_expect(!!(x), 0) |
50 | | #endif |
51 | | |
52 | | #if defined(__GNUC__) && (__GNUC__ >= 4) |
53 | | #define LIBDE265_CHECK_RESULT __attribute__ ((warn_unused_result)) |
54 | | #elif defined(_MSC_VER) && (_MSC_VER >= 1700) |
55 | | #define LIBDE265_CHECK_RESULT _Check_return_ |
56 | | #else |
57 | | #define LIBDE265_CHECK_RESULT |
58 | | #endif |
59 | | |
60 | | // Be careful with these alignment instructions. They only specify the alignment within |
61 | | // a struct. But they cannot make sure that the base address of the struct has the same alignment |
62 | | // when it is dynamically allocated. |
63 | 4.39M | #define ALIGNED_32( var ) LIBDE265_DECLARE_ALIGNED( var, 32 ) |
64 | 5.95M | #define ALIGNED_16( var ) LIBDE265_DECLARE_ALIGNED( var, 16 ) |
65 | | #define ALIGNED_8( var ) LIBDE265_DECLARE_ALIGNED( var, 8 ) |
66 | | #define ALIGNED_4( var ) LIBDE265_DECLARE_ALIGNED( var, 4 ) |
67 | | |
68 | | #ifdef _MSC_VER |
69 | | #ifdef _CPPRTTI |
70 | | #define RTTI_ENABLED |
71 | | #endif |
72 | | #else |
73 | | #ifdef __GXX_RTTI |
74 | | #define RTTI_ENABLED |
75 | | #endif |
76 | | #endif |
77 | | |
78 | | inline static int Clip1_8bit(int value) |
79 | 67.8M | { |
80 | 67.8M | return value<0 ? 0 : value>255 ? 255 : value; |
81 | 67.8M | } Unexecuted instantiation: de265.cc:Clip1_8bit(int) Unexecuted instantiation: decctx.cc:Clip1_8bit(int) Unexecuted instantiation: contextmodel.cc:Clip1_8bit(int) Unexecuted instantiation: deblock.cc:Clip1_8bit(int) Unexecuted instantiation: cabac.cc:Clip1_8bit(int) Unexecuted instantiation: dpb.cc:Clip1_8bit(int) Unexecuted instantiation: fallback.cc:Clip1_8bit(int) fallback-motion.cc:Clip1_8bit(int) Line | Count | Source | 79 | 57.6M | { | 80 | 57.6M | return value<0 ? 0 : value>255 ? 255 : value; | 81 | 57.6M | } |
fallback-dct.cc:Clip1_8bit(int) Line | Count | Source | 79 | 10.1M | { | 80 | 10.1M | return value<0 ? 0 : value>255 ? 255 : value; | 81 | 10.1M | } |
Unexecuted instantiation: fallback-intrapred.cc:Clip1_8bit(int) Unexecuted instantiation: fallback-deblk.cc:Clip1_8bit(int) Unexecuted instantiation: image.cc:Clip1_8bit(int) Unexecuted instantiation: intrapred.cc:Clip1_8bit(int) Unexecuted instantiation: nal-parser.cc:Clip1_8bit(int) Unexecuted instantiation: pps.cc:Clip1_8bit(int) Unexecuted instantiation: sao.cc:Clip1_8bit(int) Unexecuted instantiation: sei.cc:Clip1_8bit(int) Unexecuted instantiation: slice.cc:Clip1_8bit(int) Unexecuted instantiation: refpic.cc:Clip1_8bit(int) Unexecuted instantiation: motion.cc:Clip1_8bit(int) Unexecuted instantiation: sps.cc:Clip1_8bit(int) Unexecuted instantiation: threads.cc:Clip1_8bit(int) Unexecuted instantiation: transform.cc:Clip1_8bit(int) Unexecuted instantiation: util.cc:Clip1_8bit(int) Unexecuted instantiation: vps.cc:Clip1_8bit(int) Unexecuted instantiation: vui.cc:Clip1_8bit(int) Unexecuted instantiation: sse-motion.cc:Clip1_8bit(int) Unexecuted instantiation: sse-dct.cc:Clip1_8bit(int) Unexecuted instantiation: sse-intrapred.cc:Clip1_8bit(int) |
82 | | |
83 | | inline static int Clip_BitDepth(int value, int bit_depth) |
84 | 282M | { |
85 | 282M | const int maxval = (1<<bit_depth)-1; |
86 | 282M | return value<0 ? 0 : value>maxval ? maxval : value; |
87 | 282M | } Unexecuted instantiation: de265.cc:Clip_BitDepth(int, int) Unexecuted instantiation: decctx.cc:Clip_BitDepth(int, int) Unexecuted instantiation: contextmodel.cc:Clip_BitDepth(int, int) deblock.cc:Clip_BitDepth(int, int) Line | Count | Source | 84 | 22.2M | { | 85 | 22.2M | const int maxval = (1<<bit_depth)-1; | 86 | 22.2M | return value<0 ? 0 : value>maxval ? maxval : value; | 87 | 22.2M | } |
Unexecuted instantiation: cabac.cc:Clip_BitDepth(int, int) Unexecuted instantiation: dpb.cc:Clip_BitDepth(int, int) Unexecuted instantiation: fallback.cc:Clip_BitDepth(int, int) fallback-motion.cc:Clip_BitDepth(int, int) Line | Count | Source | 84 | 124M | { | 85 | 124M | const int maxval = (1<<bit_depth)-1; | 86 | 124M | return value<0 ? 0 : value>maxval ? maxval : value; | 87 | 124M | } |
fallback-dct.cc:Clip_BitDepth(int, int) Line | Count | Source | 84 | 109M | { | 85 | 109M | const int maxval = (1<<bit_depth)-1; | 86 | 109M | return value<0 ? 0 : value>maxval ? maxval : value; | 87 | 109M | } |
fallback-intrapred.cc:Clip_BitDepth(int, int) Line | Count | Source | 84 | 417k | { | 85 | 417k | const int maxval = (1<<bit_depth)-1; | 86 | 417k | return value<0 ? 0 : value>maxval ? maxval : value; | 87 | 417k | } |
fallback-deblk.cc:Clip_BitDepth(int, int) Line | Count | Source | 84 | 25.3M | { | 85 | 25.3M | const int maxval = (1<<bit_depth)-1; | 86 | 25.3M | return value<0 ? 0 : value>maxval ? maxval : value; | 87 | 25.3M | } |
Unexecuted instantiation: image.cc:Clip_BitDepth(int, int) Unexecuted instantiation: intrapred.cc:Clip_BitDepth(int, int) Unexecuted instantiation: nal-parser.cc:Clip_BitDepth(int, int) Unexecuted instantiation: pps.cc:Clip_BitDepth(int, int) Unexecuted instantiation: sao.cc:Clip_BitDepth(int, int) Unexecuted instantiation: sei.cc:Clip_BitDepth(int, int) Unexecuted instantiation: slice.cc:Clip_BitDepth(int, int) Unexecuted instantiation: refpic.cc:Clip_BitDepth(int, int) Unexecuted instantiation: motion.cc:Clip_BitDepth(int, int) Unexecuted instantiation: sps.cc:Clip_BitDepth(int, int) Unexecuted instantiation: threads.cc:Clip_BitDepth(int, int) Unexecuted instantiation: transform.cc:Clip_BitDepth(int, int) Unexecuted instantiation: util.cc:Clip_BitDepth(int, int) Unexecuted instantiation: vps.cc:Clip_BitDepth(int, int) Unexecuted instantiation: vui.cc:Clip_BitDepth(int, int) Unexecuted instantiation: sse-motion.cc:Clip_BitDepth(int, int) Unexecuted instantiation: sse-dct.cc:Clip_BitDepth(int, int) sse-intrapred.cc:Clip_BitDepth(int, int) Line | Count | Source | 84 | 291k | { | 85 | 291k | const int maxval = (1<<bit_depth)-1; | 86 | 291k | return value<0 ? 0 : value>maxval ? maxval : value; | 87 | 291k | } |
|
88 | | |
89 | | inline static int Clip3(int low, int high, int value) |
90 | 1.10G | { |
91 | 1.10G | return value<low ? low : value>high ? high : value; |
92 | 1.10G | } Unexecuted instantiation: de265.cc:Clip3(int, int, int) Unexecuted instantiation: decctx.cc:Clip3(int, int, int) contextmodel.cc:Clip3(int, int, int) Line | Count | Source | 90 | 1.81M | { | 91 | 1.81M | return value<low ? low : value>high ? high : value; | 92 | 1.81M | } |
deblock.cc:Clip3(int, int, int) Line | Count | Source | 90 | 63.7M | { | 91 | 63.7M | return value<low ? low : value>high ? high : value; | 92 | 63.7M | } |
Unexecuted instantiation: cabac.cc:Clip3(int, int, int) Unexecuted instantiation: dpb.cc:Clip3(int, int, int) Unexecuted instantiation: fallback.cc:Clip3(int, int, int) Unexecuted instantiation: fallback-motion.cc:Clip3(int, int, int) fallback-dct.cc:Clip3(int, int, int) Line | Count | Source | 90 | 161M | { | 91 | 161M | return value<low ? low : value>high ? high : value; | 92 | 161M | } |
Unexecuted instantiation: fallback-intrapred.cc:Clip3(int, int, int) fallback-deblk.cc:Clip3(int, int, int) Line | Count | Source | 90 | 14.0M | { | 91 | 14.0M | return value<low ? low : value>high ? high : value; | 92 | 14.0M | } |
Unexecuted instantiation: image.cc:Clip3(int, int, int) Unexecuted instantiation: intrapred.cc:Clip3(int, int, int) Unexecuted instantiation: nal-parser.cc:Clip3(int, int, int) Unexecuted instantiation: pps.cc:Clip3(int, int, int) sao.cc:Clip3(int, int, int) Line | Count | Source | 90 | 163M | { | 91 | 163M | return value<low ? low : value>high ? high : value; | 92 | 163M | } |
Unexecuted instantiation: sei.cc:Clip3(int, int, int) slice.cc:Clip3(int, int, int) Line | Count | Source | 90 | 53.8M | { | 91 | 53.8M | return value<low ? low : value>high ? high : value; | 92 | 53.8M | } |
Unexecuted instantiation: refpic.cc:Clip3(int, int, int) motion.cc:Clip3(int, int, int) Line | Count | Source | 90 | 608M | { | 91 | 608M | return value<low ? low : value>high ? high : value; | 92 | 608M | } |
Unexecuted instantiation: sps.cc:Clip3(int, int, int) Unexecuted instantiation: threads.cc:Clip3(int, int, int) transform.cc:Clip3(int, int, int) Line | Count | Source | 90 | 41.4M | { | 91 | 41.4M | return value<low ? low : value>high ? high : value; | 92 | 41.4M | } |
Unexecuted instantiation: util.cc:Clip3(int, int, int) Unexecuted instantiation: vps.cc:Clip3(int, int, int) Unexecuted instantiation: vui.cc:Clip3(int, int, int) Unexecuted instantiation: sse-motion.cc:Clip3(int, int, int) Unexecuted instantiation: sse-dct.cc:Clip3(int, int, int) Unexecuted instantiation: sse-intrapred.cc:Clip3(int, int, int) |
93 | | |
94 | | // three-valued sign: returns -1, 0, or +1 |
95 | | template <typename T> inline int Sign(T value) |
96 | 20.0M | { |
97 | 20.0M | return (T(0) < value) - (value < T(0)); |
98 | 20.0M | } |
99 | | |
100 | | inline static int ceil_div(int num,int denom) |
101 | 23.9k | { |
102 | 23.9k | num += denom-1; |
103 | 23.9k | return num/denom; |
104 | 23.9k | } Unexecuted instantiation: de265.cc:ceil_div(int, int) Unexecuted instantiation: decctx.cc:ceil_div(int, int) Unexecuted instantiation: contextmodel.cc:ceil_div(int, int) Unexecuted instantiation: deblock.cc:ceil_div(int, int) Unexecuted instantiation: cabac.cc:ceil_div(int, int) Unexecuted instantiation: dpb.cc:ceil_div(int, int) Unexecuted instantiation: fallback.cc:ceil_div(int, int) Unexecuted instantiation: fallback-motion.cc:ceil_div(int, int) Unexecuted instantiation: fallback-dct.cc:ceil_div(int, int) Unexecuted instantiation: fallback-intrapred.cc:ceil_div(int, int) Unexecuted instantiation: fallback-deblk.cc:ceil_div(int, int) Unexecuted instantiation: image.cc:ceil_div(int, int) Unexecuted instantiation: intrapred.cc:ceil_div(int, int) Unexecuted instantiation: nal-parser.cc:ceil_div(int, int) Unexecuted instantiation: pps.cc:ceil_div(int, int) Unexecuted instantiation: sao.cc:ceil_div(int, int) Unexecuted instantiation: sei.cc:ceil_div(int, int) Unexecuted instantiation: slice.cc:ceil_div(int, int) Unexecuted instantiation: refpic.cc:ceil_div(int, int) Unexecuted instantiation: motion.cc:ceil_div(int, int) sps.cc:ceil_div(int, int) Line | Count | Source | 101 | 23.9k | { | 102 | 23.9k | num += denom-1; | 103 | 23.9k | return num/denom; | 104 | 23.9k | } |
Unexecuted instantiation: threads.cc:ceil_div(int, int) Unexecuted instantiation: transform.cc:ceil_div(int, int) Unexecuted instantiation: util.cc:ceil_div(int, int) Unexecuted instantiation: vps.cc:ceil_div(int, int) Unexecuted instantiation: vui.cc:ceil_div(int, int) Unexecuted instantiation: sse-motion.cc:ceil_div(int, int) Unexecuted instantiation: sse-dct.cc:ceil_div(int, int) Unexecuted instantiation: sse-intrapred.cc:ceil_div(int, int) |
105 | | |
106 | | inline static int ceil_log2(int val) |
107 | 1.68k | { |
108 | 1.68k | int n=0; |
109 | 4.84k | while (val > (1<<n)) { |
110 | 3.16k | n++; |
111 | 3.16k | } |
112 | | |
113 | 1.68k | return n; |
114 | 1.68k | } Unexecuted instantiation: de265.cc:ceil_log2(int) Unexecuted instantiation: decctx.cc:ceil_log2(int) Unexecuted instantiation: contextmodel.cc:ceil_log2(int) Unexecuted instantiation: deblock.cc:ceil_log2(int) Unexecuted instantiation: cabac.cc:ceil_log2(int) Unexecuted instantiation: dpb.cc:ceil_log2(int) Unexecuted instantiation: fallback.cc:ceil_log2(int) Unexecuted instantiation: fallback-motion.cc:ceil_log2(int) Unexecuted instantiation: fallback-dct.cc:ceil_log2(int) Unexecuted instantiation: fallback-intrapred.cc:ceil_log2(int) Unexecuted instantiation: fallback-deblk.cc:ceil_log2(int) Unexecuted instantiation: image.cc:ceil_log2(int) Unexecuted instantiation: intrapred.cc:ceil_log2(int) Unexecuted instantiation: nal-parser.cc:ceil_log2(int) Unexecuted instantiation: pps.cc:ceil_log2(int) Unexecuted instantiation: sao.cc:ceil_log2(int) Unexecuted instantiation: sei.cc:ceil_log2(int) Line | Count | Source | 107 | 1.68k | { | 108 | 1.68k | int n=0; | 109 | 4.84k | while (val > (1<<n)) { | 110 | 3.16k | n++; | 111 | 3.16k | } | 112 | | | 113 | 1.68k | return n; | 114 | 1.68k | } |
Unexecuted instantiation: refpic.cc:ceil_log2(int) Unexecuted instantiation: motion.cc:ceil_log2(int) Unexecuted instantiation: sps.cc:ceil_log2(int) Unexecuted instantiation: threads.cc:ceil_log2(int) Unexecuted instantiation: transform.cc:ceil_log2(int) Unexecuted instantiation: util.cc:ceil_log2(int) Unexecuted instantiation: vps.cc:ceil_log2(int) Unexecuted instantiation: vui.cc:ceil_log2(int) Unexecuted instantiation: sse-motion.cc:ceil_log2(int) Unexecuted instantiation: sse-dct.cc:ceil_log2(int) Unexecuted instantiation: sse-intrapred.cc:ceil_log2(int) |
115 | | |
116 | | inline static int Log2(int v) |
117 | 12.6M | { |
118 | 12.6M | int n=0; |
119 | 39.3M | while (v>1) { |
120 | 26.6M | n++; |
121 | 26.6M | v>>=1; |
122 | 26.6M | } |
123 | | |
124 | 12.6M | return n; |
125 | 12.6M | } Unexecuted instantiation: de265.cc:Log2(int) Unexecuted instantiation: decctx.cc:Log2(int) Unexecuted instantiation: contextmodel.cc:Log2(int) Unexecuted instantiation: deblock.cc:Log2(int) Unexecuted instantiation: cabac.cc:Log2(int) Unexecuted instantiation: dpb.cc:Log2(int) Unexecuted instantiation: fallback.cc:Log2(int) Unexecuted instantiation: fallback-motion.cc:Log2(int) fallback-dct.cc:Log2(int) Line | Count | Source | 117 | 3.24M | { | 118 | 3.24M | int n=0; | 119 | 10.1M | while (v>1) { | 120 | 6.87M | n++; | 121 | 6.87M | v>>=1; | 122 | 6.87M | } | 123 | | | 124 | 3.24M | return n; | 125 | 3.24M | } |
fallback-intrapred.cc:Log2(int) Line | Count | Source | 117 | 2.70M | { | 118 | 2.70M | int n=0; | 119 | 8.33M | while (v>1) { | 120 | 5.63M | n++; | 121 | 5.63M | v>>=1; | 122 | 5.63M | } | 123 | | | 124 | 2.70M | return n; | 125 | 2.70M | } |
Unexecuted instantiation: fallback-deblk.cc:Log2(int) Unexecuted instantiation: image.cc:Log2(int) Unexecuted instantiation: intrapred.cc:Log2(int) Unexecuted instantiation: nal-parser.cc:Log2(int) Unexecuted instantiation: pps.cc:Log2(int) Unexecuted instantiation: sao.cc:Log2(int) Unexecuted instantiation: sei.cc:Log2(int) Unexecuted instantiation: slice.cc:Log2(int) Unexecuted instantiation: refpic.cc:Log2(int) Unexecuted instantiation: motion.cc:Log2(int) Unexecuted instantiation: sps.cc:Log2(int) Unexecuted instantiation: threads.cc:Log2(int) Unexecuted instantiation: util.cc:Log2(int) Unexecuted instantiation: vps.cc:Log2(int) Unexecuted instantiation: vui.cc:Log2(int) Unexecuted instantiation: sse-motion.cc:Log2(int) Unexecuted instantiation: sse-dct.cc:Log2(int) Unexecuted instantiation: sse-intrapred.cc:Log2(int) |
126 | | |
127 | | inline static int Log2SizeToArea(int v) |
128 | 0 | { |
129 | 0 | return (1<<(v<<1)); |
130 | 0 | } Unexecuted instantiation: de265.cc:Log2SizeToArea(int) Unexecuted instantiation: decctx.cc:Log2SizeToArea(int) Unexecuted instantiation: contextmodel.cc:Log2SizeToArea(int) Unexecuted instantiation: deblock.cc:Log2SizeToArea(int) Unexecuted instantiation: cabac.cc:Log2SizeToArea(int) Unexecuted instantiation: dpb.cc:Log2SizeToArea(int) Unexecuted instantiation: fallback.cc:Log2SizeToArea(int) Unexecuted instantiation: fallback-motion.cc:Log2SizeToArea(int) Unexecuted instantiation: fallback-dct.cc:Log2SizeToArea(int) Unexecuted instantiation: fallback-intrapred.cc:Log2SizeToArea(int) Unexecuted instantiation: fallback-deblk.cc:Log2SizeToArea(int) Unexecuted instantiation: image.cc:Log2SizeToArea(int) Unexecuted instantiation: intrapred.cc:Log2SizeToArea(int) Unexecuted instantiation: nal-parser.cc:Log2SizeToArea(int) Unexecuted instantiation: pps.cc:Log2SizeToArea(int) Unexecuted instantiation: sao.cc:Log2SizeToArea(int) Unexecuted instantiation: sei.cc:Log2SizeToArea(int) Unexecuted instantiation: slice.cc:Log2SizeToArea(int) Unexecuted instantiation: refpic.cc:Log2SizeToArea(int) Unexecuted instantiation: motion.cc:Log2SizeToArea(int) Unexecuted instantiation: sps.cc:Log2SizeToArea(int) Unexecuted instantiation: threads.cc:Log2SizeToArea(int) Unexecuted instantiation: transform.cc:Log2SizeToArea(int) Unexecuted instantiation: util.cc:Log2SizeToArea(int) Unexecuted instantiation: vps.cc:Log2SizeToArea(int) Unexecuted instantiation: vui.cc:Log2SizeToArea(int) Unexecuted instantiation: sse-motion.cc:Log2SizeToArea(int) Unexecuted instantiation: sse-dct.cc:Log2SizeToArea(int) Unexecuted instantiation: sse-intrapred.cc:Log2SizeToArea(int) |
131 | | |
132 | | void copy_subimage(uint8_t* dst,int dststride, |
133 | | const uint8_t* src,int srcstride, |
134 | | int w, int h); |
135 | | |
136 | | |
137 | | // === logging === |
138 | | |
139 | | enum LogModule { |
140 | | LogHighlevel, |
141 | | LogHeaders, |
142 | | LogSlice, |
143 | | LogDPB, |
144 | | LogMotion, |
145 | | LogTransform, |
146 | | LogDeblock, |
147 | | LogSAO, |
148 | | LogSEI, |
149 | | LogIntraPred, |
150 | | LogPixels, |
151 | | LogSymbols, |
152 | | LogCABAC, |
153 | | LogEncoder, |
154 | | LogEncoderMetadata, |
155 | | NUMBER_OF_LogModules |
156 | | }; |
157 | | |
158 | | |
159 | | #if defined(DE265_LOG_ERROR) || defined(DE265_LOG_INFO) || defined(DE265_LOG_DEBUG) || defined(DE265_LOG_TRACE) |
160 | | # define DE265_LOGGING 1 |
161 | | void enable_logging(enum LogModule); |
162 | | void disable_logging(enum LogModule); |
163 | | #else |
164 | | #define enable_logging(x) { } |
165 | | #define disable_logging(x) { } |
166 | | #endif |
167 | | |
168 | | #ifdef DE265_LOGGING |
169 | | void log_set_current_POC(int poc); |
170 | | #else |
171 | | #define log_set_current_POC(poc) { } |
172 | | #endif |
173 | | |
174 | | #ifdef DE265_LOG_ERROR |
175 | | void logerror(enum LogModule module, const char* string, ...); |
176 | | #else |
177 | | #define logerror(...) { } |
178 | | #endif |
179 | | |
180 | | #ifdef DE265_LOG_INFO |
181 | | void loginfo (enum LogModule module, const char* string, ...); |
182 | | #else |
183 | 170k | #define loginfo(...) { } |
184 | | #endif |
185 | | |
186 | | #ifdef DE265_LOG_DEBUG |
187 | | void logdebug(enum LogModule module, const char* string, ...); |
188 | | bool logdebug_enabled(enum LogModule module); |
189 | | #else |
190 | 9.34M | #define logdebug(...) { } |
191 | 0 | inline bool logdebug_enabled(enum LogModule module) { return false; } |
192 | | #endif |
193 | | |
194 | | #ifdef DE265_LOG_TRACE |
195 | | void logtrace(enum LogModule module, const char* string, ...); |
196 | | #else |
197 | 2.41G | #define logtrace(...) { } |
198 | | #endif |
199 | | |
200 | | void log2fh(FILE* fh, const char* string, ...); |
201 | | |
202 | | |
203 | | void printBlk(const char* title,const int32_t* data, int blksize, int stride, const std::string& prefix=" "); |
204 | | void printBlk(const char* title,const int16_t* data, int blksize, int stride, const std::string& prefix=" "); |
205 | | void printBlk(const char* title,const uint8_t* data, int blksize, int stride, const std::string& prefix=" "); |
206 | | |
207 | | void debug_set_image_output(void (*)(const struct de265_image*, int slot)); |
208 | | void debug_show_image(const struct de265_image*, int slot); |
209 | | |
210 | | #endif |