The present invention relates to an image decoding technique of performing data conversion in order to reduce a bandwidth required to transmit a bitstream, and more specifically relates to an image decoding method and an image decoding device which perform data conversion in order to minimize a maximum code length of compressed image data.
In recent years, the H.264 standard (Non-Patent Reference 1) and the VC-1 standard (Non-Patent Reference 2) are being adopted as image coding techniques, in order to implement high-compression of moving picture data. In these techniques, compressed image data (hereinafter called bitstream) is temporarily stored in a buffer. The stored bitstream is transmitted to an image decoder within a certain time limit in order to maintain the real-timeliness of image decoding. In recent years, this time limit is becoming shorter because of increased high-definition of images and simultaneous transmission of plural images, and as a result, the bandwidth (amount of data to be transmitted÷transmission time) required for transmitting a bitstream to the image decoder within the time limit is increasing.
In addition, in the H.264 standard and the VC-1 standard, although an image is decoded by being divided into plural blocks, the coding result for each block (hereinafter called a macroblock) can be of a wide range extending from 0 bits to several 1000 bits. As such, in order to transmit the bitstream to the image decoder within the time limit, it is necessary to presume the case where the coding result of a macroblock is the maximum bit amount, and thus a large bandwidth becomes necessary in order to transmit the bitstream to the image decoder.
As described above, in recent years, the bandwidth for transmitting the bitstream to the image decoder has increased considerably. However, in the H.264 standard and the VC-1 standard, as a an implementation problem, there are no constraints in the method for transmitting a bitstream to the image decoder, and thus the bandwidth for transmitting the bitstream to the image decoder becomes a problem in the configuration of an image decoding device.
To solve this problem, it is necessary to reduce the bandwidth for transmitting the bitstream to the image decoder. Since this bandwidth is determined by the maximum bit amount of the macroblock coding results as described earlier, it is sufficient to reduce the bit amounts of the macroblock coding result so that the maximum bit amount of the macroblock coding results does not exceed the bit amount that can be transmitted using a provided bandwidth.
Meanwhile, Patent Reference 1 shows a method for reducing the bit amounts of macroblock coding results. The method in Patent Reference 1 reduces the bit amounts of the macroblock coding results by converting, into codes of higher compression rate, the respective codes (a mode code indicating the coding method, a motion vector code, a code indicating a DCT coefficient, and so on) in a macroblock that is coded using the MPEG-2 standard. However, since the method in Patent Reference 1 is intended for reducing an average bit amount of the macroblock coding results, there is no assurance that the maximum bit amount of the macroblock coding results will be reduced.
FIG. 1 is a diagram showing a coding rule for codes before conversion, in the code conversion in Patent Reference 1.
FIG. 2 is a diagram showing a coding rule for codes after conversion, in the code conversion in Patent Reference 1.
Specifically, in Patent Reference 1, although the codes in FIG. 1 are converted into the codes in FIG. 2, the maximum number of bits of code, that is, the number of bits of the code at the lowest level in the chart in FIG. 1 and the number of bits of the code at the lowest level in the chart in FIG. 2 are both six bits, and are thus mutually the same.
However, in the method for reducing the macroblock bit amount having the above-described conventional configuration, since the problem is the reduction of average bit amounts of the macroblock coding results and not the maximum bit amount of the macroblock coding results, reduction of the maximum bit amount of the macroblock coding results is not possible.
Furthermore, when configuring an image decoder which decodes an image in real time within the range indicated by the image coding standards in Non-Patent Reference 1 and so on, the bandwidth for transmitting a bitstream to the image decoder is determined according to the maximum bit amount of the macroblock coding results. In the image coding specifications in Non-Patent Reference 1 and so on, the bit amounts of the macroblock coding results vary for each macroblock in a range extending from 0 bits to several 1000 bits. As a result, when performing real time image decoding, there is the problem that the bandwidth for transmitting a bitstream to the image decoder becomes large, and the cost of the image data decoder resulting from the enhancement of the performance of the buffer for storing the bitstream increases.
In this manner, there exists, conventionally, an image data decoding device which decodes image data and includes a decoding unit which obtains image data inputted to the decoding device, and decodes the obtained image data. However, at the time when the technique for the standard was conceived, it was not foreseen that, due to increased high-definition of images and simultaneous transmission of images, the bandwidth for transmitting image data would increase considerably. On the other hand, in the process of actually creating an image data decoding device implementing the standards, the occurrence of the problem that the maximum bit amount of the macroblock coding results becomes large and thus the required bandwidth becomes large, has been recognized.
Here, for example, with CABAC codes in the H.264 standard, the bitstream of the coding result is compressed using arithmetic codes. With the arithmetic codes used in CABAC codes, since decoding must be a serial process, it is difficult to obtain a decoding performance that suits the processing performance of the image decoder. Consequently, a decoding device which handles CABAC codes is configured so that the decoding results for the arithmetic codes are stored in a buffer corresponding to the CPB of the standard, and an image decoder decodes the result of the decoding of the arithmetic codes. However, with this configuration, the restored results of compressing the arithmetic codes are transmitted to the image decoder, and thus the maximum bit amount for the macroblocks is large at about 5000 bits, and the required bandwidth for transmitting the decoding results from the buffer to the image decoder becomes extremely large. For example, in this manner, the problem that the maximum bit amount for the macroblocks becomes large and the required bandwidth becomes large occurs.
Such a problem is a problem that is common to image data decoding devices which decode image data.
Consequently, the present invention is conceived to solve such problem and has as an object to provide a decoding device that can reduce the maximum bit amount of the macroblock coding results.
In order to solve the above-described conventional problem, the image data decoding apparatus according to the present invention adopts the subsequent configuration.
The image data decoding device according to an aspect of the present invention is an image data decoding device which decodes image data, the image data decoding device including: a code converting unit configured to convert image data inputted to the image data decoding device into image data coded according to a second coding rule in which a maximum code length is shorter than in a first coding rule used to code the inputted image data; and a decoding unit configured to obtain the image data after the conversion by the code converting unit, and to decode the obtained image data.
Furthermore, a computer program according to an aspect of the present invention is a computer program for causing an image data decoding device to decode image data, the computer program causing the image data decoding device to execute: a code converting function of converting image data inputted to the image data decoding device into image data coded according to a second coding rule in which a maximum code length is shorter than in a first coding rule used to code the inputted image data; and a decoding function of obtaining the image data after the conversion through the code converting step, and decoding the obtained image data.
It should be noted that, in the case where other data aside from image data is transmitted through the bus, the “bandwidth” identified by the bandwidth information and through which the image data is transmitted in claim 3 is assumed to be the bandwidth related to the transmission of image data excluding the portion concerning such other data, out of the entire bandwidth. The “bandwidth information” may be, for example, a target bit amount for image data or a target bit amount for units-of-transmission included in image data. Furthermore, the reducing unit may remove a DC coefficient only when a predetermined AC coefficient is not included within the unit-of-transmission of the image data.
On the other hand, the image data decoding device in an aspect of the present invention may be as described below. That is, the image data decoding device in an aspect of the present invention may be an image data decoding device including: a data converting unit which converts image data coded according to a first coding rule into image data coded according to a second coding rule in which a maximum code length is shorter than in the first coding rule; and an image decoding unit which decodes the image data converted by the converting unit.
According to this image data decoding device, by taking advantage of the fact that the bandwidth of a bitstream to be inputted to the image decoder is determined by the maximum bit amount of the result of coding macroblocks; applying, to the input bitstream, the conversion into codes in which the maximum bit amount for the macroblocks is reduced or the reduction of the amount of information such that the maximum bit amount for the macroblocks is reduced; and, in addition, by configuring the image decoder so as to handle the code conversion or information amount reduction that has been applied, it is possible to reduce the bandwidth of a bitstream inputted to the image decoder, and provide a decoding device which can reduce the bandwidth of a bitstream inputted to the image decoder.
It should be noted that the data converting unit may perform code conversion separately for motion vector information and coefficient values.
Furthermore, the image data decoding device may further include: a buffer which stores image data outputted from the data converting unit; and an obtaining unit which obtains a bandwidth for the buffer, wherein the data converting unit may perform data transmission when the maximum data length of the image data in the unit-of-transmission to the buffer exceeds the bandwidth obtained by the obtaining unit.
Furthermore, the image data decoding device may further include: a buffer which stores image data outputted from the data converting unit; an obtaining unit which obtains a bandwidth for the buffer; a bit number control unit which obtains a bandwidth for image data outputted from the buffer, sets a target value based on the obtained bandwidth, counts, for each unit-of-transmission, the number of bits for the code-converted image data on which code conversion has been performed, and sends out a data reduction command when the counted number of bits exceeds the target value; and a reducing unit which reduces the number of bits of the code-converted image data, upon receiving the reduction command.
Furthermore, the reducing unit may reduce the number of bits in the order of a luminance AC, a chrominance AC, a luminance DC, and a chrominance DC.
Furthermore, the first coding rule may be a coding rule for coding to unequal-length codes, the second coding rule may be a coding rule for coding in which unequal-length codes and equal-length codes are switched and the maximum code length in the second coding rule is a code length of equal-length code.
Furthermore, the present invention may be configured as a decoding method of decoding image data, the method including: converting image data coded according to a first coding rule into image data coded according to a second coding rule in which a maximum code length is shorter than in the first coding rule; and decoding the image data converted in the converting.
Furthermore, the present invention may be configured as an integrated circuit used in a decoding device which decodes image data, the integrated circuit including: a data converting unit which converts image data coded according to a first coding rule into image data coded according to a second coding rule in which a maximum code length is shorter than in the first coding rule; and an image decoding unit which decodes the image data converted by the converting unit.
In order to reduce the bandwidth to the image decoder, the present invention, by being provided with a converting unit which reduces the maximum number of bits for code lengths, converts a bitstream into codes configured such that the maximum bit amount for macroblocks is reduced, before the bitstream is stored in a buffer, and decodes the bitstream after conversion, using an image decoder. Accordingly, since the maximum bit amount of the macroblock coding result is reduced, it is possible to reduce the bandwidth for transmitting a bitstream to the image decoder, which is required for real-time image decoding. Furthermore, since high-performance is not required of the buffer for storing the bitstream, the image decoder can be implemented at a lower cost.
Hereinafter, embodiments of the present invention shall be described with reference to the Drawings.
The decoding device 100 in
The code converting unit 101 reads a bitstream coded according to the H.264 standard from a source outside the decoding device 100, processes the read bitstream according to the code conversion procedure described later (see description for
The buffer 102 functions as a CPB (Coded Picture Buffer) required in the H.264 standard, and stores the bitstream outputted from the code converting unit 101 into a storage device such as a memory, and so on, and outputs the stored bitstream in response to a read request from the image decoder 103.
The image decoder 103 obtains the bitstream in the form outputted by the code converting unit 101, decodes the obtained bitstream, and outputs an image which is the decoding result. It should be noted that, in the image decoder 103, a variable-length code decoding unit of a decoder compatible to the H.264 standard has been altered to allow decoding of the bitstream outputted by the code converting unit 101. As a result, in order to properly decode an image, the conversion performed by the code converting unit 101 is performed in such a way that there is no impact on regulations other than that for the variable-length coding in the image coding standard. It should be noted that such image decoder 103 and code converting unit 101 are examples and do not place any limitations.
The frame memory 104 stores the decoding result images outputted by the image decoder 103, into a storage device such as a memory and so on. The image stored by the frame memory 104 is used as a reference image at the time of image decoding and as a buffer at the time of decoding result outputting, and so on.
A bitstream decoding unit 201 decodes the bitstream coded according to the image coding standard, and sends the input bitstream directly to a bitstream generating unit 202 when a stream code converting unit 203 (stream code converting units 203x) will not perform conversion, and sends the input bitstream to the stream code converting unit 203 (stream code converting units 203x) when conversion is to be performed.
The bitstream generating unit 202 binds the bitstreams outputted from the bitstream decoding unit 201 and the stream code converting unit 203, and outputs the result as a bitstream that can be decoded by the image decoder 103.
The stream code converting unit 203 converts the codes outputted by the bitstream decoding unit 201 into codes configured so that the maximum bit amount is reduced, and outputs each code in the conversion result as a bitstream to the bitstream generating unit 202. The stream code converting units 203x include, as stream code converting units 203, a motion vector code converting unit 204 and a coefficient value code converting unit 205, that is, the motion vector code converting unit 204 and the coefficient value code converting unit 205 are included among the plural stream code converting units 203 that are included in the stream code converting units 203x. Details of these shall be described later.
Hereinafter, the procedure for code conversion of CAVLC (Context Adaptive Variable Length Coding) codes in the H.264 standard shall be described.
In the application of the present invention to CAVLC codes, the code converting unit 101 converts only the motion vector (hereafter denoted as mvd) and the coefficient value (hereafter denoted as level) among the parameters included in a bitstream (denoted in the standard as macroblock_layer( ), into codes in which the maximum code length is reduced, and outputs the others without performing conversion. The reason why only the mvd and the level are converted in the present embodiment is that, in a macroblock of which the bit amount is the maximum, most of the bits are used in the coding of the mvd and the level.
The bitstream decoding unit 201 decodes an inputted bitstream in accordance with the standard (step S301). Next, the bitstream decoding unit 201 classifies the decoding result of the preceding step S301 into: mvd_I0 and mvd_I1 which correspond to motion vectors; level_prefix and level_suffix which correspond to coefficient values; and others (step S302). Furthermore, based on the result of the classification in step S302, the bitstream decoding unit 201 outputs the others aside from the motion vectors and the coefficient values directly to the bitstream generating unit 202 (see
It should be noted that the above-described others aside from the motion vectors and the coefficient values, which the bitstream decoding unit 201 outputs directly to the bitstream generating unit 202 in step S303, are mostly 1 bit data or data that is coded using a fixed-length code, for example. By not performing code conversion up to the others portion mentioned above, the decoding device 100 allows the configuration of the device to be simplified. Inversely, according to the decoding device 100, code conversion is performed on motion vectors and coefficient values, which are data of two bits or more and data that are coded using variable-length codes, and thus the bus length can be sufficiently reduced while simplifying the configuration of the device.
The motion vector code converting unit 204 performs code conversion on the inputted motion vectors (step S304 in
These codes take advantage of the fact that the values of mvd_I0 and mvd_I1 can be expressed by 15-bit signed fixed-length codes, and a fixed-length code is adopted for an absolute value of 128 or higher for which 15 bits or more become necessary using the original Exp-Golomb code, and the Exp-Golomb code is adopted for the others. In this case, since it is necessary to judge which between coding using fixed-length code and coding using Exp-Golomb code the coding method is in the decoding of the bitstream after the conversion, 0 is added to the beginning of the code when it is a fixed-length code, and 1 is added when it is a Exp-Golomb code. With this code conversion, the maximum code length of mvd_I0 and mvd_I1 is reduced from 31 bits to 16 bits, and the maximum bit amount for macroblocks is reduced from 992 bits to 512 bits. On the other hand, in this code conversion, the code length increases 1 bit when the absolute value is 127 or lower. In general, since the absolute value of mvd_I0 and mvd_I1 are often small, the average number of bits for macroblocks increases due to this conversion. However, for a macroblock for which the absolute value of mvd_I0 and mvd_I1 are small, very often the bit amount for the entire macroblock becomes significantly smaller than the maximum bit amount, and thus the increase in the macroblock maximum bit amount caused by the 1-bit increase of the code length when absolute value is 127 or lower can be disregarded.
The coefficient value code converting unit 205 performs code conversion on the coefficient values (step S305). Next, the code conversion of coefficient values shall be described. In the CAVLC code in the H.264 standard, the coefficient values are denoted as the two codes level_prefix and level_suffix as shown in
Since the range of the coefficient values is restricted to −131072 to 131071 in the standard, the coefficient values can be represented using 18-bit signed fixed-length codes. Consequently, in
The decoding device 100 repeatedly executes the above-described processing in
In this manner, the decoding device 100 is a decoding device 100 which decodes image data (bitstream, macroblock), and includes the code converting unit 101 (
In addition, the image data includes motion vectors and coefficient values, and the code converting unit 101 includes: the motion vector code converting unit 204 (
It should be noted that, in this manner, with the “code converting unit” described in the Claims, in the case where the image data is divided into n (n≧2) portions and the respective portions are coded according to a mutually different type of coding rule, image data of a k-th portion coded according to a first coding rule of a k-th type (1≦k≦n) may be converted to image data of the k-th portion coded according to a second coding rule of the k-th type (1≦k≦n), and the maximum code length of the second coding rule of the same k-th type may be shorter than the maximum code length of the first coding rule of the k-th type. It should be noted that, in this case, the image data need not be made up of only the above-described n portions, and may be configured of the above-described n portions and other portions.
Furthermore, the decoding device 100 further includes the buffer 102 for storing the image data after the conversion by the code converting unit 101, and the image decoder 103 obtains the image data stored in the buffer 102 and decodes the obtained image data. The decoding device 100 further includes a bus B for transmitting image data between the buffer 102 and the outside of the buffer 102. As shown in
Furthermore, in the coding rule in
Furthermore, the respective codes for which associations are established according to the coding rule in
Here, in the case where all the values (0 to −16384) for which associations are established according to the coding rule in
In addition, in both cases of the aforementioned short code length codes and the aforementioned long code length codes, the code for which association is established according to the coding rule in
For example, a code “1—010” corresponding to mvd value 1 in
An identification bit has a value 1 when the code in which such identification bit is included is a short code length code described above (the codes of values 0 to −127 in
On the other hand, in the case where the code including the body is a short code length code, the body is the same code as the code associated with the value indicating such short code length code, in the coding rule in
In addition, in the case where the code including the body is a long code length code, the body is an equal-length code having the size of the above-described switching size. For example, in
In this manner, in the coding rule in
In the same manner, in the coding rule in
It should be noted that, the decoding device 100 may be a decoding device in which, for example, the code converting unit 101, the buffer 102, the bus B, the image decoder 103, the frame memory 104 are implemented in a integrated circuit (LSI) included in the decoding device 100.
It should be noted that the code converting unit 101 may be configured as a circuit having, for example, the codes before conversion shown in
In this manner, according to the code conversion in the present embodiment, the maximum bit amount for the macroblocks is reduced, and thus it is also possible to reduce the bandwidth for transmitting the bitstream to the decoder, determined based on the maximum bit amount for the macroblocks. It should be noted that the image decoder 103 in the present embodiment is a variable-length code decoding unit for handling motion vectors and coefficient values out of the image decoding processes stipulated in the standards, that has been modified to handle the codes in
With such a decoding device 100, inputted image data is converted by the code converting unit 101 into image data of the coding rule in
Although the first embodiment of the present invention has been described up to this point, various modifications are possible in the present embodiment within a scope that does not exceed the essence of converting codes to reduce the maximum code length. As an example of a modification, application to image coding standards other than H.264, such as VC-1 or MPEG-2, is possible. Since motion vectors and coefficient values occupy the majority of the maximum bit amount for macroblocks even in image coding standards other than H.264, the same effect as in the present embodiment can be obtained by converting the respective codes into codes in which the maximum code length is reduced.
It should be noted that each function block shown in
Furthermore, the decoding device in the first embodiment may further include an obtaining unit which obtains a bandwidth for the buffer, and perform code conversion only when the number of bits for each processing-unit of an inputted bitstream exceeds the obtained bandwidth. In this regard, it is preferable to affix, to the stream, an identifier for identifying whether it is a stream before conversion or a stream after conversion (see
The decoding apparatus 100A shown in
The coefficient reducing unit 801 reads the bitstream outputted by the code converting unit 101 and, by removing the coefficient value of the orthogonal convert (DCT and so on) application result included in a macroblock for each of the macroblocks included in the read bitstream, reduces the bit amount of the macroblocks, so that the bit amount of the macroblock approaches a specified value. In the second embodiment, coefficient reduction is performed in the case where, even when the code conversion such as that in the first embodiment is performed, the bit amount for the macroblock is greater than a target. In the second embodiment, the maximum bit amount for the macroblocks that is obtained from the bandwidth that can be allocated to the transmission of a bitstream to the decoder is set as a target bit amount. As such, in the second embodiment, it is possible to reduce the bit amount for macroblocks so that the bandwidth required for transmitting the bitstream falls within a predicted value. It should be noted that for the target bit amount, a bit amount corresponding to the bus width of the bus B and which can be adequately transmitted using the bus B is selected.
It should be noted that an example of the “bandwidth information” in the Claims is shown in the second embodiment by the above-described target bit amount.
Hereinafter, the operation of the coefficient reducing unit 801 shall be described.
(1) Remove from the AC coefficients (high-frequency component out of the orthogonal convert application result), and remove DC coefficients (direct current component out of the orthogonal convert application result) only when there are no more AC coefficients.
(2) In the removal of the AC coefficients and the DC coefficients, luminance coefficient removal and chrominance coefficient removal are performed alternately.
(3) Bit amount judgment is performed each time one coefficient is removed and ends at the point when the target is reached.
(4) Coefficient removal is performed on a coefficient having a non-zero value.
In performing the processing in step S1005 in.
Subsequently, in an AC coefficient presence judging step S1102, the reducing unit 902 first checks whether a non-0 value is present in the AC coefficients decoded in step S1101, and the process proceeds to a DC coefficient judging step S1107 when a non-0 value is not present (step S1102: not present) and proceeds to a luminance AC coefficient removing step S1103 when present (step S1102: present).
In the luminance AC coefficient removing step S1103, the reducing unit 902 first removes one coefficient corresponding to the highest frequency and having the largest value among the non-0 coefficients of the luminance AC coefficients decoded in step S1101, and obtains the macroblock bit amount after the removal.
Subsequently, in a target bit amount judging step S1104, the reducing unit 902 checks whether the macroblock bit amount obtained in step S1103 has reached the target, and the process proceeds to a chrominance AC coefficient removing step 1105 when the target is not reached (step S1104: not achieved) and proceeds to a coefficient coding step S1112 when reached (step S1104: achieved).
In the chrominance AC coefficient removing step 1105, the reducing unit 902 first removes one coefficient corresponding to the highest frequency and having the largest value among the non-0 coefficients of the chrominance AC coefficients decoded in step S1005, and obtains the macroblock bit amount after the removal.
Subsequently, in a target bit amount judgment step S1106, the reducing unit 902 checks whether the macroblock bit amount obtained in step S1105 has reached the target. The process proceeds to the AC coefficient presence judging step S1102 in order to perform the removal of an AC coefficient again when the target is not reached (step S1106: achieved), and proceeds to the coefficient coding step S1112 when reached (step S1106: not achieved).
In the DC coefficient judging step S1107, the reducing unit 902 first checks whether a non-0 value is present in the DC coefficients decoded in step S1101, and the process proceeds to the coefficient coding step S1112 when a non-0 value is not present (step S1107: not present) and proceeds to a luminance DC coefficient removing step S1108 when present (step S1107: present).
In the luminance DC coefficient removing step S1108, the reducing unit 902 first removes one coefficient having the largest value among the non-0 coefficients of the luminance DC coefficients decoded in step S1101, and obtains the macroblock bit amount after the removal.
Subsequently, in a target bit amount judging step S1109, the reducing unit 902 checks whether the macroblock bit amount obtained in step S1108 has reached the target, and the process proceeds to a chrominance DC coefficient removing step 1110 when the target is not reached (step S1109: not achieved) and proceeds to the coefficient coding step S1112 when reached (step S1109: achieved).
In the chrominance DC coefficient removing step S1110, the reducing unit 902 first removes one coefficient having the largest value among the non-0 coefficients of the chrominance DC coefficients decoded in step S1101.
Subsequently, in a target bit amount judging step S1111, the reducing unit 902 checks whether the macroblock bit has reached the target, and the process proceeds to the DC coefficient judging step 1107 when the target is not reached (step S1111: not achieved) and more coefficients are removed, and proceeds to step S1112 when reached (step S1111: achieved).
When the target is reached, the process proceeds to the coefficient coding step S1112. Lastly, in the coefficient coding step S1112, the reducing unit 902 codes the luminance AC coefficients, the luminance DC coefficients, the chrominance AC coefficients, and the chrominance DC coefficients on which the above-described reduction process has been performed, and outputs the result as a bitstream. The coding is configured so as to output the format after the application of the code conversion performed by the code converting unit 101.
As described above, the decoding device 100A is configured to include: a coefficient reducing unit 801 (see coefficient reducing control unit 905,
In addition, in such a decoding device 100A, the reducing unit 902 removes a DC coefficient when, between AC coefficients and DC coefficients, an AC coefficient is not included (step S1102: not present, in
Furthermore, the reducing unit 902 judges whether or not the bit amount of the macroblock from which a luminance coefficient has been removed (step S1103, S1108) has reached the target (step S1104, S1109), and removes a chrominance coefficient of the macroblock (step S1105, step S1110) only when it is judged that the bit amount of the macroblock from which a luminance coefficient has been removed has not reached the target (step S1104: not achieved, step S1109: not achieved).
In this manner, among the four types of coefficients of the luminance AC, the luminance DC, the chrominance AC, and the chrominance DC, and based on a removing priority that decreases in such sequence, the reducing unit 902 reduces the bit amount for a macroblock by removing a coefficient having the highest priority among the types of coefficients included in the macroblock.
There are cases where the macroblock bit amount is larger than the target bit amount even when coefficients are removed in the above-described procedure. In such a case, the holding of the difference from the target bit amount by the coefficient reduction control unit 905 is utilized, and the target bit amount for a subsequent macroblock is reduced by such difference. In other words, in such a case, the coefficient reduction control unit 905 reduces, by the aforementioned difference, the target bit amount in the processing of the subsequent macroblock. With this operation, it is possible to reduce the increase in bandwidth caused by a macroblock for which the target bit amount has not been reached.
In this manner, in the second embodiment, it is possible to increase or decrease the bit amount for macroblocks on a macroblock basis. Using this allows for applications such as reducing the overall bandwidth for image decoding by reducing the target bit amount for a macroblock on which motion compensation is to be performed, and using, in reference image transmission, the bandwidth for stream transmission that has been reduced as a result thereof.
Next, a method for applying the present embodiment to CAVLC (Context Adaptive Variable Length Coding) codes in the H.264 standard shall be described. First, a method for restructuring the luminance DC coefficients, the luminance AC coefficients, the chrominance DC coefficients, and the chrominance AC coefficients in the coefficient decoding step S1101 (
(1) Intra16×16DCLevel
Luminance DC coefficients (block size 16×16, 16 coefficients)
(2) Intra16×16ACLevel
Luminance AC coefficients (block size 16×16, 16 sets of 15 coefficients)
(3) LumaLevel
Luminance coefficients (block size 4×4 or 8×8, 16 sets of 16 coefficients)
(4) ChromaDCLevel
Chrominance DC coefficients (in a 4:2:0 format, 2 sets of 4 coefficients)
(5) ChromaACLevel
Chrominance AC coefficients (in a 4:2:0 format, 8 sets of 15 coefficients)
Among the coefficients to be restructured, the chrominance DC coefficient and the chrominance AC coefficients can be used, as is, as the restructured results. On the other hand, the luminance DC coefficients and the chrominance AC coefficients are used by selecting from the following three, according to the orthogonal convert block size for the macroblock.
(1) When the block size is 16×16
For the luminance DC coefficients, Intra16×16DCLevel is used.
For the luminance AC coefficients, Intra16×16ACLevel is used.
(2) When the block size is 8×8
For the luminance DC coefficients, LumaLevel [i] [0](i=0, 4, 8, 12) is used.
For the luminance AC coefficients, a LumaLevel other than that above is used.
(3) When the block size is 4×4
For the luminance DC coefficients, LumaLevel [i] [0](0≦i≦15) is used.
For the luminance AC coefficients, a LumaLevel other than that above is used.
With the above-described procedure, it is possible to restructure the luminance DC coefficients, the luminance AC coefficients, the chrominance DC coefficients, and the chrominance AC coefficients. With regard to subsequent coefficient removal, the method indicated in the description of the coefficient removing step S1005 can be applied as is. In the re-coding of the result of the application of coefficient removal, the Level_Prefix and Level_Suffix in the coding of the coefficient values shall be as in
Although the second embodiment of the present invention has been described thus far, various modifications are possible for the second embodiment without exceeding the feature of reducing the number of bits of the macroblocks through coefficient removal. As a specific modification, a method which utilizes the changing of coefficient values in bit amount reduction is also possible, aside from the application to moving picture coding standards such as MPEG-2 or VC-1 or coefficient removal.
It should be noted that each function block shown in
In the decoding device 100B shown in
The arithmetic code decoder 1201 performs arithmetic decoding on a bitstream that has been coded using CABAC (Context Adaptive Binary Arithmetic Coding) codes in the H.264 standard, and outputs the decoding result as a bitstream.
Here, with CABAC codes in the H.264 standard, the bitstream of the coding result is compressed using arithmetic codes. With the arithmetic codes used in CABAC codes, since decoding must be a serial process, it is difficult to obtain a decoding performance that suits the processing performance of the image decoder. Consequently, a decoding device which handles CABAC codes is configured so that the decoding results for the arithmetic codes are stored in the buffer 102 corresponding to the CPB of the standard, and the image decoder decodes the result of the decoding of the arithmetic codes. However, with this configuration, since the restored results of compressing the arithmetic codes are transmitted to the image decoder, the maximum bit amount for the macroblocks is large at about 5000 bits, and the required bandwidth for transmitting the decoding results from the buffer 102 to the image decoder becomes extremely large. In order to solve this problem, in the third embodiment, the code conversion described in the first embodiment or the coefficient value conversion described in the second embodiment is applied to the large portion occupied by the arithmetic code decoding result.
Hereinafter, the processing by the code converting unit 1202 and the coefficient reducing unit 1203 in
First, the code conversion performed by the code converting unit 1202 shall be described. With the code converting unit 1202, code conversion is applied to reference image indices (ref_idx_I0, ref_idx_I1) and a quantization parameter (mb_qp_delta), in addition to the motion vectors (mvd_I0, mvd_I1) and the coefficient values (coeff_abs_level_minus1, coeff_sign_flag). Hereinafter, the code conversion for each element shall be described.
Consequently, with the codes in
It should be noted that in the case of the coding rule in
In this manner, although the format in which the codes after conversion are separated into long code length codes and short code length codes has been described in detail in the foregoing description (see
The code converting unit 1202 in the third embodiment has been described thus far. With the code conversion shown here, the maximum bit amount for the macroblocks can be reduced from approximately 5000 bits to approximately 3500 bits. It should be noted that the code conversion shown here is merely one example, and various modifications are possible without exceeding the essence of reducing the maximum code length by code conversion. Specifically, there is a method in which the original codes are not outputted as is, and are instead converted into Exp-Golomb codes, and so on.
Next, the coefficient reducing unit 1203 in third embodiment shall be described. Since the coefficient reducing unit 1203 in third embodiment is configured in the same manner as the coefficient reducing unit 1203 described in the second embodiment, description regarding the configuration shall be omitted.
Next, the procedure for coefficient reduction in CABAC in the H.264 standard shall be described. With the CABAC codes in the H.264 standard, the handling of the luminance DC coefficients and luminance AC coefficients in an orthogonal convert with an 8×8 block size is different with that in the CAVLC codes in the H.264 standard shown in the second embodiment. Consequently, when the block size is 8×8, the luminance DC coefficients use LumaLevel8×8[0][0](0≦i≦3), and the luminance AC coefficients a use a LumaLevel8×8 other than the above. Other than this, the operation of the coefficient reducing unit 1203 is the same as that in the case of the CAVLC codes in the H.264 standard described in the second embodiment.
Even in the third embodiment, there are cases where the macroblock bit amount after coefficient removal is larger than the target bit amount. In such a case, it is possible to utilize the outputting of the difference from the target bit amount by the coefficient reduction control unit 905 included in the coefficient reducing unit 1203 in the third embodiment, and perform control such as causing the target bit amount for a subsequent macroblock to be reduced by such difference.
In this manner, in the third embodiment, the bandwidth for transmitting a bitstream to the image decoder can be increased or decreased on a macroblock basis. Using this allows for control such as reducing the target bit amount for a macroblock on which motion compensation is to be performed, and using, in reference image transmission, the bandwidth for stream transmission that has been reduced, and thus reducing the overall bandwidth required for image decoding.
Thus far, the third embodiment has been described exemplifying a bitstream that has been coded using CABAC codes in the H.264 standard. It should be noted that the method for code removal shown here is merely one example, and various modifications are possible without exceeding the feature of the present configuration of reducing the code length of macroblocks by removing coefficients and the like. As an example of a modification, it is possible to have a method that reduces values instead of removing coefficients.
It should be noted that each function block shown in
Here, the code converting unit 1202 converts codes into the codes in the coding rule shown in
In the coding rule in
In this manner, in the coding rule in
With this, even without using an equal-length code having many bits for denoting an equal-length code value of a wide range, the mvd value can be recorded using an equal-length code having few bits, such as, for example, an equal-length code having the minimum bits corresponding to the number of the mvd value denoted by a long code length code.
It should be noted that this point is also true for the coding rule in
It should be noted that, in the third embodiment, according to the two's complement principle, instead of denoting the equal-length code value, the body of the code shown in
As a fourth embodiment, a modification of the third embodiment (see
The decoding device 100C includes a post-conversion maximum code length identifying unit 1301, a rule type-displaying flag adding unit 1303, and a switching unit 1304.
The post-conversion maximum code length identifying unit 1301 identifies the maximum code length from among the code lengths of codes included in macroblocks after codes are converted by the code converting unit 1202. More specifically, the post-conversion maximum code length identifying unit 1301 identifies three types of maximum code lengths, that is, it identifies the maximum code length among codes (see
Only in the case where the motion vector code maximum code length identified by the post-conversion maximum code length identifying unit 1301 exceeds a predetermined motion vector threshold length, the switching unit 1304 causes the code converting unit 1202 to perform code conversion on the motion vectors included in the macroblock from which the post-conversion maximum code length identifying unit 1301 has identified the motion vector code maximum code length.
Furthermore, only in the case where the coefficient value code maximum code length identified by the post-conversion maximum code length identifying unit 1301 exceeds a predetermined coefficient value threshold length, the switching unit 1304 causes the code converting unit 1202 to perform code conversion on the coefficients included in the macroblock of the coefficient value code maximum code length.
Furthermore, only in the case where the third maximum code length identified by the post-conversion maximum code length identifying unit 1301 exceeds a predetermined third threshold length, the code converting unit 1202 causes the code converting unit 1202 to perform code conversion on the reference image indices, and so on, included in the macroblock of the third maximum code length.
It should be noted that the switching unit 1304 performs such a switching (see
The rule type-displaying flag adding unit 1303 adds a rule type-display flag, which indicates whether or not code conversion has been performed by the code converting unit 1202, to the macroblock inputted to the rule type-displaying flag adding unit 1303 by either the switching unit 1304 or the code converting unit 1202. The rule type-display flag includes a motion vector flag indicating whether or not motion vector code conversion has been performed, a coefficient value flag indicating whether or not the coefficient values have been code converted, and a third flag indicating whether or not code conversion has been performed on the reference image indices, and so on. The rule type-displaying flag adding unit 1303 adds such three rule type-display flags to the macroblock. At this time, for example, the size of the macroblock may be increased by the size of the 3 rule type-display flags, that is, by 3 bits, and it is also possible to have the size of the 3 rule type-display flags pre-existing inside the macroblock prior to adding, such that the macroblock does not increase in size.
In the fourth embodiment, the image decoder 103 (
The embodiments of the present embodiment have been described thus far by exemplifying some embodiments. Aside from the embodiments described herein, various modifications are possible for the present invention without departing from the essence of reducing the maximum number of bits of a macroblock by code conversion and removal of information such as a coefficient value. For example, aside from an image decoding device in the H.264 standard described above, the present invention can also be applied, in the same manner, to an image decoding device compliant with the MPEG-2 standard or the VC-1 standard. Furthermore, aside from performing the conversion of codes or the removal of coefficients using an independent circuit, it is also possible to have a configuration such that such processing is performed simultaneously with demultiplexing in which the process of separating audio and video from a stream is performed.
The decoding device in the present invention: includes a converting unit which converts codes coded according to a first coding rule into codes according to a second coding rule which reduces the maximum code length; and is useful in televisions, personal computers, DVD recorders, and the like.
Number | Date | Country | Kind |
---|---|---|---|
2007-103627 | Apr 2007 | JP | national |
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/JP2008/000858 | 4/3/2008 | WO | 00 | 10/9/2009 |