JP3478019B2 - Image encoded data creation method and image encoded data decoding method - Google PatentsImage encoded data creation method and image encoded data decoding method
- Publication number
- JP3478019B2 JP3478019B2 JP25826496A JP25826496A JP3478019B2 JP 3478019 B2 JP3478019 B2 JP 3478019B2 JP 25826496 A JP25826496 A JP 25826496A JP 25826496 A JP25826496 A JP 25826496A JP 3478019 B2 JP3478019 B2 JP 3478019B2
- Prior art keywords
- discrete cosine
- cosine transform
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
- 238000004519 manufacturing process Methods 0.000 claims 1
- 239000003550 marker Substances 0.000 description 96
- 238000000034 methods Methods 0.000 description 27
- 238000010586 diagrams Methods 0.000 description 20
- 238000003780 insertion Methods 0.000 description 17
- 230000000750 progressive Effects 0.000 description 17
- 229920001223 polyethylene glycols Polymers 0.000 description 10
- 101710088096 PABPC4 Proteins 0.000 description 9
- 102100010415 Polyadenylate-binding protein 4 Human genes 0.000 description 9
- 101710044155 ampp Proteins 0.000 description 9
- 238000007906 compression Methods 0.000 description 6
- 230000000051 modifying Effects 0.000 description 5
- 281000156623 G Data companies 0.000 description 3
- 238000006243 chemical reactions Methods 0.000 description 3
- 230000001174 ascending Effects 0.000 description 2
- 281999990011 institutions and organizations companies 0.000 description 2
- 239000000203 mixtures Substances 0.000 description 2
- 238000005457 optimization Methods 0.000 description 2
- 101710005545 CSTF77 Proteins 0.000 description 1
- 281000064475 Hitachi companies 0.000 description 1
- 280000635983 Watermark companies 0.000 description 1
- 239000000460 chlorine Substances 0.000 description 1
- 239000002131 composite materials Substances 0.000 description 1
- 239000000470 constituents Substances 0.000 description 1
- 230000000875 corresponding Effects 0.000 description 1
- 230000000593 degrading Effects 0.000 description 1
- 238000005070 sampling Methods 0.000 description 1
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a data encryption method for encoded image data, which is performed when transmitting or storing encoded image data, and an apparatus using the same.
2. Description of the Related Art In recent years, when image data of continuous tone such as a natural image is stored or transferred, the amount of the image data is enormous. Therefore, it is common to encode the image data to reduce the data amount. Is. As an encoding method for natural still image data, ISO (Internatinal Standard Organization:
International Standardization Organization) and CCITT (Comite Consulatif Inte
rnationale telegraphicque et Telephonique: Joint Photographic Expert Group (JPEG), a joint group with the International Telegraph and Telephone Advisory Committee, now ITU-T)
The algorithm recommended by
EG) is known as an international standard. Below, J
Image data encoded by PEG is called JPEG data. The above technique is described in detail, for example, in "International Standard for Multimedia Coding" (Maruzen Co., Ltd.).
The most basic encoding / decoding processing of JPEG will be described with reference to FIGS. 2, 3 and 4. 2 is J
It is a flowchart figure which showed the example of the encoding procedure of PEG.
First, the image data of a still image to be encoded is
Divide into blocks of × 8 pixels, and DCT for each block
(Step 201). Below, the DCT
(Discreate Cosine Transform)
These blocks are called DCT coefficient blocks, one coefficient of the DCT coefficient blocks is called a DCT coefficient, and a set of DCT coefficient blocks of one image is called a DCT coefficient block group. Next, the DCT coefficient block group is quantized using an arbitrary quantization table (step 202). Below, this DC
A block obtained by quantizing a T coefficient block is called a quantized DCT coefficient block, and a set of quantized DCT coefficient blocks of one image is called a quantized DCT coefficient block group. Then, the quantized DCT coefficient block group is Huffman-coded (step 203). The data after this Huffman coding becomes JPEG data. The Huffman table used at this time may be a table prepared in advance or a table created for each image compression. JPEG
The data includes this Huffman-encoded data, the quantization table and the Huffman table used at the time of compression.
An example of this JPEG data is shown in FIG. FIG. 3 shows an example of the structure of data compressed by the JPEG sequential method. The sequential method is a method in which a clear image appears in order from the top when a day code is performed. On the other hand, a method in which the entire image is initially displayed indistinctly and gradually becomes clear is called a progressive method. The difference in this method depends on the Huffman coding method in the Huffman coding in step 203 of FIG. This JPE
G data has a unique 2 in the data called a marker.
Formatted by byte code. The first SOI marker 301 represents the start of JPEG data. The next DQT marker unit 302 represents the definition of the quantization table, and stores the quantization table used at the time of compression after the DQT marker. The next SOF0 marker unit 303 uses the SOF0 marker when compressed by the sequential method using DCT, and the size of the image compressed after this marker, the sampling rate, the number of components, and the quantization table for each component. The parameters at the time of compression such as the identifier of are stored. Next DH
The T marker unit 304 represents the definition of the Huffman table, and the Huffman table used at the time of compression is stored after the DHT marker. Next SOS marker section 30
Reference numeral 5 stores a Huffman code that is an actual encoded image. After the SOS marker, a header containing information such as an identifier in the Huffman table for each component is attached for several bytes, and then the Huffman code that encodes the image is inserted. Finally, the EOI marker indicates the end of the image.
In this example, the order of the markers is as shown in FIG. 3, but the order does not have to be the same in actual data, and the number of markers may be two or more.
FIG. 4 is a flow chart showing an example of the decoding procedure of the JPEG data compressed by the procedure of FIG.
In the decoding, first, the Huffman table in the JPEG data is used to perform the Huffman decoding of the Huffman code to decode the quantized DCT coefficient block group (step 40).
1). Next, the quantized DCT coefficient block group is converted to JPEG.
Inverse quantization is performed using the data quantization table, and the DCT coefficient block group is decoded (step 402). Next, the block group is subjected to IDCT (Inverse DCT) (step 403) to return it to a block of 8 × 8 pixels and reconstruct it. Image data decoded from JPEG data can be obtained by such a procedure.
Nowadays, recently, the JPEG data of the natural image compressed by JPEG is used for the WWW (World WWW) of the Internet.
Very often published on the server of (ide Web). This is because most WWW clients can display JPEG data. In particular, there are many JPEG data in WWW servers published by museums or museums, and WWW clients all over the world can freely access those servers through Intenet to view JPEG data such as paintings and photographs. You can
 However, since pictures, photographs, etc. have rights such as copyright, there is a WWW server that allows only WWW clients who have the right to see depending on the data to see. For example, when the WWW client requests the JPEG data from the WWW server, the JPEG data is transferred only when the user is authenticated by inputting the user ID and password. As another method, there is a method in which the image data provided by the WWW server is changed to data different from the standard data format so that only an arbitrary client can display the image data.
However, in the user authentication of the conventional technique, the JPEG data transferred from the WWW server is not protected at all, and therefore the client that issued the request on the Internet. Other machines can get the data. Furthermore, J
Since the WWW client who obtained the PEG data can redistribute the JPEG data, there is a problem that it is difficult to protect the right such as copyright.
Further, the method of specializing the data format has a problem that when a normal client having no means for displaying the data obtains the data, nothing can be displayed.
It is an object of the present invention to provide a method for creating coded image data which scrambles image data without degrading the image quality of the original image.
Another object of the present invention is to provide an image coded data creating method in which the time for decoding the image coded data is extremely small depending on whether it is encrypted or not encrypted. To provide.
Another object of the present invention is to provide an image code capable of displaying an image of the same size as the original image even if the image data is combined without decrypting the code of the image data. The purpose is to provide a method for creating computerized data.
In order to solve the above problems, the present invention divides image data into blocks each having a predetermined number of pixels in the vertical and horizontal directions, and a discrete cosine (D
CT) transform, quantize the DCT transformed data, transform code the quantized data into a quantized DCT coefficient block group, thereby performing modulation coding of the image data A Huffman table for modulating and coding the quantized DCT block is created from the quantized DCT block group, and the DCT block coefficient is Huffman coded using the created Huffman table to create image coded data. The Huffman table is encrypted, and the encrypted Huffman table is inserted into the encoded image data to obtain encoded image data of the image data.
Further, in the decoding method of the image coded data created by the image coded data creating method of the present invention, it is determined that the Huffman table in the image coded data is encrypted, and the encryption is performed. The decoded Huffman table is decoded, the image coded data is composited by the decoded Huffman table, the decoded image coded data is inversely quantized, and inverse DCT transform is performed to obtain the image coded data. It is configured to be composite.
In order to solve the above problems, the present invention divides image data into blocks each having a predetermined number of pixels in the vertical and horizontal directions, performs discrete cosine (DCT) conversion for each of the divided blocks, and performs the DCT conversion. An image coded data creating method for modulating and coding the image data by quantizing the data and transform-coding the quantized data into a quantized DCT coefficient block group, wherein the quantized DCT block is modulated and coded. The Huffman table for this purpose is divided into several stages from a component having coarse image quality to a component having fine image quality of the image data of the quantized DCT block group, and one Huffman table is produced by sequentially producing Huffman codes. , Using the Huffman table, Huffman coding the DCT block coefficients to sequentially create coded image data, and the sequential creation Of Huffman code, at least 1
One Huffman code is encrypted, and a Huffman table having the encrypted Huffman code and dummy data indicating that the Huffman code has ended are inserted into the image coded data to obtain image coded data of the image data. Configured as
In order to solve the above problems, the present invention divides image data into blocks each having a predetermined number of pixels in the vertical and horizontal directions, performs discrete cosine (DCT) conversion for each of the divided blocks, and performs the DCT-converted data. In the image coded data creating method for modulating and coding the image data by converting and coding the quantized data into a quantized DCT coefficient block group. When decoding with the data decoding method, another image is inserted into the coded image data like a watermark picture to decode, but there is a means to decipher the code Decoding with the image coding data decoding method Is performed, only the encoded image data is decoded.
BEST MODE FOR CARRYING OUT THE INVENTION Embodiments of the present invention will be described with reference to the drawings. In the following embodiments, JPEG will be used as an example of encoded data of still image data.
In the following embodiment, the encryption of the non-encoded still image data or JPEG data is realized by the apparatus example as shown in FIG. In FIG. 5, a still image data encryption device 508 includes a CPU 501 that performs predetermined processing,
Bus 502 for transferring data and control, hard disk, floppy, CD for storing programs and data
A storage device 503 such as a ROM or MO, a main storage device 505 such as a memory for storing programs and data, and a communication control device 506 such as a network board or a modem. In this device, the above components are connected by a bus 502 so that information can be transmitted to each other. Also,
It is assumed that the still image data encryption device 508 can send and receive data and programs to and from other devices connected to the communication network 507 by using the communication network 507 such as a telephone line and a LAN.
The storage device 503, the main memory 505, and the communication control device 506 are controlled by control and data sent via the CPU 501 according to a program executed by the still image data encryption device 508.
A program for encrypting still image data and a target non-encoded still image data or encoded JPEG data, which are used in the following embodiments, are defined by the communication network 50.
It is possible to read from another device or a storage device 503 on the communication network via the communication network 7. Also, encrypted JPEG
The data can be sent to another device via the storage device 503 or the communication network 507.
Further, the storage device 503 and the communication control device 50
If there is a device which is not related to the input / output of the direct data or the program out of 6, the device can be removed from the configuration of FIG.
The decryption device for JPEG data encrypted by the device of FIG. 5 is realized by the example of the device as shown in FIG. 6, the same reference numerals as those in FIG. 5 are the same as those described above. The still image data decoding device 603 in FIG. 6 is an input device 60 such as a mouse or a keyboard.
1, a display device 602 such as a display, a CPU 50
1, bus 502, storage device 503, main storage device 505,
The communication control device 506 is provided. In this device, the above-mentioned constituent elements are connected to the bus 5 so that information can be transmitted to each other.
Connected at 02. Further, the still image data decoding device 603 is assumed to be capable of transmitting and receiving data and programs to and from other devices connected to the communication network 507 using the communication network 507 such as a telephone line and LAN.
A storage device 503, a main storage 505, a communication control device 506, an input device 601, and a display device 602.
Are controlled by control and data sent via the CPU 501 according to a program executed by the still image data decoding device 603.
A program for decoding JPEG data obtained by encrypting still image data, which is used in the following embodiments,
The target encrypted JPEG data is stored in the storage device 50.
3 or another device on the communication network via the communication network 507. When the user inputs a key code or the like to decrypt the encrypted data, the user can input the key code using the input device 601. When the key code is not input from the input device 601, the input device 601 may be removed from the configuration of the still image data decoding device 603. Also, when the key code is in another device on the communication network via the communication network 507, it can be read from that device and used for decryption. Then, the non-encoded still image data decoded by the still image data decoding device 603 is sent to the display device 602 or another device via the storage device 503 or the communication network 507, or the display device 602. Can be displayed.
In this configuration, if there is a device that is not related to direct input / output of data or programs among the storage device 503 and the communication control device 506, that device can be removed from the configuration of FIG.
Next, in the embodiment, the still image data encryption method realized by the program running on the above-mentioned apparatus will be described in detail.
A first embodiment of an image data encryption method according to the present invention will be described with reference to the flowcharts of FIGS. 1, 7 and 9. In the first embodiment, a method for encoding unencoded image data into encrypted sequential JPEG data and a method for decoding the encrypted JPEG data will be described.
In this embodiment, first, the image data is converted into the image data shown in FIG.
Similar to the JPEG encoding procedure of, the image is divided into blocks of 8 × 8 pixels, and DCT (Discrete Cos
ineTransform: Performs discrete cosine transform (step 1
Next, each DCT coefficient block DCTed for each block is quantized (step 102). At this time, any quantization table can be used.
Next, a Huffman table for Huffman coding the quantized DCT coefficient block group is created (step 103). The quantized DCT coefficient block is composed of one DC component representing the DC component of the image and 63 AC components representing the AC component.
The Huffman coding of the DC component takes the difference from the DC component of the DCT coefficient block that was previously Huffman coded, assigns the Huffman code to the category representing the magnitude of the difference, and performs the Huffman coding. To do.
Huffman coding of the AC component is performed by the AC component 6
The Huffman code is assigned to the combination of the run length of 0 of the coefficient and the two pieces of information of the category indicating the size of the coefficient, with the three coefficients arranged in one column in a specific array. The AC component run length 0 and category 0 Huffman code have a special meaning, and indicate that the Huffman code for the block has ended. Hereafter, this Huffman code is referred to as EOB (End Of Blo
ck). The Huffman code may have additional bits for both the DC component and the AC component. In this step, the Huffman table is created so that the Huffman code exists for all cases of the quantized DCT coefficient block to be encoded. Here, when the Huffman table is created, the frequency of the Huffman code generation element is taken as a histogram, the shortest Huffman code is assigned to the element that occurs the most, and the Huffman code is not assigned to the element that never occurs. Such optimization of the Huffman table is desirable. Further, when there are a plurality of Huffman codes with the same code length, it is desirable that the decoded values of the Huffman code for the Huffman code be arranged randomly. For example, if there are three Huffman codes of 3-bit length of DC component, "010", "011", and "100", the category corresponding to the code is, for example, "010" = category 2, "011" = Category 3, "100" = The decoding value is not random according to the ascending order like "Category 1" but ascending order.
Next, the quantized DCT coefficient block is Huffman-coded based on the created Huffman table,
It is output as JPEG data (step 104).
Next, the Huffman table is encrypted and the JP
It is inserted into the EG data (step 105). Any method can be used for this encryption. For example, the bits and bytes are exchanged according to a certain law, the data is encoded arbitrarily, addition and subtraction are performed, and these are combined.
Also, a specific key code may be required for decryption. Instead of outputting this encrypted Huffman table with a DHT (Define Huffman Table: table number, code length, code symbol) marker, a marker that can be used for application extension of JPEG, such as APP1
(Reserved for Application Segments: Can be freely used by applications) It is possible to output to JPEG data together with a marker. At this time, an identifier indicating that this JPEG data is encrypted, for example, a unique identifier such as "Huffman Table Coded" may be inserted after the APP1 marker. A Huffman table is encrypted behind it.
Also, this Huffman table itself is
The JPEG data may not be included in the JPEG data as a decryption key code, and only the APP1 marker and the identifier indicating that the data is encrypted may be included in the JPEG data.
In that case, if the key code of the Huffman table is used for decryption, the decryption can be performed.
Finally, a dummy Huffman table and a dummy EOI (EOI: end of the entire image) marker are inserted into the JPEG data (step 106). The dummy Huffman table is, for example, a Huffman table,
EOB (EO) that indicates that the category 0 is associated with both the 1-bit Huffman code "0" and "1" of the DC component and that the end of the block is represented by both the 1-bit Huffman code "0" and "1" of the AC component
B: End of Block end code) is made to correspond. This dummy Huffman table is used, for example, in SOS (SOS: Start of
Scan Start) Insert before the marker. Also,
The insertion position of the dummy EOI marker is determined by the dummy Huffman table.
For example, using the dummy Huffman table described above, it can be seen that the decoding of one DCT coefficient block is uniquely 2 bits. Then, for example, 640
When encoding a × 480 monochrome image, the DCT
Since the number of coefficient blocks is 80 × 60 = 4800,
2 bits x 4800 = 9600 bits = after the Huffman code starts at the location where the dummy EOI marker is inserted.
It can be seen that it is the 1200th byte.
JPE encrypted by the above processing procedure
G data can be obtained.
Further, in the flowchart of FIG. 1, non-encoded image data is input, but when inputting JPEG data that has already been encoded, the same encryption is performed by the procedure shown in the flowchart of FIG. Can be converted.
In FIG. 7, the JPEG data to be input is JP
SO using the Huffman table included in the EG data
Huffman decoding is performed using the Huffman table included in the S marker part to decode up to the quantized DCT coefficient block group (step 701).
Then, the subsequent steps 103 to 1
06 performs the same processing as the description of the same reference numerals in FIG. By doing so, it is possible to obtain the JPEG data encrypted in the processing procedure of FIG.
JP created by the flow chart of FIG.
An example of EG data is shown in FIG. In this JPEG data, the SOI marker 8 indicating the start of the data is first
01 comes. Then, after that, DQT (Define Quantizatio) that indicates the definition of the quantization table is included in the data.
n Table) marker section 802, SOF0 marker section 803 for storing parameters such as image size at the time of compression, APP1 marker section 804 including the encrypted Huffman table, and DHT marker section 805 of the dummy Huffman table.
The marker parts after the SOI marker 801 may be in any order. After this, S including the Huffman code of the image
There is an OS marker section 806. This SOS marker section 806
A dummy EOI marker 807 is included in the middle of. Then, the EOI marker 808 comes at the end of the data. If the data size is defined in SOFO, etc., a dummy EOI
The marker 807 is unnecessary.
Next, the JP coded by the coding procedure of FIG.
FIG. 9 shows an example of a flowchart for decoding EG data.
First, the JPEG data is read, and if there is a marker indicating encryption, for example, the APP1 marker, it is confirmed whether or not there is an identifier indicating that the JPEG data following the marker is encrypted (step 90).
1). When there is no identifier, this marker part may be skipped and a normal JPEG decoding process may be performed. If there is an identifier, the following encrypted Huffman table is decompressed and read (step 902). In this case, if some key code is required for decompressing the code, the key code is separately input and decompression is performed. If a Huffman table is defined before this marker or is defined after this marker, that Huffman table is ignored.
Next, the Huffman code included in the SOS marker is Huffman-decoded based on the Huffman table obtained in step 602 to be decoded into a quantized DCT coefficient block group (step 903). At this time, even if an EOI marker appears in the Huffman code, it is ignored and decoding is performed.
Then, the decoded quantized DCT coefficient block group is inversely quantized based on the quantization table defined in the JPEG data and decoded into a DCT coefficient block group (step 904), and the DCT coefficient block is decoded. Each block of the group is subjected to IDCT (step 905) to be returned to the 8 × 8 pixel block group, and then decoded into one image data.
If decryption is performed in this way, the encrypted J
It is possible to decode PEG data.
A second embodiment of the image data encryption method according to the present invention will be described with reference to the flowcharts of FIGS. 11, 13 and 14. In the second embodiment, a method of encrypting JPEG data encoded in progressive format and a method of decrypting the encrypted JPEG data will be described.
Prior to the description of the second embodiment, an example of the data structure of JPEG data encoded in the progressive format will be briefly described with reference to FIG.
In FIG. 10, the first SOI marker 1001 represents the start of JPEG data, and the next D
The QT marker part 1002 represents the definition of the quantization table. The next SOF2 part marker part 1003 is a DCT.
Used when compressing with the progressive method using
The data following the SOF2 marker is the same as that for the SOF0 marker. Here, in the case of the sequential method, the data that follows is one or more Huffman tables,
An SOS marker portion including data obtained by Huffman coding a block group obtained by DCT / quantizing image data comes. However, in the case of the progressive method, since the quantized DCT coefficient block group is coded in several stages, the Huffman table and Huffman coded data are repeatedly included.
In the example of FIG. 10, since coding is performed in three stages, the DHT marker parts 1004, 1006 and 1008 that define the Huffman table.
And the SOS marker unit 100 including the Huffman code of the image
Three, 5, 1007 and 1009 are included alternately. In this example, the DHT marker part and the SOS marker part are alternated, but if the second and subsequent SOS marker parts use the Huffman table used before that,
The DHT marker part before the SOS marker part can be omitted. When these SOS marker parts are sequentially decoded from the beginning of the data, rough image data can be decoded first, and detailed image data can be displayed sequentially as the decoding progresses. At the end of the JPEG data, EO is used as a marker indicating the end of the JPEG data.
The I marker 1010 is attached.
A processing procedure for encoding the JPEG data encoded by the progressive method as in the example of FIG. 10 while encrypting it will be described with reference to the flowchart of FIG.
First, as in the case of the normal encoding of FIG. 2, the image data to be encoded is divided into blocks of 8 × 8 pixels, and DCT is performed for each block (step 1).
101). Then, each DCT coefficient block subjected to DCT for each block is quantized (step 1102). At this time, any quantization table can be used.
Then, Huffman coding is performed next. As described above, in the progressive method, coding is performed in several stages. First, Huffman coding in the first stage is performed (step 1103). At this time, the Huffman table used in this Huffman coding is JPEG.
Must be inserted in the data. As the Huffman table used here, it is desirable to use an optimized table so that the amount of encoded data is minimized for each data to be encoded. Note that the Huffman coding is sequentially performed a plurality of times from a component having rough image quality to a component having fine image quality.
Then, when the Huffman coding is completed, it is judged from this point whether or not it is the point for encrypting the JPEG data described above (step 1104). Any method can be used for this determination. For example, when one SOS marker part is detected, the SOS marker part may be uniquely determined so as to be encrypted after that, or it may be determined randomly, or the data may be encoded step by step to determine the progress. . If the encryption is not started, the process returns to step 1103 and the Huffman coding of the next stage is performed. If you want to start encryption, step 11
Go to 05. Then, a dummy EOI marker is inserted after the previously encoded Huffman code (step 110).
Then, when performing the Huffman code in the next stage, first, the Huffman table for Huffman coding is encrypted and inserted into the JPEG data (step 1106). This encryption method can be the same as the method described in the first embodiment. A marker when inserting this encrypted Huffman code is a DHT marker,
It does not matter which marker is used for extending the application described in the first embodiment, such as the APP1 marker.
Then, based on the Huffman table,
Huffman coding of the current stage of the progressive method is performed (step 1107).
Then, it is judged whether or not all the data to be encoded has been Huffman-encoded, and if so, the process ends (step 1108). If not finished, Huffman coding of the next stage is performed.
By performing the processing in this way, it is possible to create encrypted progressive JPEG data.
In the flowchart of FIG. 11, non-encoded image data is input, but when JPEG data already encoded by the progressive system is input, the same procedure is followed as shown in the flowchart of FIG. Can be encrypted.
FIG. 1 shows the procedure for encrypting JPEG data encoded by the progressive method as shown in FIG.
3 will be used for the explanation. In this flowchart, it is assumed that the target data is sequentially scanned from the beginning and sequentially encrypted.
First, the JPEG data is scanned in order from the beginning to detect the SOS marker part (step 1
Then, after detecting one or more SOS marker portions, it is determined whether or not the subsequent data is encrypted from the data position (step 1302). This decision is
Any method can be used. For example, when one SOS marker part is detected, it is uniquely determined so that the SOS marker part will be encrypted later, or randomly determined, or the data is encoded step by step to determine the progress. If it is determined to encrypt, proceed to the next. If the encryption is not performed, the detection of the SOS marker portion is resumed.
In the case of encryption, a 2-byte dummy EOI marker is inserted at the end of the last detected SOS marker part (step 1303).
Next, the Huffman table of the DHT marker portion following the inserted dummy EOI marker is encrypted (step 1304). Any encryption method can be used. At that time, the DHT marker may be used as it is or may be replaced with another marker, for example, a marker such as the APP1 marker. If there is no DHT marker part and there is an SOS marker part, this process is ignored.
Next, the SOS marker portion following the DHT marker portion is detected (step 1305).
Next, a marker following the SOS marker part is searched, and if the marker is an EOI marker, the process ends (step 1306). If it is not the EOI marker, the process returns to step 1304.
By processing as shown in FIG. 13,
It is possible to obtain encrypted progressive JPEG data similar to the flowchart in FIG. here,
FIG. 12 shows an example of the progressive progressive JPEG data encrypted by the flowchart of FIG. 11 or FIG.
In FIG. 12, the same reference numerals as those of the JPEG data structure example of FIG. 10 are the same as the description of the same reference numerals of FIG.
In FIG. 12, the EOI marker 1201
Is the dummy EOI marker described with reference to FIGS. 11 and 13. Further, the APP1 marker 1202 and the APP1 marker 1203 include the encrypted Huffman table described with reference to FIGS. 11 and 13.
Next, FIG. 14 shows a flowchart for decoding progressive JPEG data having the data structure shown in FIG. 12, which is encrypted by the processing procedure shown in FIG. 11 or 13.
First, the encrypted progressive J
The PEG data is read, the necessary Huffman table is read, and Huffman decoding in the first stage is performed (step 1401).
Then, when the Huffman decoding is completed, the mark following the SOS marker portion is determined (step 1402). If the mark is not the EOI mark,
Returning to step 1401, the Huffman decoding of the next stage is performed. If it is an EOI mark, it is determined whether all Huffman codes have been decoded (step 1403). This can be easily determined by checking whether the quantized DCT coefficient block is completely decoded. If all the Huffman codes have not been decoded, the Huffman table is encrypted in the DHT marker section or APP0 marker section that follows, so the code is decrypted and the Huffman table is read (step 1
404). At this time, if a key code is required for decryption, enter the key code. If you can decompress later encrypted Huffman tables with the same key code,
The next time you come to this step, you do not need to enter the key code. Then, using this decompressed Huffman table, the Huffman code at the stage is decoded (step 140).
5) and returns to step 1403. In step 1403,
When all the quantized DCT coefficient block groups are prepared, the quantized DCT coefficient block groups are inversely quantized (step 14
06), further IDCT (step 140)
7), non-encoded image data can be obtained.
A third embodiment of the image data encryption method according to the present invention will be described with reference to the flowcharts of FIGS. 15, 18 and 19. In the third embodiment, a method for encrypting JPEG data and a method for decrypting the encrypted JPEG data will be described.
Hereinafter, using the flowchart of FIG. 15,
A procedure for encoding non-encoded image data into encrypted JPEG data will be described.
In this embodiment, first, in addition to the image data to be encoded, the image data to be inserted into the image data for encryption is prepared. Hereinafter, the image data to be encoded will be referred to as original image data, and the image data to be inserted will be referred to as insertion data. Although there may be a plurality of pieces of insertion data, this embodiment will be described assuming that only one piece of insertion data is used.
FIG. 16 shows an example of original image data and an example of inserted image data. In FIG. 16, 1601 is original image data and 1602 is insertion data. The number of pixels of this insertion data may be independent of the size of the data to be encoded. However, it is desirable that the number of vertical and horizontal pixels is a multiple of 8. Any image can be used as the image included in this insertion data. For example, patterns such as sandstorms, marks or letters may be written. However, for example, in the case of an image of a mark or a character, it is desirable to take an intermediate value of the values that the background of the mark or character can have. For example, the value that one pixel can take is from 0 to 25
When it is 5, the value of the background pixel is preferably 128. There is no problem whether this image is a color image or a grayscale image.
The procedure of inserting the insertion data 1602 into the original image data 1601 and encrypting it will be described below with reference to the flowchart of FIG.
In the flowchart of FIG. 15, first, the uncoded original image data is divided into 8 × 8 pixel blocks, and DCT is performed on each block to perform DCT.
A coefficient block group is formed (step 1501). Then D
The CT coefficient block group is quantized using an arbitrary quantization table (step 1502).
Separately from the DCT and quantization of the original image data, the insertion data is divided into 8 × 8 pixel blocks and DCT is performed on each block to form a DCT coefficient block group (step 1503). Next, the DCT coefficient block group subjected to DCT in step 1503 is quantized into a quantized DCT coefficient block group (step 150
4). The quantization table used here is step 150.
The quantization table used in 2 must be used.
The steps 1503 and 1504 may be performed before the steps 1501 and 1502.
Next, the quantized DCT coefficient block group of the insertion data and the quantized DCT coefficient block group of the original image data are added together (step 1505).
Here, the processing of this step will be described in detail with reference to FIG.
In FIG. 17, the original image data 160 of FIG.
It is assumed that 1 is 40 pixels in the horizontal direction and 32 pixels in the vertical direction and the insertion data 1602 is 24 pixels in the horizontal direction and 16 pixels in the vertical direction, and the insertion data is inserted into the original image data as an example.
In FIG. 17, since the original image data 1701 has 40 pixels in the horizontal direction and 32 pixels in the vertical direction, if it is divided into blocks of 8 × 8 pixels, it can be divided into blocks of 5 × 4 pixels in the horizontal direction as shown in the figure. Similarly, insert data 1702
Can also be divided into horizontal 3 × vertical 2 pixel blocks as shown. Each of the divided 8 × 8 pixel blocks is D by steps 1501, 1502, 1503, 1504.
The result of CT and quantization is schematically shown as a quantized DCT coefficient block group 1703 of original image data,
It is a quantized DCT coefficient block group 1704 of insertion data. One of the first cells in this quantized DCT coefficient block group
One represents a quantized DCT coefficient block, and the position thereof corresponds to the 8 × 8 pixel block of the image before DCT / quantization. The addition of the quantized DCT coefficient blocks in this step means, for example, the quantized DCT coefficient block group 1703 having a quantized DCT coefficient block group 1703 and the quantized DCT coefficient block group 1704 having a quantized DCT coefficient block group 1704. The DCT coefficient blocks are added together. The quantized DCT coefficient block has 64 coefficients. Adding the quantized DCT coefficient blocks to each other means adding the coefficients at the same position among the 64 coefficients. Similarly, b and b ', c and c', d and d ', e and e', and f and f'are added. The result is a quantized DCT coefficient block group 1705. This is the processing of this step.
The position where the DCT coefficient block group of the insertion data is inserted can be arbitrarily set. However, it is desirable that the pixel position of the insertion point is a multiple of 8 in each of the vertical and horizontal directions. Also,
The image to be inserted is not limited to one place, and can be inserted in any number of places.
Then, the quantized DCT coefficient block after the addition is Huffman coded (step 1506), and J
Use PEG data. At this time, the Huffman table used for coding is such that all the Huffman coding elements can be coded even if it is the table created at the time of Huffman coding so that all the quantized DCT coefficient blocks can be coded. It may be a table created in advance with Huffman codes.
Furthermore, an identifier indicating the encryption, the location of the inserted image, or the number of inserted images, the information necessary for decrypting the encrypted JPEG data such as the inserted image data, etc. are added to the application extension of the JPEG data. Can be inserted with the marker. However, if such information is implicitly known to the decoder, it may be omitted.
By doing this, J encrypted
PEG data can be created.
In the flow chart of FIG. 15, non-encoded image data is input, but it is already encoded.
Even when PEG data is input, it can be encrypted in the same manner as shown in the flowchart of FIG.
In FIG. 18, the input JPEG data is J
Using the Huffman table included in the PEG data, S
Huffman decoding is performed using the Huffman table included in the OS marker part, and the quantized DCT coefficient block group is also decoded (step 1801). Then, subsequent steps 1503 to 1306 perform the same processing as the description of the same reference numerals in FIG. By doing so, it is possible to obtain the JPEG data encrypted in the processing procedure of FIG. However, the quantization table used in this step 1504 is
The quantization table included in the JPEG data must be used.
Next, FIG. 19 shows a flowchart of a decoder for JPEG data encrypted based on the flowchart of FIG. Before starting the decryption, the encrypted JP
If the insert data is not included in the EG data, it is necessary to prepare the insert data separately. The flow of the decoding procedure will be described below.
First, the Huffman code of the JPEG data is decoded by using the Huffman table included in the JPEG data to form a quantized DCT coefficient block group (step 1901).
Next, the inserted data is divided into 8 × 8 pixel blocks, and DCT is performed on each block to form a DCT coefficient block group (step 1902).
Next, the DCT coefficient block group subjected to DCT in step 1902 is quantized into a quantized DCT coefficient block group (step 1903). The quantization table used here must be the quantization table included in the JPEG data. The steps 1902 and 1903 may be performed in advance before the step 1901.
Then, the quantized DCT coefficient block groups formed in step 1903 are subtracted from the quantized DCT coefficient block groups formed in step 1901 (step 1904). The places and numbers to be subtracted are JPEG
Follow the data if it contains that information, and if implicitly determined.
Next, using the quantization table included in the JPEG data, the quantized DCT coefficient block group is inversely quantized into a DCT coefficient block group (step 190).
Then, the DCT coefficient block group is ID
CT is performed (step 1906).
Decoding can be performed by collecting 8 × 8 pixel data after IDCT into image data.
By doing this, J encrypted
PEG data can be decrypted.
As described above, according to the image coded data creation method of the present invention, the so-called JPEG data itself is encrypted in consideration of the irreversibility of the JPEG data in which the image quality deteriorates when the encoding and decoding are repeated. It is possible to minimize the image quality deterioration from the original image because the Huffman table used when creating the JPEG data is encrypted instead of being encrypted. Further, since the Huffman table to be encrypted is subjected to the optimization processing, the encryption cannot be decrypted without the data of the original image, and the protection of the encrypted JPEG data is guaranteed.
Further, in the image coded data creation method of the present invention, the time required for decryption is encrypted even though the Huffman table, which has a smaller amount of data, is encrypted as compared with JPEG data. Is not encrypted JP
The time required for decoding EG data is almost the same, and the decoding speed can be increased.
According to the present invention, coded data of an image coded by DCT, quantization and Huffman coding can be easily encrypted at high speed without deterioration of image quality.
Further, the encrypted data reproduces some kind of image without error if it is subjected to normal decryption. For example, the JP encrypted in the first embodiment
As for the EG data, when the above-mentioned dummy Huffman table is used, it is possible to display a monochromatic image whose size does not change from that of the original image. Further, for example, the JPE encrypted in the second embodiment
The G data can display an image in which a fine portion of the image is blurred. Further, for example, the JPEG data encrypted in the third embodiment can be displayed as an image in which the image of the insertion data is combined with the original image. In particular, when the inserted data is an image of a mark or a character and the background color is an intermediate color, the mark or the character is displayed so that the background can be seen through the image of the original image data as shown in FIG. The image looks like a combination of.
FIG. 1 is a diagram showing a flowchart of a first embodiment of image data whose input is uncoded.
FIG. 2 is a diagram showing an example of a JPEG encoding procedure.
FIG. 3 is a diagram showing a JPEG data structure example of a sequential system.
FIG. 4 is a diagram showing an example of a JPEG decoding procedure.
[Fig. 5] Still image data encryption device configuration diagram
FIG. 6 is a block diagram of a still image data decoding device.
FIG. 7 is a diagram showing an encrypted JPEG data decryption flowchart of the first embodiment.
FIG. 8 is a configuration diagram of encrypted JPEG data according to the first embodiment.
FIG. 9 is a diagram showing a flowchart of the first embodiment in which JPEG data is input.
FIG. 10 is a diagram of a progressive JPEG data structure.
FIG. 11 is a diagram showing a flowchart of a second embodiment of image data whose input is uncoded.
FIG. 12 is an encrypted JPEG data configuration diagram of the second embodiment.
FIG. 13 is a diagram showing a flowchart of a second embodiment in which JPEG data is input.
FIG. 14 is a diagram showing an encrypted JPEG data decryption flowchart of the second embodiment.
FIG. 15 is a diagram showing a flowchart of a third embodiment of image data whose input is uncoded.
FIG. 16 is a diagram showing an example of original image data and insertion data.
FIG. 17 is a diagram showing an example of quantized DCT coefficient block addition.
FIG. 18 is a diagram showing a flowchart of a third embodiment in which JPEG data is input.
FIG. 19 is a diagram showing an encrypted JPEG data decryption flowchart of the third embodiment.
FIG. 20 is a diagram showing an example of encrypted JPEG data display according to the third embodiment.
501 ... CPU 502 ... Bus 503 ... Storage device 505 ... Main memory 506 ... Communication control device 507 ... Communication network 508 ... Still image data encryption device 601 ... Input Device 602 ... Display device 603 ... Still image data decoding device 1601 ... Original image data 1602 ... Inserted data 1701 ... Original image data 1702 ... Inserted data 1703 ... Original image data Quantized DCT coefficient block group 1704 ... Quantized DCT coefficient block group 1705 for inserted data ... Quantized DCT coefficient block group after addition
─────────────────────────────────────────────────── ─── Continuation of the front page (72) Inventor Akio Hayashi 810 Shimoimaizumi, Ebina City, Kanagawa Hitachi Office Systems Division (56) Reference JP-A-7-264546 (JP, A) JP-A 6-90451 (JP, A) JP-A-7-274166 (JP, A) Noboru Katsuta, Shin Ibaraki, Seiji Nakamura, Hironori Murakami, "One Method of Digital Scramble Suitable for Compressed Images", IEICE Technical Research Report, Japan, The Institute of Electronics, Information and Communication Engineers, December 1992, IEC92-59, pp. 19-28 (58) Fields investigated (Int.Cl. 7 , DB name) H04N 7/ 24-7/68 H04N 1/41
The image coded data generated by generating the image coded data, which includes the quantization table and the Huffman table, is Huffman-decoded by using the Huffman coded result data and the Huffman table to perform the Huffman decoding. A quantized discrete cosine transform coefficient block group of one image data is obtained, the second image data having a plurality of pixels in the vertical and horizontal directions is divided into blocks of the predetermined number of pixels in the vertical and horizontal directions, and the divided blocks are discretely divided. Cosine transform coefficient block group is obtained by performing dynamic cosine transform, and the discrete cosine transform coefficient block group of the second image data is quantized using the quantization table included in the image coded data. , A quantized discrete cosine transform coefficient block group is obtained, and the quantized discrete cosine transform of the second image data is calculated. A coefficient block group is added to the quantized discrete cosine transform coefficient block group obtained from the first image data included in the image coded data in block units, and the added quantized discrete cosine transform is added. Huffman coding a coefficient block group using the Huffman table included in the image coded data, the Huffman coding result data, the second image data, the quantization table, and the Huffman table An image coded data creation method characterized by collectively generating new image coded data.
Priority Applications (1)
|Application Number||Priority Date||Filing Date||Title|
|JP25826496A JP3478019B2 (en)||1996-09-30||1996-09-30||Image encoded data creation method and image encoded data decoding method|
Applications Claiming Priority (1)
|Application Number||Priority Date||Filing Date||Title|
|JP25826496A JP3478019B2 (en)||1996-09-30||1996-09-30||Image encoded data creation method and image encoded data decoding method|
|Publication Number||Publication Date|
|JPH10108180A JPH10108180A (en)||1998-04-24|
|JP3478019B2 true JP3478019B2 (en)||2003-12-10|
Family Applications (1)
|Application Number||Title||Priority Date||Filing Date|
|JP25826496A Expired - Fee Related JP3478019B2 (en)||1996-09-30||1996-09-30||Image encoded data creation method and image encoded data decoding method|
Country Status (1)
|JP (1)||JP3478019B2 (en)|
Families Citing this family (9)
|Publication number||Priority date||Publication date||Assignee||Title|
|JP3813387B2 (en)||1998-07-28||2006-08-23||富士写真フイルム株式会社||Information embedding method and apparatus, and recording medium|
|US6785814B1 (en)||1998-07-28||2004-08-31||Fuji Photo Film Co., Ltd||Information embedding method and apparatus|
|JP2000059771A (en)||1998-08-04||2000-02-25||Hitachi Ltd||Image-pickup device and image data utilizing system|
|US6239818B1 (en)||1998-08-28||2001-05-29||Fuji Photo Film Co., Ltd.||Printing method and apparatus|
|JP3772604B2 (en)||1999-10-04||2006-05-10||株式会社日立製作所||Monitoring system|
|JP2001211310A (en)||2000-01-27||2001-08-03||Hitachi Ltd||Image data operating method and recording medium having recorded processing program thereof|
|JP4703460B2 (en) *||2006-03-29||2011-06-15||パナソニック株式会社||Progressive JPEG playback device|
|JP4932452B2 (en) *||2006-11-24||2012-05-16||三菱電機株式会社||Data conversion apparatus, data conversion method, and program|
|JP2014131197A (en) *||2012-12-28||2014-07-10||Axell Corp||Content data processing method, content server, client terminal, and content distribution system|
- 1996-09-30 JP JP25826496A patent/JP3478019B2/en not_active Expired - Fee Related
Non-Patent Citations (1)
Also Published As
|Publication number||Publication date|
|US9098724B2 (en)||Digital video protection for authenticity verification|
|Lee et al.||High-payload image hiding with quality recovery using tri-way pixel-value differencing|
|Zhang||Separable reversible data hiding in encrypted image|
|JP5579760B2 (en)||Method and apparatus for coding the location of coefficients|
|Holliman et al.||Counterfeiting attacks on oblivious block-wise independent invisible watermarking schemes|
|Hartung et al.||Digital watermarking of raw and compressed video|
|EP0648055B1 (en)||Scrambling system, scrambling apparatus and descrambling apparatus|
|Hsu et al.||DCT-based watermarking for video|
|US7620253B2 (en)||Steganographic systems and methods|
|US8046841B2 (en)||Steganographic method and device|
|Lin et al.||Issues and solutions for authenticating MPEG video|
|KR100770963B1 (en)||Hierarchical authentication system for images and video|
|DE69922453T2 (en)||Image processing apparatus, image processing techniques and manufacturing media|
|US5945930A (en)||Data processing apparatus|
|JP3109575B2 (en)||Image data processing device|
|Chae et al.||Data hiding in video|
|US7221802B2 (en)||Method and device for secure transmission of JPEG encoded images|
|JP3768705B2 (en)||Digital watermark embedding device, output control device, and computer-readable storage medium|
|DE602004003067T2 (en)||Method for encrypting a fault tolerance compressed audio or video power|
|Qian et al.||Separable reversible data hiding in encrypted JPEG bitstreams|
|Busch et al.||Digital watermarking: From concepts to real-time video applications|
|US5809139A (en)||Watermarking method and apparatus for compressed digital video|
|Chuman et al.||Encryption-then-compression systems using grayscale-based image encryption for JPEG images|
|Hartung et al.||Watermarking of uncompressed and compressed video|
|JP4669187B2 (en)||Method for embedding a watermark in a compressed image, method for recovering a watermark from a compressed image, and recording medium|
|LAPS||Cancellation because of no payment of annual fees|