58 #define PRINT_CONSTANT(NAME, NAME_WIDTH, VALUE_WIDTH) std::cout << std::setw(NAME_WIDTH) << #NAME << " = " << std::setw(VALUE_WIDTH) << NAME << std::endl;
76 static std::list< std::pair<std::string, std::string> > &
getEnvVarList();
81 EnvVar(
const std::string &sName,
const std::string &sDefault,
const std::string &sHelp);
97 namespace DebugOptionList
106 extern EnvVar DebugString_Structure;
107 extern EnvVar DebugString_Pred;
108 extern EnvVar DebugString_Resi;
109 extern EnvVar DebugString_Reco;
110 extern EnvVar DebugString_InvTran;
124 #if DEBUG_ENCODER_SEARCH_BINS
125 extern const UInt debugEncoderSearchBinTargetLine;
126 extern const UInt debugEncoderSearchBinWindow;
130 extern const UInt debugCabacBinTargetLine;
131 extern const UInt debugCabacBinWindow;
142 const TCoeff *
const pCoeff,
143 const Bool finalEncode=
true
153 template <
typename ValueType>
inline Void writeValueToStream (
const ValueType &value, std::ostream &stream,
const UInt outputWidth) { stream << std::setw(outputWidth) << value; }
157 template <
typename ValueType>
162 const UInt outputValueWidth = 0,
163 const Bool onlyPrintEdges =
false,
164 const Bool printInZScan =
false,
165 const Int shiftLeftBy = 0,
166 const Bool printAverage =
false,
167 std::ostream & stream = std::cout)
170 UInt outputWidth = outputValueWidth;
172 if (outputWidth == 0)
174 ValueType minimumValue =
leftShift(source[0], shiftLeftBy);
175 ValueType maximumValue = minimumValue;
177 for (
UInt y = 0; y < height; y++)
179 for (
UInt x = 0; x < width; x++)
183 if (!onlyPrintEdges || (x == 0) || (y == 0))
188 if (value < minimumValue)
190 minimumValue = value;
192 else if (value > maximumValue)
194 maximumValue = value;
205 ValueType valueSum = 0;
207 for (
UInt y = 0; y < height; y++)
209 for (
UInt x = 0; x < width; x++)
213 if (!onlyPrintEdges || (x == 0) || (y == 0))
224 const Int valueCount = onlyPrintEdges ?
Int((width + height) - 1) :
Int(width * height);
227 stream <<
"Average: " << (valueSum / valueCount) <<
"\n";
233 template <
typename T>
236 for (
UInt y=0; y<height; y++)
238 if (subBlockHeight!=0 && (y%subBlockHeight)==0 && y!=0)
240 ss << pLinePrefix <<
'\n';
244 for (
UInt x=0; x<width; x++)
246 if (subBlockWidth!=0 && (x%subBlockWidth)==0 && x!=0)
248 ss << std::setw(defWidth+2) <<
"";
251 ss << std::setw(defWidth) << blkSrc[y*stride + x] <<
' ';
266 std::string
lineWrap(
const std::string &input,
const UInt maximumLineLength);
ValueType leftShift(const ValueType value, const Int shift)
static std::list< std::pair< std::string, std::string > > & getEnvVarList()
Void printMacroSettings()
Defines version information, constants and small in-line functions.
UInt getDecimalWidth(const Double value)
std::string lineWrap(const std::string &input, const UInt maximumLineLength)
static Void printEnvVar()
Void writeValueToStream(const ValueType &value, std::ostream &stream, const UInt outputWidth)
std::string splitOnSettings(const std::string &input)
Void writeValueToStream< UChar >(const UChar &value, std::ostream &stream, const UInt outputWidth)
const std::string & getString() const
UInt getZScanIndex(const UInt x, const UInt y)
EnvVar(const std::string &sName, const std::string &sDefault, const std::string &sHelp)
Int TCoeff
transform coefficient
static Void printEnvVarInUse()
Void writeValueToStream< SChar >(const SChar &value, std::ostream &stream, const UInt outputWidth)
Void printCbfArray(TComDataCU *pcCU)
std::string indentNewLines(const std::string &input, const UInt indentBy)
PredMode
supported prediction type
Void printSBACCoeffData(const UInt lastX, const UInt lastY, const UInt width, const UInt height, const UInt chan, const UInt absPart, const UInt scanIdx, const TCoeff *const pCoeff, const Bool finalEncode)
Void printBlock(const ValueType *const source, const UInt width, const UInt height, const UInt stride, const UInt outputValueWidth=0, const Bool onlyPrintEdges=false, const Bool printInZScan=false, const Int shiftLeftBy=0, const Bool printAverage=false, std::ostream &stream=std::cout)
const std::string & getName() const
Void printBlockToStream(std::ostream &ss, const TChar *pLinePrefix, TComYuv &src, const UInt numSubBlocksAcross, const UInt numSubBlocksUp, const UInt defWidth)
static std::list< EnvVar * > & getEnvVarInUse()