Encoding device, decoding device and program
The encoding and decoding devices optimize bit allocation for last significant coefficients by selecting appropriate binarization methods based on conversion and prediction processes, addressing inefficiencies in HEVC and VVC, thereby improving encoding efficiency.
Patent Information
- Application Number
- JP2025074619
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2019-06-25
- Filing Date
- 2025-04-28
- Publication Date
- 2025-07-10
AI Technical Summary
In video encoding methods like HEVC and VVC, when transform skip is applied to residual signals with sharp edges or high energy in local regions, the energy distribution across transform coefficients increases, leading to higher entropy and inefficient bit usage for signaling the last position of significant coefficients.
An encoding and decoding device that dynamically selects an encoding mode for the last significant coefficient based on the type of conversion process, block size, and prediction process, using either truncated Rice binarization or fixed-length binarization to optimize bit allocation, and optionally omits signaling the last position when transform skip is used.
This approach reduces the bit requirement for signaling the last position, enhancing encoding efficiency by ensuring bits are allocated efficiently, especially when transform skip is employed.
Smart Images

Figure 2025105857000001_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to an encoding device, a decoding device, and a program.
Background Art
[0002] In an encoding method typified by HEVC (High Efficiency Video Coding), by utilizing the property that the residual signal obtained from the difference between the predicted image and the original image by inter prediction or intra prediction generally tends to have energy concentrated in low-frequency components, entropy reduction is achieved by decomposing (transforming) the residual signal into frequency components through a transformation process (see, for example, Non-Patent Document 1).
[0003] The uppermost left component of the transform coefficients obtained by performing a transform process on the residual signal is the DC (Direct Current) component, and as it goes down, it represents components with higher vertical frequencies, and as it goes to the right, it represents components with higher horizontal frequencies.
[0004] On the other hand, when a transform process is applied to a residual signal including a sharp edge or a residual signal having high energy only in a local region, there is a problem that the energy is distributed over the entire transform coefficients due to frequency division, resulting in an increase in entropy.
[0005] In HEVC and VVC (Versatile Video Coding), which is a next-generation encoding method, a transform skip mode in which no transform is applied to the residual signal is introduced. In transform skip, the residual signal is scaled to obtain transform coefficients without performing a transform such as DCT (Discrete Cosine Transform) or DST (Discrete Sine Transform). Therefore, by selecting transform skip for a residual signal including a sharp edge or a residual signal having high energy only in a local region, an increase in entropy can be suppressed.
[0006] In the symbolization device, in order to output the residual signal as a stream, the positions and values of the significant components (significant coefficients) of the quantized transform coefficients are entropy-coded and output.
[0007] In HEVC, the transform coefficients within a block are serialized in a pre-defined scan order from high frequency to low frequency, and the serialized transform coefficients are entropy-coded. At this time, among the serialized transform coefficients, last position which is the end position information indicating the position of the last significant coefficient on the highest frequency side is signaled, and the positions and values of the significant coefficients from the last position to the DC component are entropy-coded.
[0008] In the entropy coding of the last position, two values (last_position_x, last_position_y) of X and Y which are the coordinates within the block of the last position (relative position based on the DC component) are entropy-coded separately.
[0009] As described above, since the residual signal generally tends to concentrate energy in the low frequency components, the last position is likely to occur in the upper left region of the transform coefficients. Therefore, when binarizing to signal last_position_x and last_position_y, symbols with a short bit length are assigned to small values, and symbols with a long bit length are assigned to large values, thereby efficiently coding the last position.
Prior Art Documents
Non-Patent Documents
[0010]
Non-Patent Document 1
Disclosure of the Invention
Problems to be Solved by the Invention
[0011] However, when performing conversion skip, since the residual signal is directly quantized, the last position does not necessarily occur in the upper left region of the conversion coefficient. When a prediction residual occurs in the lower right region of the block to be encoded, a symbol with a long bit length is assigned to the last position, so the amount of bits required for signaling the last position increases, resulting in a problem of reduced encoding efficiency.
[0012] Therefore, an object of the present invention is to provide an encoding device, a decoding device, and a program capable of suppressing an increase in the amount of bits caused by signaling of the last position (end position information) and improving the encoding efficiency.
Means for Solving the Problems
[0013] An encoding device according to a first aspect is an encoding device that encodes an encoding target block obtained by dividing an image, and includes a prediction unit that performs a prediction process on the encoding target block and outputs a prediction block, a conversion unit that performs a conversion process on a residual signal representing an error between the prediction block and the encoding target block and outputs a conversion coefficient for each frequency component, a quantization unit that quantizes the conversion coefficient output by the conversion unit, and an entropy encoding unit that encodes the quantized conversion coefficient and outputs an encoded stream. The entropy encoding unit has an encoding control unit that selects an encoding mode for end position information indicating a position of a last significant coefficient on the highest frequency side among the conversion coefficients based on at least one of a type of the conversion process performed by the conversion unit, a size of the encoding target block, and a type of the prediction process performed by the prediction unit.
[0014] The decoding device according to the second aspect is a decoding device that decodes a block to be decoded from an encoded stream, and includes an entropy decoding unit that decodes the encoded stream and outputs quantized transform coefficients, an inverse quantization unit that inverse-quantizes the transform coefficients output by the entropy decoding unit, an inverse transform unit that performs an inverse transform process on the inverse-quantized transform coefficients to restore a residual signal, a prediction unit that performs a prediction process on the block to be decoded and outputs a predicted block, and a synthesis unit that synthesizes the residual signal output by the inverse transform unit and the predicted block to reconstruct the block to be decoded. The entropy decoding unit has a decoding control unit that selects a decoding mode for end position information indicating the position of the last significant coefficient on the highest frequency side among the transform coefficients based on at least one of the type of the inverse transform process performed by the inverse transform unit, the size of the block to be decoded, and the type of the prediction process performed by the prediction unit.
[0015] The program according to the third aspect causes a computer to function as the encoding device according to the first aspect or the decoding device according to the second aspect.
Advantages of the Invention
[0016] According to the present invention, it is possible to provide an encoding device, a decoding device, and a program capable of suppressing an increase in the amount of bits caused by signaling of the last position and improving the encoding efficiency.
Brief Description of the Drawings
[0017]
Figure 1
Figure 2
Figure 3
Figure 4
Figure 5
Figure 6
Figure 7
Figure 8
Figure 9
Figure 10
Mode for Carrying Out the Invention
[0018] With reference to the drawings, an encoding device and a decoding device according to an embodiment will be described. The encoding device and the decoding device according to the embodiment respectively perform encoding and decoding of moving images represented by MPEG. In the following description of the drawings, the same or similar parts are denoted by the same or similar reference numerals.
[0019] <Encoding Device> First, the encoding device according to the present embodiment will be described. FIG. 1 is a diagram showing the configuration of an encoding device 1 according to the present embodiment. The encoding device 1 is a device that encodes an encoding target block obtained by dividing an image.
[0020] As shown in FIG. 1, the encoding device 1 includes a block division unit 100, a subtraction unit 110, a conversion / quantization unit 120, an entropy encoding unit 130, an inverse quantization / inverse conversion unit 140, a synthesis unit 150, a memory 160, and a prediction unit 170.
[0021] The block division unit 100 divides the original image, which is an input image in units of frames (or pictures) constituting the moving image, into a plurality of image blocks, and outputs the image blocks obtained by the division to the subtraction unit 110. The size of the image block is, for example, 32×32 pixels, 16×16 pixels, 8×8 pixels, or 4×4 pixels, etc. The shape of the image block is not limited to a square and may be a rectangle (non-square). The image block is a unit (encoding target block) for which the encoding device 1 performs encoding, and is also a unit (decoding target block) for which the decoding device performs decoding. Such an image block is sometimes called a CU (Coding Unit).
[0022] The block division unit 100 performs block division on the luminance signal and the color difference signal. In the following, the case where the shape of the block division is the same for the luminance signal and the color difference signal will be mainly described, but the division may be independently controllable for the luminance signal and the color difference signal. When the luminance block and the color difference block are not particularly distinguished, they are simply called the encoding target block.
[0023] The subtraction unit 110 calculates a prediction residual representing the difference (error) between the encoding target block output from the block division unit 100 and the prediction block obtained by the prediction unit 170 predicting the encoding target block. The subtraction unit 110 calculates the prediction residual by subtracting the pixel values of the prediction block from the pixel values of each block, and outputs the calculated prediction residual to the conversion / quantization unit 120. In the following, a signal composed of prediction residuals in block units is called a residual signal.
[0024] The conversion / quantization unit 120 performs conversion processing and quantization processing in block units. The conversion / quantization unit 120 includes a conversion unit 121 and a quantization unit 122.
[0025] The conversion unit 121 performs a conversion process on the residual signal output from the subtraction unit 110 to calculate conversion coefficients for each frequency component, and outputs the calculated conversion coefficients to the quantization unit 122. The conversion process (conversion) refers to a process of converting a signal in the pixel domain into a signal in the frequency domain. For example, it refers to a discrete cosine transform (DCT: Discrete Cosine Transform), a discrete sine transform (DST: Discrete Sine Transform), a Karhunen-Loeve transform (KLT), and a conversion obtained by integerizing them.
[0026] In the present embodiment, the conversion unit 121 performs a conversion process of a type selected from a plurality of types of conversion processes including a conversion skip in which conversion on the residual signal is not performed. Specifically, the conversion unit 121 selects the type of conversion process to be applied to the residual signal for each of the horizontal direction and the vertical direction. For example, it selects which conversion to apply among candidates for conversions such as DCT2, DST7, DCT8 (including conversions obtained by integerizing them). The conversion unit 121 outputs conversion type information indicating the type of the selected conversion process to the entropy encoding unit 130.
[0027] The conversion unit 121 can select a conversion skip. For example, the conversion unit 121 selects a conversion skip for a residual signal including a steep edge or a residual signal having high energy only in a local region. When the conversion unit 121 selects a conversion skip, it outputs, as conversion coefficients, a signal obtained by adjusting the residual signal by a scaling process or the like without performing a conversion such as DCT or DST. The conversion unit 121 may apply a conversion skip to only one of the horizontal direction and the vertical direction, or may apply a conversion skip to both. In the following, the case where a conversion skip is applied to both the horizontal direction and the vertical direction will be described.
[0028] Note that the conversion unit 121 may select the type of conversion processing by optimizing (i.e., RD optimization) so that the linear combination of the generated information amount and the signal distortion for each block to be encoded is minimized, or may select the type of conversion processing based on the block size, division shape, and type of prediction processing of the block to be encoded.
[0029] The quantization unit 122 quantizes the conversion coefficients output from the conversion unit 121 using a quantization parameter (Qp) and a quantization matrix, and outputs the quantized conversion coefficients to the entropy encoding unit 130 and the inverse quantization / inverse conversion unit 140. Note that the quantization parameter (Qp) is a parameter that is commonly applied to each conversion coefficient within a block and determines the coarseness of quantization. The quantization matrix is a matrix having quantization values as elements when quantizing each conversion coefficient.
[0030] The entropy encoding unit 130 performs entropy encoding on the conversion coefficients output from the quantization unit 122, performs data compression to generate an encoded stream (bit stream), and outputs the generated encoded stream to the outside of the encoding device 1. For entropy encoding, Huffman coding, CABAC (Context-based Adaptive Binary Arithmetic Coding), or the like can be used.
[0031] The entropy encoding unit 130 acquires information such as the size and shape of each block to be encoded from the block division unit 100, acquires conversion type information from the conversion unit 121, acquires information related to prediction from the prediction unit 170, and also performs encoding of the acquired information.
[0032] The inverse quantization / inverse conversion unit 140 performs inverse quantization processing and inverse conversion processing in block units. The inverse quantization / inverse conversion unit 140 includes an inverse quantization unit 141 and an inverse conversion unit 142.
[0033] The inverse quantization unit 141 performs an inverse quantization process corresponding to the quantization process performed by the quantization unit 122. Specifically, the inverse quantization unit 141 restores the transform coefficients by inverse quantizing the transform coefficients output from the quantization unit 122 using the quantization parameter (Qp) and the quantization matrix, and outputs the restored transform coefficients to the inverse transform unit 142.
[0034] The inverse transform unit 142 performs an inverse transform process corresponding to the transform process performed by the transform unit 121. For example, when the transform unit 121 performs DCT, the inverse transform unit 142 performs inverse DCT. The inverse transform unit 142 performs an inverse transform process on the transform coefficients output from the inverse quantization unit 141 to restore the residual signal, and outputs the restored residual signal, which is the restored residual signal, to the synthesis unit 150.
[0035] The synthesis unit 150 synthesizes the restored residual signal output from the inverse transform unit 142 with the prediction block output from the prediction unit 170 on a pixel-by-pixel basis. The synthesis unit 150 adds each pixel value of the restored residual signal and each pixel value of the prediction block to reconstruct (decode) the block to be encoded, and outputs the decoded image (decoded block) in block units to the memory 160. Such a decoded block may be referred to as a reconstructed block.
[0036] The memory 160 stores the decoded image output from the synthesis unit 150 and accumulates the decoded images in frame units. The memory 160 outputs the stored decoded image to the prediction unit 170. A loop filter may be provided between the synthesis unit 150 and the memory 160.
[0037] The prediction unit 170 generates a prediction block corresponding to the block to be encoded by performing a prediction process in block units, and outputs the generated prediction block to the subtraction unit 110 and the synthesis unit 150. The prediction unit 170 includes an inter prediction unit 171, an intra prediction unit 172, and a switching unit 173.
[0038] The inter prediction unit 171 uses the decoded image stored in the memory 160 as a reference image, calculates a motion vector by a method such as block matching, predicts the encoding target block to generate an inter prediction block, and outputs the generated inter prediction block to the switching unit 173.
[0039] The inter prediction unit 171 selects an optimal inter prediction method from among inter predictions using a plurality of reference images (typically, bi-prediction) and inter predictions using one reference image (uni-directional prediction), and performs inter prediction using the selected inter prediction method. The inter prediction unit 171 outputs information related to the inter prediction (such as a motion vector) to the entropy encoding unit 130.
[0040] The intra prediction unit 172 selects an optimal intra prediction mode to be applied to the intra prediction target block from among a plurality of intra prediction modes, and predicts the intra prediction target block using the selected intra prediction mode. The intra prediction unit 172 generates an intra prediction block by referring to the decoded pixel values adjacent to the encoding target block among the decoded images stored in the memory 160, and outputs the generated intra prediction block to the switching unit 173. Further, the intra prediction unit 172 outputs information related to the selected intra prediction mode to the entropy encoding unit 130.
[0041] The switching unit 173 switches between the inter prediction block output from the inter prediction unit 171 and the intra prediction block output from the intra prediction unit 172, and outputs either prediction block to the subtraction unit 110 and the synthesis unit 150.
[0042] As described above, the encoding apparatus 1 according to the present embodiment includes a prediction unit 170 that performs prediction processing on an encoding target block to output a prediction block, a conversion unit 121 that performs conversion processing on a residual signal representing an error between the prediction block and the encoding target block to output conversion coefficients for each frequency component, a quantization unit 122 that quantizes the conversion coefficients output by the conversion unit 121, and an entropy encoding unit 130 that encodes the quantized conversion coefficients to output an encoded stream.
[0043] Next, the configuration of the entropy encoding unit 130 according to the present embodiment will be described. FIG. 2 is a diagram showing the configuration of the entropy encoding unit 130 according to the present embodiment.
[0044] As shown in FIG. 2, the entropy encoding unit 130 includes a serialization unit 131, a binarization unit 132, an encoding unit 133, and an encoding control unit 134.
[0045] The serialization unit 131 serializes the conversion coefficients for each encoding target block in a scan order specified in advance from the high frequency to the low frequency within this block, and outputs the serialized conversion coefficients to the binarization unit 132. The scan order refers to the encoding / decoding order of the conversion coefficients.
[0046] FIGS. 3 and 4 are diagrams showing operation examples of the serialization unit 131 according to the present embodiment. In FIGS. 3 and 4, an example in which the size of the encoding target block is 8×8 is shown.
[0047] As shown in FIG. 3, the serialization unit 131 scans the conversion coefficients within the block from the highest frequency component toward the DC component. Here, an example of performing the scan in units of sub-blocks of 4×4 is shown.
[0048] As shown in FIG. 4, the serialization unit 131 generates last position, which is terminal position information indicating the position of the last significant coefficient on the highest frequency side among the serialized conversion coefficients, and outputs last position to the binarization unit 132. Specifically, the serialization unit 131 outputs to the binarization unit 132 last position represented by two values (last_position_x, last_position_y) of the coordinates of the first non-zero coefficient in the scan order (i.e., the relative position based on the DC component). In the example of FIG. 4, (last_position_x, last_position_y) = (6, 5). Each of last_position_x and last_position_y is composed of a prefix part and a suffix part.
[0049] Also, the serialization unit 131 generates various information (syntax elements) indicating the configuration of the conversion coefficients in sub-block units, and outputs the generated information to the binarization unit 132. For example, the serialization unit 131 outputs to the binarization unit 132 coded_sub_block_flag, which is a flag indicating whether there is a significant coefficient in the sub-block. In the example of FIG. 4, for the lower left sub-block, the serialization unit 131 outputs to the binarization unit 132 coded_sub_block_flag indicating that there is no significant coefficient in this sub-block.
[0050] The encoding control unit 134 selects an encoding mode for last position based on the type of conversion process performed by the conversion unit 121. Also, the encoding control unit 134 may select an encoding mode for last position based on the size of the block to be encoded. Further, the encoding control unit 134 may select an encoding mode for last position based on the type of prediction process performed by the prediction unit 170.
[0051] In this embodiment, the encoding mode for the last position includes an assignment method for the bit length of the symbol obtained by binarizing the last position. Specifically, the encoding control unit 134 selects either a first assignment method of assigning a symbol with a longer bit length as the value of the last position increases, or a second assignment method of assigning a symbol with a uniform bit length regardless of the value of the last position.
[0052] The first assignment method is a method of assigning a variable-length bit symbol when binarizing last_position_x and last_position_y, taking advantage of the characteristic that energy is likely to concentrate in the upper left region (low-frequency component) of the conversion coefficient. Specifically, in the first assignment method, when binarizing, a symbol with a shorter bit length is assigned to a smaller value, and a symbol with a longer bit length is assigned to a larger value. Note that the first assignment method may be called truncated Rice binarization.
[0053] For example, in the first assignment method, when the block size is 8×8 pixels, when the coordinate position of the last position is the upper left (for example, (x, y)=(0, 0)), the last position is composed of a symbol of a total of 2 bits, and when the coordinate position of the last position is the lower right (for example, (x, y)=(7, 7)), the last position is composed of a symbol of a total of 10 bits.
[0054] On the other hand, the second assignment method assigns a symbol with a uniform bit length regardless of the value of the last position (that is, the coordinate position of the last position). The uniform bit length means that there is no difference in the bit length between small values and large values, and it is not necessary to make the bit lengths the same for all values. Note that the second assignment method may be called fixed length binarization.
[0055] For example, in the second allocation method, the input value is binarized with the shortest fixed bit length Ceil(log2(cMax + 1)) that can represent the maximum value cMax (Maximum Code Value). Here, Ceil is a function that rounds up the decimal part. When the block width is 32 pixels, a symbol with a fixed length of 6 bits may be assigned to last_position_x.
[0056] The encoding control unit 134 selects the first allocation method in response to the type of conversion process selected by the conversion unit 121 not being conversion skip, and selects the second allocation method in response to the type of conversion process selected by the conversion unit 121 being conversion skip.
[0057] In this way, when the conversion unit 121 selects conversion skip, since the energy of the conversion coefficient does not necessarily concentrate in the upper left region, when binarizing last_position_x and last_position_y, symbols with equal bit lengths are assigned by the second allocation method. This can suppress an increase in the amount of bits required for signaling the last position and improve the encoding efficiency.
[0058] Also, the encoding control unit 134 may select the first allocation method in response to the size of the block to be encoded satisfying a specific condition, and select the second allocation method in response to the size of the block to be encoded not satisfying the specific condition. The size of the block may be, for example, the length of the smaller side, or "block width + block height", or "block width × block height".
[0059] For example, the encoding control unit 134 may select the first allocation method in response to the size of the block to be encoded exceeding a predetermined size, and select the second allocation method in response to the size of the block to be encoded being equal to or less than the predetermined size. When the size of the block to be encoded is small, the values of last_position_x and last_position_y are small in the first place, so the second allocation method can improve the encoding efficiency more than the first allocation method.
[0060] Alternatively, the encoding control unit 134 may select the first allocation method in response to the size of the block to be encoded not being the maximum size or the minimum size, and select the second allocation method in response to the size of the block to be encoded being the maximum size or the minimum size.
[0061] Furthermore, the encoding control unit 134 may select the first allocation method in response to the type of prediction process selected by the prediction unit 170 being a specific prediction process, and select the second allocation method in response to the type of prediction process selected by the prediction unit 170 not being a specific prediction process. The specific prediction process refers to a prediction process that performs prediction by referring to reference pixels adjacent to the block to be encoded. For example, intra prediction corresponds to the specific prediction process. On the other hand, prediction processes other than the specific prediction process include inter prediction and intra block copy that copies different decoded partial images in the same frame.
[0062] The binarization unit 132 converts the multi-value signal output by the serialization unit 131 into a binary signal and outputs the binary signal to the encoding unit 133. In the present embodiment, the binarization unit 132 binarizes (binarizes) each of last_position_x and last_position_y according to the bit length allocation method selected by the encoding control unit 134.
[0063] Specifically, when the first allocation method is selected by the encoding control unit 134, the binarization unit 132 binarizes each of last_position_x and last_position_y according to the first allocation method, and when the second allocation method is selected by the encoding control unit 134, the binarization unit 132 binarizes each of last_position_x and last_position_y according to the second allocation method.
[0064] The encoding unit 133 encodes the binary signal output by the binarization unit 132, generates an encoded stream, and outputs the generated encoded stream. In this embodiment, when the conversion unit 121 selects a conversion process other than conversion skip, the encoding unit 133 encodes a variable-length bit symbol, and when the conversion unit 121 selects conversion skip, the encoding unit 133 encodes a fixed-length bit symbol.
[0065] At this time, when the conversion unit 121 selects other than conversion skip, the encoding unit 133 may perform entropy encoding on a part (prefix part) of the binarized symbol by context-adaptive arithmetic encoding using the first context. When the conversion unit 121 selects conversion skip, the encoding unit 133 may perform entropy encoding on the binarized fixed-length bit symbol by context-adaptive arithmetic encoding using the second context. Also, when the conversion unit 121 selects conversion skip, the encoding unit 133 may perform fixed-length encoding on the binarized fixed-length bits and output a stream.
[0066] Next, an operation example of the encoding control unit 134 according to this embodiment will be described. FIG. 5 is a diagram showing a first operation example of the encoding control unit 134 according to this embodiment.
[0067] As shown in FIG. 5, in step S111, the encoding control unit 134 checks whether the type of conversion process selected by the conversion unit 121 is conversion skip. If the type of conversion process selected by the conversion unit 121 is conversion skip (step S111: YES), in step S115, the encoding control unit 134 selects the second allocation method.
[0068] If the type of conversion process selected by the conversion unit 121 is not conversion skip (step S111: NO), in step S112, the encoding control unit 134 checks whether the size of the encoding target block satisfies a specific condition. If the size of the encoding target block satisfies the specific condition (step S112: YES), in step S115, the encoding control unit 134 selects the second allocation method.
[0069] If the size of the encoding target block does not satisfy the specific condition (step S112: NO), in step S113, the encoding control unit 134 checks whether the type of prediction process selected by the prediction unit 170 is a specific prediction process. If the type of prediction process selected by the prediction unit 170 is a specific prediction process (step S113: YES), in step S115, the encoding control unit 134 selects the second allocation method.
[0070] On the other hand, if any of steps S111, S112, and S113 is "NO", the encoding control unit 134 selects the first allocation method.
[0071] Note that the order of steps S111, S112, and S113 is not limited to the above order. Also, one or two of steps S111, S112, and S113 may be omitted.
[0072] FIG. 6 is a diagram showing a second operation example of the encoding control unit 134 according to the present embodiment.
[0073] As shown in FIG. 6, in step S121, the encoding control unit 134 checks whether the type of conversion process selected by the conversion unit 121 is conversion skip. If the type of conversion process selected by the conversion unit 121 is not conversion skip (step S121: NO), in step S125, the encoding control unit 134 selects the first allocation method.
[0074] If the type of conversion process selected by the conversion unit 121 is conversion skip (step S121: YES), in step S122, the encoding control unit 134 checks whether the size of the block to be encoded satisfies a specific condition. If the size of the block to be encoded does not satisfy the specific condition (step S122: NO), in step S125, the encoding control unit 134 selects the first allocation method.
[0075] If the size of the block to be encoded satisfies the specific condition (step S122: YES), in step S123, the encoding control unit 134 checks whether the type of prediction process selected by the prediction unit 170 is a specific prediction process. If the type of prediction process selected by the prediction unit 170 is not a specific prediction process (step S123: NO), in step S125, the encoding control unit 134 selects the first allocation method.
[0076] On the other hand, if any of steps S121, S122, and S123 is "YES", the encoding control unit 134 selects the second allocation method.
[0077] Note that the order of steps S121, S122, and S123 is not limited to the above order. Also, one or two of steps S121, S122, and S123 may be omitted.
[0078] <Decoder device> Next, the differences between the decoder device according to the present embodiment and the above-described encoder device will be mainly described. FIG. 7 is a diagram showing the configuration of the decoder device 2 according to the present embodiment. The decoder device 2 is a device that decodes a block to be decoded from an encoded stream.
[0079] As shown in FIG. 7, the decoding device 2 includes an entropy decoding unit 200, an inverse quantization / inverse transformation unit 210, a synthesis unit 220, a memory 230, and a prediction unit 240.
[0080] The entropy decoding unit 200 decodes the encoded stream generated by the encoding device 1 and decodes various signaling information. Specifically, the entropy decoding unit 200 acquires conversion type information indicating the type of conversion process applied to the decoding target block, information regarding the block size / shape of the decoding target block, and prediction type information indicating the type of prediction process applied to the decoding target block. The entropy decoding unit 200 outputs the acquired conversion type information to the inverse quantization / inverse transformation unit 210 (inverse transformation unit 212) and outputs the acquired prediction type information to the prediction unit 240.
[0081] Also, the entropy decoding unit 200 decodes the encoded stream, acquires the quantized conversion coefficients, and outputs the acquired conversion coefficients to the inverse quantization / inverse transformation unit 210 (inverse quantization unit 211).
[0082] The inverse quantization / inverse transformation unit 210 performs inverse quantization processing and inverse transformation processing in block units. The inverse quantization / inverse transformation unit 210 includes an inverse quantization unit 211 and an inverse transformation unit 212.
[0083] The inverse quantization unit 211 performs inverse quantization processing corresponding to the quantization processing performed by the quantization unit 122 of the encoding device 1. The inverse quantization unit 211 inverse quantizes the quantized conversion coefficients output from the entropy decoding unit 200 using the quantization parameter (Qp) and the quantization matrix to restore the conversion coefficients of the decoding target block, and outputs the restored conversion coefficients to the inverse transformation unit 212.
[0084] The inverse conversion unit 212 performs an inverse conversion process corresponding to the conversion process performed by the conversion unit 121 of the encoding device 1. The inverse conversion unit 212 performs an inverse conversion process on the conversion coefficients output from the inverse quantization unit 211 to restore the residual signal, and outputs the restored residual signal (restored residual signal) to the synthesis unit 220. In the present embodiment, the inverse conversion unit 212 performs an inverse conversion process of a type selected from a plurality of types of inverse conversion processes including a conversion skip in which an inverse conversion for the conversion coefficients is not performed, based on the conversion type information output from the entropy decoding unit 200.
[0085] The synthesis unit 220 reconstructs (decodes) the original block by synthesizing the residual signal output from the inverse conversion unit 212 and the prediction block output from the prediction unit 240 on a pixel-by-pixel basis, and outputs the decoded image in block units to the memory 230.
[0086] The memory 230 stores the decoded image output from the synthesis unit 220. The memory 230 stores the decoded image in frame units. The memory 230 outputs the decoded image in frame units to the outside of the decoding device 2. Note that a loop filter may be provided between the synthesis unit 220 and the memory 230.
[0087] The prediction unit 240 performs prediction in block units. Specifically, the prediction unit 240 performs a prediction process of a type selected from a plurality of types of prediction processes including a specific prediction process of performing prediction by referring to reference pixels adjacent to the block to be decoded, based on the prediction type information output from the entropy decoding unit 200. The prediction unit 240 includes an inter prediction unit 241, an intra prediction unit 242, and a switching unit 243.
[0088] The inter prediction unit 241 uses the decoded image stored in the memory 230 as a reference image to predict the block to be decoded by inter prediction. The inter prediction unit 241 generates an inter prediction block by performing inter prediction according to the index, motion vector, etc. output from the entropy decoding unit 200, and outputs the generated inter prediction block to the switching unit 243.
[0089] The intra prediction unit 242 refers to the decoded image stored in the memory 230, and based on the information output from the entropy decoding unit 200, generates an intra prediction block by predicting the block to be decoded through intra prediction, and outputs the generated intra prediction block to the switching unit 243.
[0090] The switching unit 243 switches between the inter prediction block output from the inter prediction unit 241 and the intra prediction block output from the intra prediction unit 242, and outputs one of the prediction blocks to the synthesis unit 220.
[0091] Thus, the decoding device 2 according to the present embodiment includes an entropy decoding unit 200 that decodes an encoded stream and outputs quantized transform coefficients, an inverse quantization unit 211 that inverse quantizes the transform coefficients output by the entropy decoding unit 200, an inverse transform unit 212 that performs an inverse transform process on the inverse quantized transform coefficients to restore a residual signal, a prediction unit 240 that performs a prediction process on a block to be decoded and outputs a prediction block, and a synthesis unit 220 that synthesizes the residual signal output by the inverse transform unit 212 and the prediction block to reconstruct the block to be decoded.
[0092] Next, the configuration of the entropy decoding unit 200 according to the present embodiment will be described. FIG. 8 is a diagram showing the configuration of the entropy decoding unit 200 according to the present embodiment.
[0093] As shown in FIG. 8, the entropy decoding unit 200 includes a decoding unit 201, a quantization unit 202, and a deserialization unit 203.
[0094] The decoding unit 201 performs syntax analysis (parsing) on the encoded stream and decodes a binary signal from the encoded stream. In the present embodiment, the decoding unit 201 converts the symbol of the last position (last_position_x, last_position_y) into a binary signal according to the bit length assignment method selected by the decoding control unit 204.
[0095] Here, the decoding control unit 204 selects a decoding mode for the last position based on at least one of the conversion type information included in the encoded stream (i.e., the type of inverse conversion process performed by the inverse conversion unit 212), the block size information included in the encoded stream (i.e., the size of the block to be decoded), and the prediction type information included in the encoded stream (i.e., the type of prediction process performed by the prediction unit 240). In the present embodiment, the decoding mode for the last position includes an assignment method for the bit length of the symbol at the last position.
[0096] The decoding control unit 204 selects the above-described first assignment method in response to the selected type of inverse conversion process not being conversion skip. The decoding control unit 204 selects the above-described second assignment method in response to the selected type of inverse conversion process being conversion skip.
[0097] Also, the decoding control unit 204 may select the first assignment method in response to the size of the block to be decoded satisfying a specific condition, and select the second assignment method in response to the size of the block to be decoded not satisfying the specific condition.
[0098] Furthermore, the decoding control unit 204 may select the first assignment method in response to the selected type of prediction process being a specific prediction process, and select the second assignment method in response to the selected type of prediction process not being a specific prediction process.
[0099] The multi-valued conversion unit 202 converts the binary signal output by the decoding unit 201 into a multi-valued signal and outputs the multi-valued signal to the deserialization unit 203. Thereby, the quantized conversion coefficient is restored.
[0100] The deserialization unit 203 deserializes the multi-valued signal output by the multi-valued conversion unit 202, and outputs the conversion coefficient in block units (quantized conversion coefficient) to the inverse quantization unit 211.
[0101] Next, referring to FIG. 5, an example operation 1 of the decoding control unit 204 according to the present embodiment will be described.
[0102] As shown in FIG. 5, in step S111, the decoding control unit 204 checks whether the type of conversion process indicated by the signaled conversion type information is conversion skip. If the type of conversion process indicated by the signaled conversion type information is conversion skip (step S111: YES), in step S115, the decoding control unit 204 selects the second allocation method.
[0103] If the type of conversion process indicated by the signaled conversion type information is not conversion skip (step S111: NO), in step S112, the decoding control unit 204 checks whether the decoding target block size indicated by the block size information satisfies a specific condition. If the size of the decoding target block satisfies the specific condition (step S112: YES), in step S115, the decoding control unit 204 selects the second allocation method.
[0104] If the size of the decoding target block does not satisfy the specific condition (step S112: NO), in step S113, the decoding control unit 204 checks whether the type of prediction process indicated by the signaled prediction type information is a specific prediction process. If the type of prediction process indicated by the signaled prediction type information is a specific prediction process (step S113: YES), in step S115, the decoding control unit 204 selects the second allocation method.
[0105] On the other hand, if any of steps S111, S112, and S113 is "NO", the decoding control unit 204 selects the first allocation method.
[0106] Note that the order of steps S111, S112, and S113 is not limited to the above order. Also, one or two of steps S111, S112, and S113 may be omitted.
[0107] Next, referring to FIG. 6, an operation example 2 of the decoding control unit 204 according to the present embodiment will be described.
[0108] As shown in FIG. 6, in step S121, the decoding control unit 204 checks whether the type of conversion process indicated by the signaled conversion type information is conversion skip. When the type of conversion process indicated by the signaled conversion type information is not conversion skip (step S121: NO), in step S125, the decoding control unit 204 selects the first allocation method.
[0109] When the type of conversion process indicated by the signaled conversion type information is conversion skip (step S121: YES), in step S122, the decoding control unit 204 checks whether the size of the decoding target block satisfies a specific condition. When the size of the decoding target block does not satisfy the specific condition (step S122: NO), in step S125, the decoding control unit 204 selects the first allocation method.
[0110] When the size of the decoding target block satisfies the specific condition (step S122: YES), in step S123, the decoding control unit 204 checks whether the type of prediction process indicated by the signaled prediction type information is a specific prediction process. When the type of prediction process indicated by the signaled prediction type information is not a specific prediction process (step S123: NO), in step S125, the decoding control unit 204 selects the first allocation method.
[0111] On the other hand, when any of steps S121, S122, and S123 is "YES", the decoding control unit 204 selects the second allocation method.
[0112] Note that the order of steps S121, S122, and S123 is not limited to the above order. Also, one or two of steps S121, S122, and S123 may be omitted.
[0113] <Modification Example> Next, a modification example of the above-described embodiment will be described.
[0114] In the above-described embodiment, as an encoding / decoding mode for the last position, an assignment method of bit lengths for the symbol obtained by binarizing the last position was exemplified. Specifically, in the above-described embodiment, the first assignment method and the second assignment method were switched according to conditions.
[0115] In contrast, in this modification example, as an encoding / decoding mode for the last position, whether to encode (signal) the last position is switched according to conditions.
[0116] In the encoding apparatus 1 according to this modification example, the encoding control unit 134 selects either a first encoding method that encodes the last position and performs encoding on the conversion coefficients up to the last position, or a second encoding method that performs encoding on all the conversion coefficients without encoding the last position.
[0117] In the first encoding method, after serializing the conversion coefficients in the block in a scan order defined in advance from high frequency to low frequency, when entropy-encoding the serialized conversion coefficients, the last position is encoded (signaled), and the positions and values of the significant coefficients from the last position to the DC component are entropy-encoded. Note that in the case of the first encoding method, it is assumed that the above-described first assignment method is applied to the binarization of the last position.
[0118] On the other hand, in the second encoding method, after serializing the conversion coefficients in the block in a scan order defined in advance from high frequency to low frequency, when entropy-encoding the serialized conversion coefficients, the positions and values of the significant coefficients from the highest frequency component to the DC component are entropy-encoded without encoding (signaling) the last position.
[0119] The symbol control unit 134 selects the first encoding method according to the fact that the type of conversion process selected by the conversion unit 121 is not conversion skip, and selects the second encoding method according to the fact that the type of conversion process selected by the conversion unit 121 is conversion skip.
[0120] As described above, when the conversion unit 121 selects conversion skip, since the energy of the conversion coefficients does not necessarily concentrate in the upper left region, the amount of bits required for signaling last_position_x and last_position_y may increase. For this reason, when the conversion unit 121 selects conversion skip, encoding is performed on all the conversion coefficients in the encoding target block without signaling last_position_x and last_position_y. Thereby, it is possible to suppress an increase in the amount of bits required for signaling the last position and improve the encoding efficiency.
[0121] Also, the encoding control unit 134 may select the first encoding method according to the fact that the size of the encoding target block satisfies a specific condition, and select the second encoding method according to the fact that the size of the encoding target block does not satisfy the specific condition.
[0122] Furthermore, the encoding control unit 134 may select the first encoding method according to the fact that the type of prediction process selected by the prediction unit 170 is a specific prediction process, and select the second encoding method according to the fact that the type of prediction process selected by the prediction unit 170 is not the specific prediction process.
[0123] In the decoding apparatus 2 according to this modification example, the decoding control unit 204 selects either the first decoding method of decoding the last position and performing decoding on the conversion coefficients up to the last position, or the second decoding method of performing decoding on all the conversion coefficients without decoding the last position.
[0124] The decoding control unit 204 selects the first encoding method according to the fact that the type of the inverse transformation process is not transformation skip, and selects the second encoding method according to the fact that the type of the inverse transformation process is transformation skip.
[0125] Alternatively, the decoding control unit 204 may select the first encoding method according to the fact that the size of the block to be decoded satisfies a specific condition, and select the second encoding method according to the fact that the size of the block to be decoded does not satisfy the specific condition.
[0126] Furthermore, the decoding control unit 204 may select the first encoding method according to the fact that the type of the prediction process is a specific prediction process, and select the second encoding method according to the fact that the type of the prediction process is not the specific prediction process.
[0127] Next, an operation example of the encoding control unit 134 and the decoding control unit 204 according to this modification example will be described. Here, the operation of the encoding control unit 134 will be described, but the same operation can be applied to the decoding control unit 204. In that case, "encoding method" is read as "decoding method", and "block to be encoded" is read as "block to be decoded".
[0128] FIG. 9 is a diagram showing a first operation example of the encoding control unit 134 according to this modification example.
[0129] As shown in FIG. 9, in step S211, the encoding control unit 134 checks whether the type of the transformation process selected by the transformation unit 121 is transformation skip. When the type of the transformation process selected by the transformation unit 121 is transformation skip (step S211: YES), in step S215, the encoding control unit 134 selects the second encoding method.
[0130] When the type of conversion process selected by the conversion unit 121 is not conversion skip (step S211: NO), in step S212, the encoding control unit 134 checks whether the size of the block to be encoded satisfies a specific condition. When the size of the block to be encoded satisfies the specific condition (step S212: YES), in step S215, the encoding control unit 134 selects the second encoding method.
[0131] When the size of the block to be encoded does not satisfy the specific condition (step S212: NO), in step S213, the encoding control unit 134 checks whether the type of prediction process selected by the prediction unit 170 is a specific prediction process. When the type of prediction process selected by the prediction unit 170 is a specific prediction process (step S213: YES), in step S215, the encoding control unit 134 selects the second encoding method.
[0132] On the other hand, when any of steps S211, S212, and S213 is "NO", the encoding control unit 134 selects the first encoding method.
[0133] Note that the order of steps S211, S212, and S213 is not limited to the above order. Also, one or two of steps S211, S212, and S213 may be omitted.
[0134] FIG. 10 is a diagram showing a second operation example of the encoding control unit 134 according to this modification example.
[0135] As shown in FIG. 10, in step S221, the encoding control unit 134 checks whether the type of conversion process selected by the conversion unit 121 is conversion skip. When the type of conversion process selected by the conversion unit 121 is not conversion skip (step S221: NO), in step S225, the encoding control unit 134 selects the first encoding method.
[0136] When the type of conversion process selected by the conversion unit 121 is conversion skip (step S221: YES), in step S222, the encoding control unit 134 checks whether the size of the block to be encoded satisfies a specific condition. When the size of the block to be encoded does not satisfy the specific condition (step S222: NO), in step S225, the encoding control unit 134 selects the first encoding method.
[0137] When the size of the block to be encoded satisfies the specific condition (step S222: YES), in step S223, the encoding control unit 134 checks whether the type of prediction process selected by the prediction unit 170 is a specific prediction process. When the type of prediction process selected by the prediction unit 170 is not the specific prediction process (step S223: NO), in step S225, the encoding control unit 134 selects the first encoding method.
[0138] On the other hand, when any of steps S221, S222, and S223 is "YES", the encoding control unit 134 selects the second encoding method.
[0139] Note that the order of steps S221, S222, and S223 is not limited to the above order. Also, one or two of steps S221, S222, and S223 may be omitted.
[0140] <Other Embodiments> A program for causing a computer to execute each process performed by the encoding device 1 may be provided. A program for causing a computer to execute each process performed by the decoding device 2 may be provided. The program may be recorded on a computer-readable medium. By using a computer-readable medium, it is possible to install the program on a computer. Here, the computer-readable medium on which the program is recorded may be a non-transitory recording medium. The non-transitory recording medium is not particularly limited, and may be, for example, a recording medium such as a CD-ROM or a DVD-ROM.
[0141] The circuits that execute each process performed by the symbolization device 1 may be integrated, and the symbolization device 1 may be configured by a semiconductor integrated circuit (chipset, SoC). The circuits that execute each process performed by the decoding device 2 may be integrated, and the decoding device 2 may be configured by a semiconductor integrated circuit (chipset, SoC).
[0142] As described above, the embodiments have been described in detail with reference to the drawings. However, the specific configuration is not limited to the above, and various design changes and the like can be made without departing from the gist.
Explanation of Signs
[0143] 1: Symbolization device 2: Decoding device 100: Block division unit 110: Subtraction unit 120: Transformation / quantization unit 121: Transformation unit 122: Quantization unit 130: Entropy encoding unit 131: Serialization unit 132: Binarization unit 133: Encoding unit 134: Encoding control unit 140: Inverse quantization / inverse transformation unit 141: Inverse quantization unit 142: Inverse transformation unit 150: Synthesis unit 160: Memory 170: Prediction unit 171: Inter prediction unit 172: Intra prediction unit 173: Switching unit 200: Entropy decoding unit 201: Decoding unit 202: Multivalue conversion unit 203: Deserialization unit 204: Decoding control unit 210: Inverse quantization / inverse transformation unit 211: Inverse quantization unit 212: Inverse transformation unit 220: Synthesis unit 230: Memory 240: Prediction Unit 241: Inter-Prediction Unit 242: Intra-Prediction Unit 243: Switching Unit
Claims
1. An encoding apparatus that encodes an encoding target block obtained by dividing an image, comprising: an intra prediction unit that performs intra prediction processing on the encoding target block to output a prediction block; a conversion unit that performs conversion processing on a residual signal representing an error of the prediction block with respect to the encoding target block, and outputs conversion coefficients for each frequency component; a quantization unit that quantizes the conversion coefficients output by the conversion unit; an entropy encoding unit that encodes the quantized conversion coefficients and outputs an encoded stream; and the entropy encoding unit has an encoding control unit that selects an encoding mode for end position information indicating a position of a last significant coefficient on the highest frequency side among the conversion coefficients, the intra prediction unit performs a type of prediction processing selected from a plurality of types of prediction processing including specific prediction processing that performs prediction with reference to reference pixels adjacent to the encoding target block, the encoding control unit, selects a first encoding mode in response to the selected type of prediction processing being the specific prediction processing, and selects a second encoding mode different from the first encoding mode in response to the selected type of prediction processing not being the specific prediction processing. An encoding apparatus characterized by this.
2. A decoding apparatus that decodes a decoding target block from an encoded stream, comprising: an entropy decoding unit that decodes the encoded stream and outputs quantized conversion coefficients; an inverse quantization unit that inverse quantizes the conversion coefficients output by the entropy decoding unit; an inverse conversion unit that performs inverse conversion processing on the inverse quantized conversion coefficients to restore a residual signal; an intra prediction unit that performs intra prediction processing on the decoding target block to output a prediction block; a synthesis unit that synthesizes the residual signal output by the inverse conversion unit and the prediction block to reconstruct the decoding target block; and the intra prediction unit performs a type of prediction processing selected from a plurality of types of prediction processing including specific prediction processing that performs prediction with reference to reference pixels adjacent to the decoding target block, the entropy decoding unit has a decoding control unit that selects a decoding mode for end position information indicating a position of a last significant coefficient on the highest frequency side among the conversion coefficients, the decoding control unit, selects a first decoding mode in response to the selected type of prediction processing being the specific prediction processing, A decoding apparatus, comprising: selecting a second decoding mode different from the first decoding mode in response to that the selected type of prediction processing is not the specific prediction processing.
3. A program, which causes a computer to function as the encoding apparatus according to claim 1 or the decoding apparatus according to claim 2.