Newer
Older
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
\end{minted}
Further, add your statistic to the map blockstatistic2description:
\begin{minted}{c++}
static const std::map<BlockStatistic,
std::tuple<std::string, BlockStatisticType, std::string>>
blockstatistic2description =
{
{ BlockStatistic::PredMode,
std::tuple<std::string, BlockStatisticType, std::string>
{"PredMode", BlockStatisticType::Flag, ""}},
{ BlockStatistic::MergeFlag,
std::tuple<std::string, BlockStatisticType, std::string>
{"MergeFlag", BlockStatisticType::Flag, ""}},
{ BlockStatistic::MVL0,
std::tuple<std::string, BlockStatisticType, std::string>
{"MVL0", BlockStatisticType::Vector, "Scale: 4"}},
YOURS
\end{minted}
\item[source/Lib/CommonLib/dtrace_blockstatistics.cpp] All code for
writing syntax elements is kept in this file in
getAndStoreBlockStatistics. This function is called once for each
CTU, after it has been en/decoded. The following macros have been
defined to facilitate writing of block statistics:
\begin{minted}{c++}
DTRACE_BLOCK_SCALAR(ctx,channel,cs_cu_pu,stat_type,val)
DTRACE_BLOCK_SCALAR_CHROMA(ctx,channel,cs_cu_pu,stat_type,val)
DTRACE_BLOCK_VECTOR(ctx,channel,cu_pu,stat_type,v_x,v_y)
DTRACE_BLOCK_AFFINETF(ctx,channel,pu,stat_type,v_x0,v_y0,v_x1,v_y1,v_x2,v_y2)
\end{minted}
An example:
\begin{minted}{c++}
DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL,
cu, GetBlockStatisticName(BlockStatistic::PredMode), cu.predMode);
\end{minted}
\item[Block statistics for debugging] The statistics can also be used
to write out other data, not just syntax elements. Add your
statistics to dtrace_blockstatistics.h. Where it should be used the
following headers have to be included:
\begin{minted}{c++}
#include "dtrace_next.h"
#include "dtrace_blockstatistics.h"
\end{minted}
\end{description}
\section{Using the stream merge tool}
\label{sec:stream-merge-tool}
The StreamMergeApp tool takes multiple single-layer (singe nuh_layer_id) bistreams
as inputs and merge them into a multi-layer bistream by interleaving the NALUs
from the input single layer bistreams. During the merge, the tool assigns a new unique
nuh_layer_id for each input bitstream. Then the decoder could specify which layer
bitstream to be decoded through the command line option "-p nuh_layer_id".
\subsection{Usage}
\label{sec:stream-merge-usage}
\begin{minted}{bash}
StreamMergeApp <bitstream1> <bitstream2> [<bitstream3> ...] <outfile>
\end{minted}
The command line options bistreamX specify the file names of the input single-layer
bistreams. At least two input bitstreams need to be specified. The merged multi-layer
bistream will be stored into the outfile.
\end{document}