@@ -3021,4 +3021,226 @@ If the decoder is compiled with the macro RExt__DECODER_DEBUG_BIT_STATISTICS def
The Linux makefile will compile both the analyser and standard version when the `all' or `everything' target is used (where the latter will also build high-bit-depth executables).
\section{Block statistics extension}
\label{sec:block-stat-extens}
The block statistics extension enables straightforward visualization and statistical analysis of coding tool
usage in encoded bitstreams. The extension enables the reference
software encoder and decoder to write out statistics files in a configurable
way, which in turn can be loaded into a suitable YUV player for overlay of the
reconstructed YUV sequence, or can be used for statistical analysis at a
selectable scope (e.g. block/picture/sequence level). An example implementation
for such visualization is available with the open-source YUView player
(https://github.com/IENT/YUView).
\subsection{Usage}
\label{sec:usage}
The software has to be compiled with the macros ENABLE_TRACING and
K0149_BLOCK_STATISTICS defined as 1. The statistics can be written by either
encoder or decoder.
The extension adds additional trace channels to the ``dtrace'' functionality of
the software. The following trace channels were added:
\begin{description}
\item[D_BLOCK_STATISTICS_ALL] All syntax elements are written, no matter whether
they are actually encoded or derived.
\item[D_BLOCK_STATISTICS_CODED] Tries to write only syntax elements, which have
also been encoded.
\end{description}
The following additional encoder options are available (part of ``dtrace''). See
("SEIColourRemappingInfoFilename",m_colourRemapSEIFileName,string(""),"Colour Remapping YUV output file name. If empty, no remapping is applied (ignore SEI message)\n")
("OutputDecodedSEIMessagesFilename",m_outputDecodedSEIMessagesFilename,string(""),"When non empty, output decoded SEI messages to the indicated file. If file is '-', then output to stdout\n")
("ClipOutputVideoToRec709Range",m_bClipOutputVideoToRec709Range,false,"If true then clip output video to the Rec. 709 Range on saving")
("PYUV",m_packedYUVMode,false,"If true then output 10-bit and 12-bit YUV data as 5-byte and 3-byte (respectively) packed YUV data. Ignored for interlaced output.")
#if ENABLE_TRACING
("TraceChannelsList",bTracingChannelsList,false,"List all available tracing channels")
("TraceRule",sTracingRule,string(""),"Tracing rule (ex: \"D_CABAC:poc==8\" or \"D_REC_CB_LUMA:poc==8\")")
intm_respectDefDispWindow;///< Only output content inside the default display window
std::stringm_outputDecodedSEIMessagesFilename;///< filename to output decoded SEI messages to. If '-', then use stdout. If empty, do not output details.
boolm_bClipOutputVideoToRec709Range;///< If true, clip the output video to the Rec 709 range on saving.
boolm_packedYUVMode;///< If true, output 10-bit and 12-bit YUV data as 5-byte and 3-byte (respectively) packed YUV data
std::stringm_cacheCfgFile;///< Config file of cache model
("FramesToBeEncoded,f",m_framesToBeEncoded,0,"Number of frames to be encoded (default=all)")
("ClipInputVideoToRec709Range",m_bClipInputVideoToRec709Range,false,"If true then clip input video to the Rec. 709 Range on loading when InternalBitDepth is less than MSBExtendedBitDepth")
("ClipOutputVideoToRec709Range",m_bClipOutputVideoToRec709Range,false,"If true then clip output video to the Rec. 709 Range on saving when OutputBitDepth is less than InternalBitDepth")
("PYUV",m_packedYUVMode,false,"If true then output 10-bit and 12-bit YUV data as 5-byte and 3-byte (respectively) packed YUV data. Ignored for interlaced output.")
("SummaryOutFilename",m_summaryOutFilename,string(),"Filename to use for producing summary output file. If empty, do not produce a file.")
("SummaryPicFilenameBase",m_summaryPicFilenameBase,string(),"Base filename to use for producing summary picture output files. The actual filenames used will have I.txt, P.txt and B.txt appended. If empty, do not produce a file.")
("SummaryVerboseness",m_summaryVerboseness,0u,"Specifies the level of the verboseness of the text output")
("QPIncrementFrame,-qpif",m_qpIncrementAtSourceFrame,OptionalValue<uint32_t>(),"If a source file frame number is specified, the internal QP will be incremented for all POCs associated with source frames >= frame number. If empty, do not increment.")
("QPIncrementFrame,-qpif",m_qpIncrementAtSourceFrame,OptionalValue<uint32_t>(),"If a source file frame number is specified, the internal QP will be incremented for all POCs associated with source frames >= frame number. If empty, do not increment.")
#else
("QP,q",m_fQP,30.0,"Qp value, if value is float, QP is switched once during encoding")