52 = {
"Start of channel 0 inter debug\n",
"Start of channel 1 inter debug\n",
"Start of channel 2 inter debug\n",
"End of inter residual debug\n"} ;
53 const TChar *partSizeToString[
NUMBER_OF_PART_SIZES]={
"2Nx2N(0)",
"2NxN(1)",
"Nx2N(2)",
"NxN(3)",
"2Nx(N/2+3N/2)(4)",
"2Nx(3N/2+N/2)(5)",
"(N/2+3N/2)x2N(6)",
"(3N/2+N/2)x2N(7)"};
62 static std::list<std::pair<std::string, std::string> > varInfoList;
68 static std::list<EnvVar*> varInUseList;
72 static inline Void printPair(
const std::pair<std::string, std::string> &p)
76 std::cout <<
"\n" << std::setw(
settingNameWidth) << p.first <<
"\n" << std::endl;
80 std::cout << std::setw(
settingNameWidth) << p.first <<
": " << p.second <<
"\n" << std::endl;
101 std::cout <<
"--- Environment variables:\n" << std::endl;
104 std::cout << std::endl;
111 std::cout <<
"RExt Environment variables set as follows: \n" << std::endl;
114 std::cout << std::endl;
117 EnvVar::EnvVar(
const std::string &sName,
const std::string &sDefault,
const std::string &sHelp) :
156 EnvVar DebugOptionList::DebugString_Structure (
"DEBUG_STRUCTURE",
"0",
"Produce output on chosen structure bit0=intra, bit1=inter");
157 EnvVar DebugOptionList::DebugString_Pred (
"DEBUG_PRED",
"0",
"Produce output on prediction data. bit0=intra, bit1=inter");
158 EnvVar DebugOptionList::DebugString_Resi (
"DEBUG_RESI",
"0",
"Produce output on residual data. bit0=intra, bit1=inter");
159 EnvVar DebugOptionList::DebugString_Reco (
"DEBUG_RECO",
"0",
"Produce output on reconstructed data. bit0=intra, bit1=inter");
160 EnvVar DebugOptionList::DebugString_InvTran (
"DEBUG_INV_QT",
"0",
"Produce output on inverse-quantiser and transform stages. bit0=intra, bit1=inter");
169 std::cout <<
"Non-environment-variable-controlled macros set as follows: \n" << std::endl;
185 std::cout << std::endl;
195 #if DEBUG_ENCODER_SEARCH_BINS
196 const UInt debugEncoderSearchBinTargetLine = 0;
197 const UInt debugEncoderSearchBinWindow = 1000000;
201 const UInt debugCabacBinTargetLine = 0;
202 const UInt debugCabacBinWindow = 1000000;
212 const TCoeff *
const pCoeff,
213 const Bool finalEncode
218 std::cout <<
"Size: " << width <<
"x" << height <<
", Last X/Y: (" << lastX <<
", " << lastY <<
"), absPartIdx: " << absPart <<
", scanIdx: " << scanIdx <<
", chan: " << chan <<
"\n";
219 for (
Int i=0; i<width*height; i++)
221 std::cout << std::setw(3) << pCoeff[i];
222 if (i%width == width-1)
231 std::cout << std::endl;
239 for (
UInt ch=0; ch<numValidComp; ch++)
242 printf(
"channel: %d\n", ch);
243 for (
Int y=0; y<CUSizeInParts; y++)
245 for (
Int x=0; x<CUSizeInParts; x++)
255 return (value == 0) ? 1 : (
UInt(floor(log10(fabs(value)))) + ((value < 0) ? 2 : 1));
266 while ((remainingX != 0) || (remainingY != 0))
268 result |= ((remainingX & 0x1) << offset) | ((remainingY & 0x1) << (offset + 1));
286 std::string result = input;
288 std::string::size_type searchFromPosition = 0;
290 while (searchFromPosition < result.length())
293 std::string::size_type equalsPosition = result.find(
" = ", searchFromPosition);
295 if (equalsPosition == std::string::npos)
301 std::string::size_type splitPosition = result.find_last_of(
"1234567890", equalsPosition);
304 if (splitPosition != std::string::npos)
306 splitPosition = result.find_last_of(
' ', splitPosition);
310 if (splitPosition != std::string::npos)
312 result.replace(splitPosition, 1, 1,
'\n');
316 searchFromPosition = (equalsPosition + 3);
323 std::string
lineWrap(
const std::string &input,
const UInt maximumLineLength)
325 if (maximumLineLength == 0)
329 std::string result = input;
331 std::string::size_type lineStartPosition = result.find_first_not_of(
' ');
333 while (lineStartPosition != std::string::npos)
337 const std::string::size_type searchFromPosition = lineStartPosition + maximumLineLength;
339 if (searchFromPosition >= result.length())
348 std::string::size_type nextLineStartPosition = std::string::npos;
349 for (std::string::size_type currentPosition = lineStartPosition; currentPosition <= searchFromPosition; currentPosition++)
351 if (result[currentPosition] ==
'\n')
353 nextLineStartPosition = currentPosition + 1;
361 if (nextLineStartPosition != std::string::npos)
363 lineStartPosition = nextLineStartPosition;
367 std::string::size_type spacePosition = std::string::npos;
370 for (
Int currentPosition =
Int(searchFromPosition); currentPosition >=
Int(lineStartPosition); currentPosition--)
372 if (result[currentPosition] ==
' ')
374 spacePosition = currentPosition;
380 if (spacePosition == std::string::npos)
382 result.insert(searchFromPosition,
"-\n");
383 lineStartPosition = searchFromPosition + 2;
387 result.replace(spacePosition, 1, 1,
'\n');
388 lineStartPosition = spacePosition + 1;
401 std::string result = input;
403 const std::string indentString(indentBy,
' ');
404 std::string::size_type offset = 0;
406 while ((offset = result.find(
'\n', offset)) != std::string::npos)
408 if ((++offset) >= result.length())
412 result.insert(offset, indentString);
426 for (
UInt ch=0; ch<numValidComp ; ch++)
433 const UInt subBlockWidth=width/numSubBlocksAcross;
434 const UInt subBlockHeight=height/numSubBlocksUp;
436 ss << pLinePrefix <<
" compID: " << compID <<
"\n";
437 for (
UInt y=0; y<height; y++)
439 if ((y%subBlockHeight)==0 && y!=0)
441 ss << pLinePrefix <<
'\n';
445 for (
UInt x=0; x<width; x++)
447 if ((x%subBlockWidth)==0 && x!=0)
449 ss << std::setw(defWidth+2) <<
"";
452 ss << std::setw(defWidth) << blkSrc[y*stride + x] <<
' ';
456 ss << pLinePrefix <<
" --- \n";
468 if (DebugOptionList::DebugString_Pred.getInt()&predmode_mask)
470 std::stringstream ss(std::stringstream::out);
472 std::string debugTmp;
474 sDebug=debugTmp+sDebug;
476 if (DebugOptionList::DebugString_Resi.getInt()&predmode_mask)
478 std::stringstream ss(std::stringstream::out);
482 if (DebugOptionList::DebugString_Reco.getInt()&predmode_mask)
484 std::stringstream ss(std::stringstream::out);
EnvVar Debug("-- Debugging","","")
#define RExt__DECODER_DEBUG_BIT_STATISTICS
0 (default) = decoder reports as normal, 1 = decoder produces bit usage statistics (will impact decod...
static std::list< std::pair< std::string, std::string > > & getEnvVarList()
Void printMacroSettings()
UInt getDecimalWidth(const Double value)
general YUV buffer class (header)
std::string lineWrap(const std::string &input, const UInt maximumLineLength)
static const UInt settingNameWidth
UInt getStride(const ComponentID id) const
Int getNumberValidComponents() const
UChar getCbf(UInt uiIdx, ComponentID eType) const
UInt getHeight(const ComponentID id) const
#define RExt__HIGH_BIT_DEPTH_SUPPORT
0 (default) use data type definitions for 8-10 bit video, 1 = use larger data types to allow for up t...
static Void printEnvVar()
#define O0043_BEST_EFFORT_DECODING
0 (default) = disable code related to best effort decoding, 1 = enable code relating to best effort d...
std::string splitOnSettings(const std::string &input)
const std::string & getString() const
static const UInt settingHelpWidth
UInt getWidth(const ComponentID id) const
static Void printPair(const std::pair< std::string, std::string > &p)
UInt getZScanIndex(const UInt x, const UInt y)
#define PRINT_CONSTANT(NAME, NAME_WIDTH, VALUE_WIDTH)
EnvVar(const std::string &sName, const std::string &sDefault, const std::string &sHelp)
static Void printVal(const EnvVar *env)
Int TCoeff
transform coefficient
Pel * getAddr(const ComponentID id)
static Void printEnvVarInUse()
#define RExt__HIGH_PRECISION_FORWARD_TRANSFORM
0 (default) use original 6-bit transform matrices for both forward and inverse transform, 1 = use original matrices for inverse transform and high precision matrices for forward transform
UInt g_auiRasterToZscan[MAX_NUM_PART_IDXS_IN_CTU_WIDTH *MAX_NUM_PART_IDXS_IN_CTU_WIDTH]
#define ME_ENABLE_ROUNDING_OF_MVS
0 (default) = disables rounding of motion vectors when right shifted, 1 = enables rounding ...
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)
CU data structure (header)
static const UInt settingValueWidth
const std::string & getName() const
UInt getNumberValidComponents() 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()
Defines types and objects for environment-variable-based debugging and feature control.