# High-Quality Video Watermarking Based on Deep Neural Networks for Video with HEVC Compression +
## 3 Proposed Method  
### Presentation of the Concept of the Proposed Method  
The presented method is a continuation of the method presented in a previous publication aimed at embedding a watermark in the compression conditions of the HEVC codec using DNN and ASPA (Adjustable Subsquares Properties Algorithm). In the watermarking system concept presented further in this article (Figure 1), the additional factor of YUV420p chrominance subsampling used in video codecs as one of the compression stages allowing an additional reduction in memory requirements at the expense of degrading the quality of the chrominance channels is included. The system consists of two main components of a watermarking encoder and a watermark reconstruction decoder. Embedding a watermark in an image consists of two stages. In the first stage, the binary character string is transformed via the ASPA algorithm into an image that is optimal for encoding in chrominance channels. In the next step, the watermarked image thus obtained is fed to the DNN encoder input together with the image that will carry the watermark. At the encoder output, an image of the carrier with a transparently embedded watermark is obtained. From the image thus obtained, the watermark can be recovered by feeding it to the input of the decoder and obtaining a reconstructed watermark at its output. The encoder and decoder subsystems use ASPA for efficient encoding of information in the image, which was discussed in detail in a previous publication [22], however the main idea of the algorithm will be briefly explained here as well. The area of the square with dimensions \(\mathrm{n}\times\mathrm{n}\) is divided in such a way as to form a fixed number of subsquares with dimensions \(\mathrm{m}\times\mathrm{m}\) that fit into the square in such a way as to fill all its available space of \(\mathrm{n}\times\mathrm{n}\). Translating this for the case used in this article, the square of \(128\times 128\) was divided into 16 subsquares of \(32\times 32\). Each subsquare for a hidden watermark copies the original luminance value (Y-channel) to increase the similarity of the encoded image with the original image and has chrominance values (U and V channels), which are the actual carrier of the hidden information and represent digits of the selected number system, which is the octal in this case. Thus, U and V may take values in the range of digits \(\langle 0;7\rangle\). The value in the V channel should be interpreted as a less significant bit and U channel represents the most significant bit. Each digit is assigned a fixed value during the watermark embedding process. For the decoding process, a fixed range of values is assigned to each of the interpreted digits. The ranges of values used in this method for the decoding process are shown in Table 1.  
Two numbers in the octal number system contain 64 combinations of values. This property was used to assign an appropriate ASCII character to a given value. In this way, the letters of the alphabet, as well as numbers and some special characters, were assigned. Characters representing watermark are read from the text file and converted into the appropriate assigned value in the range \(\langle 0;64\rangle\) for the encoding needs. Thus, each subsquare in ASPA represents a single character. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Digit** & **Value Range** & **RGB Value Range** \\ \hline
0 & \(\langle 0;0.125\rangle\) & \(\langle 0;31.875\rangle\) \\
1 & \((0.125;0.25)\) & \((31.875;63.75)\) \\
2 & \((0.25;0.375)\) & \((63.7;95.625)\) \\
3 & \((0.375;0.5)\) & \((95.625;127.5)\) \\
4 & \((0.5;0.625)\) & \((127.5;159.375)\) \\
5 & \((0.625;0.75)\) & \((159.375;191.25)\) \\
6 & \((0.75;0.875)\) & \((191.25;223.125)\) \\
7 & \((0.875;1)\) & \((223.125;255)\) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Value ranges for encoding and decoding digits. Figure 1: Conceptual diagram of the system.