Encoding device, decoding device, and program
The encoding and decoding devices optimize bit length assignment for the last significant coefficient position based on conversion and prediction processes, addressing inefficiencies in HEVC and VVC by reducing bit requirements and enhancing encoding efficiency.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- NIPPON HOSO KYOKAI
- Filing Date
- 2020-06-22
- Publication Date
- 2026-06-19
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In video encoding methods like HEVC and VVC, conversion skipping leads to increased bit requirements when the last position of significant coefficients does not occur in the upper left region, reducing encoding efficiency.
An encoding and decoding device that selects an encoding mode for the last significant coefficient position based on conversion and prediction processes, using variable or fixed bit lengths to optimize bit signaling.
Reduces the bit size required for signaling the last position, improving encoding efficiency by adapting bit length assignment to the characteristics of the residual signal distribution.
Smart Images

Figure 0007876256000001 
Figure 0007876256000002 
Figure 0007876256000003
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 represented 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 has a tendency for energy to concentrate in low-frequency components, entropy reduction is achieved by decomposing (transforming) the residual signal into frequency components through a conversion process (see, for example, Non-Patent Document 1).
[0003] The left-upper most component of the conversion coefficient obtained by performing a conversion process on the residual signal is the DC (Direct Current) component, and as it goes downward, 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 applying a conversion process to a residual signal including a sharp edge or a residual signal with high energy only in a local region, there is a problem that the energy is distributed over the entire conversion coefficient due to frequency division, resulting in an increase in entropy.
[0005] In HEVC and VVC (Versatile Video Coding), which is the next-generation encoding method, a conversion skip mode in which conversion is not applied to the residual signal is introduced. In conversion skip, the residual signal is scaled to obtain a conversion coefficient without performing a conversion such as DCT (Discrete Cosine Transform) or DST (Discrete Sine Transform). Therefore, by selecting conversion skip for a residual signal including a sharp edge or a residual signal with high energy only in a local region, an increase in entropy can be suppressed.
[0006] In encoding devices, residual signals are output as a stream, and the positions and values of significant components (significance coefficients) of the quantized conversion coefficients are entropy encoded and output.
[0007] In HEVC, the conversion coefficients within a block are serialized in a predetermined scan order from high frequency to low frequency, and the serialized conversion coefficients are entropy encoded. At that time, the last position, which is the termination position information indicating the position of the last significance coefficient on the highest frequency side among the serialized conversion coefficients, is signaled, and the position and value of the significance coefficients from the last position to the DC component are entropy encoded.
[0008] In entropy coding of the last position, the two values X and Y (last_position_x, last_position_y), which are coordinates (relative positions with respect to the DC component) within the last position block, are entropically coded separately.
[0009] As described above, residual signals generally tend to have energy concentrated in the low-frequency components, so the last position is likely to occur in the upper left region of the conversion coefficients. Therefore, when binarizing to signal last_position_x and last_position_y, the last position is efficiently encoded by assigning a symbol with a short bit length to small values and a symbol with a long bit length to large values. [Prior art documents] [Non-patent literature]
[0010] [Non-Patent Document 1] Recommendation ITU-T H.265,(12 / 2016), “High efficiency video coding”, International Telecommunication Union [Disclosure of the Invention] [Problems that the invention aims to solve]
[0011] However, when conversion skipping is performed, the residual signal is directly quantized, so the last position does not necessarily occur in the upper left region of the conversion coefficients. If the predicted 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, which increases the amount of bits required for signaling the last position, resulting in a decrease in encoding efficiency.
[0012] Therefore, the present invention aims to provide an encoding device, a decoding device, and a program that can suppress the increase in bit size caused by signaling of the last position (terminal position information) and improve encoding efficiency. [Means for solving the problem]
[0013] The encoding device according to the first embodiment is an encoding device that encodes a block to be encoded obtained by dividing an image, and comprises: a prediction unit that performs prediction processing on the block to be encoded and outputs a predicted block; a conversion unit that performs conversion processing on a residual signal representing the error of the predicted block with respect to the block to be encoded 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 termination position information indicating the position of the last significant coefficient on the highest frequency side among the conversion coefficients, based on at least one of the type of conversion processing performed by the conversion unit, the size of the block to be encoded, and the type of prediction processing performed by the prediction unit.
[0014] A decoding device according to a second embodiment is a decoding device for decoding a block to be decoded from an encoded stream, comprising: an entropy decoding unit that decodes the encoded stream and outputs quantized conversion coefficients; an inverse quantization unit that inversely quantizes the conversion coefficients output by the entropy decoding unit; an inverse conversion unit that performs an inverse conversion process on the conversion coefficients after inverse quantization 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 conversion 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 termination position information indicating the position of the last significant coefficient on the highest frequency side among the conversion coefficients, based on at least one of the type of inverse conversion process performed by the inverse conversion unit, the size of the block to be decoded, and the type of prediction process performed by the prediction unit.
[0015] The program according to the third embodiment causes the computer to function as an encoding device according to the first embodiment or a decoding device according to the second embodiment. [Effects of the Invention]
[0016] According to the present invention, it is possible to provide an encoding device, a decoding device, and a program that can suppress the increase in bit amount caused by signaling of the last position and improve encoding efficiency. [Brief explanation of the drawing]
[0017] [Figure 1] This figure shows the configuration of the encoding device according to the embodiment. [Figure 2] This figure shows the configuration of the entropy encoding unit according to the embodiment. [Figure 3] This figure shows an example of the operation of the serialization unit according to the embodiment. [Figure 4] This figure shows an example of the operation of the serialization unit according to the embodiment. [Figure 5] This figure shows a first example of the operation of the coding control unit according to the embodiment. [Figure 6] It is a diagram showing a second operation example of the encoding control unit according to the embodiment. [Figure 7] It is a diagram showing the configuration of the decoding device according to the embodiment. [Figure 8] It is a diagram showing the configuration of the entropy decoding unit according to the embodiment. [Figure 9] It is a diagram showing a first operation example of the encoding control unit according to a modified example of the embodiment. [Figure 10] It is a diagram showing a second operation example of the encoding control unit according to a modified example of the embodiment.
Mode for Carrying Out the Invention
[0018] Referring to the drawings, an encoding device and a decoding device according to the 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 the 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 the form of frames (or pictures) that make up the moving image, into multiple image blocks, and outputs the resulting image blocks to the subtraction unit 110. The size of the image block is, for example, 32x32 pixels, 16x16 pixels, 8x8 pixels, or 4x4 pixels. The shape of the image block is not limited to a square; it may also be rectangular (non-square). The image block is a unit that the encoding device 1 performs encoding on (a block to be encoded) and a unit that the decoding device performs decoding on (a block to be decoded). 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 chrominance signal. In the following description, the case where the shape of the block division is the same for the luminance signal and the chrominance signal will be mainly explained, but the division can also be controlled independently for the luminance signal and the chrominance signal. When luminance blocks and chrominance blocks are not specifically distinguished, they are simply called the encoded blocks.
[0023] The subtraction unit 110 calculates a predicted residual, which represents the difference (error) between the block to be encoded output from the block division unit 100 and the predicted block obtained by the prediction unit 170 predicting the block to be encoded. The subtraction unit 110 calculates the predicted residual by subtracting each pixel value of the predicted block from each pixel value of the block, and outputs the calculated predicted residual to the conversion / quantization unit 120. Hereinafter, the signal consisting of the predicted residuals at the block level will be called the residual signal.
[0024] The conversion and quantization unit 120 performs conversion and quantization processing in block units. The conversion and quantization unit 120 comprises 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. Conversion processing (conversion) refers to the process of converting a signal in the pixel domain into a signal in the frequency domain, and includes, for example, discrete cosine transform (DCT), discrete sine transform (DST), Karhunen-Loeve transform (KLT), and integer conversions thereof.
[0026] In this embodiment, the conversion unit 121 performs a conversion process of a type selected from among multiple types of conversion processes, including a conversion skip that does not perform a conversion on the residual signal. Specifically, the conversion unit 121 selects the type of conversion process to apply to the residual signal for both the horizontal and vertical directions. For example, it selects which conversion to apply from among candidates such as DCT2, DST7, DCT8, etc. (including conversions that are integerized versions of these). The conversion unit 121 outputs conversion type information indicating the type of conversion process selected to the entropy coding unit 130.
[0027] The conversion unit 121 can select conversion skipping. For example, the conversion unit 121 selects conversion skipping for residual signals that contain sharp edges or residual signals with high energy only in localized regions. When conversion skipping is selected, the conversion unit 121 outputs the residual signal adjusted by scaling or other processes as a conversion coefficient without performing conversions such as DCT or DST. The conversion unit 121 may apply conversion skipping to only one of the horizontal and vertical directions, or it may apply conversion skipping to both. The case where conversion skipping is applied to both the horizontal and vertical directions will be described below.
[0028] The conversion unit 121 may, for example, select the type of conversion process by optimizing (i.e., RD optimization) such that the linear combination of the amount of information generated for each block to be encoded and the signal distortion is minimized, or it may select the type of conversion process based on the block size and division shape of the block to be encoded and the type of prediction process.
[0029] The quantization unit 122 quantizes the conversion coefficients output from the transformation unit 121 using a quantization parameter (Qp) and a quantization matrix, and outputs the quantized conversion coefficients to the entropy coding unit 130 and the inverse quantization / inverse transformation unit 140. The quantization parameter (Qp) is a parameter that is applied in common to each conversion coefficient within a block and is a parameter that determines the coarseness of the quantization. The quantization matrix is a matrix whose elements are the quantized values obtained when quantizing each conversion coefficient.
[0030] The entropy coding unit 130 performs entropy coding on the conversion coefficients output from the quantization unit 122, compresses the data, generates an encoded stream (bitstream), and outputs the generated encoded stream to the outside of the encoding device 1. For entropy coding, Huffman coding or CABAC (Context-based Adaptive Binary Arithmetic Coding) can be used.
[0031] The entropy coding unit 130 obtains information such as the size and shape of each block to be coded from the block division unit 100, obtains conversion type information from the conversion unit 121, obtains prediction information from the prediction unit 170, and also encodes this obtained information.
[0032] The inverse quantization / inverse transformation unit 140 performs inverse quantization and inverse transformation processing on a block-by-block basis. The inverse quantization / inverse transformation unit 140 comprises an inverse quantization unit 141 and an inverse transformation unit 142.
[0033] The inverse quantization unit 141 performs inverse quantization processing corresponding to the quantization processing performed by the quantization unit 122. Specifically, the inverse quantization unit 141 restores the transformation coefficients output from the quantization unit 122 by inverse quantization using the quantization parameter (Qp) and the quantization matrix, and outputs the restored transformation coefficients to the inverse transformation 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, if the transform unit 121 performs a DCT, the inverse transform unit 142 performs an 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 predicted 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 to each pixel value of the predicted block to reconstruct (decode) the target block, and outputs the decoded image (decoded block) in the decoded block unit to the memory 160. Such decoded blocks are sometimes called reconstructed blocks.
[0036] Memory 160 stores the decoded images output from the synthesis unit 150 and accumulates the decoded images on a frame-by-frame basis. Memory 160 outputs the stored decoded images to the prediction unit 170. A loop filter may be provided between the synthesis unit 150 and memory 160.
[0037] The prediction unit 170 generates prediction blocks corresponding to the blocks to be encoded by performing prediction processing on a block-by-block basis, and outputs the generated prediction blocks 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 interpretation unit 171 uses the decoded image stored in the memory 160 as a reference image to calculate motion vectors using methods such as block matching, predicts the blocks to be encoded, generates interpretation prediction blocks, and outputs the generated interpretation prediction blocks to the switching unit 173.
[0039] The interpretation unit 171 selects the optimal interpretation method from among interpretation using multiple reference images (typically biprediction) and interpretation using one reference image (unidirectional prediction), and performs interpretation using the selected interpretation method. The interpretation unit 171 outputs information related to interpretation (such as motion vectors) to the entropy coding unit 130.
[0040] The intra-prediction unit 172 selects the optimal intra-prediction mode from among multiple intra-prediction modes to apply to the target block for intra-prediction, and uses the selected intra-prediction mode to predict the target block. The intra-prediction unit 172 generates an intra-prediction block by referring to the decoded pixel values adjacent to the target block from the decoded image stored in the memory 160, and outputs the generated intra-prediction block to the switching unit 173. The intra-prediction unit 172 also outputs information regarding the selected intra-prediction mode to the entropy coding 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 one of the prediction blocks to the subtraction unit 110 and the synthesis unit 150.
[0042] As described above, the encoding device 1 according to this embodiment includes a prediction unit 170 that performs prediction processing on a block to be encoded and outputs a predicted block, a conversion unit 121 that performs conversion processing on a residual signal representing the error of the predicted block with respect to the block to be encoded and outputs 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 and outputs an encoded stream.
[0043] Next, the configuration of the entropy coding unit 130 according to this embodiment will be described. Figure 2 is a diagram showing the configuration of the entropy coding unit 130 according to this embodiment.
[0044] As shown in Figure 2, the entropy coding unit 130 includes a serialization unit 131, a binarization unit 132, a coding unit 133, and a coding control unit 134.
[0045] The serialization unit 131 serializes the conversion coefficients for each block to be encoded in a predetermined scan order from high frequency to low frequency, and outputs the serialized conversion coefficients to the binarization unit 132. The scan order refers to the encoding and decoding order of the conversion coefficients.
[0046] Figures 3 and 4 show examples of the operation of the serialization unit 131 according to this embodiment. In Figures 3 and 4, an example is shown where the size of the block to be encoded is 8 × 8.
[0047] As shown in Figure 3, the serialization unit 131 scans the conversion coefficients within a block from the highest frequency component toward the DC component. Here, an example of scanning in 4x4 sub-block units is shown.
[0048] As shown in Figure 4, the serialization unit 131 generates last position information, which indicates 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 last position to the binarization unit 132, which is expressed in two values (last_position_x, last_position_y) of x and y, representing the coordinates of the first non-zero coefficient in the scan order (i.e., the relative position with respect to the DC component). In the example in Figure 4, (last_position_x, last_position_y) = (6, 5). last_position_x and last_position_y each consist of a prefix part and a suffix part.
[0049] Furthermore, the serialization unit 131 generates various information (syntax elements) indicating the structure of the conversion coefficients on a subblock basis and outputs the generated information to the binarization unit 132. For example, the serialization unit 131 outputs a flag called coded_sub_block_flag to the binarization unit 132, which indicates whether or not there is a significant coefficient within the subblock. In the example in Figure 4, the serialization unit 131 outputs a coded_sub_block_flag to the binarization unit 132 for the lower left subblock, indicating that there is no significant coefficient within this subblock.
[0050] The coding control unit 134 selects the coding mode for the last position based on the type of conversion process performed by the conversion unit 121. The coding control unit 134 may also select the coding mode for the last position based on the size of the block to be coded. Furthermore, the coding control unit 134 may select the coding mode for the last position based on the type of prediction process performed by the prediction unit 170.
[0051] In this embodiment, the encoding method for the last position includes a bit length assignment method for the binarized symbol of the last position. Specifically, the encoding control unit 134 selects one of two methods: a first assignment method that assigns symbols with longer bit lengths as the value of the last position increases, and a second assignment method that assigns symbols with uniform bit lengths regardless of the value of the last position.
[0052] The first assignment method utilizes the characteristic that energy is more likely to concentrate in the upper left region (low-frequency components) of the conversion coefficients to assign variable-length bit symbols when binarizing last_position_x and last_position_y. 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. The first assignment method may also be called trunked rice binarization.
[0053] For example, in the first allocation method, if the block size is 8x8 pixels, when the coordinate position of the last position is the top left (for example, (x,y)=(0,0)), the last position is composed of a symbol with a total of 2 bits, and when the coordinate position of the last position is the bottom right (for example, (x,y)=(7,7)), the last position is composed of a symbol with a total of 10 bits.
[0054] On the other hand, the second assignment method assigns symbols with a uniform bit length regardless of the value of the last position (i.e., the coordinate position of the last position). A uniform bit length means that there is no difference in bit length between small and large values, and it is not necessary to make the bit length the same for all values. The second assignment method may also be called fixed-length binaryization.
[0055] For example, in the second assignment method, the input value is binarized using Ceil(log2(cMax+1)), which is the shortest fixed-bit length that can represent the maximum value cMax (Maximum Code Value). However, Ceil is a function that rounds up the decimal part. If the block width is 32 pixels, a 6-bit fixed-bit symbol may be assigned to last_position_x.
[0056] The encoding control unit 134 selects a first assignment method if the type of conversion process selected by the conversion unit 121 is not a conversion skip, and selects a second assignment method if the type of conversion process selected by the conversion unit 121 is a conversion skip.
[0057] Thus, when the conversion unit 121 selects to skip a conversion, the energy of the conversion coefficient is not necessarily concentrated in the upper left region. Therefore, when binarizing last_position_x and last_position_y, symbols of equal bit length are assigned using the second assignment method. This suppresses the increase in the amount of bits required for signaling the last position and improves encoding efficiency.
[0058] Furthermore, the encoding control unit 134 may select a first assignment method depending on whether the size of the block to be encoded satisfies specific conditions, and select a second assignment method depending on whether the size of the block to be encoded does not satisfy specific conditions. 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 a first assignment method depending on whether the size of the block to be encoded exceeds a predetermined size, and select a second assignment method depending on whether the size of the block to be encoded is less than or equal to 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 to begin with, so the second assignment method may offer better encoding efficiency than the first assignment method.
[0060] Alternatively, the encoding control unit 134 may select a first assignment method depending on whether the size of the block to be encoded is the maximum or minimum size, and select a second assignment method depending on whether the size of the block to be encoded is the maximum or minimum size.
[0061] Furthermore, the coding control unit 134 may select a first assignment method depending on whether the type of prediction process selected by the prediction unit 170 is a specific prediction process, and may select a second assignment method depending on whether the type of prediction process selected by the prediction unit 170 is not a specific prediction process. A specific prediction process is a prediction process that makes predictions by referring to a reference pixel adjacent to the block to be coded, and intra-prediction is an example of a specific prediction process. On the other hand, prediction processes other than specific prediction processes include inter-prediction and intra-block copying, which copies different decoded partial images of the same frame.
[0062] The binarization unit 132 converts the multi-level signal output by the serialization unit 131 into a binary signal and outputs the binary signal to the encoding unit 133. In this embodiment, the binarization unit 132 binarizes last_position_x and last_position_y respectively according to the bit length allocation method selected by the encoding control unit 134.
[0063] Specifically, the binarization unit 132 binarizes last_position_x and last_position_y using the first assignment method if the encoding control unit 134 selects the first assignment method, and binarizes last_position_x and last_position_y using the second assignment method if the encoding control unit 134 selects the second assignment 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, the encoding unit 133 encodes variable-length bit symbols when the conversion unit 121 selects a conversion process other than conversion skip, and encodes fixed-length bit symbols when the conversion unit 121 selects conversion skip.
[0065] In this case, if the conversion unit 121 selects something other than conversion skip, the encoding unit 133 may entropy encode a portion of the binarized symbol (the prefix portion) using context-adaptive arithmetic encoding with the first context. If the conversion unit 121 selects conversion skip, the encoding unit 133 may entropy encode the binarized fixed-length bit symbol using context-adaptive arithmetic encoding with the second context. Furthermore, if the conversion unit 121 selects conversion skip, the encoding unit 133 may perform fixed-length encoding on the binarized fixed-length bits and output them as a stream.
[0066] Next, an example of the operation of the coding control unit 134 according to this embodiment will be described. Figure 5 is a diagram showing a first example of the operation of the coding control unit 134 according to this embodiment.
[0067] As shown in Figure 5, in step S111, the coding control unit 134 checks whether the type of conversion process selected by the conversion unit 121 is a conversion skip. If the type of conversion process selected by the conversion unit 121 is a conversion skip (step S111: YES), in step S115, the coding control unit 134 selects the second assignment method.
[0068] If the type of conversion process selected by the conversion unit 121 is not a conversion skip (step S111: NO), in step S112, 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 satisfies the specific condition (step S112: YES), in step S115, the encoding control unit 134 selects the second assignment method.
[0069] If the size of the block to be encoded does not meet the specific conditions (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 assignment method.
[0070] On the other hand, if all of steps S111, S112, and S113 are "NO", the coding control unit 134 selects the first assignment method.
[0071] Note that the order of steps S111, S112, and S113 is not limited to the order shown above. Also, one or two of steps S111, S112, and S113 may be omitted.
[0072] Figure 6 shows a second example of the operation of the coding control unit 134 according to this embodiment.
[0073] As shown in Figure 6, in step S121, the encoding control unit 134 checks whether the type of conversion process selected by the conversion unit 121 is a conversion skip. If the type of conversion process selected by the conversion unit 121 is not a conversion skip (step S121: NO), in step S125, the encoding control unit 134 selects the first assignment method.
[0074] If the type of conversion process selected by the conversion unit 121 is a 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 assignment method.
[0075] If the size of the block to be encoded satisfies a 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 assignment method.
[0076] On the other hand, if all of steps S121, S122, and S123 are "YES", the coding control unit 134 selects the second assignment method.
[0077] Note that the order of steps S121, S122, and S123 is not limited to the order shown above. Also, one or two of steps S121, S122, and S123 may be omitted.
[0078] <Decryption device> Next, the decoding device according to this embodiment will be described, primarily focusing on the differences between it and the encoding device described above. Figure 7 shows the configuration of the decoding device 2 according to this embodiment. The decoding device 2 is a device that decodes the target block from the encoded stream.
[0079] As shown in Figure 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 transformation type information indicating the type of transformation process applied to the block to be decoded, information regarding the block size and shape of the block to be decoded, and prediction type information indicating the type of prediction process applied to the block to be decoded. The entropy decoding unit 200 outputs the acquired transformation 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] Furthermore, the entropy decoding unit 200 decodes the encoded stream, obtains quantized conversion coefficients, and outputs the obtained conversion coefficients to the inverse quantization / inverse conversion unit 210 (inverse quantization unit 211).
[0082] The inverse quantization / inverse transformation unit 210 performs inverse quantization and inverse transformation processing on a block-by-block basis. The inverse quantization / inverse transformation unit 210 comprises 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 recovers the conversion coefficients of the decoded block by inverse quantization of the quantization conversion coefficients output from the entropy decoding unit 200 using the quantization parameter (Qp) and the quantization matrix, and outputs the recovered conversion coefficients to the inverse conversion unit 212.
[0084] The inverse transform unit 212 performs inverse transform processing corresponding to the transform processing performed by the transform unit 121 of the encoding device 1. The inverse transform unit 212 performs inverse transform processing on the transform 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 this embodiment, the inverse transform unit 212 performs an inverse transform processing of a selected type from among multiple types of inverse transform processing, including a transform skip that does not perform inverse transform on the transform coefficients, based on the transform type information output from the entropy decoding unit 200.
[0085] The synthesis unit 220 reconstructs (decodes) the original block by combining the residual signal output from the inverse transform unit 212 and the predicted block output from the prediction unit 240 on a pixel-by-pixel basis, and outputs the decoded block image to the memory 230.
[0086] Memory 230 stores the decoded images output from the combining unit 220. Memory 230 stores the decoded images on a frame-by-frame basis. Memory 230 outputs the decoded images on a frame-by-frame basis to the outside of the decoding device 2. A loop filter may be provided between the combining unit 220 and memory 230.
[0087] The prediction unit 240 performs predictions on a block-by-block basis. Specifically, the prediction unit 240 performs a prediction process of a selected type from among multiple types of prediction processes, including a specific prediction process that performs a prediction by referring to a reference pixel 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 interpretation unit 241 uses the decoded image stored in the memory 230 as a reference image to predict the blocks to be decoded by interpretation. The interpretation unit 241 generates interpretation predicted blocks by performing interpretation according to the index and motion vector output from the entropy decoding unit 200, and outputs the generated interpretation predicted blocks to the switching unit 243.
[0089] The intra-prediction unit 242 refers to the decoded image stored in the memory 230 and generates intra-predicted blocks by predicting the blocks to be decoded using intra-prediction based on the information output from the entropy decoding unit 200, and outputs the generated intra-predicted blocks 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] As described above, the decoding device 2 according to this embodiment includes an entropy decoding unit 200 that decodes an encoded stream and outputs quantized conversion coefficients, an inverse quantization unit 211 that inversely quantizes the conversion coefficients output by the entropy decoding unit 200, an inverse conversion unit 212 that performs an inverse conversion process on the conversion coefficients after inverse quantization to restore the residual signal, a prediction unit 240 that performs a prediction process on the block to be decoded and outputs a predicted block, and a synthesis unit 220 that synthesizes the residual signal output by the inverse conversion unit 212 and the predicted block to reconstruct the block to be decoded.
[0092] Next, the configuration of the entropy decoding unit 200 according to this embodiment will be described. Figure 8 is a diagram showing the configuration of the entropy decoding unit 200 according to this embodiment.
[0093] As shown in Figure 8, the entropy decoding unit 200 includes a decoding unit 201, a multi-level conversion unit 202, and a deserialization unit 203.
[0094] The decoding unit 201 parses the encoded stream and decodes a binary signal from the encoded stream. In this embodiment, the decoding unit 201 converts the symbols at the last position (last_position_x, last_position_y) into binary signals according to the bit length allocation scheme 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 following: the conversion type information included in the encoded stream (i.e., the type of inverse conversion processing 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 processing performed by the prediction unit 240). In this embodiment, the decoding mode for the last position includes a bit length assignment method for the symbols at the last position.
[0096] The decoding control unit 204 selects the first assignment method described above, depending on whether the selected type of inverse transformation process is not a transformation skip. The decoding control unit 204 selects the second assignment method described above, depending on whether the selected type of inverse transformation process is a transformation skip.
[0097] Furthermore, the decoding control unit 204 may select a first allocation method depending on whether the size of the block to be decoded satisfies specific conditions, and select a second allocation method depending on whether the size of the block to be decoded does not satisfy specific conditions.
[0098] Furthermore, the decoding control unit 204 may select a first assignment method depending on whether the selected prediction process is a specific prediction process, and select a second assignment method depending on whether the selected prediction process is not a specific prediction process.
[0099] The multi-leveling unit 202 converts the binary signal output by the decoding unit 201 into a multi-level signal and outputs the multi-level signal to the deserialization unit 203. This restores the quantized conversion coefficients.
[0100] The deserialization unit 203 deserializes the multi-level signal output by the multi-level conversion unit 202, and outputs block-level conversion coefficients (quantized conversion coefficients) to the inverse quantization unit 211.
[0101] Next, with reference to Figure 5, an example of operation 1 of the decoding control unit 204 according to this embodiment will be described.
[0102] As shown in Figure 5, in step S111, the decoding control unit 204 checks whether the type of conversion process indicated by the signaled conversion type information is a conversion skip. If the type of conversion process indicated by the signaled conversion type information is a conversion skip (step S111: YES), in step S115, the decoding control unit 204 selects the second assignment method.
[0103] If the type of conversion process indicated by the signaled conversion type information is not a conversion skip (step S111: NO), in step S112, the decoding control unit 204 checks whether the size of the block to be decoded, indicated by the block size information, satisfies a specific condition. If the size of the block to be decoded satisfies the specific condition (step S112: YES), in step S115, the decoding control unit 204 selects the second assignment method.
[0104] If the size of the block to be decoded does not meet the specific conditions (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 assignment method.
[0105] On the other hand, if all of steps S111, S112, and S113 are "NO", the decoding control unit 204 selects the first assignment method.
[0106] Note that the order of steps S111, S112, and S113 is not limited to the order shown above. Also, one or two of steps S111, S112, and S113 may be omitted.
[0107] Next, with reference to Figure 6, an example of operation 2 of the decoding control unit 204 according to this embodiment will be described.
[0108] As shown in Figure 6, in step S121, the decoding control unit 204 checks whether the type of conversion process indicated by the signaled conversion type information is a conversion skip. If the type of conversion process indicated by the signaled conversion type information is not a conversion skip (step S121: NO), in step S125, the decoding control unit 204 selects the first assignment method.
[0109] If the type of conversion process indicated by the signaled conversion type information is a conversion skip (step S121: YES), in step S122, the decoding control unit 204 checks whether the size of the block to be decoded satisfies a specific condition. If the size of the block to be decoded does not satisfy the specific condition (step S122: NO), in step S125, the decoding control unit 204 selects the first assignment method.
[0110] If the size of the block to be decoded satisfies a 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. If 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 assignment method.
[0111] On the other hand, if all of steps S121, S122, and S123 are "YES", the decoding control unit 204 selects the second assignment method.
[0112] Note that the order of steps S121, S122, and S123 is not limited to the order shown above. Also, one or two of steps S121, S122, and S123 may be omitted.
[0113] <Example of changes> Next, we will describe some examples of modifications to the embodiments described above.
[0114] In the embodiments described above, the encoding and decoding method for the last position was illustrated by a method of assigning bit lengths to a symbol obtained by binarizing the last position. Specifically, in the embodiments described above, the first assignment method and the second assignment method were switched depending on the conditions.
[0115] In contrast, this modified example switches whether or not to encode (signalize) the last position as the encoding / decoding method for the last position, depending on the conditions.
[0116] In the encoding device 1 according to this modified example, the encoding control unit 134 selects one of the following: a first encoding method that encodes the last position and encodes the conversion coefficients up to the last position, and a second encoding method that encodes all conversion coefficients without encoding the last position.
[0117] In the first encoding scheme, the conversion coefficients within a block are serialized in a predetermined scan order from high frequency to low frequency. Then, when the serialized conversion coefficients are entropy encoded, the last position is encoded (signaled), and the position and value of the significance coefficients from the last position to the DC component are also entropy encoded. In the case of the first encoding scheme, the first assignment scheme described above is applied to the binarization of the last position.
[0118] On the other hand, in the second coding method, the conversion coefficients within a block are serialized in a predetermined scan order from high frequency to low frequency. Then, when entropy coding the serialized conversion coefficients, the last position is not coded (signaled), and the position and value of the significance coefficients from the highest frequency component to the DC component are entropy coded.
[0119] The encoding control unit 134 selects a first encoding method if the type of conversion process selected by the conversion unit 121 is not a conversion skip, and selects a second encoding method if the type of conversion process selected by the conversion unit 121 is a conversion skip.
[0120] As described above, if the conversion unit 121 selects to skip conversions, the energy of the conversion coefficients may not be concentrated in the upper left region, which could increase the number of bits required for signaling last_position_x and last_position_y. Therefore, if the conversion unit 121 selects to skip conversions, it performs encoding on all conversion coefficients within the target block without signaling last_position_x and last_position_y. This suppresses the increase in the number of bits required for signaling the last position and improves encoding efficiency.
[0121] Furthermore, the encoding control unit 134 may select a first encoding method depending on whether the size of the block to be encoded satisfies specific conditions, and select a second encoding method depending on whether the size of the block to be encoded does not satisfy specific conditions.
[0122] Furthermore, the coding control unit 134 may select a first coding scheme depending on whether the type of prediction process selected by the prediction unit 170 is a specific prediction process, and may select a second coding scheme depending on whether the type of prediction process selected by the prediction unit 170 is not a specific prediction process.
[0123] In the decryption device 2 according to this modified example, the decryption control unit 204 selects one of the following: a first decryption method that decrypts the last position and performs decryption on the conversion coefficients up to the last position, and a second decryption method that performs decryption on all conversion coefficients without decrypting the last position.
[0124] The decoding control unit 204 selects a first encoding scheme depending on whether the type of inverse transformation process is not a transformation skip, and selects a second encoding scheme depending on whether the type of inverse transformation process is a transformation skip.
[0125] Furthermore, the decoding control unit 204 may select a first encoding method depending on whether the size of the block to be decoded satisfies specific conditions, and select a second encoding method depending on whether the size of the block to be decoded does not satisfy specific conditions.
[0126] Furthermore, the decoding control unit 204 may select a first coding scheme depending on whether the type of prediction process is a specific prediction process, and select a second coding scheme depending on whether the type of prediction process is not a specific prediction process.
[0127] Next, we will describe the operation examples of the encoding control unit 134 and the decoding control unit 204 related to this modification example. Here, we will describe the operation of the encoding control unit 134, but similar operation can be applied to the decoding control unit 204. In that case, replace "encoding method" with "decoding method" and "encoded block" with "decoded block".
[0128] Figure 9 shows a first example of the operation of the coding control unit 134 related to this modification example.
[0129] As shown in Figure 9, in step S211, the encoding control unit 134 checks whether the type of conversion process selected by the conversion unit 121 is a conversion skip. If the type of conversion process selected by the conversion unit 121 is a conversion skip (step S211: YES), in step S215, the encoding control unit 134 selects a second encoding method.
[0130] If the type of conversion process selected by the conversion unit 121 is not a 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. If the size of the block to be encoded satisfies the specific condition (step S212: YES), in step S215, the encoding control unit 134 selects a second encoding method.
[0131] If the size of the block to be encoded does not meet the specific conditions (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. If 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 a second encoding method.
[0132] On the other hand, if all of steps S211, S212, and S213 are "NO", the coding control unit 134 selects the first coding method.
[0133] Note that the order of steps S211, S212, and S213 is not limited to the order shown above. Also, one or two of steps S211, S212, and S213 may be omitted.
[0134] Figure 10 shows a second example of the operation of the coding control unit 134 related to this modification example.
[0135] As shown in Figure 10, in step S221, the encoding control unit 134 checks whether the type of conversion process selected by the conversion unit 121 is a conversion skip. If the type of conversion process selected by the conversion unit 121 is not a conversion skip (step S221: NO), in step S225, the encoding control unit 134 selects the first encoding method.
[0136] If the type of conversion process selected by the conversion unit 121 is a 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. If 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 a first encoding method.
[0137] If the size of the block to be encoded satisfies a 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. If the type of prediction process selected by the prediction unit 170 is not a specific prediction process (step S223: NO), in step S225, the encoding control unit 134 selects a first encoding method.
[0138] On the other hand, if all of steps S221, S222, and S223 are "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 order shown above. Also, one or two of steps S221, S222, and S223 may be omitted.
[0140] <Other Embodiments> A program may be provided that causes a computer to perform each process performed by the encoding device 1. A program may also be provided that causes a computer to perform each process performed by the decoding device 2. The program may be recorded on a computer-readable medium. 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-transient recording medium. The non-transient recording medium is not particularly limited, but may be a recording medium such as a CD-ROM or DVD-ROM.
[0141] The circuits that perform each process carried out by the encoding device 1 may be integrated, and the encoding device 1 may be configured as a semiconductor integrated circuit (chipset, SoC). The circuits that perform each process carried out by the decoding device 2 may be integrated, and the decoding device 2 may be configured as a semiconductor integrated circuit (chipset, SoC).
[0142] Although the embodiments have been described in detail above with reference to the drawings, the specific configuration is not limited to those described above, and various design changes can be made without departing from the gist of the invention. [Explanation of Symbols]
[0143] 1: Encoding device 2: Decryption device 100: Block division section 110: Subtraction Unit 120: Conversion / Quantization Unit 121: Conversion section 122: Quantization section 130: Entropy coding unit 131: Serialization section 132: Binarization part 133: Encoding section 134: Encoding Control Unit 140: Inverse Quantization / Inverse Transformation Section 141: Inverse quantization section 142: Inverse Transform Section 150: Synthesis part 160: Memory 170: Prediction Department 171: Interpretation Department 172: Intra Prediction Unit 173: Switching section 200: Entropy Decoder 201: Decoding section 202: Multi-level conversion section 203: Deserialization Section 204: Decoding Control Unit 210: Inverse Quantization / Inverse Transformation Unit 211: Inverse quantization section 212: Inverse transformation section 220: Synthesis part 230: Memory 240: Prediction Department 241: Interpretation Department 242: Intra Prediction Unit 243: Switching section
Claims
1. An encoding device that encodes the blocks to be encoded obtained by dividing an image, An intra-prediction unit that performs intra-prediction processing on the aforementioned block to be coded and outputs a predicted block, A conversion unit performs a conversion process on the residual signal representing the error of the prediction block with respect to 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, The system includes an entropy encoding unit that encodes the quantized conversion coefficients and outputs an encoded stream, The entropy coding unit has an coding control unit that selects a coding mode for termination position information indicating the position of the last significant coefficient on the highest frequency side among the conversion coefficients, The intra prediction unit performs a prediction process of a type selected from among multiple types of prediction processes, including a specific prediction process that performs a prediction by referring to a reference pixel adjacent to the block to be encoded. The encoding control unit, Depending on whether the selected type of prediction process is the specified prediction process, a first coding mode is selected. An encoding device characterized by selecting a second encoding mode different from the first encoding mode in accordance with the fact that the selected type of prediction processing is not the specified prediction processing.
2. A decoding device that decodes a block to be decoded from an encoded stream, An entropy decoding unit that decodes the encoded stream and outputs quantized transformation coefficients, An inverse quantization unit that inversely quantizes the conversion coefficients output by the entropy decoding unit, An inverse transform unit that performs an inverse transform process on the transformation coefficients after inverse quantization to restore the residual signal, An intra-prediction unit that performs intra-prediction processing on the aforementioned decoded target block and outputs a predicted block, The system includes a combining unit that combines the residual signal output by the inverse transform unit with the prediction block to reconstruct the decoded block, The intra prediction unit performs a prediction process of a type selected from among multiple types of prediction processes, including a specific prediction process that performs a prediction by referring to a reference pixel adjacent to the block to be decoded. The entropy decoding unit includes a decoding control unit that selects a decoding mode for termination position information indicating the position of the last significant coefficient on the highest frequency side among the conversion coefficients, The decoding control unit, Depending on whether the selected type of prediction process is the specified prediction process, a first decoding mode is selected. A decoding device characterized by selecting a second decoding mode different from the first decoding mode, depending on whether the selected type of prediction process is not the specified prediction process.
3. A program characterized by causing a computer to function as the encoding device described in claim 1 or the decoding device described in claim 2.