Method and apparatus for modifying motion vector list at decoder side in inter prediction
By using the template matching or bilateral matching method in the merge mode and AMVP mode in the inter-frame prediction, the video encoding and decoding technology is optimized for the motion vector list, which solves the problem of low efficiency of motion vector operation in the inter-frame prediction and realizes video Improvement in quality and encoding and decoding efficiency.
Patent Information
- Application Number
- CN202280092281.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2022-12-28
- Filing Date
- 2022-12-29
- Publication Date
- 2024-10-08
AI Technical Summary
Existing video coding and decoding technology is difficult to effectively operate motion vector lists in inter-frame prediction, resulting in low video coding and decoding efficiency and poor image quality, especially at high resolutions and high frame rates, where the amount of data increases.
In the merge mode of inter prediction and the advanced motion vector prediction (AMVP) mode, the motion vector list is added, trimmed or reordered on the decoder side through template matching or bilateral matching (BM) method to generate more accurate Motion vector pairs to improve encoding and decoding efficiency.
Improved video quality and encoding and decoding efficiency, reduced data volume and improved image reconstruction accuracy through more accurate motion vector prediction.
Smart Images

Figure CN118749197A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method for modifying a motion vector list at a decoder side in inter-frame prediction. Background Art
[0002] The statements in this section merely provide background information related to the present invention and may not necessarily constitute prior art.
[0003] Since video data has a large amount of data compared to audio data or still image data, video data requires a large amount of hardware resources (including memory) to store or transmit the video data without being compressed.
[0004] Accordingly, the encoder is generally used to compress and store or transmit video data. The decoder receives the compressed video data, decompresses the received compressed video data, and plays the decompressed video data. Video compression technologies include H.264 / AVC, High Efficiency Video Coding (HEVC), and Versatile Video Coding (VVC), which improves the coding efficiency of HEVC by about 30% or more.
[0005] However, as image size, resolution, and frame rate gradually increase, the amount of data to be encoded will also increase. Accordingly, new compression technologies are needed that provide higher encoding and decoding efficiency and improved image enhancement effects than existing compression technologies. In particular, inter-frame prediction needs to consider the efficient operation of motion vector lists to improve video encoding and decoding efficiency and enhance video quality. Summary of the invention
[0006] Technical issues
[0007] The present invention is directed to providing a video coding method and apparatus using template matching or bilateral matching (BM) in a merge mode and an advanced motion vector prediction (AMVP) mode of inter-frame prediction, and performing at least one of adding, pruning or reordering candidates on a motion vector list at a decoder side.
[0008] Technical Solution
[0009] At least one aspect of the present invention provides a method for inter-frame prediction of a current block performed by a video decoding device. The method includes decoding a candidate index indicating one of a plurality of candidates in a candidate list from a bitstream, each candidate representing a motion vector pair in bidirectional prediction. The method also includes generating a candidate list by utilizing neighboring information of the current block. The method also includes modifying the candidate list based on a plurality of channels of multi-channel bilateral matching (MBM) and an MBM cost. Here, the plurality of channels include a first channel for performing a search for a motion vector pair of the current block, a second channel for performing a search for a motion vector pair of a sub-block within the current block, and a third channel for performing a search for a motion vector pair of a sub-sub-block of the sub-block. The search is performed based on an MBM cost, the MBM cost depending on the difference between the two blocks indicated by the motion vector pair of each of the plurality of channels searched. The method also includes extracting a motion vector pair of the current block from the modified candidate list by utilizing the candidate index. The method also includes generating a prediction block of the current block by utilizing the extracted motion vector pair.
[0010] Another aspect of the present invention provides a method for inter-frame prediction of a current block performed by a video decoding device. The method includes generating a candidate list by utilizing neighboring information of the current block. The method also includes determining a candidate index indicating one of a plurality of candidates in the candidate list, each candidate representing a motion vector pair in bidirectional prediction. The method also includes modifying the candidate list based on a plurality of channels of multi-channel bilateral matching (MBM) and an MBM cost. Here, the plurality of channels include a first channel for performing a search for a motion vector pair of the current block, a second channel for performing a search for a motion vector pair of a sub-block within the current block, and a third channel for performing a search for a motion vector pair of a sub-sub-block of the sub-block. The search is performed based on an MBM cost, the MBM cost depending on the difference between the two blocks indicated by the motion vector pair of each of the plurality of channels searched. The method also includes extracting a motion vector pair of the current block from the modified candidate list by utilizing the candidate index. The method also includes generating a prediction block of the current block by utilizing the extracted motion vector pair, and encoding the candidate index.
[0011] Another aspect of the present invention provides a computer-readable recording medium storing a bitstream generated by a video encoding method. The video encoding method includes generating a candidate list by utilizing neighboring information of a current block. The video encoding method also includes determining a candidate index indicating one of a plurality of candidates in the candidate list, and each candidate represents a motion vector pair in a bidirectional prediction. The video encoding method also includes modifying the candidate list based on a plurality of channels of multi-channel bilateral matching (MBM) and an MBM cost. Here, the plurality of channels have a first channel for performing a search for a motion vector pair of a current block, a second channel for performing a search for a motion vector pair of a sub-block within the current block, and a third channel for performing a search for a motion vector pair of a sub-sub-block of a sub-block. The search is performed based on an MBM cost, and the MBM cost depends on the difference between two blocks indicated by the motion vector pair of each of the plurality of channels searched. The video encoding method also includes extracting a motion vector pair of the current block from the modified candidate list by utilizing the candidate index. The video encoding method also includes generating a prediction block of the current block by utilizing the extracted motion vector pair, and encoding the candidate index.
[0012] Beneficial Effects
[0013] As described above, the present invention provides a video coding method and apparatus using a template matching method or a bilateral matching (BM) method in a merge mode and an AMVP mode of inter-frame prediction. The video coding method and apparatus perform at least one of adding, pruning or reordering candidates for a motion vector list on the decoder side. Therefore, the video coding method and apparatus improve video quality and enhance video coding efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 is a block diagram of a video encoding device that can implement the technology of the present invention.
[0015] Figure 2 A method of partitioning blocks using a quadtree plus binary tree ternary tree (QTBTTT) structure is shown.
[0016] Figure 3a and Figure 3b Multiple intra prediction modes are shown including a wide-angle intra prediction mode.
[0017] Figure 4 Shows the neighboring blocks of the current block.
[0018] Figure 5 is a block diagram of a video decoding device that can implement the technology of the present invention.
[0019] Figure 6a and Figure 6b is a schematic diagram illustrating affine motion prediction according to at least one embodiment of the present invention.
[0020] Figure 7 A method of deriving constructed affine merging candidates for affine motion prediction is shown.
[0021] Figure 8 is a flowchart of a process for searching for affine advanced motion vector prediction (AMVP) candidates in an affine AMVP mode according to at least one embodiment of the present invention.
[0022] Fig. 9 is a schematic diagram illustrating triangle partitioning types supported in geometric partitioning mode according to at least one embodiment of the present invention.
[0023] Fig.10 is a schematic diagram illustrating weights utilized in a geometric partitioning mode in accordance with at least one embodiment of the present invention.
[0024] Fig.11 is a schematic diagram illustrating a Geometric Partitioning Mode (GPM) candidate list according to at least one embodiment of the present invention.
[0025] Fig.12 is a schematic diagram illustrating template matching in intra prediction according to at least one embodiment of the present invention.
[0026] Fig.13 is a schematic diagram illustrating template matching in bidirectional prediction according to at least one embodiment of the present invention.
[0027] Fig.14 is a schematic diagram illustrating a bilateral matching AMVP-MERGE mode according to at least one embodiment of the present invention.
[0028] Fig.15 is a schematic diagram illustrating neighboring blocks used to derive a motion information candidate list according to at least one embodiment of the present invention.
[0029] Fig.16 is a schematic diagram illustrating neighboring blocks for deriving spatial candidates according to at least one embodiment of the present invention.
[0030] Fig.17 is a flow chart of a process for searching for affine AMVP candidates, including reordered inherited affine AMVP candidates, according to at least one embodiment of the present invention.
[0031] Fig.18 is a flowchart of a method for inter-predicting a current block performed by a video encoding apparatus according to at least one embodiment of the present invention.
[0032] Fig.19 is a flowchart of a method for inter-predicting a current block performed by a video decoding device according to at least one embodiment of the present invention.
[0033] Fig. 20 is a flowchart of a method for inter-predicting a current block performed by a video encoding apparatus according to another embodiment of the present invention.
[0034] Fig.21 is a flowchart of a method for inter-predicting a current block performed by a video decoding apparatus according to another embodiment of the present invention. DETAILED DESCRIPTION
[0035] Hereinafter, some embodiments of the present invention will be described in detail with reference to the attached illustrative drawings. In the following description, the same reference numerals represent the same elements, although the elements are shown in different drawings. In addition, in the following description of some embodiments, when it is considered that the detailed description of related known components and functions obscures the subject matter of the present invention, the detailed description of related known components and functions may be omitted for the sake of clarity and brevity.
[0036] Figure 1 is a block diagram of a video encoding device that can implement the technology of the present invention. Figure 1 A video encoding device and components of the device are described in detail.
[0037] The encoding device may include: an image divider 110, a predictor 120, a subtractor 130, a transformer 140, a quantizer 145, a rearrangement unit 150, an entropy encoder 155, an inverse quantizer 160, an inverse transformer 165, an adder 170, a loop filtering unit 180 and a memory 190.
[0038] Each component of the encoding device can be implemented as hardware or software, or as a combination of hardware and software. In addition, the function of each component can be implemented as software, and the microprocessor can also be implemented to execute the function of the software corresponding to each component.
[0039] A video consists of one or more sequences including multiple images. Each image is divided into multiple regions, and encoding is performed on each region. For example, an image is divided into one or more tiles or / and slices. Here, one or more tiles can be defined as a tile group. Each tile or / and slice is divided into one or more coding tree units (coding tree unit, CTU). In addition, each CTU is divided into one or more coding units (coding unit, CU) through a tree structure. The information applied to each coding unit (CU) is encoded as the syntax of the CU, and the information commonly applied to the CU included in a CTU is encoded as the syntax of the CTU. In addition, the information commonly applied to all blocks in a slice is encoded as the syntax of the slice header, and the information applied to all blocks constituting one or more images is encoded as a picture parameter set (Picture Parameter Set, PPS) or a picture header. In addition, the information commonly referenced by multiple images is encoded as a sequence parameter set (Sequence Parameter Set, SPS). In addition, the information commonly referenced by one or more SPSs is encoded as a video parameter set (Video Parameter Set, VPS). In addition, information commonly applied to one tile or tile group may also be encoded as syntax of the tile or tile group header.The syntax included in the SPS, PPS, slice header, tile or tile group header may be referred to as a high-level syntax.
[0040] The image divider 110 determines the size of a coding tree unit (CTU). Information on the size of the CTU (CTU size) is encoded as a syntax of an SPS or a PPS and transmitted to a video decoding device.
[0041] The image divider 110 divides each image constituting a video into a plurality of coding tree units (CTUs) having a predetermined size, and then recursively divides the CTUs by using a tree structure. A leaf node in the tree structure becomes a coding unit (CU), which is a basic unit of coding.
[0042] The tree structure can be a quadtree (quadtree, QT), in which a higher node (or parent node) is split into four lower nodes (or child nodes) of the same size. The tree structure can also be a binary tree (binarytree, BT), in which a higher node is split into two lower nodes. The tree structure can also be a ternary tree (ternarytree, TT), in which a higher node is split into three lower nodes at a ratio of 1:2:1. The tree structure can also be a structure in which two or more structures in the QT structure, BT structure and TT structure are mixed. For example, a quadtree plus binary tree (quadtree plus binarytree, QTBT) structure can be used, or a quadtree plus binary tree ternary tree (quadtree plus binarytreeternarytree, QTBTTT) structure can be used. Here, a binary tree ternary tree (BTTT) is added to the tree structure to be called a multiple-type tree (multiple-type tree, MTT).
[0043] Figure 2 is a schematic diagram for describing a method of partitioning a block by using a QTBTTT structure.
[0044] like Figure 2 As shown, the CTU can be first split into a QT structure. The quadtree splitting can be recursive until the size of the split block reaches the minimum block size (MinQTSize) of the leaf node allowed in QT. The first flag (QT_split_flag) indicating whether each node of the QT structure is split into four nodes of the lower layer is encoded by the entropy encoder 155 and notified to the video decoding device with a signal. When the leaf node of QT is not larger than the maximum block size (MaxBTSize) of the root node allowed in BT, the leaf node can be further split into at least one of a BT structure or a TT structure. There may be multiple splitting directions in the BT structure and / or the TT structure. For example, there may be two directions, namely, a direction for horizontally splitting blocks of the corresponding node and a direction for vertically splitting blocks of the corresponding node. As Figure 2 As shown, when MTT splitting starts, the entropy encoder 155 encodes a second flag (mtt_split_flag) indicating whether the node is split, and when the node is split, a flag additionally indicating the splitting direction (vertical or horizontal) and / or a flag indicating the splitting type (binary or trifurcated) and notifies the video decoding device of the same by signal.
[0045] Alternatively, before encoding the first flag (QT_split_flag) indicating whether each node is split into four nodes of the lower layer, the CU split flag (split_cu_flag) indicating whether the node is split may also be encoded. When the value of the CU split flag (split_cu_flag) indicates that each node is not split, the block of the corresponding node becomes a leaf node in the split tree structure and becomes a CU, which is the basic unit of encoding. When the value of the CU split flag (split_cu_flag) indicates that each node is split, the video encoding device first starts encoding the first flag in the above scheme.
[0046] When QTBT is used as another example of a tree structure, there may be two types, namely, a type in which the block of the corresponding node is horizontally split into two blocks of the same size (i.e., symmetrical horizontal splitting) and a type in which the block of the corresponding node is vertically split into two blocks of the same size (i.e., symmetrical vertical splitting). The entropy encoder 155 encodes a split flag (split_flag) indicating whether each node of the BT structure is split into blocks of the lower layer and split type information indicating the split type, and transmits them to the video decoding device. On the other hand, there may be another type in which the block of the corresponding node is split into two blocks that are asymmetric to each other. The asymmetric form may include a form in which the block of the corresponding node is split into two rectangular blocks with a size ratio of 1:3, or may also include a form in which the block of the corresponding node is split in a diagonal direction.
[0047] The CU may have various sizes according to the QTBT or QTBTTT partitioned from the CTU. Hereinafter, the block corresponding to the CU to be encoded or decoded (i.e., the leaf node of the QTBTTT) is referred to as the "current block". When QTBTTT partitioning is adopted, the shape of the current block may also be a rectangular shape in addition to a square shape.
[0048] The predictor 120 predicts the current block to generate a predicted block. The predictor 120 includes an intra predictor 122 and an inter predictor 124.
[0049] Typically, each of the current blocks in an image may be predictively encoded. Typically, the prediction of the current block may be performed by utilizing an intra-prediction technique (which utilizes data from an image including the current block) or an inter-prediction technique (which utilizes data from an image encoded prior to the image including the current block). Inter-prediction includes both unidirectional prediction and bidirectional prediction.
[0050] The intra-frame predictor 122 predicts pixels in the current block by using pixels (reference pixels) located adjacent to the current block in the current image including the current block. There are multiple intra-frame prediction modes according to the prediction direction. For example, Figure 3aAs shown, the plurality of intra prediction modes may include two non-directional modes including a planar mode and a DC mode, and may include 65 directional modes. Neighboring pixels and algorithm equations to be used are defined differently according to each prediction mode.
[0051] In order to perform efficient directional prediction for a current block with a rectangular shape, it is possible to additionally use Figure 3b The directional modes are shown in the dashed arrows (#67 to #80, intra-frame prediction modes #-1 to #-14). The directional modes can be called "wide angle intra-frame prediction modes". Figure 3b In the figure, the arrows indicate the corresponding reference samples used for prediction, rather than representing the prediction direction. The prediction direction is opposite to the direction indicated by the arrow. When the current block has a rectangular shape, the wide-angle intra prediction mode is a mode in which prediction is performed in a direction opposite to the specific direction mode without additional bit transmission. In this case, in the wide-angle intra prediction mode, some wide-angle intra prediction modes available for the current block can be determined by the ratio of the width to the height of the current block having a rectangular shape. For example, when the current block has a rectangular shape with a height less than the width, a wide-angle intra prediction mode (intra prediction modes #67 to #80) with an angle less than 45 degrees is available. When the current block has a rectangular shape with a width greater than the height, a wide-angle intra prediction mode with an angle greater than -135 degrees is available.
[0052] The intra-frame predictor 122 may determine an intra-frame prediction to be used for encoding the current block. In some examples, the intra-frame predictor 122 may encode the current block by utilizing multiple intra-frame prediction modes, and may also select an appropriate intra-frame prediction mode to be used from a test mode. For example, the intra-frame predictor 122 may calculate a rate-distortion value by utilizing a rate-distortion analysis of multiple tested intra-frame prediction modes, and may also select an intra-frame prediction mode having the best rate-distortion characteristic in the test mode.
[0053] The intra-frame predictor 122 selects an intra-frame prediction mode among a plurality of intra-frame prediction modes and predicts the current block by using adjacent pixels (reference pixels) and an algorithm equation determined according to the selected intra-frame prediction mode. Information about the selected intra-frame prediction mode is encoded by the entropy encoder 155 and transmitted to the video decoding device.
[0054] The inter-frame predictor 124 generates a prediction block for the current block by using a motion compensation process. The inter-frame predictor 124 searches for a block that is most similar to the current block in a reference image that has been encoded and decoded earlier than the current image, and generates a prediction block for the current block by using the searched block. In addition, a motion vector (MV) is generated, which corresponds to the displacement between the current block in the current image and the prediction block in the reference image. Typically, motion estimation is performed on the luminance (luma) component, and the motion vector calculated based on the luminance component is used for both the luminance component and the chrominance component. The motion information including information of the reference image and information about the motion vector used to predict the current block is encoded by the entropy encoder 155 and transmitted to the video decoding device.
[0055] The inter-frame predictor 124 may also perform interpolation of a reference image or a reference block to increase the accuracy of the prediction. In other words, a subsample is interpolated between two consecutive integer samples by applying a filter coefficient to a plurality of consecutive integer samples including two integer samples. When performing a process of searching for a block most similar to the current block on the interpolated reference image, a decimal unit precision may be represented for the motion vector instead of an integer sample unit precision. For each target region to be encoded, for example, a unit such as a slice, a tile, a CTU, a CU, etc., the precision or resolution of the motion vector may be set differently. When such an adaptive motion vector resolution (AMVR) is applied, information about the motion vector resolution to be applied to each target region should be signaled for each target region. For example, when the target region is a CU, information about the motion vector resolution applied to each CU is signaled. The information about the motion vector resolution may be information representing the precision of the motion vector difference to be described below.
[0056] On the other hand, the inter-frame predictor 124 may perform inter-frame prediction by utilizing bidirectional prediction. In the case of bidirectional prediction, two reference images and two motion vectors representing the block positions most similar to the current block in each reference image are used. The inter-frame predictor 124 selects a first reference image and a second reference image from a reference image list 0 (RefPicList0) and a reference image list 1 (RefPicList1), respectively. The inter-frame predictor 124 also searches for a block most similar to the current block in the corresponding reference image to generate a first reference block and a second reference block. In addition, a prediction block of the current block is generated by averaging or weighted averaging the first reference block and the second reference block. In addition, motion information including information about two reference images used to predict the current block and including information about two motion vectors is transmitted to the entropy encoder 155. Here, the reference image list 0 may be composed of images that are before the current image in the display order in the pre-reconstructed image, and the reference image list 1 may be composed of images that are after the current image in the display order in the pre-reconstructed image. However, although not particularly limited thereto, the pre-reconstructed image that is after the current image in the display order may be additionally included in the reference image list 0. Conversely, a pre-reconstructed image preceding the current image may also be additionally included in the reference image list 1 .
[0057] In order to minimize the amount of bits consumed for encoding motion information, various methods may be used.
[0058] For example, when the reference image and motion vector of the current block are the same as those of the neighboring block, information capable of identifying the neighboring block is encoded to transmit the motion information of the current block to the video decoding device. This method is called merge mode.
[0059] In the merge mode, the inter predictor 124 selects a predetermined number of merge candidate blocks (hereinafter, referred to as 'merge candidates') from neighboring blocks of the current block.
[0060] As the neighboring blocks for deriving the merge candidate, all or some of the left block A0, the lower left block A1, the upper block B0, the upper right block B1 and the upper left block B2 adjacent to the current block in the current image may be used, such as Figure 4 As shown. In addition, in addition to the current image where the current block is located, a block located in a reference image (which may be the same as or different from the reference image used to predict the current block) may also be used as a merge candidate. For example, a co-located block of the current block in the reference image or a block adjacent to the co-located block may be additionally used as a merge candidate. If the number of merge candidates selected by the above method is less than the preset number, a zero vector is added to the merge candidate.
[0061] The inter-frame predictor 124 configures a merge list including a predetermined number of merge candidates by using adjacent blocks. A merge candidate to be used as motion information of the current block is selected from among the merge candidates included in the merge list, and merge index information for identifying the selected candidate is generated. The generated merge index information is encoded by the entropy encoder 155 and transmitted to the video decoding device.
[0062] Merge skip mode is a special case of merge mode. After quantization, when all transform coefficients for entropy coding are close to zero, only the neighbor block selection information is transmitted without the residual signal. By using merge skip mode, relatively high coding efficiency can be achieved for images with slight motion, still images, screen content images, etc.
[0063] Hereinafter, merge mode and merge skip mode are collectively referred to as merge / skip mode.
[0064] Another method for encoding motion information is the advanced motion vector prediction (AMVP) mode.
[0065] In the AMVP mode, the inter-frame predictor 124 derives a motion vector prediction candidate for a motion vector of a current block by using neighboring blocks of the current block. As neighboring blocks for deriving motion vector prediction candidates, the neighboring blocks may be used. Figure 4 All or some of the left block A0, lower left block A1, upper block B0, upper right block B1 and upper left block B2 adjacent to the current block in the current image shown. In addition, in addition to the current image where the current block is located, blocks located in a reference image (which may be the same as or different from the reference image used to predict the current block) may also be used as adjacent blocks for deriving motion vector prediction candidates. For example, a co-located block of the current block in the reference image or a block adjacent to the co-located block may be used. If the number of motion vector candidates selected by the above method is less than the preset number, a zero vector is added to the motion vector candidates.
[0066] The inter-frame predictor 124 derives a motion vector prediction candidate by using the motion vectors of the neighboring blocks, and determines a motion vector prediction of the motion vector of the current block by using the motion vector prediction candidate. In addition, a motion vector difference is calculated by subtracting the motion vector prediction from the motion vector of the current block.
[0067] The motion vector prediction can be obtained by applying a predefined function (e.g., median and mean calculations, etc.) to the motion vector prediction candidate. In this case, the video decoding device also knows the predefined function. In addition, since the neighboring blocks used to derive the motion vector prediction candidate are blocks that have completed encoding and decoding, the video decoding device may also already know the motion vectors of the neighboring blocks. Therefore, the video encoding device does not need to encode the information for identifying the motion vector prediction candidate. Accordingly, in this case, information about the motion vector difference and information about the reference image used to predict the current block are encoded.
[0068] On the other hand, the motion vector prediction can also be determined by selecting any one of the motion vector prediction candidates. In this case, information for identifying the selected motion vector prediction candidate is additionally encoded together with information about the motion vector difference used to predict the current block and information about the reference image.
[0069] The subtractor 130 generates a residual block by subtracting a prediction block generated by the intra predictor 122 or the inter predictor 124 from the current block.
[0070] The transformer 140 transforms the residual signal in the residual block having the pixel value of the spatial domain into the transform coefficient of the frequency domain. The transformer 140 may transform the residual signal in the residual block by using the entire size of the residual block as the transform unit, or may also divide the residual block into a plurality of sub-blocks, and may perform the transform by using the sub-block as the transform unit. Alternatively, the residual block is divided into two sub-blocks, namely, a transform region and a non-transform region, so as to transform the residual signal by using only the transform region sub-block as the transform unit. Here, the transform region sub-block may be one of two rectangular blocks having a size ratio of 1:1 based on the horizontal axis (or the vertical axis). In this case, the entropy encoder 155 encodes a flag (cu_sbt_flag) indicating that only the sub-block is transformed, and direction (vertical / horizontal) information (cu_sbt_horizontal_flag) and / or position information (cu_sbt_pos_flag), and notifies the video decoding device with a signal. In addition, the size of the transform region subblock may have a size ratio of 1:3 based on the horizontal axis (or vertical axis). In this case, a flag (cu_sbt_quad_flag) for dividing the corresponding partition is additionally encoded by the entropy encoder 155 and signaled to the video decoding apparatus.
[0071] On the other hand, the transformer 140 may perform transformation of the residual block separately in the horizontal direction and the vertical direction. For the transformation, various types of transformation functions or transformation matrices may be used. For example, paired transformation functions for horizontal transformation and vertical transformation may be defined as a multiple transform set (MTS). The transformer 140 may select a transformation function pair with the highest transformation efficiency in the MTS, and may transform the residual block in each of the horizontal and vertical directions. The information (mts_idx) about the transformation function pair in the MTS is encoded by the entropy encoder 155 and notified to the video decoding device with a signal.
[0072] The quantizer 145 quantizes the transform coefficients output from the transformer 140 using the quantization parameters and outputs the quantized transform coefficients to the entropy encoder 155. The quantizer 145 may also quantize the relevant residual block immediately without transforming any block or frame. The quantizer 145 may also apply different quantization coefficients (scaling values) according to the position of the transform coefficients in the transform block. The quantization matrix applied to the quantized transform coefficients arranged in two dimensions may be encoded and signaled to the video decoding device.
[0073] The rearrangement unit 150 may perform rearrangement of coefficient values on the quantized residual value.
[0074] The rearrangement unit 150 can change the 2D coefficient array into a 1D coefficient sequence by using coefficient scanning. For example, the rearrangement unit 150 can use a zig-zag scan or a diagonal scan to scan the DC coefficient to the coefficient of the high frequency region to output a 1D coefficient sequence. Depending on the size of the transform unit and the intra-frame prediction mode, the zig-zag scan can also be replaced by a vertical scan that scans the 2D coefficient array in the column direction and a horizontal scan that scans the 2D block type coefficient in the row direction. In other words, depending on the size of the transform unit and the intra-frame prediction mode, the scanning method to be used can be determined among zig-zag scanning, diagonal scanning, vertical scanning, and horizontal scanning.
[0075] The entropy encoder 155 encodes the sequence of 1D quantized transform coefficients output from the rearrangement unit 150 by using various encoding schemes including Context-based Adaptive Binary Arithmetic Code (CABAC), Exponential Golomb, etc. to generate a bitstream.
[0076] In addition, the entropy encoder 155 encodes information related to block segmentation (e.g., CTU size, CTU segmentation flag, QT segmentation flag, MTT segmentation type, and MTT segmentation direction, etc.) so that the video decoding device can segment the block equivalent to the video encoding device. In addition, the entropy encoder 155 encodes information about the prediction type indicating whether the current block is encoded by intra-frame prediction or inter-frame prediction. The entropy encoder 155 encodes intra-frame prediction information (i.e., information about intra-frame prediction mode) or inter-frame prediction information (merge index in the case of merge mode, and information about reference image index and motion vector difference in the case of AMVP mode) according to the prediction type. In addition, the entropy encoder 155 encodes information related to quantization (i.e., information about quantization parameters and information about quantization matrices).
[0077] The inverse quantizer 160 inversely quantizes the quantized transform coefficient output from the quantizer 145 to generate a transform coefficient. The inverse transformer 165 transforms the transform coefficient output from the inverse quantizer 160 from the frequency domain to the spatial domain to reconstruct a residual block.
[0078] The adder 170 adds the reconstructed residual block and the prediction block generated by the predictor 120 to reconstruct the current block. When intra-prediction is performed on the next block, the pixels in the reconstructed current block are used as reference pixels.
[0079] The loop filtering unit 180 performs filtering on the reconstructed pixels to reduce blocking artifacts, ringing artifacts, blurring artifacts, etc. that occur due to block-based prediction and transform / quantization. The loop filtering unit 180 as an in-loop filter may include all or some of a deblocking filter 182, a sample adaptive offset (SAO) filter 184, and an adaptive loop filter (ALF) 186.
[0080] The deblocking filter 182 filters the boundaries between the reconstructed blocks to remove blocking artifacts that occur due to block unit encoding / decoding, and the SAO filter 184 and the ALF 186 perform additional filtering on the deblocking filtered video. The SAO filter 184 and the ALF 186 are filters for compensating for the difference between the reconstructed pixels and the original pixels that occur due to lossy coding. The SAO filter 184 applies an offset in units of CTU to enhance subjective image quality and encoding efficiency. On the other hand, the ALF 186 performs block unit filtering and applies different filters to compensate for distortion by dividing the boundaries of the corresponding blocks and the degree of the amount of change. Information about the filter coefficients to be used for the ALF can be encoded and notified to the video decoding device with a signal.
[0081] The reconstructed blocks filtered by the deblocking filter 182, the SAO filter 184, and the ALF 186 are stored in the memory 190. When all blocks in one image are reconstructed, the reconstructed image can be used as a reference image for inter-frame prediction of blocks within an image to be subsequently encoded.
[0082] Figure 5 is a functional block diagram of a video decoding device that can implement the technology of the present invention. Figure 5 , describes a video decoding device and components of the device.
[0083] The video decoding apparatus may include an entropy decoder 510 , a rearrangement unit 515 , an inverse quantizer 520 , an inverse transformer 530 , a predictor 540 , an adder 550 , a loop filtering unit 560 , and a memory 570 .
[0084] Similar to Figure 1 Each component of the video encoding device and the video decoding device can be implemented as hardware or software, or as a combination of hardware and software. In addition, the function of each component can be implemented as software, and the microprocessor can also be implemented to execute the function of the software corresponding to each component.
[0085] The entropy decoder 510 extracts information related to block partitioning by decoding a bitstream generated by a video encoding apparatus to determine a current block to be decoded, and extracts prediction information required to reconstruct the current block and information about a residual signal.
[0086] The entropy decoder 510 determines the size of the CTU by extracting information about the CTU size from a sequence parameter set (SPS) or a picture parameter set (PPS), and divides the image into CTUs of the determined size. In addition, the CTU is determined as the highest level (i.e., the root node) of the tree structure, and the partition information of the CTU is extracted to partition the CTU by using the tree structure.
[0087] For example, when CTU is segmented by using the QTBTTT structure, the first flag (QT_split_flag) related to the segmentation of QT is first extracted to segment each node into four nodes of the lower layer. In addition, the second flag (mtt_split_flag) related to the segmentation of MTT, the segmentation direction (vertical / horizontal) and / or the segmentation type (binary / tripartite) are extracted with respect to the node corresponding to the leaf node of QT to segment the corresponding leaf node into the MTT structure. As a result, each node below the leaf node of QT is recursively segmented into a BT or TT structure.
[0088] As another example, when a CTU is split by using a QTBTTT structure, a CU split flag (split_cu_flag) indicating whether the CU is split is extracted. When the corresponding block is split, a first flag (QT_split_flag) may also be extracted. During the splitting process, for each node, 0 or more recursive MTT splits may occur after 0 or more recursive QT splits. For example, for a CTU, MTT splits may occur immediately, or, conversely, multiple QT splits may occur only.
[0089] As another example, when CTU is segmented by using the QTBT structure, the first flag (QT_split_flag) related to the segmentation of the QT is extracted to segment each node into four nodes of the lower layer. In addition, the segmentation flag (split_flag) indicating whether the node corresponding to the leaf node of the QT is further segmented into BT and the segmentation direction information are extracted.
[0090] On the other hand, when the entropy decoder 510 determines the current block to be decoded by using the partitioning of the tree structure, the entropy decoder 510 extracts information about the prediction type indicating whether the current block is intra-predicted or inter-predicted. When the prediction type information indicates intra-prediction, the entropy decoder 510 extracts syntax elements of intra-prediction information (intra-prediction mode) for the current block. When the prediction type information indicates inter-prediction, the entropy decoder 510 extracts information representing syntax elements of inter-prediction information, that is, a motion vector and a reference image to which the motion vector refers.
[0091] In addition, the entropy decoder 510 extracts quantization-related information and extracts information on a quantized transform coefficient of the current block as information on a residual signal.
[0092] The rearrangement unit 515 may change the sequence of 1D quantized transform coefficients entropy-decoded by the entropy decoder 510 into a 2D coefficient array (ie, block) again in the reverse order of the coefficient scanning order performed by the video encoding device.
[0093] The inverse quantizer 520 inversely quantizes the quantized transform coefficients, and inversely quantizes the quantized transform coefficients by using quantization parameters. The inverse quantizer 520 may also apply different quantization coefficients (scaling values) to the quantized transform coefficients arranged in 2D. The inverse quantizer 520 may perform inverse quantization by applying a matrix of quantization coefficients (scaling values) from a video encoding device to a 2D array of quantized transform coefficients.
[0094] The inverse transformer 530 reconstructs a residual signal by inversely transforming the inversely quantized transform coefficient from the frequency domain to the spatial domain to generate a residual block of the current block.
[0095] In addition, when the inverse transformer 530 inversely transforms a partial region (sub-block) of the transform block, the inverse transformer 530 extracts a flag (cu_sbt_flag) that only the sub-block of the transform block is transformed, direction (vertical / horizontal) information (cu_sbt_horizontal_flag) of the sub-block, and / or position information (cu_sbt_pos_flag) of the sub-block. The inverse transformer 530 also inversely transforms the transform coefficient of the corresponding sub-block from the frequency domain to the spatial domain to reconstruct the residual signal, and fills the region that is not inversely transformed with a value of "0" as the residual signal to generate a final residual block of the current block.
[0096] In addition, when MTS is applied, the inverse transformer 530 determines the transform index or transform matrix to be applied in each of the horizontal and vertical directions by using the MTS information (mts_idx) signaled from the video encoding device. The inverse transformer 530 also performs inverse transform on the transform coefficients in the transform block in the horizontal and vertical directions by using the determined transform function.
[0097] The predictor 540 may include an intra predictor 542 and an inter predictor 544. The intra predictor 542 is activated when the prediction type of the current block is intra prediction, and the inter predictor 544 is activated when the prediction type of the current block is inter prediction.
[0098] The intra predictor 542 determines an intra prediction mode of a current block among a plurality of intra prediction modes according to syntax elements of the intra prediction mode extracted from the entropy decoder 510. The intra predictor 542 also predicts the current block by using neighboring reference pixels of the current block according to the intra prediction mode.
[0099] The inter predictor 544 determines a motion vector of a current block and a reference image to which the motion vector refers by using a syntax element of the inter prediction mode extracted from the entropy decoder 510 .
[0100] The adder 550 reconstructs the current block by adding the residual block output from the inverse transformer 530 and the prediction block output from the inter predictor 544 or the intra predictor 542. When intra-predicting a subsequent block to be decoded, pixels within the reconstructed current block are used as reference pixels.
[0101] The loop filtering unit 560 as an in-loop filter may include a deblocking filter 562, an SAO filter 564, and an ALF 566. The deblocking filter 562 performs deblocking filtering on the boundary between the reconstructed blocks in order to remove block artifacts that occur due to block unit decoding. The SAO filter 564 and the ALF 566 perform additional filtering on the reconstructed blocks after deblocking filtering in order to compensate for the difference between the reconstructed pixels and the original pixels that occurs due to lossy encoding. The filter coefficients of the ALF are determined by using information about the filter coefficients decoded from the bitstream.
[0102] The reconstructed blocks filtered by the deblocking filter 562, the SAO filter 564, and the ALF 566 are stored in the memory 570. When all blocks in one image are reconstructed, the reconstructed image can be used as a reference image for inter-frame prediction of blocks within an image to be subsequently encoded.
[0103] In some embodiments, the present invention relates to encoding and decoding video images as described above. More specifically, the present invention provides a video encoding and decoding method and apparatus, which performs at least one of adding, pruning and reordering candidates on a motion vector list at a decoder side based on a merge mode of inter-frame prediction and template matching or bilateral matching in an advanced motion vector prediction (AMVP) mode.
[0104] The following embodiments may be performed by the inter-frame predictor 124 in the video encoding apparatus. The following embodiments may also be performed by the inter-frame predictor 544 in the video decoding apparatus.
[0105] When encoding the current block, the video encoding device can generate signaling information associated with the present embodiment from the perspective of optimizing rate distortion. The video encoding device can encode the signaling information using the entropy encoder 155, and can send the encoded signaling information to the video decoding device. The video decoding device can decode the signaling information associated with decoding the current block from the bitstream using the entropy decoder 510.
[0106] In the following description, the term "target block" may be used interchangeably with a current block or a coding unit (CU). The term "target block" may refer to some areas of a coding unit.
[0107] In addition, a flag value of true indicates a case where the flag is set to 1. In addition, a flag value of false indicates a case where the flag is set to 0.
[0108] I. Intra Block Copy (IBC)
[0109] IBC performs intra prediction of a current block by copying a reference block in the same frame using a block vector to generate a prediction block for the current block.
[0110] The video encoding device performs block matching to derive the best block vector. Here, the block vector represents the displacement from the current block to the reference block. In order to improve the coding efficiency, the video encoding device can split the block vector into a block vector predictor (BVP) and a block vector difference (BVD), encode the BVP and BVD, and then send the BVP and BVD to the video decoding device instead of sending the entire block vector.
[0111] In the following, the spatial resolution of the BVD and the spatial resolution of the block vector are considered to be the same.
[0112] From the perspective of utilizing block vectors, IBC has inter-frame prediction characteristics. Therefore, IBC can be classified into IBC merge / skip mode and IBC AMVP mode.
[0113] In IBC merge / skip mode, the video encoding device first combines the IBC merge list. From the perspective of optimizing codec efficiency, the video encoding device can select a block vector from one of the candidates included in the IBC merge list, and the selected block vector can be used as a block vector predictor (BVP). The video encoding device determines a merge index indicating the selected block vector. However, the video encoding device does not generate a BVD. The video encoding device encodes the merge index and sends the merge index to the video decoding device. The IBC merge list can be combined in the same manner by the video encoding device and the video decoding device. The video decoding device can decode the merge index, and then use the merge index to generate a block vector from the IBC merge list.
[0114] In case of the IBC skip mode, the video encoding apparatus uses the same block vector transmission method as the IBC merge mode, but does not transmit a residual block corresponding to a difference between a current block and a predicted block.
[0115] When in IBC AMVP mode, the video encoding device determines the motion vector and combines the IBC AMVP list to optimize the coding efficiency. The video decoding device determines to include one of the candidate block vectors in the IBC AMVP list as a candidate index of the BVP. The video encoding device calculates the BVD, which is the difference between the BVP and the motion vector. The video encoding device then encodes the candidate index and the BVD, and sends the candidate index and the BVD to the video decoding device.
[0116] On the other hand, the video decoding apparatus decodes the candidate index and the BVD. The video decoding apparatus may obtain the BVP indicated by the candidate index from the IBC AMVP list, and may then reconstruct the motion vector by summing the BVP and the BVD.
[0117] The following inter-frame prediction techniques are used to improve coding efficiency and improve the accuracy of inter-frame prediction. These techniques are performed by the inter-frame predictor 124 in the video encoding device, but can also be performed by the inter-frame predictor 544 in the video decoding device, as described above.
[0118] II-1. Merge / Skip Mode, MMVD, AMVP Mode, and AMVR
[0119] The merge / skip modes include a normal merge mode, a merge mode with motion vector difference (MMVD) mode, a combined inter and intra prediction (CIIP) mode, a geometric partitioning mode (GPM) and a sub-block merge mode. Here, the sub-block merge mode is divided into a sub-block-based temporal motion vector prediction (SbTMVP) mode and an affine merge mode.
[0120] On the other hand, the advanced motion vector prediction (AMVP) mode includes a normal AMVP mode, a symmetric MVD (SMVD) mode, and an affine AMVP mode.
[0121] The method of combining a merge candidate list of motion information in a normal merge / skip mode is described below. To support the merge / skip mode, the inter predictor 124 in the video encoding apparatus may select a preset number (eg, 6) of merge candidates to combine the merge candidate list.
[0122] The inter-frame predictor 124 searches for spatial merging candidates. The inter-frame predictor 124 searches for spatial merging candidates from neighboring blocks, such as Figure 4 As shown. Up to four spatial merge candidates can be selected. The spatial merge candidate is also called spatial motion vector prediction (SMVP).
[0123] The inter-frame predictor 124 searches for temporal merge candidates. The inter-frame predictor 124 may add a block that is co-located with the current block in a reference image other than the current image holding the target block (which may be the same as or different from the reference image used to predict the current block) as a temporal merge candidate. One temporal merge candidate may be selected. The temporal merge candidate is also called temporal motion vector prediction (TMVP).
[0124] The inter-frame predictor 124 searches for history-based motion vector predictor (HMVP) candidates. The inter-frame predictor 124 can store the motion vectors of the previous h (where h is a natural number) CUs in a table for future use as merge candidates. The size of the table is 6, and the motion vectors of the previous CUs are stored in a first-in-first-out (FIFO) manner. This means that a maximum of six HMVP candidates are stored in the table. The inter-frame predictor 124 can set the latest motion vector among the HMVP candidates stored in the table as a merge candidate.
[0125] The inter predictor 124 searches for a pairwise average motion vector prediction (PAMVP) candidate and may set an average of motion vectors of a first candidate and a second candidate in the merge candidate list as a merge candidate.
[0126] If, after all the above searches, the merge candidate list is not filled, ie, is not filled with a preset number of candidates, the inter predictor 124 adds a zero motion vector as a merge candidate.
[0127] From the perspective of optimizing coding efficiency, the inter-frame predictor 124 may determine a merge index indicating one of the candidates in the merge candidate list. The inter-frame predictor 124 may use the merge index to derive a motion vector predictor (MVP) from the merge candidate list, and then may determine the MVP as the motion vector of the current block. In addition, the video encoding device may send the merge index to the video decoding device using a signal.
[0128] In the skip mode, the video encoding apparatus uses the same method of transmitting a motion vector as in the merge mode, but does not transmit a residual block corresponding to a difference between a current block and a predicted block.
[0129] The above method of combining the merge candidate list can be equivalently performed by the inter-frame predictor 544 in the video decoding device. The video decoding device can decode the merge index. The inter-frame predictor 544 can use the merge index to derive the MVP from the merge candidate list, and then can determine the MVP as the motion vector of the current block.
[0130] When using the MMVD technique, the inter-frame predictor 124 may use a merge index to derive an MVP from a merge candidate list. For example, the first or second candidate in the merge candidate list may be used as the MVP. In addition, from the perspective of optimizing encoding and decoding efficiency, the inter-frame predictor 124 determines a distance index and a direction index. The inter-frame predictor 124 may use the distance index and the direction index to derive a motion vector difference (MVD), and then may sum the MVD and the MVP to reconstruct the motion vector of the current block. In addition, the video encoding device may send the merge index, the distance index, and the direction index to the video decoding device using a signal.
[0131] The above-mentioned MMVD technology can be equivalently performed by the inter-frame predictor 544 in the video decoding device. The video decoding device can decode the merge index, the distance index and the direction index. After combining the merge candidate list, the inter-frame predictor 544 can use the merge index to derive the MVP from the merge candidate list. When deriving the MVD by using the distance index and the direction index, the inter-frame predictor 544 can sum the MVD and the MVP to reconstruct the motion vector of the current block.
[0132] The method of combining motion information candidate lists in the AMVP mode of inter prediction is described below. To support the AMVP mode, the inter predictor 124 in the video encoding apparatus may select a preset number (eg, two) of candidates to form a candidate list.
[0133] The inter-frame predictor 124 searches for spatial candidates. The inter-frame predictor 124 searches for spatial candidates from neighboring blocks, such as Figure 4 As shown. At most two spatial candidates can be selected.
[0134] The inter-frame predictor 124 searches for temporal candidates. In addition to maintaining the current image of the target block, the video encoding apparatus may add a block co-located with the current block in a reference image (which may be the same as or different from the reference image used to predict the current block) as a temporal candidate. One temporal candidate may be selected.
[0135] If the candidate list is not filled, ie, is not filled with a preset number of candidates after performing all of the above searches, the inter predictor 124 adds a zero motion vector as a candidate.
[0136] From the perspective of optimizing codec efficiency, the inter-frame predictor 124 may determine a candidate index indicating one of the candidates in the candidate list. The inter-frame predictor 124 may use the candidate index to derive the MVP from the candidate list. In addition, from the perspective of optimizing codec efficiency, the inter-frame predictor 124 determines a motion vector and then subtracts the MVP from the motion vector to calculate the MVD. The video encoding device may send the candidate index and the MVD to the video decoding device in a signal.
[0137] The above method of combining the AMVP candidate list can be equivalently performed by the inter-frame predictor 544 in the video decoding device. The video decoding device can decode the candidate index and the MVD. The inter-frame predictor 544 can use the candidate index to derive the MVP from the candidate list. The inter-frame predictor 544 can sum the MVD and the MVP to reconstruct the motion vector of the current block.
[0138] On the other hand, the video encoding device transmits information determining the spatial resolution of the MVD and the MVD. When using the AMVR technology, the video encoding device can determine the adaptive spatial resolution of the MVD from the perspective of optimizing the bit rate distortion. In this case, the spatial resolution of the MVD and the spatial resolution of the motion vector can be the same.
[0139] When using AMVR technology, the video encoding device signals amvr_flag and amvr_precision_idx to the video decoding device to indicate the spatial resolution of the MVD. For example, if amvr_flag is signaled as 0, the video decoding device sets the MVD to 1 / 4 pixel spatial resolution. However, if amvr_flag is not zero, the video decoding device can determine the spatial resolution of the MVD based on amvr_precision_idx. In this case, the spatial resolution of the selectable MVD can vary based on the prediction method applied by AMVR. The prediction method applied by AMVR is conventional AMVP mode, affine AMVP mode, IBC AMVP mode, etc.
[0140] II-2. Affine Merge Mode and Affine AMVP Mode
[0141] Inter-frame prediction is motion prediction that reflects a translational motion model. Inter-frame motion prediction is a technique for predicting motion in the horizontal or x-axis direction and the vertical or y-axis direction. However, in reality, there may be various forms of motion, such as rotation, enlargement, or reduction in addition to translational motion. Affine motion prediction can reflect these different types of motion.
[0142] Figure 6a and Figure 6b is a schematic diagram illustrating affine motion prediction according to at least one embodiment of the present invention.
[0143] There are two types of affine motion prediction models. Type one is an affine motion prediction model that uses four parameters, namely, two control point motion vectors (CPMVs) at the upper left and upper right corners of the target block to be encoded, such as Figure 6a Another affine motion prediction model uses the three control point motion vectors of the upper left corner, upper right corner and lower left corner of the target block, that is, six parameters, such as Figure 6b shown.
[0144] The four-parameter affine model is expressed as shown in Equation 1. The motion at the sample position (x, y) in the target block can be calculated as shown in Equation 1. Here, it is assumed that the position of the upper left sample of the target block is (0, 0).
[0145] [Equation 1]
[0146]
[0147] Furthermore, the six-parameter affine model is expressed as shown in Equation 2. The motion at the sample position (x, y) within the target block can be calculated as shown in Equation 2.
[0148] [Equation 2]
[0149]
[0150] Among them, (mv 0x , mv 0y ) is the motion vector of the upper left control point, (mv 1x , mv 1y ) is the motion vector of the upper right control point, and (mv 2x , mv 2y ) is the lower left control point motion vector. Also, W is the horizontal length of the target block, and H is the vertical length of the target block.
[0151] Affine motion prediction may be performed using a motion vector calculated for each sample in the target block according to Equation 1 or Equation 2. Alternatively, to reduce computational complexity, affine motion prediction calculation may be performed on a per-subblock basis, for example, by dividing the target block into subblocks of size 4×4.
[0152] Motion vector (mv x , mv y) can be set to have 1 / 16 sample accuracy. In this case, the motion vector (mv) calculated according to Equation 1 or Equation 2 is x , mv y ) can be rounded to the nearest 1 / 16 sample.
[0153] The video encoding device performs intra prediction, inter prediction (translational motion prediction), affine motion prediction, etc., and selects the best prediction method by calculating the rate-distortion (RD) cost. In order to perform affine motion prediction, the inter predictor 124 of the video encoding device determines which type of affine motion prediction model to use of the two types of affine motion prediction models, and determines two or three control points according to the determined affine motion prediction model type. Using the control point motion vector, the inter predictor 124 calculates a motion vector (mv) for each subblock in the target block. x , mv y Then, the motion vector (mv x , mv y ) is used to perform motion compensation within a reference image on a per-subblock basis to generate a prediction block for each sub-block within a target block.
[0154] The video encoding device encodes and transmits to the video decoding device an affine-related syntax element, the syntax element including a flag indicating whether to apply affine motion prediction to a target block, type information indicating a type of an affine model, and motion information indicating a motion vector of each control point. When performing affine motion prediction, the type information and motion information of the control point may be signaled, and the motion vectors of as many control points as the number determined according to the type information may be signaled.
[0155] The video decoding apparatus determines the type of the affine model and the control point motion vector by using the syntax sent by the signal, and calculates the motion vector (mv) for each 4×4 sub-block in the target block by using Equation 1 or Equation 2. x , mv y If motion vector resolution information about the affine motion vector of the target block is signaled, the motion vector (mv) is modified by utilizing an operation such as rounding to the precision identified by the motion vector resolution information. x , mv y ).
[0156] The video decoding apparatus uses the motion vector (mv) for each sub-block. x , mv y ) performs motion compensation within a reference picture to generate a prediction block for each sub-block.
[0157] To reduce the amount of bits required to encode the control point motion vectors, conventional inter-frame prediction or translational motion vectors as described above may be applied.
[0158] As an example, in the case of the affine merge mode, the inter-frame predictor 124 of the video encoding device combines an affine merge candidate list including a predetermined number (e.g., 5) of affine merge candidates. First, the inter-frame predictor 124 of the video encoding device derives inherited affine merge candidates from neighboring blocks of the target block. For example, by Figure 4 The neighboring samples A0, A1, B0, B1 and B2 of the target block shown in the figure derive a predetermined number of inherited affine merge candidates and generate a merge candidate list. Each of the inherited affine merge candidates in the candidate list corresponds to a combination of two or three CPMVs.
[0159] The inter-frame predictor 124 derives affine merge candidates inherited from the control point motion vectors of the neighboring blocks of the target block predicted in affine mode. In some embodiments, the number of merge candidates derived from the neighboring blocks predicted in affine mode may be limited. For example, the inter-frame predictor 124 may derive two inherited affine merge candidates from the neighboring blocks predicted in affine mode, one of A0 or A1, and one of B0, B1, or B2. The priority may be in the order of A0, A1, then B0, B1, and B2.
[0160] On the other hand, if the total number of merging candidates is greater than three, the inter predictor 124 may derive an affine merging candidate constructed from the insufficient number of merging candidates from the translation motion vectors of the neighboring blocks.
[0161] Figure 7 A method of deriving constructed affine merging candidates for affine motion prediction is shown.
[0162] The inter-frame predictor 124 derives a control point motion vector CPMV1, CPMV2 or CPMV3 from each of the adjacent block groups {B2, B3, A2}, the adjacent block group {B1, B0} and the adjacent block group {A1, A0}. As an example, the priority order within each adjacent block group can be the order of B2, B3, A2, the order of B1, B0 and the order of A1, A0. In addition, another control point motion vector CPMV4 is derived from the co-located block T in the reference image. The inter-frame predictor 124 combines two or three of the four control point motion vectors to generate an affine merge candidate constructed from an insufficient number. The constructed priority is as follows. The elements within each group are listed in the order of the upper left corner, the upper right corner and the lower left corner of the control point motion vector.
[0163] {CPMV1, CPMV2, CPMV3}, {CPMV1, CPMV2, CPMV4}, {CPMV1, CPMV3, CPMV4},
[0164] {CPMV2, CPMV3, CPMV4}, {CPMV1, CPMV2}, {CPMV1, CPMV3}
[0165] If the merge candidate list cannot be filled with the inherited affine merge candidates and the constructed affine merge candidates, the inter predictor 124 may add a zero motion vector as a candidate.
[0166] The inter-frame predictor 124 selects a merge candidate from the merge candidate list from the perspective of optimizing encoding and decoding efficiency, and determines a merge index indicating the merge candidate. The inter-frame predictor 124 performs affine motion prediction on the target block by using the selected merge candidate. If the merge candidate consists of two control point motion vectors, affine motion prediction is performed by using a four-parameter affine model. On the other hand, if the merge candidate consists of three control point motion vectors, affine motion prediction is performed by using a six-parameter affine model. The video encoding device encodes the merge index and sends the merge index to the video decoding device with a signal.
[0167] The video decoding device decodes the merge index. The inter predictor 544 of the video decoding device combines the merge candidate list in the same manner as the video encoding device, and performs affine motion prediction by using a control point motion vector corresponding to the merge candidate indicated by the merge index.
[0168] As another example, in the affine AMVP mode, from the perspective of optimizing encoding and decoding efficiency, the inter-frame predictor 124 of the video encoding device determines the type of affine model for the target block and the corresponding actual control point motion vector. For each control point, the inter-frame predictor 124 of the video encoding device calculates the MVD and encodes the MVD of each control point, wherein the MVD is the difference between the actual control point motion vector and the MVP of each control point. In order to derive the MVP of each control point, the inter-frame predictor 124 combines an affine AMVP candidate list including a predetermined number (e.g., two) of affine AMVP candidates. If the target block is a 4-parameter type, the candidates included in the list are each composed of a pair of two control point motion vectors. On the other hand, if the target block is a 6-parameter type, the candidates included in the list are each composed of a pair of three control point motion vectors.
[0169] use Figure 8 The following describes a method for combining candidate lists in affine AMVP mode. The affine AMVP candidate list can be derived similarly to the method for combining the affine merged candidate list described above.
[0170] Figure 8 is a flowchart of a process for searching for affine AMVP candidates in affine AMVP mode according to at least one embodiment of the present invention.
[0171] The inter-frame predictor 124 checks whether the reference image of the inherited affine AMVP candidate is the same as the reference image of the current block (S800). Here, the inherited affine AMVP candidate may be a reference image of the current block. Figure 4 The blocks predicted in affine mode among the neighboring blocks A0, A1, B0, B1, B2 of the target block shown in , as in the above-mentioned affine merge mode.
[0172] If the reference image of the inherited affine AMVP candidate is the same as the reference image of the current block (Yes in S800 ), the inter predictor 124 adds the corresponding inherited affine AMVP candidate ( S802 ).
[0173] If the reference image of the inherited affine AMVP candidate is not the same as the reference image of the current block (No in S800), the inter-frame predictor 124 verifies whether the reference images of all CPMVs of the constructed affine AMVP candidate are the same as the reference image of the current block (S804). Figure 7 All CPMVs of the constructed affine AMVP candidates are derived from the motion vectors of the neighboring samples shown in , as in the above-mentioned affine merge mode.
[0174] If the reference images of all CPMVs of the constructed affine AMVP candidates are the same as the reference image of the current block (Yes in S804 ), the inter predictor 124 adds the corresponding constructed affine AMVP candidates ( S806 ).
[0175] At this time, the affine model type of the target block needs to be considered. If the affine model type of the target block is a 4-parameter type, the video encoding device uses the affine model of the adjacent block to derive two control point motion vectors of the upper left corner and upper right corner control point motion vectors of the target block. If the affine model type of the target block is a 6-parameter type, the affine model of the adjacent block is used to derive three control point motion vectors of the upper left corner, upper right corner and lower left corner control point motion vectors of the target block.
[0176] If the reference images of all CPMVs are not the same as the reference image of the current block (No in S804), the inter-frame predictor 124 adds the translation motion vector as an affine AMVP candidate (S808). 0 、mv 1 and mv 2 The translational motion vector is used in the order of to predict the CPMV of the current block.
[0177] If the candidate list is not filled, ie, filled with a preset number of candidates, after performing all of the above steps ( S800 to S808 ), the inter predictor 124 adds a zero motion vector as an affine AMVP candidate ( S810 ).
[0178] The inter-frame predictor 124 selects a candidate from the affine AMVP list and determines a candidate index indicating the selected candidate. Here, each control point motion vector of the selected candidate corresponds to the MVP of each control point. From the perspective of optimizing encoding and decoding efficiency, the inter-frame predictor 124 determines the actual control point motion vector for each control point of the target block, and then calculates the MVD between the actual control point motion vector and the MVP of the control point. The video encoding device encodes the affine model type of the target block, the candidate index, and the MVD of each control point, and sends it to the video decoding device with a signal.
[0179] The video decoding device decodes the affine model type, candidate index and MVD of each control point. The inter-frame predictor 544 of the video decoding device generates an affine AMVP list in the same manner as the video encoding device, and selects a candidate indicated by the candidate index from the affine AMVP list. The inter-frame predictor 544 of the video decoding device reconstructs the motion vector of each control point by summing the MVP of each control point of the selected candidate and its corresponding MVD. The inter-frame predictor 544 performs affine motion prediction by using the reconstructed control point motion vector.
[0180] II-3. Geometric Partitioning Model (GPM)
[0181] Fig. 9 is a schematic diagram showing triangle partitioning types supported in geometric partitioning mode according to at least one embodiment of the present invention.
[0182] In GPM, the inter-frame predictor 124 performs inter-frame prediction based on the triangle blocks obtained by partitioning the current block. GPM supports two triangle partition types, such as Fig. 9 In each triangle partition type, for two triangle regions, the inter-frame predictor 124 performs inter-frame prediction by using different motion information (ie, motion vectors).
[0183] The inter-frame predictor 124 generates a final predicted signal by weighted summing of the predicted signals from each region to minimize discontinuities at the boundaries between the partitioned regions. The weights used to generate the final predicted signal may be in Fig.10 In Fig.10 In, P 1 is the predictor of the current block based on the motion information of the upper right triangle block, and P 2 is the predictor of the current block based on the motion information of the lower left triangle block.
[0184] Fig.11 is a schematic diagram illustrating a GPM candidate list according to at least one embodiment of the present invention.
[0185] When combining GPM candidate lists, the motion information of each partition region is derived from the regular merge candidate list, such as Fig.11 If the index of the merge candidate list is an even number, the motion information in the first reference list L0 is selected, and if the index is an odd number, the motion information in the second reference list L1 is selected.
[0186] II-4. Template Matching
[0187] Fig.12 is a schematic diagram illustrating template matching in intra prediction according to at least one embodiment of the present invention.
[0188] In the template matching (TM) mode, the intra-frame predictor 122 in the video encoding apparatus searches for the best reference block by using a template in a reconstructed region of the current frame, and applies the best reference block as a prediction block, such as Fig.12 As shown in . The matching degree between the L-shaped template and the current template is calculated to search for the template most similar to the current template, and the block corresponding to the similar template can be used as the prediction block. The search range of the template can be preset, and the prediction of the current block is performed based on the preset search range.
[0189] On the other hand, the technique of adaptive reordering of merge candidates (ARMC) with template matching adaptively reorders the merge candidates of inter prediction based on the above template matching. The reordering scheme of merge candidates can be applied to the normal merge mode, template matching merge mode or affine merge mode, except for SbTMVP candidates.
[0190] For example, in the template matching merge mode, the inter-frame predictor 124 in the video encoding device may combine the merge candidate list, partition the merge candidates into subgroups of size 5, and for each subgroup, reorder the merge candidates in ascending order (i.e., in order of increasing cost according to the template matching cost or TM cost). The TM cost may be defined by the sum of absolute differences (SAD) or the sum of squared differences (SSE) between the template samples of the current block and the corresponding reference samples.
[0191] On the other hand, if the merge candidate uses bidirectional prediction, the inter-frame predictor 124 may derive reference samples of the merge candidate template based on the bidirectional prediction, such as Fig.13 shown.
[0192] II-5. DMVR and multi-path decoder-side motion vector refinement
[0193] Decoder-side Motion Vector Refinement (DMVR) is a method to refine the motion vectors on the decoder side by fine-tuning the motion vectors (MV0 and MV1) in bidirectional prediction using bilateral matching (BM) techniques. In the following, the motion vectors in bidirectional prediction are used compatibly with the motion vector pairs.
[0194] In bidirectional prediction, the video encoding device searches for a refined motion vector around an initial motion vector generated from reference images in reference list L0 and reference list L1. Here, the initial motion vector is two motion vectors MV0 and MV1 of bidirectional prediction. In BM technology, a BM cost is calculated, which is the distortion between two candidate blocks in the reference images of L0 and L1. As the BM cost, the SAD or SSE between the two candidate blocks can be calculated. The video encoding device generates a candidate motion vector with the minimum BM cost as a refined motion vector, as shown in Equation 3.
[0195] [Equation 3]
[0196] MV0'=MV0+MVoffset
[0197] MV1'=MV1-MVoffset
[0198] Here, MV_offset is the difference between the candidate motion vector and the initial motion vector, which is an offset applied to the initial motion vector as the motion vector refinement progresses. The offset can be formed as the sum of an integer offset in integer sample units and a sub-pixel offset in sub-pixel or sub-pixel sample units. As shown in Equation 3, the offsets of the two motion vector candidates follow the mirror rule.
[0199] Multi-pass decoder-side motion vector refinement is a method of refining motion vectors in multiple channels at the decoder side by using BM technology. Hereinafter, multi-pass decoder-side motion vector refinement using BM technology is referred to as multi-pass bilateral matching (MBM).
[0200] The video encoding device searches for motion vectors in units of CUs in the first channel of multiple channels of MBM, and searches for motion vectors for each 16×16 sub-block within the CU in the second channel. In the third channel, the video encoding device applies Bi-directional Optical Flow (BDOF) to search for motion vectors for each 8×8 sub-block. The refined motion vectors generated by the search are stored for prediction of spatial and temporal motion vectors. Here, BDOF is a technique for further compensating the motion of the predicted samples by utilizing bidirectional motion prediction based on the assumption that the samples or objects forming the video move at a constant speed and that there is little change in the sample values.
[0201] The multi-channel decoder side motion vector refinement specifically performs the following steps.
[0202] In the first pass, the video encoding apparatus uses the motion vectors (MV0 and MV1) in bidirectional prediction generated from the reference images in the reference lists L0 and L1 as initial values to generate refined motion vectors (MV0_pass1 and MV1_pass1) around the motion vectors (MV0 and MV1). The refined motion vectors may be generated based on the minimum BM cost of the two reference lists L0 and L1, as shown in Equation 4.
[0203] [Equation 4]
[0204] MV0_pass1=MV0+deltaMV
[0205] MV1_pass1=MV1-deltaMV
[0206] Here, the deltaMV may be searched according to a 3×3 square search pattern around the initial MV with an accuracy of integer samples around the initial value.
[0207] In the second pass, the video encoding apparatus applies BM to 16×16 sub-blocks. For each sub-block, the video encoding apparatus generates MV0_pass2 and MV1_pass2 by refining the motion vectors around MV0_pass1 and MV1_pass1 obtained from the reference lists L0 and L1 in the first pass. At this time, the motion vector is searched with integer sample accuracy. Then, the video encoding apparatus generates deltaMV(sbIdx2) as shown in Equation 5 by utilizing the sub-sample refinement process according to the DMVR technology.
[0208] [Equation 5]
[0209] MV0_pass2(sbIdx2)=MV0_pass1+deltaMV(sbIdx2)
[0210] MV1_pass2(sbIdx2)=MV1_pass1-deltaMV(sbIdx2)
[0211] Here, sbIdx2 represents the index of the 16×16 sub-block.
[0212] In the third pass, the video encoding device applies BDOF to the 8×8 sub-block to derive the final motion vector. For each 8×8 sub-block, the video encoding device applies BDOF to the motion vector obtained in the second pass. The final motion vectors MV0_pass3 and MV1_pass3 generated in the third pass are represented as shown in Equation 6.
[0213] [Equation 6]
[0214] MV0_pass3(sbIdx3)=MV0_pass2(sbIdx2)+bioMv
[0215] MV1_pass3(sbIdx3)=MV0_pass2(sbIdx2)-bioMv
[0216] Here, sbIdx3 represents the index of the 8×8 sub-block, and bioMV represents the correction value due to application of BDOF.
[0217] For each channel, the MBM cost represents the cost of block matching between two blocks indicated by the searched motion vector. In addition, deltaMV, deltaMV(sbIdx2), and bioMV are collectively referred to as the refinement value or "refinement value" of the refined motion vector. In addition, for the initial motion vector of the first channel, the refinement value may represent the sum of all or part of deltaMV, deltaMV(sbIdx2), and bioMV.
[0218] II-6. Bilateral Matching AMVP-MERGE Mode
[0219] Fig.14 is a schematic diagram illustrating a bilateral matching AMVP-MERGE mode according to at least one embodiment of the present invention.
[0220] In the bilateral matching AMVP-MERGE mode (BM AMVP-MERGE mode), when the unidirectional AMVP mode is selected for the reference image in the LX (X=0 or 1) direction, the video encoding apparatus refines the motion vector of the merge candidate for the reference image in the opposite direction that is equidistant from the reference image in time. For the refinement, the bilateral matching technique is used.
[0221] For motion vector refinement based on bilateral matching, the video encoding device generates a refined motion vector by applying multi-channel decoder-side motion vector refinement using the AMVP vector in the LX direction and the merge candidate motion vector in the L1-X direction as initial values. At this time, the AMVP motion vector may be changed to the same extent as the refined merge candidate motion vector. For example, if the AMVP motion vector refinement value is MVD0, the merge candidate motion vector refinement value MVD1 may be -MVD0.
[0222] III. Adding, pruning, and reordering candidates in the motion vector list
[0223] Hereinafter, the embodiments of the present invention are described centering around a video encoding apparatus, but the embodiments of the present invention can also be applied to a video decoding apparatus.
[0224] Hereinafter, a motion vector list includes candidates. In Examples 1 and 3, each candidate may be a pair of motion vectors MV0 and MV1 in bidirectional prediction, i.e., a motion vector pair. In Example 2, each candidate may include a motion vector pair as motion information or a motion vector from unidirectional prediction.
[0225] <Example 1> Method for modifying the merge candidate list and the AMVP candidate list using MBM
[0226] The video encoding apparatus may modify the merge candidate list and the AMVP candidate list by utilizing MBM as follows.
[0227] First, the video encoding device can refine each candidate motion vector pair by utilizing the 3-level multiple channels of MBM. The video encoding device can utilize the finalized motion vector generated in the third channel, but can selectively add the motion vector from each stage to the AMVP candidate list or the merge candidate list. For example, in the conventional merge mode, the refined motion vector from the first channel generated in units of CU or the refined motion vector from the second channel generated in units of 16×16 sub-blocks can be added to the candidate list.
[0228] If the DMVR mode is applied, the refined motion vectors of the first pass can be utilized.
[0229] Furthermore, if the DMVR mode and the affine merge mode are applied, the refinement value (deltaMV) of the refined motion vector generated in the first pass may be added to all CPMVs of each constructed affine candidate in the affine merge candidate list.
[0230] Furthermore, if a candidate is determined in units of subblocks, such as a subblock-based merge mode or an affine-based motion vector candidate, a refined motion vector of a third pass in addition to the first and second passes may be added to the candidate list.
[0231] On the other hand, when AMVR is applied, the video encoding apparatus may add only motion vectors greater than or equal to the minimum luma sample unit according to amvr_precision_idx. To this end, multiple channels of MBM may be adaptively selected for the relevant CU.
[0232] In one example, the video encoding apparatus may perform the following operations on the AMVP candidate list by utilizing MBM: adding candidates, reordering the list, pruning the list, etc.
[0233] As described above, the video encoding device can refine the existing motion vector pair (MV0, MV1) by using three multi-channels of MBM to generate a refined motion vector (MV0_passN, MV1_passN). Here, the existing motion vector pair represents the motion vector in the dual prediction as a candidate included in the AMVP candidate list. For the existing motion vector pair (MV0, MV1), the video encoding device generates a refined motion vector pair (MV0_passN, MV1_passN), but is not necessarily limited to this. For example, one or more refined motion vector pairs can be generated for the existing motion vector pair based on the application of multiple channels.
[0234] To add a candidate, the video encoding device adds the refined motion vector (MV0_passN, MV1_passN) to the existing AMVP candidate list. When added to the list, the refined motion vector can be added at a fixed position. For example, the refined motion vector can be placed at the end of the list. Alternatively, the refined motion vector can be located at the highest priority position of the list.
[0235] In addition, in order to prune the AMVP candidate list, the video encoding device can replace or delete the existing motion vector from the list with the refined motion vector. Replacement or deletion can be selected by calculating the cost difference between the refined motion vector and the existing motion vector. Here, the cost represents the MBM cost.
[0236] Replacement means replacing the existing motion vector in the list with the refined motion vector if the refined motion vector is better than the existing motion vector in terms of cost. If the refined motion vector is not better than the existing motion vector in terms of cost, the refined motion vector is not added to the list. Alternatively, deletion means that for the candidate list of the refined motion vector pair to which the candidate is added, the best candidate in terms of MBM cost is retained according to the list size, and the remaining candidates are removed. In this case, the MBM cost can be calculated by assuming deltaMV to be zero for the existing motion vector pair.
[0237] In addition, in order to reorder the list, the video encoding device may reorder the motion vector candidates in the AMVP candidate list based on the MBM cost. For example, the priority of the candidates may be determined by sorting the candidates in ascending order based on the MBM cost. In addition, the video encoding device may reorder the candidates based on the MBM cost of the AMVP candidate list, where the candidates have been added or pruned.
[0238] In another example, the video encoding apparatus may perform the following operations on a conventional merge candidate list by utilizing MBM: adding candidates, reordering the list, pruning the list, etc.
[0239] As described above, the video encoding apparatus refines the existing motion vector pair MV0, MV1 by using 3-level multi-pass of MBM to generate refined motion vectors MV0_passN and MV1_passN. Here, the existing motion vector pair represents a motion vector in bi-prediction as a candidate included in the merge candidate list.
[0240] To add a candidate, the video encoding device adds the refined motion vector (MV0_passN, MV1_passN) to the existing merge candidate list. When added to the list, the refined motion vector can be added at a fixed position. For example, the refined motion vector can be at the end of the list or at the top priority position.
[0241] Alternatively, the video encoding device may add the refined motion vector to a specific ranking in the merge candidate list, taking into account a predetermined condition. The video encoding device may calculate the MBM costs of the candidates in the list and take into account their diversity. For example, the video encoding device may calculate the cost difference between a previous candidate at a specific ranking and the refined motion vector, and compare the cost difference with a preset threshold. If the specific ranking is the highest priority, the cost difference between the highest priority candidate and the refined motion vector may be calculated. If the calculated cost difference is greater than or equal to the threshold, the video encoding device places the refined motion vector in the specific ranking. On the other hand, if the calculated cost difference is less than the threshold, the video encoding device determines that the refined motion vector is duplicated with the previous candidate, and the video encoding device repeats the above process for the next ranked candidate of the specific ranking.
[0242] Here, the threshold value may be set based on the quantization parameter. For example, the threshold value may be set as a Lagrangian parameter for rate-distortion optimization.
[0243] In addition, in order to prune the merge candidate list, the video encoding device can replace or delete the existing motion vector in the list with the refined motion vector. Replacement or deletion can be selected by calculating the cost difference between the refined motion vector and the existing motion vector. Here, the cost represents the MBM cost.
[0244] Replace means that if the refined motion vector is more effective than the existing motion vector in terms of cost, the refined motion vector is used to replace the existing motion vector in the list. Deletion means that if the refined motion vector is not better than the existing motion vector in terms of cost, the refined motion vector is not added to the list. Alternatively, deletion means that for a candidate list to which a candidate pair with a refined motion vector has been added, the best candidate in terms of MBM cost is retained according to the list size, and the remaining candidates are removed. In this case, the MBM cost can be calculated assuming deltaMV is zero for the existing motion vector.
[0245] Alternatively, in order to reorder the list, the video encoding device may reorder the motion vector candidates in the merge candidate list based on the MBM cost. For example, the priority of the candidates may be determined by sorting the candidates in ascending order based on the MBM cost. In addition, the video encoding device may reorder the candidates based on the MBM cost of the merge candidate list, where the candidates have been added or pruned.
[0246] When the coded motion vector is stored in the HMVP table, the video encoding device can add refined motion vectors based on TM, BM or MBM. In addition, the existing HMVP table can be updated in FIFO format, but in this embodiment, the motion vectors in the HMVP table can be reordered based on TM cost or MBM cost.
[0247] Furthermore, the video encoding apparatus may reorder the GPM candidate list as follows.
[0248] In the conventional method, when combining the GPM candidate list, motion information of each of the two regions obtained by diagonally dividing the current block region is derived from the conventional merge mode candidate list. The conventional method may combine the candidate list by utilizing the motion information in L0 / L1 depending on whether the index is even or odd. In this embodiment, the video encoding device may abandon the combination method and may combine the candidate list by prioritizing the motion information in the merge mode candidate list based on the MBM cost. The MBM cost may be calculated based on the motion information (i.e., the motion vectors of the two regions).
[0249] Alternatively, in order to select motion information for each of the two regions, the video encoding apparatus may select a reference block with a minimum TM cost. The unidirectional motion information of each reference block may be selected from a motion information candidate list derived from neighboring blocks of the current block, such as Fig.15 In order to improve the coding efficiency, the video encoding apparatus may combine the candidate list by prioritizing the motion information based on the TM cost.
[0250] In the conventional GPM (geometric partitioning mode), blocks can be partitioned according to two partitioning methods using the upper left to lower right diagonal line or the upper right to lower left diagonal line, such as Fig. 9 The template matching according to the present embodiment adopts only a partitioning method using a slanted line from the upper left to the lower right, where there are pixels adjacent to the current block.
[0251] When operating under GPM, the video encoding device may signal a flag indicating whether the reordering method is to be used.
[0252] Alternatively, the video encoding device may use a TM / BM-based method for combining the motion information candidate list of the GPM. In this case, the template of the current block may utilize the upper and left reference samples according to the conventional TM / BM method, but the template of the reference block may utilize samples at a position indicated by a motion vector derived from a sub-block adjacent to the boundary of the current block. During the template matching search of the GPM, while retaining the motion information of one of the two triangular partitioned areas, the video encoding device performs a matching search for the other triangular partitioned area. The video encoding device may repeat the above template matching search process for all conventional merge mode candidates.
[0253] As another example, the video encoding apparatus may utilize MBM to reorder the affine merge / AMVP candidate list.
[0254] In the affine mode processing, the video encoding apparatus organizes a candidate list using inherited affine candidates, constructed affine candidates, etc. At this time, priorities may be determined among the candidates in the list based on the MBM method.
[0255] When determining the constructed affine candidate, the video encoding apparatus checks the existence of a motion vector in the order of adjacent blocks B2 → B3 → A2, such as Figure 7 As shown, and the first available motion vector is set to CPMV1. At this time, the video encoding device reorders the available motion vectors based on the MBM cost, and determines CPMV1 according to the priority. Similarly, the video encoding device can check the motion vector and set CPMV2 by following the order B1→B0, and check the motion vector and set CPMV3 by following the order A1→A0, and determine CPMV (CPMV2 and CPMV3) based on the MBM cost.
[0256] In the affine merge mode, the video encoding apparatus may generate a refined motion vector by utilizing the first channel of the MBM of the current block, and then may add a refined value (deltaMV) of the refined motion vector to all CPMVs of each constructed affine candidate in the list. For applying the initial value of the first channel, the motion vector pair of the current block may be used.
[0257] Alternatively, in the affine merge mode, the video encoding apparatus may generate a refined motion vector by using the first pass of the MBM of the current block, and may then add a refinement value (deltaMV) of the refined motion vector to the CPMV selected from the neighboring block.
[0258] When determining the constructed affine candidates, the video encoding apparatus checks the existence of motion vectors in the order of candidate blocks B2 → B3 → A2, as shown in FIG. Figure 7As shown, and the first available motion vector is set to CPMV1. Similarly, the video encoding device checks the motion vector in the order of B1→B0 to set CPMV2, and checks the motion vector in the order of A1→A0 to set CPMV3. At this time, the video encoding device does not use a fixed CPMV but calculates a regression model that estimates affine parameters by using the motion vectors of the neighboring blocks of the current block, and recalculates the modified CPMV of the current block from the model. The video encoding device can generate a refined motion vector by using the first channel of the MBM of the current block, and can then add the refined value (deltaMV) of the refined motion vector to the modified CPMV.
[0259] <Example 2> Method of using TM to modify the merge candidate list and AMVP candidate list
[0260] The video encoding device performs template matching on each candidate in the AMVP / Merge list and calculates the template cost. The video encoding device can then reorder the list in order of increasing TM cost.
[0261] In one example, the video encoding device may reorder the candidates in the regular AMVP candidate list based on template matching.
[0262] The video encoding device may combine the AMVP candidate list to include at most two prediction candidates by adding the HMVP candidate to the spatial candidate and the temporal candidate. The video encoding device may then reorder the candidates by utilizing the TM cost. Alternatively, the video encoding device may select a candidate based on the TM cost when selecting a candidate from the list.
[0263] The video encoding apparatus may refer to the left block and the upper block to obtain one candidate for each of the left block and the upper block, and may use up to two candidates as spatial candidates. Fig.16 As shown, the video encoding device may select A located on the left m and A m+1 One of them is selected as a candidate, and B located on the upper side can be selected -1 , B n and B n+1 The video encoding device then continues the encoding process with rate-distortion optimization. In this embodiment, the video encoding device may determine the candidate based on the TM cost when determining the left and upper candidates.
[0264] As another example, the video encoding apparatus may reorder affine AMVP / merge candidates based on template matching.
[0265] In the affine mode processing, the video encoding apparatus may combine the affine AMVP candidate list to include inherited affine candidates, constructed affine candidates, etc. At this time, the video encoding apparatus may use TM to determine the priority among the candidates.
[0266] When determining the constructed affine candidates, the video encoding apparatus checks the existence of motion vectors in the order of candidate blocks B2 → B3 → A2, such as Figure 7 As shown, and the first available motion vector is set to CPMV1. At this time, the video encoding device reorders the motion vectors based on the TM cost, and determines CPMV1 according to the priority. Similarly, the video encoding device can check the motion vectors in the order of B1→B0 to set CPMV2, can check the motion vectors in the order of A1→A0 to set CPMV3, and can determine CPMV based on the TM cost.
[0267] If there are more than one inherited affine candidate or more than one constructed affine candidate, the more than one inherited affine candidate or more than one constructed affine candidate may be divided into subgroups, respectively. The video encoding apparatus then reorders the list by determining priorities based on template matching within the subgroups.
[0268] Fig.17 is a flow chart of a process for searching for affine AMVP candidates (including re-ordered inherited affine AMVP candidates) according to at least one embodiment of the present invention.
[0269] exist Fig.17 In the example of , the video encoding apparatus reorders the inherited affine AMVP candidates within the subgroup containing the inherited affine AMVP candidates by determining the priority based on the template matching of the subgroup (S1703). Fig.17 In the example, the remaining steps are the same as Figure 8 The examples are the same as in , so further description is omitted.
[0270] As yet another example, the video encoding apparatus may reorder the candidates in the TM AMVP / TM merge candidate list.
[0271] The video encoding apparatus may perform template matching on each candidate in the TM AMVP / TM merge candidate list to calculate a template matching (TM) cost. The video encoding apparatus may then reorder the candidates in the list in order of increasing TM cost.
[0272] The video encoding apparatus may refine the existing motion information by using the TM to generate the refined motion information. Here, the existing motion information represents a motion vector in unidirectional prediction or a motion vector pair (MV0, MV1) in bidirectional prediction included in the candidate list.
[0273] When TM is used to refine candidate motion information, the video encoding apparatus can calculate the TM cost by reflecting the shape of the current block. For example, if the block is elongated in the horizontal direction, the upper samples of the template can be used, and if the block is elongated in the vertical direction, the left samples can be used.
[0274] When the refined motion information is generated by using TM, if the TM cost is greater than a predetermined threshold, the video encoding device may not add the refined motion information to the list. In this case, the threshold is calculated by considering the TM cost of the first candidate. For example, the threshold may be set by multiplying the TM cost of the first candidate by N (e.g., 5).
[0275] As another example, the video encoding apparatus may perform candidate addition, list reordering, list pruning, etc. on a regular merge candidate list based on TM as follows. Hereinafter, motion information refers to a motion vector in unidirectional prediction or a motion vector pair (MV0, MV1) in bidirectional prediction.
[0276] First, the video encoding apparatus refines existing motion information by using TM to generate refined motion information.
[0277] For candidate addition, the video encoding device adds the refined motion information to the existing merge candidate list. When added to the list, the refined motion information can be added at a fixed position. For example, the refined motion information can be at the end of the list or at the top priority position of the list.
[0278] Alternatively, the video encoding device may add the refined motion information to a specific ranking in the merge candidate list, taking into account a predetermined condition. The video encoding device may calculate the TM cost of the candidates in the list, and may take into account their diversity. For example, the video encoding device may calculate the cost difference between the previous candidate of a specific ranking and the refined motion information, and may compare the cost difference with a preset threshold. If the specific ranking is the highest priority, the cost difference between the highest priority candidate and the refined motion information may be calculated. If the calculated cost difference is greater than or equal to the threshold, the video encoding device places the refined motion information in the specific ranking. On the other hand, if the calculated cost difference is less than the threshold, the video encoding device determines that the refined motion information is duplicated with the previous candidate, and repeats the above process for the next candidate of the specific ranking.
[0279] Here, the threshold value may be set based on the quantization parameter. For example, the threshold value may be set as a Lagrangian parameter for rate distortion optimization.
[0280] In addition, in order to prune the merge candidate list, the video encoding device can replace or delete the existing motion information in the list with the refined motion information. At this time, the replacement or deletion can be selected by calculating the cost difference between the refined motion information and the existing motion information. Here, the cost represents the TM cost.
[0281] Replacement is replacing existing motion information in the list with the refined motion information if it is better in terms of cost than the existing motion information. Deletion is not adding the refined motion information to the list if it is not more effective in terms of cost than the existing motion information. Alternatively, deletion means that for the list of candidates including the refined motion information, the best candidate in terms of TM cost is kept and the rest are removed, leaving the list size of the best candidates in terms of TM cost. In this case, the TM cost can be calculated assuming deltaMV is zero for the existing motion information.
[0282] Alternatively, in order to reorder the list, the video encoding apparatus may reorder the motion vector candidates in the merge candidate list based on the TM cost. For example, the priority of the candidate may be determined by sorting the candidates in ascending order based on the TM cost.
[0283] <Example 3> Modify the candidate list in BM AMVP-MERGE mode
[0284] The following describes a method of adding motion vector candidates and reordering the candidate list in BM AMVP-MERGE mode.
[0285] Motion vectors in the L0 direction and the L1 direction according to the BM AMVP-MERGE mode are designated as MV0_passN and MV1_passN, respectively. Also, MV0_passN and MV1_passN are refined motion vectors generated according to one of a plurality of passes of the MBM.
[0286] The video encoding apparatus uses MV0_passN and MV1_passN to replace MV0 and MV1 in the existing AMVP / merge candidate. For example, using the HMVP candidate, the replaced motion vector can be used to predict the motion vector of the future block other than the current block.
[0287] The video encoding apparatus adds MV0_passN and MV1_passN to MV0 and MV1 of the existing AMVP / merge candidate. For example, for the HMVP candidate, the added motion vector can be used to predict the motion vector of the future block other than the current block.
[0288] After replacement or addition, the video encoding device may re-rank the candidates in the list. For example, the video encoding device may rank MV0_passN and MV1_passN as the highest. Alternatively, the candidates may be adaptively ranked based on BM, MBM, or TM.
[0289] The video encoding apparatus may store MV0_passN and MV1_passN in the HMVP for use. In addition to storing MV0_passN and MV1_passN in the existing HMVP, the video encoding apparatus may store MV0_passN and MV1_passN separately for use in predicting a motion vector of a next block.
[0290] The video encoding device may use MV0_passN and MV1_passN as candidate motion vectors for prediction in the L0 direction and the L1 direction, respectively, but may also use MV0_passN and MV1_passN as candidate motion vectors for reverse prediction in the L1 direction and the L0 direction. In this case, the signs of the candidate motion vectors may be opposite. For example, -MV0_passN may be used for the L1 direction, and -MV1_passN may be used for the L0 direction. This may be applied to any of the above cases.
[0291] MV0_passN and MV1_passN may be refined motion vectors from the original candidate motion vectors MV0 and MV1 in the L0 direction and the L1 direction, but MV0_passN may be the same value as MV0, or MV1_passN may be the same value as MV1. These values may apply to any of the foregoing cases.
[0292] The video encoding device may utilize an additional flag at the prediction unit (PU) level to determine whether to use any of the aforementioned implementations.
[0293] In the following, reference Fig.18 and Fig.19 , describes a method for a video encoding device or a video decoding device to inter-frame predict a current block based on multiple channels of MBM and MBM cost.
[0294] Fig.18 is a flowchart of a method for inter-predicting a current block performed by a video encoding apparatus according to at least one embodiment of the present invention.
[0295] The video encoding apparatus determines a candidate index (S1800). Here, the candidate index indicates one of a plurality of candidates in the candidate list, and each candidate represents a motion vector pair in bidirectional prediction.
[0296] In merge mode, the candidate list can be a regular merge candidate list, a GPM candidate list, or an affine merge candidate list. If in AMVP mode, the candidate list can be a regular AMVP candidate list or an affine AMVP candidate list.
[0297] The video encoding apparatus generates a candidate list by using neighboring information of the current block ( S1802 ).
[0298] The video encoding apparatus modifies the candidate list based on multiple channels of MBM and MBM costs (S1804). Here, a first channel of the multiple channels searches for a motion vector pair based on the MBM cost for the current block, a second channel searches for a motion vector pair based on the MBM cost for a sub-block within the current block, and a third channel searches for a motion vector pair based on the MBM cost for a sub-sub-block. The MBM cost depends on the difference between the two blocks indicated by the motion vector pair searched for each channel.
[0299] The video encoding device generates a refined motion vector pair by using multiple channels, and the refined motion vector pair minimizes the MBM cost of each candidate. The video encoding device may add the generated refined motion vector pair to the candidate list. The video encoding device may calculate the MBM cost difference between the refined motion vector pair and the corresponding candidate, and may perform replacement or deletion as described above. Alternatively, the video encoding device may reorder the candidates in the candidate list in ascending order based on the MBM cost.
[0300] The video encoding apparatus extracts a motion vector pair of the current block from the modified candidate list by using the candidate index (S1806).
[0301] The video encoding apparatus generates a prediction block of the current block by using the extracted motion vector pair (S1808).
[0302] The video encoding apparatus encodes a candidate index ( S1810 ).
[0303] Fig.19 is a flowchart of a method for inter-predicting a current block performed by a video decoding device according to at least one embodiment of the present invention.
[0304] The video decoding apparatus decodes a candidate index from a bitstream (S1900). Here, the candidate index indicates one of a plurality of candidates in a candidate list, and each candidate represents a motion vector pair in bidirectional prediction.
[0305] In the merge mode, the candidate list can be a regular merge candidate list, a GPM candidate list, or an affine merge candidate list. If it is AMVP mode, the candidate list can be a regular AMVP candidate list or an affine AMVP candidate list.
[0306] The video decoding apparatus generates a candidate list by using neighboring information of the current block ( S1902 ).
[0307] The video decoding apparatus modifies the candidate list based on multiple channels of MBM and MBM costs (S1904). Here, a first channel of the multiple channels searches for a motion vector pair based on the MBM cost for the current block, a second channel searches for a motion vector pair based on the MBM cost for a sub-block within the current block, and a third channel searches for a motion vector pair based on the MBM cost for a sub-sub-block. The MBM cost depends on the difference between the two blocks indicated by the motion vector pair searched for each channel.
[0308] The video decoding device generates a refined motion vector pair by using multiple channels, and the refined motion vector pair minimizes the MBM cost of each candidate. The video decoding device may add the generated refined motion vector pair to the candidate list. The video decoding device may calculate the MBM cost difference between the refined motion vector pair and the corresponding candidate, and may perform replacement or deletion as described above. Alternatively, the video decoding device may reorder the candidates in the candidate list in ascending order based on the MBM cost.
[0309] The video decoding apparatus extracts a motion vector pair of the current block from the modified candidate list by using the candidate index (S1906).
[0310] The video decoding apparatus generates a prediction block of the current block by using the extracted motion vector pair (S1908).
[0311] In the following, reference Fig. 20 and Fig.21 , describes a method for performing inter-frame prediction on a current block based on TM and TM cost by a video encoding device and a video decoding device.
[0312] Fig. 20 is a flowchart of a method for inter-predicting a current block performed by a video encoding apparatus according to another embodiment of the present invention.
[0313] The video encoding apparatus determines a candidate index (S2000). Here, the candidate index indicates one of a plurality of candidates in a candidate list, each candidate including a motion vector pair in bidirectional prediction or a motion vector in unidirectional prediction as motion information.
[0314] In merge mode, the candidate list can be a regular merge candidate list, a GPM candidate list, a TM merge candidate list, or an affine merge candidate list. When in AMVP mode, the candidate list can be a regular AMVP candidate list, a TM AMVP candidate list, or an affine AMVP candidate list.
[0315] The video encoding apparatus generates a candidate list by using neighboring information of a current block ( S2002 ).
[0316] The video encoding apparatus modifies the candidate list based on the TM and the TM cost (S2004). Here, the TM searches for a similar template corresponding to the template of the current block in the reconstructed area. The TM cost depends on the difference between the samples in the template of the current block and the samples in the similar template.
[0317] The video encoding apparatus may reorder the candidates in the candidate list in ascending order based on the TM cost.
[0318] In the conventional merge candidate list, the video encoding device can use TM to generate refined motion information for each candidate that minimizes the TM cost. The video encoding device can add the generated refined motion information to the candidate list. The video encoding device can calculate the TM cost difference between the refined motion information and the corresponding candidate, and can perform replacement or deletion as described above.
[0319] The video encoding apparatus extracts motion information of the current block from the modified candidate list by using the candidate index (S2006).
[0320] The video encoding apparatus generates a prediction block of the current block by using the extracted motion information (S2008).
[0321] The video encoding apparatus encodes a candidate index ( S2010 ).
[0322] Fig.21 is a flowchart of a method for inter-predicting a current block performed by a video decoding apparatus according to another embodiment of the present invention.
[0323] The video decoding apparatus decodes a candidate index from a bitstream (S2100). Here, the candidate index indicates one of a plurality of candidates in a candidate list, and each candidate includes motion information, such as a motion vector pair in bidirectional prediction or a motion vector in unidirectional prediction.
[0324] In merge mode, the candidate list can be a regular merge candidate list, a GPM candidate list, a TM merge candidate list, or an affine merge candidate list. When in AMVP mode, the candidate list can be a regular AMVP candidate list, a TM AMVP candidate list, or an affine AMVP candidate list.
[0325] The video decoding apparatus generates a candidate list by using neighboring information of the current block ( S2102 ).
[0326] The video decoding apparatus modifies the candidate list based on the TM and the TM cost (S2104). Here, the TM searches for a similar template corresponding to the template of the current block in the reconstructed area. The TM cost depends on the difference between the samples in the template of the current block and the samples in the similar template.
[0327] The video decoding device may reorder the candidates in the candidate list in ascending order based on the TM cost.
[0328] In the conventional merge candidate list, the video decoding device can use TM to generate refined motion information for each candidate that minimizes the TM cost. The video decoding device can add the generated refined motion information to the candidate list. The video decoding device can calculate the TM cost difference between the refined motion information and the corresponding candidate, and can perform replacement or deletion as described above.
[0329] The video decoding apparatus extracts motion information of the current block from the modified candidate list by using the candidate index ( S2106 ).
[0330] The video decoding apparatus generates a prediction block of the current block by using the extracted motion information ( S2108 ).
[0331] Although the steps in the various flowcharts are described as being performed sequentially, these steps merely illustrate the technical ideas of some embodiments of the present invention. Therefore, a person of ordinary skill in the art to which the present invention belongs can perform the steps by changing the order described in the various figures or by performing two or more steps in parallel. Therefore, the steps in the various flowcharts are not limited to the order shown in the order in which they occur.
[0332] It should be understood that the above description presents illustrative embodiments that can be implemented in various other ways. The functions described in some embodiments can be implemented by hardware, software, firmware and / or their combination. It should also be understood that the functional components described in the present invention are marked as "... units" to highlight the possibility of their independent implementation.
[0333] On the other hand, the various methods or functions described in some embodiments can be implemented as instructions stored in a non-volatile recording medium, which can be read and executed by one or more processors. Non-volatile recording media can include various types of recording devices that store data in a form that is readable by a computer system. For example, non-volatile recording media can include storage media, such as erasable programmable read-only memory (EPROM), flash drives, optical disk drives, magnetic hard drives, and solid-state drives (SSDs), etc.
[0334] Although exemplary embodiments of the present invention are described for illustrative purposes, it will be appreciated by those skilled in the art that various modifications, additions and substitutions may be made without departing from the spirit and scope of the present invention. Therefore, embodiments of the present invention are described for simplicity and clarity. The scope of the technical ideas of the embodiments of the present invention are not limited by the examples. Accordingly, it will be appreciated by those skilled in the art that the scope of the present invention should not be limited by the embodiments clearly described above, but by the claims and their equivalents.
[0335] Reference numerals
[0336] 124: Inter-frame predictor
[0337] 155: Entropy Encoder
[0338] 510: Entropy Decoder
[0339] 544: Inter-frame predictor.
[0340] CROSS-REFERENCE TO RELATED APPLICATIONS
[0341] This application claims priority to and the benefit of Korean Patent Application No. 10-2022-0003247, filed on January 10, 2022, and Korean Patent Application No. 10-2022-0187975, filed on December 28, 2022, the entire contents of each of which are incorporated herein by reference.
Claims
1. A method for performing inter-frame prediction on a current block performed by a video decoding device, the method include: decoding from the bitstream a candidate index indicating one of a plurality of candidates in a candidate list, each candidate representing a motion vector pair in bidirectional prediction; Generate a candidate list by utilizing neighboring information of the current block; modifying the candidate list based on a plurality of passes of a multi-pass bilateral matching (MBM) and an MBM cost, the plurality of passes having a first pass performing a search for a motion vector pair of a current block, a second pass performing a search for a motion vector pair of a sub-block within the current block, and a third pass performing a search for a motion vector pair of a sub-sub-block of the sub-block; performing a search based on an MBM cost that depends on a difference between two blocks indicated by a pair of motion vectors for each of a plurality of channels searched; extracting a motion vector pair of the current block from the modified candidate list by using the candidate index; and A prediction block of the current block is generated by using the extracted motion vector pair.
2. The method according to claim 1, in, The list of candidates for revision includes: Multiple channels are used to generate a refined motion vector pair for each candidate that minimizes the MBM cost.
3. The method according to claim 2, in, The list of candidates for revision includes: When the candidate list is a conventional merge candidate list, utilizing the first pass or the second pass to generate refined motion vector pairs; and When the candidate list is a sub-block based candidate list, a third pass in addition to the first pass or the second pass is utilized to generate a refined motion vector pair.
4. The method according to claim 2, in, The list of candidates for revision includes: The refined motion vector pairs are added to the candidate list at fixed positions.
5. The method according to claim 2, in, The list of candidates for revision includes: Replacement or removal is performed by calculating the MBM cost difference between the refined motion vector pair and the corresponding candidate.
6. The method according to claim 5, in, Performing a replacement involves: When the refined motion vector pair is better than the corresponding candidate in terms of MBM cost, the corresponding candidate in the candidate list is replaced with the refined motion vector pair.
7. The method according to claim 5, in, Performing a removal involves: With the candidate list of refined motion vector pairs to which the candidates are added, as many best candidates in terms of MBM cost as the size of the candidate list are retained and the rest are removed.
8. The method according to claim 1, in, The list of candidates for revision includes: The candidates in the candidate list are reordered in ascending order based on the MBM cost.
9. The method according to claim 2, in, The list of candidates for revision includes: When the candidate list is a normal merge candidate list, the refined motion vector pair is added to a specific ranking of the candidate list by considering a preset condition.
10. The method according to claim 9, in, The list of candidates for revision includes: Calculate the MBM cost difference between the candidate and refined motion vector pairs before a specific ranking; When the MBM cost difference is greater than or equal to a preset threshold, placing the refined motion vector pair in a specific ranking; and When the MBM cost difference is less than a preset threshold, the preset condition of the ranking after the specific ranking is reconsidered.
11. The method according to claim 2, in, The list of candidates for revision includes: When the candidate list is a regular merge candidate list, the refined motion vector pairs are added to a history-based motion vector predictor (HMVP) table.
12. The method according to claim 1, in, The list of candidates for revision includes: When the candidate list is a regular merge candidate list, the motion vector pairs are reordered in a history-based motion vector predictor (HMVP) table based on the MBM cost.
13. The method according to claim 1, in, The list of candidates for revision includes: When the candidate list is a geometry partition mode candidate list, the candidate list is combined by prioritizing the motion information in the regular merge candidate list based on the MBM cost.
14. The method according to claim 1, in, The list of candidates for revision includes: When the candidate list is an affine merge candidate list, determining a constructed affine candidate, wherein available motion vectors of neighboring blocks of the current block are reordered based on the MBM cost; and The control point motion vectors of the combined constructed affine candidates are determined in order of priority.
15. The method according to claim 1, in, When the candidate list is an affine merge candidate list, modifying the candidate list includes: Extracting a motion vector pair of the current block from the candidate list by using the candidate index; corresponding to the motion vector pair of the current block, generating a refined motion vector pair that minimizes the MBM cost by using the first channel, wherein the refined motion vector pair includes the motion vector pair of the current block and a refinement value; Selecting a control point motion vector from a neighboring block of the current block; and Adds refinement value to control point motion vectors.
16. A method for performing inter-frame prediction on a current block, performed by a video decoding device, the method include: determining a candidate index indicating one of a plurality of candidates in a candidate list, each candidate representing a motion vector pair in bidirectional prediction; Generate a candidate list by utilizing neighboring information of the current block; modifying the candidate list based on a plurality of passes of a multi-pass bilateral matching (MBM) and an MBM cost, the plurality of passes having a first pass performing a search for a motion vector pair of a current block, a second pass performing a search for a motion vector pair of a sub-block within the current block, and a third pass performing a search for a motion vector pair of a sub-sub-block of the sub-block; performing a search based on an MBM cost that depends on a difference between two blocks indicated by a pair of motion vectors for each of a plurality of channels searched; extracting a motion vector pair of the current block from the modified candidate list by using the candidate index; generating a prediction block for the current block by using the extracted motion vector pair; as well as Encode candidate index.
17. A computer-readable recording medium storing a bit stream generated by a video encoding method, the video encoding method include: determining a candidate index indicating one of a plurality of candidates in a candidate list, each candidate representing a motion vector pair in bidirectional prediction; Generate a candidate list by utilizing neighboring information of the current block; modifying the candidate list based on a plurality of passes of a multi-pass bilateral matching (MBM) and an MBM cost, the plurality of passes having a first pass performing a search for a motion vector pair of a current block, a second pass performing a search for a motion vector pair of a sub-block within the current block, and a third pass performing a search for a motion vector pair of a sub-sub-block of the sub-block; performing a search based on an MBM cost that depends on a difference between two blocks indicated by a pair of motion vectors for each of a plurality of channels searched; extracting a motion vector pair of the current block from the modified candidate list by using the candidate index; generating a prediction block for the current block by using the extracted motion vector pair; as well as Encode candidate index.
