Method of encoding / decoding video and recording medium storing bitstream
By deriving motion vectors on a sub-block basis and performing motion compensation for high-resolution video data, the method improves prediction accuracy and efficiency, addressing the challenges of high data volume and cost associated with high-resolution video content.
Patent Information
- Application Number
- PCT/KR2024/003522
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-03-21
- Filing Date
- 2024-03-20
- Publication Date
- 2024-09-26
AI Technical Summary
The increasing demand for high-resolution and high-quality video data leads to increased data volume, resulting in higher transmission and storage costs, necessitating more efficient video compression technologies, particularly for high-resolution and ultra-high-resolution stereoscopic video content.
A method for deriving a motion vector on a sub-block basis, which improves prediction accuracy by using an initial motion vector to derive motion information of sub-blocks from corresponding sub-blocks in an initial reference picture, and performing motion compensation for each sub-block, allowing for more efficient encoding and decoding.
This approach enhances prediction accuracy and encoding/decoding efficiency by allowing for more precise motion compensation on a sub-block level, thereby reducing data volume and costs associated with high-resolution video transmission and storage.
Smart Images

Figure KR2024003522_26092024_PF_FP
Abstract
Description
Video encoding / decoding method and recording medium for storing bitstream
[0001] The present disclosure relates to a video signal processing method and device.
[0002] Recently, the demand for high-resolution, high-quality images, such as HD (High Definition) and UHD (Ultra High Definition) images, is increasing across various application fields. As image data becomes higher in resolution and quality, the relative amount of data increases compared to conventional image data. Therefore, transmitting image data using existing media such as wired and wireless broadband lines or storing it using existing storage media leads to increased transmission and storage costs. To address these issues arising from the increasing resolution and quality of image data, high-efficiency image compression technologies can be utilized.
[0003] There are various technologies for image compression, such as inter-picture prediction technology that predicts pixel values included in the current picture from pictures before or after the current picture, intra-picture prediction technology that predicts pixel values included in the current picture using pixel information in the current picture, and entropy encoding technology that assigns short codes to values with high frequency of appearance and long codes to values with low frequency of appearance, and these technologies can be used to effectively compress and transmit or store image data.
[0004] Meanwhile, as demand for high-resolution video grows, so does the demand for stereoscopic video content as a new video service. Discussions are underway on video compression technologies to effectively deliver high-resolution and ultra-high-resolution stereoscopic video content.
[0005] The present disclosure aims to provide a method for deriving a motion vector in sub-block units.
[0006] The present disclosure aims to improve the prediction accuracy of sub-block units by improving the method for deriving initial motion vectors.
[0007] The present disclosure aims to improve the prediction accuracy of a sub-block unit by improving a method for deriving a motion vector in a sub-block unit.
[0008] The technical problems to be achieved in the present disclosure are not limited to the technical problems mentioned above, and other technical problems not mentioned will be clearly understood by a person having ordinary skill in the technical field to which the present disclosure belongs from the description below.
[0009] A video decoding method according to the present disclosure includes the steps of: deriving an initial motion vector of a current block; using the initial motion vector, deriving motion information of sub-blocks within the current block from corresponding sub-blocks within an initial reference picture; and performing motion compensation on each of the sub-blocks within the current block. In this case, the initial motion vector may be derived based on a merge candidate included in a motion information merge list of the current block or a motion vector prediction candidate included in a motion vector prediction list.
[0010] In the image decoding method according to the present disclosure, the merging candidate may be one having the smallest template matching cost among the merging candidates included in the motion information merging list of the current block.
[0011] In the video decoding method according to the present disclosure, the template matching cost may represent the sum of the absolute value differences between the reference template around the reference block indicated by the motion information of the merging candidate and the current template around the current block.
[0012] In the video decoding method according to the present disclosure, the motion information merge list may be rearranged according to the template matching cost of each of the merge candidates, and the merge candidate may be selected by index information indicating one of the rearranged merge candidates.
[0013] In the video decoding method according to the present disclosure, among the merge candidates included in the motion information merge list, a reference picture indicated by a reference picture index that is different from the initial reference picture may not be available for deriving the initial motion vector.
[0014] In the video decoding method according to the present disclosure, the initial reference picture may be a collocated picture or a reference picture having a predefined index.
[0015] In the image decoding method according to the present disclosure, the initial motion vector can be derived by adding an offset vector to the motion vector of the merging candidate or the motion vector of the motion vector prediction candidate.
[0016] In the image decoding method according to the present disclosure, if there is no motion information of a corresponding sub-block corresponding to a sub-block within the current block in the initial reference picture, the motion vector of the sub-block may be set as a representative sub-motion vector.
[0017] In the image decoding method according to the present disclosure, the representative sub-motion vector may be set as the motion vector of the first available corresponding sub-block found when the corresponding sub-blocks are sequentially searched.
[0018] In the image decoding method according to the present disclosure, the search order of the corresponding sub-blocks can be determined based on an index indicating one of a plurality of scan order candidates.
[0019] In the video decoding method according to the present disclosure, the motion vector of the sub-block in the current block is derived by scaling the motion vector of the corresponding sub-block in the reference picture, and the scaling can be performed based on a first distance between the current picture and the initial reference picture and a second distance between the initial reference picture and a reference picture indicated by the reference picture index of the merging candidate.
[0020] In the video decoding method according to the present disclosure, the motion vector of the sub-block in the current block is derived by scaling the sum of the motion vector of the corresponding sub-block in the reference picture and the initial motion vector, and the scaling can be performed based on a first distance between the current picture and the initial reference picture and a second distance between the initial reference picture and a reference picture indicated by the reference picture index of the merging candidate.
[0021] In the video decoding method according to the present disclosure, the motion vector of the sub-block within the current block can be derived by adding a motion vector differential value and a motion vector prediction value derived by scaling the motion vector of the corresponding sub-block within the reference picture.
[0022] A video encoding method according to the present disclosure includes the steps of: deriving an initial motion vector of a current block; using the initial motion vector, deriving motion information of sub-blocks within the current block from corresponding sub-blocks within an initial reference picture; and performing motion compensation on each of the sub-blocks within the current block. In this case, the initial motion vector may be encoded based on a merge candidate included in a motion information merge list of the current block or a motion vector prediction candidate included in a motion vector prediction list.
[0023] According to the present disclosure, a computer-readable recording medium for storing a bitstream generated by the image encoding method can be provided.
[0024] The features briefly summarized above regarding the present disclosure are merely exemplary aspects of the detailed description of the present disclosure that follows and do not limit the scope of the present disclosure.
[0025] According to the present disclosure, by providing a method for deriving a motion vector in sub-block units, there is an effect of increasing prediction accuracy and improving encoding / decoding efficiency.
[0026] According to the present disclosure, by improving the method for deriving an initial motion vector, prediction accuracy in sub-block units can be improved.
[0027] According to the present disclosure, by improving a method for deriving a motion vector in units of sub-blocks, prediction accuracy in units of sub-blocks can be improved.
[0028] The effects that can be obtained from the present disclosure are not limited to the effects mentioned above, and other effects that are not mentioned will be clearly understood by a person having ordinary skill in the art to which the present disclosure pertains from the description below.
[0029] FIG. 1 is a block diagram illustrating an image encoding device according to an embodiment of the present disclosure.
[0030] FIG. 2 is a block diagram showing an image decoding device according to an embodiment of the present disclosure.
[0031] Figure 3 is a diagram schematically illustrating the process of performing inter prediction in an encoder and decoder.
[0032] Figure 4 shows an example in which motion estimation is performed.
[0033] Figures 5 and 6 illustrate examples in which a prediction block of a current block is generated based on motion information generated through motion estimation.
[0034] Figure 7 shows the locations referenced to derive motion vector prediction values.
[0035] Figure 8 is a diagram for explaining a template-based motion estimation method.
[0036] Figure 9 shows examples of template configurations.
[0037] Figure 10 is a diagram for explaining a motion estimation method based on a bilateral matching method.
[0038] Figure 11 is a diagram for explaining a motion estimation method based on a one-way matching method.
[0039] Figures 12 and 13 are diagrams showing examples in which a prediction block is derived according to motion vector precision.
[0040] Figures 14 and 15 are diagrams for explaining the process of encoding and decoding a motion vector difference value, respectively, when the AMVR method is applied.
[0041] Figure 16 is a diagram illustrating a motion vector expressed as the sum of a motion vector prediction value and a motion vector difference value.
[0042] Figure 17 is a diagram for explaining an example in which motion information is derived in units of sub-blocks within the current block.
[0043] Figure 18 shows an example in which motion compensation is performed for a sub-block.
[0044] Figure 19 illustrates the search order of sub-blocks within a reference block.
[0045] The present disclosure may be modified in various ways and encompasses numerous embodiments. Specific embodiments are illustrated in the drawings and described in detail in the detailed description. However, this is not intended to limit the present disclosure to specific embodiments, but rather to encompass all modifications, equivalents, and alternatives falling within the spirit and technical scope of the present disclosure. Throughout the description of each drawing, similar reference numerals have been used to designate similar components.
[0046] While terms such as "first" and "second" may be used to describe various components, these components should not be limited by these terms. These terms are used solely to distinguish one component from another. For example, without departing from the scope of the present disclosure, a first component could be referred to as a "second component," and similarly, a second component could also be referred to as a "first component." The term "and / or" includes a combination of multiple related items described herein or any of multiple related items described herein.
[0047] When a component is referred to as being "connected" or "connected" to another component, it should be understood that it may be directly connected or connected to that other component, but that there may be other components intervening. Conversely, when a component is referred to as being "directly connected" or "connected" to another component, it should be understood that there are no other components intervening.
[0048] The terminology used in this application is only used to describe specific embodiments and is not intended to limit the present disclosure. The singular expression includes the plural expression unless the context clearly indicates otherwise. In this application, it should be understood that the terms "comprise" or "have" indicate the presence of a feature, number, step, operation, component, part, or combination thereof described in the specification, but do not preclude the possibility of the presence or addition of one or more other features, numbers, steps, operations, components, parts, or combinations thereof.
[0049] Hereinafter, preferred embodiments of the present disclosure will be described in more detail with reference to the attached drawings. Hereinafter, identical components in the drawings will be designated by the same reference numerals, and redundant descriptions of identical components will be omitted.
[0050] FIG. 1 is a block diagram illustrating an image encoding device according to an embodiment of the present disclosure.
[0051] Referring to FIG. 1, a video encoding device (100) may include a picture segmentation unit (110), a prediction unit (120, 125), a transformation unit (130), a quantization unit (135), a reordering unit (160), an entropy encoding unit (165), an inverse quantization unit (140), an inverse transformation unit (145), a filter unit (150), and a memory (155).
[0052] Each component shown in Fig. 1 is independently depicted to represent different characteristic functions in the video encoding device, and does not mean that each component is composed of separate hardware or a single software component. That is, each component is listed and included as a separate component for convenience of explanation, and at least two components among each component may be combined to form a single component, or one component may be divided into multiple components to perform a function, and such integrated and separate embodiments of each component are also included in the scope of the present disclosure as long as they do not deviate from the essence of the present disclosure.
[0053] Additionally, some components may not be essential components that perform the essential functions of the present disclosure, but may be optional components merely used to enhance performance. The present disclosure may be implemented by including only components essential to implementing the essence of the present disclosure, excluding components used solely for performance enhancement. A structure that includes only essential components, excluding optional components used solely for performance enhancement, is also within the scope of the present disclosure.
[0054] The picture splitting unit (110) can split the input picture into at least one processing unit. At this time, the processing unit may be a prediction unit (PU), a transform unit (TU), or a coding unit (CU). The picture splitting unit (110) can split one picture into a combination of multiple coding units, prediction units, and transform units, and select one combination of coding units, prediction units, and transform units based on a predetermined criterion (e.g., a cost function) to encode the picture.
[0055] For example, a picture can be split into multiple coding units. A recursive tree structure such as a quad tree, a ternary tree, or a binary tree can be used to split a coding unit in a picture. A coding unit that is split into other coding units starting from an image or the largest coding unit as the root can be split into as many child nodes as the number of split coding units. A coding unit that cannot be split any further according to a certain restriction becomes a leaf node. For example, assuming that a quad tree split is applied to a coding unit, a coding unit can be split into at most four different coding units.
[0056] Hereinafter, in the embodiments of the present disclosure, the encoding unit may be used to mean a unit that performs encoding or may be used to mean a unit that performs decoding.
[0057] A prediction unit may be divided into at least one square or rectangular shape of the same size within a single coding unit, or may be divided such that one prediction unit among the divided prediction units within a single coding unit has a different shape and / or size from another prediction unit.
[0058] When predicting within a screen, the transformation unit and the prediction unit can be set to be the same. In this case, the encoding unit can be divided into multiple transformation units, and then intra-screen prediction can be performed for each transformation unit. The encoding unit can be divided in the horizontal or vertical direction. The number of transformation units generated by dividing the encoding unit can be 2 or 4, depending on the size of the encoding unit.
[0059] The prediction unit (120, 125) may include an inter-prediction unit (120) that performs inter-prediction and an intra-prediction unit (125) that performs intra-prediction. It may be determined whether to use inter-prediction or intra-prediction for an encoding unit, and specific information (e.g., intra-prediction mode, motion vector, reference picture, etc.) according to each prediction method may be determined. At this time, the processing unit where prediction is performed and the processing unit where the prediction method and specific contents are determined may be different. For example, the prediction method and prediction mode, etc. are determined in the encoding unit, and the prediction may be performed in the prediction unit or the transformation unit. The residual value (residual block) between the generated prediction block and the original block may be input to the transformation unit (130). In addition, the prediction mode information, motion vector information, etc. used for prediction may be encoded together with the residual value in the entropy encoding unit (165) and transmitted to the decoding device. When using a specific encoding mode, it is also possible to encode the original block as is and transmit it to the decoding unit without generating a prediction block through the prediction unit (120, 125).
[0060] The inter-screen prediction unit (120) may predict a prediction unit based on information of at least one picture among the previous or subsequent pictures of the current picture, and in some cases, may predict a prediction unit based on information of a portion of an encoded region within the current picture. The inter-screen prediction unit (120) may include a reference picture interpolation unit, a motion prediction unit, and a motion compensation unit.
[0061] The reference picture interpolation unit can receive reference picture information from the memory (155) and generate pixel information less than an integer pixel from the reference picture. In the case of luminance pixels, a DCT-based 8-tap interpolation filter with different filter coefficients can be used to generate pixel information less than an integer pixel in units of 1 / 4 pixels. In the case of a chrominance signal, a DCT-based 4-tap interpolation filter with different filter coefficients can be used to generate pixel information less than an integer pixel in units of 1 / 8 pixels.
[0062] The motion prediction unit can perform motion prediction based on a reference picture interpolated by the reference picture interpolation unit. Various methods can be used to derive a motion vector, such as FBMA (Full search-based Block Matching Algorithm), TSS (Three Step Search), and NTS (New Three-Step Search Algorithm). The motion vector can have a motion vector value of 1 / 2 or 1 / 4 pixel unit based on the interpolated pixel. The motion prediction unit can predict the current prediction unit by using different motion prediction methods. Various methods can be used as motion prediction methods, such as the Skip method, the Merge method, the AMVP (Advanced Motion Vector Prediction) method, and the Intra Block Copy method.
[0063] The on-screen prediction unit (125) can generate a prediction block based on reference pixel information, which is pixel information within the current picture. The reference pixel information can be derived from one selected from among a plurality of reference pixel lines. The Nth reference pixel line among the plurality of reference pixel lines can include left pixels having an x-axis difference of N from the upper left pixel within the current block and upper pixels having a y-axis difference of N from the upper left pixel. The number of reference pixel lines that the current block can select can be 1, 2, 3, or 4.
[0064] If the neighboring blocks of the current prediction unit are blocks that have performed inter-screen prediction and the reference pixel is a pixel that has performed inter-screen prediction, the reference pixel included in the block that has performed inter-screen prediction can be replaced with the reference pixel information of the neighboring block that has performed intra-screen prediction. That is, if the reference pixel is unavailable, the unavailable reference pixel information can be replaced with information from at least one of the available reference pixels.
[0065] In intra-screen prediction, the prediction mode can have a directional prediction mode that uses reference pixel information according to the prediction direction, and a non-directional mode that does not use directional information when performing prediction. The mode for predicting luminance information and the mode for predicting chrominance information can be different, and the intra-screen prediction mode information used to predict luminance information or the predicted luminance signal information can be utilized to predict chrominance information.
[0066] When performing intra-screen prediction, if the size of the prediction unit and the size of the transformation unit are the same, intra-screen prediction for the prediction unit can be performed based on the pixels on the left side of the prediction unit, the pixels on the upper left side, and the pixels on the upper side.
[0067] The on-screen prediction method can generate prediction blocks by applying a smoothing filter to reference pixels according to the prediction mode. Depending on the selected reference pixel line, whether or not the smoothing filter is applied can be determined.
[0068] In order to perform an intra-screen prediction method, the intra-screen prediction mode of the current prediction unit can be predicted from the intra-screen prediction modes of prediction units existing around the current prediction unit. When the prediction mode of the current prediction unit is predicted using mode information predicted from the surrounding prediction units, if the intra-screen prediction modes of the current prediction unit and the surrounding prediction units are the same, information indicating that the prediction modes of the current prediction unit and the surrounding prediction units are the same can be transmitted using predetermined flag information, and if the prediction modes of the current prediction unit and the surrounding prediction units are different, entropy encoding can be performed to encode the prediction mode information of the current block.
[0069] Additionally, a residual block containing residual value information, which is the difference between the prediction unit that performed the prediction based on the prediction unit generated in the prediction unit (120, 125) and the original block of the prediction unit, can be generated. The generated residual block can be input to the transformation unit (130).
[0070] In the transformation unit (130), the residual block including the residual value information of the prediction unit generated through the original block and the prediction unit (120, 125) can be transformed using a transformation method such as DCT (Discrete Cosine Transform), DST (Discrete Sine Transform), or KLT. Whether to apply DCT, DST, or KLT to transform the residual block can be determined based on at least one of the size of the transformation unit, the shape of the transformation unit, the prediction mode of the prediction unit, or the prediction mode information within the screen of the prediction unit.
[0071] The quantization unit (135) can quantize values converted to the frequency domain by the transformation unit (130). The quantization coefficients may vary depending on the block or the importance of the image. The values produced by the quantization unit (135) can be provided to the dequantization unit (140) and the reordering unit (160).
[0072] The rearrangement unit (160) can perform rearrangement of coefficient values for quantized residual values.
[0073] The rearrangement unit (160) can change a two-dimensional block-shaped coefficient into a one-dimensional vector form through a coefficient scanning method. For example, the rearrangement unit (160) can change the two-dimensional block-shaped coefficient into a one-dimensional vector form by scanning from the DC coefficient to the coefficient of the high-frequency region using a zig-zag scan method. Depending on the size of the transformation unit and the intra-screen prediction mode, a vertical scan that scans the two-dimensional block-shaped coefficient in the column direction, a horizontal scan that scans the two-dimensional block-shaped coefficient in the row direction, or a diagonal scan that scans the two-dimensional block-shaped coefficient in the diagonal direction may be used instead of the zig-zag scan. That is, depending on the size of the transformation unit and the intra-screen prediction mode, it is possible to determine which scan method among the zig-zag scan, the vertical scan, the horizontal scan, or the diagonal scan is to be used.
[0074] The entropy encoding unit (165) can perform entropy encoding based on the values produced by the rearrangement unit (160). Entropy encoding can use various encoding methods such as, for example, Exponential Golomb, Context-Adaptive Variable Length Coding (CAVLC), and Context-Adaptive Binary Arithmetic Coding (CABAC).
[0075] The entropy encoding unit (165) can encode various information such as residual value coefficient information of the encoding unit, block type information, prediction mode information, division unit information, prediction unit information, transmission unit information, motion vector information, reference frame information, block interpolation information, and filtering information from the rearrangement unit (160) and the prediction unit (120, 125).
[0076] The entropy encoding unit (165) can entropy encode the coefficient values of the encoding unit input from the rearrangement unit (160).
[0077] The inverse quantization unit (140) and the inverse transformation unit (145) inversely quantize the values quantized in the quantization unit (135) and inversely transform the values transformed in the transformation unit (130). The residual values generated in the inverse quantization unit (140) and the inverse transformation unit (145) can be combined with the predicted prediction units predicted through the motion estimation unit, motion compensation unit, and intra-screen prediction unit included in the prediction unit (120, 125) to generate a reconstructed block.
[0078] The filter unit (150) may include at least one of a deblocking filter, an offset correction unit, and an ALF (Adaptive Loop Filter).
[0079] A deblocking filter can remove block distortion caused by boundaries between blocks in a reconstructed picture. To determine whether to perform deblocking, a deblocking filter can be applied to the current block based on the pixels contained in several columns or rows within the block. When applying a deblocking filter to a block, a strong filter or a weak filter can be applied depending on the required deblocking filtering strength. Furthermore, when applying a deblocking filter, horizontal and vertical filtering can be processed in parallel when performing vertical and horizontal filtering.
[0080] The offset correction unit can correct the offset from the original image on a pixel-by-pixel basis for an image that has undergone deblocking. To perform offset correction for a specific picture, the pixels contained in the image can be divided into a certain number of regions, the regions to be offset can be determined, and the offset can be applied to those regions. Alternatively, the offset can be applied by considering the edge information of each pixel.
[0081] Adaptive Loop Filtering (ALF) can be performed based on the comparison of the filtered restored image with the original image. After dividing the pixels included in the image into predetermined groups, a filter to be applied to each group can be determined, and filtering can be performed differentially for each group. Information regarding whether to apply ALF can be transmitted by luminance signal for each coding unit (CU), and the shape and filter coefficients of the ALF filter to be applied can vary depending on each block. Furthermore, an ALF filter of the same shape (fixed shape) can be applied regardless of the characteristics of the target block.
[0082] The memory (155) can store a restored block or picture produced through the filter unit (150), and the stored restored block or picture can be provided to the prediction unit (120, 125) when performing inter-screen prediction.
[0083] FIG. 2 is a block diagram showing an image decoding device according to an embodiment of the present disclosure.
[0084] Referring to FIG. 2, the image decoding device (200) may include an entropy decoding unit (210), a rearrangement unit (215), an inverse quantization unit (220), an inverse transformation unit (225), a prediction unit (230, 235), a filter unit (240), and a memory (245).
[0085] When a video bitstream is input to a video encoding device, the input bitstream can be decoded in the opposite procedure to that of the video encoding device.
[0086] The entropy decoding unit (210) can perform entropy decoding in a procedure opposite to that of the entropy encoding unit of the video encoding device. For example, various methods such as Exponential Golomb, Context-Adaptive Variable Length Coding (CAVLC), and Context-Adaptive Binary Arithmetic Coding (CABAC) can be applied in response to the method performed in the video encoding device.
[0087] The entropy decoding unit (210) can decode information related to intra-screen prediction and inter-screen prediction performed in the encoding device.
[0088] The reordering unit (215) can perform reordering based on the method in which the bitstream entropy-decoded by the entropy decoding unit (210) is reordered by the encoding unit. The coefficients expressed in the form of a one-dimensional vector can be reordered by restoring them back to coefficients in the form of a two-dimensional block. The reordering unit (215) can perform reordering by receiving information related to the coefficient scanning performed by the encoding unit and performing reverse scanning based on the scanning order performed by the corresponding encoding unit.
[0089] The dequantization unit (220) can perform dequantization based on the quantization parameters provided from the encoding device and the coefficient values of the rearranged block.
[0090] The inverse transform unit (225) can perform inverse transform, i.e., inverse DCT, inverse DST, and inverse KLT, on the transforms, i.e., DCT, DST, and KLT, performed by the transform unit on the quantization result performed by the image encoding device. The inverse transform can be performed based on the transmission unit determined by the image encoding device. In the inverse transform unit (225) of the image decoding device, a transform technique (e.g., DCT, DST, KLT) can be selectively performed according to a plurality of pieces of information, such as a prediction method, the size and shape of the current block, the prediction mode, and the prediction direction within the screen.
[0091] The prediction unit (230, 235) can generate a prediction block based on the prediction block generation related information provided by the entropy decoding unit (210) and the previously decoded block or picture information provided by the memory (245).
[0092] As described above, when performing intra-screen prediction in the same manner as the operation in the video encoding device, if the size of the prediction unit and the size of the transformation unit are the same, intra-screen prediction for the prediction unit is performed based on the pixels on the left side of the prediction unit, the pixels on the upper left side, and the pixels on the upper side. However, when performing intra-screen prediction, if the size of the prediction unit and the size of the transformation unit are different, intra-screen prediction can be performed using reference pixels based on the transformation unit. In addition, intra-screen prediction using NxN division only for the minimum coding unit can be used.
[0093] The prediction unit (230, 235) may include a prediction unit determination unit, an inter-screen prediction unit, and an intra-screen prediction unit. The prediction unit determination unit may receive various information such as prediction unit information input from the entropy decoding unit (210), prediction mode information of an intra-screen prediction method, and motion prediction-related information of an inter-screen prediction method, and may distinguish a prediction unit from a current encoding unit and determine whether the prediction unit performs inter-screen prediction or intra-screen prediction. The inter-screen prediction unit (230) may perform inter-screen prediction on the current prediction unit based on information included in at least one of a previous picture or a subsequent picture of the current picture including the current prediction unit, using information necessary for inter-screen prediction of the current prediction unit provided from the video encoding device. Alternatively, inter-screen prediction may be performed based on information on a pre-restored portion of the current picture including the current prediction unit.
[0094] In order to perform inter-screen prediction, it is possible to determine whether the motion prediction method of the prediction unit included in the encoding unit is Skip Mode, Merge Mode, AMVP Mode, or Intra-screen Block Copy Mode based on the encoding unit.
[0095] The intra-screen prediction unit (235) can generate a prediction block based on pixel information within the current picture. If the prediction unit is a prediction unit that has performed intra-screen prediction, intra-screen prediction can be performed based on intra-screen prediction mode information of the prediction unit provided by the video encoding device. The intra-screen prediction unit (235) can include an AIS (Adaptive Intra Smoothing) filter, a reference pixel interpolation unit, and a DC filter. The AIS filter is a part that performs filtering on the reference pixels of the current block, and can determine and apply whether to apply the filter according to the prediction mode of the current prediction unit. AIS filtering can be performed on the reference pixels of the current block using the prediction mode and AIS filter information of the prediction unit provided by the video encoding device. If the prediction mode of the current block is a mode that does not perform AIS filtering, the AIS filter may not be applied.
[0096] The reference pixel interpolation unit can generate a reference pixel of a pixel unit less than an integer value by interpolating the reference pixel when the prediction mode of the prediction unit is a prediction unit that performs intra-screen prediction based on the pixel value interpolated from the reference pixel. If the prediction mode of the current prediction unit is a prediction mode that generates a prediction block without interpolating the reference pixel, the reference pixel may not be interpolated. The DC filter can generate a prediction block through filtering when the prediction mode of the current block is the DC mode.
[0097] The restored block or picture may be provided to a filter unit (240). The filter unit (240) may include a deblocking filter, an offset correction unit, and an ALF.
[0098] Information regarding whether a deblocking filter has been applied to a corresponding block or picture may be received from a video encoding device, and if a deblocking filter has been applied, information regarding whether a strong or weak filter has been applied. The deblocking filter of the video decoding device may receive information related to the deblocking filter provided by the video encoding device, and the video decoding device may perform deblocking filtering on the corresponding block.
[0099] The offset correction unit can perform offset correction on the restored image based on the type of offset correction applied to the image during encoding and offset value information.
[0100] ALF can be applied to an encoding unit based on information such as whether ALF is applied and ALF coefficient information provided from an encoding device. This ALF information can be provided by being included in a specific parameter set.
[0101] The memory (245) can store a restored picture or block so that it can be used as a reference picture or reference block, and can also provide the restored picture to an output unit.
[0102] As described above, in the following embodiments of the present disclosure, for convenience of explanation, the term coding unit is used as an encoding unit, but it may also be a unit that performs not only encoding but also decoding.
[0103] In addition, the current block represents a block to be encoded / decoded, and may represent a coding tree block (or coding tree unit), an encoding block (or encoding unit), a transform block (or transform unit), a prediction block (or prediction unit), or a block to which an in-loop filter is applied, depending on the encoding / decoding step. In this specification, a 'unit' represents a basic unit for performing a specific encoding / decoding process, and a 'block' may represent a pixel array of a predetermined size. Unless otherwise distinguished, 'block' and 'unit' may be used with the same meaning. For example, in the embodiment described below, an encoding block (coding block) and an encoding unit (coding unit) may be understood to have the same meaning.
[0104] Furthermore, we will refer to the picture that contains the current block as the current picture.
[0105] When encoding the current picture, redundant data between pictures can be removed through inter-prediction. Inter-prediction can be performed on a block-by-block basis. Specifically, a prediction block of the current block can be generated from a reference picture using motion information of the current block. Here, the motion information can include at least one of a motion vector, a reference picture index, and a prediction direction.
[0106] Figure 3 is a diagram schematically illustrating the process of performing inter prediction in an encoder and decoder.
[0107] As in the example illustrated in FIG. 3, to perform inter prediction, motion information for the current block can be acquired (S310). Here, the motion information can include at least one of a motion vector, a reference picture index, or a weight applied to the prediction block. For the current block, motion information for at least one of the L0 direction or the L1 direction can be acquired.
[0108] In the encoder, motion information of the current block can be derived through motion estimation, and the derived motion information can be encoded and signaled to the decoder. Meanwhile, the encoding / decoding of motion information can be based on a motion information merging mode, a motion vector prediction mode, a template-based motion estimation method, or a bilateral matching method, which will be described later.
[0109] In the decoder, motion information of the current block can be derived based on the information transmitted from the encoder.
[0110] Alternatively, the motion information of the current block can be derived from the decoder in the same manner as in the encoder. This method can be referred to as decoder-side motion estimation.
[0111] Once motion information for the current block is derived, a prediction block for the current block can be obtained based on the derived motion information (S320). For example, a reference block spaced apart by a motion vector from the current block's position within the reference picture can be set as the prediction block for the current block.
[0112] Below, we will explain in more detail the process of calculating inter predictions.
[0113] The motion information of the current block can be generated through motion estimation.
[0114] Figure 4 shows an example in which motion estimation is performed.
[0115] In Fig. 4, it is assumed that the POC (Picture Order Count) of the current picture is T, and the POC of the reference picture is (T-1).
[0116] A search range for motion estimation can be set from the same location as the reference point of the current block within the reference picture. Here, the reference point may be the location of the upper left sample of the current block.
[0117] For example, in FIG. 4, a rectangle of size (w0+w01) and (h0+h1) is set as a search range centered on a reference point. In the above example, w0, w1, h0, and h1 may have the same value. Alternatively, at least one of w0, w1, h0, and h1 may be set to have a different value from the other. Alternatively, the sizes of w0, w1, h0, and h1 may be determined so as not to exceed a Coding Tree Unit (CTU) boundary, a slice boundary, a tile boundary, or a picture boundary.
[0118] Within the search range, reference blocks of the same size as the current block can be set, and the cost of each reference block relative to the current block can be measured. The cost can be calculated using the similarity between the two blocks.
[0119] For example, the cost can be calculated based on the absolute sum of the differences between the original samples in the current block and the original samples (or reconstructed samples) in the reference block. A smaller absolute sum can reduce the cost.
[0120] Afterwards, the cost of each reference block is compared, and the reference block with the optimal cost can be set as the prediction block of the current block.
[0121] Additionally, the distance between the current block and the reference block can be set as a motion vector. Specifically, the x-coordinate difference and the y-coordinate difference between the current block and the reference block can be set as the motion vector.
[0122] Furthermore, the index of the picture containing the reference block identified through motion estimation is set as the reference picture index.
[0123] Additionally, the prediction direction can be set based on whether the reference picture belongs to the L0 reference picture list or the L1 reference picture list.
[0124] Additionally, motion estimation can be performed for each of the L0 direction and the L1 direction. If prediction is performed for both the L0 direction and the L1 direction, motion information in the L0 direction and motion information in the L1 direction can be generated, respectively.
[0125] Figures 5 and 6 illustrate examples in which a prediction block of a current block is generated based on motion information generated through motion estimation.
[0126] Figure 5 shows an example of generating a prediction block by unidirectional (i.e., L0 direction) prediction, and Figure 6 shows an example of generating a prediction block by bidirectional (i.e., L0 and L1 direction) prediction.
[0127] In the case of unidirectional prediction, a prediction block of the current block is generated using a single motion information. For example, the motion information may include an L0 motion vector, an L0 reference picture index, and prediction direction information indicating the L0 direction.
[0128] In the case of bidirectional prediction, a prediction block is generated using two pieces of motion information. For example, a reference block in the L0 direction, determined based on motion information about the L0 direction (L0 motion information), can be set as an L0 prediction block, and an L1 prediction block can be generated based on a reference block in the L1 direction, determined based on motion information about the L1 direction (L1 motion information). Thereafter, the L0 prediction block and the L1 prediction block can be weighted and combined to generate a prediction block of the current block.
[0129] In the examples shown in FIGS. 4 to 6, the L0 reference picture is illustrated as existing in the previous direction of the current picture (i.e., having a POC value smaller than that of the current picture), and the L1 reference picture is illustrated as existing in the subsequent direction of the current picture (i.e., having a POC value larger than that of the current picture).
[0130] However, unlike the illustrated example, the L0 reference picture may exist in the subsequent direction of the current picture, or the L1 reference picture may exist in the previous direction of the current picture. For example, both the L0 reference picture and the L1 reference picture may exist in the previous direction of the current picture, or both may exist in the subsequent direction of the current picture. Alternatively, bidirectional prediction may be performed using the L0 reference picture existing in the subsequent direction of the current picture and the L1 reference picture existing in the previous direction of the current picture.
[0131] Motion information for blocks for which inter prediction has been performed can be stored in memory. At this time, the motion information can be stored on a sample-by-sample basis. Specifically, the motion information for a block to which a specific sample belongs can be stored as motion information for that specific sample. The stored motion information can be used to derive motion information for neighboring blocks to be encoded / decoded in the future.
[0132] In the encoder, information encoding residual samples corresponding to the difference between the sample of the current block (i.e., the original sample) and the predicted sample, and motion information required to generate a predicted block can be signaled to the decoder. The decoder can decode information about the signaled difference value to derive a difference sample, and add a prediction sample within the predicted block generated using the motion information to the difference sample to generate a restored sample.
[0133] At this time, in order to effectively compress the motion information signaled to the decoder, one of a plurality of inter prediction modes may be selected. Here, the plurality of inter prediction modes may include a motion information merging mode and a motion vector prediction mode.
[0134] The motion vector prediction mode is a mode that signals by encoding the difference between a motion vector and a motion vector prediction value. Here, the motion vector prediction value can be derived based on motion information of neighboring blocks or neighboring samples adjacent to the current block.
[0135] Figure 7 shows the locations referenced to derive motion vector prediction values.
[0136] For convenience of explanation, the current block is assumed to have a size of 4x4.
[0137] In the illustrated example, 'LB' represents a sample contained in the leftmost column and bottommost row within the current block. 'RT' represents a sample contained in the rightmost column and topmost row within the current block. A0 to A4 represent samples neighboring to the left of the current block, and B0 to B5 represent samples neighboring to the top of the current block. For example, A1 represents a sample neighboring to the left of LB, and B1 represents a sample neighboring to the top of RT.
[0138] Col indicates the location of a sample neighboring the lower right of the current block within a co-located picture. A co-located picture is a picture different from the current picture, and information for specifying the co-located picture (e.g., a co-located picture index) can be explicitly encoded and signaled in the bitstream. Alternatively, a reference picture having a predefined reference picture index can be set as the co-located picture.
[0139] The motion vector prediction value of the current block can be derived from at least one motion vector prediction candidate included in a motion vector prediction list.
[0140] The number of motion vector prediction candidates that can be inserted into the motion vector prediction list (i.e., the size of the list) may be predefined in the encoder and decoder. For example, the maximum number of motion vector prediction candidates may be 2.
[0141] A motion vector stored at the location of a neighboring sample adjacent to the current block or a scaled motion vector derived by scaling the motion vector can be inserted into the motion vector prediction list as a motion vector prediction candidate. At this time, the motion vector prediction candidates can be derived by scanning the neighboring samples adjacent to the current block in a predefined order.
[0142] For example, it is possible to check whether a motion vector is stored at each location in the order of A0 to A4. Then, according to the above scanning order, the first available motion vector found can be inserted into the motion vector prediction list as a motion vector prediction candidate.
[0143] As another example, in the order of A0 to A4, it is checked whether a motion vector is stored at each position, and the motion vector of the position that is found first and has the same reference picture as the current block can be inserted into the motion vector prediction list as a motion vector prediction candidate. If there is no neighboring sample that has the same reference picture as the current block, a motion vector prediction candidate can be derived based on the first found available vector. Specifically, the first found available motion vector can be scaled, and then the scaled motion vector can be inserted into the motion vector prediction list as a motion vector prediction candidate. At this time, the scaling can be performed based on the output order difference between the current picture and the reference picture (i.e., the POC difference) and the output order difference between the current picture and the reference picture of the neighboring sample (i.e., the POC difference).
[0144] Furthermore, it is possible to check whether a motion vector is stored at each location in the order of B0 to B5. Then, according to the above scanning order, the first available motion vector found can be inserted into the motion vector prediction list as a motion vector prediction candidate.
[0145] As another example, in the order of B0 to B5, it is checked whether a motion vector is stored at each position, and the motion vector of the position that has the same reference picture as the current block that is found first can be inserted into the motion vector prediction list as a motion vector prediction candidate. If there is no neighboring sample that has the same reference picture as the current block, a motion vector prediction candidate can be derived based on the first found available vector. Specifically, the first found available motion vector can be scaled, and then the scaled motion vector can be inserted into the motion vector prediction list as a motion vector prediction candidate. At this time, the scaling can be performed based on the output order difference between the current picture and the reference picture (i.e., the POC difference) and the output order difference between the current picture and the reference picture of the neighboring sample (i.e., the POC difference).
[0146] As in the example described above, a motion vector prediction candidate can be derived from a sample adjacent to the left of the current block, and a motion vector prediction candidate can be derived from a sample adjacent to the top of the current block.
[0147] At this time, the motion vector prediction candidate derived from the left sample may be inserted into the motion vector prediction list before the motion vector prediction candidate derived from the upper sample. In this case, the index assigned to the motion vector prediction candidate derived from the left sample may have a smaller value than the motion vector prediction candidate derived from the upper sample.
[0148] Conversely, the motion vector prediction candidate derived from the top sample may be inserted into the motion vector prediction list before the motion vector prediction candidate derived from the left sample.
[0149] Among the motion vector prediction candidates included in the above motion vector prediction list, the motion vector prediction candidate with the highest encoding efficiency can be set as the motion vector predictor (MVP) of the current block. In addition, index information indicating the motion vector prediction candidate set as the motion vector predictor of the current block among the plurality of motion vector prediction candidates can be encoded and signaled to a decoder. When the number of motion vector prediction candidates is two, the index information can be a 1-bit flag (e.g., an MVP flag). In addition, a motion vector difference (MVD), which is the difference between the motion vector of the current block and the motion vector predictor, can be encoded and signaled to a decoder.
[0150] The decoder can construct a motion vector prediction list, similar to the encoder. Furthermore, it can decode index information from the bitstream and select one of multiple motion vector prediction candidates based on the decoded index information. The selected motion vector prediction candidate can be set as the motion vector prediction value of the current block.
[0151] Additionally, the motion vector differential can be decoded from the bitstream. Afterwards, the motion vector of the current block can be derived by combining the motion vector prediction value and the motion vector differential value.
[0152] When bidirectional prediction is applied to the current block, a motion vector prediction list can be generated for each of the L0 and L1 directions. That is, the motion vector prediction list can be composed of motion vectors in the same direction. Accordingly, the motion vector of the current block and the motion vector prediction candidates included in the motion vector prediction list have the same direction.
[0153] When the motion vector prediction mode is selected, reference picture index and prediction direction information can be explicitly encoded and signaled to the decoder. For example, when there are multiple reference pictures in the reference picture list and motion estimation is performed for each of the multiple reference pictures, a reference picture index for specifying a reference picture from which motion information of the current block is derived among the multiple reference pictures can be explicitly encoded and signaled to the decoder.
[0154] At this time, if the reference picture list contains only one reference picture, encoding / decoding of the reference picture index may be omitted.
[0155] The prediction direction information may be an index pointing to one of L0 unidirectional prediction, L1 unidirectional prediction, or bidirectional prediction. Alternatively, an L0 flag indicating whether prediction is performed in the L0 direction and an L1 flag indicating whether prediction is performed in the L1 direction may be encoded and signaled, respectively.
[0156] Motion Information Merge Mode is a mode in which the motion information of the current block is set to be identical to the motion information of neighboring blocks. In Motion Information Merge Mode, motion information can be encoded / decoded using a motion information merge list.
[0157] Motion information merging candidates can be derived based on motion information from neighboring blocks or neighboring samples adjacent to the current block. For example, after defining reference locations around the current block, it is possible to check whether motion information exists at the defined reference locations. If motion information exists at the defined reference locations, the motion information at those locations can be inserted into the motion information merging list as a motion information merging candidate.
[0158] In the example of Fig. 7, the predefined reference positions may include at least one of A0, A1, B0, B1, B5, and Col. Furthermore, motion information merging candidates may be derived in the order of A1, B1, B0, A0, B5, and Col.
[0159] Among the motion information merge candidates included in the motion information merge list, the motion information of the motion information merge candidate with the optimal cost can be set as the motion information of the current block. Furthermore, index information (e.g., a merge index) indicating the motion information merge candidate selected from among the multiple motion information merge candidates can be encoded and transmitted to the decoder.
[0160] In the decoder, a motion information merge list can be constructed in the same manner as in the encoder. Furthermore, motion information merge candidates can be selected based on the merge index decoded from the bitstream. The motion information of the selected motion information merge candidate can be set as the motion information of the current block.
[0161] Unlike the motion vector prediction list, the motion information merge list is composed of a single list regardless of the prediction direction. That is, the motion information merge candidates included in the motion information merge list may have only L0 motion information or only L1 motion information, or may have bidirectional motion information (i.e., L0 motion information and L1 motion information).
[0162] Motion information about the current block can also be derived using the restoration sample area surrounding the current block. Here, the restoration sample area used to derive motion information about the current block can be referred to as a template.
[0163] Figure 8 is a diagram for explaining a template-based motion estimation method.
[0164] In Fig. 4, it is described that the predicted block of the current block is determined based on the cost between the current block and the reference block within the search range. According to the present embodiment, unlike Fig. 4, motion estimation for the current block can be performed based on the cost between a template neighboring the current block (hereinafter referred to as the "current template") and a reference template having the same size and shape as the current template.
[0165] For example, the cost can be calculated based on the absolute sum of the differences between the restored samples in the current template and the restored samples in the reference block. A smaller absolute sum can reduce the cost.
[0166] Once the reference template with the optimal cost is determined relative to the current template within the search range, the reference block neighboring the reference template can be set as the predicted block of the current block.
[0167] And, motion information of the current block can be set based on the distance between the current block and the reference block, the index of the picture to which the reference block belongs, and whether the reference picture is included in the L0 or L1 reference picture list.
[0168] Since the template defines the restored area around the current block as a template, the decoder itself can perform motion estimation in the same manner as the encoder. Accordingly, when deriving motion information using a template, there is no need to encode and signal the motion information other than information indicating whether a template is used.
[0169] The current template may include at least one region adjacent to the top of the current block or an adjacent region to the left of the current block. The region adjacent to the top may include at least one row, and the region adjacent to the left may include at least one column.
[0170] Figure 9 shows examples of template configurations.
[0171] The current template can be configured according to one of the examples illustrated in FIG. 9.
[0172] Alternatively, unlike the example illustrated in FIG. 9, the template may be configured only with the area adjacent to the left of the current block, or only with the area adjacent to the top of the current block.
[0173] The size and / or shape of the current template may be predefined in the encoder and decoder.
[0174] Alternatively, after defining a plurality of template candidates having different sizes and / or shapes, index information specifying one of the plurality of template candidates can be encoded and signaled to a decoder.
[0175] Alternatively, one of multiple template candidates can be adaptively selected based on at least one of the size, shape, or position of the current block. For example, if the current block borders the upper boundary of the CTU, the current template can be constructed using only the region adjacent to the left of the current block.
[0176] Template-based motion estimation can be performed for each of the reference pictures stored in the reference picture list. Alternatively, motion estimation can be performed only for some of the reference pictures. For example, motion estimation can be performed only for reference pictures with a reference picture index of 0, or only for reference pictures with a reference picture index less than a threshold, or only for reference pictures with a POC difference from the current picture less than a threshold.
[0177] Alternatively, a reference picture index can be explicitly encoded and signaled, and then motion estimation can be performed only for the reference picture pointed to by the reference picture index.
[0178] Alternatively, motion estimation can be performed on the reference picture of the neighboring block corresponding to the current template. For example, if the template consists of a left adjacent region and an upper adjacent region, at least one reference picture can be selected using at least one of the reference picture index of the left adjacent block or the reference picture index of the upper adjacent block. Thereafter, motion estimation can be performed on the selected at least one reference picture.
[0179] Information indicating whether template-based motion estimation is applied can be encoded and signaled to a decoder. The information can be a 1-bit flag. For example, a true (1) flag indicates that template-based motion estimation is applied in the L0 direction and L1 direction of the current block. On the other hand, a false (0) flag indicates that template-based motion estimation is not applied. In this case, the motion information of the current block can be derived based on the motion information merging mode or the motion vector prediction mode.
[0180] Conversely, template-based motion estimation may be applied only when it is determined that neither the motion information merging mode nor the motion vector prediction mode is applied to the current block. For example, if the first flag indicating whether the motion information merging mode is applied and the second flag indicating whether the motion vector prediction mode is applied are both 0, template-based motion estimation may be performed.
[0181] For each of the L0 and L1 directions, information indicating whether template-based motion estimation is applied can be signaled. That is, whether template-based motion estimation is applied in the L0 direction and whether template-based motion estimation is applied in the L1 direction can be determined independently. Accordingly, template-based motion estimation can be applied to one of the L0 and L1 directions, while another mode (e.g., motion information merging mode or motion vector prediction mode) can be applied to the other.
[0182] When template-based motion estimation is applied to both the L0 direction and the L1 direction, the prediction block of the current block can be generated based on a weighted sum operation of the L0 prediction block and the L1 prediction block. Alternatively, even when template-based motion estimation is applied to one of the L0 direction and the L1 direction, but another mode is applied to the other direction, the prediction block of the current block can be generated based on a weighted sum operation of the L0 prediction block and the L1 prediction block.
[0183] Alternatively, a template-based motion estimation method may be inserted as a motion information merging candidate in a motion information merging mode or a motion vector prediction candidate in a motion vector prediction mode. In this case, whether or not to apply a template-based motion estimation method may be determined based on whether the selected motion information merging candidate or the selected motion vector prediction candidate indicates a template-based motion estimation method.
[0184] Based on the two-way matching method, it is also possible to generate movement information of the current block.
[0185] Figure 10 is a diagram for explaining a motion estimation method based on a bilateral matching method.
[0186] The bilateral matching method can be performed only when the temporal order (i.e., POC) of the current picture exists between the temporal order of the L0 reference picture and the temporal order of the L1 reference picture.
[0187] When a bilateral matching method is applied, a search range can be set for each of the L0 reference picture and the L1 reference picture. At this time, an L0 reference picture index for identifying the L0 reference picture and an L1 reference picture index for identifying the L1 reference picture can be encoded and signaled, respectively.
[0188] As another example, only the L0 reference picture index may be encoded and signaled, and an L1 reference picture may be selected based on the distance between the current picture and the L0 reference picture (hereinafter referred to as the L0 POC difference). For example, among the L1 reference pictures included in the L1 reference picture list, an L1 reference picture having an absolute value of the distance from the current picture (hereinafter referred to as the L1 POC difference) equal to the absolute value of the distance between the current picture and the L0 reference picture may be selected. If there is no L1 reference picture having an L1 POC difference equal to the L0 POC difference, an L1 reference picture having an L1 POC difference most similar to the L0 POC difference may be selected among the L1 reference pictures.
[0189] At this time, among the L1 reference pictures, only L1 reference pictures that are temporally different from the L0 reference picture can be used for bilateral matching. For example, if the POC of the L0 reference picture is smaller than that of the current picture, one of the L1 reference pictures that has a POC larger than that of the current picture can be selected.
[0190] Conversely, one could also encode and signal only the L1 reference picture index, and select the L0 reference picture based on the distance between the current picture and the L1 reference picture.
[0191] Alternatively, a bilateral matching method may be performed using the L0 reference picture having the closest distance to the current picture among the L0 reference pictures and the L1 reference picture having the closest distance to the current picture among the L1 reference pictures.
[0192] Alternatively, a bilateral matching method may be performed using an L0 reference picture (e.g., index 0) assigned with a predefined index in the L0 reference picture list and an L1 reference picture (e.g., index 0) assigned with a predefined index in the L1 reference picture list.
[0193] Alternatively, the LX (X is 0 or 1) reference picture may be selected based on an explicitly signaled reference picture index, and the L|X-1| reference picture may be selected as a reference picture having the closest distance to the current picture among the L|X-1| reference pictures, or as a reference picture having a predefined index in the L|X-1| reference picture list.
[0194] As another example, L0 and / or L1 reference pictures can be selected based on motion information of neighboring blocks of the current block. For example, L0 and / or L1 reference pictures to be used for bilateral matching can be selected using the reference picture index of the neighboring block to the left or above the current block.
[0195] The search range can be set within a predetermined range from a collocated block within a reference picture.
[0196] As another example, the search range can be set based on initial motion information. This initial motion information can be derived from neighboring blocks of the current block. For example, the motion information of the left or top neighboring block of the current block can be set as the initial motion information of the current block.
[0197] When the bilateral matching method is applied, the L0 motion vector and the L1 motion vector are set to have opposite directions. This indicates that the signs of the L0 motion vector and the L1 motion vector have opposite signs. In addition, the size of the LX motion vector can be proportional to the distance between the current picture and the LX reference picture (i.e., the POC difference).
[0198] Thereafter, motion estimation can be performed using the cost between a reference block belonging to the search range of the L0 reference picture (hereinafter referred to as an L0 reference block) and a reference block belonging to the search range of the L1 reference picture (hereinafter referred to as an L1 reference block).
[0199] If an L0 reference block whose vector to the current block is (x, y) is selected, an L1 reference block located at a distance of (-Dx, -Dy) from the current block can be selected. Here, D can be determined by the ratio of the distance between the current picture and the L0 reference picture and the distance between the L1 reference picture and the current picture.
[0200] For example, in the example illustrated in FIG. 10, the absolute value of the distance between the current picture (T) and the L0 reference picture (T-1) and the absolute value of the distance between the current picture (T) and the L1 reference picture (T+1) are equal to each other. Accordingly, in the illustrated example, the L0 motion vector (x0, y0) and the L1 motion vector (x1, y1) have equal magnitudes but opposite distances. If an L1 reference picture with a POC of (T+2) were used, the L1 motion vector (x1, y1) would be set to (-2*x0, -2*y0).
[0201] Once the L0 reference block and L1 reference block with the optimal cost are selected, the L0 reference block and the L1 reference block can be set as the L0 prediction block and the L1 prediction block of the current block, respectively. Thereafter, the final prediction block of the current block can be generated through a weighted sum operation of the L0 reference block and the L1 reference block.
[0202] When the bilateral motion matching method is applied, the decoder can perform motion estimation in the same manner as the encoder. Accordingly, information indicating whether the bilateral motion matching method is applied can be explicitly encoded / decoded, while encoding / decoding of motion information such as motion vectors can be omitted. As previously explained, at least one of the L0 reference picture index or L1 reference picture index may also be explicitly encoded / decoded.
[0203] As another example, information indicating whether a bilateral matching method is applied may be explicitly encoded / decoded, and if a bilateral matching method is applied, the L0 motion vector or the L1 motion vector may be explicitly encoded and signaled. If the L0 motion vector is signaled, the L1 motion vector may be derived based on the POC difference between the current picture and the L0 reference picture and the POC difference between the current picture and the L1 reference picture. If the L1 motion vector is signaled, the L0 motion vector may be derived based on the POC difference between the current picture and the L0 reference picture and the POC difference between the current picture and the L1 reference picture. In this case, the encoder may explicitly encode the smaller one of the L0 motion vector and the L1 motion vector.
[0204] Information indicating whether a bilateral matching method has been applied may be a 1-bit flag. For example, a true flag (e.g., 1) may indicate that a bilateral matching method has been applied to the current block. A false flag (e.g., 0) may indicate that a bilateral matching method has not been applied to the current block. In this case, the current block may be subject to motion information merging mode or motion vector prediction mode.
[0205] Conversely, the bilateral matching method may be applied only when it is determined that neither the motion information merging mode nor the motion vector prediction mode is applied to the current block. For example, the bilateral matching method may be applied when both the first flag indicating whether the motion information merging mode is applied and the second flag indicating whether the motion vector prediction mode is applied are 0.
[0206] Alternatively, the bilateral matching method may be inserted as a motion information merging candidate in the motion information merging mode or as a motion vector prediction candidate in the motion vector prediction mode. In this case, whether the bilateral matching method is applied may be determined based on whether the selected motion information merging candidate or the selected motion vector prediction candidate indicates the bilateral matching method.
[0207] In the bidirectional matching method, it is exemplified that the temporal order of the current picture must exist between the temporal order of the L0 reference picture and the temporal order of the L1 reference picture. A unidirectional matching method, which is not subject to the constraints of the above bidirectional matching method, may also be applied to generate a prediction block of the current block. Specifically, in the unidirectional matching method, two reference pictures having a temporal order (i.e., POC) smaller than that of the current block or two reference pictures having a temporal order larger than that of the current block may be used. In this case, both reference pictures may be derived from the L0 reference picture list or the L1 reference picture list. Alternatively, one of the two reference pictures may be derived from the L0 reference picture list and the other may be derived from the L1 reference picture list.
[0208] Figure 11 is a diagram for explaining a motion estimation method based on a one-way matching method.
[0209] The unidirectional matching method can be performed based on two reference pictures having a POC smaller than that of the current picture (i.e., forward reference pictures) or two reference pictures having a POC larger than that of the current picture (i.e., backward reference pictures). In Fig. 11, motion estimation based on the unidirectional matching method is exemplified as being performed based on a first reference picture (T-1) and a second reference picture (T-2) having a POC smaller than that of the current picture (T).
[0210] At this time, a first reference picture index for identifying a first reference picture and a second reference picture index for identifying a second reference picture may be encoded and signaled, respectively. At this time, among the two reference pictures used in the unidirectional matching method, a reference picture having a smaller POC difference from the current picture may be set as the first reference picture. Accordingly, when the first reference picture is selected, only reference pictures included in the reference picture list having a larger POC difference from the current picture than the first reference picture may be set as the second reference picture. The second reference picture index may be set to point to an index of one of the rearranged reference pictures after rearranging reference pictures having the same temporal direction as the first reference picture and having a larger POC difference from the current picture than the first reference picture.
[0211] Conversely, the reference picture with a larger POC difference from the current picture among the two reference pictures can be set as the first reference picture. In this case, the second reference picture index can be set to point to the index of one of the rearranged reference pictures after rearranging the reference pictures that have the same temporal direction as the first reference picture and have a smaller POC difference from the current picture than the first reference picture.
[0212] Alternatively, a one-way matching method may be performed using a reference picture assigned with a predefined index within a reference picture list and a reference picture having the same temporal direction as the reference picture. For example, a reference picture having an index of 0 within the reference picture list may be set as the first reference picture, and a reference picture having the smallest index among the reference pictures having the same temporal direction as the first reference picture within the reference picture list may be selected as the second reference picture.
[0213] Both the first reference picture and the second reference picture can be selected from the L0 reference picture list or the L1 reference picture list. In Fig. 11, two L0 reference pictures are illustrated as being used in the unidirectional matching method. Alternatively, the first reference picture may be selected from the L0 reference picture list, and the second reference picture may be selected from the L1 reference picture list.
[0214] Information indicating whether the first reference picture and / or the second reference picture belongs to the L0 reference picture list or the L1 reference picture list may be additionally encoded / decoded.
[0215] Alternatively, one-way matching can be performed using one of the L0 reference picture list and the L1 reference picture list, whichever is set as default. Alternatively, two reference pictures can be selected from the L0 reference picture list and the L1 reference picture list, whichever has a larger number of reference pictures.
[0216] Afterwards, a search range within the first reference picture and the second reference picture can be set.
[0217] The search range can be set within a predetermined range from a collocated block within a reference picture.
[0218] As another example, the search range can be set based on initial motion information. This initial motion information can be derived from neighboring blocks of the current block. For example, the motion information of the left or top neighboring block of the current block can be set as the initial motion information of the current block.
[0219] Thereafter, motion estimation can be performed using the cost between the first reference block belonging to the search range of the first reference picture and the second reference block belonging to the search range of the second reference picture.
[0220] At this time, under the unidirectional matching method, the size of the motion vector should be set to increase in proportion to the distance between the current picture and the reference picture. Specifically, if a first reference block whose vector with the current picture is (x, y) is selected, the second reference block should be spaced apart from the current block by (Dx, Dy). Here, D can be determined by the ratio of the distance between the current picture and the first reference picture and the distance between the current picture and the second reference picture.
[0221] For example, in the example of FIG. 11, the distance between the current picture and the first reference picture (i.e., the POC difference) is 1, and the distance between the current picture and the second reference picture (i.e., the POC difference) is 2. Accordingly, when the first motion vector for the first reference block in the first reference picture is (x0, y0), the second motion vector (x1, y1) for the second reference block in the second reference picture can be set to (2x0, 2y0).
[0222] Once the first and second reference blocks with optimal costs are selected, the first and second reference blocks can be set as the first and second prediction blocks of the current block, respectively. Thereafter, a weighted sum operation of the first and second prediction blocks can be performed to generate the final prediction block of the current block.
[0223] When a unidirectional motion matching method is applied, the decoder can perform motion estimation in the same manner as the encoder. Accordingly, information indicating whether a unidirectional motion matching method is applied can be explicitly encoded / decoded, while encoding / decoding of motion information such as motion vectors can be omitted. As previously explained, at least one of the first reference picture index or the second reference picture index may also be explicitly encoded / decoded.
[0224] As another example, information indicating whether a unidirectional matching method is applied may be explicitly encoded / decoded, and if a unidirectional matching method is applied, the first motion vector or the second motion vector may be explicitly encoded and signaled. If the first motion vector is signaled, the second motion vector may be derived based on the POC difference between the current picture and the first reference picture and the POC difference between the current picture and the second reference picture. If the second motion vector is signaled, the first motion vector may be derived based on the POC difference between the current picture and the first reference picture and the POC difference between the current picture and the second reference picture. In this case, the encoder may explicitly encode a smaller one of the first motion vector and the second motion vector.
[0225] Information indicating whether a unidirectional matching method has been applied may be a 1-bit flag. For example, a true flag (e.g., 1) may indicate that a unidirectional matching method has been applied to the current block. A false flag (e.g., 0) may indicate that a unidirectional matching method has not been applied to the current block. In this case, the current block may be subject to motion information merging mode or motion vector prediction mode.
[0226] Conversely, the one-way matching method may be applied only when it is determined that neither the motion information merging mode nor the motion vector prediction mode is applied to the current block. For example, the one-way matching method may be applied when the first flag indicating whether the motion information merging mode is applied and the second flag indicating whether the motion vector prediction mode is applied are both 0.
[0227] Alternatively, the unidirectional matching method may be inserted as a motion information merging candidate in the motion information merging mode or as a motion vector prediction candidate in the motion vector prediction mode. In this case, whether the unidirectional matching method is applied may be determined based on whether the selected motion information merging candidate or the selected motion vector prediction candidate indicates the unidirectional matching method.
[0228]
[0229] When detecting motion between frames, the precision of the motion vector can be adjusted. Specifically, the location of each sample within a picture is defined as an integer position. However, the position reflecting the motion may be a decimal position, not an integer position.
[0230] Taking this into account, we can search for motion vectors more precisely through reference picture interpolation.
[0231] Figures 12 and 13 are diagrams showing examples in which a prediction block is derived according to motion vector precision.
[0232] Figure 12 shows the position of the current block within the current picture, and Figure 13 shows the position of the reference block according to the motion vector precision.
[0233] As in the examples illustrated in FIGS. 12 and 13, the motion vector of the current block can be defined as the distance from a sample corresponding to the upper left position of the current block in the reference picture to a sample corresponding to the upper left position of the reference block in the reference picture.
[0234] Figure 13 (a) illustrates a case where the motion vector precision of the current block is an integer pel, Figure 13 (b) illustrates a case where the motion vector precision of the current block is 1 / 2 pel, and Figure 13 (c) illustrates a case where the motion vector precision of the current block is 1 / 4 pel.
[0235] In Figure 13, motion vectors are expressed up to 1 / 4 vector precision, but motion vectors can also be expressed more precisely, such as 1 / 8, 1 / 16, or 1 / 32.
[0236] Meanwhile, information indicating the motion vector precision of the current block may be encoded and signaled. For example, the information may be an index identifying one of the motion vector precision candidates. Specifically, each of the motion vector precision candidates may be assigned a different index, and the information may indicate the index of the motion vector precision candidate applied to the current block.
[0237] By adjusting the precision of the motion vector used for inter-screen prediction, more precise motion vector search can be achieved. If the reference block indicated by the motion vector exists at a real number location, the samples at the real number location can be generated using samples at integer locations and an interpolation filter. Furthermore, motion vectors expressed as real numbers can be scaled up to integers and then encoded / decoded.
[0238] In this way, motion vectors (MV), motion vector predictors (MVPs), and motion vector differences (MVDs) can be encoded / decoded as integer values through integerization. Specifically, motion vectors, motion vector predictors, and / or motion vector differences can be integerized based on motion vector precision.
[0239] For example, if the motion vector precision is 1 / N, integerization can be performed by multiplying the motion vector difference MVD by N. For example, if the motion vector difference MVD is (4 / 16, 8 / 16), the motion vector difference MVD can be integerized by multiplying by 16. That is, the integerized motion vector difference MVD can be expressed as (4, 8).
[0240] Based on the motion vector precision, the actual MVD can be derived from the integerized MVD. For example, if the motion vector precision is 1 / N, the actual MVD can be derived by dividing the integerized MVD by N. For example, if the integerized MVD is (4, 8) and the motion vector precision is 1 / 8, the actual MVD can be (4 / 8, 8 / 8). Alternatively, if the integerized MVD is (4, 8) and the motion vector precision is 1 / 4, the actual MVD can be (4 / 4, 8 / 4).
[0241] Depending on the motion vector precision, the range of expression of the integerized MVD may vary. For example, assume that the motion vector difference MVD is (4 / 16, 8 / 16) (i.e., (1 / 4, 2 / 4)). If the motion vector precision is 1 / 16, the integerized MVD is derived as (4, 8). On the other hand, if the motion vector precision is 1 / 4, the integerized MVD is derived as (1, 2).
[0242] Comparing the two cases above, if the motion vector precision is adjusted from 1 / 16 to 1 / 4, the integerized MVD value can be reduced from (4, 8) to (1, 2).
[0243] As a result, depending on the motion vector precision, the number of bits required to encode / decode the integerized motion vector difference MVD may vary. Accordingly, when encode / decode the motion vector difference MVD, a motion vector precision that can minimize the number of bins can be selected. Then, based on the selected motion vector precision, the motion vector difference MVD can be integerized, and the integerized motion vector difference MVD can be encode / decoded. In addition, information regarding the motion vector precision can be additionally encode / decode.
[0244] In the decoder, the actual MVD can be reconstructed from the decoded MVD based on the motion vector precision. Then, the motion vector MV can be derived by combining the reconstructed MVD and the motion vector prediction value MVP.
[0245] As above, the method of adjusting the value of the motion vector difference MVD to be encoded / decoded based on the motion vector precision is called AMVR (Adaptive Motion Vector Resolution).
[0246] Figures 14 and 15 are diagrams for explaining the process of encoding and decoding a motion vector difference value, respectively, when the AMVR method is applied.
[0247] For convenience of explanation, it is assumed that the motion vector and motion vector difference are expressed in units of 1 / 16 before integerization is performed, and 1 / 16 is expressed as the original motion vector precision.
[0248] The motion vector difference value MVD can be derived by differentiating the motion vector prediction value MVP from the motion vector MV (S1110).
[0249] The motion vector difference MVD may be composed of a horizontal direction component (i.e., x-axis component) and a vertical direction component (i.e., y-axis component).
[0250] If the motion vector difference value is 0, that is, if both the horizontal direction component and the vertical direction component are 0, the value of the motion vector difference value MVD to be encoded becomes 0 regardless of the motion vector precision. Therefore, if the motion vector difference value MVD is 0, encoding of AMVR-related information can be omitted (S1120).
[0251] On the other hand, if the motion vector difference is not 0, i.e., if at least one of the horizontal direction component and the vertical direction component is not 0, the motion vector precision can be determined (S1130). Meanwhile, the motion vector precision can be encoded as AMVR-related information.
[0252] Information related to AMVR may include at least one of a flag (e.g., amvr_flag) indicating whether the AMVR method is applied to the current block, and an index (e.g., amvr_prec_idx) indicating one of a plurality of motion precision candidates when the AMVR method is applied.
[0253] If the AMVR method is not applied to the current block, the motion vector precision can be set to a default value. In this case, amvr_flag can be encoded as a value of 0. Meanwhile, the default value can be 1, 1 / 2, 1 / 4, 1 / 8, or 1 / 16.
[0254] When the AMVR method is applied to the current block, an index indicating one of multiple motion vector precision candidates, i.e., amvr_prec_idx, may be additionally decoded. In this case, amvr_flag may be encoded with a value of 1, and amvr_prec_idx may be encoded with a value from 0 to (n-1), where n represents the number of motion vector precision candidates. For example, the multiple motion vector precision candidates may include at least one of 4, 2, 1, 1 / 2, 1 / 4, 1 / 8, or 1 / 16. Meanwhile, the default value may not be set to the multiple motion vector precision candidates indicated by the index. That is, when the motion vector precision of the current block is the default value, it is encoded and signaled with the value of amvr_flag, 0, and encoding of amvr_prec_idx may be omitted.
[0255] In the encoder, the optimal motion vector precision can be determined by performing Rate Distortion Optimization (RDO) for each combination of amvr_flag and amvr_prec_idx. That is, the combination with the optimal cost can be selected by performing RDO for the following cases.
[0256] 1) If amvr_flag is 0
[0257] 2) If amvr_flag is 1 and amvr_prec_idx is 0
[0258] 3) If amvr_flag is 1 and amvr_prec_idx is 1
[0259] 4) If amvr_flag is 1 and amvr_prec_idx is 2
[0260] Depending on the motion vector precision of the current block, a variable for scaling the motion vector difference, i.e., a scaling parameter, can be set. As an example, Table 1 illustrates the values of the variable amvrshift according to the motion vector precision.
[0261] amvr_flagamvr_prec_idxamvrshift0 (1 / 4)-210 (1 / 2)311 (1-pel)412 (4-pel)6
[0262] If the finest motion vector precision that can be applied to the current block is 1 / 16, the motion vector precision can be expressed as in the following mathematical expression 1.
[0263]
[0264] As shown in Table 1, when the value of amvr_flag is 0, the variable amvrshift is set to 2. This indicates that the motion vector precision is 1 / 4 according to Equation 1.
[0265] When the value of amvr_flag is 1, the variable amvrshft can be determined according to the value of amvr_prec_idx. For example, when amvr_prec_idx is 1, the variable amvrshift is set to 4. This indicates that the motion vector precision is 1 according to Equation 1.
[0266] In the encoder, the motion vector difference value MVD can be scaled down and encoded using the variable amvrshift according to the motion vector precision. As an example, mathematical expression 2 shows an example of performing a scale down operation on the motion vector difference value MVD.
[0267]
[0268] In the above mathematical expression 2, MVD_x represents the horizontal component of the motion vector difference, and MVD_y represents the vertical component of the motion vector difference. MVD'_x and MVD'_y represent the results of the scale down operation.
[0269] The encoder can encode motion vector difference values and AMVR information with changed precision (S1140).
[0270] In the decoder, the motion vector difference value MVD can be decoded (S1210).
[0271] If the motion vector difference value is 0, decoding of AMVR-related information is omitted, and the motion vector MV of the current block can be set to be the same as the motion vector prediction value (S1220).
[0272] On the other hand, if the motion vector difference is not 0, i.e., if at least one of the horizontal direction component and the vertical direction component is not 0, information related to AMVR can be additionally decoded (S1230).
[0273] Based on the AMVR information, a variable amvrshift can be derived for scaling the motion vector difference. For example, as shown in Table 1, a variable amvrshfit can be derived based on amvr_flag and / or amvr_prec_idx.
[0274] Thereafter, by using the variable amvrshift, the decoded MVD can be scaled up to obtain a motion vector difference MVD restored to its original precision (S1240). Mathematical expression 3 shows an example in which a scale-up operation is applied to the decoded MVD.
[0275]
[0276] In mathematical expression 3, MVD' represents the decoded motion vector difference. MVD represents the motion vector difference restored to its original precision, i.e., 1 / 16, through a scale-up operation.
[0277] Afterwards, the motion vector MV can be obtained by combining the motion vector difference MVD restored to the original precision and the motion vector prediction value MVP.
[0278] As in the example described above, when the motion vector prediction mode is applied, the decoder can derive the motion vector MV by combining the motion vector prediction value MVP and the motion vector difference value MVD.
[0279] Figure 16 is a diagram illustrating a motion vector expressed as the sum of a motion vector prediction value and a motion vector difference value.
[0280] In the decoder, an index for motion vector prediction (e.g., an MVP index) can be decoded, and one of a plurality of motion vector prediction candidates specified by the index can be set as a motion vector prediction value.
[0281] Additionally, the decoder can decode the motion vector difference and AMVR information, and derive the motion vector difference by modifying the decoded motion vector difference to match the original precision.
[0282] Meanwhile, in the step (S310) of deriving motion information for the current block, motion information may be derived for each sub-block within the current block. For example, instead of deriving motion information for each CU or PU, the CU or PU may be divided into multiple sub-blocks, and motion information may be derived for each of the divided sub-blocks.
[0283] Figure 17 is a diagram for explaining an example in which motion information is derived in units of sub-blocks within the current block.
[0284] For convenience of explanation, it is assumed that the current block size is 16x16 and the size of each sub-block is 4x4.
[0285] To derive a motion vector for each sub-block, the initial motion vector of the current block can be set.
[0286] Using the initial motion vector of the current block, a reference block within a reference picture can be set, and motion information of each sub-block within the reference block can be set as motion information of each sub-block within the current block. Meanwhile, a sub-block within the reference block that corresponds to a sub-block within the current block can also be referred to as a corresponding sub-block.
[0287] Specifically, the motion vector of the corresponding sub-block in the reference picture spaced apart from the position of the sub-block by the initial motion vector can be set as the motion vector of the sub-block.
[0288] If motion information is derived for each sub-block within the current block, motion compensation can be performed for each sub-block.
[0289] The initial motion vector of the current block can be derived based on the motion information merging mode. For example, after constructing a motion information merging list for the current block, an index indicating a merging candidate used to derive the initial motion vector of the current block among the merging candidates included in the motion information merging list can be encoded and signaled.
[0290] Meanwhile, when motion vectors are derived on a sub-block basis, the composition of the motion information merge list of the current block can be simplified. That is, when motion vectors are derived on a sub-block basis, the maximum number of merge candidates that can be included in the motion vector merge list or at least one of the types of merge candidates can be smaller than when motion vectors are derived on a block basis.
[0291] For example, when a sub-block unit motion vector derivation method is applied, at least one of deriving a merge candidate from a spatial neighboring block, deriving a merge candidate from a temporal neighboring block, deriving a merge candidate from HMVP, or deriving a pair-wise merge candidate may be omitted.
[0292] Meanwhile, encoding / decoding of the index can be omitted, and the initial motion vector can be derived using a block existing at a predefined position in the encoder and decoder (i.e., a merge candidate). For example, in the example illustrated in Fig. 7, the motion vector of the block at position A1 adjacent to the left of the current block can be set as the initial motion vector of the current block.
[0293] Alternatively, the initial motion vector of the current block may be derived from a block including a position adjacent to the top of the current block (B1 in FIG. 7), a block including a position adjacent to the upper left (B5 in FIG. 7), a block including a position adjacent to the upper right (B0 in FIG. 7), or a block including a position adjacent to the lower left (A0 in FIG. 7).
[0294] As another example, neighboring blocks (i.e., merge candidates) used to derive the initial motion vector of the current block can be adaptively selected based on at least one of the shape of the current block or the ratio of its width and height. For example, if the height of the current block is greater than its width, the initial motion vector of the current block can be derived from the block at position A1, i.e., the left neighboring block.
[0295] On the other hand, if the width of the current block is greater than the height, the initial motion vector of the current block can be derived from the block at position B1, i.e., the upper neighboring block.
[0296] As another example, the initial motion vector of the current block can be derived by adding an offset vector to the motion vector of the merge candidate included in the motion information merge list. In this case, the offset vector can be derived using a table consisting of direction and magnitude. Tables 2 and 3 show lookup tables containing information about direction and magnitude.
[0297] Index01234567Direction0°45°90°135°180°225°270°315°Vector(1,0)(1,-1)(0,-1)(-1,-1)(-1,0)(-1,1)(0,1)(1,1)
[0298] Index0123Magnitude4-pel8-pel16-pel32-pelVector(4,4)(8,8)(16,16)(32,32)
[0299] The offset vector can be derived as the product of the direction vector indicated by the direction index and the magnitude vector indicated by the magnitude index. For example, if the direction index is 3, the direction vector is (-1, -1), and if the magnitude index is 2, the magnitude vector is (16, 16). In this case, the offset vector can be derived as (-16, -16).
[0300] To derive the offset vector, each of the direction index and the magnitude index can be encoded and signaled.
[0301] Meanwhile, information indicating whether an offset vector is used may be encoded and signaled. If the information indicates that an offset vector is not used, the motion vector of the merge candidate may be set as the initial motion vector of the current block.
[0302] If the above information indicates that an offset vector is used, the direction index and the size index may be additionally encoded / decoded. In this case, the offset vector may be added to the motion vector of the merge candidate to derive the initial motion vector of the current block.
[0303] Alternatively, encoding / decoding of information indicating whether to use an offset vector can be omitted, and the offset vector can be set to always be used.
[0304] Meanwhile, unlike the examples in Table 2 or Table 3, a candidate whose direction vector or magnitude vector is (0, 0) may be included. If the direction vector or magnitude vector is (0, 0), the offset vector is derived as (0, 0), and accordingly, the initial motion vector of the current block can be set to be the same as the motion vector of the merge candidate.
[0305] If the direction index points to the (0, 0) candidate, encoding / decoding of the size index may be omitted. Alternatively, if the size index points to the (0, 0) candidate, encoding / decoding of the direction index may be omitted.
[0306] As another example, the initial motion vector of the current block can be derived through motion estimation, and then the initial motion vector of the current block can be encoded / decoded based on the motion vector prediction mode.
[0307] Specifically, in the encoder, motion estimation for the current block can be performed according to the example described through Fig. 4 to derive a motion vector of the current block. The motion vector derived through motion estimation can be set as the initial motion vector of the current block.
[0308] The derived initial motion vector can be encoded / decoded using the MVP list. Specifically, among the motion vector prediction candidates included in the motion vector prediction (MVP) list, the MVP candidate with the highest encoding efficiency is selected. The selected candidate can be set as the predicted value of the initial motion vector.
[0309] Afterwards, the difference between the initial motion vector and the MVP (i.e., the MVD) can be encoded and signaled. Additionally, the MVP index, which points to the MVP candidate used as the prediction value of the initial motion vector within the MVP list, can be encoded and signaled.
[0310] Alternatively, encoding / decoding of the MVP index may be omitted, and the maximum motion vector of the current block may be derived based on the first MVP candidate in the MVP list or an MVP candidate derived from a block at a predefined position. Here, the block at the predefined position may be a block including a position adjacent to the left of the current block (A1 in FIG. 7), a block including a position adjacent to the top (B1 in FIG. 7), a block including a position adjacent to the upper left (B5 in FIG. 7), a block including a position adjacent to the upper right (B0 in FIG. 7), or a block including a position adjacent to the lower left (A0 in FIG. 7).
[0311] Meanwhile, when using the MVP list, at least one of the reference picture index or prediction direction information indicating one of the reference pictures included in the reference picture list may be further encoded and signaled. Here, the reference picture index indicates a reference picture used to derive a motion vector in units of sub-blocks. The prediction direction information indicates at least one of L0 direction prediction, L1 direction prediction, or bidirectional prediction.
[0312] Meanwhile, the MVP list can be generated before the motion vector difference (MVD) is derived. Furthermore, the MVP candidates can be derived by scaling the motion vectors of the candidate blocks using the distance between the reference picture indicated by the reference picture index and the current picture. That is, the MVP candidates included in the MVP list can be inserted into the MVP list after undergoing the scaling process.
[0313] Alternatively, a candidate block may be set as available only if the reference picture index of the candidate block for deriving the MVP has a preset reference picture index. For example, the preset reference picture index may be 0.
[0314] If there is no candidate block among the candidate blocks having a preset reference picture index, an MVP candidate can be derived by scaling the motion vector of each candidate block to match the reference picture indicated by the preset reference picture index.
[0315] When encoding / decoding a motion vector difference, the absolute value and sign of the motion vector difference can be encoded / decoded, respectively. At this time, information indicating the absolute value of the motion vector difference can include at least one of a flag indicating whether the size of the absolute value is greater than N or residual value information indicating the difference between the absolute value and N. At this time, N can be a natural number such as 1, 2, 3, or 4.
[0316] As another example, motion vector differences can also be encoded / decoded in the same manner as the offset vectors illustrated in Tables 2 and 3. That is, with respect to the motion vector differences, a magnitude index indicating one of the predefined magnitude candidates and a direction index indicating one of the predefined direction candidates can be encoded / decoded.
[0317] Alternatively, the number of candidates described in Table 2 or Table 3 may be adaptively adjusted. For example, it may include at least one of the size / shape of the current block, the size of the current picture, or whether a motion vector compensation method using an offset vector was applied in the previous picture. Here, the previous picture may indicate a picture encoded / decoded before the current block. For example, the previous picture may be a reference picture indicated by the reference picture index of the current block, a reference picture having a predefined index (e.g., 0) in the reference picture list, a collocated picture, or a picture encoded / decoded immediately before the current picture.
[0318] For example, if the current block size is less than the threshold, only 0 degrees, 90 degrees, 180 degrees, and 270 degrees may be set as available candidates in the example of Table 2, and only 4-pel may be set as an available candidate in Table 3. Alternatively, if the current block size is equal to or greater than the threshold, the above restrictions may apply.
[0319] For example, the number / type of available candidates may be adjusted based on at least one of the number of blocks to which the motion vector correction method using an offset vector is applied in the previous picture, the number of tiles, slices or subpictures including the blocks, or the area occupied by the blocks, the tiles or the slices in the previous picture. For example, if the area occupied by the blocks to which the motion vector correction method using an offset vector is applied in the previous picture, the tiles, slices or subpictures including the blocks is less than a predetermined ratio with respect to the entire area of the previous picture, in Table 2, only 0 degrees, 90 degrees, 180 degrees and 270 degrees may be set as available candidates, and in Table 3, only 4-pel may be set as an available candidate. Alternatively, if the area occupied by the blocks, the tiles, the slices or the subpictures is equal to or greater than a predetermined ratio with respect to the entire area of the previous picture, the above restrictions may be applied.
[0320] As another example, the initial motion vector of the current block can be derived based on a template matching method. For example, after constructing a motion information merge list for the current block, the template matching cost (TM Cost) can be calculated for each merge candidate included in the motion information merge list. The template matching cost can be the Sum of Absolute Difference (SAD) between the current template and the reference template.
[0321] Specifically, a reference block can be derived based on the motion vector of the merge candidate within the reference picture indicated by the motion information of the merge candidate, and a reference template can be set around the reference block. Thereafter, the difference (i.e., TM cost) between the reference template and the current template can be calculated.
[0322] Once the template matching cost for each of the merge candidates is calculated, the motion vector of the merge candidate with the lowest template matching cost can be set as the initial motion vector of the current block.
[0323] Meanwhile, to simplify computation, the template matching cost can be calculated only for a certain number or type of merge candidates included in the motion information merge list. For example, the template matching cost can be calculated only for spatial merge candidates included in the motion information merge list.
[0324] Alternatively, at least one of the number, position, or type of merge candidates for which template matching costs are calculated may be determined based on the ratio of the width and height of the current block. For example, if the height of the current block is greater than its width, the template matching cost may be calculated only for merge candidates derived from candidate blocks adjacent to the left of the current block, or the template matching cost may be calculated only for the remaining merge candidates excluding merge candidate(s) derived from candidate block(s) adjacent to the top of the current block.
[0325] Alternatively, if the width of the current block is greater than the height, the template matching cost may be calculated only for the merge candidates derived from the candidate blocks adjacent to the top of the current block, or only for the remaining merge candidates excluding the merge candidate(s) derived from the candidate block(s) adjacent to the left of the current block.
[0326] Alternatively, the template matching cost may be sequentially calculated for merge candidates included in the motion information merge list, and if the template matching cost for a merge candidate of a specific order is less than a threshold, the template matching process may be terminated, and the initial motion vector of the current block may be derived using a merge candidate having a template matching cost less than the threshold.
[0327] As another example, after constructing a motion information merge list for the current block, the template matching cost (TM Cost) for each MVP candidate included in the motion vector prediction list can be calculated.
[0328] Specifically, a reference block can be derived based on the motion vector of an MVP candidate within a reference picture, and a reference template can be set around the reference block. Thereafter, the difference (i.e., TM Cost) between the reference template and the current template can be calculated.
[0329] Once the template matching cost for each MVP candidate is calculated, the motion vector of the MVP candidate with the lowest template matching cost can be set as the initial motion vector of the current block or the predicted value of the initial motion vector.
[0330] Meanwhile, MVP candidates do not store reference picture information. Therefore, reference picture indices can be encoded and signaled to calculate template matching costs for MVP candidates included in the MVP candidate list.
[0331] Alternatively, reference pictures may be selected according to predefined rules. For example, to calculate the template matching cost, a co-located picture or a reference picture with an index of 0 in the reference picture list may be selected.
[0332] Once the reference picture is determined, a reference block within the reference picture can be derived based on the motion vector of the MVP candidate.
[0333] Meanwhile, to simplify computation, the template matching cost can be calculated only for a certain number or type of MVP candidates included in the motion vector prediction list. For example, the template matching cost can be calculated only for spatial MVP candidates included in the motion vector prediction list.
[0334] Alternatively, at least one of the number, location, or type of MVP candidates for which template matching costs are calculated may be adaptively determined based on the ratio of the width and height of the current block. For example, if the height of the current block is greater than its width, the template matching cost may be calculated only for MVP candidates derived from candidate blocks adjacent to the left of the current block, or only for the remaining merge candidates excluding MVP candidate(s) derived from candidate block(s) adjacent to the top of the current block.
[0335] Alternatively, if the width of the current block is greater than its height, the template matching cost may be calculated only for the MVP candidates derived from the upper adjacent candidate blocks of the current block, or only for the remaining merge candidates excluding the MVP candidate(s) derived from the candidate block(s) adjacent to the left of the current block.
[0336] Alternatively, the template matching cost may be sequentially calculated for MVP candidates included in the motion vector prediction list, and if the template matching cost for an MVP candidate of a specific order is less than a threshold, the template matching process may be terminated, and the initial motion vector of the current block may be derived using a merged candidate having a template matching cost less than the threshold.
[0337] In the above example, it was explained that the initial motion vector of the current block is derived by using the candidate with the smallest template matching cost among the merge candidates included in the motion information merge list or the MVP candidates included in the motion vector prediction list.
[0338] Instead of blindly using the candidate with the smallest template matching cost, the candidates can be rearranged in order of template matching cost, and one of the rearranged candidates can be selected to derive the initial motion vector of the current block.
[0339] For example, the merge candidates included in the motion vector merge list can be rearranged in ascending order of template matching cost, and one of the rearranged merge candidates can be selected to derive the initial motion vector of the current block. At this time, index information for selecting one of the rearranged merge candidates can be encoded and signaled.
[0340] The above reordering may be such that the smallest index (i.e., 0) is assigned to the merge candidate with the smallest template matching cost, and the largest index is assigned to the merge candidate with the largest template matching cost.
[0341] Alternatively, the MVP candidates included in the motion vector prediction list can be reordered in ascending order of template matching cost, and one of the reordered merge candidates can be selected to derive the initial motion vector of the current block. At this time, index information for selecting one of the reordered merge candidates can be encoded and signaled.
[0342] The above reordering may be such that the smallest index (i.e., 0) is assigned to the merge candidate with the smallest template matching cost, and the largest index is assigned to the merge candidate with the largest template matching cost.
[0343] As described above, by reordering candidates based on the template matching cost, a smaller index can be assigned to a candidate with a smaller template matching cost. In this case, if the index information indicating one of the plurality of candidates is encoded / decoded with a variable length (e.g., context-adaptive arithmetic entropy coding) rather than a fixed length, the length of the bin for the index information is set to be shorter as the index value is smaller. For example, a candidate with an index of 0 can be encoded / decoded with one bin, while a candidate with an index greater than 0 can be encoded / decoded with two or more bins.
[0344] By assigning the smallest index to the candidate with the lowest template cost and the highest probability of selection in the list, the length of the bin for index information can be reduced.
[0345] As another example, the decoder can also perform motion estimation in the same manner as the encoder to derive the initial motion vector for the current block. In other words, the decoder can derive the initial motion vector on its own.
[0346] Information indicating a method for deriving an initial motion vector of the current block may be encoded and signaled. Based on the information, one of the following methods for deriving an initial motion vector may be selected.
[0347] 1) A method of using a merge candidate selected based on index information among the merge candidates in the movement information merge list.
[0348] 2) Method of using candidates for predefined positions in the movement information merge list
[0349] 3) A method of rearranging merge candidates in the movement information merge list and using a merge candidate selected based on index information among the rearranged merge candidates.
[0350] 4) A method of using a merge candidate selected based on index information among MVP candidates in the motion vector prediction list.
[0351] 5) Method of using candidates at predefined positions in the motion vector prediction list
[0352] 6) A method of rearranging MVP candidates in the motion vector prediction list and using a merge candidate selected based on index information among the rearranged MVP candidates.
[0353] 7) How to perform motion estimation on the decoder side
[0354] 8) Method of using the motion vector of a block at a predefined location
[0355] The information indicating the method for deriving the initial motion vector may be a flag indicating whether one of the above methods is executed. Alternatively, the information indicating the method for deriving the initial motion vector may be an index indicating one of the listed methods.
[0356] As another example, the method for deriving the initial motion vector can be determined based on at least one of the size / shape of the current block, the position of the current block, or the encoding mode of a neighboring block. Here, the encoding mode can indicate intra prediction or inter prediction.
[0357] As shown in the example in Fig. 17, the initial motion vector of the current block is used to indicate a reference block for deriving a sub-block unit motion vector. Since the initial motion vector is not used for motion compensation for a specific position within the current block, but rather points to a position for deriving motion information of a sub-block within the current block, there is no need to use a precise motion vector as in motion compensation. Accordingly, the initial motion vector of the current block can be derived to point to an integer position rather than a fractional position.
[0358] For example, when deriving an initial motion vector from a motion vector of a merge candidate included in a motion information merge list, the real part of the motion vector of the merge candidate can be discarded, and the remaining integer part can be set as the initial motion vector of the current block.
[0359] For example, the precision of the motion vector being stored is 1 / 16 units, and the motion vector stored for the merge candidate is 18, which indicates that the actual motion vector of the merge candidate is 18 / 16. Accordingly, 1, which is an integer fraction of 18 / 16, can be set as the initial motion vector of the current block, and the remaining real part 2 / 16 can be discarded.
[0360] Even when using an MVP candidate in the motion vector prediction list, only the integer part of the motion vector of the MVP candidate can be used, and the real part can be discarded.
[0361] Similarly, even when deriving the initial motion vector through motion estimation, the initial motion vector can only be searched for integer positions.
[0362] The reference picture to which the reference block indicated by the initial motion vector belongs may be called an initial reference picture.
[0363] Depending on the method of deriving the initial motion vector, the method of determining the initial reference picture may differ.
[0364] For example, when an initial motion vector is derived using a merge candidate in a motion information merge list, a reference picture pointed to by the reference picture index of the merge candidate can be set as the initial reference picture.
[0365] For example, when an initial motion vector is derived using an MVP candidate in a motion vector prediction list or when an initial motion vector is derived through motion estimation on the decoder side, a reference picture pointed to by a reference picture index explicitly signaled through the bitstream can be set as the initial reference picture.
[0366] Alternatively, a reference picture having a predefined index in the reference picture list can be set as the initial reference picture.
[0367] The motion information of a sub-block within the current block can be derived from a corresponding sub-block within an initial reference picture. For example, the motion information of a corresponding sub-block spaced apart from the position of the sub-block within the initial reference picture by an initial motion vector can be set as the motion information of the sub-block. Here, the motion information can include at least one of a motion vector, a reference picture index, and a prediction direction.
[0368] When motion information of a sub-block within the current block is derived, motion compensation for the sub-block can be performed based on the derived motion information.
[0369] Figure 18 shows an example in which motion compensation is performed for a sub-block.
[0370] In Fig. 18, reference picture 0 is illustrated as being the initial reference picture.
[0371] Motion information of sub-blocks (a0 to 16) within the current block can be derived based on motion information of corresponding sub-blocks (A0 to A16) within the initial reference picture. For example, motion information of sub-block a0 within the current block can be derived based on motion information of corresponding sub-block A0 at a position spaced apart by an initial motion vector from the position of sub-block a0 within the initial reference picture. For example, the reference picture index and prediction direction of sub-block a0 can be set to be the same as the reference picture index and prediction direction of the corresponding sub-block A0.
[0372] Meanwhile, in deriving motion information of a sub-block within a current block, the distance between the current picture and the initial reference picture (hereinafter referred to as the first distance) and the distance between the initial reference picture and the reference picture of the corresponding sub-block (hereinafter referred to as the second distance) may be considered. Here, the distance between pictures may represent the POC difference between the pictures. For example, the motion vector MV_AN of the corresponding sub-block AN and the motion vector MV_aN of the sub-block aN within the current block may have a relationship as shown in the following mathematical expression 4.
[0373]
[0374] In the above mathematical expression 4, N indicates the index of the sub-block, and according to the example of FIG. 18, it can have a value of 0 to 15.
[0375] According to the above mathematical expression 4, the motion vector MV_aN of the sub-block aN within the current block can be derived as in the following mathematical expression 5.
[0376]
[0377] As in the example shown in mathematical expression 5, the motion vector MV_aN of the sub-block aN within the current block can be derived by scaling the motion vector MV_AN of the corresponding sub-block AN.
[0378] For example, in the example illustrated in FIG. 18, the POC of the current picture is t, and the POC of the initial reference picture is (t-1), so the distance between the current picture and the initial reference picture (i.e., the first distance) is 1. In addition, the POC of the initial reference picture is (t-1), and the POC of the reference picture indicated by the reference picture index of the corresponding sub-block A0 (i.e., reference picture 2) is (t-2), so the distance between the initial reference picture and the reference picture of the corresponding position sub-block (i.e., the second distance) is also 1. According to the above mathematical expression 5, the motion vector MV_a0 of the sub-block a0 in the current block can be set to be the same as the motion vector MV_A0 of the corresponding sub-block A0.
[0379] On the other hand, since the POC of the reference picture (i.e., reference picture 3) indicated by the reference picture index of the corresponding sub-block A12 is (t-3), the distance between the initial reference picture and the reference picture of the corresponding position sub-block (i.e., the second distance) is 2. According to the above mathematical expression 5, the motion vector MV_a12 of the sub-block a12 in the current block can be set to 1 / 2 of the motion vector MV_A12 of the corresponding position sub-block A12.
[0380] As another example, the motion vector of a sub-block within the current block can be derived by considering the initial motion vector in addition to the motion vector of the corresponding sub-block. Specifically, the motion vector of a sub-block within the current block can be derived based on the sum of the motion vector of the corresponding sub-block and the initial motion vector.
[0381] For example, a relationship as shown in the following mathematical expression 6 can be established between the sum of the motion vector MV_aN of the sub-block within the current block and the initial motion vector MV_int and the motion vector MV_AN of the corresponding sub-block.
[0382]
[0383] According to the above mathematical expression 6, the motion vector MV_aN of the sub-block aN within the current block can be derived as in the following mathematical expression 7.
[0384]
[0385] The initial motion vector can be commonly used for all sub-blocks within the current block. That is, in Equations 6 and 7, the value of the initial motion vector MV_int can have a fixed value regardless of the value of N.
[0386] Meanwhile, the scaled motion vector can also be set as the initial motion vector of the current block. When the scaled initial motion vector is used as the initial motion vector, in Equations 6 and 7, the initial motion vector MV_int can be set as the scaled motion vector.
[0387] Instead of setting the motion vector of a sub-block derived from a corresponding sub-block as the final motion vector, it can also be set as the motion vector prediction value of the sub-block. In this case, the motion vector difference for deriving the final motion vector of the sub-block can be encoded and signaled.
[0388] The motion vector difference can be encoded and signaled for each sub-block. For example, the motion vector absolute value and sign can be encoded / decoded for each sub-block.
[0389] As another example, the motion vector difference for each sub-block can also be encoded / decoded in the same manner as the offset vector encoding / decoding method illustrated in Tables 2 and 3. That is, for each sub-block, a size index indicating one of the predefined size candidates and a direction index indicating one of the predefined direction candidates can be encoded / decoded.
[0390] As another example, a single motion vector differential value can be encoded and signaled for multiple sub-blocks. For example, information about the motion vector differential value for the current block can be encoded / decoded, and the motion vector differential value derived for the current block can be commonly applied to all sub-blocks within the current block.
[0391] Alternatively, information on the motion vector differential for the current block may be encoded / decoded, and information indicating whether the motion vector differential for the current block is to be used may be encoded and signaled for each sub-block. If the information indicates that the motion vector differential for the current block is to be used, the final motion vector of the sub-block may be derived by adding the motion vector differential for the current block to the motion vector prediction value derived from the motion vector of the corresponding sub-block. On the other hand, if the information indicates that the motion vector differential for the current block is not to be used, the motion vector prediction value derived from the motion vector of the corresponding sub-block may be set as the final motion vector of the sub-block.
[0392] Alternatively, for the current block, N motion vector differential values can be encoded and signaled. And, for each sub-block, at least one of information indicating whether a motion vector differential value is used or one of the N motion vector differential values can be encoded and signaled. When a motion vector differential value is used for a sub-block, the final motion vector of the sub-block can be derived by adding any one of the N motion vector differential values to the motion vector prediction value.
[0393] Alternatively, information indicating whether the motion vector differential of the current sub-block is identical to the motion vector differential of the neighboring sub-block may be encoded and signaled. If the information indicates that the motion vector differential of the current sub-block is identical to the neighboring sub-block, encoding / decoding of the motion vector differential information may be omitted for the current sub-block, and the motion vector differential of the current sub-block may be set identical to the motion vector differential of the neighboring block. On the other hand, if the information indicates that the motion vector differential of the current sub-block is different from the neighboring sub-block, the motion vector differential information for the current sub-block may be explicitly encoded and signaled.
[0394] In another example, the motion vector differential value can be encoded and signaled for each reference picture index. In this case, sub-blocks with the same reference picture index can share a single motion vector differential value. For example, the motion vector of a sub-block can be derived by adding the motion vector differential value corresponding to the reference picture index of the corresponding sub-block to the motion vector prediction value.
[0395] An initial motion vector can also be derived by scaling a motion vector to a specific reference picture. Here, the specific reference picture can be a collocated picture or a reference picture having a predefined index (e.g., 0) in a reference picture list.
[0396] If the reference picture of a neighboring block or merge candidate from which an initial motion vector is to be derived is different from a specific reference picture, the motion vector of the neighboring block or merge candidate can be scaled to match the specific reference picture, and the scaled motion vector can be set as the initial motion vector of the current block.
[0397] If the corresponding sub-block is unavailable, the representative sub-motion vector may be set as the motion vector of the sub-block. For example, if the corresponding sub-block is not encoded / decoded using inter prediction, if the corresponding sub-block exceeds the boundary of the picture, tile, or slice, or if the corresponding sub-block does not contain motion information, the corresponding sub-block may be determined to be unavailable. An unavailable corresponding sub-block may also be referred to as a hole block.
[0398] The motion vector of a sub-block at a predefined position within a reference block can be set as a representative sub-motion vector. For example, the predefined position may be the center position of the reference block.
[0399] That is, the representative sub-motion vector can be derived from a block located at a position spaced apart from the center point of the current block by the initial motion vector. For example, the motion vector of a reference block with a sample located at a position spaced apart from the center point of the current block by the initial motion vector as the upper left sample or the center sample within the reference picture can be set as the center motion vector.
[0400] As another example, when searching sub-blocks within a reference block in a predefined order, the motion vector of the first available sub-block found can be set as a representative sub-motion vector.
[0401] Figure 19 illustrates the search order of sub-blocks within a reference block.
[0402] Figures 19 (a) and (b) show examples in which scanning starts from a central position sub-block within a reference block.
[0403] Figure 19 (c) shows an example in which a vertical scan is performed from the upper left sub-block to the lower right sub-block.
[0404] Figure 19 (d) shows an example in which a horizontal scan is performed from the upper left sub-block to the lower right sub-block.
[0405] When searching for sub-blocks within a reference block according to a scan order corresponding to any one of (a) to (d) of Fig. 19, the motion vector of the sub-block found first can be set as a representative sub-motion vector.
[0406] The scan order may be predefined in the encoder and decoder.
[0407] Alternatively, information indicating one of multiple scan order candidates may be encoded and signaled.
[0408] Alternatively, one of the multiple scan order candidates may be adaptively selected based on at least one of the size / shape of the current block or the encoding mode of the neighboring block.
[0409] As another example, on the decoder side, the motion vector of the hole block can be derived, and based on the derived motion vector of the hole block, the motion vector of the sub-block within the current block can be derived.
[0410] In one embodiment, the motion vector of the hole block can be derived based on the motion vector of at least one neighboring sub-block adjacent to the hole block. The motion vector of the hole block can be obtained based on an average operation or a weighted sum operation of the motion vectors of the neighboring sub-blocks.
[0411] For example, in the example illustrated in Fig. 18, it is assumed that the corresponding position sub-block A10 is a hole block. At this time, the motion vector of the hole block A10 can be derived by averaging or weighting the motion vectors of the left sub-block A9, the right sub-block A11, the upper sub-block A6, and the lower sub-block A14 of the hole block A10.
[0412] As another example, the motion vector of a hole block can be derived based on an average operation or a weighted sum operation of the motion vectors of multiple available sub-blocks within a reference block.
[0413] Meanwhile, for average or weighted sum operations, only sub-blocks with the same reference picture index can be used.
[0414] Alternatively, neighboring sub-blocks surrounding the hole block can be sequentially searched, and the motion vector of the first available sub-block found can be set as the motion vector of the hole block. For example, when the available motion vectors are sequentially searched in the order of left sub-block A9, right sub-block A11, upper sub-block A6, and lower sub-block A14, the motion vector of the first available sub-block found can be set as the motion vector of hole block A10.
[0415] Alternatively, the motion vector of a sub-block at a predefined position adjacent to the hole block may be set as the motion vector of the hole block. Here, the predefined position may include at least one of a left sub-block, a right sub-block, an upper sub-block, or a lower sub-block of the hole block.
[0416] As another example, the decoder can perform motion estimation on the hole block to derive motion information for the hole block. For example, motion estimation can be performed on the hole block, assuming that each of the hole block and the reference picture containing the hole block (i.e., the initial reference picture) is the current block and the current picture. Through this motion estimation, motion information for the hole block can be derived.
[0417] As another example, the movement information of a hole block can be generated through a two-way matching method.
[0418] As another example, a preset motion vector can be set as the motion vector of the hole block. For example, the preset motion vector can be a zero vector (i.e., (0, 0)).
[0419] To simplify implementation, a co-located picture of the current picture or a reference picture with a predefined index (e.g., a reference picture with an index of 0) can be set as the initial reference picture.
[0420] For example, if only a collocated picture is available as an initial reference picture, a reference block can be derived from within the collocated picture, and the motion information of the sub-block can be derived from the corresponding sub-block within the collocated picture.
[0421] When the above constraints apply, a candidate that uses a reference picture different from a collocated picture or a reference picture having a predefined index may be set as unavailable for deriving an initial motion vector of the current block. For example, if the reference picture index of a merge candidate included in the motion information merge list does not point to a collocated picture or a reference picture having a predefined index, the merge candidate may be determined to be unavailable for deriving an initial motion vector of the current block.
[0422] The index information may indicate one of the remaining merge candidates (i.e., available merge candidates) excluding merge candidates that are unavailable for the current block among the merge candidates included in the motion information merge list.
[0423] Meanwhile, if the merge candidate has both bidirectional (i.e., L0 and L1) motion information, the initial motion vector of the current block can be derived using only the motion information in the direction pointing to the collocated picture or the reference picture with the predefined index among the L0 direction and the L1 direction.
[0424] After deriving the initial motion vector of the current block, it is also possible to determine whether to use the reference block based on whether motion information of a sub-block at a preset location within the reference block is available. Here, unavailability of motion information of a sub-block indicates that there is no motion information stored at the location of the sub-block, or that the location of the sub-block is outside the boundary of a picture, tile, or slice.
[0425] For example, if motion information is not available for a centrally located sub-block within a reference block indicated by the initial motion vector of the current block, the reference block may be set as unavailable. If the reference block is determined to be unavailable, a method for deriving motion information at the sub-block level using the reference block may be set as unavailable.
[0426] If the method for deriving motion information in units of sub-blocks using reference blocks is set to be unavailable, a method for deriving motion vectors in units of sub-blocks based on an affine motion model or a method for deriving motion vectors in units of blocks can be applied.
[0427]
[0428] Applying the embodiments described above, focusing on the decoding or encoding process, to the encoding or decoding process is within the scope of the present disclosure. Changing the embodiments described above, in a given order, to a different order is also within the scope of the present disclosure.
[0429] Although the above-described disclosure is described based on a series of steps or a flowchart, this does not limit the chronological order of the invention, and may be performed simultaneously or in a different order as needed. In addition, each component (e.g., unit, module, etc.) constituting the block diagram in the above-described disclosure may be implemented as a hardware device or software, or multiple components may be combined to be implemented as a single hardware device or software. For example, the hardware device may include at least one of a processor for performing calculations, a memory for storing data, a transmitter for transmitting data, and a receiver for receiving data.
[0430] The above-described disclosure may be implemented in the form of program commands that can be executed by various computer components and recorded on a computer-readable recording medium. The computer-readable recording medium may include program commands, data files, data structures, etc., either singly or in combination.
[0431] In addition, according to the present disclosure, a computer-readable recording medium can be provided that stores a bitstream generated by the above-described encoding method. The bitstream can be transmitted by an encoding device, and a decoding device can receive the bitstream and decode an image.
[0432] Examples of computer-readable recording media include magnetic media such as hard disks, floppy disks, and magnetic tapes, optical recording media such as CD-ROMs and DVDs, magneto-optical media such as floptical disks, and hardware devices specifically configured to store and execute program instructions, such as ROMs, RAMs, and flash memories. The hardware devices may be configured to operate as one or more software modules to perform processing according to the present disclosure, and vice versa.
[0433] The present disclosure may be applied to a computing or electronic device capable of encoding / decoding a video signal.
Claims
1. A step of deriving the initial motion vector of the current block; A step of deriving motion information of sub-blocks within the current block from corresponding sub-blocks within the initial reference picture using the initial motion vector; and A step of performing motion compensation for each of the sub-blocks within the current block, A video decoding method, characterized in that the initial motion vector is derived based on a merge candidate included in a motion information merge list of the current block or a motion vector prediction candidate included in a motion vector prediction list.
2. In paragraph 1, A video decoding method, wherein the above merging candidate is one having the smallest template matching cost among the merging candidates included in the motion information merging list of the current block.
3. In paragraph 2, A video decoding method, characterized in that the template matching cost represents the sum of the absolute value differences between the reference template around the reference block indicated by the motion information of the merge candidate and the current template around the current block.
4. In paragraph 1, A video decoding method, characterized in that the above motion information merge list is rearranged according to the template matching cost of each of the merge candidates, and the merge candidate is selected by index information indicating one of the rearranged merge candidates.
5. In paragraph 1, A video decoding method, characterized in that a reference picture pointed to by a reference picture index among the merge candidates included in the motion information merge list is different from the initial reference picture and cannot be used to derive the initial motion vector.
6. In paragraph 5, A video decoding method, characterized in that the initial reference picture is a collocated picture or a reference picture having a predefined index.
7. In paragraph 1, A video decoding method, characterized in that the initial motion vector is derived by adding an offset vector to the motion vector of the merging candidate or the motion vector of the motion vector prediction candidate.
8. In paragraph 1, A video decoding method, characterized in that, if there is no motion information of a corresponding sub-block corresponding to a sub-block within the current block within the initial reference picture, the motion vector of the sub-block is set as a representative sub-motion vector.
9. In paragraph 8, An image decoding method, characterized in that the representative sub-motion vector is set to the motion vector of the first available corresponding sub-block found when the corresponding sub-blocks are sequentially searched.
10. In paragraph 9, An image decoding method, characterized in that the search order of the corresponding sub-blocks is determined based on an index indicating one of a plurality of scan order candidates.
11. In paragraph 1, The motion vector of a sub-block within the current block is derived by scaling the motion vector of a corresponding sub-block within a reference picture, A video decoding method, characterized in that the scaling is performed based on a first distance between a current picture and the initial reference picture and a second distance between the initial reference picture and a reference picture indicated by the reference picture index of the merging candidate.
12. In paragraph 1, The motion vector of the sub-block within the current block is derived by scaling the sum of the motion vector of the corresponding sub-block within the reference picture and the initial motion vector, A video decoding method, characterized in that the scaling is performed based on a first distance between a current picture and the initial reference picture and a second distance between the initial reference picture and a reference picture indicated by the reference picture index of the merging candidate.
13. In paragraph 1, A video decoding method, characterized in that the motion vector of a sub-block within the current block is derived by adding a motion vector differential value and a motion vector prediction value derived by scaling the motion vector of a corresponding sub-block within a reference picture.
14. Step of deriving the initial motion vector of the current block; A step of deriving motion information of sub-blocks within the current block from corresponding sub-blocks within the initial reference picture using the initial motion vector; and A step of performing motion compensation for each of the sub-blocks within the current block, A video encoding method, characterized in that the initial motion vector is encoded based on a merge candidate included in a motion information merge list of the current block or a motion vector prediction candidate included in a motion vector prediction list.
15. Step of deriving the initial motion vector of the current block; A step of deriving motion information of sub-blocks within the current block from corresponding sub-blocks within the initial reference picture using the initial motion vector; and A step of performing motion compensation for each of the sub-blocks within the current block, A computer-readable recording medium storing a bitstream generated by a video encoding method, characterized in that the initial motion vector is encoded based on a merge candidate included in a motion information merge list of the current block or a motion vector prediction candidate included in a motion vector prediction list.
Citation Information
Patent Citations
Imbalanced Data Analysis Method and System
KR1020230150621A
Electromagnetic induction heating apparatus for heating an aerosol-forming article of an electronic cigarette and driving method thereof
KR1020240057162A
Adjustment pipe manufacturing robot system
KR102242236B1
Biosensor arrary for measuring conductivity and frequency change and manufacturing method thereof
KR102436003B1
KR20190024765A
