US 20040179746 A1 Abstract A system for inserting an increased amount of information into DCT coefficients generated in blocks from image data is disclosed. Additional information is first inserted into input DCT coefficients in a block by changing at least one DCT coefficient of the input DCT coefficients to produce changed DCT coefficients. A level of one DCT coefficient selected from the changed DCT coefficients in the block is corrected to produce corrected DCT coefficients. The one DCT coefficient is selected so that a total code length of codes generated from the corrected DCT coefficients is equal to an original total code length of codes generated from the input DCT coefficients in the block.
Claims(13) 1. A system for inserting additional information in DCT (discrete cosine transform) coefficients by referring to a variable-length code table, wherein the DCT coefficients are generated in blocks from image data, the system comprising:
an information inserting section for inserting additional information into input DCT coefficients in a block by changing at least one DCT coefficient of the input DCT coefficients to produce changed DCT coefficients; and a total code length restoring section for correcting a level of one DCT coefficient selected from the changed DCT coefficients in the block to produce corrected DCT coefficients by referring to the variable-length code table, wherein the one DCT coefficient is selected so that a total code length of codes generated from the corrected DCT coefficients is equal to an original total code length of codes generated from the input DCT coefficients in the block. 2. The system according to a difference calculator for calculating a total code length difference between the original total code length and a total code length of codes generated from the changed DCT coefficients in the block; a target code length calculator for calculating a target code length for a non-zero DCT coefficient sequentially selected from the changed DCT coefficients based on a difference between the total code length difference and a current code length of the non-zero DCT coefficient; and a level corrector for correcting a level of the non-zero DCT coefficient to produce corrected DCT coefficients when a corrected code length of a code generated from a combination of a zero-run length and a corrected level of the non-zero DCT coefficient substantially matches the target code length. 3. The system according to a level candidate calculator for calculating a level candidate of the non-zero DCT coefficient based on a current level of the non-zero DCT coefficient; a determiner for determining whether a corrected code length of a code generated from a combination of a zero-run length and the level candidate of the non-zero DCT coefficient substantially matches the target code length; and a corrector for correcting a level of the non-zero DCT coefficient to the level candidate when the corrected code length matches the target code length. 4. The system according to a level range limiter for limiting a level range of the non-zero DCT coefficient based on the current level of the non-zero DCT coefficient; and a candidate generator for generating a level candidate within the level range. 5. The system according to a level candidate calculator for calculating a level candidate of the non-zero DCT coefficient based on the target code length and a zero-run length of the non-zero DCT coefficient; a determiner for determining whether a corrected code length of a code generated from a combination of the zero-run length and the level candidate of the non-zero DCT coefficient substantially matches the target code length; and a corrector for correcting a level of the non-zero DCT coefficient to the level candidate when the corrected code length matches the target code length. 6. The system according to a candidate generator for generating a level candidate based on the target code length and a zero-run length of the non-zero DCT coefficient; a level range limiter for limiting a level range of the non-zero DCT coefficient, wherein the level range is limited by a maximum level and a minimum level; and a level selector for selecting one of the level candidate, the maximum level and the minimum level depending on whether the level candidate falls within the level range. 7. A method for inserting additional information in DCT (discrete cosine transform) coefficients by referring to a variable-length code table, wherein the DCT coefficients are generated in blocks from image data, the method comprising the steps of:
a) inserting additional information into input DCT coefficients in a block by changing at least one DCT coefficient of the input DCT coefficients to produce changed DCT coefficients; and b) correcting a level of one DCT coefficient selected from the changed DCT coefficients in the block to produce corrected DCT coefficients by referring to the variable-length code table, wherein the one DCT coefficient is selected so that a total code length of codes generated from the corrected DCT coefficients is equal to an original total code length of codes generated from the input DCT coefficients in the block. 8. The method according to b. 1) calculating a total code length difference between the original total code length and a total code length of codes generated from the changed DCT coefficients in the block; b. 2) calculating a target code length for a non-zero DCT coefficient sequentially selected from the changed DCT coefficients based on a difference between the total code length difference and a current code length of the non-zero DCT coefficient; and b. 3) correcting a level of the non-zero DCT coefficient to produce corrected DCT coefficients when a corrected code length of a code generated from a combination of a zero-run length and a corrected level of the non-zero DCT coefficient substantially matches the target code length. 9. The method according to 3) comprises the steps of:
b. 3.1) calculating a level candidate of the non-zero DCT coefficient based on a current level of the non-zero DCT coefficient; b. 3.2) determining whether a corrected code length of a code generated from a combination of a zero-run length and the level candidate of the non-zero DCT coefficient substantially matches the target code length; and b. 3.3) correcting a level of the non-zero DCT coefficient to the level candidate when the corrected code length matches the target code length. 10. The method according to 3.1) comprises:
a level range limiter for limiting a level range of the non-zero DCT coefficient based on the current level of the non-zero DCT coefficient; and a candidate generator for generating a level candidate within the level range. 11. The method according to 3) comprises the steps of:
b. 3.1) calculating a level candidate of the non-zero DCT coefficient based on the target code length and a zero-run length of the non-zero DCT coefficient; b. 3.2) determining whether a corrected code length of a code generated from a combination of the zero-run length and the level candidate of the non-zero DCT coefficient substantially matches the target code length; and b. 3.3) correcting a level of the non-zero DCT coefficient to the level candidate when the corrected code length matches the target code length. 12. The method according to 3.1) comprises the steps of:
generating a level candidate based on the target code length and a zero-run length of the non-zero DCT coefficient; limiting a level range of the non-zero DCT coefficient, wherein the level range is limited by a maximum level and a minimum level; and selecting one of the level candidate, the maximum level and the minimum level depending on whether the level candidate falls within the level range. 13. A recording medium storing a computer-readable program for inserting additional information in DCT (discrete cosine transform) coefficients by referring to a variable-length code table, wherein the DCT coefficients are generated in blocks from image data, the program comprising the steps of:
a) inserting additional information into input DCT coefficients in a block by changing at least one DCT coefficient of the input DCT coefficients to produce changed DCT coefficients; and b) correcting a level of one DCT coefficient selected from the changed DCT coefficients in the block to produce corrected DCT coefficients by referring to the variable-length code table, wherein the one DCT coefficient is selected so that a total code length of codes generated from the corrected DCT coefficients is equal to an original total code length of codes generated from the input DCT coefficients in the block. Description [0001] 1. Field of the Invention [0002] The present invention relates to techniques for inserting additional information into discrete cosine transform (DCT) coefficient data, which is intermediate data in a digital image encoding system conforming to compression standards such as MPEG, JPEG, H.261, or the like. [0003] 2. Description of the Prior Art [0004] With wide-spreading digital satellite broadcasting, Internet transmission and DVD (Digital Video Disk), etc. in recent years, digital images are becoming easily accessible to users. Since the quality of digital images does not deteriorate when they are copied, securing their copyrights is an important issue. As means for implementing protection for copyrights, there has been proposed a technique of adding copyright information or the like into the DCT coefficient domain of digital image (see Japanese Patent Application Unexamined Publication No. 10-178642). [0005] A typical example of such a conventional information inserting system will be described briefly with reference to FIG. 9. [0006] Referring to FIG. 9, an information inserting section [0007]FIG. 10 is an example of insertion of certain information into DCT coefficients of a block of image data. In this example, a one-dimensional data stream obtained by scanning the DCT coefficients in zigzag order is represented as follows: [0008] before the information is inserted, (15, 7, 5, 3, 0, 2, 0, 0, 0, 0, 0, 1, 2, 3, 0, . . . 0, 0, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0); and [0009] after the information has been inserted, (15, 7, 1, 3, 0, 2, 0, 0, 0, 0, 0, 1, 2, 3, 0, . . . 0, 0, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0). [0010] Insertion of the information in this example is performed by changing the level of the third coefficient from 5 to 6. The code length after Huffman coding does not change before and after insertion of the information. That is, the code length of a code corresponding to a combination of run length and level (run_length=0, level=5) is 9 and that corresponding to (run_length=0, level=6) is also 9. Therefore, a change from (run_length=0, level=5) to (run_length=0, level=6) of the third coefficient does not cause any change in code length, remaining 9 bits. [0011] Such a conventional information inserting method, however, has a problem of allowing only a limited amount of information to be inserted. This is because information is only inserted by finding a combination (run length, level) at which the code length does not vary though the level of a DCT coefficient is changed and then changing only the level of a found combination. [0012] It is an object of the present invention to provide a system and method allowing an increased amount of information to be inserted into DCT coefficient data. [0013] According to the present invention, a system for inserting additional information in DCT coefficients by referring to a variable-length code table, wherein the DCT coefficients are generated in blocks from image data, includes an information inserting section for inserting additional information into input DCT coefficients in a block by changing at least one DCT coefficient of the input DCT coefficients to produce changed DCT coefficients; and a total code length restoring section for correcting a level of one DCT coefficient selected from the changed DCT coefficients in the block to produce corrected DCT coefficients by referring to the variable-length code table, wherein the one DCT coefficient is selected so that a total code length of codes generated from the corrected DCT coefficients is equal to an original total code length of codes generated from the input DCT coefficients in the block. [0014] The total code length restoring section preferably includes a difference calculator for calculating a total code length difference between the original total code length and a total code length of codes generated from the changed DCT coefficients in the block; a target code length calculator for calculating a target code length for a non-zero DCT coefficient sequentially selected from the changed DCT coefficients based on a difference between the total code length difference and a current code length of the non-zero DCT coefficient; and a level corrector for correcting a level of the non-zero DCT coefficient to produce corrected DCT coefficients when a corrected code length of a code generated from a combination of a zero-run length and a corrected level of the non-zero DCT coefficient substantially matches the target code length. [0015] The level corrector may include a level candidate calculator for calculating a level candidate of the non-zero DCT coefficient based on a current level of the non-zero DCT coefficient; a determiner for determining whether a corrected code length of a code generated from a combination of a zero-run length and the level candidate of the non-zero DCT coefficient substantially matches the target code length; and a corrector for correcting a level of the non-zero DCT coefficient to the level candidate when the corrected code length matches the target code length. The level candidate calculator may include a level range limiter for limiting a level range of the non-zero DCT coefficient based on the current level of the non-zero DCT coefficient; and a candidate generator for generating a level candidate within the level range. [0016] The level corrector may include a level candidate calculator for calculating a level candidate of the non-zero DCT coefficient based on the target code length and a zero-run length of the non-zero DCT coefficient; a determiner for determining whether a corrected code length of a code generated from a combination of the zero-run length and the level candidate of the non-zero DCT coefficient substantially matches the target code length; and a corrector for correcting a level of the non-zero DCT coefficient to the level candidate when the corrected code length matches the target code length. The level candidate calculator may include a candidate generator for generating a level candidate based on the target code length and a zero-run length of the non-zero DCT coefficient; a level range limiter for limiting a level range of the non-zero DCT coefficient, wherein the level range is limited by a maximum level and a minimum level; and a level selector for selecting one of the level candidate, the maximum level and the minimum level depending on whether the level candidate falls within the level range. [0017]FIG. 1 is a schematic block diagram showing a configuration of a system for inserting information into DCT coefficient data according to the present invention; [0018]FIG. 2 illustrates a layered structure of an MPEG standard format; [0019]FIG. 3 illustrates a zigzag-scanning sequence; [0020]FIG. 4 is a schematic diagram showing a two-dimensional variable-length coding table; [0021]FIG. 5 is a diagram illustrating DCT coefficient sequences before and after insertion of information for explaining the present invention; [0022]FIG. 6 is a block diagram showing a total code length restoring section according to a first embodiment of the present invention; [0023]FIG. 7 is a block diagram showing a total code length restoring section according to a second embodiment of the present invention; [0024]FIG. 8 is a block diagram showing a total code length restoring section according to a third embodiment of the present invention; [0025]FIG. 9 is a block diagram showing a configuration of a conventional system for inserting information into DCT coefficient data; and [0026]FIG. 10 is a diagram illustrating DCT coefficient sequences before and after insertion of information for explaining the conventional information inserting system. [0027] System Configuration [0028] Referring to FIG. 1, an information inserting section [0029] The total code length restoring section [0030] Hereafter, assuming the input image data is MPEG-encoded image data, embodiments of the present invention will be described in detail. [0031] As shown in FIG. 2, image data that has been compressed according to an MPEG standard has such a structure that a sequence header code SHC is followed by a sequence of GOP (group of picture). Here, data of each frame/field of an image is written in a picture layer following a picture start code (PSC). Each frame or field is encoded in one of three types of picture format, Intra-Picture (hereinafter referred to as “I picture”), Predictive Picture (hereinafter referred to as “P picture”) and Bidirectionally-Predictive-Picture (hereinafter referred to as “B picture”). In the case of P picture and B picture, only a difference between a reference picture and the own picture is encoded as image data. Moreover, each picture is subdivided into blocks and each block is subjected to the discrete cosine transform (DCT). Then, the DCT coefficients are quantized with an appropriate quantizing coefficient and the quantized DCT coefficients are subjected to two-dimensional Huffman coding. [0032] The field data of each frame is inside a macro block (MB) layer under a slice layer following a slice start code (SSC). In the case where a color difference format is 4:2:0, the field data of each frame is expressed by a total of 6 block layers, 4 block layers indicating brightness data Y and 2 block layers indicating color difference data Cb and Cr. [0033] Variable-Length Encoding [0034] The following is a further explanation of variable length encoding using two-dimensional Huffman codes. [0035] As shown in FIG. 3, in the case of zigzag scanning, quantized DCT coefficients are scanned in a sequence of numbers and are converted to a one-dimensional sequence of 64 DCT coefficients. The position labeled with “1” in the figure expresses a DC component of the DCT domain. Horizontal space frequency increases from this position “1” rightward and vertical frequency increases from this position “1” downward. Thus, zigzag scanning virtually results in a one-dimensional sequence in order from low-frequency components to high-frequency components. For this one-dimensional sequence of 64 DCT coefficients, a non-zero coefficient amplitude (level) and a running length of preceding zero coefficients (run length) are sequentially combined except the DC component (the first component of the one-dimensional sequence). A variable length code is assigned to each of these combinations of run lengths and levels. [0036] Referring to FIG. 4, for example, a code “00100110s” is assigned to a combination of run length 0 and level 5 and a code “00100001s” is assigned to a combination of run length 0 and level 6. Here, “s” at the end of each code is a sign bit. [0037] The variable length table [0038] When a run length and a level are input, the variable length code table [0039] Information Inserting Method [0040] Next, a method for inserting information into DCT coefficients will be explained. [0041] A necessary condition when inserting information is that the sum total of all code lengths when DCT coefficients are subjected to the Huffman coding does not change. [0042] As shown in FIG. 5, in this example, a one-dimensional sequence obtained by zigzag-scanning before insertion of the information is: [0043] (15, 7, 5, 3, 0, 2, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, . . . 0, 0, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0), and [0044] after insertion of the information is: [0045] (15, 7, 6, 3, 0, 2, 0, 0, 0, 0, 0, 1, 3, 0, 0, 2, . . . 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0). [0046] Information in this example is inserted by changing the 3rd coefficient from 5 to 6, the 13th coefficient from 2 to 3, the 14th coefficient from 3 to 0, the 16th coefficient from 0 to 2, and the 56th coefficient from 2 to 1. The Huffman-coded code length does not change before and after inserting the information. [0047] More specifically, the change in the 3rd coefficient causes the combination (run length 0, level 5) to change to the combination (run length 0, level 6). Since the code lengths corresponding to these combinations are both 9 as shown in FIG. 4, the code length is not changed by the change of the 3rd coefficient. [0048] The change in the 13th coefficient causes the combination (run length 0, level 2) to change to the combination (run length 0, level 3). The code length of the code corresponding to the combination (run length 0, level 2) is 5 bits and the code length of the code corresponding to the combination (run length 0, level 3) is 6 bits (see FIG. 4). Therefore, the change of the 13th coefficient causes the code length to be increased by 1 bit. [0049] The change in the 14th coefficient causes the combination (run length 0, level 3) to change to the combination (run length 2, level 2). The code length of the code corresponding to the combination (run length 0, level 3) is 6 bits and the code length of the code corresponding to the combination (run length 2, level 2) is 8 bits (see FIG. 4). Therefore, the change of the 14th coefficient causes the code length to be increased by 2 bits. [0050] The change in the 56th coefficient causes the combination (run length 2, level 2) to change to the combination (run length 2, level 1). The code length of the code corresponding to the combination (run length 2, level 2) is 8 bits and the code length of the code corresponding to the combination (run length 2, level 1) is 5 bits. Therefore, the change of the 56th coefficient causes the code length to be decreased by 3 bits. [0051] Therefore, the sum total of increments/decrements of the code length is: 0 bits+2 bits+1 bit−3 bits=0 bits, which means that the sum total of code lengths remains unchanged. This is a basic operation of the total code length restoring section [0052] Code Length Restoration [0053] First to third embodiments of the total code length restoring section [0054] First Embodiment [0055] Referring to FIG. 6, the total code length restoring section [0056] In FIG. 6, the total code length restoring means [0057] The code length reference section [0058] The encoder [0059] The total code length calculation section [0060] The total code length calculation section [0061] The total code length difference calculation section [0062] The code length target value calculation section [0063] The level range calculation section [0064] The counter [0065] The code length reference section [0066] The difference calculation section [0067] The optimal value detection section [0068] The memory [0069] The DCT coefficient correction section [0070] When the optimal value detection section [0071] Second Embodiment [0072] Referring to FIG. 7, the total code length restoring section [0073] In FIG. 7, the total code length restoring means [0074] The code length reference section [0075] The encoder [0076] The total code length calculation section [0077] The total code length calculation section [0078] The total code length difference calculation section [0079] The code length target value calculation section [0080] The level range calculation section [0081] The level reference section [0082] The level comparator [0083] The selector [0084] The code length reference section [0085] The level reference section [0086] The selector [0087] The selector [0088] More specifically, when the target level is greater than the maximum value of the level variation range, the signal [0089] The code length reference section [0090] The code length comparator [0091] The memory [0092] The DCT coefficient correction section [0093] When the level output by the level reference section [0094] However, even if a maximum value or minimum value output by the level range calculation section [0095] When no match has been found in the code length comparator [0096] Third Embodiment [0097] Referring to FIG. 8, the total code length restoring section [0098] The total code length restoring section [0099] In FIG. 8, the total code length restoring means [0100] The code length reference section [0101] The encoder [0102] The total code length calculation section [0103] The total code length calculation section [0104] The total code length difference calculation section [0105] The code length target value calculation section [0106] The level range calculation section [0107] The level reference section [0108] The level comparator [0109] The selector [0110] The code length reference section [0111] The code length comparator [0112] The memory [0113] The DCT coefficient correction section [0114] When no match is found by the code length comparator [0115] The above-described embodiments have been explained taking the MPEG standard coding system as an example, but of course the present invention is applicable to other image coding systems using DCT, for example, JPEG standard and H.261 as well. [0116] The method according to the above described embodiments can also be implemented by a computer loading and executing from a recording medium such as CD-ROM, a program that instructs the computer to execute this method. [0117] The system according to the above described embodiments can also be implemented by a computer loading and executing from a recording medium such as CD-ROM, a program to make the computer function as the above-described sections of the system. [0118] In this case, normally, a CPU of the computer temporarily transfers the program from the recording medium to the main memory under an operating system, and then loads the program from the main memory and executes the program. [0119] The above described program can also be created from a text-format file in which interpreter format instructions are written and an interpreter that loads this file and converts it to executable instructions. [0120] As described above, according to the present invention, it is possible to eliminate variations in code length that occur when information is inserted. Therefore, a great deal of information is allowed to be inserted into digital image data compression-encoded by the MPEG standard or the like. Classifications
Rotate |