Image encoding device and method
By virtually dividing processing units into smaller units and applying a BIO threshold-based determination, the image encoding device addresses the challenge of large buffer requirements in BIO prediction, optimizing hardware resources and maintaining throughput.
Patent Information
- Application Number
- JP2023220431
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2018-12-28
- Filing Date
- 2023-12-27
- Publication Date
- 2024-10-08
- Estimated Expiration
- 2039-12-16
AI Technical Summary
The challenge of reducing buffer size requirements in image encoding devices, particularly when implementing bidirectional optical flow (BIO) prediction in video codecs like VVC, where dividing processing units (PUs) into virtual PUs (vPUs) becomes difficult due to the need for large buffers for gradient and speed calculations, especially when PUs are larger than VPDU sizes.
An image encoding device that virtually divides processing units into 8x8, 16x16, 32x32, or 64x64 units for cost calculation and BIO application determination, using a control unit and a BIO application determination unit to assess the Sum of Absolute Difference (SAD) and a BIO threshold for each divided unit, reducing the buffer size required for gradient and speed calculations.
This approach effectively reduces buffer size requirements by allowing efficient division of PUs into smaller units, optimizing hardware resources and maintaining throughput, even when PUs exceed VPDU sizes, thereby enhancing encoding efficiency.
Smart Images

Figure 0007563562000001 
Figure 0007563562000002 
Figure 0007563562000003
Abstract
Description
[Technical field]
[0001] The present technology relates to an image coding device and method, and more particularly to an image coding device and method that enable a reduction in buffer size. [Background technology]
[0002] Progress is being made in standardizing VVC as the next-generation codec following AVC / H.264 and HEVC / H.265.
[0003] The VVC standard uses large coding units (CUs) of up to 128x128, but also introduces the concept of virtual pipeline data units (VPDUs) to address issues such as increased circuit size and power consumption in HW decoder implementations.
[0004] The size of the VPDU is the buffer size that allows each pipeline stage to process data smoothly. The size of the VPDU is often set to the maximum size of a TU (Transform Unit).
[0005] In VVC, the maximum TU size is 64x64, and this size is also assumed for VPDU. In VVC, one PU corresponds to one CU, and inter prediction processing is required for PUs larger than VPDU. Even in this case, it is possible to process by dividing the PU into virtual vPUs (virtual PUs), which is compatible with VPDU and could be implemented with reasonable HW resources until the adoption of BIO (Bi-directional optical flow), which will be described later.
[0006] The Optical Flow method is an image processing method that detects the movement of an object in a video and estimates the direction in which it will move after a certain amount of time has passed. Adding this Optical Flow method as an option for inter-prediction in a codec improves coding efficiency. The Optical Flow method is specifically called BIO because it uses Bi-prediction (bidirectional prediction), which refers to one frame before and one after in time (see Non-Patent Document 1).
[0007] In normal Bi-prediction, since there is a difference between the optimal MV and the predicted MV (PMV), the differential MV (MVD) is coded, whereas in Bi-prediction with BIO, the gradient (G) and velocity (V) are calculated using the Optical Flow method for the predicted blocks generated by the predicted MV (PMV), and the same results as normal Bi-prediction are obtained. In such cases, coding of the differential MV (MVD) is unnecessary or can be reduced, improving coding efficiency (see Non-Patent Document 2).
[0008] On the other hand, the computational cost of the gradient (G) and velocity (V) required by BIO is very high. Therefore, when the gradient (G) and velocity (V) are calculated but have little difference from the predicted value obtained by normal Bi prediction due to their small absolute values, reduction is particularly required in terms of cost-effectiveness.
[0009] One of the various proposed BIO reduction methods involves calculating the Sum of Absolute Difference (SAD) between blocks when the L0 predicted block and the L1 predicted block are generated, and if the SAD value falls below a certain threshold, not applying BIO and instead performing normal Bi prediction.
[0010] This takes into account the tendency for a small SAD value to result in a small velocity (V) and therefore less effect from BIO, and functions as an early termination that omits costly calculations when no effect is expected. [Prior art documents] [Non-patent literature]
[0011] [Non-Patent Document 1] Jianle Chen, Yan Ye, Seung Hwan Kim, “Algorithm description for Versatile Video Coding and Test Model 3 (VTM 3)”, [online], September 24, 2018, Experts Team (JVET), [Retrieved December 21, 2018], Internet, < http: / / phenix.it-sudparis.eu / jvet / doc_end_user / documents / 12_Macao / wg11 / JVET-L1002-v1.zip > [Non-Patent Document 2] Xiaoyu Xiu, Yuwen He, Yan Ye, “CE9-related: Complexity reduction and bit-width control for bi-directional optical flow (BIO)”, [online], September 24, 2018, Experts Team (JVET), [Retrieved December 21, 2018], Internet, < http: / / phenix.it-sudparis.eu / jvet / doc_end_user / documents / 12_Macao / wg11 / JVET-L0256-v3.zip > Summary of the Invention [Problem to be solved by the invention]
[0012] When the BIO reduction method described above is applied, the SAD of the L0 and L1 predicted blocks is calculated for the entire PU, and then compared with a threshold to determine whether or not to apply BIO processing, and the process branches. Therefore, when performing inter prediction with a PU larger than the VPDU, it becomes difficult to virtually divide the PU into multiple vPUs.
[0013] In this case, the buffer required for gradient calculation and velocity calculation requires an area that is one size larger than the PU, and a large buffer resource is required in the inter prediction processing unit including the BIO.
[0014] The present technology has been made in consideration of such circumstances, and makes it possible to reduce the buffer size. [Means for solving the problem]
[0015] An image coding device according to one aspect of the present technology includes a control unit that virtually divides a coding unit (CU) used for inter-prediction processing into either 8x8, 16x16, 32x32, or 64x64 as a processing unit for cost calculation used to determine whether or not to perform bidirectional prediction (BIO), which references one frame before and after in time using an Optical Flow technique, and a BIO application determination unit that determines whether or not to apply the BIO based on a comparison between the Sum of Absolute Difference (SAD) of the prediction block of the CU and a BIO threshold corresponding to the size of the processing unit.
[0016] An image coding method of one aspect of the present technology is an image coding method of an image coding device including a control unit and a BIO application determination unit, in which the control unit virtually divides a Coding Unit (CU) used for inter-prediction processing into either 8x8, 16x16, 32x32, or 64x64 as a processing unit for cost calculation used to determine whether to perform bidirectional prediction (BIO) that references one frame before and after in time using an Optical Flow method, and the BIO application determination unit determines whether to apply the BIO based on a comparison between the Sum of Absolute Difference (SAD) of the predicted block of the CU and a BIO threshold corresponding to the size of the processing unit.
[0017] In one aspect of the present technology, a Coding Unit (CU) used for inter-prediction processing is virtually divided into either 8x8, 16x16, 32x32, or 64x64 as a processing unit for cost calculation used to determine whether to perform bidirectional prediction (BIO), which references one frame before and after in time using the Optical Flow method, and whether to apply the BIO is determined based on a comparison between the Sum of Absolute Difference (SAD) of the prediction block of the CU and a BIO threshold value corresponding to the size of the processing unit. [Brief description of the drawings]
[0018] [Figure 1] This is a diagram showing an example of a pipeline configuration without introducing VPDU. [Diagram 2] 2 is a flowchart illustrating Bi prediction, which is one of the inter PU processes in the case of FIG. 1. [Diagram 3] This is a diagram showing an example of efficient pipeline configuration using VPDU. [Figure 4] 4 is a flowchart illustrating Bi prediction, which is one of the inter PU processes in the case of FIG. 3. [Diagram 5] FIG. 1 is a diagram showing an example of normal Bi prediction. [Figure 6] FIG. 13 is a diagram showing an example of Bi prediction to which BIO is applied. [Figure 7] FIG. 13 is a diagram showing an example of two-block division in normal Bi prediction. [Figure 8] FIG. 13 is a diagram showing an example of two-block division in Bi prediction to which BIO is applied. [Figure 9] 1 is a block diagram showing an example configuration of an encoding device according to an embodiment of the present technology. [Figure 10] 11 is a flowchart illustrating details of an encoding process performed by the encoding device. [Figure 11] 11 is a flowchart illustrating the details of the encoding process of the encoding device, following FIG. [Figure 12]1 is a block diagram showing an example configuration of an embodiment of a decoding device to which the present disclosure is applied. [Figure 13] 11 is a flowchart illustrating details of a decoding process performed by the decoding device. [Figure 14] FIG. 13 is a block diagram showing an example configuration of an inter prediction unit. [Figure 15] 1 is a flowchart illustrating a conventional Bi prediction including BIO. [Figure 16] 16 is a flowchart illustrating Bi prediction including conventional BIO, following FIG. 15 . [Figure 17] 1 is a flowchart illustrating Bi prediction including BIO according to a first embodiment of the present technology. [Figure 18] 18 is a flowchart illustrating Bi prediction including BIO according to the first embodiment of the present technology, following FIG. 17 . [Figure 19] 13 is a diagram showing the correspondence between PU size, vPU number, and processing position and size. FIG. [Figure 20] 11 is a diagram showing a comparison between a conventional operation and an operation according to a first embodiment of the present technology. FIG. [Figure 21] 11 is a diagram showing a comparison between a conventional operation and an operation according to a first embodiment of the present technology. FIG. [Figure 22] 13 is a diagram showing an example in which the BIO determination result for a vPU number of 0 is used for other vPUs when the PU is larger than the VPDU. [Figure 23] 13 is a diagram showing an example in which the BIO determination result for a vPU number of 0 is used for other vPUs when the PU is larger than the VPDU. [Figure 24] 24 is a flowchart illustrating Bi prediction including BIO in the cases of FIGS. 22 and 23. [Diagram 25] 24 is a flowchart illustrating Bi prediction including BIO in the cases of FIGS. 22 and 23. FIG. [Figure 26] FIG. 13 is a diagram showing an example of determining whether BIO is applicable based on partial SAD values within each vPU. [Figure 27] FIG. 13 is a diagram showing an example of determining whether BIO is applicable based on partial SAD values within each vPU. [Figure 28] 13 is a flowchart illustrating a process of determining a partial SAD calculation area for determining BIO_vPU_ON of each vPU. [Figure 29] 29 is a flowchart illustrating the process of determining a partial SAD calculation area for determining BIO_vPU_ON of each vPU, following FIG. 28. [Diagram 30] 13 is a flowchart illustrating Bi prediction including BIO performed by an inter prediction unit 51 as an operation example of the second embodiment of the present technology. [Diagram 31] 30 , is a flowchart illustrating Bi prediction including BIO performed by the inter prediction unit 51 as an operation example of the second embodiment of the present technology. [Diagram 32] A diagram showing the correspondence between BIO_MAX_SAD_BLOCK_SIZE and sPU. [Diagram 33] 13 is a flowchart illustrating Bi prediction including BIO performed by an inter prediction unit 51 as an operation example of the third embodiment of the present technology. [Diagram 34] 34 is a flowchart illustrating Bi prediction including BIO performed by the inter prediction unit 51 as an operation example of the third embodiment of the present technology, following FIG. 33. [Diagram 35] 13 is a diagram showing an example of an area for calculating the SAD of each PU when BIO_MAX_SAD_BLOCK_SIZE is set to 2; FIG. [Diagram 36] 13 is a diagram showing an example of an area for calculating the SAD of each PU when BIO_MAX_SAD_BLOCK_SIZE is set to 2; FIG. [Figure 37] 13 is a flowchart illustrating Bi prediction including BIO performed by an inter prediction unit 51 as an operation example of the fourth embodiment of the present technology. [Figure 38] 37, is a flowchart illustrating Bi prediction including BIO performed by the inter prediction unit 51 as an operation example of the fourth embodiment of the present technology. [Figure 39] 13 is a flowchart illustrating Bi prediction including BIO performed by an inter prediction unit 51 as an operation example of the fifth embodiment of the present technology. [Diagram 40] 39 , is a flowchart illustrating Bi prediction including BIO performed by the inter prediction unit 51 as an operation example of the fifth embodiment of the present technology. [Diagram 41] FIG. 2 is a block diagram showing an example of the configuration of a computer. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0019] Hereinafter, an embodiment of the present technology will be described in the following order. 0. Overview 1. First embodiment (example of division by vPU) 2. Second embodiment (example of sharing operations using flags) 3. Third embodiment (example of division by sPU) 4. Fourth embodiment (example of prohibition of use of BIO) 5. Fifth embodiment (example of continuous BIO application) 6. Sixth embodiment (computer)
[0020] <0. Overview>
[0021] Progress is being made in standardizing VVC as the next-generation codec following AVC / H.264 and HEVC / H.265.
[0022] The VVC standard uses large coding units (CUs) of up to 128x128, but also introduces the concept of virtual pipeline data units (VPDUs) in consideration of increased circuit size and power consumption in HW decoder implementations.
[0023] The size of the VPDU is the buffer size that allows each pipeline stage to process data smoothly. The size of the VPDU is often set to the maximum size of a TU (Transform Unit).
[0024] In VVC, 64x64 is the maximum TU size, and this size is also assumed for VPDU. In VVC, one PU corresponds to one CU, and for a PU with a size larger than the VPDU size, it is necessary to perform inter-prediction processing. Even in this case, it is possible to perform processing by dividing the PU into virtual vPUs (virtual PUs), and the consistency with VPDU is good. Until BIO (Bi-directional optical flow) described later is adopted, as shown in FIGS. 1 to 4, the buffer can be reduced, so it was possible to implement with reasonable HW resources.
[0025] <Example of pipeline when VPDU is not introduced> FIG. 1 is a diagram showing an example of constructing a pipeline without introducing VPDU.
[0026] Above FIG. 1, each block of CU, inter-PU, and TU is shown.
[0027] The maximum size of CU is 128×128. The maximum size of inter-PU is 128×128. In VVC, one PU corresponds to one CU. TU consists of TU0 to TU3, and the maximum size of each TU is 64×64. The size of TU is also the size of VPDU.
[0028] As shown above FIG. 1, CU is formed by adding the inter-PU generated by inter-PU processing and the TU obtained by TU processing.
[0029] Below FIG. 1, a pipeline consisting of inter-PU processing, TU processing, and local decoding processing is shown.
[0030] In the pipeline, the processing of inter-PU and the processing of TU0 to TU3 are performed in parallel, and when both are completed, the local decoding processing of CU is started. Therefore, in the processing of inter-PU, a 128×128 buffer is required, and in the processing of TU, a 128×128 buffer is required for synchronization with PU.
[0031] Figure 2 is a flowchart for explaining Bi prediction (bidirectional prediction), which is one of the inter-PU processes in the case of Figure 1.
[0032] In step S1, the parameters of the inter prediction are acquired.
[0033] In step S2, an L0 prediction block is generated.
[0034] In step S3, an L1 prediction block is generated.
[0035] In step S4, a Bi prediction block PU is generated from the L0 prediction block and the L1 prediction block.
[0036] Note that in steps S2 to S4, the size of the PU is required as the maximum buffer size.
[0037] <Example of pipeline when VPDU is introduced> Figure 3 is a diagram showing an example of efficiently constructing a pipeline by introducing VPDU.
[0038] Note that in Figure 3, points common to the description of Figure 1 are omitted as appropriate.
[0039] Above Figure 3, blocks of CU, inter-PU, and TU are shown. Different from Figure 1, CU is composed of divided CUs (0) to CU(3) because the PU is virtually divided into vPUs for processing. The PU is composed of virtual vPUs (0) to vPU(3).
[0040] Below Figure 3, a pipeline consisting of inter-PU processing, TU processing, and local decoding processing is shown.
[0041] In the pipeline, the processing of vPU(0) to vPU(3) and the processing of TU0 to TU3 in the inter-PU are performed in parallel. Therefore, when the processing of vPU(0) and the processing of TU0 are completed, the local decoding processing of CU(0) is started. When the processing of vPU(1) and the processing of TU1 are completed, the local decoding processing of CU(1) is started. When the processing of vPU(2) and the processing of TU2 are completed, the local decoding processing of CU(2) is started. When the processing of vPU(3) and the processing of TU3 are completed, the local decoding processing of CU(3) is started.
[0042] By configuring the pipeline in this manner, a 64×64 buffer is sufficient for inter-PU processing, and a size of 64×64 is sufficient for the vPU queueing buffer in TU processing.
[0043] FIG. 4 is a flowchart illustrating Bi prediction, which is one of the inter PU processes in the case of FIG.
[0044] In step S11, inter prediction parameters are obtained.
[0045] In step S12, the number of vPUs included in the PU is obtained.
[0046] In step S13, 0 is set to the vPU number.
[0047] In step S14, it is determined whether the vPU number is smaller than the vPU count. If it is determined in step S14 that the vPU number is smaller than the vPU count, the process proceeds to step S15.
[0048] In step S15, the position and size of the vPU within the PU are obtained from the vPU number.
[0049] In step S16, an L0 predicted block for the area of the vPU is generated.
[0050] In step S17, an L1 prediction block for the vPU region is generated.
[0051] In step S18, a Bi predicted block vPU is generated from the L0 predicted block and the L1 predicted block.
[0052] In step S19, the vPU number is incremented, and then the process returns to step S14, and the subsequent processes are repeated.
[0053] Furthermore, if it is determined in step S14 that the vPU number is equal to or greater than the number of vPUs, the Bi prediction is terminated.
[0054] In steps S16 and S17, the maximum buffer size may be a VPDU size smaller than a PU.
[0055] The Optical Flow technique is an image processing technique that detects the movement of an object in a video image and estimates the direction in which it will move after a certain amount of time has passed. Adding this Optical Flow technique as an option for inter-prediction in a codec improves coding efficiency. It is specifically called BIO because it uses the Optical Flow technique with Bi-prediction, which references one frame before and one frame after in time.
[0056] <Example of normal Bi prediction> FIG. 5 is a diagram showing an example of normal Bi prediction.
[0057] In Fig. 5, the arrows from left to right indicate the time in the display order. Also, an example is shown in which optimal MVs are calculated for Bi predicted values of Bi predicted blocks in B pictures in reference plane 0 in the L0 direction and reference plane 1 in the L1 direction. The same applies to the following figures.
[0058] The Bi predicted value corresponds to pixel L0 of the L0 predicted block in reference plane 0 and pixel L1 of the L1 predicted block in reference plane 1, and the Bi predicted value is calculated as (L0+L1) / 2.
[0059] As shown in FIG. 5, in normal Bi prediction, since there is a difference between the optimal MV (MV_L0, MV_L1) and the predicted MV (MVP_L0, MVP_L1), it is necessary to encode the differential MV (MVD_L0, MVD_L1).
[0060] <Example of Bi prediction applying BIO> FIG. 6 is a diagram showing an example of Bi prediction to which BIO is applied.
[0061] In FIG. 6, as an example of Bi prediction applying BIO, an example of obtaining a gradient (G) and a velocity (V) by an Optical Flow method for predicted blocks generated by the predicted MV (MVP_L0, MVP_L1) is shown. By obtaining the gradient (G) and the velocity (V) by the Optical Flow method for the predicted blocks, results equivalent to those of normal Bi prediction can be obtained.
[0062] In the case of Bi prediction applying BIO, since the predicted MV (MVP_L0, MVP_L1) is directly used as the MV (MV_L0, MV_L1), there is no need to encode the differential MV (MVD_L0, MVD_L1), so the encoding efficiency is improved.
[0063] In the Bi prediction value, the pixel L0' of the L0 predicted block on the reference plane 0 and the pixel L1' of the L1 predicted block on the reference plane 1 almost correspond, and the Bi prediction value is obtained by (L0' + L1' + B) / 2. That is, it is necessary to calculate the gradient (G: Gx, Gy) and the velocity (V: Vx, Vy) from the L0 predicted block and the L1 predicted block, and obtain the correction value B = Vx * Gx + Vy * Gy.
[0064] <Example of two-block division of Bi prediction> FIG. 7 is a diagram showing an example of two-block division of normal Bi prediction.
[0065] In the normal Bi prediction, since the blocks are divided into two blocks, as shown in FIG. 7, the block division information for two blocks and two differential MVs (MVDs) are obtained respectively. Therefore, it is necessary to encode the block division information for two blocks and two differential MVs (MVDs).
[0066] <Example of 2-block division of Bi prediction applying BIO> FIG. 8 is a diagram showing an example of 2-block division of Bi prediction applying BIO.
[0067] In the Bi prediction applying BIO, even if there are two blocks, as shown in FIG. 8, the gradient (G) and velocity (V) can be obtained by the Optical Flow method without dividing the blocks, so the same result as the normal Bi prediction can be obtained.
[0068] As described above, in the Bi prediction applying BIO in FIG. 8, it becomes possible to eliminate or reduce the encoding of the block division information required in the Bi prediction in FIG. 7, or it becomes possible to eliminate or reduce the encoding of the differential MV (MVD) required in the Bi prediction in FIG. 7. Therefore, the encoding efficiency can be improved.
[0069] On the other hand, the calculation cost of the gradient (G) and velocity (V) obtained by BIO is very high. Therefore, if, despite calculating the gradient (G) and velocity (V), there is little difference from the predicted value obtained by the normal Bi prediction, for example, because the absolute values are small, a reduction is particularly required in terms of cost-effectiveness.
[0070] One of the reduction methods of BIO for which various proposals have been made is to calculate the SAD (Sum of Absolute Difference) between blocks at the stage when the L0 prediction block and the L1 prediction block are generated, and if the SAD value is below a certain threshold, do not apply BIO and execute the normal Bi prediction.
[0071] This takes into account the tendency for a small SAD value to result in a small velocity (V) and therefore less effect from BIO, and functions as an early termination that omits costly calculations when no effect is expected.
[0072] When the BIO reduction method described above is applied, the SAD of the L0 and L1 predicted blocks is calculated for the entire PU, and then compared with a threshold to determine whether or not to apply BIO processing, and the process branches. Therefore, when performing inter prediction with a PU larger than the VPDU, it becomes difficult to virtually divide the PU into multiple vPUs.
[0073] In this case, the buffer required for gradient calculation and velocity calculation requires an area one size larger than the PU, and large buffer resources are required in the part performing inter prediction including BIO.
[0074] Furthermore, if the above-mentioned BIO reduction method is implemented in hardware, the pipeline delay of inter prediction including BIO is significantly different from the pipeline delay of TU processing, which increases the difficulty of the hardware implementation in order to maintain throughput.
[0075] Therefore, in the present technology, a processing unit (e.g., PU) for calculating a cost used to determine whether or not to perform bidirectional prediction such as BIO is divided into a division processing unit equivalent to the VPDU size (e.g., vPU) or a division processing unit equal to or smaller than the VPDU size (e.g., sPU, which will be described later), and a determination is made using the cost calculated based on the division processing unit. Note that the VPDU size refers to a size one size larger than the VPDU size.
[0076] In this specification, when referring to block sizes, "A is larger than B" means that "the horizontal size of A is larger than the horizontal size of B" or "the vertical size of A is larger than the vertical size of B".
[0077] Furthermore, with regard to block size, "A is equal to or smaller than B" means that "the horizontal size of A is equal to or smaller than the horizontal size of B, and the vertical size of A is equal to or smaller than the vertical size of B."
[0078] This technology will be described in detail below.
[0079] <1. First embodiment (example of division by vPU)> <Example of the configuration of the encoding device>
[0080] FIG. 9 is a block diagram showing an example of the configuration of an encoding device according to an embodiment of the present technology.
[0081] 9 includes an A / D conversion unit 31, a screen rearrangement buffer 32, a calculation unit 33, an orthogonal transformation unit 34, a quantization unit 35, a lossless encoding unit 36, an accumulation buffer 37, an inverse quantization unit 38, an inverse orthogonal transformation unit 39, and an addition unit 40. The encoding device 1 also includes a deblocking filter 41, an adaptive offset filter 42, an adaptive loop filter 43, a frame memory 44, a switch 45, an intra prediction unit 46, a motion prediction and compensation unit 47, a predicted image selection unit 48, and a rate control unit 49.
[0082] The A / D conversion unit 31 performs A / D conversion on the input image to be coded in units of frames. The A / D conversion unit 31 outputs the image, which is a digital signal after conversion, to the screen rearrangement buffer 32 for storage.
[0083] The screen rearrangement buffer 32 rearranges the images in frame units in display order into coding order according to the GOP structure. The screen rearrangement buffer 32 outputs the rearranged images to the calculation unit 33, the intra prediction unit 46, and the motion prediction and compensation unit 47.
[0084] The calculation unit 33 performs encoding by subtracting the predicted image supplied from the predicted image selection unit 48 from the image supplied from the screen rearrangement buffer 32. The calculation unit 33 outputs the image after subtraction as residual information (difference) to the orthogonal transformation unit 34. Note that when a predicted image is not supplied from the predicted image selection unit 48, the calculation unit 33 outputs the image read out from the screen rearrangement buffer 32 as it is to the orthogonal transformation unit 34 as residual information.
[0085] The orthogonal transformation unit performs an orthogonal transformation process on the residual information from the calculation unit 33. The orthogonal transformation unit outputs the image after the orthogonal transformation process to the quantization unit .
[0086] The quantization unit 35 quantizes the image after the orthogonal transformation process supplied from the orthogonal transformation unit 34. The quantization unit 35 outputs the quantized value after the quantization to the lossless encoding unit 36.
[0087] The lossless encoding unit 36 acquires intra prediction mode information, which is information indicating an optimal intra prediction mode, from the intra prediction unit 46. In addition, the lossless encoding unit 36 acquires inter prediction mode information, which is information indicating an optimal inter prediction mode, and inter prediction parameters such as motion information and reference image information, from the motion prediction and compensation unit 47.
[0088] Furthermore, the lossless encoding unit 36 acquires offset filter information relating to the offset filter from the adaptive offset filter 42 , and acquires filter coefficients from the adaptive loop filter 43 .
[0089] The lossless encoding unit 36 performs lossless encoding, such as variable length encoding (e.g., CAVLC (Context-Adaptive Variable Length Coding)) or arithmetic encoding (e.g., CABAC (Context-Adaptive Binary Arithmetic Coding)), on the quantized values supplied from the quantization unit 35.
[0090] Furthermore, the lossless encoding unit 36 losslessly encodes the intra prediction mode information or the inter prediction mode information, the inter prediction parameters, the offset filter information, and the filter coefficients as encoding information related to encoding. The lossless encoding unit 36 outputs the losslessly encoded encoding information and the quantized values to the accumulation buffer 37 as encoded data to be accumulated therein.
[0091] The accumulation buffer 37 temporarily stores the encoded data supplied from the lossless encoding unit 36. The accumulation buffer 37 also outputs the stored encoded data to a subsequent stage as an encoded stream.
[0092] The quantized value output from the quantization unit 35 is also input to the inverse quantization unit 38. The inverse quantization unit 38 inverse quantizes the quantized value. The inverse quantization unit 38 outputs the orthogonal transform processing result after inverse quantization to the inverse orthogonal transform unit 39.
[0093] The inverse orthogonal transform unit 39 performs inverse orthogonal transform processing on the orthogonal transform processing result supplied from the inverse quantization unit 38. Examples of inverse orthogonal transform methods include IDCT (inverse discrete cosine transform) and IDST (inverse discrete sine transform). The inverse orthogonal transform unit 39 outputs residual information obtained as a result of the inverse orthogonal transform processing to the addition unit 40.
[0094] The adder 40 adds the residual information supplied from the inverse orthogonal transform unit 39 and the predicted image supplied from the predicted image selection unit 48, and performs decoding. The adder 40 outputs the decoded image to a deblocking filter 41 and a frame memory 44.
[0095] The deblocking filter 41 performs a deblocking filter process to remove block distortion from the decoded image supplied from the addition unit 40. The deblocking filter 41 outputs the image after the deblocking filter process to the adaptive offset filter .
[0096] The adaptive offset filter 42 performs adaptive offset filter (SAO (Sample Adaptive Offset)) processing on the image that has been subjected to the deblocking filter processing by the deblocking filter 41, mainly to remove ringing.
[0097] The adaptive offset filter 42 outputs the image after the adaptive offset filter processing to the adaptive loop filter 43. In addition, the adaptive offset filter 42 outputs information indicating the type and offset of the adaptive offset filter processing to the lossless encoding unit 36 as offset filter information.
[0098] The adaptive loop filter 43 is configured by, for example, a two-dimensional Wiener filter. The adaptive loop filter 43 performs adaptive loop filter (ALF (Adaptive Loop Filter)) processing on the image after the adaptive offset filter processing.
[0099] The adaptive loop filter 43 outputs the image after the adaptive loop filter processing to the frame memory 44. In addition, the adaptive loop filter 43 outputs the filter coefficients used in the adaptive loop filter processing to the lossless encoding unit .
[0100] The frame memory 44 accumulates the image supplied from the adaptive loop filter 43 and the image supplied from the adder 40. Of the images stored in the frame memory 44 that have not been subjected to filtering, images adjacent to a CU are output as peripheral images to the intra prediction unit 46 via the switch 45. On the other hand, the images that have been subjected to filtering and stored in the frame memory 44 are output as reference images to the motion prediction and compensation unit 47 via the switch 45.
[0101] The intra prediction unit 46 performs intra prediction processing in all candidate intra prediction modes by using the surrounding images read from the frame memory 44 via the switch 45 on a PU-by-PU basis.
[0102] Furthermore, the intra prediction unit 46 calculates RD costs for all candidate intra prediction modes based on the image read from the screen rearrangement buffer 32 and the predicted image predicted by the intra prediction process. The intra prediction unit 46 determines the intra prediction mode with the smallest calculated RD cost as the optimal intra prediction mode.
[0103] The intra prediction unit 46 outputs the predicted image generated in the optimal intra prediction mode to the predicted image selection unit 48. When the intra prediction unit 46 is notified of the selection of the predicted image generated in the optimal intra prediction mode, it outputs intra prediction mode information to the lossless encoding unit 36. Note that the intra prediction mode is a mode that indicates the size of the PU, the prediction direction, and the like.
[0104] The motion prediction and compensation unit 47 performs motion prediction and compensation processing for all candidate inter prediction modes. The motion prediction and compensation unit 47 includes an inter prediction unit 51 that compensates for the predicted motion and generates a predicted image.
[0105] The motion prediction and compensation unit 47 detects motion information (motion vectors) of all candidate inter prediction modes based on the image supplied from the screen rearrangement buffer 32 and the reference image read from the frame memory 44 via the switch 45.
[0106] The motion prediction / compensation unit 47 supplies the inter prediction unit 51 with the PU position in the frame, the PU size, the prediction direction, reference image information, motion information, and the like, which correspond to the detected motion information, as inter prediction parameters.
[0107] The inter prediction unit 51 uses the inter prediction parameters supplied from the motion prediction and compensation unit 47 to generate a predicted image by Bi prediction including BIO processing or the like.
[0108] The motion prediction and compensation unit 47 calculates the RD cost for all candidate inter prediction modes based on the image supplied from the screen rearrangement buffer 32 and the predicted image generated by the inter prediction unit 51. The motion prediction and compensation unit 47 determines the inter prediction mode with the smallest RD cost as the optimal inter prediction mode.
[0109] The RD cost and predicted image of the determined optimal inter prediction mode are output to the predicted image selection unit 48. The inter prediction parameters corresponding to the determined optimal inter prediction mode are output to the lossless encoding unit .
[0110] The predicted image selection unit 48 determines, as an optimal prediction mode, one having a smaller corresponding RD cost from the optimal intra prediction mode supplied from the intra prediction unit 46 and the optimal inter prediction mode supplied from the motion prediction and compensation unit 47. Then, the predicted image selection unit 48 outputs the predicted image of the optimal prediction mode to the calculation unit 33 and the addition unit 40.
[0111] The rate control unit 49 controls the rate of the quantization operation of the quantization unit 35 based on the encoded data stored in the storage buffer 37 so as to prevent overflow or underflow.
[0112] <Encoding device operation> 10 and 11 are flowcharts illustrating the details of the encoding process of the encoding device.
[0113] 10, the A / D conversion unit 31 performs A / D conversion on an image in units of frames that is input as an encoding target. The A / D conversion unit 31 outputs the image, which is a digital signal after the conversion, to the screen rearrangement buffer 32 for storage.
[0114] In step S32, the screen rearrangement buffer 32 rearranges the images of the frames in display order into the coding order according to the GOP structure. The screen rearrangement buffer 32 outputs the rearranged frame-by-frame images to the calculation unit 33, the intra prediction unit 46, and the motion prediction and compensation unit 47.
[0115] In step S33, the intra prediction unit 46 performs intra prediction processing for all candidate intra prediction modes. The intra prediction unit 46 also calculates RD costs for all candidate intra prediction modes based on the image read from the screen rearrangement buffer 32 and the predicted image predicted by the intra prediction processing. The intra prediction unit 46 determines the intra prediction mode with the smallest RD cost as the optimal intra prediction mode. The intra prediction unit 46 outputs the predicted image generated in the optimal intra prediction mode to the predicted image selection unit 48.
[0116] In step S34, the motion prediction / compensation unit 47 performs motion prediction / compensation processing for all candidate inter prediction modes.
[0117] The motion prediction and compensation unit 47 detects motion information (motion vectors) of all candidate inter prediction modes based on the image supplied from the screen rearrangement buffer 32 and the reference image read from the frame memory 44 via the switch 45.
[0118] The inter prediction unit 51 uses the inter prediction parameters supplied from the motion prediction and compensation unit 47 to generate a predicted image by Bi prediction including BIO processing or the like.
[0119] The motion prediction and compensation unit 47 calculates the RD cost for all candidate inter prediction modes based on the image supplied from the screen rearrangement buffer 32 and the predicted image generated by the inter prediction unit 51. The motion prediction and compensation unit 47 determines the inter prediction mode with the smallest RD cost as the optimal inter prediction mode.
[0120] The RD cost and predicted image of the determined optimal inter prediction mode are output to the predicted image selection unit 48. The inter prediction parameters in the determined optimal inter prediction mode are output to the lossless encoding unit .
[0121] In step S35, the prediction image selection unit 48 determines the prediction mode with the smallest RD cost as the optimal prediction mode based on the RD costs of the optimal intra prediction mode and the optimal inter prediction mode. Then, the prediction image selection unit 48 outputs the prediction image of the optimal prediction mode to the calculation unit 33 and the addition unit 40.
[0122] In step S36, the predicted image selection unit 48 determines whether the optimal prediction mode is the optimal inter prediction mode. If it is determined in step S36 that the optimal prediction mode is the optimal inter prediction mode, the predicted image selection unit 48 notifies the motion prediction / compensation unit 47 of the selection of a predicted image generated in the optimal inter prediction mode.
[0123] Then, in step S37, the motion prediction / compensation unit 47 outputs the inter prediction mode information and the inter prediction parameters to the lossless encoding unit 36. After that, the process proceeds to step S39.
[0124] On the other hand, if the optimal prediction mode is the optimal intra prediction mode in step S36, the predicted image selection unit 48 notifies the intra prediction unit 46 of the selection of the predicted image generated in the optimal intra prediction mode. Then, in step S38, the intra prediction unit 46 outputs the intra prediction mode information to the lossless encoding unit 36. After that, the process proceeds to step S39.
[0125] In step S39, the calculation unit 33 performs encoding by subtracting the predicted image supplied from the predicted image selection unit 48 from the image supplied from the screen rearrangement buffer 32. The calculation unit 33 outputs the image after the subtraction to the orthogonal transformation unit 34 as residual information.
[0126] In step S40, the orthogonal transform unit performs an orthogonal transform process on the residual information. The orthogonal transform unit outputs the orthogonal transform process result to the quantization unit .
[0127] In step S41, the quantization unit 35 quantizes the orthogonal transform processing result supplied from the orthogonal transformation unit 34. The quantization unit 35 outputs the quantized value after quantization to the lossless encoding unit 36 and the inverse quantization unit 38.
[0128] 11, the inverse quantization unit 38 performs inverse quantization on the quantized value from the quantization unit 35. The inverse quantization unit 38 outputs the orthogonal transform processing result after the inverse quantization to the inverse orthogonal transform unit 39.
[0129] In step S43, the inverse orthogonal transform unit 39 performs an inverse orthogonal transform process on the orthogonal transform result. The inverse orthogonal transform unit 39 outputs residual information after the inverse orthogonal transform process to the adder unit .
[0130] In step S44, the adder 40 adds the residual information supplied from the inverse orthogonal transform unit 39 and the predicted image supplied from the predicted image selection unit 48, and performs decoding. The adder 40 outputs the decoded image to the deblocking filter 41 and the frame memory 44.
[0131] In step S45, the deblocking filter 41 performs a deblocking filter process on the image supplied from the addition unit 40. The deblocking filter 41 outputs the image after the deblocking filter process to the adaptive offset filter .
[0132] In step S46, the adaptive offset filter 42 performs adaptive offset filtering on the image after the deblocking filtering process. The adaptive offset filter 42 outputs the image after the adaptive offset filtering process to the adaptive loop filter 43. In addition, the adaptive offset filter 42 outputs offset filter information to the lossless encoding unit 36.
[0133] In step S47, the adaptive loop filter 43 performs adaptive loop filtering on the image after the adaptive offset filtering process. The adaptive loop filter 43 outputs the image after the adaptive loop filtering process to the frame memory 44. In addition, the adaptive loop filter 43 outputs the filter coefficients used in the adaptive loop filtering process to the lossless encoding unit 36.
[0134] In step S48, the frame memory 44 accumulates the image supplied from the adaptive loop filter 43 and the image supplied from the adder 40. Of the images stored in the frame memory 44 that have not been subjected to filtering, images adjacent to the CU are output as peripheral images to the intra prediction unit 46 via the switch 45. On the other hand, the images that have been subjected to filtering and stored in the frame memory 44 are output as reference images to the motion prediction and compensation unit 47 via the switch 45.
[0135] In step S49, the lossless encoding unit 36 losslessly encodes the intra prediction mode information or inter prediction mode information, the inter prediction parameters, the offset filter information, and the filter coefficients as encoding information.
[0136] In step S50, the lossless encoding unit 36 losslessly encodes the quantized value supplied from the quantization unit 35. Then, the lossless encoding unit 36 generates encoded data from the encoding information losslessly encoded in the process of step S49 and the quantized value losslessly encoded, and outputs the encoded data to the accumulation buffer 37.
[0137] In step S51, the accumulation buffer 37 temporarily accumulates the encoded data supplied from the lossless encoding unit .
[0138] In step S52, the rate control unit 49 controls the rate of the quantization operation of the quantization unit 35 so as not to cause an overflow or underflow, based on the encoded data accumulated in the accumulation buffer 37. Thereafter, the encoding process is terminated.
[0139] In the encoding process of Figures 10 and 11, for the sake of simplicity, it is assumed that intra prediction processing and motion prediction and compensation processing are always performed. However, in reality, only one of the processing may be performed depending on the picture type, etc.
[0140] <Example of the configuration of the decryption device> FIG. 12 is a block diagram showing an example configuration of an embodiment of a decoding device to which the present disclosure is applied, which decodes the coded stream transmitted from the coding device of FIG.
[0141] 12 includes an accumulation buffer 131, a lossless decoding unit 132, an inverse quantization unit 133, an inverse orthogonal transformation unit 134, an addition unit 135, a deblocking filter 136, an adaptive offset filter 137, an adaptive loop filter 138, and a screen rearrangement buffer 139. The decoding device 101 also includes a D / A conversion unit 140, a frame memory 141, a switch 142, an intra prediction unit 143, an inter prediction unit 51, and a switch 144.
[0142] The accumulation buffer 131 of the decoding device 101 receives and accumulates the encoded data of the encoded stream transmitted from the encoding device 1 of Fig. 9. The accumulation buffer 131 outputs the accumulated encoded data to the lossless decoding unit 132.
[0143] The lossless decoding unit 132 obtains quantized values and coding information by performing lossless decoding such as variable length decoding and arithmetic decoding on the coded data from the accumulation buffer 131. The lossless decoding unit 132 outputs the quantized values to the inverse quantization unit 133. The coding information is composed of intra prediction mode information, inter prediction mode information, inter prediction parameters, offset filter information, filter coefficients, and the like.
[0144] Furthermore, the lossless decoding unit 132 outputs the intra prediction mode information and the like to the intra prediction unit 143. The lossless decoding unit 132 outputs the inter prediction parameters, the inter prediction mode information, and the like to the inter prediction unit 51.
[0145] The lossless decoding unit 132 outputs the intra prediction mode information or inter prediction mode information to the switch 144. The lossless decoding unit 132 outputs the offset filter information to the adaptive offset filter 137. The lossless decoding unit 132 outputs the filter coefficient to the adaptive loop filter 138.
[0146] The inverse quantization unit 133, the inverse orthogonal transformation unit 134, the adder unit 135, the deblocking filter 136, the adaptive offset filter 137, the adaptive loop filter 138, the frame memory 141, the switch 142, the intra prediction unit 143, and the inter prediction unit 51 perform the same processes as the inverse quantization unit 38, the inverse orthogonal transformation unit 39, the adder unit 40, the deblocking filter 41, the adaptive offset filter 42, the adaptive loop filter 43, the frame memory 44, the switch 45, the intra prediction unit 46, and the motion prediction and compensation unit 47 in Fig. 9, respectively. In this way, the image is decoded.
[0147] Specifically, the inverse quantization unit 133 is configured similarly to the inverse quantization unit 38 in Fig. 9. The inverse quantization unit 133 inverse quantizes the quantized value from the lossless decoding unit 132. The inverse quantization unit 133 outputs the orthogonal transform processing result after the inverse quantization to the inverse orthogonal transform unit 134.
[0148] The inverse orthogonal transform unit 134 has the same configuration as the inverse orthogonal transform unit 39 in Fig. 9. The inverse orthogonal transform unit 134 performs inverse orthogonal transform processing on the orthogonal transform processing result supplied from the inverse quantization unit 133. The inverse orthogonal transform unit 134 outputs residual information after the inverse orthogonal transform processing to the addition unit 135.
[0149] The adder 135 performs decoding by adding the residual information supplied from the inverse orthogonal transformer 134 and the predicted image supplied from the switch 144. The adder 135 outputs the decoded image to the deblocking filter 136 and the frame memory 141.
[0150] The deblocking filter 136 performs deblocking filter processing on the image supplied from the addition unit 135 , and outputs the image after the deblocking filter processing to the adaptive offset filter 137 .
[0151] The adaptive offset filter 137 performs adaptive offset filtering of the type indicated by the offset filter information on the image after the deblocking filter processing, using the offset indicated by the offset filter information from the lossless decoding unit 132. The adaptive offset filter 137 outputs the image after the adaptive offset filtering to the adaptive loop filter 138.
[0152] The adaptive loop filter 138 performs adaptive loop filter processing on the image supplied from the adaptive offset filter 137, using the filter coefficients supplied from the lossless decoding unit 132. The adaptive loop filter 138 outputs the image after the adaptive loop filter processing to the frame memory 141 and the screen rearrangement buffer 139.
[0153] The screen rearrangement buffer 139 stores the image after the adaptive loop filter process in units of frames. The screen rearrangement buffer 139 rearranges the images in units of frames in the coding order into the original display order, and outputs the images to the D / A conversion unit 140.
[0154] The D / A conversion unit 140 D / A converts the image in frame units supplied from the screen rearrangement buffer 139 and outputs the converted image.
[0155] The frame memory 141 accumulates the image after adaptive loop filtering and the image supplied from the addition unit 135. Of the images stored in the frame memory 141 that have not been subjected to filtering, images adjacent to a CU are supplied as peripheral images to the intra prediction unit 143 via the switch 142. On the other hand, the images that have been subjected to filtering and stored in the frame memory 141 are output as reference images to the inter prediction unit 51 via the switch 142.
[0156] The intra prediction unit 143 performs intra prediction processing in the optimal intra prediction mode indicated by the intra prediction mode information supplied from the lossless decoding unit 132, using the peripheral images read from the frame memory 141 via the switch 142. The intra prediction unit 143 outputs a predicted image generated as a result to the switch 144.
[0157] The inter prediction unit 51 has the same configuration as in Fig. 9. The inter prediction unit 51 performs inter prediction in the optimal inter prediction mode indicated by the inter prediction mode information, using the inter prediction parameters supplied from the lossless decoding unit 132, and generates a predicted image.
[0158] The inter prediction unit 51 reads out a reference image specified by reference image information of the inter prediction parameters supplied from the lossless decoding unit 132 from the frame memory 141 via the switch 142. The inter prediction unit 51 generates a predicted image by Bi prediction including BIO processing or the like using the motion information of the inter prediction parameters supplied from the lossless decoding unit 132 and the read reference image. The generated predicted image is output to the switch 144.
[0159] When intra prediction mode information is supplied from the lossless decoding unit 132, the switch 144 outputs the predicted image supplied from the intra prediction unit 143 to the addition unit 135. On the other hand, when inter prediction mode information is supplied from the lossless decoding unit 132, the switch 144 outputs the predicted image supplied from the inter prediction unit 51 to the addition unit 135.
[0160] <Operation of the Decryption Device> FIG. 13 is a flowchart illustrating the details of the decoding process performed by the decoding device.
[0161] 13, the accumulation buffer 131 of the decoding device 101 receives and accumulates the encoded data in units of frames supplied from a previous stage (not shown). The accumulation buffer 131 outputs the accumulated encoded data to the lossless decoding unit 132.
[0162] In step S132, the lossless decoding unit 132 losslessly decodes the encoded data from the accumulation buffer 131 to obtain a quantized value and encoded information. The lossless decoding unit 132 outputs the quantized value to the inverse quantization unit 133.
[0163] The lossless decoding unit 132 outputs the intra prediction mode information and the like to the intra prediction unit 143. The lossless decoding unit 132 outputs the inter prediction parameters, the inter prediction mode information, and the like to the inter prediction unit 51.
[0164] Furthermore, the lossless decoding unit 132 outputs the intra prediction mode information or inter prediction mode information to the switch 144. The lossless decoding unit 132 supplies offset filter information to the adaptive offset filter 137, and outputs the filter coefficient to the adaptive loop filter 138.
[0165] In step S133, the inverse quantization unit 133 inverse quantizes the quantized value supplied from the lossless decoding unit 132. The inverse quantization unit 133 outputs the orthogonal transform processing result after the inverse quantization to the inverse orthogonal transform unit .
[0166] In step S 134 , the inverse orthogonal transform unit 134 performs orthogonal transform processing on the orthogonal transform processing result supplied from the inverse quantization unit 133 .
[0167] In step S135, the inter prediction unit 51 determines whether or not inter prediction mode information has been supplied from the lossless decoding unit 132. If it is determined in step S135 that inter prediction mode information has been supplied, the process proceeds to step S136.
[0168] In step S136, the inter prediction unit 51 reads a reference image based on the reference image specifying information supplied from the lossless decoding unit 132, and performs motion compensation processing in the optimal inter prediction mode indicated by the inter prediction mode information using the motion information and the reference image. For example, the inter prediction unit 51 generates a predicted image by Bi prediction including BIO processing. The inter prediction unit 51 outputs the generated predicted image to the adder 135 via the switch 144. Then, the process proceeds to step S138.
[0169] On the other hand, if it is determined in step S135 that the inter prediction mode information has not been supplied, that is, if the intra prediction mode information has been supplied to the intra prediction unit 143, the process proceeds to step S137.
[0170] In step S137, the intra prediction unit 143 performs intra prediction processing in the intra prediction mode indicated by the intra prediction mode information, using the peripheral images read from the frame memory 141 via the switch 142. The intra prediction unit 143 outputs a predicted image generated as a result of the intra prediction processing to the adder 135 via the switch 144. After that, the process proceeds to step S138.
[0171] In step S138, the adder 135 performs decoding by adding the residual information supplied from the inverse orthogonal transform unit 134 and the predicted image supplied from the switch 144. The adder 135 outputs the decoded image to the deblocking filter 136 and the frame memory 141.
[0172] In step S139, the deblocking filter 136 removes block distortion by performing a deblocking filter process on the image supplied from the addition unit 135. The deblocking filter 136 outputs the image after the deblocking filter process to the adaptive offset filter 137.
[0173] In step S140, the adaptive offset filter 137 performs adaptive offset filtering on the image after the deblocking filter processing, based on the offset filter information supplied from the lossless decoding unit 132. The adaptive offset filter 137 outputs the image after the adaptive offset filtering to the adaptive loop filter 138.
[0174] In step S141, the adaptive loop filter 138 performs adaptive loop filter processing on the image supplied from the adaptive offset filter 137, using the filter coefficients supplied from the lossless decoding unit 132. The adaptive loop filter 138 supplies the image after the adaptive loop filter processing to the frame memory 141 and the screen rearrangement buffer 139.
[0175] In step S142, the frame memory 141 accumulates the image supplied from the adder 135 and the image supplied from the adaptive loop filter 138. Images adjacent to a CU among the images accumulated in the frame memory 141 that have not been subjected to filtering are supplied as peripheral images to the intra prediction unit 143 via the switch 142. On the other hand, the images that have been subjected to filtering and accumulated in the frame memory 141 are supplied as reference images to the inter prediction unit 51 via the switch 142.
[0176] In step S143, the screen rearrangement buffer 139 stores the images supplied from the adaptive loop filter 138 on a frame-by-frame basis, rearranges the images in coding order on a frame-by-frame basis into the original display order, and outputs the images to the D / A conversion unit 140.
[0177] In step S144, the D / A conversion unit 140 D / A converts the image after the adaptive loop filter process and outputs the converted image.
[0178] <Example of inter prediction unit configuration> FIG. 14 is a block diagram illustrating an example configuration of the inter prediction unit.
[0179] In Figure 14, the inter prediction unit 51 is composed of an inter prediction control unit 201, an L0 prediction block generation unit 202, an L1 prediction block generation unit 203, a BIO cost calculation unit 204, a BIO application determination unit 205, a Bi prediction block generation unit 206, a Bi prediction block generation unit 207 including BIO processing, a Bi prediction block selection unit 208, and a prediction block selection unit 209.
[0180] To the inter prediction control unit 201, inter prediction parameters are supplied from the motion prediction / compensation unit 47 in the case of the encoding device 1 (from the lossless decoding unit 132 in the case of the decoding device 101).
[0181] The inter prediction parameters include a PU position in a frame, a PU size, a prediction direction (one of L0, L1, and Bi is set), reference image information, motion information, and the like.
[0182] The inter prediction control unit 201 is configured with, for example, a CPU (Central Processing Unit), a microprocessor, etc. The inter prediction control unit 201 executes a predetermined program using the CPU, and controls each unit according to the contents of the inter prediction parameters.
[0183] The inter prediction control unit 201 supplies parameters of L0 prediction to the L0 predicted block generation unit 202, and controls the L0 predicted block generation unit 202. The parameters of L0 prediction include a PU position, a PU size, reference image information REFIDX_L0, and motion information MV_L0.
[0184] The inter prediction control unit 201 supplies parameters of L1 prediction to the L1 predicted block generation unit 203, and controls the L1 predicted block generation unit 203. The parameters of L1 prediction include a PU position, a PU size, reference image information REFIDX_L1, and motion information MV_L1.
[0185] The inter prediction control unit 201 supplies parameters of Bi prediction to the BIO cost calculation unit 204, the Bi prediction block generation unit 206, and the Bi prediction block generation unit 207 including BIO processing, and controls the BIO cost calculation unit 204, the Bi prediction block generation unit 206, and the Bi prediction block generation unit 207 including BIO processing. The parameters of Bi prediction include a PU size and the like.
[0186] The inter prediction control unit 201 supplies the BIO threshold value to the BIO application determining unit 205 and controls the BIO application determining unit 205 .
[0187] The inter prediction control unit 201 supplies the prediction direction to the prediction block selection unit 209 and controls the prediction block selection unit 209 .
[0188] The L0 predicted block generation unit 202 operates when the prediction direction is L0 or Bi. The L0 predicted block generation unit 202 accesses the frame memory 44 based on the L0 prediction parameters supplied from the inter prediction control unit 201, and generates an L0 predicted image from the reference image. The generated L0 predicted image is supplied from the L0 predicted block generation unit 202 to a BIO cost calculation unit 204, a BIO application determination unit 205, a Bi predicted block generation unit 206, a Bi predicted block generation unit 207 including BIO processing, and a predicted block selection unit 209.
[0189] The L1 predicted block generator 203 operates when the prediction direction is L1 or Bi. The L1 predicted block generator 203 accesses the frame memory 44 based on the L1 prediction parameters supplied from the inter prediction control unit 201, and generates an L1 predicted image from the reference image. The generated L1 predicted image is supplied from the L1 predicted block generator 203 to the BIO cost calculation unit 204, the BIO application determination unit 205, the Bi predicted block generator 206, the Bi predicted block generator 207 including BIO processing, and the predicted block selection unit 209.
[0190] The BIO cost calculation unit 204 operates when the prediction direction is Bi. The BIO cost calculation unit 204 calculates the SAD between the L0 predicted image supplied from the L0 predicted block generation unit 202 and the L1 predicted image supplied from the L1 predicted block generation unit 203, based on the Bi prediction parameters supplied from the inter prediction control unit 201. The calculated SAD is supplied from the BIO cost calculation unit 204 to the BIO application determination unit 205.
[0191] The BIO application determination unit 205 operates when the prediction direction is Bi. The BIO application determination unit 205 compares the BIO threshold supplied from the inter prediction control unit 201 with the SAD supplied from the BIO cost calculation unit 204, and determines a BIO_ON flag. When the SAD is greater than the BIO threshold, the BIO_ON flag is determined to be BIO_ON=1, which indicates BIO application, and when the SAD is smaller than the BIO threshold, the BIO_ON flag is determined to be BIO_ON=0, which indicates BIO non-application.
[0192] The determined BIO_ON flag is supplied from the BIO application determining unit 205 to the Bi predicted block generating unit 206, the Bi predicted block generating unit 207 including BIO processing, and the Bi predicted block selecting unit 208.
[0193] The Bi prediction block generation unit 206 operates when the prediction direction is Bi and BIO_ON=0, based on the BIO_ON flag supplied from the BIO application determination unit 205. The Bi prediction block generation unit 206 generates a Bi prediction image from the L0 prediction image supplied from the L0 prediction block generation unit 202 and the L1 prediction image supplied from the L1 prediction block generation unit 203, based on Bi prediction parameters supplied from the inter prediction control unit 201. The generated Bi prediction image is supplied from the Bi prediction block generation unit 206 to the Bi prediction block selection unit 208.
[0194] The Bi prediction block generation unit 207 including BIO processing operates when the prediction direction is Bi and BIO_ON=1 based on the BIO_ON flag supplied from the BIO application determination unit 205. The Bi prediction block generation unit 206 generates a Bi prediction image including BIO processing from the L0 prediction image supplied from the L0 prediction block generation unit 202 and the L1 prediction image supplied from the L1 prediction block generation unit 203 based on Bi prediction parameters supplied from the inter prediction control unit 201. The generated Bi prediction image including BIO processing is supplied from the Bi prediction block generation unit 207 including BIO processing to the Bi prediction block selection unit 208.
[0195] The Bi prediction block selection unit 208 selects a Bi prediction image based on the BIO_ON flag supplied from the BIO application determination unit 205. When BIO_ON=0, the Bi prediction block selection unit 208 selects a Bi prediction image supplied from the Bi prediction block generation unit 206, and when BIO_ON=1, the Bi prediction block selection unit 208 selects a Bi prediction image including BIO processing supplied from the Bi prediction block generation unit 207 including BIO processing. The selected Bi prediction image is supplied from the Bi prediction block selection unit 208 to the prediction block selection unit 209.
[0196] The prediction block selection unit 209 selects a prediction image according to the prediction direction supplied from the inter prediction control unit 201, and outputs the selected prediction image to the downstream prediction image selection unit 48 in Figure 9 (or switch 144 in Figure 12) as a prediction image for inter prediction.
[0197] When the prediction direction is L0, the prediction block selection unit 209 selects the L0 predicted image supplied from the L0 predicted block generation unit 202, and when the prediction direction is L1, the prediction block selection unit 209 selects the L1 predicted image supplied from the L1 predicted block generation unit 203. When the prediction direction is Bi, the prediction block selection unit 209 selects the Bi predicted image supplied from the Bi predicted block selection unit 208.
[0198] <Example of inter prediction unit operation> 15 and 16 are flowcharts illustrating Bi prediction including BIO performed by the inter prediction unit 51.
[0199] This process is a conventional Bi prediction process including BIO for comparison with the Bi prediction process including BIO of the present technology described later. This Bi prediction process including BIO is a process performed on both the encoding side and the decoding side, and is a part of the motion prediction and compensation process performed in step S34 of Fig. 10 and is a part of the inter prediction process performed in step S136 of Fig. 13.
[0200] 15, the inter prediction control unit 201 acquires inter prediction parameters supplied from the motion prediction and compensation unit 47. It is to be noted that in the case of the decoding device 101, the inter prediction parameters are supplied from the lossless decoding unit 132.
[0201] The inter prediction parameters include a PU position in a frame, a PU size, a prediction direction (one of L0, L1, and Bi is set), reference image information, motion information, and the like.
[0202] The inter prediction control unit 201 supplies L0 prediction parameters to the L0 prediction block generation unit 202. The L0 prediction parameters include a PU position, a PU size, reference image information REFIDX_L0, and motion information MV_L0. The inter prediction control unit 201 supplies L1 prediction parameters to the L1 prediction block generation unit 203. The L1 prediction parameters include a PU position, a PU size, reference image information REFIDX_L1, and motion information MV_L1.
[0203] The inter prediction control unit 201 supplies the Bi prediction parameters to the BIO cost calculation unit 204, the Bi prediction block generation unit 206, and the Bi prediction block generation unit 207 including BIO processing. The Bi prediction parameters are information indicating the PU size.
[0204] The inter prediction control unit 201 supplies the BIO threshold to the BIO application determination unit 205. The inter prediction control unit 201 supplies the prediction direction to the prediction block selection unit 209, and controls the prediction block selection unit 209.
[0205] In step S302, the L0 predicted block generation unit 202 accesses the frame memory 44 and generates an L0 predicted block from a reference image, based on the L0 prediction parameters supplied from the inter prediction control unit 201. Note that in the case of the decoding device 101, the frame memory 141 is accessed and referenced for the reference image.
[0206] In step S303, the L1 predicted block generation unit 203 accesses the frame memory 44 based on the L1 prediction parameters supplied from the inter prediction control unit 201, and generates an L1 predicted block from the reference image.
[0207] The maximum buffer size in the processes of steps S302 and S303 is the PU' size. The PU' size is a size equivalent to the size of the PU, and is one size larger than the size of the PU.
[0208] In step S304, the BIO cost calculation unit 204 calculates, in 4×4 units, the SAD between the L0 predicted image supplied from the L0 predicted block generation unit 202 and the L1 predicted image supplied from the L1 predicted block generation unit 203. By calculating and accumulating the SAD in 4×4 units, a SAD_4×4 block, which is the sum of the SADs, is obtained.
[0209] In step S305, the BIO cost calculation unit 204 calculates the SAD between the L0 predicted image supplied from the L0 predicted block generation unit 202 and the L1 predicted image supplied from the L1 predicted block generation unit 203 for each PU. The SAD is calculated for each PU and accumulated to obtain SAD_PU, which is the sum of the SADs. The obtained SAD_PU is supplied from the BIO cost calculation unit 204 to the BIO application determination unit 205.
[0210] In step S306, the BIO application determination unit 205 determines the BIO_PU_ON flag based on SAD_PU supplied from the BIO cost calculation unit 204>=BIO threshold_PU supplied from the inter prediction control unit 201. The determined BIO_PU_ON flag is supplied from the BIO application determination unit 205 to the Bi prediction block generation unit 206, the Bi prediction block generation unit 207 including BIO processing, and the Bi prediction block selection unit 208.
[0211] When the SAD is greater than the BIO threshold, the BIO_PU_ON flag is determined to be BIO_PU_ON=1, indicating that BIO is applied, and when the SAD is less than the BIO threshold, the BIO_PU_ON flag is determined to be BIO_PU_ON=0, indicating that BIO is not applied.
[0212] In step S307, the Bi prediction block generation unit 206 and the Bi prediction block generation unit 207 including the BIO processing determine whether the BIO_PU_ON flag is 1 or not.
[0213] If it is determined in step S307 that the BIO_PU_ON flag is not 1, the process proceeds to step S308.
[0214] In step S308, the Bi prediction block generation unit 206 generates a Bi prediction block PU from the L0 prediction image supplied from the L0 prediction block generation unit 202 and the L1 prediction image supplied from the L1 prediction block generation unit 203. The generated Bi prediction block PU is supplied from the Bi prediction block generation unit 206 to the Bi prediction block selection unit 208. Thereafter, the Bi prediction process including BIO is terminated.
[0215] The maximum buffer size in the process of step S308 is the PU size.
[0216] On the other hand, if it is determined in step S307 that the BIO_PU_ON flag is 1, the process proceeds to step S309.
[0217] In the subsequent steps S309 to S320, the Bi predicted block generation unit 207 including BIO processing performs processing for generating a Bi predicted image including BIO processing.
[0218] In step S309, the Bi prediction block generation unit 207 including BIO processing calculates multiple gradients from the L0 prediction image supplied from the L0 prediction block generation unit 202 and the L1 prediction image supplied from the L1 prediction block generation unit 203. The maximum buffer size in the process of step S309 is the PU' size×9.
[0219] In step S310, the Bi-prediction block generation unit 207 including BIO processing obtains the number of 4×4 blocks included in the PU.
[0220] In step S311, the Bi prediction block generation unit 207 including BIO processing sets 0 to the 4×4 block number.
[0221] In step S312 in FIG. 16, the Bi prediction block generation unit 207 including BIO processing determines whether or not the 4×4 block number is smaller than the number of 4×4 blocks.
[0222] If it is determined in step S312 that the 4×4 block number is smaller than the number of 4×4 blocks, the process proceeds to step S313.
[0223] In step S313, the Bi prediction block generation unit 207 including BIO processing obtains the position within the PU and SAD_4×4 from the 4×4 block number.
[0224] In step S314, the Bi prediction block generation unit 207 including BIO processing determines BIO_4×4_ON based on SAD_4×4>=BIO threshold_4×4.
[0225] In step S315, the Bi prediction block generation unit 207 including BIO processing determines whether the BIO_4×4_ON flag is 1 or not.
[0226] If it is determined in step S315 that the BIO_4×4_ON flag is not 1, the process proceeds to step S316.
[0227] In step S316, the Bi prediction block generation unit 207 including BIO processing generates a Bi prediction value from the L0 prediction image and the L1 prediction image of the 4×4 block number area.
[0228] If it is determined in step S315 that the BIO_4×4_ON flag is 1, the process proceeds to step S317.
[0229] In step S317, the Bi prediction block generation unit 207 including BIO processing calculates velocities from a plurality of gradients in the 4×4 block number area.
[0230] In step S318, the Bi prediction block generation unit 207 including BIO processing generates a BIO predicted value from the L0 predicted image, the L1 predicted image, the gradient, and the velocity of the 4×4 block number area.
[0231] After steps S316 and S318, the process proceeds to step S319.
[0232] In step S319, the Bi prediction block generation unit 207 including BIO processing stores the predicted value at the position of the 4×4 block number in the buffer. The maximum buffer size in the processing of step 319 is the PU size.
[0233] In step S320, the Bi prediction block generation unit 207 including BIO processing increments the 4×4 block number. After that, the process returns to step S312, and the subsequent processes are repeated.
[0234] After step S308 or if it is determined in step S312 that the 4×4 block number is not smaller than the number of 4×4 blocks, the Bi prediction including BIO is terminated.
[0235] In addition, in the Bi processing including the BIO described above, in step S305, the SAD of the L0 prediction block and the L1 prediction block are calculated for the entire PU, and in step S306, the SAD is compared with a threshold value to determine whether or not BIO processing can be applied, and in step S307, the processing is branched.
[0236] Therefore, when performing inter prediction with a PU larger than a VPDU, it becomes difficult to virtually divide the PU into multiple vPUs. As a result, the buffer required in steps S302, S303, and S309 requires a PU', which is a slightly larger area than the PU, for the gradient calculation in step S309 and the velocity calculation in step S317. The maximum size of the PU' is 130 x 130, which is the result of adding 2 to the horizontal size and vertical size of the PU.
[0237] Furthermore, a buffer of the PU size is required in step S308. These facts mean that the inter prediction unit 51 including BIO requires a large buffer resource.
[0238] Furthermore, if the inter prediction unit 51, which requires this buffer, is implemented in HW (hardware), the pipeline delay of inter prediction including BIO and the pipeline delay of TU processing are significantly different, which increases the difficulty of HW implementation in order to maintain throughput.
[0239] This affects both the encoding side and the decoding side. On the encoding side, it is possible to avoid this by self-constraints such as always decomposing CUs to 64x64 or less, but it is desirable to have a solution to ensure the freedom of the encoding side. On the decoding side, where standard compliance is required, large HW resources are essential.
[0240] Therefore, as described above, in the present technology, the processing unit for calculating the cost used to determine whether or not to perform bidirectional prediction such as BIO is divided into divided processing units equivalent to the VPDU size or divided processing units smaller than the VPDU size, and the determination is made using the cost calculated based on the divided processing units.
[0241] The VPDU size corresponds to a VPDU' size, which is an area slightly larger than the VPDU size.
[0242] <Example of inter prediction unit operation> 17 and 18 are flowcharts illustrating Bi prediction including BIO performed by the inter prediction unit 51 as an operation example of the first embodiment of the present technology.
[0243] 17 and 18, the case of the encoding device 1 will be described, but since the same processing is performed in the case of the decoding device 101, the description thereof will be omitted.
[0244] In step S401 , the inter prediction control unit 201 obtains inter prediction parameters supplied from the motion prediction / compensation unit 47 .
[0245] In step S402, the inter prediction control unit 201 acquires the number of vPUs included in the PU. That is, if the PU is larger than the VPDU, the PU is virtually divided into a plurality of vPUs. If the PU is 128×128, the number of vPUs is set to 4. If the PU is 128×64 or 64×128, the number of vPUs is set to 2. If the PU is 64×64 or less, the number of vPUs is set to 1. If the number of vPUs is 1, no virtual division is performed, and the same processing as that of FIG. 15 and FIG. 16 is performed substantially.
[0246] In step S403, the inter prediction control unit 201 sets 0 as the vPU number to be processed first.
[0247] In step S404, the inter prediction control unit 201 determines whether the vPU number is smaller than the number of vPUs.
[0248] If it is determined in step S404 that the vPU number is smaller than the vPU count, the process proceeds to step S405.
[0249] In step S405, the inter prediction control unit 201 acquires the position and size of the vPU, which indicates which area in the PU is to be processed, from the PU size and the vPU number.
[0250] FIG. 19 is a diagram showing the correspondence between PU size, vPU number, and processing position and size.
[0251] When the PU size is 128x128 and the vPU number is 0, the processing position is the upper left and the size is 64x64. When the vPU number is 1, the processing position is the upper right and the size is 64x64. When the vPU number is 2, the processing position is the lower left and the size is 64x64. When the vPU number is 3, the processing position is the lower right and the size is 64x64.
[0252] When the PU size is 128 x 64 and the vPU number is 0, the processing position is on the left and the size is 64 x 64. When the vPU number is 1, the processing position is on the right and the size is 64 x 64.
[0253] When the PU size is 64x128 and the vPU number is 0, the processing position is the top and the size is 64x64. When the vPU number is 1, the processing position is the bottom and the size is 64x64.
[0254] When the PU size is 64x64 or less and the vPU number is 0, the processing position is the PU itself.
[0255] Returning to FIG. 17, the position and size of the vPU acquired in step S405 are supplied to the L0 predicted block generation unit 202 and the L1 predicted block generation unit 203.
[0256] In step S406, the L0 predicted block generation unit 202 generates an L0 predicted block for the area of the vPU number.
[0257] In step S407, the L1 predicted block generation unit 203 generates an L1 predicted block for the area of the vPU number.
[0258] The maximum buffer size in the processing of steps S406 and S407 is, for example, the VPDU' size including a slightly larger area required for the gradient calculation of step S413 and the velocity calculation of step S421. The VPDU' size is a size slightly larger than the VPDU size, and is equivalent to the above-mentioned VPDU size, and is, for example, 66 x 66, which is the result of adding 2 to each of the horizontal and vertical sizes.
[0259] Since the BIO application decision in the later stage is made based on a SAD value of at most the VPDU size, the buffer size for storing the L0 prediction block and L1 prediction block generated here can also be based on the VPDU size.
[0260] In step S408, the BIO cost calculation unit 204 calculates, for each 4×4 unit in the vPU, the SAD between the L0 predicted image supplied from the L0 predicted block generation unit 202 and the L1 predicted image supplied from the L1 predicted block generation unit 203. By calculating and accumulating the SAD for each 4×4 unit, a SAD_4×4 block, which is the sum of the SADs, is obtained.
[0261] In the later stage, the application of BIO is judged again for the 4×4 block, which is the unit of speed calculation, and early termination is performed if no effect is expected, so this SAD_4×4 block must also be saved. However, the buffer size for saving the SAD_4×4 block can be reduced to 1 / 4 of the size in step S304 in FIG. 15.
[0262] In step S409, the BIO cost calculation unit 204 calculates, for each vPU, the SAD between the L0 predicted image supplied from the L0 predicted block generation unit 202 and the L1 predicted image supplied from the L1 predicted block generation unit 203. The SAD is calculated for each vPU and accumulated to obtain SAD_vPU, which is the sum of the SADs. The obtained SAD_vPU is supplied from the BIO cost calculation unit 204 to the BIO application determination unit 205.
[0263] In step S410, the BIO application determination unit 205 determines the BIO_vPU_ON flag based on SAD_vPU supplied from the BIO cost calculation unit 204>=BIO threshold_vPU supplied from the inter prediction control unit 201. The BIO threshold_vPU is a value obtained by scaling the BIO threshold_PU to a value according to the size of the vPU calculated in step S405.
[0264] The determined BIO_vPU_ON flag is supplied from the BIO application determining unit 205 to the Bi predicted block generating unit 206 , the Bi predicted block generating unit 207 including BIO processing, and the Bi predicted block selecting unit 208 .
[0265] In step S411, the Bi prediction block generation unit 206 and the Bi prediction block generation unit 207 including the BIO processing determine whether the BIO_vPU_ON flag is 1 or not.
[0266] If it is determined in step S411 that the BIO_vPU_ON flag is not 1, it is determined that the BIO has no effect on the entire vPU, and the process proceeds to step S412.
[0267] In step S412, the Bi prediction block generation unit 206 generates a Bi prediction block vPU from the L0 prediction image supplied from the L0 prediction block generation unit 202 and the L1 prediction image supplied from the L1 prediction block generation unit 203. The generated Bi prediction block vPU is stored in a buffer and is also supplied from the Bi prediction block generation unit 206 to the Bi prediction block selection unit 208.
[0268] When a pipeline is set up during HW implementation, TU processing is also performed in VPDU units in parallel with the inter prediction of the vPU, and the next processing can be started at this timing. Therefore, the buffer for storing the Bi prediction prepared here only needs to be the maximum VPDU size. After that, the process proceeds to step S425 in FIG. 18.
[0269] On the other hand, if it is determined in step S411 that the BIO_vPU_ON flag is 1, the process proceeds to step S413.
[0270] In step S413, the Bi prediction block generation unit 207 including BIO processing calculates a plurality of gradients from the L0 prediction block supplied from the L0 prediction block generation unit 202 and the L1 prediction block supplied from the L1 prediction block generation unit 203.
[0271] In step S413, nine types of intermediate parameters are calculated from the L0 predicted block and the L1 predicted block. The amount of change between the L0 predicted block and the L1 predicted block and the amount of change in each pixel value in the horizontal and vertical directions in each predicted block are calculated, and are collectively called gradients. Since the gradient needs to be calculated for the same number of pixels as the predicted block, the required buffer size here is the maximum VPDU' size x 9.
[0272] In step S414 of FIG. 18, the Bi prediction block generation unit 207 including the BIO process obtains the number of 4×4 blocks included in the vPU. For example, when the vPU is 64×64, the number of 4×4 blocks is 256. In the optical flow, the most accurate prediction is obtained by calculating the predicted value by obtaining the velocity in pixel units, but this requires a huge amount of calculation. In the BIO, a balance is achieved by calculating the velocity in 4×4 block units, with a trade-off between performance and cost.
[0273] In step S415, the Bi prediction block generation unit 207 including BIO processing sets 0 as the number of the 4×4 block to be processed first.
[0274] In step S416, the Bi prediction block generation unit 207 including BIO processing determines whether the 4×4 block number is smaller than the number of 4×4 blocks.
[0275] If it is determined in step S416 that the 4×4 block number is smaller than the number of 4×4 blocks, the process proceeds to step S417.
[0276] In step S417, the Bi prediction block generation unit 207 including BIO processing acquires the position in the vPU and SAD_4×4 from the 4×4 block number. The 4×4 blocks are processed in raster scan order.
[0277] In step S418, the Bi prediction block generation unit 207 including BIO processing determines BIO_4×4_ON based on SAD_4×4>=BIO threshold_4×4.
[0278] In step S419, the Bi prediction block generation unit 207 including BIO processing determines whether the BIO_4×4_ON flag is 1 or not.
[0279] If it is determined in step S419 that the BIO_4×4_ON flag is not 1, it is determined that the effect of BIO is not expected for the 4×4 block, and the process proceeds to step S420.
[0280] In step S420, the Bi prediction block generation unit 207 including BIO processing generates a Bi prediction value by calculating the average of the L0 prediction image and the L1 prediction image of the 4×4 block number area.
[0281] If it is determined in step S419 that the BIO_4×4_ON flag is 1, the process proceeds to step S421.
[0282] In step S421, the Bi-prediction block generation unit 207 including BIO processing calculates velocities from a plurality of gradients in a 4×4 block number area.
[0283] In step S422, the Bi prediction block generation unit 207 including BIO processing generates a BIO predicted value from the L0 predicted image, the L1 predicted image, the gradient, and the velocity of the 4×4 block number area.
[0284] After steps S420 and S422, the process proceeds to step S423.
[0285] In step S423, the Bi prediction block generation unit 207 including the BIO process stores the prediction value generated in step S420 or step S422 at the position of the 4×4 block number in the buffer. The maximum buffer size in the process of step 423 is the VPDU size. The buffer may be shared with the buffer used in the process of S412.
[0286] In step S424, the Bi prediction block generation unit 207 including BIO processing increments the 4×4 block number. After that, the process returns to step S416, and the subsequent processes are repeated.
[0287] After step S412, or if it is determined in step S416 that the 4×4 block number is equal to or greater than the number of 4×4 blocks, the process proceeds to step S425.
[0288] In step S425, the inter prediction control unit 201 increments the vPU number, and the process returns to step S404, and the subsequent processes are repeated.
[0289] If it is determined in step S404 that the vPU number is equal to or greater than the number of vPUs, the Bi prediction including the BIO processing is terminated.
[0290] 20 and 21 are diagrams illustrating a comparison between a conventional operation and a case where the operation according to the first embodiment of the present technology is performed.
[0291] 20, the range where SAD is calculated for the first BIO application determination in the case of CU(PU)128×128 and VPDU=64×64 is shown for the conventional operation and the operation of the first embodiment of the present technology. In the case of CU(PU)128×128, the vPU, which is the SAD calculation area for BIO_vPU_ON determination, is divided into four.
[0292] 20, the range where SAD is calculated for the first BIO application determination in the case of CU(PU)128×64 and VPDU=64×64 is shown for the conventional operation and the operation of the first embodiment of the present technology. In the case of CU(PU)128×64, vPU, which is the SAD calculation area for BIO_vPU_ON determination, is divided into two, left and right.
[0293] 21, the range where SAD is calculated for the first BIO application determination in the case of CU(PU)64×128 and VPDU=64×64 is shown for the conventional operation and the operation of the first embodiment of the present technology. In the case of CU(PU)64×128, vPU, which is the SAD calculation area for BIO_vPU_ON determination, is divided into two, upper and lower.
[0294] 21, the range where SAD is calculated for the first BIO application determination when CU(PU) is 64×64 or less and VPDU=64×64 is shown for the conventional operation and the operation of the first embodiment of the present technology. When CU(PU) is 64×64 or less, the CU(PU) is composed of one vPU, which is the SAD calculation area for BIO_vPU_ON determination, without being divided.
[0295] In conventional operations, SAD is required for the entire PU, so a wide range of L0 prediction blocks and L1 prediction blocks must be prepared and stored in advance. However, with this technology, for PUs larger than a VPDU, the application of BIO is determined for each virtually divided vPU, making it possible to reduce the buffers for L0 prediction blocks and L1 prediction blocks that are prepared and stored in advance.
[0296] Furthermore, compared with the buffers used in steps S308, S309, and S319 in FIGS. 15 and 16, the buffers used in steps S412, S413, and S423 in FIGS. 17 and 18 can also be reduced to 1 / 4.
[0297] There are tools such as FRUC (Frame Rate Up-Conversion) and DMVR (Decoder-side motion vector refinement) that generate two prediction blocks on the decoding side like BIO, make a decision based on cost calculation, and improve the coding efficiency of inter prediction. Unlike BIO's early termination purpose, FRUC and DMVR generate L0 prediction blocks and L1 prediction blocks larger than the PU size for the purpose of MV correction, and perform SAD or similar cost calculation.
[0298] If the PU is larger than the VPDU, the same measures as in this technology are required. In FRUC and DMVR, if the PU is larger than the VPDU, as in this technology, it can be handled by virtually dividing it into multiple vPUs and performing MV correction for each vPU.
[0299] The conventional operation of SAD calculation and BIO application decision for the entire PU described above, or the SAD calculation and BIO application decision for each vPU of this technology, have the main purpose of early termination in the broad framework, so further reductions can be made.
[0300] <Variation 1> In the above-mentioned first embodiment, when a PU is larger than a VPDU, the PU is virtually divided into multiple vPUs, and the SAD calculation is performed for each vPU to determine whether or not BIO is applicable. The vPUs that make up a PU are originally included in the same PU, so it is considered that a certain partial trend is similar to a different partial trend.
[0301] 22 and 23 are diagrams showing an example, as Modification 1, in which, on the premise of the above-mentioned tendency, when a PU is larger than a VPDU, the BIO determination result for a vPU number of 0 is also used for other vPUs.
[0302] The upper part of Fig. 22 shows the range where SAD is calculated initially for BIO application determination when CU(PU)128 x 128 and VPDU=64 x 64. In the case of CU(PU)128 x 128, the CU(PU) calculates SAD for the upper left vPU (vPU number = 0) of the vPUs that are the SAD calculation area for BIO_vPU_ON determination divided into four, and the result of vPU with vPU number = 0 is copied and used for the remaining vPUs (upper right, lower left, upper right).
[0303] The lower part of Fig. 22 shows the range where SAD is calculated initially for BIO application determination in the case of CU(PU)128 x 64 and VPDU=64 x 64. In the case of CU(PU)128 x 64, the CU(PU) calculates SAD for the left vPU (vPU number = 0) of the vPUs that are the SAD calculation area for BIO_vPU_ON determination, which are divided into two, and the result of the vPU with vPU number = 0 is copied and used for the remaining vPU (right).
[0304] The upper part of Fig. 23 shows the range where SAD is calculated initially for BIO application determination in the case of CU(PU)64 x 128 and VPDU=64 x 64. In the case of CU(PU)128 x 64, the CU(PU) calculates SAD for the upper vPU (vPU number = 0) of the vPUs that are the SAD calculation area for BIO_vPU_ON determination divided into two, and for the remaining vPU (lower), the result of vPU with vPU number = 0 is copied and used.
[0305] The lower part of Fig. 23 shows the range where SAD is calculated for the first BIO application decision when CU(PU) is 64 x 64 or less and VPDU = 64 x 64. When CU(PU) is 64 x 64 or less, the CU(PU) is composed of one vPU, which is the SAD calculation area for BIO_vPU_ON decision, without being divided.
[0306] <Example of inter prediction unit operation> 24 and 25 are flowcharts illustrating Bi prediction including BIO in the case of FIG.
[0307] Steps S501 to S508 and steps S510 to S526 in FIGS. 24 and 25 basically perform the same processing as steps S401 to S425 in FIGS. 17 and 18, and therefore their description will be omitted where appropriate to avoid duplication.
[0308] 25, the BIO cost calculation unit 204 calculates, for each 4×4 unit in the vPU, the SAD between the L0 predicted image supplied from the L0 predicted block generation unit 202 and the L1 predicted image supplied from the L1 predicted block generation unit 203. By calculating and accumulating the SAD for each 4×4 unit, a SAD_4×4 block, which is the sum of the SADs, is obtained.
[0309] In step S509, the BIO cost calculation unit 204 determines whether the vPU number is 0 or not.
[0310] If it is determined in step S509 that the vPU number is 0, the process proceeds to step S510.
[0311] In step S510, the BIO cost calculation unit 204 calculates, for each vPU, the SAD between the L0 predicted image supplied from the L0 predicted block generation unit 202 and the L1 predicted image supplied from the L1 predicted block generation unit 203. The SAD is calculated for each vPU and accumulated to obtain SAD_vPU, which is the sum of the SADs. The obtained SAD_vPU is supplied from the BIO cost calculation unit 204 to the BIO application determination unit 205.
[0312] In step S511, the BIO application determination unit 205 determines the BIO_vPU_ON flag based on SAD_vPU supplied from the BIO cost calculation unit 204>=BIO threshold_vPU supplied from the inter prediction control unit 201. After that, the process proceeds to step S512.
[0313] On the other hand, if it is determined that the vPU number is not 0, steps S510 and S511 are skipped, and the process proceeds to step S512.
[0314] As described above, in a PU, the SAD accumulation and BIO determination of the vPU are performed only when the vPU is located first in raster scan order, so that the processing and processing time related to early termination can be shortened.
[0315] <Variation 2> 26 and 27 are diagrams showing an example of performing BIO applicability determination using partial SAD values in each vPU as a second modification.
[0316] The upper part of Fig. 26 shows the range where SAD is calculated initially for BIO application determination when CU(PU) is 128 x 128 and VPDU = 64 x 64. In the case of CU(PU) 128 x 128, the CU(PU) is divided into two vPUs, and SAD is calculated for a partial area (32 x 32) in the upper left corner of each vPU, which is the SAD calculation area for BIO_vPU_ON determination.
[0317] The lower part of Fig. 26 shows the range where SAD is calculated initially for BIO application determination when CU(PU)128x64 and VPDU=64x64. In the case of CU(PU)128x64, SAD is calculated for a partial area (32x32) in the upper left corner of each vPU, which is the SAD calculation area for BIO_vPU_ON determination, divided into two.
[0318] 27 shows the range where SAD is calculated for the first BIO application decision when CU(PU)64×128 and VPDU=64×64. When CU(PU)128×64, the CU(PU) is divided into two vPUs, and SAD is calculated for a partial area (32×32) in the upper left corner of each vPU, which is the SAD calculation area for BIO_vPU_ON decision.
[0319] The lower part of Fig. 27 shows the range where SAD is calculated initially to determine whether BIO is applicable when CU(PU) is 64x64 or less and VPDU=64x64. When CU(PU) is 64x64 or less, vPU, which is the SAD calculation area for determining BIO_vPU_ON, is not divided for CU(PU), and SAD is calculated for a partial area (32x32) in the upper left.
[0320] As described above, in Figures 26 and 27, an example is shown in which the BIO application decision is made in the upper left 1 / 4 region of each vPU, but the compatibility with the HW pipeline is also taken into consideration for the upper left 1 / 4 region. The BIO application decision is possible when the L0 prediction block and the L1 prediction block of the upper left 1 / 4 region are ready.
[0321] By using only a portion of each vPU's area to determine whether BIO is applicable, the buffers prepared in each pipeline stage can be further reduced from the VPDU size.
[0322] Note that some areas may be of any size, and for example, it is possible to perform cost calculation (SAD) with a size of 0 x 0. In other words, 0 means that no cost calculation is performed and early termination is skipped.
[0323] Furthermore, it is also possible to dynamically change the area for calculating the SAD required for determining BIO_vPU_ON for each vPU.
[0324] <Example of inter prediction unit operation> 28 and 29 are flowcharts illustrating a process of determining a partial SAD calculation area for determining BIO_vPU_ON of each vPU.
[0325] In Fig. 28 and Fig. 29, two MVs for generating an L0 predicted block and an L1 predicted block are divided into four parts, horizontal and vertical components, and it is assumed that the one with the furthest reference position has poor accuracy as motion information, and it is determined whether or not there is an effect of correcting that area with BIO. This process is performed, for example, before step S509 in Fig. 25. In this case, in step S509, it is determined whether or not it is a set area, and the processes of steps S510 and S511 are performed only on the set area.
[0326] In step S601, the inter prediction control unit 201 obtains MVL0x and MVL0y for L0 prediction and MVL1x and MVL1y for L1 prediction.
[0327] In step S602, the inter prediction control unit 201 selects the MV with the maximum absolute value from the four MVs and assigns it to MV_MAX.
[0328] In step S603, the inter prediction control unit 201 determines whether |MV_MAX| < MV_threshold.
[0329] In step S603, if it is determined that |MV_MAX| < MV_threshold, the process proceeds to step S604.
[0330] In step S604, the inter prediction control unit 201 sets the central part of the vPU as the SAD calculation area.
[0331] In step S605, the inter prediction control unit 201 determines whether PU size < vPU size.
[0332] In step S605, if it is determined that PU size < vPU size, the process proceeds to step S606.
[0333] In step S606, the inter prediction control unit 201 sets the horizontal size = horizontal PU size / 2 and the vertical size = vertical PU size / 2.
[0334] In step S605, if it is determined that PU size < vPU size is not true, the process proceeds to step S607.
[0335] In step S607, the inter prediction control unit 201 sets the horizontal size = horizontal vPU size / 2 and the vertical size = vertical vPU size / 2.
[0336] On the other hand, in step S603, if it is determined that |MV_MAX| < MV_threshold is not true, the process proceeds to step S608.
[0337] In step S608, the inter prediction control unit 201 determines whether MV_MAX == MVL0x || MV_MAX == MVL1x.
[0338] In step S608, if it is determined that MV_MAX == MVL0x or MV_MAX == MVL1x, the process proceeds to step S609.
[0339] In step S609, the inter prediction control unit 201 determines whether MV_MAX is less than 0.
[0340] In step S609, if it is determined that MV_MAX is less than 0, the process proceeds to step S610.
[0341] In step S610, the inter prediction control unit 201 sets the left side of the vPU as the SAD calculation area.
[0342] In step S609, if it is determined that MV_MAX is 0 or greater, the process proceeds to step S611.
[0343] In step S611, the inter prediction control unit 201 sets the right side of the vPU as the SAD calculation area.
[0344] After step S610 or S611, the process proceeds to step S612.
[0345] In step S612, the inter prediction control unit 201 determines whether the PU size < vPU size.
[0346] In step S612, if it is determined that the PU size < vPU size, the process proceeds to step S613.
[0347] In step S613, the inter prediction control unit 201 sets the horizontal size = horizontal PU size / 4 and the vertical size = vertical PU size.
[0348] In step S612, if it is determined that the PU size < vPU size is not true, the process proceeds to step S614.
[0349] In step S614, the inter prediction control unit 201 sets the horizontal size = horizontal vPU size / 4 and the vertical size = vertical vPU size.
[0350] Also, in step S608, if it is determined that MV_MAX!= MVL0x || MV_MAX!= MVL1x, the process proceeds to step S615.
[0351] In step S615, the inter prediction control unit 201 determines whether MV_MAX < 0.
[0352] In step S615, if it is determined that MV_MAX < 0, the process proceeds to step S616.
[0353] In step S616, the inter prediction control unit 201 sets the upper side of the vPU as the SAD calculation area.
[0354] In step S615, if it is determined that MV_MAX >= 0, the process proceeds to step S617.
[0355] In step S617, the inter prediction control unit 201 sets the lower side of the vPU as the SAD calculation area.
[0356] After step S616 or S617, the process proceeds to step S618.
[0357] In step S618, the inter prediction control unit 201 determines whether the PU size < vPU size.
[0358] In step S618, if it is determined that the PU size < vPU size, the process proceeds to step S619.
[0359] In step S619, the inter prediction control unit 201 sets the horizontal size = horizontal PU size and the vertical size = vertical PU size / 4.
[0360] In step S618, if it is determined that the PU size < vPU size, the process proceeds to step S620.
[0361] In step S620, the inter prediction control unit 201 sets the horizontal size = horizontal vPU size and the vertical size = vertical vPU size / 4.
[0362] After steps S606, S607, S613, S614, S619, and S620, the process proceeds to step S621 in FIG. 29.
[0363] In step S621, the inter prediction control unit 201 determines whether the horizontal size < 4.
[0364] In step S621, if it is determined that the horizontal size < 4, the process proceeds to step S622.
[0365] In step S622, the inter prediction control unit 201 sets the horizontal size = 4, and the process proceeds to step S623.
[0366] In step S621, if it is determined that the horizontal size < 4 is not true, step S622 is skipped and the process proceeds to step S623.
[0367] In step S623, the inter prediction control unit 201 determines whether the vertical size < 4.
[0368] In step S623, if it is determined that the vertical size < 4, the process proceeds to step S624.
[0369] In step S624, the inter prediction control unit 201 sets the vertical size = 4, and the determination process for the partial SAD calculation area for the BIO_vPU_ON determination ends.
[0370] If it is determined in step S623 that the vertical size is not smaller than 4, step S624 is skipped and the process of determining the partial SAD calculation area for determining BIO_vPU_ON is terminated.
[0371] The above-mentioned process of partially calculating SAD and then judging whether BIO should be applied can also be applied to FRUC and DMVR. However, unlike the early termination purpose of BIO, in FRUC and DMVR, SAD or similar cost calculation and the subsequent judgment are directly reflected in the inter prediction accuracy. Therefore, since there is a risk of a large penalty if the cost calculation is omitted, the process of partially calculating SAD and then judging whether BIO should be applied can be said to be unique to BIO.
[0372] <2. Second embodiment (example of sharing of actions by flags)> In the second embodiment, similarly to the first embodiment, when a PU is larger than a VPDU, the PU is virtually divided into vPUs, and processing is performed on a vPU basis.
[0373] The difference from the first embodiment is that in the second embodiment, the bit stream transmitted and received between the encoding device 1 and the decoding device 101 includes one bit of the BIO_PU_ON flag, allowing the encoding device 1 and the decoding device 101 to share operations.
[0374] <Example of inter prediction unit operation> 30 and 31 are flowcharts illustrating Bi prediction including BIO performed by the inter prediction unit 51 as an operation example of the second embodiment of the present technology.
[0375] Steps S701 to S708 and steps S715 to S728 in Figures 30 and 31 basically perform the same processing as steps S401 to S408 and steps S412 to S425 in Figures 17 and 18, so their explanation will be omitted as appropriate to avoid duplication.
[0376] 30, the BIO cost calculation unit 204 calculates, for each 4×4 unit in the vPU, the SAD between the L0 predicted image supplied from the L0 predicted block generation unit 202 and the L1 predicted image supplied from the L1 predicted block generation unit 203. By calculating and accumulating the SAD for each 4×4 unit, a SAD_4×4 block, which is the sum of the SADs, is obtained.
[0377] In step S709, the inter prediction control unit 201 determines whether the number of vPUs is one.
[0378] In step S709, if it is determined that the vPU number is 1, the process proceeds to step S710. In steps S710 and S711, the same process as in the PU unit is performed.
[0379] In step S710, the BIO cost calculation unit 204 calculates the SAD between the L0 predicted image supplied from the L0 predicted block generation unit 202 and the L1 predicted image supplied from the L1 predicted block generation unit 203 for each vPU. The SAD is calculated for each vPU and accumulated to obtain SAD_PU, which is the sum of the SADs. The obtained SAD_PU is supplied from the BIO cost calculation unit 204 to the BIO application determination unit 205.
[0380] In step S711, the BIO application determination unit 205 determines the BIO_PU_ON flag based on SAD_PU supplied from the BIO cost calculation unit 204>=BIO threshold_PU supplied from the inter prediction control unit 201. After that, the process proceeds to step S714.
[0381] If it is determined in step S709 that the vPU number is not 1, the process proceeds to step S712.
[0382] In step S712, the inter prediction control unit 201 determines whether the vPU number is 0 or not.
[0383] If it is determined in step S709 that the vPU number is 0, the process proceeds to step S713.
[0384] In step S713, the inter prediction control unit 201 sets BIO_PU_ON. In the case of the encoding device 1, BIO_PU_ON determined from a motion estimation (ME) result or the like is set. In the case of the decoding device 101, BIO_PU_ON acquired from the stream is set.
[0385] If it is determined in step S712 that the vPU number is 0, ie, YES, step S713 is skipped and the process proceeds to step S714 in FIG.
[0386] In step S714, it is determined whether the BIO_PU_ON flag is 1 or not.
[0387] If it is determined in step S714 that the BIO_PU_ON flag is not 1, it is determined that the BIO has no effect on the entire PU, and the process proceeds to step S715.
[0388] In step S715, the Bi prediction block generation unit 206 generates a Bi prediction block vPU from the L0 prediction image supplied from the L0 prediction block generation unit 202 and the L1 prediction image supplied from the L1 prediction block generation unit 203. The generated Bi prediction block vPU is stored in a buffer and is also supplied from the Bi prediction block generation unit 206 to the Bi prediction block selection unit 208.
[0389] On the other hand, if it is determined in step S714 that the BIO_PU_ON flag is 1, the process proceeds to step S716.
[0390] In step S716, the Bi prediction block generation unit 207 including the BIO processing calculates a plurality of gradients from the L0 prediction block supplied from the L0 prediction block generation unit 202 and the L1 prediction block supplied from the L1 prediction block generation unit 203.
[0391] As described above, by including the BIO_PU_ON flag in the bitstream, it becomes possible for the encoding device 1 and the decoding device 101 to share the same operation.
[0392] Since including a flag in the bitstream may cause a deterioration in coding efficiency, the BIO_PU_ON flag is not included in all layers, but is limited to the case where a PU with a relatively small value of 1 bit is larger than a VPDU. In the case where the PU is not larger than the VPDU, as shown in steps S709 to S713 of Fig. 30, the SAD value is calculated in the PU to determine whether or not to apply BIO, as in the first embodiment.
[0393] When the BIO_PU_ON flag is included in the bitstream, the encoding device 1 may freely set it to 0 or 1. If the encoding device 1 has sufficiently high performance, it may perform motion compensation with the BIO_PU_ON flag set to both 0 and 1, and determine which one provides better results. Alternatively, it may be determined that the BIO_PU_ON flag is set to 0 for 128x128 depending on the PU size, and 1 for other sizes.
[0394] Meanwhile, in decoding device 101, since the BIO_PU_ON flag is decoded in the PU layer of a CU in Bi prediction mode in which the PU is larger than the VPDU, when the vPU number is 0, the BIO_PU_ON flag is acquired in step S713 and processing proceeds. Since the BIO_PU_ON flag has already been set for vPUs whose vPU numbers are 1 or greater, processing skips step S713 and proceeds from step S712 to step S714.
[0395] Although it is not impossible to apply a technique similar to that of the second embodiment described above to FRUC or DMVR, it is almost meaningless because having data for MV correction in the bit stream is equivalent to encoding differential MV (MVD).
[0396] <3. Third embodiment (example of division by sPU)> In the third embodiment, the virtual division size is different from that in the first embodiment. When a PU is larger than a VPDU, the PU is virtually divided into sPUs, and processing is performed in units of sPUs.
[0397] In other words, since the processing unit for calculating the SAD and determining whether or not the BIO can be applied is required to be equal to or smaller than the VPDU size that spans a VPDU boundary, in the third embodiment, a PU is virtually divided into multiple sPUs using separately given information, and a determination of whether or not the BIO can be applied is made for each sPU.
[0398] As a method of providing information, a variable such as BIO_MAX_SAD_BLOCK_SIZE is added to the bitstream and included therein, so that the information is shared between the encoding device 1 and the decoding device 101 .
[0399] FIG. 32 is a diagram showing the correspondence between BIO_MAX_SAD_BLOCK_SIZE and sPU.
[0400] When BIO_MAX_SAD_BLOCK_SIZE is 1, the sPU size is set to 8 x 8. When BIO_MAX_SAD_BLOCK_SIZE is 2, the sPU size is set to 16 x 16. When BIO_MAX_SAD_BLOCK_SIZE is 3, the sPU size is set to 32 x 32. When BIO_MAX_SAD_BLOCK_SIZE is 4, the sPU size is set to 64 x 64.
[0401] The value of BIO_MAX_SAD_BLOCK_SIZE may be set to any value depending on the performance of each individual encoding device 1, or may be determined as a Profile / Level constraint as a standard. Depending on the picture size to be handled, the Level constraint is 0 for SD or less, 1 for HD, 2 for 4K, and 3 for 8K.
[0402] <Example of inter prediction unit operation> 33 and 34 are flowcharts illustrating Bi prediction including BIO performed by the inter prediction unit 51 as an operation example of the third embodiment of the present technology.
[0403] Note that steps S801 to S825 in Figures 33 and 34 are basically the same as steps S401 to S425 in Figures 17 and 18, except that the vPU is replaced with an sPU of a different size, and therefore the explanation thereof will be omitted as appropriate to avoid repetition.
[0404] 35 and 36 are diagrams showing examples of areas for calculating the SAD of each PU when BIO_MAX_SAD_BLOCK_SIZE is set to 2. In FIG.
[0405] The upper part of Fig. 35 shows an area for calculating the SAD of each sPU when CU (PU) is 128 x 128, VPDU = 64 x 64, and BIO_MAX_SAD_BLOCK_SIZE is 2 (sPU = 32 x 32). In the upper part of Fig. 35, the sPU does not straddle the VPDU boundary, and the PU is divided into 16 parts.
[0406] The lower part of Fig. 35 shows an area for calculating the SAD of each sPU when CU (PU) is 128 x 64, VPDU = 64 x 64, and BIO_MAX_SAD_BLOCK_SIZE is 2 (sPU = 32 x 32). In the case of the lower part of Fig. 35, the sPU does not straddle the VPDU boundary, and the PU is divided into 8 parts.
[0407] The upper part of Fig. 36 shows the area for calculating the SAD of each sPU when CU (PU) is 64 x 128, VPDU = 64 x 64, and BIO_MAX_SAD_BLOCK_SIZE is 2 (sPU = 32 x 32). In the upper part of Fig. 36, the sPU does not straddle the VPDU boundary, and the PU is divided into 8 parts.
[0408] The lower part of Fig. 36 shows the area for calculating the SAD of each sPU when CU (PU) is 64 x 64 or less, VPDU = 64 x 64, and BIO_MAX_SAD_BLOCK_SIZE is 2 (sPU = 32 x 32). In the upper part of Fig. 36, the sPU does not straddle the VPDU boundary, and the PU is divided into four.
[0409] As described above, in the third embodiment of the present technology, the given information separately and virtually divides the PU into a plurality of sPUs, and the application determination of the BIO is performed for each sPU. As a result, the buffer size can be made even smaller than that in the case of the vPU.
[0410] <4. Fourth Embodiment (Example of Prohibiting Use of BIO)> In the fourth embodiment, when the PU is larger than the VPDU, the use of the BIO is restricted so as not to be used. As a result, the buffer size can be reduced.
[0411] <Operation Example of Inter-Prediction Unit> FIGS. 37 and 38 are flowcharts for explaining Bi prediction including BIO performed by the inter-prediction unit 51 as an operation example of the fourth embodiment of the present technology.
[0412] Steps S901 to S907 and S926 in FIGS. 37 and 38 perform basically the same processing as steps S401 to S407 and S425 in FIGS. 17 and 18, so the description thereof will be repeated and will be omitted as appropriate. Further, steps S909 to S925 in FIGS. 37 and 38 perform basically the same processing as steps S304 to S320 in FIGS. 15 and 16, so the description thereof will be repeated and will be omitted as appropriate.
[0413] In step S907, the L1 prediction block generation unit 203 generates an L1 prediction block in the area of the vPU number.
[0414] In step S908, the inter-prediction control unit 201 determines whether 1 < the number of vPUs.
[0415] In step S908, if it is determined that 1 < the number of vPUs is not satisfied, the process proceeds to step S909. When the number of vPUs is 1, that is, vPU = PU, in steps S909 and subsequent steps, the same processing as the processing in steps S309 and subsequent steps in FIG. 15 is performed.
[0416] In step S908, if it is determined that 1 < the number of vPUs, the process proceeds to step S913 in FIG. 38.
[0417] Also, in step S912, if it is determined that the BIO_vPU_ON flag is not 1, assuming that there is no effect of BIO on all vPUs, the process proceeds to step S913.
[0418] In step S913, the Bi prediction block generation unit 206 generates a Bi prediction block vPU from the L0 prediction image supplied from the L0 prediction block generation unit 202 and the L1 prediction image supplied from the L1 prediction block generation unit 203. The generated Bi prediction block vPU is saved in the buffer and supplied from the Bi prediction block generation unit 206 to the Bi prediction block selection unit 208.
[0419] As described above, in FIGS. 37 and 38, step S908 is added as a conditional branch step for determining whether there are a plurality of vPUs, that is, whether the PU is larger than the VPDU, in steps S907 to S913.
[0420] When the PU is larger than the VPDU, since it branches to the normal Bi prediction from step S908 to step S913, BIO is not used, so it is not necessary to calculate the SAD value for the entire PU, and similar to FIG. 4, it is possible to perform processing by dividing the PU into virtual vPUs.
[0421] Steps S909 to S925 after branching from step S908 to step S909 are the same processing as the conventional Bi prediction including BIO (S304 to S320 in FIGS. 15 and 16). However, since the branching to step S909 is when the PU is less than or equal to the VPDU, when calculating the SAD for the entire PU, if there are resources less than or equal to the VPDU, it is sufficient.
[0422] <5. Fifth Embodiment (Example of Application of Always-ON BIO)> In the fifth embodiment, when PU is larger than VPDU, the buffer size is reduced by always applying BIO.
[0423] <Operation example of the inter prediction unit> FIGS. 39 and 40 are flowcharts for explaining Bi prediction including BIO performed by the inter prediction unit 51 as an operation example of the fifth embodiment of the present technology.
[0424] Steps S1001 to S1008, and S1026 in FIGS. 39 and 40 perform basically the same processing as steps S401 to S408, and S425 in FIGS. 17 and 18, so the description thereof will be repeated and thus will be omitted as appropriate. Also, steps S1014 to S1025 in FIGS. 39 and 40 perform basically the same processing as steps S309 to S320 in FIGS. 15 and 16, so the description thereof will be repeated and thus will be omitted as appropriate.
[0425] In step S1008, the BIO cost calculation unit 204 calculates the SAD between the L0 prediction image supplied from the L0 prediction block generation unit 202 and the L1 prediction image supplied from the L1 prediction block generation unit 203 in 4×4 units within the vPU. By calculating and accumulating the SAD in 4×4 units, the SAD_4×4 block, which is the total sum of the SAD, is obtained.
[0426] In step S1009, the inter prediction control unit 201 determines whether 1 < the number of vPUs.
[0427] In step S1009, if it is determined that 1 < the number of vPUs is not satisfied, the process proceeds to step S1010.
[0428] In step S1010, the BIO cost calculation unit 204 calculates the SAD between the L0 predicted image supplied from the L0 prediction block generation unit 202 and the L1 predicted image supplied from the L1 prediction block generation unit 203 for each PU unit. By calculating and accumulating the SAD for each PU unit, the total SAD, SAD_PU, is obtained. The obtained SAD_PU is supplied from the BIO cost calculation unit 204 to the BIO application determination unit 205.
[0429] In step S1011, the BIO application determination unit 205 determines the BIO_PU_ON flag based on SAD_PU supplied from the BIO cost calculation unit 204 >= BIO threshold_PU supplied from the inter prediction control unit 201.
[0430] In step S1012, it is determined whether the BIO_PU_ON flag is 1.
[0431] In step S1012, if it is determined that the BIO_PU_ON flag is not 1, it is considered that there is no effect of BIO on the entire vPU, and the process proceeds to step S1013 in FIG. 40.
[0432] In step S1013, the Bi prediction block generation unit 206 generates a Bi prediction block vPU from the L0 predicted image supplied from the L0 prediction block generation unit 202 and the L1 predicted image supplied from the L1 prediction block generation unit 203. The generated Bi prediction block vPU is stored in the buffer and supplied from the Bi prediction block generation unit 206 to the Bi prediction block selection unit 208.
[0433] In step S1012, if it is determined that the BIO_PU_ON flag is 1, the process proceeds to step S1014 in FIG. 40.
[0434] Also, in step S1009, if it is determined that the number of vPUs > 1, the process proceeds to step S1014.
[0435] From step S1014 onwards, the same BIO processing as in steps S309 to S320 in FIG. 15 is carried out.
[0436] As described above, in FIG. 39 and FIG. 40, a conditional branch is added in step S1009 to determine whether or not there are multiple vPUs, that is, whether or not the PU is larger than the VPDU.
[0437] If the PU is larger than the VPDU, the SAD calculations from S1010 to S1012 to the threshold determination are bypassed, and the process of applying the BIO from step S1014 onwards is entered. This eliminates the need to calculate the SAD for the entire PU, and makes it possible to divide the PU into virtual vPUs for processing, as in Figure 4.
[0438] Steps S1010 to S1012 are entered when the PU is equal to or smaller than a VPDU, and therefore resources equal to or smaller than a VPDU are sufficient to perform SAD calculation for the entire PU.
[0439] The fifth embodiment cannot be applied to FRUC or DMVR. Since the BIO SAD calculation is for the purpose of early termination, it is possible to avoid cost calculation by other criteria such as PU size as in the fifth embodiment. This is because the cost calculation of FRUC and DMVR is the core process of MV correction and is difficult to avoid.
[0440] As described above, according to the present technology, the processing unit for calculating the cost used to determine whether or not to perform bidirectional prediction such as BIO is divided into divided processing units equivalent to the VPDU size (e.g., vPU) or divided processing units equal to or smaller than the VPDU size (e.g., sPU), and the determination is made using the cost calculated based on the divided processing units. This makes it possible to reduce the buffer size.
[0441] Since BIO can be implemented in VVC, the size of the various required buffers can be reduced to 1 / 4 of the conventional buffer size.
[0442] It also becomes possible to optimize the HW configuration, making it possible to implement BIO while significantly reducing some of the buffers to less than one-quarter of the previous size.
[0443] <6. Sixth embodiment (computer)> <Computer configuration example> The above-mentioned series of processes can be executed by hardware or software. When the series of processes is executed by software, the program constituting the software is installed from a program recording medium into a computer incorporated in dedicated hardware, or into a general-purpose personal computer, etc.
[0444] FIG. 41 is a block diagram showing an example of the hardware configuration of a computer that executes the above-mentioned series of processes by a program.
[0445] A central processing unit (CPU) 301, a read only memory (ROM) 302, and a random access memory (RAM) 303 are interconnected via a bus 304.
[0446] An input / output interface 305 is further connected to the bus 304. An input unit 306 including a keyboard, a mouse, etc., and an output unit 307 including a display, a speaker, etc. are connected to the input / output interface 305. In addition, a storage unit 308 including a hard disk, a non-volatile memory, etc., a communication unit 309 including a network interface, etc., and a drive 310 that drives a removable medium 311 are connected to the input / output interface 305.
[0447] In the computer configured as above, the CPU 301 loads a program stored in the storage unit 308 into the RAM 303 via the input / output interface 305 and the bus 304 and executes the program, thereby performing the above-mentioned series of processes.
[0448] The programs executed by the CPU 301 are installed in the storage unit 308 by being recorded on a removable medium 311, or provided via a wired or wireless transmission medium such as a local area network, the Internet, or digital broadcasting.
[0449] In addition, the program executed by the computer may be a program in which processing is performed chronologically in the order described in this specification, or it may be a program in which processing is performed in parallel or at the required timing, such as when called.
[0450] In this specification, a system refers to a collection of multiple components (devices, modules (parts), etc.), regardless of whether all the components are in the same housing. Therefore, multiple devices housed in separate housings and connected via a network, and a single device in which multiple modules are housed in a single housing, are both systems.
[0451] It should be noted that the effects described in this specification are merely examples and are not limiting, and other effects may also be obtained.
[0452] The embodiments of the present technology are not limited to the above-described embodiments, and various modifications are possible without departing from the gist of the present technology.
[0453] For example, the present technology can be configured as cloud computing, in which a single function is shared and processed collaboratively by multiple devices via a network.
[0454] Furthermore, each step described in the above flow chart can be executed by one device, or can be shared and executed by a plurality of devices.
[0455] Furthermore, when a single step includes multiple processes, the multiple processes included in the single step can be executed by a single device, or can be shared and executed by multiple devices.
[0456] <Examples of configuration combinations> The present technology can also be configured as follows. <1> A control unit that virtually divides a coding unit (CU) used in inter prediction processing into any of 8 x 8, 16 x 16, 32 x 32, or 64 x 64 as a processing unit for cost calculation used to determine whether or not to perform bidirectional prediction (BIO) that references one frame each before and after in time by an optical flow method; a BIO application determination unit that determines whether or not to apply the BIO based on a comparison between a Sum of Absolute Difference (SAD) of the predicted block of the CU and a BIO threshold according to the size of the processing unit; An image encoding device comprising: <2> The BIO application determination unit changes a BIO application flag indicating whether or not the BIO is applied to a non-application state when the SAD is smaller than the BIO threshold. <1> The image encoding device according to claim 1 . <3> An image encoding method for an image encoding device including a control unit and a BIO application determination unit, The control unit virtually divides a coding unit (CU) used in inter prediction processing into any of 8 × 8, 16 × 16, 32 × 32, or 64 × 64 as a processing unit for cost calculation used to determine whether to perform bidirectional prediction (BIO) that refers to one frame each before and after in time by an optical flow method, The BIO application determination unit determines whether to apply the BIO based on a comparison between a sum of absolute differences (SAD) of the predicted block of the CU and a BIO threshold according to the size of the processing unit. Image encoding method. <4> The BIO application determination unit changes a BIO application flag indicating whether or not the BIO is applied to a non-application state when the SAD is smaller than the BIO threshold. <3> 2. The image encoding method according to claim 1 . [Explanation of symbols]
[0457] 1 encoding device, 36 lossless encoding unit, 47 motion prediction and compensation unit, 51 inter prediction unit, 101 decoding device, 132 lossless decoding unit, 201 inter prediction control unit, 202 L0 prediction block generation unit, 203 L1 prediction block generation unit, 204 BIO cost calculation unit, 205 BIO application decision unit, 206 Bi prediction block generation unit, 207 Bi prediction block generation unit including BIO processing, 208 Bi prediction block selection unit, 209 prediction block selection unit
Claims
1. a control unit that virtually divides a coding unit (CU) used in inter prediction processing into any of 8×8, 16×16, 32×32, or 64×64 as a processing unit for cost calculation used in determining whether or not to perform bidirectional prediction (BIO) that refers to one frame each before and after in time by an optical flow method; a BIO application determination unit that determines whether or not to apply the BIO based on a comparison between a Sum of Absolute Difference (SAD) of the predicted block of the CU and a BIO threshold according to the size of the processing unit; An image encoding device comprising:
2. The BIO application determination unit changes a BIO application flag indicating whether or not the BIO is applied to a non-application state when the SAD is smaller than the BIO threshold. The image encoding device according to claim 1 .
3. An image encoding method for an image encoding device including a control unit and a BIO application determination unit, The control unit virtually divides a coding unit (CU) used in inter prediction processing into any of 8 × 8, 16 × 16, 32 × 32, or 64 × 64 as a processing unit for cost calculation used to determine whether to perform bidirectional prediction (BIO) that refers to one frame each before and after in time by an optical flow method, The BIO application determination unit determines whether to apply the BIO based on a comparison between a Sum of Absolute Difference (SAD) of the predicted block of the CU and a BIO threshold according to the size of the processing unit. Image encoding method.
4. The BIO application determination unit changes a BIO application flag indicating whether or not the BIO is applied to a non-application state when the SAD is smaller than the BIO threshold. The image coding method according to claim 3.
Citation Information
Patent Citations
Image processing device, image coding method and image processing method
WO2012046435A1
Predicted-image generation device, video decoding device, and video coding device
WO2018173895A1
