Files
doc_phd_thesis/043_EndToEndRobustSystem/Figures/JointlyRobustnessDiagram.tikz
T
2018-07-06 17:56:46 +01:00

96 lines
4.8 KiB
Plaintext

\usetikzlibrary{arrows,matrix}
\usetikzlibrary{fit}
\usetikzlibrary{intersections}
\usetikzlibrary{intersections}
% \usetkzobj{all}
\pgfdeclarelayer{background}
\pgfdeclarelayer{foreground}
\pgfsetlayers{background,main,foreground}
\def\scale{1}
\begin{tikzpicture}[
font=\scriptsize,
auto,
node distance=1cm,
scale=\scale,
every node/.style={scale=\scale},
template/.style={thick, text centered},
block/.style={template, rectangle, text width=1.3cm, ,inner sep=3, minimum height=.6cm},
arrow/.style={template, draw, -latex},
point/.style={template, draw, fill=black, circle,inner sep=0, minimum size=3}
]
% Define extra block styles
\tikzstyle{sumBlock} = [template, draw, circle, inner sep=0cm, minimum size=0.3cm]
\tikzstyle{propBlock} = [block, draw, fill=blue!15]
\tikzstyle{refBlock} = [block, draw, fill=gray!10]
\tikzstyle{propBlockNoDraw} = [block, fill=\TikZColorFillProp]
\tikzstyle{refBlockNoDraw} = [block, fill=\TikZColorFill]
\newcommand{\DrawEdgesTwoNodes}[2]{\path[arrow,-] (#1.south west) |- (#2.north east) |- (#1.south west);}
%% Encoder/Decoder
\node [refBlockNoDraw, text width=1.1cm, minimum height=.6cm] (Encoder) at (0,0) {Encoder};
\node [refBlockNoDraw, text width=0.6cm, minimum height=.6cm, right=-0.03 of Encoder.south east, anchor=south west, text centered] (EncoderNAL) {NAL};
\node [refBlockNoDraw, text width=1.1cm, minimum height=.6cm, above=-0.03 of Encoder.north west, anchor=south west] (Decoder) {Decoder};
\path[arrow,-] (Encoder.south west) |- (Decoder.north east) |- (EncoderNAL.north east) |- (Encoder.south west);
\path[arrow,-,densely dotted] (EncoderNAL.south west -| Decoder.south east) -- (Decoder.south east); % Draw inside lines
\path[arrow,-,densely dotted] (Decoder.south west |- EncoderNAL.north west) -- (EncoderNAL.north west); % Draw inside lines
%% NALU Loss and EC optimisation
\node [propBlock, above=2.2 of Encoder.west, anchor=south west, text width=3.8cm, minimum height=2.4cm] (ConcOpt) {Saliency-weighted EC Mode Decision};
\node [propBlock, below=.8 of ConcOpt.south east, anchor=north east, text width=1.7cm, minimum height=.9cm] (LossSim) {NALU Loss Simulation};
\path[arrow] (EncoderNAL -| LossSim.south) -- (LossSim) node[point] at (EncoderNAL -| LossSim) {};;
\path[arrow] (Decoder) -- (ConcOpt.south -| Decoder) node[pos=.6,coordinate] (p2) {} node[point] at (p2) {};
\path[arrow] (LossSim) -- (ConcOpt.south -| LossSim);
%% EL encoder
\node [propBlockNoDraw, right=4cm of ConcOpt.south, anchor=south west, text width=1.4cm, minimum height=1cm] (Scalable) {EL\\Encoder};
\node [refBlockNoDraw, text width=.2cm, right=-.025 of Scalable.south east, anchor=south west, text centered, minimum height=1cm] (ScalableNAL) {N\\[-2pt]A\\[-2pt]L};
\DrawEdgesTwoNodes{Scalable}{ScalableNAL}; % Draw border
\path[arrow,-,densely dotted] (ScalableNAL.south west) -- (ScalableNAL.north west); % Draw inside lines
%% Diff
\node [sumBlock, left=.75 of Scalable] (ConcDiff) {$-$};
\path[arrow] (ConcDiff) -- (Scalable) node[above, pos=0, xshift=.2cm] {$e^c$};
\path[arrow] (ConcOpt.east |- ConcDiff) -- (ConcDiff) node[above, pos=1, xshift=-.3cm] {$\tilde f$};
\path[arrow,-, shorten >=3] (p2) -- (p2 -| LossSim.north);
\path[arrow, shorten <=3] (p2 -| LossSim.north) -| (ConcDiff) node[right, pos=1, yshift=-.3cm] {$\hat f$};
%% EC mode coding
\node [propBlockNoDraw, anchor=north west, text width=1.4cm, minimum height=1cm] at (ConcOpt.north -| Scalable.west) (Signalling) {EC Mode Coding};
\node [refBlockNoDraw, text width=.2cm, right=-.025 of Signalling.south east, anchor=south west, text centered, minimum height=1cm] (SignallingNAL) {N\\[-2pt]A\\[-2pt]L};
\DrawEdgesTwoNodes{Signalling}{SignallingNAL}; % Draw border
\path[arrow,-,densely dotted] (SignallingNAL.south west) -- (SignallingNAL.north west); % Draw inside lines
\path[arrow] (ConcOpt.east |- Signalling) -- (Signalling) node[above, pos=.45, yshift=-1] {\scriptsize M1...M4};
%% Input
\node[text width=.5cm, text centered] at (-1.7,4.5) (Input) {Input video};
\path[arrow] (Input) |- (Encoder);
\path[arrow] (Input |- ConcOpt) -- (ConcOpt) node[point] at (Input |- ConcOpt) {};
%% TS Mux and output
\path (Encoder.south) -- (Encoder |- Signalling.north) node[midway] (middleRef) {}; % Find middle ref
\node [refBlock, right=8.5 of middleRef, text width=.7cm, minimum height=5.5cm] (NAL) {TS Mux};
\node [right of=NAL, node distance=1.5cm, coordinate] (Out) {};
\path[arrow] (EncoderNAL) -- (NAL.west |- EncoderNAL) node[above,pos=1, xshift=-.4cm] {VCL$_0$};
\path[arrow] (ScalableNAL) -- (NAL.west |- Scalable) node[above,pos=1, xshift=-.4cm] {VCL$_1$};
\path[arrow] (SignallingNAL) -- (NAL.west |- Signalling) node[above,pos=1, xshift=-.4cm] {SEI};
\path[arrow] (NAL) -- (Out) node[above,pos=1, xshift=-.2cm, text width=1.3cm] {Transport Stream};
\end{tikzpicture}