Application of Enhanced Hadamard Error Correcting Code in Video-Watermarking and his comparison to Reed-Solomon Code

Error Correcting Codes are playing a very important role in Video Watermarking technology. Because of very high compression rate (about 1:200) normally the watermarks can barely survive such massive attacks, despite very sophisticated embedding strategies. It can only work with a sufficient error correcting code method. In this paper, the authors compare the new developed Enhanced Hadamard Error Correcting Code (EHC) with well known Reed-Solomon Code regarding its ability to preserve watermarks in the embedded video. The main idea of this new developed multidimensional Enhanced Hadamard Error Correcting Code is to map the 2D basis images into a collection of one-dimensional rows and to apply a 1D Hadamard decoding procedure on them. After this, the image is reassembled, and the 2D decoding procedure can be applied more efficiently. With this approach, it is possible to overcome the theoretical limit of error correcting capability of (d-1)/2 bits, where d is a Hamming distance. Even better results could be achieved by expanding the 2D EHC to 3D. To prove the efficiency and practicability of this new Enhanced Hadamard Code, the method was applied to a video Watermarking Coding Scheme. The Video Watermarking Embedding procedure decomposes the initial video trough multi-Level Interframe Wavelet Transform. The low pass filtered part of the video stream is used for embedding the watermarks, which are protected respectively by Enhanced Hadamard or Reed-Solomon Correcting Code. The experimental results show that EHC performs much better than RS Code and seems to be very robust against strong MPEG compression.


Introduction
Many applications in telecommunication technologies are using Hadamard Error Correcting Code.Plotkin [1] was the first who discovered in 1960 error correcting capabilities of Hadamard matrices.Bose, Shrikhande [2] and Peterson [3] also have made important contributions.Levenshstein [4] was the first who introduced an algorithm for constructing a Hadamard Error Correcting Code.The most famous application of Hadamard Error Correcting Code was the NASA space mission in 1969 of Mariner and Voyager spacecrafts.Thanks to the powerful error correcting capability of this code it was possible to decode properly high-quality pictures of Mars, Jupiter, Saturn, and Uranus [5].In this paper we introduced a new type of multidimensional Hadamard Code, we called it Enhanced Hadamard Error Correcting Code (EHC).It can overcome the limit of error correcting capability of n/2-1 bits of standard Hadamard Code, where the codeword length and the Hamming distance d have the same value n.The application of this Code in Video Watermarking gives also a strong prove of its effectiveness.The reason for selecting Video Watermarking lies in strong compression ratio, normally factors greater than 1:200, which are applied to the video sequences.For example, an uncompressed HDTV video stream has a data rate of 1.2Gbit/s and for distribution reason, it must be compressed to 6Mbit/s.For embedded watermarks, it is a big challenge to survive such strong compression ratio.Error correcting code plays a decisive role in surviving of the embedded Watermarks.This paper has followed the structure: In Chapter 2 contains the introduction to the enhanced Hadamard Error Correcting Code and its error correcting capabilities.In Chapter 3, the authors explain the Video Watermarking Scheme and the Chapter 4 presents the results and discussion.
the authors explain the enhanced version.

One-Dimensional Hadamard Code
The Hadamard code of n-bit is a non-linear code, which is generated by rows of a n*n Hadamard Matrix Hn.It can encode k=log2(n) messages and is denoted as (n,k).The Hamming distance is n/2, and it can correct n/2-1 errors.In the case of n=8 we obtain the following matrix: The code words are the rows of this Matrix H8.In Table 1 the Code Book of the linear Code (8,3) is depicted.The Hamming distance of this code is h=4.(8,3) The decoding procedure is based on Hadamard Spectrum.The spectral component with the highest value determines the decoding message.The received code word is used to build the Hadamard spectrum vector, which enables to determine the corresponding message.The spectrum vector d is calculated by multiplying the code vector c by the Hadamard Matrix H8 .

H c d
(2) Supposed we received the code word: According to the Eq.( 2), the decoded Hadamard Spectrum vector is: The third component of the vector d has the highest value in the spectrum; all others are zeroes, d(3)=8, d(i)=0 for i=1,..8 and i≠3.It implicates that the code word at the position i=3 was received.The codebook at that position gives us the ultimate information of the message (010).
In the case of one error, the third component of the spectrum vector d still remains the highest one.In the case of a corrupted codeword c=[-1 1 -1 -1 1 1 -1 -1], the Hadamard spectrum vector delivers: The third component is still the highest one, so the message can be decoded.In the case of two errors, it is already impossible to decode the message unambiguously.What is interesting about Hadamard Code is that in the case of seven and eight errors it is possible again to decode the codewords.In case of eight errors, our codeword c=[-1-1 1 1 -1 -1 1 1] is completely corrupted.In this case, the absolute value of the third component of the Hadamard spectrum is the highest one, and it has a negative sign.A negative sign means that the decoded code word must be inverted.
In the case of seven errors, we have exactly the same situation as with one error, however, with one small difference: the third component has a negative sign, what means the decoded word must be inverted.The following figure shows the error correcting capability of an 8 bit Hadamard code. 3

Two-Dimensional Hadamard Error Correcting Code
The 2D Hadamard Error Correcting Code uses so-called

Message
Code Words

H
We can calculate the complete set of 16 such basis images.

Fig. 2. Basis Images of 2D Hadamard Transform (4x4)
For instance, the pattern A31 is generated by Eq.(1) and has the numerical presentation and "-1" as 0 (Black) The 2D Hadamard Spectrum of such basis images, which is denoted by C, delivers a matrix where only one coefficient differs from zero.It represents a 2D spectrum of the corresponding basis image.For example, the Hadamard spectrum matrix of the pattern A31 is The component C31=16 and all others are zero.This fact, identification of the basis image trough its spectral coefficient, can be utilized to construct error-correcting code.The codewords are the pattern of basis images, and they can be decoded unambiguously by detecting the highest absolute coefficient value inside of 2D Hadamard Spectrum according to Eq.( 4).To apply the basic images as codewords, we have to map their two-dimensional structure into one-dimensional pulse stream which will be denoted by the codeword.In Table , 2 such 2D Hadamard codebook is depicted.
In case that the basis image A31 is corrupted by some perturbation and looks like it depicted in Figure 4 Fig. 4. Corrupted Basic Image A31 It is still possible to recover the original pattern completely.To understand this, let us consider this corrupted Basic Image: The Hadamard Spectrum we obtain from the absolute value of │C31│=10 and it still stays the highest one between the other spectral coefficients of matrix C, hence the corresponding message word could be read out from the code book depicted in Table 2.It is "1000" (see the row for coefficient C31).
The total number of errors that can be corrected is n/2-1 and correspond completely to the one-dimensional case.The simple enlargement from 1D to 2D doesn't bring any improvement.To overcome this limit, a new enhance Hadamard decoding procedure for 2D and 3D Hadamard Code is introduced.

Enhanced 2D Hadamard Error Correcting Code
The enhanced 2D Hadamard Code makes it possible to correct more errors as with the standard Hadamard method.With this approach is possible to overcome the theoretical limit of error correcting capability of n/2-1 errors.
The basic idea is to map the 2D basis images into a collection of one-dimensional rows and applying them 1D decoding procedure.After this, the image is reassembled, and the 2D decoding procedure (Eq.( 4)) can be applied more efficiently.
To show the functionality of this method we consider the basis images A71 of 8x8 2D Hadamard Transform.This basic image (Fig. 5) can be derived from Eq.(3).This image is now corrupted by noise (Fig. 6).The corresponding error matrix contains 17 errors.According to the consideration from chapter 2.1, it is not possible to recover this pattern because the number of errors exceeds the limit of n/2-1=15.The functionality of the enhanced Hadamard decoding procedure is depicted in Figure 7.The steps of the algorithm could be described as followes: x The corrupted basis image (A) is separated into its rows (B).
x On each row is applied 1D Hadamard decoding procedure.Rows which contain only one error are decoded error free (because of each row has the length of n=8).Rows No. 6 and No. 8 are now without any errors (C).
x Reassemble the pattern again (D).The renewed pattern contains now fewer errors as before, namely 15.
x Apply the 2D Hadamard decoding procedure according to Eq.( 4).The result will be error free pattern (E).
We  The decoding procedure and the corresponding error correction work similar to the correcting procedure described in Chapter 2.3.Before it can be applied the cube is resolved from the front side in separate layers.On each layer, the enhanced 2D Hadamard decoding procedure is applied.The Performance of the 3D Hadamard Code was simulated and compared with the Standandard Hadamard Code of the length n=512.The Cubes have the dimension 8*8*8.The results are depicted in Figure 10.Digital Watermarking is a very prospective new technology, that offers a huge number of new applications [6].Especially the challenge to protect intellectual properties of multimedia data against illegal usage or tempering can be solved by watermarking technologies [7].One of the important components is an error correcting code.Especially when watermarked video sequences undergo a very hard compression the error correcting code used in the watermarking scheme plays a decisive role in surviving of watermarks [8].For this reasons, we choose these techniques to demonstrate the efficiency of Enhanced Hadamard Error Correcting Code (EHC).To underline the performance of EHC, it was compared with the well known Reed-Solomon Code [9,10] used in the same watermarking scheme.

Proposed Watermarking Scheme
The proposed watermarking scheme works in the spectral domain and uses an Interframe Discrete Wavelet Transform (DWT) [11] of video sequences and an Intraframe Discrete Cosine Transform (DCT) for embedding procedure [12,13].In the Fig. 11, the whole encoding process is illustrated.The raw format of the luminance channel of the original video stream is decomposed by multi-level Interframe DWT with Haar Wavelet.This low pass filtered part of the video stream undergoes a block-wise DCT Transform.From DCT spectrum, special coefficients are selected and used for embedding procedure with 2D Hadamard coded watermarks.The embedding procedure itself is realized through QIM (Quadrature Index Modulation) techniques [14].

Fig. 11. Watermarking Encoding Process
The decoder procedure is depicted in Fig. 12.At the beginning of the decoding procedure, the embedded video sequence undergoes the same multi-level Interframe DWT and Intraframe DCT transforms as on the encoder side.

Multi-Level DWT
As mentioned above a multi-Level Interframe DWT with Haar Wavelet was used to deliver a low pass filtered video.The Fig. 13 illustrates the operating principle of this transform.In the first level, the two consecutive frames are averaged.In the second level, the frames from level one are averaged and so forth.In this watermarking schemes, we used DWT levels from 12 till 16.Fig. 13.Multi-Level Interframe DWT.At the first level, the two consecutive frames are averaged.At level two the consecutive frames from level one are averaged and so forth.

Selection of Embedded Coefficients
To realize the embedding procedure, some coefficients from the DCT spectrum of DWT filtered video sequence must be selected.The Fig. 14 shows which coefficients are qualified for watermarking.These are mostly from the yellow area.

Investigation with 3D Enhanced Hadamard Error Correcting Code
The investigation was done with HDTV video sequence with the resolution of 1080x1920 and 25fps.The video was captured with an AVCHD Camera.The watermarking processing was performed only for the luminance channel (after converting RGB into YCrCb color space) because it is more robust against distortions than any other channels.It was investigated how many embedded watermark bits survive compression attacks without causing significant impairments.The degradation of the watermarked output video was measured with SSIM (Structural Similarity) index.SSIM is based on the human eye perception and so the expressiveness about distortion is better than in the traditional methods like PSNR (Peak Signal to Noise Ratio) or MSE (Mean Square Error) [15].
It was chosen the Enhanced 3D Hadamard Code of the size of 8x8x8, which means the code word length of 512 bits.This implies the message code length of 8 bit (log2(n) messages).The DCT block size was 8x8 and from each block were selected 16 coefficients.With these, information is easy to calculate the total number of embedded watermark bits for each frame.Where H is, the height and W is the width of the frame.The letter B denotes the block size of DCT transform; the letter M is the message code length; the letter W represents the code word length of the 3D Hadamard Code and the letter C is the number of selected spectral coefficients.
In Table , the results of capacity and robustness measurements are presented.The compression attacks were done by H.264 codec with different compression ratios.Because the method works in the raw video, the original data rate is 1.2 Gbit/s.As a watermark was used a chessboard pattern of the size of 30x30 Pixel.
The watermarks were inserted successively into the frames.The Delta QIM gave the width of the quantization steps and was tuned to value 11.Generally, the Delta value determines the noise distortion in the host video.
The embedded video sequence was compressed with different compression ratios.In the case of compression to 5 Mbit/s, which correspond to a compression ratio of 1:240 it is still possible to extract all watermarks error free.The quality comparison between originally compressed video and embedded and compressed shows, that there is only slightly difference.The SSIM index Video is in this case 98%.

Comparison of 3D Enhanced Hadamard with Reed-Solomon Code
In order to show the performance of Enhanced Hadamard Code, a comparison between EHC and well known Reed-Solomon Code was carried out.Reed-Solomon Code is well known as an error correcting code and it has a plenty of practical implementations for example in consumer electronics like CD, DVD, Blu-Rays, QR-Code or in data transmission.
To make the Reed-Solomon Code comparable to Enhanced Hadamard Code we have to select two parameters: the length of the symbol and the redundancy.The symbol length (block length) is equal to the message of 9 bit.The 3D EnhanceG Hadamard Code has a codebook, where to every message of 9 bit a cube is assigned with codeword length of 512 bits.The Reed-Solomon Code has a codebook, where for each message of 9 bit a string of 4599 bits (512 Symbols, each symbol is 9 bit long) is assigned.The redundancy of Reed-Solomon Code was selected in such a way, that the number of correctable symbols should approximately correspond to the number of correctable bits of Hadamard Code, which is n/2.So we get an RS Code of [511, 255] with a codeword length of n=511 symbols and the message of k=255 symbols, where a symbol is 9 bit long.The comparison of the performance of both codes is documented in Table .At the data rate of 5Mbit/s, which correspond to the compression ratio of 1:240, the EHC Code can still recover the whole watermark without errors.In contrary the RS Code shows a recovered watermark with 17% errors.
At the data rate of 3Mbit/s, the performance advantage of EHC is even more visible.EHC Watermark has an error of 1,7%.In contrary the RS Watermark is barely visible and has an error of 27,6%.

Table . Comparison of Enhanced Hadamard with Reed-Salomon Code
In all these considerations we should take into account, that concerning the capacity EHC code is superior against RS code because the EHC codeword length is much shorter (512 bits) than an RS codeword (4599 bits).

Conclusion
In this paper a new type of multidimensional Hadamard Error Correcting Code, we called it Enhanced Hadamard Error Correcting Code (EHC) was introduced.It has remarkable property, it can overcome the limit of n/2-1 correctable bit errors of a standard Hadamard Code, where the codeword length and the Hamming distance d have the same value n.The application of this Code in Video Watermarking gives also a strong prove of its effectiveness.Compared to Reed-Solomon Code the Enhanced Hadamard Code is much more effective.The watermarks of a video, protected by EHC, can survive a very strong compression attack, in opposite to RS-Code.EHC protected watermarks can be easily recovered error-free from a video with a compression ratio of 1:240, which corresponds to a data rate of 5 Mbit/s.If the same embedding process is using RS Code instead of EHC the error free recovery of the watermarks is not possible.It has an error of about 17,5% and the content of a watermark can barely be recognized.All these results are very promising, and they show that the new Enhanced Hadamard Code is very powerful and can be successfully used in video watermarking.

Fig. 1 .
Fig. 1.Error Correcting Capability of 8 Bit Hadamard Code The 8 bit Hadamard code can correct 1,7 and 8-bit errors regardless where they occur within the code words.Generally, we can say that n bit Hadamard code can correct totally n/2-1 types of errors.The number of error bits occurring in the range from

Fig. 7 .
Fig. 7. Enhanced Hadamard Decoding Procedure on Error Mask and on Corrupted Basis Image simulated the error correcting performances of the enhanced and standard Hadamard Error Correcting Codes with the codewords of the length n=64.The results are depicted in Fig. 8. On the x-axis, we have the number of bit errors, on the y-axis the number of corrected codewords in percentage.The enhanced Hadamard Code is depicted with a continuous line and standard Hadamard with dashed line.As described in chapter 2.1 the standard Hadamard Error Correcting Code has the following features: It can correct 100% of all corrupted codewords of the length n if the number of error bits occurring in the range [1,.., n/4-1] to [3n/4+1,…,n].In case n=64 we can see, that standard Hadamard Code corrects all errors if their number is between 1 and 15 and between 49 and 64.In the case of Enhanced Hadamard Correcting Code, we can correct beyond these limits.For example, in the case of 16 errors, we correct 92% of all possible error pattern inside the codeword.In the case of 17 errors, it is still 83% of all error pattern that can be corrected.If we have 48 errors, in the case of Standard Hadamard Code no errors could be corrected on the contrary to the Enhanced Hadamard Code.It can correct 92% of all error pattern.

Fig. 12 .
Fig. 12. Watermarking Decoding Process After the selection of the proper DCT coefficients, the inverse QIM (IQIM) is applied.It delivers the decoded code words (pulse stream).Through the help of Enhanced Hadamard Error Correcting Code, the original watermark is extracted.

Fig. 14 .
Fig. 14.Coefficients of DCT Spectrum which fits for embedding

Table 1 .
Code Book of Hadamard Code 1 1 1 -1 basis images instead of Hadamard vectors.The basis images functions are orthogonal to each other, and they can be generated from the Hadamard matrix by multiplication of columns and rows.Generally, we can write

Table 2 :
2D Code Book constructed from Basic Images