1. Field of the Invention
The present invention relates to a coding apparatus and a coding method, and more particularly, to a coding apparatus and a coding method which can perform coding at a high speed.
2. Description of the Related Art
JPEG (Joint Photographic Experts Group) 2000 standardized by ISO/IEC (International Organization for Standardization/International Electrotechnical Commission) in 2000 is an image coding system having a variety of functions of a high compression ratio, lossless and lossy compression, scalability (resolution, image quality and the like), error tolerance and so on, which is highly expected to be an alternative technique of JPEG.
In 2004, JPEG2000 Part-1 was selected as a standard codec according to DCI (Digital Cinema Initiative). Accordingly, image photographing, image editing and image delivery of digital cinema can be all integrated under JPEG2000.
Further, medical images, satellite photograph images or the like should be necessarily stored in an original state. Recently, a variety of digital single lens reflex cameras can store raw data or RGB data acquired by an image sensor such as CCD (Charge Coupled Device) or CMOS (Complementary Metal Oxide Semiconductor) in a non-compressed state in a memory card.
However, the non-compression of master images is advantageous in that loss of image data can be prevented, but is disadvantageous in that the data size becomes large. For this reason, the expectation of compression and decompression according to the JPEG2000 lossless compression is growing these days, for example, even in the use where image quality is considered important, as described above, in addition to digital cinema.
Japanese Patent No. 3,906,630 discloses an image coding apparatus which includes both a fixed-point type wavelet transformer and an integer type wavelet transformer, which can perform both a lossless transform and a lossy transform and can increase the degree of freedom of selection of image quality and compression ratio.
However, JPEG2000 may be problematic in that its calculation load is remarkably larger than JPEG, and particularly, in that overall coefficient data is compressed without loss in the case of lossless compression, which causes too much time.
In such a JPEG2000 coding technique, an entropy coding section referred to as EBCOT (Embedded Block Coding with Optimized Truncation) occupies the largest calculation load. This EBCOT employs a technique which arithmetically codes binary data being expanded in bit-planes while modeling the binary data in the unit of one pixel. Thus, after sequential processing is performed, “dependence” occurs in which a result of an upper bit-plane affects a result of a lower bit-plane, thereby making it difficult to parallelize the inside of code blocks. Therefore, in the case of encoding and lossless compression for an image having a high level of resolution, how to realize high-speed processing of the calculation load of JPEG2000, in particular EBCOT, has been a key issue.
The inside structure of EBCOT is divided into a bit modeling section and an MQ coding section. In the bit modeling, wavelet transform coefficients or quantization coefficients are expanded in bit-planes, and coding is performed in three encoding units referred to as coding passes, in the unit of rectangular code blocks. In each coding pass, a predetermined parameter group is output to the MQ coding section as necessary. The MQ coding section generates a code word using the parameter group.
For high-speed processing of EBCOT, it is necessary to reduce the calculation load in the bit modeling section and the MQ coding section.
Accordingly, it is desirable to provide a coding apparatus and a coding method which is capable of performing coding at a high speed.
According to an embodiment of the present invention, there is provided a coding apparatus including: bit modeling means for performing bit modeling for coding for coefficient data of every sub-band obtained by wavelet-transforming image data; expanding means for expanding a plurality of data sets including a symbol, a context and control information obtained by the bit modeling means in a register as input data; storing means for storing the input data expanded by the expanding means as buffer data; integrating means for integrating the data set in which the control information is valid in the input data expanded by the expanding means and the data set in which the control information is valid in the buffer data stored in the storing means; and coding means for coding the data sets in which the control information is valid, which are integrated by the integrating means.
The integrating means may integrate the data sets in which the control information is valid by detecting the data set in which the control information is invalid in the buffer data and by moving the data set, which is located in the same position as the detected data set in the buffer data, among the data set in which the control information is valid in the input data to the same position of the buffer data.
The coding apparatus may further include reading means for reading the buffer data from the storing means in a case where the data set in which the control information is valid is included in the input data, after the data sets are integrated by the integrating means, wherein the coding section may code the data set in which the control information is valid in the buffer data read by the reading means, and wherein the storing means may store the input data expanded in the register as new buffer data, after the buffer data is read by the reading means.
The coding apparatus may further include aligning means for rearranging the buffer data read from the storing means by the reading means to collect the data set in which the control information is valid, wherein the coding means may code the data set in which the control information is valid, which is rearranged and collected by the aligning means.
The coding means may code the different data sets in which the control information is valid, which are integrated by the integrating means, a plurality of times in parallel.
The expanding means may expand the data set corresponding to each sample, located in the same position, of a plurality of code blocks in the register as the input data.
The coding apparatus may further include grouping means for grouping the plurality of code blocks by a predetermined number of code blocks having the same characteristic, wherein the expanding means may expand, for every group generated by the grouping means, the data set corresponding to the sample, located in the same position, of each code block in the group, in the register as the input data.
The grouping means may group the code blocks on the basis of parameters representing the characteristic of the code blocks, including the horizontal size and vertical size of the code blocks, the number of coding passes used in the code blocks and the sub-band type to which the code blocks belong.
The bit modeling means may select one of a CU pass, an SP pass and an MR pass by which the coding is to be performed and may perform a predetermined operation by the selected coding pass.
The control information may be transmitted from the CU pass, and may be any one of valid and invalid information in which a result of run-length coding is 0, valid and invalid information in which the run-length coding result is 1, valid and invalid information on whether or not to perform the CU coding, and valid and invalid information on whether or not to perform sign coding.
The control information may be transmitted from the SP pass, and may be any one of valid and invalid information on whether or not to perform SP coding, and valid and invalid information on whether or not to perform sign coding.
The control information may be transmitted from the MR pass, and may be valid and invalid information on whether or not to perform MR coding.
According to an embodiment of the present invention, there is provided a coding method including the steps of: performing bit modeling for coding for coefficient data of every sub-band obtained by wavelet-transforming image data; expanding a plurality of data sets including a symbol, a context and control information obtained by the bit modeling in a register as input data; storing the input data expanded in the register in a storing section as buffer data; integrating the data set in which the control information is valid in the input data expanded in the register and the data set in which the control information is valid in the buffer data stored in the storing section; and coding the integrated data sets in which the control information is valid.
According to an embodiment of the present invention, bit modeling for coding is performed for coefficient data of every sub-band obtained by wavelet-transforming image data; a plurality of data sets including a symbol, a context and control information obtained by the bit modeling is expanded in a register as input data; the input data expanded in the register is stored in a storing section as buffer data; the data set in which the control information is valid in the input data expanded in the register and the data set in which the control information is valid in the buffer data stored in the storing section are integrated with each other; and the integrated data sets in which the control information is valid are coded.
According to the embodiments, it is possible to code the image, in particular, to code the image at a high speed.
Hereinafter, preferred embodiments for carrying out the present invention will be described in the following order.
1. First embodiment (image coding apparatus)
2. Second embodiment (image coding apparatus)
3. Third embodiment (personal computer)
The image coding apparatus 100 wavelet-transforms the image data, expands obtained coefficients into a bit-plane for each code block, and performs entropy coding for each bit-plane.
The image coding apparatus 100 performs entropy coding called EBCOT (Embedded Block Coding with Optimized Truncation) specifically determined in the JPEG2000 standard (reference document: ISO/IEC 15444-1, Information technology-JPEG2000, Part 1: Core coding system).
The entropy coding called EBCOT (Embedded Block Coding with Optimized Truncation) is a technique which arithmetically codes binary data being expanded in bit-planes while modeling the binary data in the unit of one pixel.
In the related art, in this process, since “dependence” occurs in which a result of an upper bit-plane affects a result of a lower bit-plane after sequential processing is performed, it is difficult to parallelize the inside of code blocks. Therefore, in the case of encoding and lossless compression for an image having a high level of resolution, how to realize high-speed processing of the calculation load of JPEG2000, in particular EBCOT, has been a key issue.
Thus, the image coding apparatus 100 performs MQ coding (arithmetic coding) regardless of the bit modeling result in EBCOT, to thereby realize deletion of conditional branches in coding passes. Further, the image coding apparatus 100 integrates symbols or contexts having valid control information, to thereby perform the MQ coding for only valid data with high efficiency. Accordingly, the image coding apparatus 100 can realize high-speed processing of EBCOT, that is, reduction in the calculation load of JPEG2000.
As shown in
The wavelet transform section 101 is typically realized by a filter bank including a low-pass filter and a high-pass filter. Further, since a digital filter generally has an impulse response (filter coefficient) having a length of a plurality of taps, the wavelet transform section 101 has a buffer for buffering in advance such an amount of an input image that is only to be filtered.
The wavelet transform section 101 obtains input image data (arrow 121) by a minimum data amount necessary for filtering or more. The wavelet transform section 101 filters the image data, for example, using a 5×3 wavelet transform filter to generate wavelet coefficients. The wavelet transform section 101 performs filtering so that the image data is separated into a low-frequency component and a high-frequency component in the respective vertical and horizontal directions of the image.
Further, the wavelet transform section 101 recursively repeats such a filtering process for sub-bands separated as the low-frequency component in both the vertical direction and the horizontal direction a predetermined number of times, as shown in
The number of the division levels of the wavelet transform is arbitrary.
Returning to
The quantization section 102 quantizes the supplied coefficient data (wavelet coefficients). The quantization section 102 supplies the obtained coefficient data (quantized coefficients) to the bit-plane expanding section 103 (arrow 123). In the JPEG2000 standard, the quantization process is omitted in the case of lossless compression. In this case, the coefficient data (wavelet coefficients) output from the wavelet transform section 101 is supplied to the bit-plane expanding section 103 (arrow 124).
The bit-plane expanding section 103 expands the supplied coefficient data into a bit-plane in each bit position.
The bit-plane is obtained by dividing (slicing) a coefficient group (for example, code blocks to be described later) of a predetermined number of wavelet coefficients for each bit, that is, in each position. That is, the bit-plane is a set of bits (coefficient bits), in the same position, of a plurality of pieces of data each having a bit depth of a plurality of bits. Accordingly, the number of the expanded bit-planes depends on the bit depth of each coefficient.
The number of the coefficients in the coefficient group thus converted into the bit-planes is arbitrary. Hereinafter, the description will be made supposing that the bit-plane expanding section 103 expands coefficients into bit-planes for each code block, so as to facilitate processing in each section by integrating processing units.
Returning to
The code blocking section 104 divides the supplied coefficient data of each bit-plane into rectangular code blocks of a predetermined size, which are processing units of entropy coding. According to the definition of the JPEG2000 standard, the vertical and horizontal sizes of the code blocks are uniform in any sub-band. Here, on opposite ends of the image (sub-band) or upper and lower ends thereof or the like, the code blocks having the same size may not be obtained.
Returning to
The EBCOT 105 performs coding for each block of a predetermined size while measuring statistics of coefficients within the block. The EBCOT 105 performs entropy coding for the coefficient data (quantized coefficients) in the code block unit. Each code block is independently coded for each bit-plane from the most significant bit (MSB) to the least significant bit (LSB). The vertical and horizontal sizes of the code blocks are powers of 2 ranging from 4 to 256, and sizes generally used include 32×32, 64×64, 128×32 and the like. Suppose that a quantized coefficient value is represented by an n-bit binary number with a sign, and that bits of zero to n−1 represent respective bits from the LSB to the MSB. The remaining one bit indicates the sign. The code blocks are coded by the following three types of coding passes in order from the bit-plane on the MSB side.
(1) Significant Propagation Pass
(2) Magnitude Refinement Pass
(3) Cleanup Pass
The order in which the three types of coding passes are used is shown in
However, in reality, the EBCOT 105 writes in what number bit-plane from the MSB side one first appears in a header, and does not code bit-planes whose coefficients are all zero and which continue from the MSB side (which will be referred to as zero bit-planes). The coding is performed repeatedly using the three types of coding passes in the above order, and is terminated in an arbitrary coding pass of an arbitrary bit-plane, to thereby acquire trade-off between code amount and image quality (performing a rate control).
Next, the scanning of coefficients will be described with reference to
Hereinafter, the three types of coding passes will be described, which are disclosed in JPEG-2000 standard (reference document: ISO/IEC 15444-1, Information technology-JPEG2000, Part 1: Core coding system).
In Significance Propagation Pass for coding a certain bit-plane, values in the bit-plane of such non-significant coefficients that at least one of 8-neighbor coefficients is significant are subjected to arithmetic coding. When the coded value of the bit-plane is one, information indicating whether a sign is positive or negative is subsequently subjected to the MQ coding.
The word “significance” which is a special term in JPEG2000 will be described. The significance refers to the state of an encoder for each coefficient, in which an initial value of the significance is zero indicating “non-significant”, the value is changed to one indicating “significant” when one is coded in the concerned coefficient, and then the value is continued as one. Accordingly, the significance can be also referred to as a flag indicating whether information on valid digits has already been coded. When a coefficient becomes significant in a certain bit-plane, the coefficient remains significant in subsequent bit-planes.
In Magnitude Refinement Pass for coding the bit-plane, values in the bit-plane of significant coefficients not coded in Significance Propagation Pass for coding the bit-plane are subjected to the MQ coding.
(3) Cleanup Pass (CU pass)
In Cleanup Pass for coding the bit-plane, values in the bit-plane of non-significant coefficients not coded in Significance Pass for coding the bit-plane are subject to the MQ coding. When the coded value of the bit-plane is one, information indicating whether a sign is positive or negative is subsequently subjected to the MQ coding.
In the MQ coding in the above three coding passes, methods such as ZC (Zero Coding), RLC (Run-Length Coding), SC (Sign Coding) and MR (Magnitude Refinement) are used properly on a case-by-case basis. Here, the arithmetic coding referred to as the MQ coding is used in this case. The MQ coding is a learning type binary arithmetic code defined in JBIG2 (reference document: ISO/IEC FDIS 14492, “Lossy/Lossless Coding of Bi-level Images”, March 2000).
In
Accordingly, the number of coding passes (num_pass), which indicates the number of coding passes used in one code block, is calculated according to the following formula (1).
num_pass=(Max.Bits−Zero.Bits)×3−2 (1)
As shown in
The coded code stream generating section 106 aligns the coded data supplied from the EBCOT 105 (MQ coding section 112), and outputs it as one code stream (arrow 129).
As shown in
The selecting section 141 selects one from the CU pass section 142, the SP pass section 143 and the MR pass section 144 as a supply target of the coefficient data (arrow 171) supplied from the code blocking section 104, and supplies the coefficient data to the selected supply target.
For example, in a case where the selecting section 141 selects the CU pass section 142, the selecting section 141 supplies the CU pass section 142 with the coefficient data (arrow 172). Further, for example, in a case where the selecting section 141 selects the SP pass section 143, the selecting section 141 supplies the SP pass section 143 with the coefficient data (arrow 173). In addition, for example, in a case where the selecting section 141 selects the MR pass section 144, the selecting section 141 supplies the MR pass section 144 with the coefficient data (arrow 174).
The CU pass section 142, the SP pass section 143 and the MR pass section 144 perform a predetermined calculation for the coefficient data by each coding pass for coding. The CU pass section 142, the SP pass section 143 and the MR pass section 144 supply the switching section 145 with a data group such as control information, symbols, contexts or the like, as an arithmetic result, respectively (arrows 175 to 177).
The switching section 145 properly switches the input coding passes, and supplies a register expanding section 151 of the MQ coding section 112 with the data group supplied from the CU pass section 142, the SP pass section 143 and the MR pass section 144 (arrow 178).
That is, a data set (of control information, symbols and contexts indicating valid or invalid) which will be described later is output from each coding pass, and is supplied to the register expanding section 151 as selection data.
As shown in
Returning to
The register expanding section 151 supplies the data integrating section 152 with the supplied data set group (arrow 179), and expands it in the register. The data integrating section 152 integrates the data expanded in the register with the data stored in the buffer section 153 (arrows 180 and 181).
The buffer section 153 stores the data set group previously expanded in the register. Further, the data integration result performed as described above is stored (the stored data set group is properly updated by the data integration). As will be described later, in a case where valid data of the register is not able to be fully integrated with the data of the buffer section 153, the data integrating section 152 reads the data set group from the buffer section 153 (arrow 181), and supplies it to the aligning section 154 (arrow 182). Further, the data integrating section 152 reads the data set group from the buffer section 153, and then stores the data set group expanded in the register in the buffer section 153 (arrow 180).
The aligning section 154 rearranges the supplied data set group and divides it into data in which the control information is valid and data in which the control information is invalid (data in which the control information is valid is collected). The aligning section 154 supplies the MQ coding performing section 155 with the data in which the control information is valid (arrow 183).
The MQ coding performing section 155 performs the MQ coding for the supplied data while referring to the probability estimation table 156 defined in the typical JPEG2000 (arrow 184), to thereby generate the coded data. The MQ coding performing section 155 supplies the coded code stream generating section 106 with the generated coded data (arrow 185).
An example of a flow of a coding process performed by the image coding apparatus 100 will be described with reference to a flowchart of
If the coding process starts, the wavelet converting section 101 wavelet-transforms image data corresponding to one picture, in step S101. In step S102, the quantization section 102 quantizes coefficient data generated in step S101. In the case of lossless compression, the process of step S102 is omitted.
In step S103, the bit-plane expanding section 103 expands the coefficient data in bit-planes. In step S104, the code blocking section 104 code-blocks the coefficient data.
In step S105, the bit modeling section 111 of the EBCOT 105 performs the bit modeling process. In step S106, the MQ coding section 112 of the EBCOT 105 performs the MQ coding process.
In step S107, the coded code stream generating section 106 aligns the coded data generated in the EBCOT 105 to generate code streams for output. When the process of step S107 is terminated, the coding process is terminated.
The coding process is performed for each picture.
Next, an example of a detailed flow of the bit modeling process performed in step S105 in
If the bit modeling process is started, the selecting section 141 in step S121 selects a coding pass. In step S122, the selecting section 141 determines whether or not the CU pass is selected.
If it is determined that the CU pass is selected, the procedure goes to step S123. In step S123, the CU pass section 142 performs the CU pass process for performing coding by the CU pass. If the CU pass process is terminated, the procedure goes to step S127.
Further, in step S122, if it is determined that the CU pass is not selected, the procedure goes to step S124. In step S124, the selecting section 141 determines whether or not the SP pass is selected.
If it is determined that the SP pass is selected, the procedure goes to step S125. In step S125, the SP pass section 143 performs the SP pass process for performing coding by the SP pass. If the SP pass process is terminated, the procedure goes to step S127.
Further, in step S124, if it is determined that the SP pass is not selected, the procedure goes to step S126. In step S126, the MR pass section 144 performs the MR pass process for performing coding by the MR pass. If the MR pass process is terminated, the procedure goes to step S127.
In step S127, the bit modeling section 111 determines whether or not to terminate the bit modeling process. If it is determined that unprocessed coefficient data exists and the bit modeling process is not to be terminated, the procedure returns to step S121, and the subsequent processes are repeated. Further, if it is determined in step S127 that all coefficient data in the picture is processed, the bit modeling process is terminated, and then the procedure returns to step S105 in
Next, an example of a flow of the CU pass process performed in step S123 in
In the CU pass, while the coefficient group in the stripe in the vertical direction (4 coefficients in the case of the example in
In step S141, the CU pass section 142 performs a calculation that the result of the run length coding (RLC: Run Length Coding) is zero. When the calculation succeeds, the calculation result becomes 0xFF (hereinafter, referred to as “FF”). Further, when the calculation fails, the calculation result becomes 0x00 (hereinafter, referred to as “00”). These calculation results affect the process of step S145.
When the process of step S141 is terminated, the procedure goes to step S142. In step S142, the CU pass section 142 performs a calculation that the result of the RLC is one. When the calculation succeeds, the calculation result becomes FF. Further, when the calculation fails, the calculation result becomes 00. These calculation results affect the processes of steps S146 to S148.
When the process of step S142 is terminated, the procedure goes to step S143. In step S143, the CU pass section 142 performs a calculation of a first uniform encoding. The encoding target is zero or one. The calculation result affects the process of step S147.
When the process of step S143 is terminated, the procedure goes to step S144. In step S144, the CU pass section 142 performs a calculation of a second uniform encoding. The encoding target is zero or one. The calculation result affects the process of step S148.
In the CU pass process, there is an initial branch point of whether to perform the RLC process or not in step S141. Here, as shown in
When the process of step S144 is terminated, the procedure goes to step S145. The CU pass section 142 supplies the MQ coding section 112 with data (control information, symbols, contexts and the like), so that a value zero is MQ-coded using an RLC context in step S145, and a value one is MQ-coded using the RLC context in step S146.
Further, the CU pass section 142 supplies the MQ coding section 112 with data (control information, symbols, contexts and the like), so that a first MQ coding is performed using a uniform context in step S147, and a second MQ coding is performed using the uniform context in step S148.
If the process of step S148 in
In step S161, the CU pass section 142 performs a calculation of whether or not to perform the CU encoding. For example, when the CU encoding is performed, the calculation result becomes FF, and when the CU encoding is not performed, the calculation result becomes 00. The calculation results are used for the MQ coding in step S163.
If the process in step S161 is terminated, the procedure goes to step S162. In step S162, the CU pass section 142 performs a calculation of a significance context. The CU pass section 142 supplies the data (control information, symbols, contexts and the like) to the MQ coding section 112, to thereby MQ-code a symbol using the significance context in step S163.
If the process of step S163 is terminated, the procedure goes to step S164. In step S164, the CU pass section 142 performs a calculation of whether or not to perform a sign encoding. For example, in a case where the sign encoding is performed, the calculation result becomes FF, and in a case where the sign encoding is not performed, the calculation result becomes 00. These calculation results are used for the MQ coding of step S166.
If the process of step S164 is terminated, the procedure goes to step S165. In step S165, the CU pass section 142 performs a calculation of a sign context. The CU pass section 142 supplies the data (control information, symbols, contexts and the like) to the MQ coding section 112, to thereby MQ-code a sign using a sign context in step S166.
In step S167, the CU pass section 142 determines whether all coefficients in the coefficient group (4 coefficients) which is the process target are processed. If it is determined that an unprocessed coefficient exist, the procedure returns to step S161, and then repeats the subsequent processes.
Further, if it is determined in step S167 that all coefficients in the coefficient group (4 coefficients) which is the process target are processed, the procedure goes to step S168. In step S168, the CU pass section 142 determines whether all coefficients of all stripes of the bit-plane which is the process target are processed. If it is determined that an unprocessed coefficient exists, the procedure returns to step S141 in
Further, if it is determined, in step S168 in
In the above CU pass process, for example, the calculation that the RLC result is one is performed (step S142), and in a case where the sign output as the result is FF, this means that the calculation was valid. In this case, even though the calculation that the RLC result is zero is performed (step S141), it is obvious that the calculation result is 00 (invalid) (because the results zero and one are in the antinomy relation).
In addition, in a case where calculation that the RLC result is one is valid, the calculation of the uniform encoding is performed two times. In any case, the encoding target is zero or one. Further, there is a case where RLC is not performed at all, as a case other than the above two cases.
Hereinafter, with respect to three cases, the procedure of performing each process of steps S141 to S148 in
First of all, the process of actually generating an operation in a case where the RLC result is zero will be described with reference to
<<Case 1 (case where the RLC result is zero)>>
(1) If the calculation that the RLC result is zero is performed (step S141), the result becomes FF.
(2) If the calculation that the RLC result is one is performed (step S142), the result becomes 00.
(3) Even though the calculation of the first uniform encoding is performed (step S143), a code word is not generated.
(4) Even though the calculation of the second uniform encoding is performed (step S144), the code word is not generated.
(5) The value zero is MQ-coded using the RLC context (step S145), and then the code word is output.
(6) Even though the value one is MQ-coded using the RLC context (step S146), the code word is not generated.
(7) Even though the MQ coding is performed using the (first) uniform context (step S147), the code word is not generated.
(8) Even though the MQ coding is performed using the (second) uniform context (step S148), the code word is not generated.
As described above, in the case of Case 1, with respect to a sample in which the RLC result is zero, the value zero is MQ-coded using the RLC context. At this time, three pieces of data of the RLC context, the symbol (0) and the control information (FF) are input to the MQ coding section 112.
Next, the process of actually generating an operation in a case where the RLC result is one will be described with reference to
<<Case 2 (Case where the RLC Result is One)>>
(1) If the calculation that the RLC result is zero is performed (step S141), the result becomes 00.
(2) If the calculation that the RLC result is one is performed (step S142), the result becomes FF.
(3) The calculation of the first uniform encoding is performed (step S143), and then the code word is generated.
(4) The calculation of the second uniform encoding is performed (step S144), and then the code word is generated.
(5) Even though the value zero is MQ-coded using the RLC context (step S145), the code word is not generated.
(6) The value one is MQ-coded using the RLC context (step S146), and then the code word is output.
(7) The MQ coding is performed using the (first) uniform context (step S147), and then the code word is output.
(8) The MQ coding is performed using the (second) uniform context (step S148), and then the code word is output.
As described above, in the case of Case 2, with respect to a sample in which the RLC result is one, the value one is MQ-coded using the RLC context. At this time, since the first and second uniform encodings are simultaneously performed, the value zero or one is MQ-coded using each uniform context. Accordingly, in Case 2, three MQ coding operations are performed, and data input to the MQ coding section 112 are the RLC context, the symbol (1) and the control information (FF); the first uniform context, the symbol (0 or 1) and the control information (FF); or the second uniform context, the symbol (0 or 1) and the control information (FF).
Next, the process of actually generating an operation in a case where the RLC is not performed will be described with reference to
<<Case 3 (Case where the RLC is not Performed)>>
(1) If the calculation that the RLC result is zero is performed (step S141), the result becomes 00.
(2) If the calculation that the RLC result is one is performed (step S142), the result becomes 00.
(3) Even though the calculation of the first uniform encoding is performed (step S143), the code word is not generated.
(4) Even though the calculation of the second uniform encoding is performed (step S144), the code word is not generated.
(5) Even though the value zero is MQ-coded using the RLC context (step S145), the code word is not generated.
(6) Even though the value one is MQ-coded using the RLC context (step S146), the code word is not generated.
(7) Even though the MQ coding is performed using the (first) uniform context (step S147), the code word is not generated.
(8) Even though the MQ coding is performed using the (second) uniform context (step S148), the code word is not generated.
As described above, in the case where the RLC is not performed, each process of steps S141 to S148 is performed, but the process of actually generating the code word does not exist. This is the same as in the case where the RLC is not performed in the CU pass process in the related art.
In addition, as described above, in the EBCOT 105, no conditional branch is generated in the processes for each coefficient (steps S161 to S166 in
Further, in a case where the calculation result of whether or not to perform the CU encoding is FF, a symbol of the sample is MQ-coded using the significance context. In a similar way, in a case where the result of whether or not to perform the sign encoding is FF, a symbol of the sample is MQ-coded using the sign context.
As described above, in a case where the CU pass is selected in the bit modeling section 111 in
Next, an example of a flow of the SP pass process performed in step S125 in
If the SP pass process starts, the SP pass section 143 calculates whether or not to perform the SP encoding in step S181. For example, in a case where the SP encoding is performed, the calculation result becomes FF, and in a case where the SP encoding is not performed, the calculation result becomes 00. These calculation results are used for the MQ coding in step S183.
If the process of step S181 is terminated, the procedure goes to step S182. In step S182, the SP pass section 143 calculates a significance context. In step S183, the SP pass section 143 supplies data (control information, symbols, contexts and the like) to the MQ coding section 112, to thereby MQ-code the symbol using the significance context.
If the process of step S183 is terminated, the procedure goes to step S184. In step S184, the SP pass section 143 calculates whether the coefficient is one or not. For example, in a case where the coefficient is one, the calculation result becomes FF, and in a case where the coefficient is zero, the calculation result becomes 00. The calculation results are used for the MQ coding of step S186.
If the process of step S184 is terminated, the procedure goes to step S185. In step S185, the SP pass section 143 calculates a sign context. In step S186, the SP pass section 143 supplies data (control information, symbols, contexts and the like) to the MQ coding section 112, to thereby MQ-code the sign using the sign context.
In step S187, the SP pass section 143 determines whether all coefficients in the coefficient group (4 coefficients) which is the process target are processed. If it is determined that an unprocessed coefficient exists, the procedure returns to step S181, and repeats the subsequent processes.
If it is determined in step S187 that all coefficients in the coefficient group (4 coefficients) which is the process target are processed, the procedure goes to step S188. In step S188, the SP pass section 143 determines whether all coefficients of all stripes in a bit-plane which is a process target are processed. If it is determined that an unprocessed coefficient exists, the procedure returns to step S181, and repeats the subsequent processes.
Further, in step S188, if it is determined that all coefficients are processed, the SP pass process is terminated. Then, the procedure returns to step S125 in
In the case of the SP pass process, in a similar way to the case of the CU pass, any conditional branch is not generated in the process (steps S181 to S186 in
Further, in a case where the calculation result of whether or not to perform the SP encoding is FF, a symbol of the sample is MQ-coded using the significance context. Similarly, in a case where the calculation result of whether or not to perform the sign encoding is FF, a symbol of the sample is MQ-coded using the sign context.
As described above, in a case where the SP pass is selected in the bit modeling section 111 in
Next, an example of a flow of the MR pass process performed in step S126 in
If the MR pass process starts, in step S201, the MR pass section 144 performs a calculation of whether or not to perform the MR encoding. For example, in a case where the MR encoding is performed, the calculation result becomes FF, and in a case where the MR encoding is not performed, the calculation result becomes 00. The calculation results are used for the MQ coding of step S203.
If the process of step S201 is terminated, the procedure goes to step S202. In step S202, the MR pass section 144 performs a calculation of an MR context. In step S203, the SP pass section 143 supplies data (control information, symbols, contexts and the like) to the MQ coding section 112, to thereby MQ-code the symbol using the MR context.
If the process of step S203 is terminated, the procedure goes to step S204. In step S204, the MR pass section 144 determines whether all coefficients in the coefficient group (4 coefficients) which is the process target are processed. If it is determined that an unprocessed coefficient exists, the procedure returns to step S201, and then repeats the subsequent processes.
If it is determined in step S204 that all coefficients in the coefficient group (4 coefficients) which is the process target are processed, the procedure goes to step S205. In step S205, the MR pass section 144 determines whether all coefficients of all stripes in a bit-plane which is the process target are processed. If it is determined that an unprocessed coefficient exists, the procedure returns to step S201, and then repeats the subsequent processes.
Further, in step S205, if it is determined that all coefficients are processed, the MR pass process is terminated. Then, the procedure returns to step S126 in
In the case of the MR pass process, in a similar way to the cases of the CU pass or SP pass, any conditional branch is not generated in the processes (steps S201 to S203 in
In addition, in a case where the calculation result of whether or not to perform the MR encoding is FF, a symbol of the sample is MQ-coded using the MR context.
As described above, in a case where the MR pass is selected in the bit modeling section 111 in
Next, an example of a flow of the MQ coding process performed in step S106 in
The MQ coding section 112 in
If the MQ coding process starts, the register expanding section 151 obtains a data set such as symbols, contexts, control information and the like of a certain sample of a certain code block, supplied from the bit modeling section 111 in step S221.
In step S222, the register expanding section 151 determines whether the data set is obtained for all samples (coefficients) of code blocks of a predetermined number (N items (N is a natural number)) which are determined in advance. If it is determined that the data set corresponding to the code blocks of the predetermined number (N) is not obtained, the procedure returns to step S221, and then repeats the subsequent processes.
In step S222, if it is determined that the data set is obtained for all samples of the code blocks of the predetermined value (N), the procedure goes to step S223.
In step S223, the register expanding section 151 obtains the data set of symbols, contexts and control information of a process target sample from each of the code blocks of the predetermined number in which the data group is obtained, and then expands it in the register. The data set group expanded in the register is referred to as input data.
In the example of
For example, in a sign bit-plane, a data set 201-1 of a sample on the upper left side is read from the codeblock0, and a data set 201-2 of a sample on the upper left side is read from the codeblock1. Similarly, a data set is read from the codeblock3 to the codeblock14, and a data set 201-16 of a sample on the upper left side is read from the codeblock15. The data set 201-1 to the data set 201-16 are arranged in parallel in the register.
Further, as will be described later, if the input data of the register is processed, a neighboring data set 202-1 of a sample on the right side is read from the codeblock0, and a neighboring data set 202-2 of a sample on the right side is also read from the codeblock1. Similarly, a neighboring data set of a sample on the right side is read from the codeblock3 to the codeblock14, and a neighboring data set 202-16 of a sample on the right side is read from the codeblock15. The data set 202-1 to the data set 202-16 are arranged in parallel in the register, in a similar way to the data set 201-1 to the data set 201-16.
The input data is processed in a similar way to the case of the data set 201-1 to the data set 201-16. That is, for example, as shown in
As shown in
Returning to
In this respect, problems of the MQ coding in the related art will be described. If data on symbols and contexts in which the control information is invalid is generally encoded by the MQ coding, the code word is not generated. Accordingly, in the case of the example in
Then, the data integrating section 152 firstly integrates the input data and the buffer data, to thereby make the valid data intensive (to increase the density of the valid data).
In the upper sections, the data integrating section 152 firstly searches data in which the control information is invalid (00) in the buffer data, and then detects data in which the control information is valid (FF) in the input data in the same position. In the case of the example in
Further, the data integrating section 152 moves (integrates) the data on the symbols and contexts of the input data in these positions, into the buffer data. In
As shown in the lower section in
As a result, the input data in the position where the movement is performed becomes empty. That is, it becomes data in which the control information is invalid (00). In the case of the example in
In reality, the integration of the input data expanded in the register with the buffer data is similarly performed. That is, since the data integrating section 152 integrates data to a maximum extent, the MQ coding performing section 155 can enhance the efficiency of the MQ coding.
Returning to
In step S226, the data integrating section 152 reads the buffer data from the buffer section 153.
In the case of the example in
In the state before the data integration, the control information of the fourth, seventh and thirteenth samples is valid in the input data, but since the control information of the thirteenth sample of the buffer data is invalid, the data integration is possible in a similar way to the case in
In this respect, since the control information of the fourth and seventh samples of the buffer data is valid, and thus, it is not possible to integrate the input data and the buffer data in these positions.
Accordingly, even in the state after the data integration, the control information of the fourth and seventh samples of the input data remains valid (FF), and thus, it is not possible to destroy the input data.
Accordingly, in this case, the data integrating section 152 reads this buffer data and then MQ-codes it. Further, as shown in the lowest stage in
Returning to
Here, as shown in
Returning to
In the case of the example in
Returning to
In step S230, the register expanding section 151 determines whether an unprocessed sample exists for the obtained code blocks of a predetermined number. If it is determined that the unprocessed sample exists, the procedure returns to step S223 and then repeats the subsequent processes.
Further, in step S230, if it is determined that the unprocessed sample does not exist, the procedure goes to step S231. In step S231, the register expanding section 151 determines whether the unprocessed code block exists in the picture. If it is determined that the unprocessed code block exists, the procedure returns to step S221 and then repeats the subsequent processes.
Further, in step S231, if it is determined that the unprocessed code block does not exist, the MQ coding process is terminated. Then, the procedure returns to step S106 in
As described above, the data integrating section 152 integrates the data and collects the data in which the control information is valid, and the aligning section 154 performs the rearrangement of the data and collects the data in which the control information is valid, so that the MQ coding performing section 155 can omit the MQ coding of the data in which the control information is invalid, to thereby more efficiently perform the MQ coding.
Thus, the image coding apparatus 100 can perform the coding at a higher speed.
The number of the buffer data items stored in the buffer section 153 is arbitrary. That is, a plurality of pieces of buffer data may be provided. In this way, the integration of the input data with the buffer data becomes easier.
For example, as shown in an example in
If the number of the buffer data items is increased, the possibility becomes high. However, the number of the buffer data items is increased, the capacity of the buffer section 153 is increased. That is, an optimal number of the buffer data items is determined according to the intensity of the data in which the control information is valid and, for example, the trade-off with cost or the like.
In the above description, the MQ coding performing section 155 MQ-codes each data in which the control information is valid, which is read from the buffer section 153. However, the MQ coding for the plurality of samples may be performed in parallel so that the coding process can be performed at a high speed.
However, since there are various types of code blocks in the picture, it is efficient to collect similar code blocks in advance and to encode them at one time.
The MQ coding section 312 performs the MQ coding process in a similar way to the MQ coding section 112. However, unlike the case of MQ coding section 112, the MQ coding section 312 performs a plurality of MQ coding processes for data group of different samples in parallel.
The MQ coding section 312 basically has the same configuration as the MQ coding section 112, but has an aligning section 324 instead of the aligning section 154, and has a parallel MQ coding performing section 325 instead of the MQ coding performing section 125, and further has a parallel arithmetic data generating section 321.
The parallel arithmetic data generating section 321 makes code block groups according to parameters indicating characteristics of code blocks so as to perform calculation (MQ coding) in parallel, and supplies the data group of each code block for each group to the register expanding section 151.
That is, as described above, a data group of a plurality of code blocks is input to the register expanding section 151, but the parallel arithmetic data generation section 321 performs a control so that the plurality of code blocks becomes code blocks having the same parameters (characteristics).
The parallel arithmetic data generating section 321 stores data groups supplied (arrow 332) from the bit modeling section 111, groups the data groups for each code block, and then supplies data for each group to the register expanding section 151 (arrow 333).
As the parameters, anything indicating the characteristics of the code blocks may be used, which may include, for example, a horizontal size (h_size) of the code block, a vertical size (v_size) of the code block, sub-band types (LL, HL, LH and HH) and the number of coding passes (num_pass) calculated as will be described later. For example, the coding pass number (num_pass) is calculated as the above-described formula (1). Of course, other parameters may be included.
Like an example shown in
Further, as described above, since the code blocking is performed for the coefficient data, the sub-bands to which each code block in the picture belongs are not all the same. Further, since the numbers of zero bit-planes (number of valid bit-planes) are independent of each other in respective code blocks, the numbers of the coding passes may be different from each other in the respective code blocks.
The parallel arithmetic data generating section 321 compares parameter values of each code block in the picture, and groups the code blocks in which all values are the same, as shown in
In
The parallel arithmetic data generating section 321 appropriately divides the groups sorted according to the parameters so that each group is formed by 16 code blocks to the maximum. A group 371 to a group 376 shown in an example in
In a case where the number of the code blocks in the group is less than 16, the parallel arithmetic data generating section 321 complements dummy data (for example, zero value) as a countermove (the number of the code blocks becomes 16 in a pseudo manner).
The register expanding section 151 accumulates code blocks for every group, and then expands the data groups in the register. At this time, values of parameters (horizontal size, vertical size, coding pass number (valid bit-plane number) and sub-band type) of the code blocks which belong to the same group are all the same as each other. Accordingly, each code block has a data configuration in which parallelization is the easiest, and each sample (each data group) expanded in the register can be MQ-coded in the same method. The number of the code blocks in one group is arbitrary.
Returning to
As shown in
The aligning section 324 distributes the data in which control information is valid to the MQ coding performing sections 155-1 to 155-4 (arrow 338 to arrow 341).
The MQ coding performing sections 155-1 to 155-4 perform the MQ coding while referring to the probability estimation table 156 (arrow 342) with respect to the supplied data, respectively. The MQ coding performing sections 155-1 to 155-4 supply the generated code words to the coded code stream generating section 106, respectively (arrow 343 to arrow 346).
That is, as shown in
The parallel number of the MQ coding is arbitrary.
An example of a flow of the MQ coding process as described above will be described with reference to flowcharts of
If the MQ coding process starts, in step S301, the parallel arithmetic data generating section 321 obtains a data group such as symbols, contexts and control information or the like of a certain sample of a certain block which is supplied from the bit modeling section 111.
In step S302, the parallel arithmetic data generating section 321 determines whether the data groups of all code blocks in the picture are entirely obtained. If it is determined that the data groups are not entirely obtained, the procedure goes to step S301 and then repeats the subsequent processes.
In step S302, if it is determined that the data groups for the all samples of the all code blocks are obtained, the procedure goes to step S303.
In step S303, the parallel arithmetic data generating section 321 performs the grouping of the code blocks on the basis of parameters of the respective code blocks. In step S304, the parallel arithmetic data generating section 321 selects a process target from an unprocessed group.
In step S305, the parallel arithmetic data generating section 321 determines whether the code blocks of a predetermined number (M items (M is a natural number)) exist in the process target group. If it is determined that the code blocks of the predetermined number (M) exist in the process target group, the procedure goes to step S307. If it is determined that the code blocks of the predetermined number (M) do not exist in the process target group, the procedure goes to step S306. In step S306, the parallel arithmetic data generating section 321 adds dummy data (for example, all zero data) corresponding to the number of the code blocks which is lacking for the predetermined number (M items), to the process target group. If the process of step S306 is terminated, the procedure goes to step S307.
In step S307, the register expanding section 151 expands the symbols, contexts and control information of the process target sample of each code block in the process target group in the register. The data group expanded in the register is referred to as “input data”.
In step S308, the data integrating section 152 integrates data in which the control information is valid, among the input data expanded in the register, into a data group (buffer data) stored in the buffer section 153. If the process of step S308 is terminated, the procedure goes to step S321 in
In step S321, the data integrating section 152 determines whether data in which the control information is valid exists in the input data after the integration. If it is determined that the data exists in the input data after the integration, the procedure goes to step S322. In step S322, the data integrating section 152 reads the buffer data from the buffer section 153.
In step S323, the aligning section 324 performs rearrangement of the buffer data read from the buffer section 153, and then collects the data in which the control information is valid. In step S324, the parallel MQ coding performing section 325 MQ-codes the respective data in which the control information is valid, in parallel.
In step S325, the data integrating section 152 supplies the input data of the register to the buffer section 153 for storage. If the process of step S325 is terminated, the procedure goes to step S326. Further, if it is determined in step S321 that the data in which the control signal is valid does not exist in the input data, the procedure goes to step S326.
In step S326, the register expanding section 151 determines whether an unprocessed sample exists for the code blocks which belong to the process target group. If it is determined that the unprocessed sample exists, the procedure returns to step S307 in
Further, in step S326 in
Further, in step S327 in
As described above, the MQ coding section 312 can perform a plurality of MQ coding processes in parallel, and can perform the MQ coding more efficiently, compared with the case of the MQ coding section 112. Thus, the image coding apparatus 100 can perform the coding at a higher speed. Further, since only a valid MQ coding is performed in principle, it is possible to omit unnecessary processes.
The length of the register of expanding the data is arbitrary. Generally, the length of a data register of a computer or hardware is determined at an initial design stage. That is, the register length mainly depends on the specification of the hardware.
The configuration shown in
In the MQ coding section 312 shown in
Further, in the bit modeling section 111, the bit modeling may be parallelized. In this case, in a similar way to the parallelization case of the MQ coding as described with respect to
In the case of parallelizing the bit modeling, if the MQ coding is performed for each parallelized bit modeling, each MQ coding section may be realized as in the MQ coding section 112 in
The series of processes as described above can be realized by hardware, or can be realized by software. In this case, a personal computer shown in
In
The CPU 501, the ROM 502 and the RAM 503 are connected to each other through a bus 504. An input and output interface 510 is also connected to the bus 504.
An input section 511 including a keyboard, a mouse or the like; an output section 512 including a display such as a CRT (Cathode Ray Tube) or an LCD (Liquid Crystal Display), a speaker and the like; and a storage section 513 including a hard disc or the like; and a communication section 514 including a modem or the like are connected to the input and output interface 510. The communication section 514 performs a communication process through a network including the Internet.
Further, a drive 515 is connected to the input and output interface 510, and a removable media 521 such as a magnetic disc, optical disc, magneto-optical disc, semiconductor memory or the like are appropriately installed to the input and output interface 510, as necessary. Further, computer programs read from the removable media 521 are installed in the storage section 513 as necessary.
In a case where the above-described series of processes are performed by software, a program for forming the software is installed from a network or a recording medium.
As shown in
The program executed by the computer may be processed in a time series manner in the order as mentioned in this description, may be processed in parallel, or may be processed at such a necessary timing that the program is called.
Further, in this description, the step of describing the program which is recorded in the recording medium may include a process which is performed in a time series manner in the described order, or may include a process which is performed in parallel or independently, differently from the time series process.
Further, in this description, the term “system” refers to the entire apparatus including a plurality of devices.
In this respect, the configuration described as a single device (or processing section) may be divided into a plurality of devices (or processing sections). Opposite to this, the configuration described as a plurality of devices (or processing sections) may be integrated into a single device (or processing section). Further, a different configuration may be added to the configuration of each device (or processing section). Further, as long as the configuration or operation of the entire system is substantially the same, a part of a configuration of a specific device (or processing section) may be integrated into a configuration of a different device (or different processing section). That is, the embodiments of the present invention are not limited to the above description, and can be variously modified without departing from the spirit of the invention.
The embodiments of the present invention may be applied, for example, to digital cinema editing apparatuses, archive systems, image transmission apparatuses in broadcasting stations, image databases, medical image recording systems, network servers, non-linear editing apparatuses, game machines, television set systems, HDD recorders, authoring tools on personal computers, software modules thereof, or the like.
The present application contains subject matter related to that disclosed in Japanese Priority Patent Application JP 2009-242770 filed in the Japan Patent Office on Oct. 21, 2009, the entire content of which is hereby incorporated by reference.
It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and alterations may occur depending on design requirements and other factors insofar as they are within the scope of the appended claims or the equivalents thereof.
Number | Date | Country | Kind |
---|---|---|---|
P2009-242770 | Oct 2009 | JP | national |