The invention relates to a method and arrangement for embedding a watermark in a media signal comprising signal samples being encoded as variable-length code words, comprising the steps of decoding variable-length code words into said signal samples, modifying selected signal samples in accordance with respective samples of the watermark to be embedded, and re-encoding the modified signal samples.
A known method of embedding a watermark in a media signal as defined in the opening paragraph is disclosed in F. Hartung and B. Girod: “Digital Watermarking of MPEG-2 Coded Video in the Bitstream Domain”, published in ICASSP, Vol. 4, 1997, pp. 2621-2624. In this prior-art publication, the media signal is an MPEG-compressed video signal. The signal samples of the media signal are DCT coefficients obtained by subjecting the image pixels to a Discrete Cosine Transform. The watermark is a DCT-transformed pseudo-noise sequence. The watermark is embedded by adding the samples of this transformed noise sequence to the corresponding DCT coefficients. The zero coefficients of the MPEG-coded signal are not affected.
A problem of this prior-art watermark embedding scheme is that modification of DCT coefficients generally changes the bit rate of the bit stream, because the DCT coefficients are represented by variable-length code words. A higher bit rate is usually not acceptable. The prior-art embedder therefore checks whether transmission of the modified coefficient increases the bit rate, and transmits the original-coefficient in that case. The reduction of the bit rate is not desired. In MPEG systems, for example, a change of the bit rate may result in overflow or underflow of buffers in the decoder and change the position of timing information in the bit stream.
It is an object of the invention to provide a method of embedding a watermark which alleviates the above-mentioned drawbacks.
To this end, the method according to the invention is characterized in that the modifying step is applied to signal samples represented by variable-length code words having the same length for signal samples having the same magnitude but a different sign, and comprises the step of inverting the sign of said signal samples if said inversion causes the signal samples to be increased or decreased as prescribed by the respective samples of the watermark.
By modifying only the signs of signal samples, and leaving the magnitudes unaffected, the lengths of the variable-length code words are not changed by the watermark embedding process. It is thus achieved with the invention that the bit rate remains unaffected.
The amount by which a signal sample is modified by inverting its sign equals twice its magnitude. Such a modification may be too large. In an embodiment of the method, the step of inverting is therefore dependent upon the magnitude of the signal sample.
The invention is particularly advantageous in compression schemes, such as MPEG, that use variable-length codes having a sign bit representing the sign of the signal sample and a variable-length coded magnitude of the signal sample. The separate step of re-encoding can then be dispensed with. It is sufficient to invert the sign bit of the variable-length code word.
The watermark W to be embedded is a series of watermark samples w(n). It is stored in the watermark buffer 4.
x′(n)=x(n)+w(n).
It should be noted that the watermark samples are much smaller than the signal samples in practice.
The watermarked signal samples x′(n) are subsequently re-encoded into variable-length code words VLC(x′(n)) by the variable-length encoder 3. A problem of such an unconditional additive watermark embedding process is that the output variable-length code words VLC(x′(n)) will generally have different lengths LEN than the corresponding input variable-length code words VLC(x(n)). The output bit rate thus generally differs from the input bit rate, which is not desirable. The Hartung and Girod article mentioned hereinbefore provides a solution to this problem by leaving a signal sample x(n) unaffected if its modification increases the length of the corresponding variable-length code word.
According to this invention, the modification of signal samples is restricted to those signal samples that are represented by variable-length code words having the same length for signal samples having the same magnitude but a different sign. For convenience, it will be assumed that this condition is fulfilled for all variable-length codes in this example, i.e. that:
LEN{VLC(x(n))}=LEN{VLC(−x(n))} for all x(n)
Watermark embedding is now performed by inverting the sign of the signal sample x(n) if said inversion indeed causes the signal sample to be increased or decreased as prescribed by the respective sample of the watermark. This operation is performed by the embedding stage 2.
It is achieved with the above described watermark embedding by sign inversion (also referred to as “sign bit flipping”) that each variable-length code word VLC(x′(n)) in the output bit stream has the same length as the corresponding variable-length code word VLC(x(n)) in the input bit stream. Not only does the average bit rate remain unchanged, but also the bit rate does not even change momentarily. Each and every code word of the bit stream maintains its original position, and there is no risk that timing-critical positions of other information in the bit stream, such as time stamps, are altered.
A practical embodiment of the arrangement will now be described with reference to embedding of a watermark in a video signal being compressed in accordance with the MPEG2 standard. Note that the media signal may already have an embedded watermark. In that case, an additional watermark is embedded. This process of watermarking an already watermarked signal is usually referred to as “remarking”.
The arrangement receives an MPEG video stream MP which represents a sequence of video images. One such video image is shown in
The coefficients of the DCT block have been sequentially scanned in accordance with a zigzag scan pattern (79 in
The (run,level) pairs are represented by variable-length code words. A property of the variable-length coding scheme adopted by MPEG is that coefficients having the same magnitude but a different sign are represented by equal-length code words. For example, the (run,level) pairs (1,−1) and (1,1) are encoded as equal-length code words 0111 and 0110, respectively.
In an MPEG2 video stream, four DCT luminance blocks and two DCT chrominance blocks constitute a macroblock, a number of macroblocks constitutes a slice, a number of slices constitutes a picture (field or frame), and a series of pictures constitutes a video sequence. Some pictures are autonomously encoded (I-pictures), other pictures are predictively encoded with motion compensation (P and B-pictures). In the latter case, the DCT coefficients represent differences between pixels of the current picture and pixels of a reference picture rather than the pixels themselves.
The MPEG2 video stream MP is applied to the parsing unit 51 (
The watermark to be embedded is a pseudo-random noise sequence in the pixel domain. In this embodiment of the arrangement, a 128×128 watermark pattern is to be “tiled” over the extent of the image. This tiling operation is illustrated in
The AC coefficients x(n) and the watermark samples s(n) are applied to the processing unit 53. This processing unit determines which of the coefficients x(n) will be inverted so as to embed the watermark. More particularly, the sign of a coefficient x(n) is to be inverted if that causes the coefficient to be increased or decreased as prescribed by the corresponding watermark sample s(n). To avoid that coefficients are modified by a too large amount (for example, that the coefficient x(2)=3 in
if (x(n)=−1 && s(n)=+1) then x(n)=−x(n)
if (x(n)=+1 && s(n)=−1) then x(n)=−x(n)
The arrangement which is shown in
In the above described arrangement for embedding a watermark in an MPEG encoded signal, the “level” part of (run,level) pairs is changed. However, a level is not an actual value of an AC coefficient, but a quantized version thereof. For example, the level x(4)=−1 in
There may thus be a need to control the watermark embedding process in such a way that the effect thereof on visibility is reduced. To this end, a further embodiment of the embedding method includes the step of controlling the number and/or positions of coefficients being modified in dependence upon the quantizer step size.
In an MPEG decoder, inverse quantization is achieved by multiplying the received level x(n) with the quantizer step size. The quantizer step size is controlled by a weighting factor W(n) which modifies the step size within a block and a scale factor QS which modifies the step size from (macro)block to (macro)block. The following equation specifies MPEG's arithmetic to reconstruct an AC coefficient X(n) from the decoded level x(n):
X(n)=x(n)×W(n)×QS
There are various ways of generating an upper boundary for the number of coefficients that are allowed to be modified. In one embodiment, a level x(n) may only be modified if the corresponding quantizing step size Q(n)=W(n)×QS is less than a predetermined threshold. Different thresholds may thereby be used for different block positions (i.e. for different indexes n).
In another embodiment, the maximum number N of coefficients that are allowed to be modified in a block is a function of the quantizer scale factor QS such that N decreases as QS increases. The feasibility of this embodiment can easily be understood if one realizes that the scale factor in fact indicates how strongly a DCT block has been quantized. The larger the scale factor, i.e. the larger the quantization step size, the fewer coefficients may be changed in order to render the effect imperceptible. An example of such a function is:
where c is a given constant value.
The quantizer scale factor QS is accommodated in MPEG bit streams as a combination of a parameter quantizer_scale_code and a parameter q_scale_type. The parameter quantizer_scale_code is a 5-bit code. The parameter q_scale_type indicates whether said code represents a linear range of QS-values between 2 and 62, or an exponential range of values between 1 and 112. In both cases, the code is indicative of the step size. Accordingly, the term QS in the above-mentioned function may also be replaced by the parameter quantizer_scale_code.
It is also advantageous to control the positions of the coefficients being modified by the watermark process in dependence upon the quantizer step size. The larger the quantizer step size, the later in the zigzag scan the desired modifications are carried out. This leaves the low-frequency coefficients unaffected and restricts the visibility of the watermark embedding process to the higher frequency coefficients.
The feature of controlling the maximum number and/or the positions of modifiable coefficients in dependence upon the quantizer step size requires only a minor modification of the arrangement. To this end, the parsing unit 51 in
It should be noted that the concept of limiting the number and/or positions of modified signal samples within a given series of signal samples in dependence upon the quantizer step size is not restricted to the bit-flip watermarking algorithm. It may also be used in other watermarking algorithms, such as the one proposed in Applicant's patent application EP 01200277.0 in which signal samples are zeroed in order to embed the watermark. The concept of limiting the number of modified signal samples may even be applied in other signal processing algorithms than watermarking.
The invention can be summarized as follows. A method and arrangement are disclosed for embedding a watermark (W) in a media signal (MP) comprising signal samples (x(n)) being encoded as variable-length code words (VLC). The variable-length coded DCT coefficients of an MPEG2 video signal constitute such a media signal. The watermark is embedded by inverting the signs of the AC coefficients as far as such an inversion indeed causes the coefficients to be increased or decreased as prescribed (s(n)) by the watermark to be embedded. The invention is simple to implement, does not require re-encoding of the signal and does not affect the bit rate of the bit stream.
Number | Date | Country | Kind |
---|---|---|---|
01204680.1 | Dec 2001 | EP | regional |
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/IB02/04794 | 11/13/2002 | WO |