Patent Publication Number: US-8983219-B2

Title: Image processing apparatus and control method therefor

Description:
BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     The present invention relates to an image data coding technique. 
     2. Description of the Related Art 
     In image transmission, an image compression rate control function of flexibly changing image data amount draws attention. This function enables change of code amount of compressed image data (encoded image data) without decoding and facilitates change of data amount in accordance with bandwidth of network to transmit the encoded image data. As an image compression method having this function, JPEG 2000 and the like are known. 
     Since JEPG (also referred to herein as “JPEG” or “JPG”) encoded data or the like has no rate control function, in some cases, the data is decoded once, then converted to encoded data having the rate control function such as JEPG 2000 data, thereby re-encoding is valid. For example, as a technique for setting a code amount and performing re-encoding, Japanese Patent Laid-Open No. 2007-166492 is known. 
     For example, in a comparison between JPEG coding to perform coding in 8×8 pixel units and JPEG 2000 coding to perform coding using a wider range as a unit, JPEG 2000 has a higher capability or probability of elimination of image information redundancy with a wider range. 
     SUMMARY OF THE INVENTION 
     The present invention has been made in view of the above situation. The present invention provides a technique for re-encoding encoded data, encoded by pixel block having a predetermined number of pixels as a unit, while suppressing degradation of image quality, with further high compressibility. 
     To solve the above problem, according to an aspect of the invention, there is provided an image processing apparatus which re-encodes encoded data, encoded in accordance with a first coding algorithm, with a pixel block having a predetermined number of pixels as a unit, comprising: an input unit to input encoded data as a re-encoding subject; a second encoder, based on a second coding algorithm, to perform coding with a block in a larger size than the pixel block as a unit; a target code amount calculation unit to calculate a target code amount with respect to the second encoder, from a code amount obtained by encoding the encoded data inputted by the input unit in accordance with a third coding algorithm; and a controller to decode the encoded data inputted by the input unit, control the second encoder, to generate encoded data in the target code amount. 
     According to the present invention, it is possible to re-encode encoded data, encoded by pixel block having a predetermined number of pixels as a coding unit, while suppressing degradation of image quality, with further high compressibility. 
     Further features of the present invention will become apparent from the following description of exemplary embodiments (with reference to the attached drawings). 
    
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         FIG. 1  is a block diagram of an image processing unit in a first embodiment of the present invention; 
         FIG. 2  is a block diagram of a redundancy estimation unit  102  in the first embodiment; 
         FIGS. 3A to 3C  are explanatory diagrams of redundancy which occurs in JPEG encoded data; 
         FIG. 4  is a block diagram of a JPEG 2000 coding apparatus; 
         FIG. 5  is an explanatory diagram of Discrete Wavelet transformation; 
         FIGS. 6A to 6C  are explanatory diagrams of the Discrete Wavelet transformation; 
         FIG. 7  is an explanatory diagram of code block division; 
         FIG. 8  is an explanatory diagram of the Discrete Wavelet transformation; 
         FIG. 9  is a table showing the numbers of pixels required in the Discrete Wavelet transformation; 
         FIG. 10  is a flowchart showing dictionary-based coding; 
         FIGS. 11A and 11B  are examples of a processing subject data stream in the dictionary-based coding and a dictionary memory; 
         FIG. 12  is an explanatory diagram showing the flow of the dictionary-based coding processing; 
         FIGS. 13A and 13B  are explanatory diagrams of redundancy which occurs in dictionary-based encoded data; 
         FIGS. 14A and 14B  are flowcharts showing the dictionary-based coding in the first embodiment; 
         FIGS. 15A and 15B  are examples of the processing subject data stream and the dictionary memory in the progress of the dictionary-based coding; 
         FIG. 16  is a block diagram of the image processing unit in a second embodiment of the present invention; 
         FIG. 17  is a block diagram of a redundancy estimation unit  1601  in the second embodiment; 
         FIG. 18  is a flowchart showing the processing by the redundancy estimation unit  1601  in the second embodiment; 
         FIGS. 19A and 19B  are explanatory diagrams of continuous cycle information in the second embodiment; 
         FIGS. 20A to 20C  are explanatory diagrams of a method for redundancy measurement from a decompressed image in another embodiment of the present invention; 
         FIG. 21  is an explanatory diagram of a problem which occurs upon recompression; 
         FIG. 22  is an explanatory diagram of an image used in PSNR calculation; and 
         FIG. 23  is an explanatory diagram of code amount upon compression of JPEG encoded data by the dictionary-based coding. 
     
    
    
     DESCRIPTION OF THE EMBODIMENTS 
     Preferred embodiments of the present invention will now be described in detail in accordance with the accompanying drawings. 
     The embodiments relate to problem and solution upon recompression. In the embodiments, the subject of re-encoding is JPEG-encoded image data (JPEG encoded data), and recompression processing is performed on the data in accordance with the JPEG 2000 method. 
       FIG. 21  is a graph tracing the result of JPEG coding with some quantization parameter with respect to an input image (1 point) and the result of recompression test with several parameters related to JPEG 2000 compressibility with respect to a decoded image from the JPEG encoded data. Note that  FIG. 22  shows the outline of the recompression processing. Upon PSNR measurement in JPEG 2000, as the image quality viewed from, not a JPEG decompressed image but an original image is significant, the original image subjected to the JPEG compression is used. As shown in  FIG. 21 , the image quality is not improved in accordance with increment of the code amount from a bit rate X (bpp). Since the subject of coding is the JPEG decompressed image, it is impossible to obtain image quality equal to or higher than that of the image. In other words, when JPEG 2000 coding is performed at the bit rate X, coding with higher compressibility can be performed without degradation of image quality. However, the bit rate X (bpp) cannot be accurately obtained. An image obtained from an input device or an image generated with editing software on a PC or the like can be compressed, however, in many cases, the original image of such image does not remain. For example, in a digital camera, an image obtained by image sensing is often compressed and stored, however, an image corresponding to an original image is not always stored. Accordingly, it is often impossible to obtain the least code amount to maintain the image quality of the decompressed image. 
     In the present embodiment, as shown in  FIG. 23 , JPEG encoded data is subjected to lossless compression by dictionary-based coding. Then, as a result, the obtained code amount is used as a target code amount (target bit rate X) upon recompression. 
     First, the ground for reduction of code amount by JPEG coding without degradation of image quality by use of the JPEG 2000 method will be described. Then, the adequacy of application of the dictionary-based coding to JPEG encoded data and setting of generated code amount as a target code amount upon recompression will be described. 
     According to the JPEG coding method (ISO/IEC IS 10918-1), as described in its recommendations, an input image is divided into 8×8 pixel sized blocks, and coding is performed approximately independently by each block. When an image  301  as shown in  FIG. 3A  having a flat luminance (or density) region or images  302  and  303  having 8×8 pixels/1 cycle dot region are inputted, the same code stream is generated from each block. As a result, redundancy due to repetition of the same code stream occurs in the encoded image data.  FIGS. 3B and 3C  show encoded image data of the corresponding regions when the image  301  having the flat region and the image  302  (or  303 ) having the dot region in  FIG. 3A  have been inputted. On the other hand, in the JPEG 2000 method, when the cycle of 8×8 pixel block as a unit exists in an image, redundancy due to cyclicity can be efficiently eliminated by coding on predetermined conditions. Accordingly, the occurrence of redundancy can be suppressed in comparison with the JPEG method. The conditions and grounds for the suppression of redundancy will be described based on the outline of the algorithm of the JPEG 2000 method. 
       FIG. 4  is a block diagram of a general JPEG 2000 coding apparatus. In  FIG. 4 , reference numeral  401  denotes an input unit;  402 , a Discrete Wavelet transforming unit;  403 , a quantizing unit;  404 , an entropy coding unit;  405 , a code stream generator; and  406 , an output unit. Image data is supplied from the input unit  401  to the Discrete Wavelet transforming unit  402 . As shown in  FIG. 5 , the Discrete Wavelet transforming unit  402  performs Discrete Wavelet transformation using plural pixels. Note that a frame data after the Discrete Wavelet transformation (Discrete Wavelet transformation coefficients) are calculated in accordance with the following expression.
 
 Y (2 n )= X (2 n )+floor{( Y (2 n− 1)+ Y (2 n+ 1)+2)/4}
 
 Y (2 n+ 1)= X (2 n+ 1)−floor{( X (2 n )+ X (2 n+ 2))/2}  (1)
 
     Note that Y(2n) and Y(2n+1) are Discrete Wavelet transformation coefficient sequences. The sequence Y(2n) is a low frequency sub band, and the sequence Y(2n+1), a high frequency sub band. Further, in the above transformation expression (1), “floor{X}” means a maximum integer value not exceeding X.  FIG. 5  schematically shows this Discrete Wavelet transformation. 
     The above-described transformation expression (1) is used with respect to one-dimensional data. Further, when this transformation is applied in horizontal direction then vertical direction to perform two-dimensional transformation, four sub bands, LL, HL, LH and HH as shown in  FIG. 6A  are obtained. Note that “L” indicates a low frequency sub band, and “H”, a high frequency sub band. Next, the Wavelet transformation is performed on the LL sub band and four sub bands are generated ( FIG. 6B ), and further, four sub bands are obtained from the LL sub bands among the generated sub bands ( FIG. 6C ). In this manner, total ten sub bands are generated. The ten sub bands are referred to as HH 1 , HL 1 , . . . , as shown in  FIG. 6C . Note that the names of the respective sub bands indicate the levels of the respective sub bands. That is, the sub bands HL 1 , HH 1  and LH 1  are level 1 sub bands. Further, the sub bands HL 2 , HH 2  and LH 2  are level 2 sub bands. The sub bands HL 3 , HH 3  and LH 3  are level 3 sub bands. Note that the LL sub band is a level 0 sub band. Further, since there is only one LL sub band, generally it has no suffix. Further, decoded image obtained by decoding the level 0 to level n sub bands is referred to as an “level n decoded image”. The resolution of the decoded image is higher in accordance with its level. The transformation coefficients of the ten sub bands are temporarily stored in a buffer  304 , and the sub bands LL, HL 1 , LH 1 , HH 1 , HL 2 , LH 2 , HH 2 , HL 3 , LH 3  and HH 3 , in this order, i.e., from the low level sub band to the high level sub band, are outputted to the coefficient quantizing unit  403 . Note that in the above-described example, the number of divisions (the number of applications of the Wavelet transformation) is “3”, however, the number is not limited to this number. 
     The coefficient quantizing unit  403  quantizes the transformation coefficients of the respective sub bands at a quantizing step determined by each frequency component, and outputs the quantized values (quantized coefficient values) to the entropy coding unit  404 . As the subject matter of the present invention does not include the details of the quantizing method, the explanation of the details will be omitted. The quantized coefficients (quantized coefficient values) are outputted to the entropy coding unit  404 . 
     The entropy coding unit  404  entropy-encodes the input quantized coefficient values. In this example, first, as shown in  FIG. 7 , the respective sub bands as sets of the input quantized coefficient values are divided in rectangular blocks (code blocks). In the present embodiment, the size of the code block is 16×16. Next, the coefficients in the code block are divided into bit planes, and binary arithmetic coding is performed sequentially from a higher-order bit plane toward a lower-order bit plane, to generate entropy-encoded data. The JPEG 2000 coding algorithm is as described above. 
     Next, the above-described elimination of redundancy in an image having an 8×8 pixel block (JPEG coding unit) cycle will be described. 
       FIG. 5  and the expression (1) are used for explanation of the Discrete Wavelet transformation. As a characteristic feature of the Discrete Wavelet transformation, when transformation is performed once in a one-dimensional direction, the numbers of coefficients of the low frequency components and high frequency components become the half of the number of pixels of the input image. When the transformation is performed twice, the numbers of coefficients of the low frequency components and high frequency components become ¼ of the number of pixels of the input image. When the transformation is performed thrice, the numbers of coefficients of the low frequency components and high frequency components become ⅛ of the number of pixels of the input image. That is, it is considered that when the Discrete Wavelet transformation is performed thrice, one coefficient is generated with respect to low frequency and high frequency components by 8 pixels of the input image. Further, since a decompressed image has an 8-pixel cycle, one coefficient is generated at each cycle. Further, as the respective coefficients are generated from the same cycle, the coefficients have the same value. That is, when the Discrete Wavelet transformation is performed thrice, the same value continues in the respective low frequency component and high frequency component sub bands, and a flat region appears in the sub bands. It is possible to perform very high efficient compression on the flat region by the binary arithmetic coding. The ground for redundancy elimination from the 8-pixel/1 cycle image in the JPEG 2000 coding is as described above. 
     Further, as described above, in the present embodiment, the binary arithmetic coding is performed by 16×16 sized code block. From the expression (1) and  FIG. 8 , the relation between the number of Discrete Wavelet transformations (n) and the number of pixels required for generation of high frequency and low frequency components obtained with the n-th transformation is as shown in  FIG. 9 . In  FIG. 9 , the numbers of pixels required for generation of 16 components in the low frequency and high frequency components obtained with the third Discrete Wavelet transformation are 149 pixels and 141 pixels. That is, the binary arithmetic coding performed with the 16×16 sized code block as a unit is approximately equivalent to coding in 141×141 pixel units with respect to high frequency components and coding in 149×149 pixel units with respect to low frequency components. In the JPEG coding, redundancy can be eliminated in a wider region in comparison with coding in 8×8 pixel units. 
     As described above, when an input image has an 8×8 pixel cycle, it is possible to efficiently eliminate redundancy by the JPEG 2000 coding in comparison with the JPEG coding. There are two grounds. One of the two grounds is that in the JPG 2000 coding, the 8×8 pixel cycle image is represented as a flat region. Then the region is compressed by the efficient entropy coding. The second ground is that the coding is performed with a wider region as a unit in comparison with the JPEG coding. 
     Next, the concept of the dictionary-based coding algorithm will be described. Further, the adequacy of application of the dictionary-based coding to JPEG encoded data and setting of generated code amount as a target code amount upon re-encoding will be described. 
     In digital data meaningful to some degree such as an image, an audio message, a document and the like, data values are not disorderly arrayed but alignment of very similar pattern often appears. That is, when data value alignment (data pattern) is found then a code shorter than the data value alignment is applied to the data value alignment and outputted, the information can be represented with a smaller data amount in comparison with that of an original. The data pattern and information to manage code values corresponding to the data pattern are generally referred to as a “dictionary”. The dictionary-based coding is performing coding while structuring a dictionary and referring to the dictionary. Hereinbelow, the outline of processing as an example of the dictionary-based coding algorithm will be described. 
     The flowchart of  FIG. 10  shows the processing procedure of dictionary-based coding application executed by a processor in an information processing apparatus. Further,  FIG. 11A  shows an example of data as a coding subject, and  FIG. 11B , an example of a dictionary memory. In  FIG. 10 , when the coding processing is started, the processor performs initialization (step S 1001 ). The initialization means input of processing subject data, allocation of the dictionary memory in a memory, and setting of a maximum coincident length. In this description, the processing subject data is as shown in  FIG. 11A , and the dictionary memory has, as shown in  FIG. 11B , a 4 byte capacity. Note that the 4 byte capacity is set for the sake of convenience of explanation, and it can be arbitrarily changed in accordance with embodiment. The maximum coincident length is a maximum value of same data pattern length (coincident length) allowed in the coding processing. In the present dictionary-based coding, the maximum coincident length is required since a coincident length is represented with a fixed length. Next, a coincident data pattern is retrieved from the dictionary memory (step S 1002 ). At this time, when the coincident length is an upper limit value, the retrieval is stopped at that time. Further, when there are plural coincident data patterns, all of them are obtained. When there is no coincident data pattern (No at step S 1003 ), “0” is outputted as information (flag) indicating presence/absence of coincident pattern (step S 1004 ). Then one character is Huffman-encoded and outputted (step S 1005 ). Then the process proceeds to step S 1008 . On the other hand, when a coincident data pattern has been found (Yes at step S 1003 ), “1” is outputted as the flag (step S 1006 ). Then, among the retrieved data patterns, the location and length of a data pattern having the maximum coincident length in the dictionary (point information) is obtained and outputted (step S 1007 ). Next, the processed data stream is added to the end of the dictionary (step S 1008 ). When the data length after the addition of the processed data stream exceeds the data length of the dictionary, its head part is eliminated such that the data is stored in the dictionary memory. Then, it is determined whether or not data to be processed remains (step S 1009 ). When no data remains (No at step S 1009 ), the process ends. On the other hand, data to be processed remains (Yes at step S 1009 ), the process returns to step S 1002 .  FIG. 12  shows an example using particular data. 
     As described above, the dictionary-based coding eliminates redundancy due to data pattern repetition. Accordingly, it can be understood that when the method is applied to JPEG encoded data, redundancy in JPEG encoded data due to redundancy in an image as shown in  FIGS. 3B and 3C  can be eliminated. However, to use the code amount obtained by applying the dictionary-based coding to JPEG encoded data as a target code amount upon recompression, it is necessary to take the following one problem into consideration. In the JPEG 2000 coding, redundancy in an image is eliminated within a predetermined range, however, in the dictionary-based coding, spatial redundancy equal to or wider than the range is eliminated. More particularly, in the above description of the JPEG 2000 coding, redundancy can be eliminated in 149 pixel units regarding the low frequency components. However, in the dictionary-based coding, redundancy equal to or more than 149 pixels, when exists, is eliminated. That is, when recompression is performed with a code amount obtained by the dictionary-based coding as a target, essential information which influences the image quality other than the redundancy is eliminated by quantization. This problem is solved by encoding the range in which the redundancy can be eliminated by the JPEG 2000 coding and resetting the dictionary memory after the coding. However, in the JPEG coding, since each 8×8 pixel block is variable-length encoded, it is impossible to obtain the number of 8×8 pixel blocks included at one cycle of repetition in the JPEG encoded data. As an example, a case where one 8×8 pixel block exists at one cycle and a case where eight 8×8 pixel blocks exist at one cycle are given. Accordingly, it is impossible to derive the number of cycles corresponding to 149 pixels. Since it is necessary to avoid unnecessary elimination of redundancy, in the embodiments, it is assumed that the number of 8×8 pixel blocks included in one cycle is four. That is, the number of pixels included in one cycle is thirty-two, the maximum number of cycles not exceeding 149 pixels is four. When four same cycles continuing in the process of the dictionary-based coding are detected, the dictionary memory is reset. 
     Note that in JPEG encoded data, encoded 8×8 pixel block data are arrayed in the raster scan order, and the dictionary-based coding is sequentially performed from the head of the JPEG encoded data toward the end of the data. Accordingly, redundancy cannot be eliminated in two dimensional directions. The amount of redundancy which can be eliminated is smaller than that in the JPEG 2000 coding. However, the difference of the number of dimensions in the range of redundancy deletion is not a serious problem to attain the purpose of the present invention, to obtain a “rough standard” of the target code amount upon re-encoding. 
     First Embodiment 
     Hereinbelow, the embodiments of the present invention will be described in detail based on the above description. 
       FIG. 1  is a block diagram of an image processing apparatus in a first embodiment of the present invention. In  FIG. 1 , numeral  101  denotes an encoded-image-data input unit;  102 , a redundancy estimation unit which functions as a target code amount calculation unit;  103 , a decompressor;  104 , a recompressor; and  105 , an output unit. In  FIG. 1 , the encoded-image-data input unit  101  inputs JPEG encoded data, and outputs the input JPEG encoded data to the redundancy estimation unit  102 . In the redundancy estimation unit  102 , the maximum number of redundancy-deletable pixels is 149 pixels as described above. Further, the number of blocks included in one cycle of repetition of code stream in JPEG encoded data is four. That is, when repetition of floor (149/(8*4))=4 has been detected, as it is not necessary to perform redundancy measurement, the dictionary memory is reset. 
       FIGS. 14A and 14B  are flowcharts showing the processing by the redundancy estimation unit  102 . The present processing flow is based on the above-described flowchart of  FIG. 10 . Further,  FIG. 2  is a block diagram of the redundancy estimation unit  102 . 
     In  FIGS. 2 ,  14 A and  14 B, when JPEG encoded data is inputted into an encoded-image-data input unit  201 , a controller  209  performs initialization (step S 1401 ). The initialization means input of processing subject data, allocation of the dictionary memory, setting of the maximum coincident length, and further, initialization of a counter  204  to count data pattern repetition. As the initialization of the counter  204 , “1” is set (count=1). In the present embodiment, as the dictionary memory, 1024 bytes, and as the maximum coincident length, two hundred fifty-six are set. Next, in a same character string detection unit  203 , a coincident data pattern is retrieved from the dictionary memory (step S 1402 ). At this time, when the coincident length is an upper limit value (256), the retrieval is stopped at that time. Further, when there are plural coincident data patterns, all of them are obtained. When there is no coincident data pattern (No at step S 1403 ), “0” is outputted as information (flag) indicating presence/absence of coincident pattern (step S 1404 ). Then one character is Huffman-encoded by the Huffman-coding unit  208  and outputted (step S 1405 ). Then the process proceeds to step S 1411 . Note that the output destination is a buffer  206 . Hereinafter, all the generated codes are outputted to the buffer  206 . On the other hand, when a coincident data pattern has been found (Yes at step S 1403 ), “1” is outputted as the flag (step S 1406 ). Then, among the retrieved data patterns, the location and length of a data pattern having the maximum coincident length in the dictionary (point information) is obtained and outputted (step S 1407 ). Then, it is determined whether or not the data pattern of which the point information has been outputted is continuously repeated (step S 1408 ). When the data pattern is not repeated (No at step S 1408 ), the value of the counter  204  is reset to “1” (step S 1415 ). Next, the processed data stream is added to the end of the dictionary memory  202  (step S 1411 ). Then, the process proceeds to step S 1414 . On the other hand, when it is determined at step S 1408  that the data pattern is repeated, the counter value is incremented at step S 1409 .  FIGS. 15A and 15B  show a particular example of the case of repetition. Next, it is determined whether or not the counter value is equal to “4” (step S 1410 ). When it is determined that the counter value is not equal to “4” (No at step S 1410 ), the process proceeds to step S 1414 . When it is determined that the counter value is equal to “4” (Yes at step S 1410 ), it is determined that it is impossible to eliminate more repetition redundancy in the subsequent JPEG 2000 recompression. Then the dictionary data is reset so as not to eliminate the redundancy of the cycle of interest (step S 1412 ). Particularly, the pointer indicating an adding position in the dictionary data is returned to the head. Further, the counter is reset (step S 1413 ), and the process proceeds to step S 1414 . At step S 1414 , it is determined whether or not data to be processed remains. When data to be processed remains (Yes at step S 1414 ), the process returns to step S 1402 . When no data remains (No at step S 1414 ), a code length calculation unit  205  calculates a code length of the dictionary-based encoded data stored in the buffer (step S 1416 ), and outputs the calculated code length to the recompressor  104 . Then the process ends. 
     The redundancy estimation unit  102  performs the dictionary-based coding processing on the JPEG encoded data, and outputs the code length to the recompressor  104 . Then the JPEG encoded data is outputted to a decompressor  103 . The decompressor  103  performs decompression processing (decoding processing) on the JPEG encoded data. As the details of the processing are well known, the explanation of the processing will be omitted. The decompressed image obtained by the decompression processing is outputted to the recompressor  104 . The recompressor  104  sets a target code amount based on the code length of the dictionary-based coding inputted from the code length calculation unit  205 , and compresses the image by the JPEG 2000 coding. Note that assuming that the code length of the dictionary-based coding inputted from the code length calculation unit  205  is L D  and the target code amount, L T , in accordance with a predetermined function F( ), L T =F(L D ) is calculated. The most simple calculation is L T =α×L D . In this calculation, α=1 holds. Further, it may be arranged such that, considering that redundancy in two-dimensional directions is not eliminated in the dictionary-based coding, and with the assumption of the code length upon elimination of redundancy in two-dimensional directions, α is set to a value less than “1” such as “0.9” (i.e., the target code amount L T  is set to a value less than the code amount L D  by the dictionary-based coding). Since the outline of the JPEG 2000 coding method has been described, the explanation of the outline of the method will be omitted. Note that to realize the target code amount, it may be arranged such that lower bits of binary arithmetic-encoded coefficients are rounded down preferentially. That is, assuming that the code amount obtained from the encoding by the recompressor  104  is L, and the predetermined allowable threshold value, Th, the encoded data from the least significant bit plane toward the higher-order bit plane are eliminated until 
     |L D −L|≦Th is satisfied. 
     The first embodiment is as described above. As a modification, it may be arranged such that the accuracy of estimation with respect to redundancy elimination upon recompression is lowered so as to mitigate the dictionary-based coding processing. More particularly, the spatial range to eliminate redundancy upon recompression is presumed, and the work of resetting the dictionary data is omitted. For example, the method as shown in  FIG. 10  used upon explanation of the concept of the dictionary-based coding may be used. The merit of this approach is that in addition to the mitigation of the processing, since the processing can be realized with existing dictionary-based software used in ZIP or LZH compression/decompression, work load of installation of new software can be reduced. Further, when such software is already installed in an image processing apparatus which implements the approach of the present invention, the work of installation of the software can be omitted. Note that in this case, the dictionary-based coding method is applied while viewing a wide image range. Accordingly, the redundancy is eliminated more than that in the coding method used in recompression. It may be arranged such that in view of this point, the target code amount is set to a greater value than the code amount in the dictionary-based coding method. For example, the above-described α may be greater than “1”. 
     Further, as another modification, it may be arranged such that the dictionary-based coding is not applied to the header of JPEG encoded data since the redundancy of header information in JPEG encoded data does not relate to the redundancy in a decompressed image. 
     Further, in the above-described embodiment, image data as a subject of re-encoding is JPEG encoded data, and the recompressor  104  performs encoding processing based on the JPEG 2000 method. As described above, it is possible to perform coding with higher compressibility than that of the JPEG method while suppressing degradation of image quality since a pixel group can be encoded in a wider range than 8×8 pixels as an encoding unit in the JPEG method. Accordingly, JPEG XR may be adopted in place of the JPEG 2000 method. The JPEG XR encoding is also applicable in the following other embodiments. 
     Second Embodiment 
     In the above-described first embodiment, redundancy is estimated using the dictionary-based coding. In the second embodiment, without the dictionary-based coding, the cycle of repetition of code stream in encoded image data is detected, and the length and the number of repetitions of the cycle is obtained. Then based on the information, the redundancy of a recompression subject image is estimated. The outline of particular processing will be described with reference to  FIGS. 19A and 19B . In those figures, a table is previously stored, and a cycle number of the first field means a serial number allotted to a continuous cycle when detected. The code amount at one cycle in the second field is one cycle code amount regarding the detected continuous cycle. When there is a continuous cycle of a bit pattern (byte pattern) as shown in  FIG. 13A , the code amount at one cycle is 1 (byte), and that in the case of  FIG. 13B  is 5 (bytes). The number of repetitions in the third field is the number of repetitions of the continuous cycle of interest, and its value is equal to or greater than 2. In the fourth field, the redundant code amount, which can be eliminated, is the result of multiplication between a value obtained by subtracting “1” from the number of repetitions and the one cycle code amount. In this method without encoding, the processing time can be reduced in comparison with the first embodiment. 
       FIG. 16  is a block diagram of the second embodiment. The difference of this figure is that the redundancy estimation unit  102  in the block diagram of the first embodiment in  FIG. 1  is replaced with a redundancy estimation unit  1601 . Accordingly, the redundancy estimation unit  1601  will be mainly described below.  FIG. 17  is a block diagram of the redundancy estimation unit  1601 .  FIG. 18  is a flowchart showing the processing content of the redundancy estimation unit  1601 . When JPEG encoded data is inputted into an encoded image data input unit  1701 , a controller  1709  performs, using the buffer  1706 , initialization (step S 1801 ), and controls a same character string detection unit  1703 , to retrieve a coincident data pattern (step S 1802 ), and determines the presence/absence of coincident data pattern (step S 1803 ). The processing to this step S 1803  is the same as that at steps S 1001  to S 1003  in the flowchart of  FIG. 10  in the first embodiment. When there is no coincident data pattern (No at step S 1803 ), the process proceeds to step S 1806 . On the other hand, when a coincident data pattern has been found (Yes at step S 1803 ), it is determined whether or not the coincident data pattern continuously exists (step S 1804 ). When the coincident data is not repeated (No at step S 1804 ), the value of a counter  1704  is reset to “1” (step S 1805 ). Next, the processed data stream is added to the end of a dictionary memory  1702  (step S 1806 ). Then, the process proceeds to step S 1813 . On the other hand, when it is determined at step S 1804  that the coincident data is repeated, the counter value is incremented (step S 1807 ). At that time, when plural cycles exist in the data pattern, the counter value is incremented by the number of cycles. The incrementation is the same as that in the first embodiment. Next, it is determined whether or not the value of the counter  4  is equal to “4” (step S 1808 ). When the counter value is not equal to “4” (No at step S 1808 ), the process proceeds to step S 1806 . In the subsequent recompression by the JPEG 2000 coding, there is a high probability that the redundancy of four or more repetitions cannot be deleted. Accordingly, when the counter value is equal to “4” (Yes at step S 1808 ), the dictionary data is reset so as not to delete the redundancy of the cycle of interest (step S 1809 ). Next, as shown in  FIG. 19A , regarding the cycle of interest, a continuous cycle information calculation unit  1708  calculates the redundant code amount (step S 1810 ). Note that the result of calculation is recorded in the internal memory of the continuous cycle information calculation unit  1708 . Then the counter is reset (step S 1811 ), and the process proceeds to step S 1813 . At step S 1813 , it is determined whether or not unprocessed data remains in the JPEG encoded data. When unprocessed data remains (Yes at step S 1813 ), the process returns to step S 1802 . When no unprocessed data remains (No at step S 1813 ), a redundant code length calculation unit  1705  calculates estimated redundancy (redundant data amount) from the result of calculation stored in the internal memory of the continuous cycle information calculation unit  1708  (step S 1814 ). More particularly, a table showing the result of calculation as shown in  FIG. 19B  is generated, and from the result, the redundancy or a target code amount is calculated. When the calculation is completed, a value, obtained by subtracting the result of calculation from the original encoded data amount, is outputted as a target code amount to the recompressor  104 . Then the process ends. 
     Other Embodiments 
     In the first and second embodiments, the redundancy only in one-dimensional direction of an image is handled. However, an image is represented as two-dimensional data, and it is expected that a target code amount is estimated with higher accuracy by using a method of two-dimensional image redundancy estimation. The present invention includes such method for two-dimensional redundancy estimation in its scope. As an example, it may be arranged such that encoded image data is decompressed and redundancy is measured from the decompressed image. More particularly, as in the case of the first embodiment, encoded image data as a subject of recompression is indicative of a JPEG image, and the recompression method is the JPEG 2000 method. Further, the range of redundancy for deletion of code block as an encoding unit in the JPEG 2000 coding is 149×149 pixels. When JPEG data to be recompressed is determined, it is decompressed, and as shown in  FIG. 20A , the decompressed image is divided into 149×149 pixel regions (redundancy elimination unit regions). Note that since 8×8 pixel block code amount will be used in the subsequent processing, it is written into the memory in the image processing apparatus in the progress of decoding. Then, as shown in  FIG. 20B , by redundancy elimination unit region, the pattern of each 8×8 pixel block is analyzed, and the pixel blocks are classified by allotting the same number to the identical patterns. Next, as shown in  FIG. 20C , in adjacent vertically and laterally diagonal 8×8 pixel blocks having the same number are grouped, and a group number is allotted to the group. Note that as the ground for the vertically and laterally diagonal grouping, as described above, in the JPEG 2000 method, in sub bands generated upon thrice Discrete Wavelet transformation, the number of coefficients obtained from each 8×8 pixel block is one. In this grouping, it is possible to efficiently delete redundancy of continuous 8×8 pixel blocks in the sub bands and refer to the vertically and laterally diagonal direction in encoding of each coefficient. Regarding each group, JPEG code amounts obtained from one respective 8×8 pixel block and the number of 8×8 pixel blocks in the group are obtained, and an apparent redundant code amount (single-group redundancy code amount) is calculated. Then, the total sum of respective single group redundancy code amounts is obtained, as a redundancy of the redundancy elimination unit region of interest. Further, the sum of redundancies in all the redundancy elimination unit regions in the decompressed image, as redundancy of the decompressed image, is subtracted from the JPEG encoded data amount. The obtained code amount is used as a target code amount upon recompression. 
     In the first and second embodiments, the first coding algorithm with a pixel block having a predetermined number of pixels as a unit is the JPEG coding. Further, the second coding algorithm to perform coding with a block greater than the pixel block as a unit is the JPEG 2000 coding. Then, as the third coding algorithm to determine redundancy in encoded data, the dictionary-based coding is used. However, this combination of the coding algorithms is not limited. For example, as the second coding algorithm, any method may be included in the scope of the present invention as long as recompression is performed by a coding method capable of deletion of image redundancy in comparison with the coding method for encoded image data as a subject of recompression. For example, the ISO standard, JPEG XR may be used. Although the detailed explanation of JPEG XR will be omitted, an input image is divided into 16×16 pixel macro blocks and encoding is performed by block. That is, the redundancy of the image is deleted with the range of 16×16 pixels. Accordingly, upon recompression of JPEG XR encoded data, the object can be attained by setting the code block size in the JPEG 2000 coding to a greater size than 16×16 size. This is included in the scope of the present invention. Further, re-encoding of JPEG data by JPEG XR is also included in the scope of the present invention. 
     In the present invention, the method for recompressing encoded image data has been described, however, an image processing system using the recompression method is also included in the scope of the present invention. For example, when a user has XPS (XML Paper Specification) data and upon direct-print to an MFP or the like, when the MFP is compliant to only PDF (Portable Document Format) format, conversion of the data to the PDF format is required. Since XPS is JPEG XR-compliant but PDF is not JPEG XR-compliant, upon format conversion, PDF-capable image recompression processing occurs. As PDF is JPG 2000-compliant, the JPEG 2000 method can be used as the recompression processing, and the method disclosed in the present invention is applicable. This embodiment is also included in the scope of the present invention. 
     Further, in the above-described respective embodiments, redundancy determination using the dictionary-based coding has been shown, however, the present invention is not limited to the redundancy determination using the dictionary-based coding. Other coding techniques than the dictionary-based coding may be used as long as redundancy of encoded data as a subject of re-encoding can be determined. 
     Aspects of the present invention can also be realized by a computer of a system or apparatus (or devices such as a CPU or MPU) that reads out and executes a program recorded on a memory device to perform the functions of the above-described embodiments, and by a method, the steps of which are performed by a computer of a system or apparatus by, for example, reading out and executing a program recorded on a memory device to perform the functions of the above-described embodiments. For this purpose, the program is provided to the computer for example via a network or from a recording medium of various types serving as the memory device (e.g., computer-readable medium). 
     While the present invention has been described with reference to exemplary embodiments, it is to be understood that the invention is not limited to the disclosed exemplary embodiments. The scope of the following claims is to be accorded the broadest interpretation so as to encompass all such modifications and equivalent structures and functions. 
     This application claims the benefit of Japanese Patent Application No. 2011-040838, filed Feb. 25, 2011, which is hereby incorporated by reference herein in its entirety.