Abstract:
The present invention relates to a gray-level watermarking system, in which sub-band and codebook technique are applied, and the feature of progressive transformation is utilized so as to randomly and evenly distribute the watermark to the entire data with the robustness and the visibility reduced. A four-fold key system is developed with encrypted key to exact the watermark, thus forming a system capable of protecting internet-transmitted multimedia signals such as audio, video ones that are combined with the watermark from being detected or attacked.

Description:
FIELD OF THE INVENTION  
         [0001]    The preset invention relates to the watermarking system for data protection. More particularly, the new invention system can provide gray level signal watermarking for images, video, music and speech applications.  
         BACKGROUND OF THE INVENTION  
         [0002]    In recent years, Internet system has become popular for transmitting and receiving digital data. Because the nature of Internet is an open system, transmitted data is easily copied, altered or even stolen. Hence communication security becomes a major concern. Moreover, digitized multi-media data such as image, video and music signals have been widely transmitted using this open system for its convenience. The problem of copyright protection becomes a most controversial subject. Unfortunately, at the present time, the protection technique is nowhere near perfect. Hence large amount of unauthorized duplication is found daily. In order to resolve this problem, watermarking techniques [1-4] have become a popular tool to protect the secrecy of the transmitted document. To achieve a high performance watermarking, the algorithm must possess properties of invisibility, security and robustness. In recent literatures, most authors [5-7] concentrated on using binary data watermarking, such as “logo” or “text”, the gray-level image watermarking for protecting multi-media data has rarely been discussed. In this invention, a gray-level data watermarking based on sub-band filtering and codebook principles is developed. In order to accomplish a high security watermarking, we avoid using the original data to extract watermark. Instead, we develop a private-key system for protecting watermark, which gives an additional security level.  
         SUMMARY OF THE INVENTION  
         [0003]    Although many watermarking algorithms have been developed in recent years, most of them concentrated on using binary data such as logos or texts. In this invention, the sub-band filtering approach is successfully employed for a gray-level data watermarking. With signal processing in the frequency domain, the feature of progressive transformation is utilized to disperse the watermark into the entire data and to enhance the robustness. The watermark is randomly dispersed into the high frequency portion of the original data. We achieved good hiding quality, which makes the unfriendly attempt on either duplication or alternation extremely difficult. To extract the watermark, we develop a four-fold key system rather than using the original data. And the privacy key is further encrypted to increase the degree of security. Furthermore, the progressive feature of DCT is used to enhance the robustness of watermarking. Even if the composite data is under attacked, the watermark can be restored from the residual coefficients, where the resulting watermark only suffers different degree of blurring but no serious distortions. Our watermark algorithm possesses the nature of good vision quality, high security, and a strong robustness. The watermarking scheme can provide good protection on the secrecy of multi-media data transmission over the current internet system, and no double shall contribute substantially on resolving the copyright violation problems. 
       
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS  
       [0004]    The foregoing aspects and many of the attendant advantages of this invention will become more readily appreciated as the same becomes better understood by reference to the following detailed description, when taken in conjunction with the accompanying drawings, wherein:  
         [0005]    [0005]FIG. 1 is a flow chart of the embedding process for watermark based on sub-band theory.  
         [0006]    [0006]FIG. 2 is a flow chart of the watermark extraction.  
         [0007]    [0007]FIG. 3 is a flow chart of the watermark embedding process using codebook concept.  
         [0008]    [0008]FIG. 4 a flow chart of the encoder and the decoder using the same key.  
         [0009]    [0009]FIG. 5 is a flow chart of the codebook method for watermark extraction.  
         [0010]    [0010]FIG. 6 is a flow chart of the mixing system by encryption and watermarking methods.  
         [0011]    [0011]FIG. 7 a flow chart of the second layer processing using encryption and spatial domain hidden.  
         [0012]    [0012]FIG. 8 is a flow chart of the watermark data extracting from two layers hidden.  
         [0013]    [0013]FIG. 9 is a flow chart of embedding the privacy key into JPEG domain.  
         [0014]    [0014]FIG. 10 is a flow chart of the watermark data being extracted from JPEG file.  
         [0015]    [0015]FIG. 11 shows privacy keys sequentially inserted into non-zero coefficients.  
         [0016]    [0016]FIG. 12 shows the key insertion with the zigzag scan for LL band. 
     
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT  
       [0017]    It is well known that the spectrum of a data can be divided into four sub-bands [8], the LL band, LH band, HL band and HH band to represent its frequency components of 2D-signal. Filters for different bands can be obtained from the following equations  
                 LL                   band   :     X   LL         =         H   LL          (     x   ij     )       =       1   C            ∑       n                 1     =   0       m                 1                         ∑       n                 2     =   0       m                 2              x   ij          W   1       -   kn                   1            W   2       -   kn                   2                   ,           (   1   )                     LH                   band   :     X   LH         =         H   LH          (     x   ij     )       =       1   C            ∑       n                 1     =   0       m                 1                         ∑       n                 2     =   0       m                 2              x   ij          W   1       -   kn                   1            W   2       -     (     k   +   π     )                     n                 2                   ,                        (   2   )                     HL                   band   :     X   HL         =         H   HL          (     x   ij     )       =       1   C            ∑       n                 1     =   0       m                 1                         ∑       n                 2     =   0       m                 2              x   ij          W   1       -     (     k   +   π     )          n                 1            W   2       -   kn                   2                   ,                        (   3   )                   HH                   band   :     X   HH         =         H   HH          (     x   ij     )       =       1   C            ∑       n                 1     =   0       m                 1                         ∑       n                 2     =   0       m                 2              x   ij          W   1       -     (     k   +   π     )          n                 1            W   2       -     (     k   +   π     )                     n                 2                   ;           (   4   )                               
 
         [0018]    where C is a constant for transformation. Using different frequency factors W1 and W2, transformations such as the Discrete Fourier Transform (DFT), Discrete Cosine Transform (DCT), etc. can be selected at will. We adapt the DCT for it has been widely used in watermarking applications. In order to reconstruct the data without frequency aliasing, transformation should have the Quadrature Mirror Filter (QMF) feature [9]. To confirm QMF in 2D transforms, horizontal symmetry, vertical symmetry and cross symmetry properties must be achieved first. In discrete signal processing, a 2D spatial block {fjk} is transformed into a DCT block by  
                 F   uv     =         C   uv            ∑     j   =   0       N   -   1                         ∑     k   =   0       N   -   1                         f   jk          W   jk   uv             =     FDCT        (     f   jk     )           ,     
            W   jk   uv     =       cos        (         (       2      j     +   1     )        u                 π       2      N       )              cos        (         (       2      k     +   1     )        v                 π       2      N       )       .                 (   5   )                               
 
         [0019]    DCT transformation can easily achieve horizontal symmetry, vertical symmetry and cross symmetry by observing  
                 W     (     N   -   k   -   1     )     uv     =                (     -   1     )     v          W   jk   uv         ,                   W       (     N   -   j   -   1     )        k     uv     =                (     -   1     )     u          W   jk   uv                                       and                            W       (     N   -   j   -   1     )          (     N   -   k   -   1     )       uv     =                (     -   1     )       u   +   v            W   jk   uv                                   
 
         [0020]    respectively. For 2D sub-bands, we can define each band according to equations (1)-(4) as: (a) LL band F LL =F u1,v1 , |u1|&lt;N/2 and |v1|&lt;N/2; (b) LH band F LH =F u2,v2 , N/2&gt;|u2| and N&gt;|v2|≧N/2; (c) HL band F HL =F u3,v3 , N&gt;|u3|≧N/2 and |v3|&lt;N/2; (d) HH band F HH =F u4,v4 , N&gt;|u4|≧N/2 and N&gt;|v4|≧N/2.  
         [0021]    In order not to confuse the “watermark data” and “watermarked data”, we shall name the former as the “watermark” and the latter as the “composite data” hereafter. Let {tilde over (f)} jk  denote a composite data where a watermark w jk  has been embedded onto an original data f jk . Clearly, the nature of a watermark is that it must be perceptually invisible in order to prevent any attempt on the composite data by unfriendly sources. Intuitively, the high frequency portion of the original data is an ideal place to insert a watermark since the great variation in high frequency makes the watermark much more difficult to detect. As the original data is divided into 8×8 blocks, its sub-bands can be obtained from  
               F   uv     =         FDCT        (     f   jk     )         8   ×   8       =         (           F   LL           F   LH               F   HL           F   HH           )       8   ×   8       =         (           F     u                 1      v                 1             F     u                 2      v                 2                 F     u                 3      v                 3             F     u                 4      v                 4             )       8   ×   8       .                 (   6   )                               
 
         [0022]    The HH band components F HH  can be viewed as a measuring parameter to search for high frequency blocks. Let us define P HH  as  
                 P   HH     =       ∑          F   HH            =       ∑       u                 4     =   4     7                       ∑       v                 4     =   4     7               F       u                 4     ,     v                 4                      ,           (   7   )                               
 
         [0023]    which denotes a high frequency factor of the HH sub-band. As the P HH  value is larger, the block frequency variance becomes higher. We search and record the P HH  value of each block in accordance with its relative block coordinate (m,n), and use the P HH  (m,n) to denote the high frequency variance for (m,n) th  block. If the P HH  (m,n)&gt;Variance-Threshold, which means this block is capable to embed a watermark without visible distortion. Then this high frequency block should be marked, for next discussions, let M(m,n) denote a coordinate of one marked block.  
         [0024]    In order to disperse the spatial correlation of the watermark, the entire watermark w jk  is transformed by DCT. Then the DCT coefficients can be split into sub-bands as  
                 W   uv     =         FDCT        (     w   jk     )         m                 1   ×   m                 2       =       (           W   LL           W   LH               W   HL           W   HH           )       m                 1   ×   m                 2           ,           (   8   )                               
 
         [0025]    where the watermark size is m1×m2. Since the W LL  band contains more information about the watermark, only their DCT coefficients are embedded into the marked blocks. The value of the LL band coefficient is usually large due to the full picture transformation. To reduce visible distortion, we need to quantize these coefficients before the embedding operation. Then equation (8) is simplified to  
                   W   ~     uv     =         1     Q     m                 1      m                 2                (           W   LL         0           0       0         )       m                 1   ×   m                 2         =       (             W   ~     LL         0           0       0         )       m                 1   ×   m                 2           ,           (   9   )                               
 
         [0026]    where Q m1m2  are parameters from a quantization table. Note that the rank of {tilde over (W)} LL  is one quarter of that of {tilde over (W)} uv . In order to reduce the bit-rate of the watermark further, we repeat the above procedure to produce a second layer LL band            LL  from the first layer {tilde over (W)} LL . Thus total bit-rate of the watermark is now reduced to {fraction (1/16)} of the original one.  
         [0027]    As coefficients of            LL  are embedded into the marked blocks, we aim to achieve good hiding quality, high security and strong robustness. This can be easily done since only one coefficient of            LL  is inserted into the high frequency portion of each marked block. Thus the watermarked block becomes  
                 F   ~     uv     =       (           F   LL           F   LH               F   HL             F   _     HH           )       8   ×   8               (   10   )                               
 
         [0028]    where {overscore (F)} HH  contains one watermark coefficient. Note that the marked blocks are randomly distributed, hence the watermark information is dispersed on the original picture everywhere. Finally, DCT coefficients are converted into spatial domain by using the inverse DCT transformation, hence the composite data is obtained by {tilde over (f)} jk =IDCT({tilde over (F)} uv ) of each sub-block.  
         [0029]    The marked coordinate is an important information for restoring the watermark, M(m,n) can be treated as a key to restore the watermark. Let us define a privacy key PK as 
         PK={M1,M2, . . . , Mn}, Mx⊂M(m,n), x=1 to n,  (11) 
         [0030]    which is a set of coordinates of the marked blocks. In order to attain high security, the privacy key can be further re-permuted by using conventional coding techniques, such as data encryption, etc. [10]. However, no algorithm is capable to remain undecoded forever, but we can create multiple privacy keys for our watermark with time-dependent codes to increase the difficulty of decoding and hence to prolong the duration of secrecy. Therefore users have a Key Bank, KB={PK 0 , PK 1 , . . . , Y}, where KB contains Y privacy keys to be used at various appropriate times. The complete embedding procedure of our algorithm is illustrated in FIG. 1.  
         [0031]    In our watermarking system, we employ the designated keys rather than the original data to extract watermark. These keys are computed according to the frequency variance of original datas, and are independent of the watermark. So they can be pre-stored on disks in the decoder of the authorized user. To extract watermark, we only need to send the composite data to users without the keys. The key in our algorithm has four folds. They are (a) Privacy Key: provides the position of the marked blocks. (b) Permutation Function key: decrypts random values into normal ones. (c) Quantization Table of            LL : provides the de-quantization for DCT coefficients of the watermark. (d) Embedding Coefficient Location: extracts the watermark coefficient from HH band of the marked blocks. In general, the procedure of extraction is just the opposite of the embedding operation. The keys that are pre-stored in the Key Bank use the same parameter for both encoder and decoder, where each user key is corresponding to one original data. Since the composite data is very similar as the original data, we can select one user key from Key Bank according to the composite data without any additional information required.  
         [0032]    [0032]FIG. 2 shows the steps for watermark extraction. When users receive a composite data, it is first partitioned into 8×8 blocks. Since the watermark is hidden on DCT domain, these blocks should be transformed by DCT first, i.e. {tilde over (F)} uv  (Extract)=DCT({tilde over (f)} jk ) 8×8 . As previously mentioned, watermark coefficients are embedded in the high frequency blocks, and the position of these marked block is recorded in the privacy key. By referring the different composite data, one can choose the appropriate privacy key from the Key Bank where the key order is re-permuted by decryption procedures. Hence the watermark coefficients are sequentially extracted from the HH band of {tilde over (F)} uv  (Extract) in the marked blocks. Finally, the LL band matrix of the watermark can be reconstructed. To restore the watermark, we need to combine the LH band, HL band and HH band of the watermark for a complete 2D sub-band processing. However, data in these bands are not used in our approach, so we must insert zeros to LH, HL and HH bands to achieve a complete matrix. After a de-quantization procedure, we can reconstruct the coefficient matrix Ŵ uv  of the watermark, and finally the watermark can be extracted from the inverse DCT of Ŵ uv .  
         [0033]    The other watermarking invention uses the codebook concept. In the first stage, the original data and watermark data all need be transformed to DCT domain. When the frame size of original picture f jk  is M1×N1, we take a full-frame transformation. Thus the DCT coefficients are attained form  
                 F     u                 1      v                 1       =         FDCT        (     f   jk     )         M                 1   ×   N1       =       (                            F   00           F   01           F     02   ...             F     0        (     M   -   1     )                   F   10           F   11                       F     1        (     M   -   1     )                 ⋯       ⋯       ⋯       ⋯                                      F       (     N   -   1     )        0           ⋯         F       (     N   -   1     )          (     M   -   1     )                                  )       M                 1   ×   N                 1           ,           (   12   )                               
 
         [0034]    where u1 and v1 are frequency indexes for coefficient F u1v1 . By the same way, we attain the watermark coefficients from  
                 W     u                 2      v                 2       =         FDCT        (     w   xy     )         M                 2   ×   N                 2       =       (                            W   00           W   01           W     02   ...             W     0        (       M                 2     -   1     )                   W   10           W   11                     …                 …                 …             W     1        (       M                 2     -   1     )                 ⋯       ⋯       ⋯       ⋯                                      W       (     N2   -   1     )        0           ⋯         W       (       N                 2     -   1     )          (       M                 2     -   1     )                                             )       M                 2   ×   N                 2           ,           (   13   )                               
 
         [0035]    where the watermark data size is M2×N2, and its frequency indexes use u2 and v2. To avoid the visible distortion after embedding process, the high frequency part of F u1v1  is good choice to insert watermarking information since human eyes are difficult to detect high frequency component. However, when the watermark coefficient is embedded to the high frequency part, the watermark coefficient should be lost after data compression because high frequency component is spatial redundancy.  
         [0036]    Based on frequency codebook concept, we propose a new approach to realize the watermarking system. As a watermarking coefficient W a  is to be embedded, its vector can be found from codebook. The coefficient matrix in (1) is treated as a codebook content. So the codebook is a set of picture coefficients. With coefficient-by-coefficient searching, we can find the minimum differential value between watermarking coefficient and codebook coefficient after n1×m1 points compared, which is given by 
         (Diff) min =Min( W   a   −F   b ), F b εF u1v1 .  (14) 
         [0037]    where Min is minimum value search function. The watermarking coefficient is matched the codebook coefficient by minimum difference. The relative coordinate in matrix (1) can be recorded as a vector. To embed the watermarking information, the watermarking coefficient is rather than the original picture coefficient with 
           [F   b ] εDiff(min)   =W   a ,  (15) 
         [0038]    where [F b ] εDiff(min)  is corresponding to the vector location of minimum difference. By the same way, the next watermarking coefficient is processed. The relative coordinate also requires to be recorded for each coefficient. Anyway, when the codebook coefficient has replaced by one watermarking coefficient in the previous search, the coefficient is not changed again for the next watermark coefficient processing. Totally, there are n2×m2 watermarking coefficients to be embedded. Finally, we can attain the relative vector according to the coordinate location from each watermark coefficient. Hereafter, the vector is named as W a (m,n) to denote the coefficient W a  located on (m,n) coordinate. The W a (m,n) is an import-nt information to restore watermark. So W a (m,n) can be treated as a privacy key (PK) [22] that is defined by 
         PK={M1,M2 . . . Mn}, Mx⊂W a (m,n), x=1 to n2×m2,  (16) 
         [0039]    PK is a set of vector for watermarking information.  
         [0040]    After the embedding process, the transform coefficient of original picture involves the watermarking coefficient. We get the new coefficient matrix with  
                   F   ~     u1v1     =       (             F   00          W   31          F   02          F   03          W   12          F     05                     ⋯                 W   21          W   35          F   12          F   13          W   14          F     15                     ⋯                 F   20          W   05          W   62          W   33          F   24          W   02                   ⋯             ⋯         )       u1   ×   v1         ,           (   17   )                               
 
         [0041]    where some coefficients have been replaced by watermarking coefficients. Finally, the frequency coefficients are converted into spatial domain using inverse transform with  
                   f   ~     jk   1     =     IDCT        (       F   ~     u1v1     )         ,           (   18   )                               
 
         [0042]    {tilde over (f)} jk   1  denotes the composite data in the first layer output. The embedding procedure of the proposed algorithm is illustrated in FIG. 3.  
         [0043]    The procedure of extracting operation is an inverse operation of the embedding one. As receiving the composite data, we only need the key parameter rather than original data to extract watermark. Since the key is a secret data, we need use the same key both of the transmitter and receiver, as shown in FIG. 4. FIG. 5 indicates the processing step for watermark restoration. When the composite data is received, the data should be transformed by DCT since the watermarking information is hidden on the frequency domain. So we have  
                 F   ~       u                 v       =       DCT        (       f   ~     jk   1     )          n                 1   ×   m                 1.             (   19   )                               
 
         [0044]    Using the privacy key, we could find the watermark coefficient from codebook. Then each coefficient is sequentially extracted according to the privacy key and the codebook content. Then the watermark coefficient matrix Ŵ uv  can be reconstructed. The reconstructed watermark data could be attain from inverse transform of Ŵ uv  with 
           ŵ   xy   =IDCT ( Ŵ   uv ) n2×m2   (20) 
         [0045]    The watermarking information is hidden into the composite data and its privacy key. In order to increase security, we propose the second layer processing to hide the privacy key to enhance the communication security. Since we have used the frequency domain processing in the first layer, in order to avoid the frequency spectrum aliasing, we employ spatial domain processing consisting of the encryption approach in the second layer.  
         [0046]    The encryption approaches had been used in the past twenty years. As the secret data is encrypted, the output becomes a scrambled data by predetermined key. The attacker can easily detect the data whether or not is encrypted. Since the computing power increases very fast today, the complex encryption system also can be de-encrypted by using statistical analysis. Although the watermarking system can efficiently avoid the attackers&#39; detection, the security level is low. Once the watermark is detected, the attacker can be easy to extract the secret data. Therefore, we develop a mixing system with the encryption consisting of watermark system. The basic structure is shown in FIG. 6. The encryption can increase the security level for watermark. And watermarking can protect the encryption to be detected.  
         [0047]    In our watermarking system, the privacy key is treated as a secret information. In order to increase the security level, the privacy key can be re-permuted by using conventional encryption methods, such as DES. As the key is encrypted by the encryption method, we have the new PK (NPK) from 
           NPK =Encryp ( PK ).  (21) 
         [0048]    The encryption approach can provide high security to protect the privacy key. In order to avoid the encryption operation to be detected, the second layer hidden is employed.  
         [0049]    To enhance security, the new PK can be further hidden into the composite data using spatial domain processing to avoid attackers&#39; detection. One has simple and efficient method, the key is considered to embed the LSB bit of pixel in composite data, then we have  
                 jk   2     =         (       f   ~     jk   1     )     LSB     ←       (   NPK   )     Bit         ,           (   22   )                               
 
         [0050]    where  
         f   ~     jk   2                         
 
         [0051]    is the second layer composite data. The NPK data use bit-by-bit to insert the LSB of  
         f   ~     jk   1                         
 
         [0052]    from left-to-right and top-to-bottom sequentially. The first layer consists of the second layer with encryption and spatial domain processing is shown in FIG. 7. The decoding system block is illustrated in FIG. 8. As we receive  
           f   ~     jk   2     ,                         
 
         [0053]    , the LSB is extracted to attain the key information. After de-encryption, the privacy key can be re-restored. According to the privacy key and  
           f   ~     jk   2     ,                         
 
         [0054]    , we can reconstruct the watermark data.  
         [0055]    As the composite data size is m1×n1, we have m1×n1 bits space to embed the key information. The coordinate resolution (m,n) presents each watermark coefficient vector, then the watermarking data size m2×n2 can be determined by  
                 m                 1   ×   n                 1       m   +   n       ≥     m2   ×     n2   .               (   23   )                               
 
         [0056]    As the key information is embedded into LSB bits of each pixel, the data quality degrades very small. Moreover, the privacy key has been encrypted, to detect the watermarking information becomes very difficult. Thus the security level becomes higher as double hidden procedure is used. In fact, this watermarking system is the mixing process of the frequency and spatial domain hidden. In first layer, the frequency codebook watermark is employed using the DCT domain. And the privacy key is scrambled using the encryption approach consisting of spatial processing in the second layer.  
         [0057]    Currently, JPEG compressor has been widely used to reduce the data size. However, most of the watermark data is discarded after JPEG processing as well. In order to overcome this drawback, a high robustness algorithm for JPEG processing is invented. In the JPEG compressor [12], the data is partitioned into 8×8, and then is transformed by DCT processing. These DCT coefficients are quantized using a particular quantization table, which can be expressed as  
                   F   ^       u                 v       =         DCT        (       f   ~     jk     )         8   ×   8         Q   uv         ,           (   24   )                               
 
         [0058]    where Q uv  is the quantization level that is dependent on the u and v component, {tilde over (f)} jk  is a composite data that is attained from (8), and {circumflex over (F)} uv  is the final quantized coefficient. For RLC/VLC package, the coefficient {circumflex over (F)} uv  should be truncated into an integer. In fact, the LSB bit of each coefficient is not exact after the truncation processing. Thus the compression performance is not changed too much as the privacy key information is embedded into LSBs of non-zero coefficients. With this concept, we first search all non-zero coefficients. Then the LSB of non-zero coefficient is modified by one-bit of the privacy key, which is given by  
             {         If               (       F   ^     uv     )                   is                 odd   ,                  then        (       F   ^     uv     )       LSB       =       0   ,                  as        (   Key   )       bit       =   0                            If             (       F   ^     uv     )        is                 even   ,                  then   (       F   ^     uv     )     LSB       =       1   ,                  as        (   Key   )         one                 bit         =       1   ,              as                     F   ^     uv       ≠   0                 Else               (       F   ^     uv     )     LSB                   No                 Change                                (   25   )                               
 
         [0059]    The information of the privacy key is sequentially inserted into the LSB location of each non-zero coefficient with bit-by-bit approach. Since only LSBs of non-zero DCT coefficients are modified, the compression ratio is not affected.  
         [0060]    [0060]FIG. 9 illustrates the privacy key embedded into non-zero coefficients on the JPEG encoder. FIG. 10 illustrates the JPEG decoder system block for the watermark data extracting. From the JPEG file, the composite data is reconstructed after JPEG decoder. Simultaneously, the privacy key is extracted from each non-zero coefficient. Then the composite data is transformed into DCT domain. According to the privacy key, the coefficients of the watermark data can be extracted. Finally, the watermark data can be restored from inverse DCT processing.  
         [0061]    From the above mentions, how much the key information embedded has to be counted. The total bit of the key information is n2×m2×log 2 (n1×m1) since there are n2×m2 keys and each key with log 2 (n1×m1) bits. After JPEG processing, the number of non-zero coefficients (NNZC) in the full frame is computed by 
         If          F   uv   i     ≠     0   ,                           
 then  NNZC=NNZC+   1 , where  i=   1  to ( n   1/8 )×( m   1/8 ),  u,v=   0  to  7   ( 26 ) 
         [0062]    , where  
         F   ^     uv   i                         
 
         [0063]    denote the quantized coefficient at the (u,v) location for the i th  block, and the composite data is split into (n1/8)×(m1/8) blocks as a block size is 8×8. To embed the key information completely, the following equation 
           NNZC≧n 2 ×m 2×log 2 ( n 1 ×m 1),  (27) 
         [0064]    need be satisfied. Otherwise, some key information would be discarded, and the extracting quality will degrade accordingly. In fact the NNZC becomes smaller after quantization. Eq. (27) is seldom satisfied in practical case, except the watermark data size is further reduced or the source data size is further enlarged, but the hiding system shall become no efficiency. For practical applications, we present three scanning approaches as below.  
         [0065]    Since DCT transformation has a progressive feature, each coefficient implies one spatial resolution. The watermark data can be restored using only a few DCT coefficients. The sequential procedure is shown in FIG. 11, where the key information is scanned to insert JPEG bit-stream with block-by-block processing. Until all non-zero coefficients are completely processed, the inserting procedure is stopped. Because the amount of the key information is much larger than that of non-zero coefficients, the extracting quality is not good generally. Intuitively, we can increase the number of non-zero coefficients to improve the data quality, but this scheme will reduce the compression ratio. Instead, the high-efficiency scanning styles are presented.  
         [0066]    Because most of the data energy is compacted into the low frequency band in the DCT domain, the key information located at the low frequency area is first considered to embed. Based on a sub-band concept the coefficients can be split into LL, LH, HL and HH bands. In order to keep a regular processing flow, only LL band information is imbedded by using the zigzag scan as shown in FIG. 12. The zigzag scan likes as the run length coding within JPEG compressor, the scanning direction is from left-top corner to right-bottom for the LL band only.  
         [0067]    Since the DCT coefficients are independent, the data can be approximately reconstructed from inverse transformation with coefficient-by-coefficient approach. As the coefficient value is larger, its weight is larger to affect the reconstructed result. To improve the data quality, the key position corresponding to a larger coefficient is first inserted. Because the coefficients are random distribution on the codebook, one-bit flag is required to record the current coefficient whether or not to be selected. For LL band processing, there are n2/2×m2/2 bits used to mark the available coordinate. The number of maximum weight coefficient (NMWC) recorded for the key processing can be computed as  
         Input                 Workspace                     TL4          
            Date   :            09   /   11     /   2003                       Number   :          10090834                     Folder   :          05                           
 
         [0068]    The processing procedures using the maximum weight scan are:  
         [0069]    (a). Pre-computing NNZC and NMWC.  
         [0070]    (b). Find the maximum coefficient and record its corresponding key position.  
         [0071]    (c) The one-bit flag is set to high, and counter=counter+1.  
         [0072]    (d) The next maximum coefficient is processed with repeating (b)-(c), until the counter=NMWC.  
         [0073]    Although we sacrifice one bit space to record the location of maximum weight coefficients, the larger weight coefficients used can improve the inverse transformation result.  
         [0074]    As previously mentioned, we had used two-layer DCT domain hidden. First the DCT coefficients are hidden on the frequency codebook. The codebook vector is treated as a privacy key. Then the privacy key is further hidden into DCT coefficients in the bit stream of JPEG domain. This approach can meet three requirements for the data hiding systems: invisible, robustness and security. The watermark data becomes invisible since its coefficients are embedded with the best match from the codebook content. Our approach can provide a high robustness for JPEG compressing because of the random coefficient distribution over the entire data. With double DCT layer hidden, a high security for the watermark data protection is achieved.