Video decoding device, video encoding device, video decoding method, and video encoding method
By introducing the BDOF part in the video decoding device, using the difference calculation between the predicted image and the gradient image, the problem of undecreasing processing volume in the BDOF technology is solved, and a more efficient processing method is achieved.
Patent Information
- Application Number
- JP2023187980
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2023-11-01
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2039-06-07
AI Technical Summary
In BDOF technology, the process of calculating the absolute difference sum fails to effectively reduce the processing volume in the worst case, resulting in poor processing efficiency.
By introducing a BDOF part in the video decoding device, the image is respectively calculated by using the first and second predicted images and its horizontal and vertical gradient images, and processed by sub-block units to generate the third predicted image.
Through this method, the processing amount can be effectively reduced at the sub-block unit level, avoid the worst-case calculation burden, and improve the processing efficiency.
Smart Images

Figure 0007654751000001 
Figure 0007654751000002 
Figure 0007654751000003
Abstract
Description
[Technical field]
[0001] FIELD An embodiment of the present invention relates to a video decoding device, a video encoding device, a video decoding method, and a video encoding method. [Background technology]
[0002] In order to efficiently transmit or record moving images, a moving image encoding device is used that generates encoded data by encoding moving images, and a moving image decoding device is used that generates a decoded image by decoding the encoded data.
[0003] Specific examples of video encoding methods include H.264 / AVC and High-Efficiency Video Coding (HEVC).
[0004] In such a video coding method, images (pictures) constituting a video are managed in a hierarchical structure consisting of slices obtained by dividing images, coding tree units (CTUs) obtained by dividing slices, coding units (sometimes called coding units: CUs) obtained by dividing coding tree units, and transform units (TUs) obtained by dividing coding units, and are coded / decoded for each CU.
[0005] In such a video coding method, a predicted image is usually generated based on a locally decoded image obtained by encoding / decoding an input image, and a prediction error (sometimes called a "difference image" or "residual image") obtained by subtracting the predicted image from the input image (original image) is coded. Methods for generating a predicted image include inter-prediction and intra-prediction.
[0006] In addition, non-patent literature includes recent video encoding and decoding technologies, and in particular, BDOF technology is disclosed that improves image quality by using gradient images when deriving a predicted image from bi-predictive motion compensation (interpolated image). [Prior art documents] [Non-patent literature]
[0007] [Non-Patent Document 1] "Versatile Video Coding (Draft 5)", JVET-N1001, Joint Video Exploration Team (JVET) of ITU-T SG 16 WP 3 and ISO / IEC JTC 1 / SC 29 / WG 11, 2019 Summary of the Invention [Problem to be solved by the invention]
[0008] In Non-Patent Document 1, in the BDOF technology, it was necessary to calculate the sum of absolute differences between two interpolated images in order to determine whether or not to perform processing for each processing unit. Since the processing can be stopped midway, the amount of processing can be reduced on average, but there was a problem that the amount of processing could not be reduced in the worst case because there was an additional amount of processing for the sum of absolute differences. [Means for solving the problem]
[0009] A video decoding device according to one aspect of the present invention is a video decoding device that generates a third predicted image by BDOF prediction using a first predicted image, a second predicted image, and a motion compensation correction value, and includes a BDOF unit that derives a sum of absolute differences between the first predicted image and the second predicted image on a sub-block basis, and the third predicted image is derived by right-shifting an added value of (i) the first predicted image, (ii) the second predicted image, (iii) the motion compensation correction value, and (iv) a first offset value by a first shift value, and the motion compensation correction value is derived by right-shifting an added value of a horizontal gradient image of the first predicted image, a vertical gradient image of the first predicted image, and a motion compensation correction value on a sub-block basis. a horizontal gradient image of the first predicted image and a vertical gradient image of the second predicted image, the horizontal gradient image of the first predicted image being derived by taking a difference between values obtained by right shifting the first predicted image by a second shift value, the vertical gradient image of the first predicted image being derived by taking a difference between values obtained by right shifting the first predicted image by the second shift value, the horizontal gradient image of the second predicted image being derived by taking a difference between values obtained by right shifting the second predicted image by the second shift value, and the vertical gradient image of the second predicted image being derived by taking a difference between values obtained by right shifting the second predicted image by the second shift value.
[0010] A video encoding device according to one aspect of the present invention is a video encoding device that generates a third predicted image by BDOF prediction using a first predicted image, a second predicted image, and a motion compensation correction value, and includes a BDOF unit that derives a sum of absolute differences between the first predicted image and the second predicted image on a sub-block basis, and the third predicted image is derived by right-shifting an added value of (i) the first predicted image, (ii) the second predicted image, (iii) the motion compensation correction value, and (iv) a first offset value by a first shift value, and the motion compensation correction value is derived by right-shifting an added value of a horizontal gradient image of the first predicted image, a vertical gradient image of the first predicted image, and a second offset value. The gradient image of the first predicted image is derived using a horizontal gradient image of a predicted image and a vertical gradient image of the second predicted image, where the horizontal gradient image of the first predicted image is derived by taking a difference between values obtained by right shifting the first predicted image by a second shift value, the vertical gradient image of the first predicted image is derived by taking a difference between values obtained by right shifting the first predicted image by the second shift value, the horizontal gradient image of the second predicted image is derived by taking a difference between values obtained by right shifting the second predicted image by the second shift value, and the vertical gradient image of the second predicted image is derived by taking a difference between values obtained by right shifting the second predicted image by the second shift value.
[0011] A video decoding method according to one aspect of the present invention is a video decoding method for generating a third predicted image by BDOF prediction using a first predicted image, a second predicted image, and a motion compensation correction value, the method including at least a step of deriving a sum of absolute differences between the first predicted image and the second predicted image in units of subblocks, the third predicted image being derived by right-shifting an added value of (i) the first predicted image, (ii) the second predicted image, (iii) the motion compensation correction value, and (iv) a first offset value by a first shift value, and the motion compensation correction value being derived by right-shifting an added value of a horizontal gradient image of the first predicted image, a vertical gradient image of the first predicted image, and a second offset value by a first shift value. a horizontal gradient image of the first predicted image and a vertical gradient image of the second predicted image, the horizontal gradient image of the first predicted image being derived by taking a difference between values obtained by right shifting the first predicted image by a second shift value, the vertical gradient image of the first predicted image being derived by taking a difference between values obtained by right shifting the first predicted image by the second shift value, the horizontal gradient image of the second predicted image being derived by taking a difference between values obtained by right shifting the second predicted image by the second shift value, and the vertical gradient image of the second predicted image being derived by taking a difference between values obtained by right shifting the second predicted image by the second shift value.
[0012] A video coding method according to one aspect of the present invention is a video coding method for generating a third predicted image by BDOF prediction using a first predicted image, a second predicted image, and a motion compensation correction value, the video coding method including at least a step of deriving a sum of absolute differences between the first predicted image and the second predicted image in units of sub-blocks, the third predicted image being derived by right-shifting an added value of (i) the first predicted image, (ii) the second predicted image, (iii) the motion compensation correction value, and (iv) a first offset value by a first shift value, and the motion compensation correction value is derived by right-shifting an added value of a horizontal gradient image of the first predicted image, a vertical gradient image of the first predicted image, and a first offset value by a first shift value. a horizontal gradient image of the first predicted image and a vertical gradient image of the second predicted image, the horizontal gradient image of the first predicted image being derived by taking a difference between values obtained by right shifting the first predicted image by a second shift value, the vertical gradient image of the first predicted image being derived by taking a difference between values obtained by right shifting the first predicted image by the second shift value, the horizontal gradient image of the second predicted image being derived by taking a difference between values obtained by right shifting the second predicted image by the second shift value, and the vertical gradient image of the second predicted image being derived by taking a difference between values obtained by right shifting the second predicted image by the second shift value. Effect of the Invention
[0013] According to the above configuration, any of the above problems can be solved. [Brief description of the drawings]
[0014] [Figure 1] 1 is a schematic diagram showing a configuration of an image transmission system according to an embodiment of the present invention. [Diagram 2] 1 is a diagram showing the configuration of a transmitting device equipped with a video encoding device according to the present embodiment, and a receiving device equipped with a video decoding device, where (a) shows the transmitting device equipped with the video encoding device, and (b) shows the receiving device equipped with the video decoding device. [Diagram 3]1 is a diagram showing the configuration of a recording device equipped with a video encoding device according to the present embodiment, and a playback device equipped with a video decoding device, where (a) shows the configuration of a recording device equipped with a video encoding device, and (b) shows the configuration of a playback device equipped with a video decoding device. [Figure 4] FIG. 2 is a diagram showing a hierarchical structure of data in an encoded stream. [Diagram 5] FIG. 13 is a diagram illustrating an example of division of a CTU. [Figure 6] FIG. 2 is a conceptual diagram showing an example of a reference picture and a reference picture list. [Figure 7] FIG. 1 is a schematic diagram showing a configuration of a video decoding device. [Figure 8] FIG. 13 is a schematic diagram showing a configuration of an inter-prediction parameter decoding unit. [Figure 9] 1 is a schematic diagram showing the configuration of a merge prediction parameter derivation unit and an AMVP prediction parameter derivation unit. [Figure 10] FIG. 13 is a schematic diagram showing a configuration of an inter-prediction image generating unit. [Figure 11] 11 is a diagram showing an example of a flowchart illustrating the flow of a process in which a motion compensation unit having a motion compensation function using BDOF prediction according to the present embodiment derives a predicted image. FIG. [Figure 12] FIG. 2 is a schematic diagram showing the configuration of a BDOF section according to the present embodiment. [Figure 13] FIG. 11 is a diagram showing an example of a flowchart illustrating a process flow for generating a predicted image by a BDOF unit according to the embodiment. [Figure 14] 11 is a diagram showing an example of an area in which a BDOF unit according to the present embodiment performs BDOF padding; FIG. [Figure 15] 11 is a diagram showing an example of a unit of BDOF processing and a read area of a BDOF section according to the embodiment; FIG. [Figure 16] FIG. 1 is a block diagram showing a configuration of a video encoding device. [Figure 17] 13 is a schematic diagram showing a configuration of an inter-prediction parameter encoding unit. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0015] (First embodiment) Hereinafter, an embodiment of the present invention will be described with reference to the drawings.
[0016] FIG. 1 is a schematic diagram showing the configuration of an image transmission system 1 according to this embodiment.
[0017] The image transmission system 1 is a system that transmits an encoded stream obtained by encoding an image to be encoded, decodes the transmitted encoded stream, and displays an image. The image transmission system 1 includes a video encoding device (image encoding device) 11, a network 21, a video decoding device (image decoding device) 31, and a video display device (image display device) 41.
[0018] An image T is input to the video encoding device 11 .
[0019] The network 21 transmits the coded stream Te generated by the video coding device 11 to the video decoding device 22. The network 21 is the Internet, a wide area network (WAN), a local area network (LAN), or a combination of these. The network 21 is not necessarily limited to a bidirectional communication network, and may be a unidirectional communication network that transmits broadcast waves such as terrestrial digital broadcasting and satellite broadcasting. The network 21 may also be replaced by a storage medium on which the encoded stream Te is recorded, such as a DVD (Digital Versatile Disc: registered trademark) or a BD (Blue-ray Disc: registered trademark).
[0020] The video decoding device 31 decodes each of the coded streams Te transmitted by the network 21, and generates one or more decoded images Td.
[0021] The moving image display device 41 displays all or part of one or more decoded images Td generated by the moving image decoding device 31. The moving image display device 41 includes, for example, a display device such as a liquid crystal display or an organic EL (Electro-luminescence) display. Examples of the form of the display include a stationary type, a mobile type, and an HMD. Further, when the moving image decoding device 31 has high processing power, an image with high image quality is displayed, and when it has only lower processing power, an image that does not require high processing power and display ability is displayed.
[0022] <Operator> The operators used in this specification are described below.
[0023] >> is a right bit shift, << is a left bit shift, & is a bitwise AND, | is a bitwise OR, |= is an OR assignment operator, and || represents a logical OR.
[0024] x?y:z is a ternary operator that takes y when x is true (non-zero) and z when x is false (0).
[0025] Clip3(a, b, c) is a function that clips c to a value between a and b (inclusive). If c < a, it returns a; if c > b, it returns b; otherwise, it returns c (where a <= b).
[0026] abs(a) is a function that returns the absolute value of a.
[0027] Int(a) is a function that returns the integer value of a.
[0028] floor(a) is a function that returns the largest integer less than or equal to a.
[0029] ceil(a) is a function that returns the smallest integer greater than or equal to a.
[0030] a / d represents the division of a by d (truncating the decimal part).
[0031] a^b represents the b-th power of a.
[0032] sign(a) is a function that returns the sign of a. sign(a) = a>0? 1 : a==0? 0 : -1 log2(a) is a function that returns the logarithm of a with base 2.
[0033] Max(a, b) is a function that returns a when a>=b and b when a<b.
[0034] Min(a, b) is a function that returns a when a<=b and b when a>b.
[0035] Round(a) is a function that returns the rounded value of a. Round(a) = sign(a)*floor(abs(a)+0.5).
[0036] <Structure of the Encoded Stream Te> Prior to the detailed description of the moving image encoding device 11 and the moving image decoding device 31 according to the present embodiment, the data structure of the encoded stream Te generated by the moving image encoding device 11 and decoded by the moving image decoding device 31 will be described.
[0037] FIG. 4 is a diagram showing the hierarchical structure of data in the encoded stream Te. The encoded stream Te illustratively includes a sequence and a plurality of pictures constituting the sequence. FIGS. 4(a) to 4(f) respectively show an encoded video sequence that defines the sequence SEQ, an encoded picture that defines the picture PICT, an encoded slice that defines the slice S, encoded slice data that defines the slice data, an encoded tree unit included in the encoded slice data, and an encoded unit included in the encoded tree unit.
[0038] (Encoded Video Sequence) In the coded video sequence, a set of data that the video decoding device 31 refers to in order to decode the sequence SEQ to be processed is specified. As shown in Fig. 4(a), the sequence SEQ includes a video parameter set (Video Parameter Set), a sequence parameter set SPS (Sequence Parameter Set), a picture parameter set PPS (Picture Parameter Set), a picture PICT, and supplemental enhancement information SEI (Supplemental Enhancement Information).
[0039] The video parameter set VPS specifies a set of coding parameters common to multiple videos composed of multiple layers, as well as a set of coding parameters related to multiple layers and each individual layer included in the video.
[0040] The sequence parameter set SPS specifies a set of coding parameters that the video decoding device 31 refers to in order to decode the target sequence. For example, the width and height of a picture are specified. Note that there may be multiple SPSs. In that case, one of the multiple SPSs is selected from the PPS.
[0041] The picture parameter set PPS specifies a set of coding parameters that the video decoding device 31 refers to in order to decode each picture in the target sequence. For example, the picture parameter set PPS includes a reference value of the quantization width (pic_init_qp_minus26) used in decoding the picture and a flag (weighted_pred_flag) indicating the application of weighted prediction. Note that there may be multiple PPSs. In that case, one of the multiple PPSs is selected for each picture in the target sequence.
[0042] (Encoded Picture) A coded picture defines a set of data to be referenced by the video decoding device 31 in order to decode a picture PICT to be processed. As shown in FIG. 4(b), the picture PICT includes slices 0 to NS-1 (NS is the total number of slices included in the picture PICT).
[0043] In the following description, when there is no need to distinguish between slices 0 to NS-1, the subscripts of the symbols may be omitted. The same applies to other data that are included in the coded stream Te and that are to be described below and that are to be given subscripts.
[0044] (Coded Slice) A coded slice defines a set of data to be referenced by the video decoding device 31 in order to decode a target slice S. As shown in Fig. 4(c), a slice includes a slice header and slice data.
[0045] The slice header includes a group of coding parameters to be referred to by the video decoding device 31 in order to determine a decoding method for the current slice. Slice type designation information (slice_type) that designates the slice type is an example of a coding parameter included in the slice header.
[0046] Slice types that can be specified by the slice type specification information include (1) an I slice that uses only intra prediction when encoding, (2) a P slice that uses unidirectional prediction or intra prediction when encoding, and (3) a B slice that uses unidirectional prediction, bidirectional prediction, or intra prediction when encoding. Note that inter prediction is not limited to uni-prediction or bi-prediction, and a predicted image may be generated using more reference pictures. Hereinafter, when referring to P or B slice, it refers to a slice including a block that can use inter prediction.
[0047] In addition, the slice header may include a reference to a picture parameter set PPS (pic_parameter_set_id).
[0048] (Encoded slice data) The coded slice data defines a set of data to be referenced by the video decoding device 31 in order to decode the slice data to be processed. As shown in Fig. 4(d), the slice data includes a CTU. A CTU is a block of a fixed size (e.g., 64x64) that constitutes a slice, and is also called a Largest Coding Unit (LCU).
[0049] (coding tree unit) 4(e) specifies a set of data that the video decoding device 31 refers to in order to decode the CTU to be processed. The CTU is divided into coding units CU, which are basic units of the encoding process, by recursive quad tree division (QT (Quad Tree) division), binary tree division (BT (Binary Tree) division), or ternary tree division (TT (Ternary Tree) division). BT division and TT division are collectively called multi tree division (MT (Multi Tree) division). A node of a tree structure obtained by recursive quad tree division is called a coding node. Intermediate nodes of the quad tree, binary tree, and ternary tree are coding nodes, and the CTU itself is specified as the top coding node.
[0050] CT includes, as CT information, a QT split flag (qt_split_cu_flag) indicating whether or not QT split is performed, an MT split flag (mtt_split_cu_flag) indicating the presence or absence of MT split, an MT split direction (mtt_split_cu_vertical_flag) indicating the split direction of MT split, and an MT split type (mtt_split_cu_binary_flag) indicating the split type of MT split. qt_split_cu_flag, mtt_split_cu_vertical_flag, and mtt_split_cu_binary_flag are transmitted for each encoding node.
[0051] 5 is a diagram showing an example of division of a CTU. When qt_split_cu_flag is 1, the coding node is divided into four coding nodes (FIG. 5(b)).
[0052] When qt_split_cu_flag is 0, and mtt_split_cu_flag is 0, the coding node is not split and has one CU as a node (Figure 5(a)). A CU is the terminal node of a coding node and is not split any further. A CU is the basic unit of coding processing.
[0053] When mtt_split_cu_flag is 1, the coding node is MT-split as follows: When mtt_split_cu_vertical_flag is 0 and mtt_split_cu_binary_flag is 1, the coding node is split horizontally into two coding nodes (Fig. 5(d)), and when mtt_split_cu_vertical_flag is 1 and mtt_split_cu_binary_flag is 1, the coding node is split vertically into two coding nodes (Fig. 5(c)). When mtt_split_cu_vertical_flag is 0 and mtt_split_cu_binary_flag is 0, the coding node is split horizontally into three coding nodes (Fig. 5(f)), and when mtt_split_cu_vertical_flag is 1 and mtt_split_cu_binary_flag is 0, the coding node is split vertically into three coding nodes (Fig. 5(e)). These are shown in Fig. 5(g).
[0054] Also, when the size of the CTU is 64x64 pixels, the size of the CU can be any of the following: 64x64 pixels, 64x32 pixels, 32x64 pixels, 32x32 pixels, 64x16 pixels, 16x64 pixels, 32x16 pixels, 16x32 pixels, 16x16 pixels, 64x8 pixels, 8x64 pixels, 32x8 pixels, 8x32 pixels, 16x8 pixels, 8x16 pixels, 8x8 pixels, 64x4 pixels, 4x64 pixels, 32x4 pixels, 4x32 pixels, 16x4 pixels, 4x16 pixels, 8x4 pixels, 4x8 pixels, and 4x4 pixels.
[0055] (Encoding Unit) As shown in Fig. 4(f), a set of data to be referenced by the video decoding device 31 in order to decode the coding unit to be processed is defined. Specifically, a CU is composed of a CU header CUH, prediction parameters, transformation parameters, quantization transformation coefficients, etc. The CU header defines a prediction mode, etc.
[0056] The prediction process may be performed in units of CUs, or in units of sub-CUs obtained by further dividing a CU. When the size of a CU and a sub-CU are equal, there is one sub-CU in the CU. When the size of a CU is larger than that of a sub-CU, the CU is divided into sub-CUs. For example, when a CU is 8x8 and a sub-CU is 4x4, the CU is divided into 2 parts horizontally and 2 parts vertically, into 4 sub-CUs.
[0057] There are two types of prediction (prediction modes): intra prediction and inter prediction. Intra prediction is a prediction within the same picture, while inter prediction refers to a prediction process performed between different pictures (for example, between display times).
[0058] The transform and quantization processes are performed in units of CUs, but the quantized transform coefficients may be entropy coded in units of sub-blocks such as 4x4.
[0059] (Prediction parameters) The predicted image is derived from prediction parameters associated with the block, which include intra-prediction and inter-prediction parameters.
[0060] Hereinafter, prediction parameters of inter prediction will be described. Inter prediction parameters are composed of prediction list use flags predFlagL0, predFlagL1, reference picture indexes refIdxL0, refIdxL1, and motion vectors mvL0, mvL1. Prediction list use flags predFlagL0, predFlagL1 are flags indicating whether or not reference picture lists called L0 list and L1 list are used, respectively, and when the value is 1, the corresponding reference picture list is used. Note that in this specification, when "a flag indicating whether or not XX" is written, a flag other than 0 (for example, 1) is XX, 0 is not XX, and 1 is treated as true and 0 is treated as false in logical negation, logical product, etc. (similarly below). However, in an actual device or method, other values can be used as true and false values.
[0061] Syntax elements for deriving inter prediction parameters include, for example, an affine flag affine_flag, a merge flag merge_flag, a merge index merge_idx, an inter prediction identifier inter_pred_idc, a reference picture index refIdxLX, a prediction vector index mvp_LX_idx, a difference vector mvdLX, and a motion vector precision mode amvr_mode.
[0062] (See picture list) The reference picture list is a list of reference pictures stored in the reference picture memory 306. FIG. 6 is a conceptual diagram showing an example of a reference picture and a reference picture list. In FIG. 6(a), a rectangle indicates a picture, an arrow indicates a reference relationship between pictures, the horizontal axis indicates time, I, P, and B in the rectangle indicate an intra picture, a uni-predictive picture, and a bi-predictive picture, respectively, and numbers in the rectangle indicate a decoding order. As shown in the figure, the decoding order of pictures is I0, P1, B2, B3, and B4, and the display order is I0, B3, B2, B4, and P1. FIG. 6(b) shows an example of a reference picture list of a picture B3 (target picture). A reference picture list is a list indicating candidates for a reference picture, and one picture (slice) may have one or more reference picture lists. In the example shown in the figure, the target picture B3 has two reference picture lists, an L0 list RefPicList0 and an L1 list RefPicList1. In each CU, a reference picture index refIdxLX is used to specify which picture in the reference picture list RefPicListX (X=0 or 1) is actually referenced. The diagram shows an example where refIdxL0=2 and refIdxL1=0. Note that LX is a description method used when there is no distinction between L0 prediction and L1 prediction, and hereinafter, parameters for the L0 list and parameters for the L1 list are distinguished by replacing LX with L0 and L1.
[0063] (Merge prediction and AMVP prediction) The prediction parameter decoding (encoding) method includes a merge prediction mode and an AMVP (Advanced Motion Vector Prediction) mode, and the merge flag merge_flag is a flag for identifying these. The merge prediction mode is a mode in which the prediction list usage flag predFlagLX (or inter prediction identifier inter_pred_idc), the reference picture index refIdxLX, and the motion vector mvLX are not included in the encoded data, but are derived from the prediction parameters of the neighboring blocks that have already been processed. The AMVP mode is a mode in which the inter prediction identifier inter_pred_idc, the reference picture index refIdxLX, and the motion vector mvLX are included in the encoded data. The motion vector mvLX is encoded as a prediction vector index mvp_LX_idx that identifies the prediction vector mvpLX, a difference vector mvdLX, and a motion vector precision mode amvr_mode. In addition to the merge prediction mode, there may be an affine prediction mode identified by the affine flag affine_flag. As one form of the merge prediction mode, there may be a skip mode identified by a skip flag skip_flag. The skip mode is a mode in which prediction parameters are derived and used in the same manner as the merge mode, and prediction errors (residual images) are not included in the encoded data. In other words, when the skip flag skip_flag is 1, only the syntax related to the merge mode, such as the skip flag skip_flag and the merge index merge_idx, is included for the target CU, and the motion vector and the like are not included in the encoded data. For this reason, when the skip flag skip_flag indicates that the skip mode is applied to the target CU, the decoding of prediction parameters other than the skip flag skip_flag is omitted.
[0064] (Motion Vector) The motion vector mvLX indicates the amount of shift between blocks on two different pictures. A prediction vector and a difference vector related to the motion vector mvLX are called a prediction vector mvpLX and a difference vector mvdLX, respectively.
[0065] (Inter prediction identifier inter_pred_idc and prediction list usage flag predFlagLX) The inter prediction identifier inter_pred_idc is a value indicating the type and number of reference pictures, and takes one of the values PRED_L0, PRED_L1, and PRED_BI. PRED_L0 and PRED_L1 indicate uni-prediction using one reference picture managed in the L0 list and L1 list, respectively. PRED_BI indicates bi-prediction BiPred using two reference pictures managed in the L0 list and L1 list.
[0066] The merge index merge_idx is an index indicating which prediction parameter is to be used as the prediction parameter of the current block among prediction parameter candidates (merge candidates) derived from blocks for which processing has been completed.
[0067] The relationship between the inter prediction identifier inter_pred_idc and the prediction list use flags predFlagL0 and predFlagL1 is as follows, and they can be converted into each other.
[0068] inter_pred_idc = (predFlagL1<<1)+predFlagL0 predFlagL0 = inter_pred_idc & 1 predFlagL1 = inter_pred_idc >> 1 (Bi-predictive biPred decision) The flag biPred indicating whether or not the prediction is biPred can be derived based on whether or not two prediction list usage flags are both 1. For example, the flag can be derived by the following formula.
[0069] biPred = (predFlagL0==1 && predFlagL1==1) Alternatively, the flag biPred can be derived based on whether the inter prediction identifier is a value indicating the use of two prediction lists (reference pictures). For example, the flag biPred can be derived by the following formula.
[0070] biPred = (inter_pred_idc==PRED_BI) ? 1 : 0 (Configuration of a video decoding device) The configuration of a video decoding device 31 (FIG. 7) according to this embodiment will be described.
[0071] The video decoding device 31 includes an entropy decoding unit 301, a parameter decoding unit (prediction image decoding device) 302, a loop filter 305, a reference picture memory 306, a prediction parameter memory 307, a prediction image generating unit (prediction image generating device) 308, an inverse quantization and inverse transform unit 311, and an adder 312. Note that, in accordance with the video encoding device 11 described below, the video decoding device 31 may also be configured not to include the loop filter 305.
[0072] The parameter decoding unit 302 further includes a header decoding unit 3020, a CT information decoding unit 3021, and a CU decoding unit 3022 (prediction mode decoding unit), which are not shown, and the CU decoding unit 3022 further includes a TU decoding unit 3024. These may be collectively called a decoding module. The header decoding unit 3020 decodes parameter set information such as VPS, SPS, and PPS, and slice header (slice information) from the encoded data. The CT information decoding unit 3021 decodes the CT from the encoded data. The CU decoding unit 3022 decodes the CU from the encoded data. The TU decoding unit 3024 decodes QP update information (quantization correction value) and quantization prediction error (residual_coding) from the encoded data when a prediction error is included in the TU.
[0073] The parameter decoding unit 302 includes an inter prediction parameter decoding unit (prediction image generating device) 303 and an intra prediction parameter decoding unit 304, both of which are not shown. The prediction image generating unit 308 includes an inter prediction image generating unit (prediction image generating device) 309 and an intra prediction image generating unit 310.
[0074] In the following, an example will be described in which CTU and CU are used as processing units, but this is not limiting, and processing may be performed in sub-CU units. Alternatively, CTU and CU may be read as blocks, and sub-CU as sub-blocks, and processing may be performed in block or sub-block units.
[0075] The entropy decoding unit 301 performs entropy decoding on the coded stream Te input from the outside, and decodes each code (syntax element).
[0076] The entropy decoding unit 301 outputs the decoded code to the parameter decoding unit 302. The decoded code includes, for example, a prediction mode predMode, a merge flag merge_flag, a merge index merge_idx, an inter prediction identifier inter_pred_idc, a reference picture index refIdxLX, a prediction vector index mvp_LX_idx, a difference vector mvdLX, a motion vector precision mode amvr_mode, and the like. Control of which code to decode is performed based on an instruction from the parameter decoding unit 302.
[0077] (Configuration of inter-prediction parameter decoding unit) The inter prediction parameter decoding unit 303 decodes inter prediction parameters by referring to the prediction parameters stored in the prediction parameter memory 307, based on the code input from the entropy decoding unit 301. In addition, the inter prediction parameter decoding unit 303 outputs the decoded inter prediction parameters to the prediction image generation unit 308, and stores them in the prediction parameter memory 307.
[0078] 8 is a schematic diagram showing the configuration of the inter prediction parameter decoding unit 303 according to this embodiment. The inter prediction parameter decoding unit 303 includes a merge prediction unit 30374, a DMVR unit 30375, a sub-block prediction unit (affine prediction unit) 30372, an MMVD prediction unit (motion vector derivation unit) 30376, a triangle prediction unit 30377, an AMVP prediction parameter derivation unit 3032, and an adder unit 3038. The merge prediction unit 30374 includes a merge prediction parameter derivation unit 3036. The AMVP prediction parameter derivation unit 3032, the merge prediction parameter derivation unit 3036, and the affine prediction unit 30372 are means common to the video encoding device and the video decoding device, and therefore may be collectively referred to as a motion vector derivation unit (motion vector derivation device).
[0079] The inter prediction parameter decoding unit 303 instructs the entropy decoding unit 301 to decode syntax elements related to inter prediction, and extracts syntax elements included in the encoded data, such as the affine flag affine_flag, the merge flag merge_flag, the merge index merge_idx, the inter prediction identifier inter_pred_idc, the reference picture index refIdxLX, the prediction vector index mvp_LX_idx, the difference vector mvdLX, and the motion vector precision mode amvr_mode.
[0080] When the affine flag affine_flag is 1, that is, when it indicates an affine prediction mode, the affine prediction unit 30372 derives inter prediction parameters for the sub-block.
[0081] When the merge flag merge_flag is 1, that is, when the merge flag indicates the merge prediction mode, the merge index merge_idx is decoded and output to the merge prediction parameter derivation unit 3036 .
[0082] When the merge flag merge_flag is 0, i.e., indicates the AMVP prediction mode, for example, the inter prediction identifier inter_pred_idc, the reference picture index refIdxLX, the prediction vector index mvp_LX_idx, and the difference vector mvdLX are decoded as the AMVP prediction parameters. The AMVP prediction parameter derivation unit 3032 derives the prediction vector mvpLX from the prediction vector index mvp_LX_idx. The adder 3038 adds the derived prediction vector mvpLX and the difference vector mvdLX to derive the motion vector mvLX.
[0083] (Affine prediction part) The affine prediction unit 30372 derives affine prediction parameters for the target block. In this embodiment, the motion vectors (mv0_x, mv0_y) (mv1_x, mv1_y) of two control points (V0, V1) of the target block are derived as the affine prediction parameters. Specifically, the motion vectors of each control point may be derived by predicting from the motion vectors of adjacent blocks of the target block, or the motion vectors of each control point may be derived by adding the predicted vector derived as the motion vector of the control point and a difference vector derived from the encoded data.
[0084] Note that the affine prediction unit 30372 may derive parameters used in four-parameter MVD affine prediction or parameters used in six-parameter MVD affine prediction as appropriate.
[0085] (Merge prediction) 9A is a schematic diagram showing a configuration of merge prediction parameter derivation unit 3036 included in merge prediction unit 30374. Merge prediction parameter derivation unit 3036 includes a merge candidate derivation unit 30361 and a merge candidate selection unit 30362. Note that a merge candidate includes a prediction list use flag predFlagLX, a motion vector mvLX, and a reference picture index refIdxLX, and is stored in a merge candidate list. An index is assigned to the merge candidates stored in the merge candidate list according to a predetermined rule.
[0086] The merge candidate derivation unit 30361 derives merge candidates by directly using the motion vectors of the decoded neighboring blocks and the reference picture indexes refIdxLX. In addition, the merge candidate derivation unit 30361 may apply a spatial merge candidate derivation process, a temporal merge candidate derivation process, a pair-wise merge candidate derivation process, and a zero merge candidate derivation process, which will be described later.
[0087] As a spatial merge candidate derivation process, the merge candidate derivation unit 30361 reads out prediction parameters stored in the prediction parameter memory 307 according to a predetermined rule, and sets them as merge candidates. The method of specifying the reference picture is, for example, prediction parameters related to each of adjacent blocks within a predetermined range from the target block (for example, all or part of blocks adjacent to the left A1, right B1, upper right B0, lower left A0, and upper left B2 of the target block). The respective merge candidates are called A1, B1, B0, A0, and B2.
[0088] where A1, B1, B0, A0, and B2 are motion information derived from blocks containing the following coordinates, respectively:
[0089] A1: (xCb - 1, yCb + cbHeight - 1) B1: (xCb + cbWidth - 1, yCb - 1) B0: (xCb + cbWidth, yCb - 1) A0: (xCb - 1, yCb + cbHeight) B2: (xCb - 1, yCb - 1) As a temporal merge derivation process, the merge candidate derivation unit 30361 reads prediction parameters of the lower right CBR of the target block or block C in the reference image including the center coordinates from the prediction parameter memory 307, sets it as a merge candidate Col, and stores it in the merge candidate list mergeCandList[ ].
[0090] The pairwise derivation unit derives pairwise candidates avgK and stores them in the merge candidate list mergeCandList[ ].
[0091] The merge candidate derivation unit 30361 derives zero merge candidates Z0, ..., ZM, in which the reference picture index refIdxLX is 0...M and the X component and the Y component of the motion vector mvLX are both 0, and stores them in a merge candidate list.
[0092] The merge candidate derivation unit 30361 or the pairwise derivation unit stores the merge candidates in the merge candidate list mergeCandList[] in the following order, for example: spatial merge candidates (A1, B1, B0, A0, B2), temporal merge candidates Col, pairwise candidates AvgK, and zero merge candidates ZeroCandK. Note that reference blocks that are unavailable (e.g., blocks that are intra-predicted) are not stored in the merge candidate list. i = 0 if( availableFlagA1 ) mergeCandList[ i++ ] = A1 if( availableFlagB1 ) mergeCandList[ i++ ] = B1 if( availableFlagB0 ) mergeCandList[ i++ ] = B0 if( availableFlagA0 ) mergeCandList[ i++ ] = A0 if( availableFlagB2 ) mergeCandList[ i++ ] = B2 if( availableFlagCol ) mergeCandList[ i++ ] = Col if( availableFlagAvgK ) mergeCandList[ i++ ] = avgK if( i < MaxNumMergeCand ) mergeCandList[ i++ ] = ZK The upper left coordinates of the target block are (xCb, yCb), the width of the target block is cbWidth, and the height of the target block is cbHeight.
[0093] The merge candidate selection unit 30362 selects a merge candidate N indicated by the merge index merge_idx from among the merge candidates included in the merge candidate list, using the following formula.
[0094] N = mergeCandList[merge_idx] Here, N is a label indicating a merging candidate, and can be A1, B1, B0, A0, B2, Col, AvgK, ZeroCandK, etc. The motion information of the merging candidate indicated by label N is indicated by (mvLXN[0], mvLXN[1]) and predFlagLXN, refIdxLXN.
[0095] The merging candidate selection unit 30362 selects the motion information (mvLXN[0], mvLXN[1]), predFlagLXN, and refIdxLXN of the selected merging candidate as inter prediction parameters of the current block. The merging candidate selection unit 30362 stores the selected inter prediction parameters in the prediction parameter memory 307 and outputs them to the predicted image generation unit 308.
[0096] (MMVD Prediction Section 30373) The MMVD prediction unit 30373 adds the difference vector mvdLX to the central vector mvdLX (the motion vector of the merging candidate) derived by the merging candidate derivation unit 30361 to derive a motion vector.
[0097] The MMVD prediction unit 30376 derives a motion vector mvLX[] using the merge candidates mergeCandList[] and the syntax elements base_candidate_idx, direction_idx, and distance_idx that are decoded from or coded into coded data. Furthermore, the MMVD prediction unit 30376 may code or decode the syntax element distance_list_idx that selects a distance table.
[0098] The MMVD prediction unit 30376 selects the central vector mvLN[ ] using base_candidate_idx.
[0099] N = mergeCandList[base_candidate_idx] The MMVD prediction unit 30376 derives the base distance (mvdUnit[0], mvdUnit[1]) and the distance DistFromBaseMV.
[0100] dir_table_x[] = { 8, -8, 0, 0, 6, -6, -6, 6} dir_table_y[] = { 0, 0, 8, -8, 6, -6, 6, -6} mvdUnit[0] = dir_table_x[direction_idx] mvdUnit[1] = dir_table_y[direction_idx] DistFromBaseMV = DistanceTable[distance_idx] The MMVD prediction unit 30376 derives the difference vector refineMv[ ].
[0101] firstMv[0] = (DistFromBaseMV< <shiftMMVD) * mvdUnit[0] firstMv[1] = (DistFromBaseMV< <shiftMMVD) * mvdUnit[1] Here, shiftMMVD is a value that adjusts the magnitude of the difference vector so that it matches the precision MVPREC of the motion vector in the motion compensation unit 3091 (interpolation unit).
[0102] refineMvL0[0] = firstMv[0] refineMvL0[1] = firstMv[1] refineMvL1[0] = -firstMv[0] refineMvL1[1] = -firstMv[1] Finally, the MMVD prediction unit 30376 derives a motion vector of the MMVD merging candidate from the difference vector refineMvLX and the center vector mvLXN as follows.
[0103] mvL0
[0000] = mvL0N
[0000] + refineMvL0[0] mvL0
[0001] = mvL0N
[0001] + refineMvL0[1] mvL1
[0000] = mvL1N
[0000] + refineMvL1[0] mvL1
[0001] = mvL1N
[0001] + refineMvL1[1] (AMVP Prediction) 9B is a schematic diagram showing the configuration of the AMVP prediction parameter derivation unit 3032 according to this embodiment. The AMVP prediction parameter derivation unit 3032 includes a vector candidate derivation unit 3033 and a vector candidate selection unit 3034. The vector candidate derivation unit 3033 derives a prediction vector candidate from the motion vector mvLX of the decoded adjacent block stored in the prediction parameter memory 307 based on the reference picture index refIdxLX, and stores the candidate in a prediction vector candidate list mvpListLX[].
[0104] The vector candidate selection unit 3034 selects the motion vector mvpListLX[mvp_LX_idx] indicated by the prediction vector index mvp_LX_idx among the prediction vector candidates in the prediction vector candidate list mvpListLX[] as the prediction vector mvpLX. The vector candidate selection unit 3034 outputs the selected prediction vector mvpLX to the addition unit 3038.
[0105] The addition unit 3038 adds the prediction vector mvpLX input from the AMVP prediction parameter derivation unit 3032 and the decoded differential vector mvdLX to calculate the motion vector mvLX. The addition unit 3038 outputs the calculated motion vector mvLX to the prediction image generation unit 308 and the prediction parameter memory 307.
[0106] mvLX[0] = mvpLX[0]+mvdLX[0] mvLX[1] = mvpLX[1]+mvdLX[1] The motion vector precision mode amvr_mode is a syntax for switching the precision of the motion vector derived in the AMVP mode. For example, at amvr_mode = 0, 1, 2, the precision is switched among 1 / 4 pixel, 1 pixel, and 4 pixels.
[0107] When the precision of the motion vector is 1 / 16 precision, in order to change the motion vector differences of 1 / 4, 1, and 4 pixel precisions to the motion vector difference of 1 / 16 pixel precision, inverse quantization may be performed using MvShift (= 1 << amvr_mode) derived from amvr_mode as follows.
[0108] mvdLX[0] = mvdLX[0] << (MvShift + 2) mvdLX[1] = mvdLX[1] << (MvShift + 2) Note that the parameter decoding unit 302 may also decode and derive mvdLX[] using the following syntax. ·abs_mvd_greater0_flag ·abs_mvd_minus2 mvd_sign_flag Then, the parameter decoding unit 302 decodes the difference vector lMvd[ ] from the syntax by using the following equation.
[0109] lMvd[ compIdx ] = abs_mvd_greater0_flag[ compIdx ] * ( abs_mvd_minus2[ compIdx] + 2 ) * ( 1 - 2 * mvd_sign_flag[ compIdx ] ) Furthermore, the decoded difference vector lMvd[] is set to mvdLX in the case of translational MVD (MotionModelIdc[x][y] == 0), and is set to mvdCpLX in the case of control point MVD (MotionModelIdc[x][y] != 0).
[0110] if (MotionModelIdc[ x ][ y ] == 0) mvdLX[ x0 ][ y0 ][ compIdx ] = lMvd[ compIdx ] else mvdCpLX[ x0 ][ y0 ][ compIdx ] = lMvd[ compIdx ]<<2 (DMVR) Next, a description will be given of a DMVR (Decoder side Motion Vector Refinement) process performed by the DMVR unit 30375. When the merge flag merge_flag indicates that the merge prediction mode is applied to the target CU, or when the skip flag skip_flag indicates that the skip mode is applied to the target CU, the DMVR unit 30375 corrects the motion vector mvLX of the target CU derived by the merge prediction unit 30374 using a reference image.
[0111] Specifically, when the prediction parameters derived by the merge prediction unit 30374 are bi-predictive, the motion vector is corrected using a predicted image derived from motion vectors corresponding to two reference pictures. The corrected motion vector mvLX is supplied to the inter-prediction image generation unit 309.
[0112] (Triangle forecast) Next, the triangle prediction will be described. In the triangle prediction, the target CU is divided into two triangular prediction units with a diagonal or an anti-diagonal as a boundary. The predicted image in each triangular prediction unit is derived by applying a weighting mask process according to the pixel position to each pixel of the predicted image of the target CU (rectangular block including the triangular prediction unit). For example, a triangular image can be derived from a rectangular image by multiplying a mask in which the pixels of a triangular area in a rectangular area are set to 1 and the pixels of areas other than the triangle are set to 0. After generating the inter-predicted image, an adaptive weighting process is applied to both areas on either side of the diagonal, and one predicted image of the target CU (rectangular block) is derived by the adaptive weighting process using the two predicted images. This process is called a triangle synthesis process. Then, a transform (inverse transform) and a quantization (inverse quantization) process are applied to the entire target CU. Note that the triangle prediction is applied only in the case of the merge prediction mode or the skip mode.
[0113] The triangle prediction unit 30377 derives prediction parameters corresponding to two triangular regions used in triangle prediction, and supplies them to the inter-prediction image generation unit 309. In order to simplify the process, the triangle prediction may be configured not to use bi-prediction. In this case, the inter-prediction parameters of unidirectional prediction are derived in one triangular region. Note that the derivation of the two predicted images and the synthesis using the predicted images are performed by the motion compensation unit 3091 and the triangle synthesis unit 30952.
[0114] The loop filter 305 is a filter provided in the encoding loop, which removes block distortion and ringing distortion to improve image quality. The loop filter 305 applies a filter such as a deblocking filter, a sample adaptive offset (SAO), and an adaptive loop filter (ALF) to the decoded image of the CU generated by the adder 312.
[0115] The reference picture memory 306 stores the decoded image of the CU generated by the adder 312 in a location that is determined in advance for each current picture and current CU.
[0116] The prediction parameter memory 307 stores prediction parameters at a predetermined position for each CTU or CU to be decoded. Specifically, the prediction parameter memory 307 stores the parameters decoded by the parameter decoding unit 302 and the prediction mode predMode decoded by the entropy decoding unit 301.
[0117] The prediction image generating unit 308 receives a prediction mode predMode, prediction parameters, and the like. The prediction image generating unit 308 also reads a reference picture from the reference picture memory 306. The prediction image generating unit 308 generates a prediction image of a block or sub-block using the prediction parameters and the read reference picture (reference picture block) in the prediction mode indicated by the prediction mode predMode. Here, the reference picture block is a set of pixels on the reference picture (usually rectangular, so called a block), and is an area to be referenced for generating a prediction image.
[0118] (Inter-prediction image generation unit 309) When the prediction mode predMode indicates an inter prediction mode, the inter prediction image generation unit 309 generates a prediction image of a block or sub-block by inter prediction using the inter prediction parameters input from the inter prediction parameter decoding unit 303 and the read reference picture.
[0119] 10 is a schematic diagram showing the configuration of an inter-prediction image generation unit 309 included in the prediction image generation unit 308 according to this embodiment. The inter-prediction image generation unit 309 includes a motion compensation unit (prediction image generation device) 3091 and a synthesis unit 3095.
[0120] (Motion Compensation) The motion compensation unit 3091 (interpolated image generation unit 3091) generates an interpolated image (motion compensation image) by reading a block at a position shifted by the motion vector mvLX from the position of the target block in the reference picture RefPicLX specified by the reference picture index refIdxLX from the reference picture memory 306 based on the inter prediction parameters (prediction list usage flag predFlagLX, reference picture index refIdxLX, motion vector mvLX) input from the inter prediction parameter decoding unit 303. Here, if the accuracy of the motion vector mvLX is not integer accuracy, a filter for generating pixels at decimal positions called a motion compensation filter is applied to generate a motion compensation image.
[0121] The motion compensation unit 3091 first derives an integer position (xInt, yInt) and a phase (xFrac, yFrac) corresponding to coordinates (x, y) in the prediction block using the following formula.
[0122] xInt = xPb+(mvLX[0]>>(log2(MVPREC)))+x xFrac = mvLX[0]&(MVPREC -1) yInt = yPb+(mvLX[1]>>(log2(MVPREC)))+y yFrac = mvLX[1]&(MVPREC -1) Here, (xPb, yPb) are the upper left coordinates of a block of size bW*bH, where x=0...bW-1, y=0...bH-1, and MVPREC indicates the accuracy of the motion vector mvLX (1 / MVPREC pixel accuracy), e.g., MVPREC=16.
[0123] The motion compensation unit 3091 derives a temporary image temp[][] by performing horizontal interpolation processing on the reference picture refImg using an interpolation filter. In the following, Σ is the sum for k=0..NTAP-1, shift1 is a normalization parameter that adjusts the value range, and offset1=1<<(shift1-1).
[0124] temp[x][y] = (ΣmcFilter[xFrac][k]*refImg[xInt+k-NTAP / 2+1][yInt]+offset1)>>shift1 Next, the motion compensation unit 3091 derives the interpolated image Pred[][] by vertically interpolating the temporary image temp[][]. In the following, Σ is the sum for k=0..NTAP-1, shift2 is a normalization parameter that adjusts the value range, and offset2=1<<(shift2-1).
[0125] Pred[x][y] = (ΣmcFilter[yFrac][k]*temp[x][y+k-NTAP / 2+1]+offset2)>>shift2 The above-described interpolated image generation process may be expressed as Interpolation(refImg, xPb, yPb, bW, bH, mvLX).
[0126] (Synthetic section) The synthesis unit 3095 generates a predicted image by referring to the interpolated image supplied from the motion compensation unit 3091, the inter prediction parameters supplied from the inter prediction parameter decoding unit 303, and the intra image supplied from the intra prediction image generation unit 310, and supplies the generated predicted image to the addition unit 312.
[0127] The synthesis unit 3095 includes a combined intra / inter synthesis unit 30951, a triangle synthesis unit 30952, and a BDOF unit 30954.
[0128] (Combined intra / inter synthesis processing) The combined intra / inter synthesis unit 30951 generates a predicted image by combining a unidirectional predicted image in AMVP, a predicted image in skip mode or merge prediction mode, and an intra predicted image.
[0129] (Triangle synthesis processing) The triangle synthesis unit 30952 generates a predicted image using the above-mentioned triangle prediction.
[0130] (BDOF processing) The BDOF unit 30954 generates a predicted image by performing BDOF (Bi-directional optical flow; bi-predictive gradient change) processing. The BDOF unit 30954 will be described in detail later.
[0131] (Weighted prediction) In weighted prediction, a predicted image of a block is generated by multiplying a motion compensation image PredLX by a weighting coefficient. When one of the prediction list usage flags (predFlagL0 or predFlagL1) is 1 (uniprediction) and weighted prediction is not used, the following equation is processed to match the motion compensation image PredLX (LX is L0 or L1) to the pixel bit depth bitDepth.
[0132] Pred[x][y] = Clip3(0,(1<<bitDepth)-1,(PredLX[x][y]+offset1)> >shift1) Here, shift1=14-bitDepth and offset1=1<<(shift1-1). Furthermore, when both reference list usage flags (predFlagL0 and predFlagL1) are 1 (bi-prediction BiPred) and weighted prediction is not used, the following equation is processed to average the motion compensation images PredL0 and PredL1 and match them to the pixel bit rate.
[0133] Pred[x][y] = Clip3(0,(1<<bitDepth)-1,(PredL0[x][y]+PredL1[x][y]+offset2)> >shift2) Here, shift2=15-bitDepth and offset2=1<<(shift2-1).
[0134] Furthermore, when uni-prediction and weighted prediction are performed, the synthesis unit 3095 derives a weighted prediction coefficient w0 and an offset o0 from the encoded data, and performs processing according to the following equations.
[0135] Pred[x][y] = Clip3(0,(1<<bitDepth)-1,((PredLX[x][y]*w0+2^(log2WD-1))> >log2WD)+o0) Here, log2WD is a variable indicating a predetermined shift amount.
[0136] Furthermore, when bi-prediction BiPred and weighted prediction are performed, the synthesis unit 3095 derives weighted prediction coefficients w0, w1, o0, and o1 from the coded data, and performs processing according to the following equations.
[0137] Pred[x][y] = Clip3(0,(1< <bitDepth)-1,(PredL0[x][y]*w0+PredL1[x][y]*w1+((o0+o1+1)<<log2WD))> >(log2WD+1)) Then, the generated predicted image of the block is output to the adder 312.
[0138] The inverse quantization and inverse transform unit 311 inverse quantizes the quantized transform coefficients input from the entropy decoding unit 301 to obtain transform coefficients. The quantized transform coefficients are coefficients obtained in the encoding process by performing frequency transform such as DCT (Discrete Cosine Transform) or DST (Discrete Sine Transform) on the prediction error and quantizing the transform coefficients. The inverse quantization and inverse transform unit 311 performs inverse frequency transform such as inverse DCT or inverse DST on the obtained transform coefficients to calculate prediction errors. The inverse quantization and inverse transform unit 311 outputs the prediction errors to the adder unit 312.
[0139] The adder 312 generates a decoded image of the block by adding, for each pixel, the predicted image of the block input from the predicted image generation unit 308 and the prediction error input from the inverse quantization and inverse transform unit 311. The adder 312 stores the decoded image of the block in the reference picture memory 306, and also outputs it to the loop filter 305.
[0140] (BDOF prediction) Next, a description will be given of details of prediction using the BDOF process (BDOF prediction) performed by the BDOF unit 30954. In the bi-prediction mode, the BDOF unit 30954 generates a predicted image by referring to two predicted images (a first predicted image and a second predicted image) and a gradient correction term.
[0141] FIG. 11 is a flowchart illustrating the flow of a process for deriving a predicted image.
[0142] When the inter prediction parameter decoding unit 303 determines that the prediction mode is unidirectional prediction of L0 (inter_pred_idc is 0 in S101), the motion compensation unit 3091 generates an L0 predicted image PredL0[x][y] (S102). When the inter prediction parameter decoding unit 303 determines that the prediction mode is unidirectional prediction of L1 (inter_pred_idc is 1 in S101), the motion compensation unit 3091 generates an L1 predicted image PredL1[x][y] (S103). On the other hand, when the inter prediction parameter decoding unit 303 determines that the prediction mode is bi-prediction mode (inter_pred_idc is 2 in S101), the process proceeds to the following S104. In S104, the synthesis unit 3095 determines whether or not BDOF processing is required by referring to bdofFlag indicating whether or not BDOF processing is performed. If bdofFlag indicates TRUE, the BDOF unit 30954 executes BDOF processing to generate a bidirectional predicted image (S106). If bdofFlag indicates FALSE, the synthesis unit 3095 generates a predicted image by normal bidirectional predicted image generation (S105).
[0143] The bdofFlag, which indicates whether or not to perform BDOF processing, is set to TRUE if the following conditions are met:
[0144] The inter prediction parameter decoding unit 303 may derive TRUE for bdofFlag when the L0 reference image refImgL0 and the L1 reference image refImgL1 are different reference images and the two pictures are in the opposite direction to the target picture. Specifically, when the target image is currPic, bdofFlag indicates TRUE when the condition DiffPicOrderCnt(currPic, refImgL0)*DiffPicOrderCnt(currPic, refImgL1)<0 is satisfied. Here, DiffPicOrderCnt() is a function that derives the difference between the POC (Picture Order Count: picture display order) of two images as follows:
[0145] DiffPicOrderCnt(picA,picB) = PicOrderCnt(picA)-PicOrderCnt(picB) As a condition for bdofFlag to indicate TRUE, a condition that the current block is not a sub-block prediction (affine prediction) may be added.
[0146] Furthermore, as a condition for bdofFlag to indicate TRUE, a condition may be added that, in weighted prediction, neither L0 prediction nor L1 prediction is performed as weighted prediction. Specifically, the condition for bdofFlag to indicate TRUE is when both luma_weight_l0_flag[refIdxL0] indicating whether or not a luminance weighting factor w0 and an offset o0 are present in the L0 predicted picture and luma_weight_l1_flag[refIdxL1] indicating whether or not a luminance weighting factor w1 and an offset o1 are present in the L1 predicted picture are FALSE.
[0147] 12, the specific contents of the processing performed by the BDOF unit 30954 when bdofFlag is TRUE will be described. The BDOF unit 30954 includes an L0, L1 predicted image generating unit 309541, a flag setting unit 309542, a gradient image generating unit 309543, a correlation parameter calculating unit 309544, a motion compensation correction value derivation unit 309545, and a bidirectional predicted image generating unit 309546. The BDOF unit 30954 generates a predicted image from an interpolated image received from the motion compensation unit 3091 and an inter prediction parameter received from the inter prediction parameter decoding unit 303, and outputs the generated predicted image to the addition unit 312. Note that the process of deriving a motion compensation correction value bdofOffset (motion compensation correction image) from a gradient image and correcting and deriving the predicted images of PredL0 and PredL1 is called a bidirectional gradient change process.
[0148] First, the L0, L1 predicted image generation unit 309541 generates L0, L1 predicted images used for BDOF processing. Here, the CU is divided into sub-blocks. This enables parallel processing in sub-block units and reduces the amount of memory required for one process.
[0149] Specifically, the basic size of a subblock may be 16 x 16. For example, when the size of a CU is cbWidth and cbHeight, the number of horizontal subblocks numSbX, the number of vertical subblocks numSbY, and the sizes of subblocks sbWidth and sbHeight in the CU are derived as follows:
[0150] numSbX = ( cbWidth > 16 ) ? ( cbWidth >> 4 ) : 1 numSbY = ( cbHeight > 16 ) ? ( cbHeight >> 4 ) : 1 sbWidth = cbWidth / numSbX sbHeight = cbHeight / numSbY Next, BDOF processing is performed based on the L0 and L1 predicted images for each subblock shown in FIG. 14, but in order to obtain the gradient, additional interpolated image information for one pixel around the subblock is required. In gradient image generation described below, this interpolated image information uses nearby pixels rather than a normal interpolation filter. In other cases, it is a padding area where the surrounding pixels are copied, just like the outside of the picture. Also, the unit of BDOF processing is 4x4 pixels, which is less than the subblock unit, and the processing itself is performed using 6x6 pixels, including one surrounding pixel.
[0151] A flag setting unit 309542 sets the value of a flag sbBdofFlag indicating whether or not to perform BDOF processing in subblock units, and a flag bdofUtilizationFlag[xIdx][yIdx] indicating whether or not to perform BDOF processing in 4x4 pixel units. Here, the number of pixels of the width and height of the subblock are sbWidth and sbHeight. xIdx is the horizontal address of the 4x4 pixel block, taking a value from 0 to (sbWidth>>2)-1, and yIdx is the vertical address of the 4x4 pixel block, taking a value from 0 to (sbHeight>>2)-1. When sbBdofFlag and bdofUtilizationFlag[xIdx][yIdx] are TRUE, BDOF processing is performed, and when FALSE, bidirectional prediction processing is performed.
[0152] First, the subblock-based threshold sbDiffThres, the 4x4 pixel block-based threshold bdofBlkDiffThres, and the subblock-based sum of absolute differences sbSumDiff are derived as follows.
[0153] sbDiffThres = 4 * sbWidth*sbHeight bdofBlkDiffThres = 128 In this embodiment, sbDiffThres is 4 per pixel, and bdofBlkDiffThres is 128=8*4*4, so a value of 8 per pixel is used as the threshold, but other values may be used. For example, double values, sbDiffThres=8*sbWidth*sbHeight, and bdofBlkDiffThres=256 may be used. Also, sub-block unit switching may be turned off by setting sbDiffThres=0, and 4x4 pixel block unit switching may be turned off by setting bdofBlkDiffThres=0.
[0154] First, set the value of sbSumDiff as follows:
[0155] sbSumDiff = 0 Then, by running a loop of xIdx = 0..(sbWidth>>2)-1 and yIdx = 0..(sbHeight>>2)-1 for each 4x4 pixel block, the sums of absolute differences bdofBlkSumDiff and bdofUtilizationFlag[xIdx][yIdx] in 4x4 pixel units are derived as follows:
[0156] bdofBlkSumDiff = sum4(Abs((PredL0[(xIdx<<2)+1+i][(yIdx<<2)+1+j]>>shift4) ?(PredL1[(xIdx<<2)+1+i][(yIdx<<2)+1+j]>>shift4))) (Formula BDOF-1) shift4=Max(InternalBitDepth-4, bitDepth+InternalBitDepth-16) bdofUtilizationFlag[xIdx][yIdx] = (bdofBlkSumDiff >= bdofBlkDiffThres) sbSumDiff += bdofBlkSumDiff That is, the sum of absolute values of differences between the value obtained by shifting PredL0 by shift4 and the value obtained by shifting PredL1 by shift4 is derived. Note that in (Equation BDOF-1), instead of (x, y)=((xIdx<<2)+1+i, yIdx<<2)+1+j), values (hx, vy) obtained by further clipping (x, y) by the CU size (nCbW, nCbH) may be used. In this case, pixels beyond the boundary are derived by padding.
[0157] hx = Clip3( 1, nCbW, x ) vy = Clip3( 1, nCbH, y ) Here, sum4() is a function that finds the sum of a 4x4 pixel block with arguments i = 0..3, j = 0..3, and shift4 is the same as shift4 defined in the correlation parameter calculation unit 309544 described later. Note that InternalBitDepth is a parameter for the calculation accuracy within the BDOF unit, and is a constant value independent of the input pixel bit length bitDepth, and is a value between 7 and 12. For example, when InternalBitDepth = 8, shift4 is shift4 = Max (4, bitDepth - 8).
[0158] When using an interpolation filter similar to that of HEVC, the values of PredL0 and PredL1 have a calculation precision of 14 bits when the bitDepth ranges from 8 to 12 bits. When InternalBitDepth=8, shift4 = Max(4, bitDepth-8) = 4. Therefore, the sum of absolute differences after shifting PredL0 and PredL1 shown in (Equation BDOF-1) to the right by shift4 is calculated with a precision of 10 bits regardless of the bitDepth.
[0159] In the prior art document, bdofBlkDiff directly calculates the sum of absolute differences between PredL0 and PredL1 without right-shifting. However, in this embodiment, the calculation is the same as the calculation of the difference of theta[x][y] (equation BDOF-2) calculated by the correlation parameter calculation unit 309544 of the BDOF unit 30954 described later, and the processing can be shared between the threshold determination by the flag setting unit 309542 and the derivation of the predicted image by the BDOF unit 30954. As a result, while in the prior art document, the calculation by the flag setting unit 309542 simply required an additional amount of calculation, in this embodiment, since the calculation of the difference can be shared, the additional part is only the part for calculating the sum of absolute values, and therefore the amount of calculation can be significantly reduced.
[0160] bdofUtilizationFlag[xIdx][yIdx] is set to TRUE if bdofBlkSumDiff is greater than or equal to bdofBlkDiffThres, and is set to FALSE otherwise.
[0161] In addition, the value of sbSumDiff is the sum of bdofBlkSumDiff.
[0162] Finally, sbBdofFlag is set to FALSE if sbSumDiff is less than sbDiffThres, otherwise it is set to TRUE.
[0163] Because the calculation of the difference is shared, this configuration allows the flag setting unit 309542 to set the values of sbBdofFlag and bdofUtilizationFlag[xIdx][yIdx] with a smaller amount of processing.
[0164] In another embodiment of the flag setting unit 309542, bdofBlkSumDiff is calculated by the following formula.
[0165] bdofBlkSumDiff = sum42(Abs((PredL0[(xIdx<<2)+1+i][(yIdx<<2)+1+2*j]>>shift4) ?(PredL1[(xIdx<<2)+1+i][(yIdx<<2)+1+2*j]>>shift4))) Here, sum42() is a function that calculates the sum of 4x2 pixel blocks with arguments i = 0..3, j = 0..1. bdofBlkSumDiff may be the sum of absolute differences of 4x2 pixels every other line. In this case, sbDiffThres and bdofBlkDiffThres are set to half the values of those in the above embodiment, as shown below.
[0166] sbDiffThres = 2 * sbWidth*sbHeight bdofBlkDiffThres = 64 By using this configuration, the amount of calculation for bdofBlkSumDiff can be halved. Because this is not a calculation that directly affects predicted image generation, there is almost no performance degradation due to the reduction in processing.
[0167] FIG. 13 is a flow chart explaining the process of generating a predicted image by the BDOF unit 30954. First, in flag setting (S201), the value of a flag sbBdofFlag indicating whether or not to perform BDOF processing in subblock units, and a flag bdofUtilizationFlag[xIdx][yIdx] indicating whether or not to perform BDOF processing in 4x4 pixel units are set. Next, a judgment of sbBdofFlag (S202) is performed, and if it is FALSE, a bidirectional predicted image generation in subblock units (S203) is performed, and if it is TRUE, BDOF processing in subblock units (S204)-(S210) is performed. Loop1 ((S204) to (S210)) is a loop of addresses in the vertical direction, and Loop2 ((S205) to (S209)) is a loop of addresses in the horizontal direction. A determination is made as to bdofUtilizationFlag[xIdx][yIdx] (S206), and if it is FALSE, bidirectional predictive image generation in 4x4 pixel units (S207) is performed, and if it is TRUE, BDOF processing in 4x4 pixel units (S208) is performed.
[0168] In this flow chart, whether or not to perform BDOF processing is determined in two stages, that is, in units of subblocks and in units of 4x4 pixel blocks, but it may be realized by only performing the processing in units of subblocks or only in units of 4x4 pixel blocks.
[0169] The gradient image generator 309543 generates a gradient image. In gradient change (Optical Flow), it is assumed that the pixel value of each point does not change, but only its position changes. This can be expressed as follows using the change in pixel value I in the horizontal direction (horizontal gradient value lx) and its position change Vx, the change in pixel value I in the vertical direction (vertical gradient value ly) and its position change Vy, and the time change in pixel value I lt.
[0170] lx * Vx + ly * Vy + lt = 0 Hereafter, the change in position (Vx, Vy) is called the correction weight vector (u, v).
[0171] Specifically, the gradient image generation unit 309543 derives gradient images lx0, ly0, lx1, and ly1 from the following equations: lx0 and lx1 indicate gradients along the horizontal direction, and ly0 and ly1 indicate gradients along the vertical direction.
[0172] Specifically, the gradient image generation unit 309543 derives the gradient images lx0, ly0, lx1, and ly1 as follows.
[0173] lx0[x][y] = (PredL0[x+1][y]-PredL0[x-1][y])>>shift0 (formula BDOF-3) ly0[x][y] = (PredL0[x][y+1]-PredL0[x][y-1])>>shift0 lx1[x][y] = (PredL1[x+1][y]-PredL1[x-1][y])>>shift0 ly1[x][y] = (PredL1[x][y+1]-PredL1[x][y-1])>>shift0 Here, shift0=14-InternalBitDepth.
[0174] As another method for deriving the gradient images lx0, ly0, lx1, and ly1, they may be set as in the following equation.
[0175] lx0[x][y] = (PredL0[x+1][y]>>shift0)-(PredL0[x-1][y]>>shift0) (formula BDOF-4) ly0[x][y] = (PredL0[x][y+1]>>shift0)-(PredL0[x][y-1]>>shift0) lx1[x][y] = (PredL1[x+1][y]>>shift0)-(PredL1[x-1][y]>>shift0) ly1[x][y] = (PredL1[x][y+1]>>shift0)-(PredL1[x][y-1]>>shift0) In the case of (equation BDOF-3), if the range between the minimum and maximum values of PredL0 and PredL1 is 16 bits, the difference will be 17 bits, so 32-bit operations are required. However, in the case of (equation BDOF-4), a right shift is performed first, so all operations can be executed as 16-bit operations, which has the advantage that parallel operation instructions are easy to use.
[0176] In either case, when an interpolation filter similar to that of HEVC is used, the values of PredL0 and PredL1 have a calculation precision of 14 bits if bitDepth is in the range of 8 to 12 bits, and the range between the minimum and maximum values is 16 bits. If bitDepth is greater than 12, the calculation precision is (bitDepth+2) bits, and the range between the minimum and maximum values is (bitDepth+4) bits. In this embodiment, the calculation precision is shifted right by shift0, which is a value according to InternalBitDepth. Therefore, the calculation precision of the gradient images lx0, ly0, lx1, and ly1 is (InternalBitDepth+1) bits when BitDepth is 8 to 12, and is (bitDepth+InternalBitDepth-11) when bitDepth is 13 or more.
[0177] Next, the correlation parameter calculation unit 309544 derives gradient product sums s1, s2, s3, s5, and s6 for each 4x4 pixel block in the subblock. Here, s1, s2, s3, s5, and s6 are calculated from the sums of pixels in a 6x6 pixel block using one pixel around the block.
[0178] s1 = sum6(phiX[x][y]* phiX[x][y]) s2 = sum6(phiX[x][y]* phiY[x][y]) s3 = sum6(-theta[x][y]* phiX[x][y]) s5 = sum6(phiY[x][y]* phiY[x][y]) s6 = sum6(-theta[x][y]* phiY[x][y]) Here, sum(a) represents the sum of a for the coordinates (x, y) in the 6x6 pixel block.
[0179] theta[x][y]= -(PredL1[x][y]>>shift4)+(PredL0[x][y]>>shift4) (formula BDOF-2) phiX[x][y] = (lx1[x][y] + lx0[x][y])>>shift5 phiY[x][y] = (ly1[x][y] + ly0[x][y])>>shift5 That is, theta[x][y] is derived from the difference between the value obtained by shifting PredL0[x][y] by shift 4 and the value obtained by shifting PredL1[x][y] by shift 4. This is the same as the difference value calculated in (Equation BDOF-1). Here, shift4 and shift5 are derived as follows.
[0180] shift4=Max(InternalBitDepth-4, bitDept+InternalBitDepth-16) shift5=Max(InternalBitDepth-7, bitDepth+InternalBitDepth-19) In addition, in (Equation BDOF-2), values (hx, vy) clipped by the CU size (nCbW, nCbH) may be used instead of (x, y). In this case, pixels beyond the boundary are derived by padding. Also, x and y may be in the ranges of x=xSb-1..xSb+4 and y=ySb-1..ySb+4, respectively.
[0181] xSb = (xIdx<<2)+1, ySb = (yIdx<<2)+1 hx = Clip3( 1, nCbW, x ) vy = Clip3( 1, nCbH, y ) In this case, the calculation precision of theta value is always (19-InternalBitDepth) bits if bitDepth is 8 or more. Also, if the image bitDepth is 8 or more, the calculation precision of phiX and phiY is always 9 bits. Therefore, the calculation precision of s1, s2, and s5, which are the sum of 6x6 pixel blocks, is about 23 bits regardless of bitDepth. Similarly, the calculation precision of s3 and s6, which are the sum of 6x6 pixel blocks, is about (33-InternalBitDepth) bits. The minimum and maximum values of PredL0 and PredL1 are in the 16-bit range when bitDepth is 8 to 12, and in the (bitDepth+4)-bit range when bitDepth is 13 bits or more, so they can be realized by 32-bit integer calculation.
[0182] More specifically, if InternalBitDepth=8, this is achieved using the following formula.
[0183] shift0=6 shift4=Max(4, bitDepth-8) shift5=Max(1, bitDepth-11) If InternalBitDepth=7, this is achieved using the following formula.
[0184] shift0=7 shift4=Max(3, bitDepth-9) shift5=Max(0, bitDepth-12) As another configuration of the correlation parameter calculation unit 309544, the gradient product sums s1, s2, s3, s5, and s6 may be calculated using 4x4 pixel blocks instead of 6x6 pixel blocks. Because the blocks are 4x4=16 pixels, the number of calculation bits required to calculate the sum is (Ceil(log2(36))-Ceil(log2(16)))=2 less than that required for a sum of 6x6=36 pixels.
[0185] shift4=Max(InternalBitDepth-5, bitDept+InternalBitDepth-15) shift5=Max(InternalBitDepth-8, bitDepth+InternalBitDepth-18) Therefore, even if values one bit smaller are used as in the above formula, it can be realized with 32-bit integer arithmetic. In this case, however, the value of InternalBitDepth must be between 8 and 12. The amount of calculation for gradient multiplication and accumulation can also be reduced. As shown in FIG. 15, the unit of BDOF processing and the read area match, so unlike the case of FIG. 14, a padding area of one pixel around the target sub-block is not required.
[0186] Next, the motion compensation modification value derivation unit 309545 derives a correction weight vector (u, v) in units of 4x4 pixels using the derived gradient product sums s1, s2, s3, s5, and s6.
[0187] u = (s3<<3) >> floor(log2(s1)) v = ((s6<<3)-((((u*s2m)<<12)+u*s2s)>>1)) >> floor(log2(s5)) Here, s2m = s2>>12 and s2s = s2&((1<<12)-1).
[0188] In addition, the range of u and v may be further restricted using clips as follows.
[0189] u=s1>0?Clip3(-th,th,-(s3<<3)>>floor(log2(s1))):0 v=s5>0?Clip3(-th,th,((s6<<3)-((((u*s2m)<<12)+u*s2s)>>1))>>floor(log2(s5))):0 Here, th is expressed by the following formula.
[0190] th = Max(2, 1<<(13-InternalBitDepth)) Since th is a value independent of bitDepth, the pixel-by-pixel correction weight vector (u, v) is clipped by a value related to InternalBitDepth. Regardless of the pixel bit length bitDepth, for example, if InternalBitDepth=8, then th=1<<(13-8)=32. Also, if InternalBitDepth=7, then th=1<<(13-7)=64.
[0191] In this case, since the pixel-based correction weight vector (u, v) can be considered to be a value related to the accuracy of the motion vector and the quantization width, the threshold value th for limiting the correction weight vector (u, v) may be expressed as a function of the quantization width Qp as shown in the following equation.
[0192] th0 = Max(1, 1<<(12-InternalBitDepth)) th = th0 + floor((Qp-32) / 6) It should be noted that the gradient sums of products s3 and s6 may be derived using the following formula without shifting them left by 3 bits.
[0193] u = s3 >> floor(log2(s1)) v = (s6-((((u*s2m)<<12)+u*s2s)>>1))>> floor(log2(s5)) However, shift4 is derived using the following formula.
[0194] shift4=Max(InternalBitDepth-7, bitDepth+InternalBitDepth-19) In this case, there is no need to change shift0 and shift5. Specifically, when InternalBitDepth=8, shift4 is derived using the following formula.
[0195] shift4=Max(1, bitDepth-11) The motion compensation correction value derivation unit 309545 derives a motion compensation correction value bdofOffset using the correction weight vector (u, v) in 4x4 pixel units and gradient images lx0, ly0, lx1, and ly1.
[0196] bdofOffset[x][y]=((lx1[x][y]-lx0[x][y])*u+(ly1[x][y]-ly0[x][y])*v+1)>>1 Alternatively, bdofOffset may be derived using a round function as follows:
[0197] bdofOffset[x][y] = Round(((lx1[x][y]-lx0[x][y])*u)>>1)+Round(((ly1[x][y]-ly0[x][y])*v)>>1) Alternatively, by devising the value of the right shift value shift0 of the gradient images lx0, ly0, lx1, and ly1, it is also possible to derive the gradient images lx0, ly0, lx1, and ly1 without using the right shift or the round function as follows:
[0198] bdofOffset[x][y]=(lx1[x][y]-lx0[x][y])*u+(ly1[x][y]-ly0[x][y])*v shift0=15-InternalBitDepth shift5=Max(InternalBitDepth-8, bitDepth+InternalBitDepth-20) In this case, the selection range of InternalBitDepth is 8 to 12, and there is no need to change shift4. Specifically, when InternalBitDepth=8, the formula is as follows.
[0199] shift0=7 shift5=Max(0, bitDepth-12) The bidirectional predicted image generation unit 309546 uses the above parameters to derive the pixel value Pred of a 4x4 pixel predicted image according to the following equation.
[0200] Pred[x][y] = Clip3(0, (1<<bitDepth)-1,( PredL0[x][y]+PredL1[x][y]+bdofOffset[x][y]+offset2)> >shift2) Here, shift2=Max(3,15-bitDepth) and offset2=1<<(shift2-1).
[0201] With the above configuration, it is possible to reduce the amount of calculation required to set a flag indicating whether or not to perform BDOF processing in sub-block units and a flag indicating whether or not to perform BDOF processing in 4x4 pixel units.
[0202] (Configuration of a video encoding device) Next, the configuration of the video encoding device 11 according to this embodiment will be described. Fig. 16 is a block diagram showing the configuration of the video encoding device 11 according to this embodiment. The video encoding device 11 includes a prediction image generating unit 101, a subtraction unit 102, a transformation and quantization unit 103, an inverse quantization and inverse transformation unit 105, an addition unit 106, a loop filter 107, a prediction parameter memory (prediction parameter storage unit, frame memory) 108, a reference picture memory (reference image storage unit, frame memory) 109, an encoding parameter determining unit 110, a parameter encoding unit 111, and an entropy encoding unit 104.
[0203] The predicted image generating unit 101 generates a predicted image for each CU, which is an area obtained by dividing each picture of the image T. The predicted image generating unit 101 operates in the same manner as the predicted image generating unit 308 already described, and therefore a description thereof will be omitted.
[0204] The subtraction unit 102 generates a prediction error by subtracting the pixel values of the predicted image of the block input from the predicted image generation unit 101 from the pixel values of the image T. The subtraction unit 102 outputs the prediction error to the transformation and quantization unit 103.
[0205] The transform / quantization unit 103 calculates transform coefficients by frequency transforming the prediction errors input from the subtraction unit 102, and derives quantized transform coefficients by quantizing the prediction errors. The transform / quantization unit 103 outputs the quantized transform coefficients to the entropy coding unit 104 and the inverse quantization / inverse transform unit 105.
[0206] The inverse quantization and inverse transform unit 105 is the same as the inverse quantization and inverse transform unit 311 (FIG. 7) in the video decoding device 31, and a description thereof will be omitted. The calculated prediction error is output to the addition unit .
[0207] The entropy coding unit 104 receives the quantized transform coefficients from the transform / quantization unit 103 and the coding parameters from the parameter coding unit 111. The coding parameters include, for example, codes of a reference picture index refIdxLX, a prediction vector index mvp_LX_idx, a difference vector mvdLX, a motion vector precision mode amvr_mode, a prediction mode predMode, and a merge index merge_idx.
[0208] The entropy coding unit 104 entropy codes the division information, the prediction parameters, the quantized transformation coefficients, etc. to generate a coded stream Te, and outputs it.
[0209] The parameter coding unit 111 includes a header coding unit 1110, a CT information coding unit 1111, a CU coding unit 1112 (prediction mode coding unit), an inter prediction parameter coding unit 112, and an intra prediction parameter coding unit 113. The CU coding unit 1112 further includes a TU coding unit 1114.
[0210] The operation of each module will be outlined below: The parameter coding unit 111 performs coding processing of parameters such as header information, division information, prediction information, and quantized transformation coefficients.
[0211] The CT information encoding unit 1111 encodes the QT, MT (BT, TT) division information and the like from the encoded data.
[0212] The CU encoding unit 1112 encodes the CU information, prediction information, the TU split flag split_transform_flag, the CU residual flags cbf_cb, cbf_cr, cbf_luma, and the like.
[0213] When a prediction error is included in a TU, the TU encoding unit 1114 encodes the QP update information (quantization correction value) and the quantized prediction error (residual_coding).
[0214] The CT information encoding unit 1111 and the CU encoding unit 1112 supply syntax elements such as inter prediction parameters (prediction mode predMode, merge flag merge_flag, merge index merge_idx, inter prediction identifier inter_pred_idc, reference picture index refIdxLX, prediction vector index mvp_LX_idx, difference vector mvdLX), intra prediction parameters, and quantized transform coefficients to the entropy encoding unit 104.
[0215] (Configuration of the inter-prediction parameter encoding unit) The parameter coding unit 112 derives inter prediction parameters based on the prediction parameters input from the coding parameter determination unit 110. The parameter coding unit 112 includes a part of the same configuration as the configuration in which the inter prediction parameter decoding unit 303 derives inter prediction parameters.
[0216] The configuration of the prediction parameter coding unit 112 will be described. As shown in FIG. 17, the prediction parameter coding unit 112 includes a parameter coding control unit 1121, a merge prediction unit 30374, a sub-block prediction unit (affine prediction unit) 30372, a DMVR unit 30375, an MMVD prediction unit 30376, a triangle prediction unit 30377, an AMVP prediction parameter derivation unit 3032, and a subtraction unit 1123. The merge prediction unit 30374 includes a merge prediction parameter derivation unit 3036. The parameter coding control unit 1121 includes a merge index derivation unit 11211 and a vector candidate index derivation unit 11212. In addition, the parameter coding control unit 1121 derives merge_idx, affine_flag, base_candidate_idx, distance_idx, direction_idx, etc. in the merge index derivation unit 11211, and derives mvpLX, etc. in the vector candidate index derivation unit 11212. The merge prediction parameter derivation unit 3036, the AMVP prediction parameter derivation unit 3032, the affine prediction unit 30372, the MMVD prediction unit 30376, and the triangle prediction unit 30377 may be collectively referred to as a motion vector derivation unit (motion vector derivation device). The parameter coding unit 112 outputs the motion vector (mvLX, subMvLX), the reference picture index refIdxLX, the inter prediction identifier inter_pred_idc, or information indicating these to the predicted image generation unit 101. The parameter coding unit 112 also outputs merge_flag, skip_flag, merge_idx, inter_pred_idc, refIdxLX, mvp_lX_idx, mvdLX, amvr_mode, and affine_flag to the entropy coding unit 104.
[0217] The merge index derivation unit 11211 derives a merge index merge_idx, and outputs it to the merge prediction parameter derivation unit (merge prediction unit) 3036. The vector candidate index derivation unit 11212 derives a predicted vector index mvp_lX_idx.
[0218] The merge prediction parameter derivation unit 3036 derives inter prediction parameters based on the merge index merge_idx.
[0219] The AMVP prediction parameter derivation unit 3032 derives a prediction vector mvpLX based on the motion vector mvLX. The AMVP prediction parameter derivation unit 3032 outputs the prediction vector mvpLX to the subtraction unit 1123. Note that the reference picture index refIdxLX and the prediction vector index mvp_lX_idx are output to the entropy encoding unit 104.
[0220] The affine prediction unit 30372 derives inter prediction parameters (affine prediction parameters) for the sub-block.
[0221] The subtraction unit 1123 generates a difference vector mvdLX by subtracting the prediction vector mvpLX, which is the output of the AMVP prediction parameter derivation unit 3032, from the motion vector mvLX input from the coding parameter determination unit 110. The difference vector mvdLX is output to the entropy coding unit 104.
[0222] The adder 106 generates a decoded image by adding, for each pixel, the pixel value of the predicted image of the block input from the predicted image generation unit 101 and the prediction error input from the inverse quantization and inverse transform unit 105. The adder 106 stores the generated decoded image in the reference picture memory 109.
[0223] The loop filter 107 performs deblocking filtering, SAO, and ALF on the decoded image generated by the adder 106. Note that the loop filter 107 does not necessarily have to include the above three types of filters, and may be configured, for example, as only a deblocking filter.
[0224] The prediction parameter memory 108 stores the prediction parameters generated by the coding parameter determination unit 110 in a predetermined location for each current picture and CU.
[0225] The reference picture memory 109 stores the decoded image generated by the loop filter 107 at a predetermined position for each current picture and CU.
[0226] The coding parameter determination unit 110 selects one set from among a plurality of sets of coding parameters. The coding parameters are the above-mentioned QT, BT or TT division information, prediction parameters, or parameters to be coded that are generated in relation to these. The predicted image generation unit 101 generates a predicted image using these coding parameters.
[0227] The coding parameter determination unit 110 calculates an RD cost value indicating the amount of information and the coding error for each of the multiple sets. The coding parameter determination unit 110 selects the set of coding parameters that minimizes the calculated cost value. As a result, the entropy coding unit 104 outputs the selected set of coding parameters as a coded stream Te. The coding parameter determination unit 110 stores the determined coding parameters in the predicted parameter memory 108.
[0228] In addition, a part of the video encoding device 11 and the video decoding device 31 in the above-mentioned embodiment, for example, the entropy decoding unit 301, the parameter decoding unit 302, the loop filter 305, the predicted image generating unit 308, the inverse quantization and inverse transform unit 311, the addition unit 312, the predicted image generating unit 101, the subtraction unit 102, the transform and quantization unit 103, the entropy encoding unit 104, the inverse quantization and inverse transform unit 105, the loop filter 107, the encoding parameter determination unit 110, and the parameter encoding unit 111 may be realized by a computer. In this case, a program for realizing this control function may be recorded in a computer-readable recording medium, and the program recorded in the recording medium may be read into and executed by a computer system. In addition, the "computer system" referred to here is a computer system built into either the video encoding device 11 or the video decoding device 31, and includes hardware such as an OS and peripheral devices. In addition, "computer-readable recording medium" refers to portable media such as flexible disks, optical magnetic disks, ROMs, and CD-ROMs, and storage devices such as hard disks built into computer systems. Furthermore, "computer-readable recording medium" may also include devices that dynamically hold a program for a short period of time, such as a communication line when transmitting a program via a network such as the Internet or a communication line such as a telephone line, and devices that hold a program for a certain period of time, such as volatile memory inside a computer system that serves as a server or client in such cases. Furthermore, the above program may be one that realizes part of the above-mentioned functions, or may be one that can realize the above-mentioned functions in combination with a program already recorded in the computer system.
[0229] In addition, a part or the whole of the video encoding device 11 and the video decoding device 31 in the above-mentioned embodiment may be realized as an integrated circuit such as an LSI (Large Scale Integration). Each functional block of the video encoding device 11 and the video decoding device 31 may be individually made into a processor, or a part or the whole may be integrated into a processor. The integrated circuit method is not limited to LSI, and may be realized by a dedicated circuit or a general-purpose processor. Furthermore, when an integrated circuit technology that replaces LSI appears due to the progress of semiconductor technology, an integrated circuit based on that technology may be used.
[0230] Although one embodiment of the present invention has been described in detail above with reference to the drawings, the specific configuration is not limited to the above, and various design changes, etc. are possible within the scope that does not deviate from the gist of the present invention.
[0231] [Application example] The above-mentioned video encoding device 11 and video decoding device 31 can be mounted on various devices that transmit, receive, record, and play videos. The video may be a natural video captured by a camera or the like, or an artificial video (including CG and GUI) generated by a computer or the like.
[0232] First, it will be described with reference to FIG. 2 that the above-mentioned video encoding device 11 and video decoding device 31 can be used for transmitting and receiving videos.
[0233] Fig. 2(a) is a block diagram showing the configuration of a transmitting device PROD_A equipped with a video encoding device 11. As shown in the figure, the transmitting device PROD_A includes an encoding unit PROD_A1 that obtains encoded data by encoding a video, a modulation unit PROD_A2 that obtains a modulated signal by modulating a carrier wave with the encoded data obtained by the encoding unit PROD_A1, and a transmitting unit PROD_A3 that transmits the modulated signal obtained by the modulation unit PROD_A2. The above-mentioned video encoding device 11 is used as this encoding unit PROD_A1.
[0234] The transmitting device PROD_A may further include a camera PROD_A4 for capturing moving images, a recording medium PROD_A5 for recording moving images, an input terminal PROD_A6 for inputting moving images from the outside, and an image processing unit A7 for generating or processing images, as a source of moving images to be input to the encoding unit PROD_A1. In the figure, the transmitting device PROD_A is illustrated as having all of these components, but some of them may be omitted.
[0235] The recording medium PROD_A5 may record unencoded video, or may record video encoded by an encoding method for recording that is different from the encoding method for transmission. In the latter case, a decoding unit (not shown) that decodes the encoded data read from the recording medium PROD_A5 according to the encoding method for recording may be interposed between the recording medium PROD_A5 and the encoding unit PROD_A1.
[0236] 2(b) is a block diagram showing the configuration of a receiving device PROD_B equipped with a video decoding device 31. As shown in the figure, the receiving device PROD_B includes a receiving unit PROD_B1 that receives a modulated signal, a demodulation unit PROD_B2 that obtains coded data by demodulating the modulated signal received by the receiving unit PROD_B1, and a decoding unit PROD_B3 that obtains a video by decoding the coded data obtained by the demodulation unit PROD_B2. The above-mentioned video decoding device 31 is used as this decoding unit PROD_B3.
[0237] The receiving device PROD_B may further include, as destinations of the moving image output by the decoding unit PROD_B3, a display PROD_B4 for displaying the moving image, a recording medium PROD_B5 for recording the moving image, and an output terminal PROD_B6 for outputting the moving image to the outside. In the figure, the receiving device PROD_B is illustrated as having all of these components, but some of them may be omitted.
[0238] The recording medium PROD_B5 may be for recording unencoded video, or may be encoded by an encoding method for recording that is different from the encoding method for transmission. In the latter case, it is preferable to interpose an encoding unit (not shown) between the decoding unit PROD_B3 and the recording medium PROD_B5, which encodes the video acquired from the decoding unit PROD_B3 according to the encoding method for recording.
[0239] The transmission medium for transmitting the modulated signal may be wireless or wired. The transmission mode for transmitting the modulated signal may be broadcast (here, this refers to a transmission mode in which the destination is not specified in advance) or communication (here, this refers to a transmission mode in which the destination is specified in advance). In other words, the transmission of the modulated signal may be realized by any of wireless broadcast, wired broadcast, wireless communication, and wired communication.
[0240] For example, a broadcasting station (such as a broadcasting facility) / receiving station (such as a television receiver) for terrestrial digital broadcasting is an example of a transmitting device PROD_A / receiving device PROD_B that transmits and receives modulated signals by wireless broadcasting. Also, a broadcasting station (such as a broadcasting facility) / receiving station (such as a television receiver) for cable television broadcasting is an example of a transmitting device PROD_A / receiving device PROD_B that transmits and receives modulated signals by cable broadcasting.
[0241] Also, a server (such as a workstation) / client (such as a television receiver, a personal computer, a smartphone, etc.) of a VOD (Video On Demand) service or a video sharing service using the Internet is an example of a transmitting device PROD_A / receiving device PROD_B that transmits and receives modulated signals by communication (usually, in a LAN, either wireless or wired is used as a transmission medium, and in a WAN, wired is used as a transmission medium). Here, personal computers include desktop PCs, laptop PCs, and tablet PCs. Also, smartphones include multi-function mobile phone terminals.
[0242] The client of the video hosting service has a function to decode the encoded data downloaded from the server and display it on a display, as well as a function to encode the video captured by the camera and upload it to the server. That is, the client of the video hosting service functions as both the transmitting device PROD_A and the receiving device PROD_B.
[0243] Next, it will be described with reference to FIG. 3 that the above-mentioned video encoding device 11 and video decoding device 31 can be used for recording and reproducing videos.
[0244] 3(a) is a block diagram showing the configuration of a recording device PROD_C equipped with the above-mentioned video encoding device 11. As shown in the figure, the recording device PROD_C includes an encoding unit PROD_C1 that obtains encoded data by encoding a video, and a writing unit PROD_C2 that writes the encoded data obtained by the encoding unit PROD_C1 onto a recording medium PROD_M. The above-mentioned video encoding device 11 is used as this encoding unit PROD_C1.
[0245] The recording medium PROD_M may be (1) a type built into the recording device PROD_C, such as an HDD (Hard Disk Drive) or SSD (Solid State Drive), (2) a type connected to the recording device PROD_C, such as an SD memory card or USB (Universal Serial Bus) flash memory, or (3) a type loaded into a drive device (not shown) built into the recording device PROD_C, such as a DVD (Digital Versatile Disc: registered trademark) or BD (Blu-ray Disc: registered trademark).
[0246] The recording device PROD_C may further include a camera PROD_C3 for capturing moving images, an input terminal PROD_C4 for inputting moving images from the outside, a receiving unit PROD_C5 for receiving moving images, and an image processing unit PROD_C6 for generating or processing images, as a supply source of moving images to be input to the encoding unit PROD_C1. Although the figure illustrates a configuration in which the recording device PROD_C includes all of these, some of them may be omitted.
[0247] The receiving unit PROD_C5 may receive unencoded video, or may receive encoded data encoded by an encoding method for transmission that is different from the encoding method for recording. In the latter case, a transmission decoding unit (not shown) that decodes the encoded data encoded by the encoding method for transmission may be interposed between the receiving unit PROD_C5 and the encoding unit PROD_C1.
[0248] Examples of such a recording device PROD_C include a DVD recorder, a BD recorder, and an HDD (Hard Disk Drive) recorder (in this case, the input terminal PROD_C4 or the receiving unit PROD_C5 is the main source of the moving image). Other examples of such a recording device PROD_C include a camcorder (in this case, the camera PROD_C3 is the main source of the moving image), a personal computer (in this case, the receiving unit PROD_C5 or the image processing unit C6 is the main source of the moving image), and a smartphone (in this case, the camera PROD_C3 or the receiving unit PROD_C5 is the main source of the moving image).
[0249] 3(b) is a block diagram showing the configuration of a playback device PROD_D equipped with the above-mentioned video decoding device 31. As shown in the figure, the playback device PROD_D includes a reading unit PROD_D1 that reads out coded data written to a recording medium PROD_M, and a decoding unit PROD_D2 that obtains video by decoding the coded data read by the reading unit PROD_D1. The above-mentioned video decoding device 31 is used as this decoding unit PROD_D2.
[0250] The recording medium PROD_M may be (1) a type that is built into the playback device PROD_D, such as an HDD or SSD, (2) a type that is connected to the playback device PROD_D, such as an SD memory card or USB flash memory, or (3) a type that is loaded into a drive device (not shown) built into the playback device PROD_D, such as a DVD or BD.
[0251] The playback device PROD_D may further include, as destinations of the video output by the decoding unit PROD_D2, a display PROD_D3 for displaying the video, an output terminal PROD_D4 for outputting the video to the outside, and a transmission unit PROD_D5 for transmitting the video. In the figure, the playback device PROD_D is illustrated as having all of these components, but some of them may be omitted.
[0252] The transmission unit PROD_D5 may transmit unencoded video, or may transmit encoded data encoded by an encoding method for transmission different from the encoding method for recording. In the latter case, it is preferable to interpose an encoding unit (not shown) between the decoding unit PROD_D2 and the transmission unit PROD_D5, which encodes the video by the encoding method for transmission.
[0253] Examples of such a playback device PROD_D include a DVD player, a BD player, and an HDD player (in this case, the output terminal PROD_D4 to which a television receiver or the like is connected is the main destination of the video image). Other examples of such a playback device PROD_D include a television receiver (in this case, the display PROD_D3 is the main destination of the video image), a digital signage (also called an electronic billboard or electronic bulletin board, and the display PROD_D3 or the transmission unit PROD_D5 is the main destination of the video image), a desktop PC (in this case, the output terminal PROD_D4 or the transmission unit PROD_D5 is the main destination of the video image), a laptop or tablet PC (in this case, the display PROD_D3 or the transmission unit PROD_D5 is the main destination of the video image), and a smartphone (in this case, the display PROD_D3 or the transmission unit PROD_D5 is the main destination of the video image).
[0254] (Hardware and Software Realizations) Furthermore, each block of the above-mentioned video decoding device 31 and video encoding device 11 may be realized in hardware by a logic circuit formed on an integrated circuit (IC chip), or in software by using a CPU (Central Processing Unit).
[0255] In the latter case, each of the above devices includes a CPU that executes the commands of a program that realizes each function, a ROM (Read Only Memory) that stores the above program, a RAM (Random Access Memory) that expands the above program, a storage device (recording medium) such as a memory that stores the above program and various data, etc. The object of the embodiment of the present invention can also be achieved by supplying each of the above devices with a recording medium on which the program code (executable program, intermediate code program, source program) of the control program of each of the above devices, which is software that realizes the above-mentioned functions, is recorded in a computer-readable manner, and the computer (or CPU or MPU) reads and executes the program code recorded on the recording medium.
[0256] Examples of the recording medium that can be used include tapes such as magnetic tapes and cassette tapes, magnetic disks such as floppy disks (registered trademark) and hard disks, disks including optical disks such as CD-ROMs (Compact Disc Read-Only Memory), MO disks (Magneto-Optical discs), MDs (Mini Discs), DVDs (Digital Versatile Discs: registered trademark), CD-Rs (CD Recordable), and Blu-ray Discs (registered trademark), cards such as IC cards (including memory cards) and optical cards, semiconductor memories such as mask ROMs, EPROMs (Erasable Programmable Read-Only Memory), EEPROMs (Electrically Erasable and Programmable Read-Only Memory: registered trademark), and flash ROMs, and logic circuits such as PLDs (Programmable logic devices) and FPGAs (Field Programmable Gate Arrays).
[0257] Moreover, each of the above devices may be configured to be connectable to a communication network, and the above program code may be supplied via the communication network. This communication network is not particularly limited as long as it is capable of transmitting the program code. For example, the Internet, an intranet, an extranet, a LAN (Local Area Network), an ISDN (Integrated Services Digital Network), a VAN (Value-Added Network), a CATV (Community Antenna television / Cable Television) communication network, a virtual private network, a telephone line network, a mobile communication network, a satellite communication network, etc. may be used. Moreover, the transmission medium constituting this communication network is not limited to a specific configuration or type as long as it is a medium capable of transmitting the program code. For example, it can be used in wired communication such as IEEE (Institute of Electrical and Electronic Engineers) 1394, USB, power line carrier, cable TV line, telephone line, ADSL (Asymmetric Digital Subscriber Line) line, etc., or in wireless communication such as infrared such as IrDA (Infrared Data Association) or remote control, BlueTooth (registered trademark), IEEE802.11 wireless, HDR (High Data Rate), NFC (Near Field Communication), DLNA (Digital Living Network Alliance: registered trademark), mobile phone network, satellite line, terrestrial digital broadcasting network, etc. The embodiment of the present invention can also be realized in the form of a computer data signal embedded in a carrier wave in which the program code is embodied by electronic transmission.
[0258] The present invention is not limited to the above-described embodiment, and various modifications are possible within the scope of the claims. In other words, the technical scope of the present invention also includes embodiments obtained by combining technical means that are appropriately modified within the scope of the claims.
[0259] [Additional Notes] The above embodiment can also be expressed as follows.
[0260] A video decoding device according to one aspect of the present invention has a predicted image generation unit that uses bidirectional gradient change processing to generate a predicted image from two interpolated images by gradient change, the predicted image generation unit having an L0,L1 prediction generation unit that generates an L0 predicted image and an L1 predicted image for each coding unit from the two interpolated images, a flag setting unit that determines whether or not to perform bidirectional gradient change processing for each coding unit from the L0 predicted image and the L1 predicted image, a gradient image generation unit that generates four gradient images in horizontal and vertical directions from the L0 predicted image and the L1 predicted image, a correlation parameter calculation unit that calculates correlation parameters for each processing unit from a product-sum operation of the L0 predicted image, the L1 predicted image, and the four gradient images, a motion compensation correction value derivation unit that derives a value for correcting a bidirectional predicted image from the gradient images and the correlation parameters, and a bidirectional predicted image generation unit that generates a predicted image from the L0 predicted image, the L1 predicted image, and the motion compensation correction value, and the flag setting unit and the correlation parameter calculation unit have the same calculation accuracy of a difference between the L0 predicted image and the L1 predicted image.
[0261] In addition, a video decoding device according to one embodiment of the present invention is characterized in that, in the flag setting unit and the correlation parameter calculation unit, the calculation accuracy of the difference between the L0 predicted image and the L1 predicted image is kept constant regardless of the pixel bit length.
[0262] [Configuration 1] a bidirectional gradient transformation process for transforming a bidirectional predicted image into a bidirectional predicted image from two interpolated images, the bidirectional gradient transformation process being performed based on the bidirectional gradient transformation process, the bidirectional predicted image generation unit comprising: an L0,L1 prediction generation unit for generating an L0 predicted image and an L1 predicted image for each coding unit from the two interpolated images; a flag setting unit for determining whether or not to perform bidirectional gradient transformation process for each coding unit from the L0 predicted image and the L1 predicted image; a gradient image generation unit for generating four gradient images in the horizontal and vertical directions from the L0 predicted image and the L1 predicted image; a correlation parameter calculation unit for calculating a correlation parameter for each processing unit from a product-sum operation of the L0 predicted image, the L1 predicted image, and the four gradient images;
[0263] [Configuration 2] The video decoding device of configuration 1, characterized in that in the flag setting unit and the correlation parameter calculation unit, the calculation accuracy of the difference between the L0 predicted image and the L1 predicted image is kept constant regardless of the pixel bit length.
[0264] [Configuration 3] a bidirectional gradient transformation process for transforming a predicted image from two interpolated images into a bidirectional gradient transformation process, the bidirectional gradient transformation process being performed for each coding unit, the bidirectional gradient transformation process being performed for each coding unit, the bidirectional gradient transformation process being performed for each coding unit, the bidirectional gradient transformation process being performed for each coding unit, the bidirectional gradient transformation process being performed for each coding unit, the bidirectional gradient transformation process being performed for each coding unit, the bidirectional gradient transformation process being performed for each coding unit, the bidirectional gradient transformation process being performed for each coding unit, the bidirectional gradient transformation process being performed for each coding unit,
[0265] [Configuration 4] The video encoding device of configuration 3, wherein the flag setting unit and the correlation parameter calculation unit maintain the calculation accuracy of the difference between the L0 predicted image and the L1 predicted image constant regardless of pixel bit length. [Industrial Applicability]
[0266] The embodiments of the present invention can be suitably applied to a video decoding device that decodes coded data in which image data is coded, and a video coding device that generates coded data in which image data is coded, and can also be suitably applied to the data structure of coded data that is generated by a video coding device and referenced by the video decoding device. [Explanation of symbols]
[0267] 31 Image Decoding Device 301 Entropy Decoding Unit 302 Parameter Decoding Unit 3020 Header Decoding Unit 303 Inter-prediction parameter decoding unit 304 Intra prediction parameter decoding unit 308 Prediction Image Generation Unit 309 Inter-prediction image generation unit 310 Intra-prediction image generation unit 311 Inverse quantization and inverse transformation unit 312 Addition section 11 Image encoding device 101 Prediction image generation unit 102 Subtraction section 103 Transformation and Quantization Section 104 Entropy coding unit 105 Inverse quantization and inverse transformation unit 107 Loop Filter 110 Encoding parameter determination unit 111 Parameter Encoding Unit 112 Inter-prediction parameter coding unit 113 Intra prediction parameter coding unit 1110 Header encoding part 1111 CT information encoding section 1112 CU encoding unit (prediction mode encoding unit) 1114 TU encoder 30954 BDOF section 309541 L0,L1 predicted image generation unit 309542 Flag setting section 309543 Gradient image generator 309544 Correlation parameter calculation unit 309545 Motion compensation correction value derivation part 309546 Bidirectional predictive image generator
Claims
1. A video decoding device that generates a third predicted image by BDOF prediction using a first predicted image, a second predicted image, and a motion compensation correction value, comprising: a BDOF unit that derives a sum of absolute differences between the first predicted image and the second predicted image in units of subblocks; the third predicted image is derived by right-shifting an added value of (i) the first predicted image, (ii) the second predicted image, (iii) the motion compensation correction value, and (iv) a first offset value by a first shift value; the motion compensation correction value is derived using a horizontal gradient image of the first predicted image, a vertical gradient image of the first predicted image, a horizontal gradient image of the second predicted image, and a vertical gradient image of the second predicted image; a horizontal gradient image of the first predicted image is derived using the equation lx0[x][y]=(PredL0[x+1][y]>>shift0)-(PredL0[x-1][y]>>shift0), where lx0 is the horizontal gradient image, PredL0 is the first predicted image, and shift0 is a second shift value; a vertical gradient image of the first predicted image is derived using the equation ly0[x][y]=(PredL0[x][y+1]>>shift0)-(PredL0[x][y-1]>>shift0), where ly0 is the vertical gradient image, PredL0 is the first predicted image, and shift0 is a second shift value; a horizontal gradient image of the second predicted image is derived using the equation lx1[x][y]=(PredL1[x+1][y]>>shift0)-(PredL1[x-1][y]>>shift0), where lx1 is the horizontal gradient image, PredL1 is the second predicted image, and shift0 is a second shift value; a vertical gradient image of the second predicted image is derived using an equation ly1[x][y] = (PredL1[x][y+1] >> shift0) - (PredL1[x][y-1] >> shift0), where ly1 is the vertical gradient image, PredL1 is the second predicted image, and shift0 is a second shift value.
2. 2. The video decoding device according to claim 1, wherein the second shift value is six.
3. A video encoding device that generates a third predicted image by BDOF prediction using a first predicted image, a second predicted image, and a motion compensation correction value, comprising: a BDOF unit that derives a sum of absolute differences between the first predicted image and the second predicted image in units of subblocks; the third predicted image is derived by right-shifting an added value of (i) the first predicted image, (ii) the second predicted image, (iii) the motion compensation correction value, and (iv) a first offset value by a first shift value; the motion compensation correction value is derived using a horizontal gradient image of the first predicted image, a vertical gradient image of the first predicted image, a horizontal gradient image of the second predicted image, and a vertical gradient image of the second predicted image; a horizontal gradient image of the first predicted image is derived using the equation lx0[x][y]=(PredL0[x+1][y]>>shift0)-(PredL0[x-1][y]>>shift0), where lx0 is the horizontal gradient image, PredL0 is the first predicted image, and shift0 is a second shift value; a vertical gradient image of the first predicted image is derived using the equation ly0[x][y]=(PredL0[x][y+1]>>shift0)-(PredL0[x][y-1]>>shift0), where ly0 is the vertical gradient image, PredL0 is the first predicted image, and shift0 is a second shift value; a horizontal gradient image of the second predicted image is derived using the equation lx1[x][y]=(PredL1[x+1][y]>>shift0)-(PredL1[x-1][y]>>shift0), where lx1 is the horizontal gradient image, PredL1 is the second predicted image, and shift0 is a second shift value; a vertical gradient image of the second predicted image is derived using an equation ly1[x][y] = (PredL1[x][y+1] >> shift0) - (PredL1[x][y-1] >> shift0), where ly1 is the vertical gradient image, PredL1 is the second predicted image, and shift0 is a second shift value.
4. A video decoding method for generating a third predicted image by BDOF prediction using a first predicted image, a second predicted image, and a motion compensation correction value, comprising: The method includes at least a step of deriving a sum of absolute differences between the first predicted image and the second predicted image in units of sub-blocks, the third predicted image is derived by right-shifting an added value of (i) the first predicted image, (ii) the second predicted image, (iii) the motion compensation correction value, and (iv) a first offset value by a first shift value; the motion compensation correction value is derived using a horizontal gradient image of the first predicted image, a vertical gradient image of the first predicted image, a horizontal gradient image of the second predicted image, and a vertical gradient image of the second predicted image; a horizontal gradient image of the first predicted image is derived using the equation lx0[x][y]=(PredL0[x+1][y]>>shift0)-(PredL0[x-1][y]>>shift0), where lx0 is the horizontal gradient image, PredL0 is the first predicted image, and shift0 is a second shift value; a vertical gradient image of the first predicted image is derived using the equation ly0[x][y]=(PredL0[x][y+1]>>shift0)-(PredL0[x][y-1]>>shift0), where ly0 is the vertical gradient image, PredL0 is the first predicted image, and shift0 is a second shift value; a horizontal gradient image of the second predicted image is derived using the equation lx1[x][y]=(PredL1[x+1][y]>>shift0)-(PredL1[x-1][y]>>shift0), where lx1 is the horizontal gradient image, PredL1 is the second predicted image, and shift0 is a second shift value; a vertical gradient image of the second predicted image is derived using an equation ly1[x][y] = (PredL1[x][y+1] >> shift0) - (PredL1[x][y-1] >> shift0), where ly1 is the vertical gradient image, PredL1 is the second predicted image, and shift0 is a second shift value.
5. 1. A video encoding method for generating a third predicted image by BDOF prediction using a first predicted image, a second predicted image, and a motion compensation correction value, comprising: The method includes at least a step of deriving a sum of absolute differences between the first predicted image and the second predicted image in units of sub-blocks, the third predicted image is derived by right-shifting an added value of (i) the first predicted image, (ii) the second predicted image, (iii) the motion compensation correction value, and (iv) a first offset value by a first shift value; the motion compensation correction value is derived using a horizontal gradient image of the first predicted image, a vertical gradient image of the first predicted image, a horizontal gradient image of the second predicted image, and a vertical gradient image of the second predicted image; a horizontal gradient image of the first predicted image is derived using the equation lx0[x][y]=(PredL0[x+1][y]>>shift0)-(PredL0[x-1][y]>>shift0), where lx0 is the horizontal gradient image, PredL0 is the first predicted image, and shift0 is a second shift value; a vertical gradient image of the first predicted image is derived using the equation ly0[x][y]=(PredL0[x][y+1]>>shift0)-(PredL0[x][y-1]>>shift0), where ly0 is the vertical gradient image, PredL0 is the first predicted image, and shift0 is a second shift value; a horizontal gradient image of the second predicted image is derived using the equation lx1[x][y]=(PredL1[x+1][y]>>shift0)-(PredL1[x-1][y]>>shift0), where lx1 is the horizontal gradient image, PredL1 is the second predicted image, and shift0 is a second shift value; a vertical gradient image of the second predicted image is derived using an equation ly1[x][y] = (PredL1[x][y+1] >> shift0) - (PredL1[x][y-1] >> shift0), where ly1 is the vertical gradient image, PredL1 is the second predicted image, and shift0 is a second shift value.
Citation Information
Patent Citations
Decoder side motion vector derivation
WO2020200269A1