Newer
Older
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
\begin{description}
\item[source/Lib/CommonLib/dtrace_blockstatistics.h]
Add your statistic to the BlockStatistic enum:
\begin{minted}{c++}
enum class BlockStatistic {
// general
PredMode,
PartSize,
Depth,
\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}
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
\section{Coding tool statistics extension for green metadata}
\label{sec:green-meta-sei}
The encoder and the decoder include an extension that generates coding tool statistic. In the encoder, the extension calculates green metadata for encoding green SEI messages, in particular complexity metrics for decoder power reduction. The decoder extension can be used for cross-checking the correct functionality of the encoding extension.
The output of the analyzer can be enabled with the option 'GMFA' (Green Metadata Feature Analyzer). The output file name is specified with the flag 'GMFAFile'.
Furthermore, it is possible to generate a framewise analysis with the option 'GMFAFramewise'. The output file is generated in a Matlab-readable way. Here is an example for both the encoder and the decoder:
\begin{minted}{bash}
bin/EncoderAppStatic -b bitstream.vvc --GMFA 1 --GMFAFramewise=1 --GMFAFile="bitstream.m" [encoder options]
bin/DecoderAppStatic -b bitstream.vvc --GMFA 1 --GMFAFramewise=1 --GMFAFile="bitstream.m" [decoder options]
\end{minted}
The output file contains arrays with statistics on the use of coding tools on block-size level. As an example, the number of intra-coded blocks is returned as:
\begin{minted}{bash}
n.intraBlocks = [...
0 0 0 0 0 0 0 0 ;...
0 0 0 16412 2142 54 0 0 ;...
0 0 41654 41906 9780 665 27 0 ;...
0 0 23494 22855 8641 906 26 0 ;...
0 0 4670 4797 4030 1215 60 0 ;...
0 0 433 507 881 1104 84 0 ;...
0 0 38 48 43 122 131 0 ;...
0 0 0 0 0 0 0 0 ];
\end{minted}
The horizontal position indicates the logarithm to the basis 2 block width (1, 2, 4, .., 128) and the vertical position the block height, accordingly. In this example, the bit stream contains $16{,}412$ intra-coded blocks of size $8\times 2$.
More information can be found in JVET-P0085 and \url{10.1109/ICIP40778.2020.9190840}.
\section{Using the stream merge tool}
\label{sec:stream-merge-tool}
The StreamMergeApp tool takes multiple single-layer (singe nuh_layer_id) bistreams
Emmanuel Thomas
committed
as inputs and merge them into a multi-layer bistream by interleaving the Picture Units
from the input single layer bistreams. During the merge, the tool assigns a new unique
Emmanuel Thomas
committed
nuh_layer_id for each input bitstream as well as unique parameter sets identifiers for each layer.
Then the decoder can specify which layer bitstream to be decoded through the command line option "-p nuh_layer_id".
Some current limitations of the tool:
\begin{itemize}
\item All input bitstreams are single layer and thus all layers in the output bitstream are independent layers.
\item Each layer in the output bitstream is abitrarily put in an individual OLS and is also an output layer.
\item All parameter sets from the input bitstreams are treated as different parameter sets. There is thus no parameters sets sharing in the output bitstream.
\item The slice header in the input bitstreams shall contain no picture header structure and no alf information.
\end{itemize}
\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.
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
\section{Using the subpicture merge tool}
\label{sec:subpicture-merge-tool}
The SubpicMergeApp takes multiple bitstreams as inputs and merges them into one output bitstream where each input bitstream forms a single subpicture. Subpicture layout and input bitstreams are defined in a subpicture list file. Sequence parameter set and picture parameter set are modified accordingly based on the layout.
The merge tool has an alternative mode for merging YUV files. This mode can be used for verifying YUV output after decoding merged bitstream.
If VTM encoder is used for encoding input bitstreams, it is recommnended that ALF, CCALF, joint chroma coding, LMCS and AMaxBT are disabled. This prevents those tools having parameters with different values in different subpictures which would result in merged bitstream being non-conformant.
\subsection{Usage}
\label{sec:subpicture-merge-usage}
\begin{minted}{bash}
SubpicMergeApp [-l <subpiclistfile>] [-o <outfile>] [-m 0|1] [-yuv 0|1] [-d <bitdepth>] [-f 400|420|422|444]
\end{minted}
\begin{table}[ht]
\footnotesize
\centering
\begin{tabular}{lp{0.5\textwidth}}
\hline
\thead{Option} &
\thead{Description} \\
\hline
\texttt{--help} & Prints parameter usage. \\
\texttt{-l} & File containing list of input pictures to be merged \\
\texttt{-o} & Output file name \\
\texttt{-m} & Enable mixed NALU type bitstreams merging \\
\texttt{-yuv} & Perform YUV merging (instead of bitstream merging) \\
\texttt{-d} & Bitdepth for YUV merging \\
\texttt{-f} & Chroma format for YUV merging, 420 (default), 400, 422 or 444 \\
\hline
\end{tabular}
\end{table}
Format of the subpicture list file given with '-l' command is as follows:
\begin{minted}{bash}
subpic1_width subpic1_height subpic1_x subpic1_y subpic1_bitstream_file
subpic2_width subpic2_height subpic2_x subpic2_y subpic2_bitstream_file
...
subpicN_width subpicN_height subpicN_x subpicN_y subpicN_bitstream_file
\end{minted}
Coordinates x and y define the location of top-left corner of the subpicture in the merged picture. Parameters width, height, x and y are given in units of luma samples.
YUV merging uses the same file format, only difference being that YUV file name is supplied instead of bitstream file name.