This application is based upon and claims the benefit of priority from the prior Japanese Patent Application No. 2007-63827 filed on Mar. 13, 2007; the entire contents of which are incorporated herein by reference.
1. Field of the Invention
The present invention relates to an image decoding apparatus and image decoding method configured to decode an image coding bitstream (coded image data) coded in H.264 format.
2. Description of the Related Art
The technique called ITU-T Recommendation H.264/AVC (Advanced video coding) (simply “H.264” hereafter) defines that DCT coefficients, motion vectors or the like be transmitted using syntaxes indicating the rules of setting coded data streams (bitstreams).
For example, in compressing and coding moving image data and transmitting the resultant data, motion prediction errors (residual blocks) between input data of luminance or color difference and motion-compensated output based on precedent-screen data are calculated for each processing block, and DCT coefficients of the residual blocks are quantized and variable-length coded and then transmitted to the decoder side.
As the advanced technique of coding DCT coefficients, CAVLC (Context-Adaptive Variable Length Coding) is used. A processing block size (processing unit) of DCT coefficients are, for example, 4□4, and sixteen DCT coefficients are converted into the following seven pieces of syntax element information (simply “syntax” hereafter) (run_before, level_Prefix, level_suffix, TotalCoeff, total_zeros, TrailingOnes, trailing_ones_sign_flag), so that all the sixteen DCT coefficients can be specified using these seven pieces of information.
run_before is the number of continuous “0s” before a non-zero coefficient value; level_prefix and level_suffix are non-zero coefficient values; TotalCoeff is the number of non-zero coefficients; total_zeros is the number of “0s” before the last non-zero coefficient; TrailingOnes is the number of the last continuous coefficients having an absolute value of 1; trailing_ones_sign_flag is the code of the last continuous coefficients having an absolute value of 1.
In the decoder side, all DCT coefficients quantized, for example, in order of zigzag scanning can be decoded based on the seven pieces of information (run_before, level_prefix, level_suffix, TotalCoeff, total_zeros, TrailingOnes, trailing_ones_sign_flag).
In a residual block, there are ((the number of non-zero coefficients)−1)-number of run_before syntaxes; when decoding is carried out using a table defined in H.264 standards, the number of multiple run_before syntaxes which can be decoded by a single decode command is only one. That is, according to a conventional art, decoding must be carried out for each non-zero run_before (run_before 10) and zero run_before (run_before□0).
Consequently, as the number of non-zero coefficients (that is, the number of coefficient data) increases, the number of cycles of processing the residual block becomes larger, thus deteriorating decoding performance.
In one code stream (bitstream), there are ((the number of non-zero coefficients)−1)-number of run_before syntaxes. ((the number of non-zero coefficients)−1) can also be expressed as ((TotalCoeff)−1).
Meanwhile, as a related art of coding and decoding by H.264, there is one described in Japanese Patent Application Laid-Open No. 2006-135786, for example. However, in Japanese Patent Application Laid-Open No. 2006-135786, there is no description of the technique of suppressing the increase in the number of decode cycles.
According to an aspect of the present invention, there is provided an image decoding apparatus including: a bitstream updating output unit configured to receive a bitstream and update a syntax element located at a beginning of the bitstream according to a code length thereof and outputs the syntax element; a bitstream decoding unit configured to decode, in response to a decode request, a variable-length code of the syntax element outputted from the bitstream updating output unit; a zerosLeft updating unit configured to update zerosLeft based on a specific syntax element decoded by the bitstream decoding unit; a run_before remaining number updating unit configured to update a run_before remaining number based on a specific syntax element decoded by the bitstream decoding unit; and a syntax selection unit configured to select a syntax element to be decoded by the bitstream decoding unit, wherein multiple zero run_before syntaxes and one non-zero run_before syntax, or multiple zero run_before syntaxes are decoded all at once.
According to another aspect of the present invention, there is provided a image decoding method including: updating a syntax element located at a beginning of an input bitstream according to a code length thereof and outputting the bitstream; issuing a decode command for a syntax element to be decoded; decoding a variable-length code of the syntax element in response to the decode command; updating the run_before remaining number based on a specific syntax element decoded; updating zerosLeft based on a specific syntax element decoded; and receiving the zerosLeft and the beginning of the bitstream and decoding multiple zero run_before syntaxes and one non-zero run_before syntax all at once using a first table group (20Xa), or receiving the zerosLeft, the beginning of the bitstream and the run_before remaining number and decoding multiple zero run_before syntaxes all at once using a second table group (20Xb).
According to another aspect of the present invention, there is provided a image decoding method including: updating a syntax element located at a beginning of an input bitstream according to a code length thereof and outputting the bitstream decoding a variable-length code of the syntax element in response to a decode request; updating the run_before remaining number based on a specific syntax element decoded; updating zerosLeft based on a specific syntax element decoded; receiving the zerosLeft and the beginning of the bitstream and decoding multiple zero run_before syntaxes and one non-zero run_before syntax all at once using a first table group (20Xa), or receiving the zerosLeft, the beginning of the bitstream and the run_before remaining number and decoding multiple zero run_before syntaxes all at once using a second table group (20Xb).
Embodiments of the present invention will be described with reference to the drawings.
Before describing embodiments of the present invention with reference to
A bitstream constituted of multiple types of syntaxes containing run_before syntax is supplied as input data to the image decoding apparatus. The whole bitstream is constituted of syntaxes from the beginning to an ending; but in the decoding unit of the image decoding apparatus, each time decoding of each syntax is finished, the decoded syntax is discarded; thus each time decoding of each syntax is finished, a subsequent syntax corresponding to the beginning of the bitstream is inputted to the decoding unit of the image decoding apparatus.
An image decoding apparatus 400 illustrated in
The operation in
The FIFO apparatus 401 receives a variable-length coded bitstream and outputs the bitstream in input order. While updating syntaxes located at the beginning of the bitstream one after another, the FIFO apparatus 401 supplies the updated syntax to the variable-length code decoding apparatus 402. When receiving the beginning of the bitstream from the FIFO apparatus 401, the variable-length code decoding apparatus 402 identifies the type of syntax and decodes the syntax, and after the decoding operation, detects the code length of the decoded syntax. Then, the detected code length is provided to the FIFO apparatus 401. When receiving the code length, the FIFO apparatus 401 determines that the syntax corresponding to the code length has already been decoded, and discards the syntax. As a result, the beginning of subsequent bitstream data (subsequent syntax) is outputted from the FIFO apparatus 401, i.e., the syntax is updated and sent to the variable-length code decoding apparatus 402. The variable-length code decoding apparatus 402 decodes the subsequent syntax and provides the code length thereof to the FIFO apparatus 401; in this way, decoding is carried out for each syntax.
In response to a total_zeros decode command from the syntax selection apparatus 404, firstly the variable-length code decoding apparatus 402 decodes total_zeros syntax and sends the decoded syntax to the zerosLeft updating apparatus 403 along with a valid signal. The zerosLeft updating apparatus 403 updates zerosLeft; the zerosLeft updating apparatus 403 receives total_zeros (an initial value of zerosLeft) decoded by the variable-length code decoding apparatus 402 and decoded run_before along with respective valid signal, and each time run_before is received, carries out updating calculation using an updating calculation formula (zerosLeft−run_before) by using total_zeros as the initial value of zerosLeft, so that updating zerosLeft is repeated until zerosLeft changes to 0. zerosLeft indicates the number of run_before syntaxes which remains to be decoded when the run_before thereof is decoded, and its initial value is equal to total_zeros.
Subsequently, in response to a run_before decode command from the syntax selection apparatus 404, the variable-length code decoding apparatus 402 receives zerosLeft from the zerosLeft updating apparatus 403, and determines (selects) based on the zerosLeft information, a decode table to be used from among tables 501 to 507 illustrated in
Then, the value of run_before (decode output) obtained from the table is sent to the zerosLeft updating apparatus 403 along with the valid signal. The zerosLeft updating apparatus 403 updates zerosLeft based on the updating calculation formula, using the value of run_before. If the updated zerosLeft is not equal to zero, the syntax selection apparatus 404 outputs a run_before decode command again. Decoding run_before and updating using the decoded value are repeated until zerosLeft changes to 0.
The decoding operation of the variable-length code decoding apparatus 402 of
Descriptions will be given by taking as an example, a case where the whole run_before syntax indicated as a variable-length coded bitstream is ‘11111110010’ as illustrated in
In
Firstly, based on a zerosLeft syntax having sent before a run_before syntax is sent, the variable-length code decoding apparatus 402 selects from among run_before decoding tables illustrated in
Consequently, the decode table to be subsequently used is the table 502 corresponding to zerosLeft=2. When the fifth two-digit syntax ‘01’ of the bitstream is inputted, run_before obtained as the decode output through the table 502 is ‘1’ (rb=1), and the updating calculation formula zL−rb=1, and zerosLeft=1, so the value of zerosLeft is updated. In this case, the code length is 2.
Consequently, the decode table to be subsequently used is the table 501 corresponding to zerosLeft=1. In the table 501, one-digit input is shown. When the sixth one-digit syntax ‘0’ of the bitstream is inputted, run_before obtained as the decode output through the table 501 is ‘1’ (rb=1). In this case, the code length is 1. And the updating calculation formula zL−rb=0, so the decoding is finished.
With the hardware configuration of
The image decoding apparatus 100 illustrated in
The image decoding apparatus 100 includes: an FIFO apparatus 101 acting as a bitstream updating and output unit configured to receive a bitstream constituted of multiple variable-length code syntaxes, and updates a syntax located at the beginning of the bitstream according to the code length thereof and output the updated syntax; a variable-length code decoding apparatus 102 acting as a bitstream decoding unit configured to decode the variable-length code of the syntax received from the FIFO apparatus 101 in response to a decode request; a zerosLeft updating apparatus 103 configured to update zerosLeft using as an initial value, a specific syntax (for example, total_zeros) decoded by the variable-length code decoding apparatus 102; a run_before remaining number updating apparatus 104 configured to update the run_before remaining number using as an initial value, a specific syntax (for example, TotalCoeff) decoded by the variable-length code decoding apparatus 102; and a syntax selection apparatus 105 configured to select a syntax to be decoded by the variable-length code decoding apparatus 102. The image decoding apparatus 100 decodes all at once multiple zero run_before syntaxes (meaning that the number of (run_before=0) is plural) and one non-zero run_before syntax (meaning that the number of (run_before□0) is one), or multiple zero run_before syntaxes. The variable-length code decoding apparatus 102 is provided with a table group of decode tables 201a to 207b. As illustrated in
The operation in
The variable-length code decoding apparatus 102 receives the beginning of a bitstream as input data (syntax) from the FIFO apparatus 101.
In response to a TotalCoeff decode command from the syntax selection apparatus 105, the variable-length code decoding apparatus 102 decodes TotalCoeff syntax and sends the syntax to the run_before remaining number updating apparatus 104 along with a valid signal. In the run_before remaining number updating apparatus 104, firstly the MUX 301 selects TotalCoeff as illustrated in
Subsequently, in response to a total_zeros decode command from the syntax selection apparatus 105, the variable-length code decoding apparatus 102 decodes total_zeros and outputs total_zeros to the zerosLeft updating apparatus 103 along with a valid signal. The zerosLeft updating apparatus 103 updates zerosLeft using total_zeros as an initial value.
Subsequently, in response to a run_before decode command from the syntax selection apparatus 105, the variable-length code decoding apparatus 102 receives zerosLeft and the run_before remaining number respectively from the zerosLeft updating apparatus 103 and the run_before remaining number updating apparatus 104. Then, firstly the variable-length code decoding apparatus 102 determines a table number (201a to 207b) (refer to
Subsequently, the variable-length code decoding apparatus 102 consults a table (20Xb) with table number suffix ‘b’ selected based on the beginning of the input bitstream and run_before remaining number. If the beginning of the input bitstream and run_before remaining number agree with the input of the table 20Xb, the number of run_before syntaxes and run_before=0 corresponding to this input are selected as the output. If there is no input of the table 20Xb which agrees with the beginning of the input bitstream and run_before remaining number, the table 20Xa is consulted, so that the number of run_before syntaxes and the value of run_before are selected as the output.
The variable-length code decoding apparatus 102 sends the selected value of run_before and a run_before valid signal to the zerosLeft updating apparatus 103, and also sends the selected number of run_before syntaxes and the run_before valid signal to the run_before remaining number updating apparatus 104.
The zerosLeft updating apparatus 103 has a function similar to the zerosLeft updating apparatus 403 described with reference to
While the zerosLeft updating apparatus 103 updates zerosLeft, in the run_before remaining number updating apparatus 104, as illustrated in
When the decoding operation is performed as described above, a plurality of zero run_before syntaxes and one non-zero run_before syntax, or a plurality of zero run_before syntaxes can be decoded in one cycle. For example, when the beginning of the bitstream is ‘1101’ and zerosLeft is 2 and run_before remaining number is 6 at the time of decoding run_before, and when the decoding is carried out using the image decoding apparatus according to the present embodiment, firstly the tables 202a/202b are selected based on the zerosLeft information ‘2’. Since run_before remaining number is 6, there is no corresponding input item in the table 202b, so subsequently the table 202a is consulted. ‘1101’ corresponds to the fifth input item of the table 202a, and the number of run_before syntaxes is 3 (2) in the output item. Accordingly, two run_before syntaxes (run_before=0) and one run_before syntax (run_before=1) are decoded. Here, in the table 20Xa, the number of run_before syntaxes 3 (2) means that ‘3’ is the number of run_before syntaxes and ‘2’ is the number of run_before syntaxes (run_before=0). Thus, the number of run_before syntaxes (run_before□0) is 1.
In the above example, according to the embodiment of the present invention, decoding of three run_before syntaxes can be carried out by a single decode command. In contrast, as illustrated in
There may be used another configuration in which the tables 20Xa/20Xb are selected all at once and if there is a corresponding input item in the table 20Xb, the output value of the table 20Xb is selected and if not, the output value of the table 20Xa is selected. Also, a table (for example, referred to 20X) obtained by combining the two tables 20Xa/20Xb may be used.
The operation of the image decoding apparatus 100 of
Descriptions will be given by taking as an example, a case where the entire run_before syntax indicated as a bitstream is ‘11111110010’ as illustrated in
In
total_zeros syntax providing an initial value of zerosLeft is inputted to the variable-length code decoding apparatus 102 before run_before syntax is inputted.
Firstly the variable-length code decoding apparatus 102 selects for reference from among the run_before tables illustrated in
In this case, with the 8-digit bitstream ‘11111110’ at the beginning, when the tables 501 to 507 of
From the calculation result (zerosLeft=2) based on the decode output (rb=1 illustrated in
Consequently, the table 201a/201b corresponding to zerosLeft=1 are selected as the decode table to be subsequently used. When the last one-digit ‘0’ is inputted as the bitstream, since there is the input ‘0’ in the table 201a, a run_before value of ‘1’ (rb=1) is obtained as the decode output by consulting the table 201a. And the updating calculation formula is zL−rb=0, and the decoding is finished.
When the hardware configuration of
Referring to
In other words, the first table group (20Xa) receives zerosLeft and the beginning of the bitstream, and can decode multiple zero run_before syntaxes and one non-zero run_before all at once. The second table group (20Xb) receives zerosLeft, the beginning of the bitstream and the run_before remaining number, and can decode multiple zero run_before syntaxes all at once.
The run_before remaining number will be described with reference to
As illustrated in
In the run_before remaining number updating apparatus 104, firstly the MUX 301 selects TotalCoeff received from the variable-length code decoding apparatus 102 based on a TotalCoeff valid signal received from the variable-length code decoding apparatus 102, and writes (TotalCoeff)−1 as the initial value into the register 302. Subsequently, when a run_before valid signal is received, the MUX 301 selects a value obtained when the subtracter 303 subtracts the number of run_before syntaxes from the run_before remaining number (initially equal to the initial value) retained in the register 302, and outputs the selected value, so that the value in the register 302 is updated. That is, each time the variable-length code decoding apparatus 102 finishes decoding for each run_before decode unit, the number of run_before syntaxes and a run_before valid signal received from the variable-length code decoding apparatus 102 are inputted to the run_before remaining number updating apparatus 104, so that the value in the register 302, i.e., the run_before remaining number is updated. In this case, when the TotalCoeff valid signal or the run_before valid signal is not valid, the MUX 301 selects the output of the register 302 as its input.
The advantageous effects according to the embodiment of the present invention will be described.
In the image decoding apparatus 400 according to the related art of
In the image decoding apparatus 100 according to the present invention of
Having described the embodiments of the invention referring to the accompanying drawings, it should be understood that the present invention is not limited to those precise embodiments and various changes and modifications thereof could be made by one skilled in the art without departing from the spirit or scope of the invention as defined in the appended claims.
Number | Date | Country | Kind |
---|---|---|---|
2007-063827 | Mar 2007 | JP | national |