Image encoding / decoding method and device for transmitting compressed video data
By updating motion information candidates through template matching, the method improves video encoding/decoding efficiency and reduces costs for high-resolution video content transmission and storage.
Patent Information
- Application Number
- PCT/KR2025/008425
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2025-06-17
- Filing Date
- 2025-06-18
- Publication Date
- 2025-12-26
AI Technical Summary
The increasing demand for high-resolution and high-quality video content leads to higher data volumes, resulting in increased transmission and storage costs, and existing video compression technologies struggle to efficiently handle stereoscopic video content.
A method for updating motion information candidates in video encoding/decoding by performing template matching to correct motion vectors, allowing for improved precision and accuracy without additional data signaling.
Enhances prediction accuracy and reduces data transmission/storage costs by optimizing motion information updates in video encoding/decoding processes.
Smart Images

Figure KR2025008425_26122025_PF_FP_ABST
Abstract
Description
Video encoding / decoding method and device for transmitting compressed video data
[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. Using these image compression technologies, image data can be effectively compressed and transmitted or stored.
[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 updating motion information candidates included in a motion information list and a device therefor.
[0006] The present disclosure aims to provide a method and a device therefor for updating motion information candidates without additional data signaling by updating motion information candidates based on template matching.
[0007] 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.
[0008] A video decoding method according to the present disclosure may include the steps of: generating a motion information list of a current block; updating the motion information list by correcting at least one of motion information candidates included in the motion information list; deriving motion information of the current block from the updated motion information list; and obtaining a prediction block of the current block based on the motion information of the current block. In this case, the correction of the motion information candidate may be updating a motion vector of the motion information candidate by performing motion estimation based on template matching.
[0009] A video encoding method according to the present disclosure may include: generating a motion information list of a current block; updating the motion information list by correcting at least one of motion information candidates included in the motion information list; encoding motion information of the current block based on the updated motion information list; and obtaining a prediction block of the current block based on the motion information of the current block. In this case, the correction of the motion information candidate may be updating a motion vector of the motion information candidate by performing motion estimation based on template matching.
[0010] In the video encoding / decoding method according to the present disclosure, the motion estimation is performed within a precision range, and the precision range can be defined by a start precision and an end precision.
[0011] In the video encoding / decoding method according to the present disclosure, one of the start precision and the end precision may be set to the motion vector precision of a neighboring block used to derive the motion information candidate.
[0012] In the video encoding / decoding method according to the present disclosure, the other of the start precision and the end precision may be predefined in the encoder / decoder.
[0013] In the video encoding / decoding method according to the present disclosure, motion estimation is performed stepwise by reducing the motion vector precision starting from the starting precision, and the number of position candidates searched when motion estimation is performed based on the first motion vector precision may be different from the number of position candidates searched when motion estimation is performed based on the second motion vector precision.
[0014] In the video encoding / decoding method according to the present disclosure, the motion vector of the motion information candidate is set as an initial motion vector, and the motion vector of the motion information candidate can be updated by adding a difference between a position indicated by the initial motion vector and an optimal position determined through the motion estimation to the motion vector of the motion information candidate.
[0015] In the video encoding / decoding method according to the present disclosure, whether to correct the motion information candidate can be determined based on the result of comparing the template matching cost calculated based on the motion information of the motion information candidate with a threshold value.
[0016] In the video encoding / decoding method according to the present disclosure, the correction can be applied only to a predefined number of motion information candidates having small indices in the motion information list.
[0017] In the video encoding / decoding method according to the present disclosure, a template matching cost is calculated for each of the motion information candidates in the motion information list, and the correction can be applied only to a predefined number of motion information candidates selected in the order of the smallest template matching cost.
[0018] In the video encoding / decoding method according to the present disclosure, after correcting motion information candidates in the motion information list, the updated motion information list can be derived by rearranging the corrected motion information candidates according to the template matching cost of each of the corrected motion information candidates.
[0019] In the video encoding / decoding method according to the present disclosure, an optimal position with the smallest template matching cost is determined through the motion estimation, and the template matching cost can be calculated based on one of a plurality of cost functions.
[0020] In the image encoding / decoding method according to the present disclosure, the cost functions may include at least one of SAD (Sum of Absolute Differences), SATD (Sum of Absolute Transformed Differences), SSD (Sum of Squared Difference), or MR-SAD (Mean-Removed Sum of Absolute Differences).
[0021] In the video encoding / decoding method according to the present disclosure, the cost function for calculating the template matching cost may be different between the case where the motion information list is a motion information merge list and the case where the motion information list is a motion vector prediction list.
[0022] According to the present disclosure, a computer-readable recording medium for storing a bitstream generated by an image encoding method can be provided.
[0023] 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.
[0024] According to the present disclosure, prediction accuracy can be improved by providing a method for updating motion information candidates included in a motion information list and a device therefor.
[0025] According to the present disclosure, by updating motion information candidates based on template matching, it is possible to update motion information candidates without additional data signaling.
[0026] 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.
[0027] FIG. 1 is a block diagram illustrating an image encoding device according to an embodiment of the present disclosure.
[0028] FIG. 2 is a block diagram showing an image decoding device according to an embodiment of the present disclosure.
[0029] Figure 3 is a diagram schematically illustrating the process of performing inter prediction in an encoder and decoder.
[0030] Figure 4 shows an example in which motion estimation is performed.
[0031] 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.
[0032] Figure 7 shows the locations referenced to derive motion vector prediction values.
[0033] Figure 8 is a diagram for explaining a template-based motion estimation method.
[0034] Figure 9 shows examples of template configurations.
[0035] Figure 10 is a diagram for explaining a motion estimation method based on a bilateral matching method.
[0036] Figure 11 is a diagram for explaining a motion estimation method based on a one-way matching method.
[0037] Figures 12 and 13 illustrate examples in which prediction blocks are generated according to the precision of a motion vector.
[0038] Figure 14 shows an example in which motion compensation based on a translational model and a zooming model is performed for the current block.
[0039] Figure 15 shows an example in which motion compensation based on a translational model and a rotational model is performed for the current block.
[0040] Figures 16 and 17 illustrate examples of generating a prediction block for a current block using control point motion vectors.
[0041] Figure 18 shows an example of generating a prediction block for the current block using three control point motion vectors.
[0042] Figure 19 shows an example in which a motion vector is derived in sub-block units.
[0043] Figures 20 and 21 illustrate examples in which motion vectors are derived in units of sub-blocks within the current block when SbTMVP is applied.
[0044] Figures 22 and 23 are diagrams showing examples in which prediction blocks are derived according to motion vector precision.
[0045] Figures 24 and 25 are diagrams for explaining the process of encoding and decoding a motion vector difference value, respectively, when the AMVR method is applied.
[0046] FIG. 26 illustrates a method for configuring a motion information list according to one embodiment of the present disclosure.
[0047] 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.
[0048] 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.
[0049] 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.
[0050] 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.
[0051] 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.
[0052] FIG. 1 is a block diagram illustrating an image encoding device according to an embodiment of the present disclosure.
[0053] 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).
[0054] 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.
[0055] 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.
[0056] 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.
[0057] 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.
[0058] 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.
[0059] 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.
[0060] 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 direction or the 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. Alternatively, when the size of the transformation unit is small, multiple transformation units can be set as a single prediction unit.
[0061] 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., reference sample line, 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).
[0062] 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.
[0063] 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.
[0064] 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.
[0065] 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.
[0066] 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.
[0067] 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.
[0068] 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.
[0069] 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.
[0070] 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.
[0071] 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).
[0072] 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. Meanwhile, the transformation can be performed by separating the horizontal direction and the vertical direction.
[0073] After performing transformations in the horizontal and vertical directions, a secondary transformation can be performed. The secondary transformation may be in a form in which the horizontal and vertical directions are not separated. The secondary transformation can be performed on the transformation coefficients obtained by the primary transformation to generate final transformation coefficients. Meanwhile, the number of final transformation coefficients output by the secondary transformation may be smaller than the number of transformation coefficients input for the secondary transformation. Specifically, the secondary transformation can be performed using a reduced transformation matrix having different numbers of columns and rows.
[0074] 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).
[0075] The rearrangement unit (160) can perform rearrangement of coefficient values for quantized residual values.
[0076] The reordering unit (160) can change a two-dimensional block-shaped coefficient into a one-dimensional vector form through a coefficient scanning method. For example, the reordering 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 conversion 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 conversion 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.
[0077] 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).
[0078] 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).
[0079] The entropy encoding unit (165) can entropy encode the coefficient values of the encoding unit input from the rearrangement unit (160).
[0080] 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.
[0081] The filter unit (150) may include at least one of a deblocking filter, an offset correction unit, and an ALF (Adaptive Loop Filter).
[0082] 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.
[0083] 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.
[0084] 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 form (fixed form) can be applied regardless of the characteristics of the target block.
[0085] The memory (155) can store a restoration block or picture produced through the filter unit (150), and the stored restoration block or picture can be provided to the prediction unit (120, 125) when performing inter-screen prediction.
[0086] FIG. 2 is a block diagram showing an image decoding device according to an embodiment of the present disclosure.
[0087] 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).
[0088] 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.
[0089] 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.
[0090] The entropy decoding unit (210) can decode information related to intra-screen prediction and inter-screen prediction performed in the encoding device.
[0091] 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.
[0092] 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.
[0093] The inverse transform unit (225) can perform an inverse transform of the transform performed by the transform unit on the quantization result performed by the image encoding device. That is, at least one of an inverse transform of a secondary transform (secondary inverse transform) or an inverse transform for DCT, DST, and KLT (i.e., first inverse transform) can be performed. The inverse transform can be performed based on a transmission unit determined by the image encoding device. The inverse transform unit (225) of the image decoding device can determine a transform matrix for the second inverse transform or a transform technique (e.g., DCT, DST, KLT) for the first inverse transform 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. Alternatively, information for determining the transform matrix or the transform technique may be explicitly encoded and signaled.
[0094] The prediction unit (230, 235) can generate a prediction block based on prediction block generation related information provided from the entropy decoding unit (210) and previously decoded block or picture information provided from the memory (245).
[0095] 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.
[0096] 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.
[0097] 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.
[0098] 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.
[0099] 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.
[0100] 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.
[0101] 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.
[0102] 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.
[0103] 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.
[0104] 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.
[0105] 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.
[0106] 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.
[0107] Furthermore, we will refer to the picture that contains the current block as the current picture.
[0108] 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.
[0109] Figure 3 is a diagram schematically illustrating the process of performing inter prediction in an encoder and decoder.
[0110] 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.
[0111] 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.
[0112] In the decoder, motion information of the current block can be derived based on the information transmitted from the encoder.
[0113] 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.
[0114] 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.
[0115] Below, we will explain in more detail the process of calculating inter predictions.
[0116] The motion information of the current block can be generated through motion estimation.
[0117] Figure 4 shows an example in which motion estimation is performed.
[0118] 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).
[0119] 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.
[0120] 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.
[0121] 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.
[0122] 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.
[0123] 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.
[0124] 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.
[0125] Furthermore, the index of the picture containing the reference block identified through motion estimation is set as the reference picture index.
[0126] 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.
[0127] 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.
[0128] 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.
[0129] 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.
[0130] 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.
[0131] 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 for 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 for 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.
[0132] 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).
[0133] 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.
[0134] 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.
[0135] 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.
[0136] 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.
[0137] 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.
[0138] Figure 7 shows the locations referenced to derive motion vector prediction values.
[0139] For convenience of explanation, the current block is assumed to have a size of 4x4.
[0140] 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.
[0141] 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.
[0142] 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.
[0143] 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.
[0144] 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.
[0145] 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.
[0146] 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).
[0147] 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.
[0148] 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).
[0149] 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.
[0150] 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.
[0151] 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.
[0152] 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.
[0153] 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.
[0154] Additionally, the motion vector differential can be decoded from the bitstream. Then, the motion vector of the current block can be derived by combining the motion vector prediction value and the motion vector differential value.
[0155] 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.
[0156] 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.
[0157] At this time, if the reference picture list contains only one reference picture, encoding / decoding of the reference picture index may be omitted.
[0158] 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.
[0159] 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.
[0160] 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.
[0161] 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.
[0162] 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.
[0163] 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.
[0164] 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).
[0165] 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.
[0166] Figure 8 is a diagram for explaining a template-based motion estimation method.
[0167] 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.
[0168] 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.
[0169] 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.
[0170] 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.
[0171] 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.
[0172] 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.
[0173] Figure 9 shows examples of template configurations.
[0174] The current template can be configured according to one of the examples illustrated in FIG. 9.
[0175] 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.
[0176] The size and / or shape of the current template may be predefined in the encoder and decoder.
[0177] 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.
[0178] 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.
[0179] 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.
[0180] 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.
[0181] 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.
[0182] 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, motion information of the current block can be derived based on a motion information merging mode or a motion vector prediction mode.
[0183] 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.
[0184] 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.
[0185] 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.
[0186] 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.
[0187] Based on the two-way matching method, it is also possible to generate movement information of the current block.
[0188] Figure 10 is a diagram for explaining a motion estimation method based on a bilateral matching method.
[0189] 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.
[0190] 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.
[0191] 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.
[0192] 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.
[0193] 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.
[0194] 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.
[0195] 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.
[0196] 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.
[0197] 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.
[0198] The search range can be set within a predetermined range from a collocated block within a reference picture.
[0199] 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.
[0200] 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).
[0201] 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).
[0202] 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.
[0203] 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).
[0204] 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.
[0205] 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.
[0206] 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.
[0207] 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.
[0208] 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.
[0209] 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.
[0210] 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.
[0211] Figure 11 is a diagram for explaining a motion estimation method based on a one-way matching method.
[0212] 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).
[0213] 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.
[0214] 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.
[0215] 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.
[0216] 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.
[0217] 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.
[0218] 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.
[0219] Afterwards, a search range within the first reference picture and the second reference picture can be set.
[0220] The search range can be set within a predetermined range from a collocated block within a reference picture.
[0221] 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.
[0222] 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.
[0223] 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.
[0224] 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).
[0225] 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.
[0226] 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.
[0227] 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.
[0228] 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.
[0229] 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.
[0230] 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.
[0231] By adjusting the precision of motion vectors, it is also possible to detect the inter-frame movement of an object. Specifically, the position of each pixel within a picture is specified as an integer. However, the inter-frame movement of an object may not be expressed as an integer position.
[0232] Taking this into account, interpolation can be performed on the reference picture to search for a motion vector in fractional pixel units.
[0233] Figures 12 and 13 illustrate examples in which prediction blocks are generated according to the precision of a motion vector.
[0234] Figure 12 shows the location of the current block within the current picture, and Figure 13 shows an example in which a prediction block is obtained according to a motion vector.
[0235] Specifically, (a) of Fig. 13 shows an example in which the motion vector precision is in integer pixel units, and (b) and (c) of Fig. 13 show examples in which the motion vector precision is in 1 / 2 pixel units and 1 / 4 pixel units, respectively.
[0236] The motion vector precision can also be set in smaller units than those shown. For example, the motion vector precision can be set in units of 1 / 8 pixel, 1 / 16 pixel, or 1 / 32 pixel.
[0237] When the motion vector of the current block is expressed in integer units, a reference block composed of integer position samples can be set as a prediction block of the current block, as in the example illustrated in (a) of Fig. 13.
[0238] On the other hand, if the motion vector of the current block is expressed in fractional units, a reference block composed of fractional position samples can be set as the prediction block of the current block, as in the examples shown in (b) and (c) of Fig. 13. In this case, the fractional position samples within the reference block can be generated by interpolating integer position samples. The interpolation filter can have a size of 4 or 8 taps.
[0239] As another example, to reduce complexity, fractional position samples can be generated via linear interpolation using only integer position samples adjacent to the fractional position.
[0240] Information indicating the motion vector precision of the current block may be encoded and signaled. For example, after assigning different indices to each of a plurality of motion vector precision candidates, the index of the motion vector precision candidate corresponding to the motion vector precision of the current block may be encoded and signaled.
[0241] At this time, the number and / or types of available motion vector candidates can be determined based on at least one of the size of the current block, the shape of the current block, the reference picture, or the motion compensation model. Here, the motion compensation model can include at least one of a translation model, a zooming model, or a rotation model. A motion compensation model that combines a translation model with at least one of a zooming model or a rotation model can be referred to as an affine model.
[0242] An index indicating one of the available motion vector candidates for the current block may be encoded. Depending on the number of motion vector candidates available for the current block, the maximum number of bits required to encode the index may be determined.
[0243] By adjusting the precision of the motion vector, the motion vector can be searched more precisely, and thus the prediction accuracy for the current block can be improved.
[0244] Meanwhile, the motion vector expressed in fractional positions can be scaled up to integers and encoded.
[0245] Compensation for the motion of an object may be performed based on at least one of a translational model for compensating for linear motion of the object (e.g., motion in the horizontal and / or vertical direction), a zooming model for compensating for changes in the size of the object, and a rotational model for compensating for rotational motion of the object. Here, zooming may refer to enlargement or reduction in size.
[0246] Figure 14 shows an example in which motion compensation based on a translational model and a zooming model is performed for the current block.
[0247] For convenience of explanation, the current block is assumed to have a size of 4x4, as illustrated in Fig. 12.
[0248] In Figure 14, the variable α represents a size adjustment parameter. The size of the reference block can be derived by multiplying the size of the current block by the variable α.
[0249] A size adjustment parameter α less than 1 indicates that the reference block is smaller than the current block, and a size adjustment parameter α greater than 1 indicates that the reference block is larger than the current block.
[0250] Figures 14 (a) and (b) show examples when the size adjustment parameter α is less than 1, and Figure 14 (c) shows examples when the size adjustment parameter α is greater than 1.
[0251] Based on the motion vector of the current block, the upper left position of the reference block can be determined. Specifically, the upper left position of the reference block can be set to a position spaced apart by the motion vector from the position corresponding to the upper left sample of the current block within the reference picture. Thereafter, based on the resizing parameter, a reference block whose width and height are α times the width and height of the current block, respectively, can be set. Fractional position samples within the reference block can be generated by interpolating integer position samples.
[0252] A reference block derived by a motion vector and a scale parameter can be set as a prediction block of the current block.
[0253] Meanwhile, information about the scaling parameter α may be encoded and signaled. Specifically, a different index may be assigned to each of a plurality of scaling parameter candidates, and an index specifying the scaling parameter candidate applied to the current block may be encoded and signaled.
[0254] Alternatively, the resizing parameters of the current block can be derived based on the resizing parameters of neighboring blocks. For example, the resizing parameters of neighboring blocks at a predefined location can be set as the resizing parameters of the current block.
[0255] Alternatively, when sequentially searching multiple neighboring blocks, the size adjustment parameter of the first searched available neighboring block can be set as the size adjustment parameter of the current block.
[0256] Alternatively, the resizing parameter of a neighboring block may be set as a resizing parameter candidate. In this case, a plurality of neighboring blocks may be sequentially searched to generate a resizing parameter candidate list including a plurality of resizing parameter candidates. One of the plurality of resizing parameter candidates included in the plurality of resizing parameter candidate lists may be set as the resizing parameter of the current block. In this case, an index indicating a candidate among the plurality of resizing parameter candidates that is identical to the resizing parameter of the current block may be encoded and signaled.
[0257] Meanwhile, the neighboring blocks used to derive the size adjustment parameters of the current block may include at least one of an upper neighboring block, a left neighboring block, an upper-left neighboring block, an upper-right neighboring block, or a lower-left neighboring block.
[0258] Figure 15 shows an example in which motion compensation based on a translational model and a rotational model is performed for the current block.
[0259] For convenience of explanation, the current block is assumed to have a size of 4x4, as illustrated in Fig. 12.
[0260] First, as illustrated in (a) of Fig. 15, the location of a temporary block within a reference picture can be determined based on the motion vector of the current block. Specifically, a block location that is spaced apart by the motion vector from the location corresponding to the upper left sample of the current block within the reference picture can be determined as the upper left sample.
[0261] Thereafter, the temporary block can be rotated, as in the example illustrated in (b) of Fig. 15. The block at the rotated position can be set as a reference block, and the reference block can be set as a prediction block of the current block.
[0262] Meanwhile, a rotation matrix can be used to rotate a temporary block specified by a motion vector. That is, the prediction sample for the current block can be set to a sample at a position obtained by applying a rotation matrix to the sample position within the temporary block.
[0263] Mathematical expression 1 represents the rotation matrix.
[0264]
[0265] In the above mathematical expression 1, (pos_x, pos_y) represents the position of a sample within a temporary block. That is, (pos_x, pos_y) can be derived by adding a motion vector to the position of the target sample to be predicted within the current block.
[0266] (pos_x', pos_y') represents the rotated position from the position of the sample within the temporary block, and θ represents the rotation angle.
[0267] The sample value at the position (pos_x', pos_y') within the reference picture can be set as the value of the predicted sample for the position of the target sample. If the position (pos_x', pos_y') is a fractional position, the sample at that position can be generated by interpolating integer position samples.
[0268] Meanwhile, information indicating the rotation angle θ can be encoded and signaled. For example, after assigning a different index to each of a plurality of rotation angle candidates, the index of the rotation angle candidate corresponding to the rotation angle of the current block can be encoded and signaled.
[0269] Alternatively, the rotation angle of the current block can be derived based on the rotation angle of a neighboring block. For example, the rotation angle of a neighboring block at a predefined position can be set to the rotation angle of the current block.
[0270] Alternatively, when sequentially searching multiple neighboring blocks, the rotation angle of the first searched available neighboring block can be set to the rotation angle of the current block.
[0271] Alternatively, the rotation angle of a neighboring block may be set as a rotation angle candidate. In this case, a rotation angle candidate list including a plurality of rotation angle candidates may be generated by sequentially searching a plurality of neighboring blocks. One of the plurality of rotation angle candidates included in the plurality of rotation angle candidate lists may be set as the rotation angle of the current block. In this case, an index indicating a candidate among the plurality of rotation angle candidates having the same rotation angle as the current block may be encoded and signaled.
[0272] Meanwhile, the neighboring block used to derive the rotation angle of the current block may include at least one of an upper neighboring block, a left neighboring block, an upper left neighboring block, an upper right neighboring block, or a lower left neighboring block.
[0273] Although not shown, motion compensation for the current block can also be performed by simultaneously applying the translation model, zoom model, and rotation model.
[0274] Meanwhile, the motion vector precision for the current block or the number and / or types of motion vector precision candidates available for the current block may be determined differently depending on the motion compensation model.
[0275] For example, the number and / or type of motion vector precision candidates available for the current block may differ between cases where only the translational model is applied and cases where at least one of the zooming model or the rotational model is applied.
[0276] For example, if a translational model is applied to the current block, candidates larger than 1 / 4 pixel unit may be available for the current block. Conversely, if at least one zooming model or rotational model is additionally applied to the current block along with the translational model, candidates larger than 1 / 16 pixel unit may be available for the current block.
[0277] Alternatively, if a translational model is applied to the current block, the motion vector precision of the current block may be set to 1 / 4 pixel units. On the other hand, if at least one of a zooming model or a rotational model is additionally applied to the current block along with the translational model, the motion vector precision of the current block may be set to 1 / 16 pixel units.
[0278] Meanwhile, the encoder and decoder may have pre-stored the motion vector precisions or motion vector precision candidates available for each motion compensation model. Alternatively, information indicating the motion vector precisions or motion vector precision candidates available for each motion compensation model may be encoded and signaled through the upper header.
[0279] Motion compensation can be performed on an affine model, in which a zooming model and / or a rotation model are added to a translational model, using the motion vectors of the control points. Here, the control points may correspond to corners of the current block. For example, to perform motion compensation based on the affine model, at least one of the motion vector of the upper left corner, the motion vector of the upper right corner, or the motion vector of the lower left corner may be used.
[0280] Hereinafter, the motion vector of a control point will be referred to as a control point motion vector.
[0281] Figures 16 and 17 illustrate examples of generating a prediction block for a current block using control point motion vectors.
[0282] For convenience of explanation, the current block is assumed to have a size of 4x4, as illustrated in Fig. 12.
[0283] In (a) and (b) of FIG. 16, it is exemplified that a prediction block for the current block is derived by a motion vector of a first control point corresponding to the upper left corner of the current block (first control point motion vector, A) and a motion vector of a second control point corresponding to the upper right corner of the current block (second control point motion vector, B).
[0284] In addition to the example shown, it is also possible to derive a prediction block of the current block by additionally using the motion vector of the lower left corner or by using the motion vector of the lower left corner instead of the upper right corner.
[0285] Figure 18 shows an example of generating a prediction block for the current block using three control point motion vectors.
[0286] In (a) and (b) of FIG. 18, it is exemplified that a prediction block for the current block is derived by a motion vector of a first control point corresponding to the upper left corner of the current block (first control point motion vector, A), a motion vector of a second control point corresponding to the upper right corner of the current block (second control point motion vector, B), and a motion vector of a third control point corresponding to the lower left corner of the current block (third control point motion vector, C).
[0287] As in the examples illustrated in FIGS. 16 to 18, translational, zooming, and rotational motion compensation for the current block can be performed using two control point motion vectors or three control point motion vectors.
[0288] Information indicating the number of control point motion vectors may be encoded and signaled. The information may be signaled on a block-by-block basis. For example, the information may indicate whether two or three control point motion vectors are used in the current block.
[0289] Alternatively, the number of control point motion vectors can be adaptively determined based on at least one of the size or shape of the current block.
[0290] Alternatively, if the control point motion vectors of the current block are derived from neighboring blocks, the number of control point motion vectors for the current block may be set equal to the number of control point motion vectors of the neighboring blocks.
[0291] Using control point motion vectors, a motion vector for each sample within the current block can be derived. Equation 2 represents a formula for deriving a motion vector for each sample using two control point motion vectors.
[0292]
[0293] In the above mathematical expression 2, (mv x , mv y ) represents the motion vector at the (x, y) position within the current block. (mv Ax , mv Ay ) represents the first control point motion vector (A), and (mv Bx , mv By ) represents the second control point motion vector (B). W represents the width of the current block.
[0294] When three control point motion vectors are used, a motion vector per sample can be derived by the following mathematical expression 3.
[0295]
[0296] In the above mathematical expression 3, (mv Cx , mv Cy ) represents the third control point motion vector (C).
[0297] Once a motion vector is derived for each sample, motion compensation can be performed for each sample, as in the example illustrated in Fig. 17. Specifically, a reference sample indicated by the motion vector of the prediction target sample can be set as a prediction sample for the prediction target sample.
[0298] Meanwhile, if the motion vector of the prediction target sample is expressed in fractional units, integer position samples can be interpolated to generate fractional position samples, and the generated fractional position samples can be set as prediction samples for the prediction target sample.
[0299] At this time, the precision of the motion vector for each sample may be different. For example, the motion vector for the first prediction target sample may be derived in units of 1 / 2 pixels, while the motion vector for the second prediction target sample may be derived in units of 1 / 4 pixels.
[0300] In this case, fractional position samples can be generated according to the motion vector precision for each prediction target sample. Alternatively, the motion vector of the prediction target sample can be adjusted according to the reference motion vector precision, and then a prediction sample for the prediction target sample can be derived based on the adjusted motion vector. For example, if the reference motion vector precision is 1 / 2, the motion vector for the second prediction target sample can be adjusted in units of 1 / 4 pixels.
[0301] The reference motion vector precision can be determined on a block-by-block basis. Alternatively, the precision of control point motion vectors can be set as the reference motion vector precision. Alternatively, the reference motion vector precision can be predefined in the encoder and decoder.
[0302] As another example, to reduce complexity, motion vectors can be derived on a sub-block basis.
[0303] Figure 19 shows an example in which a motion vector is derived in sub-block units.
[0304] The size and / or shape of a sub-block may be predefined in the encoder and decoder. For example, a sub-block may be a square block of size 2x2 or 4x4.
[0305] Alternatively, the size and / or shape of the sub-block may be adaptively determined based on the size and / or shape of the current block. For example, if the current block is square, the sub-block may also be square. Conversely, if the current block is non-square, the sub-block may also be non-square.
[0306] Alternatively, information regarding at least one of the division method or division shape of the current block may be explicitly encoded and signaled. For example, information regarding at least one of the size of a sub-block, the shape of a sub-block, the position of a division line dividing the current block, or the number of division lines may be explicitly encoded and signaled. The information may be encoded and signaled on a block-by-block basis, or may be encoded and signaled via an upper header.
[0307] In Fig. 19, it is assumed that the sub-block is a square block of size 2x2.
[0308] A motion vector of a sub-block can be derived using coordinates of a predefined position within a sub-block. Here, the predefined position can be one of the positions of the upper left sample, the upper right sample, the lower left sample, the lower right sample, or the center position within the sub-block.
[0309] By substituting the coordinates of a predefined position within a sub-block into (x, y) in Equation 2, the motion vector of the sub-block can be derived.
[0310] As in the example described above, motion vectors can be derived in sub-block units based on the affine motion model.
[0311] Meanwhile, motion vectors can also be derived for each sub-block using collocated pictures. As described above, deriving motion vectors for each sub-block using collocated pictures can be called SbTMVP (Sub-block Temporal Motion Vector Prediction).
[0312] A collocated picture may be one of the reference pictures included in a reference picture list. For example, a picture with an index of 0 in the reference picture list may be selected as a collocated picture.
[0313] Alternatively, information indicating the index of a reference picture to be set as a collocated picture within the reference picture list may be explicitly encoded and signaled.
[0314] Figures 20 and 21 illustrate examples in which motion vectors are derived in units of sub-blocks within the current block when SbTMVP is applied.
[0315] The size and / or shape of the sub-block may be predefined in the encoder and decoder.
[0316] Alternatively, the size and / or shape of the sub-block may be adaptively determined based on the size and / or shape of the current block. For example, if at least one of the width or height of the current block is greater than a threshold, the size of the sub-block may be set to 8x8. Otherwise, the size of the sub-block may be set to 4x4.
[0317] Alternatively, information indicating the size and / or shape of the sub-block may be explicitly encoded and signaled.
[0318] In the example shown in Fig. 20, it is assumed that the size of the current block is 16x16 and the size of the sub-block is 4x4.
[0319] When SbTMVP is applied, an initial motion vector of the current block can be derived. The initial motion vector can be derived based on at least one of a motion vector prediction list or a motion information merge list. For example, an index indicating one of the motion vector prediction candidates included in the motion vector prediction list can be encoded and signaled. The initial motion vector can be derived by adding a motion vector differential value to the motion vector prediction candidate indicated by the index. Meanwhile, the motion vector differential value can also be explicitly encoded and signaled.
[0320] Alternatively, encoding of the index may be omitted, and a motion vector prediction candidate having a predefined index in the motion vector prediction list may be set as a prediction value for the initial motion vector. Here, the motion vector prediction candidate having a predefined index may be a motion vector prediction candidate having an index of 0 or a motion vector prediction candidate having the largest index.
[0321] Alternatively, an index indicating one of the motion information merging candidates included in the motion information merging list may be encoded and signaled. The initial motion vector may be set to be identical to the motion vector of the motion information merging candidate indicated by the index.
[0322] Alternatively, encoding of the index can be omitted, and the initial motion vector can be derived based on a motion information merge candidate having a predefined index in the motion information merge list. Here, the motion information merge candidate having a predefined index can be a motion information merge candidate having an index of 0 or a motion information merge candidate having the largest index.
[0323] Alternatively, the initial motion vector can be derived using the motion vector of a neighboring block at a predefined position. Here, the neighboring block at the predefined position can be a left neighboring block or an upper neighboring block.
[0324] The motion vector of a neighboring block at a predefined position can be set as a predicted value of the initial motion vector, and the difference value can be added to the predicted value to derive the initial motion vector.
[0325] Alternatively, the motion vector of a neighboring block at a predefined position can be set as the initial motion vector.
[0326] Alternatively, the initial motion vector can be derived using a template-based motion estimation method (i.e., template matching method) or bilateral matching.
[0327] The precision of the initial motion vector may be predefined in the encoder and decoder. For example, the precision of the initial motion vector may be fixed in integer pixel units.
[0328] Alternatively, information indicating the precision of the initial motion vector may be explicitly encoded and signaled. The information may be an index indicating one of a plurality of motion vector precision candidates.
[0329] When deriving an initial motion vector using a motion vector prediction candidate, the motion vector prediction candidates can be derived based on the motion vector precision of the initial motion vector. That is, the motion vector prediction candidate can be adjusted according to the motion vector precision of the initial motion vector, and then the adjusted initial motion vector prediction candidate can be inserted into the motion vector prediction list.
[0330] When deriving an initial motion vector using a motion information merge candidate, the motion information merge candidates can be derived based on the motion vector precision of the initial motion vector. That is, the motion information merge candidate can be adjusted according to the motion vector precision of the initial motion vector, and then the adjusted initial motion information merge candidate can be inserted into the motion information merge list.
[0331] Meanwhile, among the motion information merge candidates included in the motion information merge list, only those candidates whose reference picture is identical to the collocated picture of the current block can be used to derive the initial motion vector. That is, if the reference picture of a motion information merge candidate is different from the collocated picture of the current block, the initial motion vector may not be derived from the motion information merge candidate.
[0332] If there are multiple candidates among motion information merging candidates whose reference pictures are identical to the collocated pictures of the current block, an index indicating one of the multiple candidates may be encoded and signaled. Alternatively, if there are multiple candidates among motion information merging candidates whose reference pictures are identical to the collocated pictures of the current block, the initial motion vector may be derived from the candidate with the smallest index or the candidate with the largest index among the multiple candidates.
[0333] If a motion information merging candidate has both motion information in the L0 direction and motion information in the L1 direction, one of the motion information in the L0 direction and the motion information in the L1 direction can be selected according to a preset priority, and an initial motion vector can be derived from the selected motion information.
[0334] The priority may be determined based on at least one of the magnitude of the motion vector of the motion merging candidate, the index of the reference picture of the motion merging candidate, or whether the reference picture of the motion merging candidate is the same as the collocated picture.
[0335] Alternatively, it can be set to always derive the initial motion vector based on the motion information in the L0 direction.
[0336] When the initial motion vector is derived based on a template matching method, motion estimation can be performed according to the precision of the initial motion vector. For example, if the precision of the initial motion vector is integer pixel units, motion estimation based on template matching can also be performed only at integer positions.
[0337] Similarly, when the initial motion vector is derived based on bilateral matching, motion estimation can be performed according to the precision of the initial motion vector.
[0338] Meanwhile, as a result of the bilateral matching, a motion vector in the L0 direction (L0 motion vector) and a motion vector in the L1 direction (L1 motion vector) are derived. In this case, one of the L0 motion vector and the L1 motion vector can be set as the initial motion vector according to the preset priority.
[0339] Alternatively, it can be set to always derive the initial motion vector based on the motion information in the L0 direction.
[0340] Alternatively, information indicating which of the L0 motion vector and the L1 motion vector is set as the initial motion vector may be encoded and signaled.
[0341] Once the initial motion vector is derived, the position of the collocated block within the collocated block can be determined using the initial motion vector. For example, a block located at a position spaced apart by the initial motion vector from a position corresponding to the current block within the reference picture can be set as the collocated block. At this time, the position of the collocated block can be determined based on a predefined position within the current block. Here, the predefined position can be an upper left position, an upper right position, a lower left position, a lower right position, or a center position.
[0342] Depending on the division method of the current block, the collocated block can be divided into multiple collocated sub-blocks. In addition, the motion vector of each collocated sub-block within the collocated block can be set to the motion vector of each sub-block within the current block.
[0343] As another example, the initial motion vector can be used to determine the positions of the collocated sub-blocks corresponding to each sub-block within the current block within the collocated picture. In this case, the positions of the collocated sub-blocks can be derived based on predefined positions within the sub-blocks. Here, the predefined positions can be the upper left position, the upper right position, the lower left position, the lower right position, or the center position.
[0344] Thereafter, the motion vector of the collocated sub-block corresponding to the sub-block can be set as the motion vector of the sub-block. Specifically, the motion vector stored at a position corresponding to a predefined position within the collocated sub-block can be set as the motion vector of the sub-block.
[0345] Meanwhile, if the motion information of the collocated sub-block is unavailable, a predefined motion vector can be set as the motion vector of the sub-block. Here, the predefined motion vector can be a zero vector (i.e., (0, 0)) or an initial motion vector.
[0346] Alternatively, if the motion information of the collocated sub-block corresponding to the sub-block is not available, the motion vector of the sub-block may be derived from another location within the collocated sub-block.
[0347] Specifically, if a position corresponding to a predefined position within a collocated sub-block is encoded using intra prediction, then there is no motion vector at that position. For example, assuming that the predefined position is a central position (e.g., c10 in FIG. 21), if no motion vector is stored at the central position, the motion vector of the sub-block cannot be derived.
[0348] In this case, the motion vector of the sub-block can be derived based on the motion vector stored at a location different from the central location. Specifically, the motion vector of the sub-block can be derived based on the motion vector stored at a location adjacent to the central location (e.g., the upper adjacent location c6, the left adjacent location c9, or the upper left adjacent location c5).
[0349] Alternatively, if the center position is not available, the samples within the collocated sub-blocks may be searched according to the scan order, and the first available motion vector found may be set as the motion vector of the sub-block. Here, the scan order may be a horizontal scan, a vertical scan, a diagonal scan, or a raster scan.
[0350] Alternatively, if motion information of a collocated sub-block is unavailable, the motion vector of the sub-block may be set as the motion vector of the collocated block. For example, a motion vector stored at a position corresponding to a predefined position within the current block within the collocated block may be set as the motion vector of the sub-block.
[0351] As in the example described above, motion vectors can be derived for each sub-block using the affine motion model or SbTMVP. When motion vectors are derived for each sub-block, motion compensation can be performed for each sub-block based on the motion vector of each sub-block.
[0352] By performing motion compensation for each sub-block, a prediction block for the current block can be obtained. That is, the prediction block may be composed of prediction samples of each of the sub-blocks.
[0353] 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.
[0354] Taking this into account, we can search for motion vectors more precisely through reference picture interpolation.
[0355] Figures 22 and 23 are diagrams showing examples in which prediction blocks are derived according to motion vector precision.
[0356] Figure 22 shows the position of the current block within the current picture, and Figure 23 shows the position of the reference block according to the motion vector precision.
[0357] As in the examples illustrated in FIGS. 22 and 23, the motion vector of the current block can be defined as the distance from the sample corresponding to the upper left position of the current block in the reference picture to the sample corresponding to the upper left position of the reference block in the reference picture.
[0358] Figure 23 (a) illustrates a case where the motion vector precision of the current block is an integer pel, Figure 23 (b) illustrates a case where the motion vector precision of the current block is 1 / 2 pel, and Figure 23 (c) illustrates a case where the motion vector precision of the current block is 1 / 4 pel.
[0359] In Figure 23, 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.
[0360] 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.
[0361] 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.
[0362] 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.
[0363] 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).
[0364] 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).
[0365] 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).
[0366] 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).
[0367] 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.
[0368] 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.
[0369] 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).
[0370] Figures 24 and 25 are diagrams for explaining the process of encoding and decoding a motion vector difference value, respectively, when the AMVR method is applied.
[0371] 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.
[0372] The motion vector difference value MVD can be derived by differentiating the motion vector prediction value MVP from the motion vector MV (S2410).
[0373] 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).
[0374] 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 (S2420).
[0375] 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 (S2430). Meanwhile, the motion vector precision can be encoded as AMVR-related information.
[0376] 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.
[0377] 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.
[0378] 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.
[0379] 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.
[0380] 1) If amvr_flag is 0
[0381] 2) If amvr_flag is 1 and amvr_prec_idx is 0
[0382] 3) If amvr_flag is 1 and amvr_prec_idx is 1
[0383] 4) If amvr_flag is 1 and amvr_prec_idx is 2
[0384] 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.
[0385] amvr_flagamvr_prec_idxamvrshift0 (1 / 4)-210 (1 / 2)311 (1-pel)412 (4-pel)6
[0386] 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 4.
[0387]
[0388] 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 4.
[0389] 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 4.
[0390] 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 5 shows an example of performing a scale down operation on the motion vector difference value MVD.
[0391]
[0392] In the above mathematical expression 5, 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.
[0393] The encoder can encode motion vector difference values and AMVR information with changed precision (S2440).
[0394] In the decoder, the motion vector difference value MVD can be decoded (S2510).
[0395] 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 (S2520).
[0396] 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 (S2530).
[0397] 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.
[0398] 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 (S2540). Mathematical expression 6 shows an example in which a scale-up operation is applied to the decoded MVD.
[0399]
[0400] In mathematical expression 6, 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.
[0401] 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.
[0402] 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.
[0403]
[0404] Meanwhile, when constructing a motion information merge list or a motion vector prediction list, a template matching technique can be used. For example, motion information derived based on template matching can be added as a candidate to a motion information merge list or a motion vector prediction list.
[0405] Alternatively, the template matching cost may be calculated for each candidate included in the motion information merge list or motion vector prediction list, and then the derived candidates may be reordered according to the template matching cost.
[0406] Alternatively, motion estimation based on template matching may be performed on at least one candidate included in the motion information merge list or the motion vector prediction list, and the candidate may be corrected based on the motion estimation result.
[0407] In the following embodiments, a method for correcting at least one candidate included in a motion information merge list or a motion vector prediction list is described in detail.
[0408] Meanwhile, a motion vector prediction list or a motion information merge list may be referred to as a motion information list. The motion information candidates included in the motion information list may represent motion vector prediction candidates included in the motion vector prediction list or motion information merge candidates included in the motion information merge list, depending on the type of the motion information list.
[0409] The size of the motion information list may indicate the maximum number of motion information candidates that the motion information list can include. If the number of motion information candidates included in the motion information list is smaller than the size of the motion information list, a new motion information candidate may be generated according to a preset method. Here, the method for generating the new motion information candidate may be predefined in the encoder and decoder. That is, the decoder may generate the new motion information candidate using the same method as the encoder.
[0410] FIG. 26 illustrates a method for configuring a motion information list according to one embodiment of the present disclosure.
[0411] First, a motion information list of the current block can be constructed (S2610). The motion information list can include at least one of motion information candidates derived from spatial neighboring blocks of the current block, motion information candidates derived from temporal neighboring blocks, or motion information candidates derived from a history-based motion vector prediction table (HMVP (History-based Motion Vector Prediction) table).
[0412] Thereafter, an updated motion information list can be generated by updating at least one motion information candidate included in the motion information list (S2620).
[0413] In the encoder, the motion information of the current block is encoded based on the updated motion information list, and in the decoder, the motion information of the current block can be obtained from the updated motion information list.
[0414] Below, we will describe in detail a method for correcting (i.e., updating) motion information candidates included in the motion information list.
[0415] For convenience of explanation, the following embodiments will be described based on a motion vector prediction list. However, the embodiments described below can also be applied to a motion information merge list.
[0416] After constructing a motion vector prediction list, motion estimation based on template matching can be performed on each of a plurality of motion vector prediction candidates included in the motion vector prediction list. Specifically, motion estimation based on template matching within a reference picture can be performed by setting an initial motion vector derived from the motion vector prediction candidate as a starting point. Here, the initial motion vector can represent a motion vector derived by adding a motion vector differential value to a motion vector prediction candidate or a motion vector.
[0417] Additionally, the reference picture may represent the reference picture of the current block. When the motion vector prediction mode is applied, information indicating the reference picture of the current block (i.e., the reference picture index) may be explicitly encoded and signaled.
[0418] Meanwhile, when applying the present embodiment to a motion information merge list, the initial motion vector may be set to the motion vector of the motion information merge candidate. In addition, motion estimation based on template matching may be performed within the reference picture indicated by the reference picture index of the motion information merge candidate.
[0419] Motion estimation can be performed within a preset search range. The size / shape of the search range may be predefined in the encoder and decoder. Alternatively, the size / shape of the search range may be adaptively determined based on at least one of the size / shape of the current block or the distance between the current picture and a reference picture. Alternatively, information indicating the size / shape of the search range may be explicitly encoded and signaled. For example, the information may be signaled via an upper header. Here, the upper header may include at least one of a slice header, a picture header, a picture parameter set, or a sequence parameter set.
[0420] Based on the motion estimation results, the motion vector prediction candidate can be corrected. That is, once the optimal motion vector is determined based on motion estimation, the existing motion vector prediction candidate (i.e., the initial motion vector) can be updated with the optimal motion vector.
[0421] That is, if the difference between the initial motion vector and the optimal motion vector is called an offset vector, a corrected motion vector prediction candidate can be derived by adding the offset vector to the existing motion vector prediction candidate.
[0422] Motion estimation based on template matching can be performed within a preset precision range. The precision range can be defined by a starting precision and an ending precision, and motion estimation can be performed by gradually reducing the motion vector precision within the precision range.
[0423] For convenience of explanation, it is assumed that the motion vector precision candidates for motion estimation include 4-pel, 2-pel, 1-pel, 1 / 2-pel, 1 / 4-pel, 1 / 8-pel, and 1 / 16-pel.
[0424] If the starting precision of the precision range is 1-pel and the ending precision is 1 / 4-pel, motion estimation can be performed sequentially from 1-pel units to 1 / 4-pel units.
[0425] First, motion estimation is performed on a 1-pel basis within the reference picture, and the optimal position (i.e., the optimal motion vector) can be determined based on the cost between the current template and the reference template. Specifically, the cost between the current template and the reference template is calculated on a 1-pel basis, and the position with the lowest cost can be determined as the optimal position.
[0426] Once the optimal position is determined, 1 / 2-pel unit motion estimation can be performed around the optimal position. Specifically, the cost between the current template and the reference template can be calculated for 1 / 2-pel unit positions in four or eight directions around the optimal position. If the cost at the 1 / 2-pel unit position with the lowest cost is less than that at the existing optimal position, the optimal position can be updated to that 1 / 2-pel position. On the other hand, if the cost at the 1 / 2-pel unit position with the lowest cost is not less than that at the existing optimal position, the optimal position can be maintained without being updated.
[0427] Here, the 1 / 2-pel unit positions in the four directions include positions that are spaced 1 / 2 pixel apart from the optimal position in the horizontal or vertical direction. For example, if the coordinates of the optimal position are (x, y), the 1 / 2-pel unit positions in the four directions may include (x+(1 / 2), y), (x-(1 / 2), y), (x, y+(1 / 2)) and (x, y-(1 / 2)).
[0428] The eight-directional half-pel unit positions include positions that are spaced apart from the optimal position by half a pixel in the horizontal and vertical directions in addition to the four-directional half-pel unit positions described above. For example, the eight-directional half-pel unit positions may further include positions (x+(1 / 2), y+(1 / 2)), (x+(1 / 2), y-(1 / 2)), (x-(1 / 2), y+(1 / 2)) and (x+(1 / 2), y-(1 / 2)) in addition to the four-directional half-pel unit positions described above.
[0429] 1 / 4-pel unit motion estimation can be performed around the optimal position determined through 1 / 2-pel unit motion estimation. Specifically, the cost between the current template and the reference template can be calculated for 1 / 4-pel unit positions in 4 or 8 directions around the optimal position. If the cost at the 1 / 4-pel unit position with the lowest cost is less than the cost at the existing optimal position, the optimal position can be updated to that 1 / 4-pel position. On the other hand, if the cost at the 1 / 4-pel unit position with the lowest cost is not less than the cost at the existing optimal position, the optimal position can be maintained without being updated.
[0430] Here, the 1 / 4-pel unit positions in the four directions include positions that are spaced 1 / 4 pixel apart in the horizontal or vertical direction from the optimal position.
[0431] Additionally, the 1 / 4-pel unit positions in the eight directions include positions that are spaced apart from the optimal position by 1 / 4 pixel in the horizontal and vertical directions, in addition to the 1 / 4-pel unit positions in the four directions described above.
[0432] Since 1 / 4-pel corresponds to the final precision, no further motion estimation may be performed after performing 1 / 4-pel unit motion estimation. That is, the motion vector prediction candidate can be corrected to indicate the optimal position obtained by performing 1 / 4-pel unit motion estimation. In other words, the corrected motion vector prediction candidate can be derived by adding the distance between the position indicated by the initial motion vector and the optimal position to the initial motion vector.
[0433] Meanwhile, depending on the precision, the number of candidate positions for calculating the optimal position may vary. For example, when motion estimation is performed in units of 1 / 2 pel, the cost is calculated for positions in four directions centered on the optimal position, whereas when motion estimation is performed in units of 1 / 4 pel, the cost may be calculated for positions in eight directions centered on the optimal position. In other words, when the first precision is greater than the second precision, the number of search target positions for the first precision may be smaller than the number of search target positions for the second precision.
[0434] The precision range can also be determined using the motion vector precision (i.e., the precision of the motion vector differential) of a motion vector prediction candidate. For example, the motion vector precision of a neighboring block used to derive a motion vector prediction candidate can be set as the final precision. To this end, information (e.g., AMVR information) used to determine the motion vector precision of a neighboring block can also be stored in the motion vector prediction candidate.
[0435] The AMVR information may include at least one of a flag (e.g., amvr_flag) indicating whether the AMVR method is applied to a neighboring block, and an index (e.g., amvr_prec_idx) indicating one of a plurality of motion precision candidates when the AMVR method is applied.
[0436] Alternatively, a variable amvrshift determined by the motion vector parameter can be stored in the motion vector prediction candidate.
[0437] Alternatively, multiple precision candidates can be defined with indices of different values, and then an index indicating one of the multiple precision candidates can be stored in the motion vector prediction candidate.
[0438] Table 2 shows an example in which an index indicating one of the motion vector precision candidates is stored for each motion vector prediction candidate.
[0439] mvp_idxMotion information 0MV(4, 5)prec_idx31MV(3, 1)prec_idx12MV(3, 1)prec_idx23MV(4, 5)prec_idx34MV(1, 5)prec_idx0
[0440] In Table 2 above, prec_idx can indicate one of multiple motion vector precision candidates. Table 3 illustrates the mapping relationship between the values of prec_idx and motion vector precision candidates.
[0441] prec_idx0123456precision4-pel2-pel1-pel1 / 2-pel1 / 4-pel1 / 8-pel1 / 16-pel
[0442] In the example in Table 1, the motion vector precision of the motion vector prediction candidate whose index (i.e., mvp_idx) is 0 is 1 / 2-pel, so if you want to perform motion estimation based on template matching for the candidate whose index is 0, you can set the ending precision to 1 / 2-pel.
[0443] Meanwhile, the starting precision can be set to a value predefined in the encoder and decoder. For example, the starting precision can be set to 2-pel or 1-pel.
[0444] Alternatively, the motion vector precision of the motion vector prediction candidate can be compared with a predefined value to determine whether to set the motion vector precision of the motion vector prediction candidate to the ending precision or the starting precision.
[0445] For example, if the motion vector precision of the motion vector prediction candidate is smaller than the predefined motion vector precision, the motion vector precision of the motion vector prediction candidate can be set as the final precision. On the other hand, if the motion vector precision of the motion vector prediction candidate is not smaller than the predefined motion vector precision, the predefined motion vector precision can be set as the final precision.
[0446] For example, assume that the predefined motion vector precision is 1-pel. If the motion vector precision of the motion vector prediction candidate is 1 / 2-pel or 1 / 4-pel, the motion vector precision of the motion vector prediction candidate can be set as the ending precision. On the other hand, if the motion vector precision of the motion vector prediction candidate is 1-pel or 2-pel, the predefined motion vector precision (i.e., 1-pel) can be set as the ending precision.
[0447] When the precision range is determined based on the motion vector precision of the motion vector prediction candidate, the precision range may be set differently for each motion vector prediction candidate.
[0448] As another example, the motion vector precision of a motion vector prediction candidate can be set to the starting precision of the precision range. In this case, the ending precision can be set to a value predefined in the encoder and decoder. For example, the predefined value can be 1-pel, 1-2-pel, or 1-4-pel.
[0449] Alternatively, when the AMVR method is applied to the current block, the motion vector precision of the current block may be set to the ending precision.
[0450] Depending on the motion vector precision of the motion vector prediction candidate, the motion estimation method may differ.
[0451] Alternatively, the motion estimation method may differ depending on the interpolation method of the motion vector prediction candidate.
[0452] Alternatively, the size / shape of the search range for motion estimation can be adaptively determined based on the motion vector precision of the motion vector prediction candidate.
[0453] Meanwhile, correction of motion vector prediction candidates can be performed on all motion vector prediction candidates included in the motion vector prediction list.
[0454] Alternatively, the correction procedure may be performed only on some of the motion vector prediction candidates included in the motion vector prediction list. For example, N motion vector prediction candidates may be selected in descending order of indices, and correction may be performed only on the selected N motion vector prediction candidates. Here, N may represent a natural number such as 1 or 2.
[0455] Meanwhile, N may be predefined in the encoder and decoder.
[0456] Alternatively, information indicating N may be encoded and signaled via the upper header.
[0457] Alternatively, a template matching cost may be calculated for each of the motion vector prediction candidates included in the motion vector prediction list, and then N motion vector prediction candidates may be selected in order of lowest cost or N motion vector prediction candidates in order of highest cost. Correction may be performed only for the selected N motion vector prediction candidates.
[0458] Alternatively, the template matching cost of a motion vector prediction candidate can be compared with a threshold to determine whether to compensate for the motion vector prediction candidate. For example, only if the template matching cost of the motion vector prediction candidate is greater than the threshold can the motion vector prediction candidate be compensated through template matching. Conversely, if the template matching cost of the motion vector prediction candidate is not greater than the threshold, the motion vector prediction candidate may not be compensated.
[0459] Information indicating whether to correct motion vector prediction candidates may be encoded and signaled. The information may be a 1-bit flag.
[0460] Alternatively, it may be determined whether to correct motion vector prediction candidates based on at least one of the size of the current block, whether bidirectional prediction is applied to the current block, or whether the reference picture is a predefined picture. Here, the predefined picture may be a collocated picture or a reference picture with an index of 0.
[0461] In the above example, motion estimation based on template matching was performed to calibrate motion vector prediction candidates. Alternatively, a template matching cost can be calculated for each motion vector prediction candidate. Subsequently, instead of calibrating motion vector prediction candidates through template matching-based motion estimation, the motion vector prediction candidates can be reordered based on the template matching cost.
[0462] Alternatively, after correcting the motion vector prediction candidates, the corrected motion vector prediction candidates can be reordered according to the template matching cost.
[0463] The cost between the current template and the reference template can be calculated using a cost function. The cost function may include at least one of the following: Sum of Absolute Differences (SAD), Sum of Absolute Transformed Differences (SATD), Sum of Squared Differences (SSD), or Mean-Removed Sum of Absolute Differences (MR-SAD).
[0464] The type of the cost function may be predefined in the encoder and decoder. Alternatively, information indicating one of multiple cost function candidates may be encoded and signaled.
[0465] Alternatively, the types of cost functions may be different between motion vector prediction candidates.
[0466] For example, the cost function type may be different depending on the index of the motion vector prediction candidate. For example, for motion vector prediction candidates whose indices are even (e.g., motion vector prediction candidates whose indices are 0, 2, and 4), the cost may be calculated based on the first type of cost function, and for motion vector prediction candidates whose indices are odd (e.g., motion vector prediction candidates whose indices are 1 and 3), the cost may be calculated using the second type of cost function. Here, the first type indicates one of SAD, SATD, SSD, and MR-SAD, and the second type indicates one of the cost function candidates excluding the first type.
[0467] Alternatively, for motion vector prediction candidates whose indices are less than a threshold, the cost may be calculated based on a first type cost function, and for motion vector prediction candidates whose indices are greater than or equal to the threshold, the cost may be calculated based on a second type cost function.
[0468] Alternatively, when calculating costs, different weights can be assigned to each sample. The weights applied to each sample can be determined based on the sample's location within the template. Here, the template can represent the current template or a reference template.
[0469] For convenience of explanation, we assume that costs are calculated based on SAD.
[0470] A residual template can be generated by differentiating between the current template and the reference template. The residual template can include differential values between the reconstructed samples in the current template and the reconstructed samples in the reference template.
[0471] By summing the absolute values of the residual values included in the residual template, a cost based on SAD can be calculated.
[0472] Alternatively, when summing residual values, weights can be assigned to the residual values. Specifically, the weight assigned to a residual value derived from samples located close to the current block within the current template may have a greater value than the weight assigned to a residual value derived from samples located far from the current block within the current template.
[0473] For example, as shown in the second figure of Fig. 9, it is assumed that the template consists of an upper restoration area and a left restoration area. Furthermore, it is assumed that each of the upper restoration area and the left restoration area consists of a plurality of lines, for example, a plurality of rows or a plurality of columns.
[0474] Accordingly, the residual template may also include an upper region T containing the upper residual values and a left region L containing the left residual values.
[0475] Assuming that the locations of the residual values in the residual template are the same as the locations of the restored samples in the current template, the weight applied to the residual values belonging to the first column adjacent to the current block in the left region L can be set to a value greater than the weight applied to the residual values belonging to the column not adjacent to the current block in the left region L.
[0476] Additionally, the weight applied to the residual values belonging to the first row adjacent to the current block in the upper region T can be set to a value greater than the weight applied to the residual values belonging to the row not adjacent to the current block in the upper region T.
[0477] As explained, weights can be determined on a line (row or column) basis or on a multiple line basis.
[0478] Alternatively, the weights assigned to residual values within a residual template can be determined based on the distance from the sample at a predefined location within the current block. Specifically, a higher weight can be assigned to a residual value that is close to the sample at a predefined location within the current block, and a higher weight can be assigned to a residual value that is far from the sample at a predefined location within the current block.
[0479] The sample at the position defined here may include at least one of a sample located at the upper left corner of the current block, a sample located at the center of the upper border, or a sample located at the center of the left border.
[0480] For example, assume that the sample at the predefined location is the sample located at the upper left corner within the current block. In this case, a high weight may be assigned to the residual value located at the lower left corner among the residual values included in the upper region T, while a low weight may be assigned to the residual value located at the upper right corner among the residual values included in the upper region T.
[0481] Additionally, a high weight may be assigned to a residual value located at the upper right among the residual values included in the left region L, while a low weight may be assigned to a residual value located at the lower left among the residual values included in the left region L.
[0482] Afterwards, the absolute values of the weighted residual values can be added to calculate the cost between the current template and the reference template.
[0483] In the above example, the weights can have either 0 or positive values.
[0484] In the above example, it was assumed that the concept of weighting was added to the existing SAD, enabling cost calculation. The concept of weighting can be added to not only Bindan SAD, but also SATD, SSD, and MR_SAD, enabling cost calculation.
[0485] Furthermore, as a concept distinct from the existing SAD, SSD, SATD, and MR-SAD, at least one of weighted SAD, weighted SSD, weighted SATD, and weighted MR-SAD, which have the added concept of weight, can be additionally defined as a cost function type.
[0486] Meanwhile, to simplify calculations, residual values can be obtained only for sub-sampled locations within the current template and reference template, and the cost between the current template and the reference template can be calculated. For example, when SAD or weighted SAD is applied, residual values can be obtained only for sub-sampled locations, and the absolute values or weighted absolute values of these can be added to calculate the cost between the current template and the reference template.
[0487] It is also possible to compute the SAD by performing subsampling rather than computing the SAD using all residual values in the template.
[0488] Whether to use the conventional cost calculation method or the cost calculation method with the weight concept added can be determined based on whether there is a reference picture that is further back in time than the current picture, whether there is a reference picture that is further back in time than the current picture, or whether there are both reference pictures that are further back in time than the current picture and reference pictures that are further back in time than the current picture.
[0489] Meanwhile, when rearranging motion vector prediction candidates based on the calculated cost, the cost calculation method for the motion vector candidates can be derived in the same manner. The motion vector prediction candidates can be rearranged in order of lowest cost.
[0490] Alternatively, the type of the cost function can be adaptively determined depending on the type of motion vector prediction candidate. Here, the type of motion vector prediction candidate can represent a candidate derived from a spatial neighboring block, a candidate derived from a temporal neighboring block, or a candidate derived from a history-based motion vector prediction table.
[0491] Alternatively, the type of cost function can be adaptively determined based on the motion vector precision of the motion vector prediction candidate.
[0492] Meanwhile, as described above, the above-described embodiments can also be applied to correcting the motion vector of a motion information merging candidate in a motion information merging list or to rearrange the motion information merging candidates.
[0493] For example, the motion vector of a motion information merge candidate in the motion information merge list can be used as an initial motion vector, and motion estimation can be performed within a reference picture indicated by the reference picture index of the motion information merge candidate. Afterwards, when an optimal motion vector is derived, the motion vector of the motion information merge candidate (i.e., the initial motion vector) can be changed to the optimal motion vector, thereby correcting the motion information merge candidate.
[0494] Meanwhile, in order to determine the precision range, information on motion vector precision can also be stored for motion information merging candidates.
[0495] Meanwhile, the cost function for motion vector prediction candidates and the cost function for motion information merging candidates may be different.
[0496]
[0497] 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.
[0498] 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.
[0499] 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.
[0500] 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.
[0501] 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.
[0502] The present disclosure may be applied to a computing or electronic device capable of encoding / decoding a video signal.
Claims
1. A step for generating a list of movement information of the current block; A step of updating the motion information list by correcting at least one of the motion information candidates included in the motion information list; A step of deriving motion information of the current block from the updated motion information list; and A step of obtaining a prediction block of the current block based on the motion information of the current block, A video decoding method in which the correction of a motion information candidate updates a motion vector of the motion information candidate by performing motion estimation based on template matching.
2. In paragraph 1, The above motion estimation is performed within a precision range, An image decoding method, characterized in that the above precision range is defined by a start precision and an end precision.
3. In paragraph 2, An image decoding method, characterized in that one of the above start precision and the above end precision is set to the motion vector precision of a neighboring block used to derive the motion information candidate.
4. In paragraph 3, A method for decoding an image, characterized in that the other of the above starting precision and the above ending precision is predefined in the decoder.
5. In paragraph 2, Starting from the above starting precision, motion estimation is performed step by step while reducing the motion vector precision. An image decoding method, characterized in that the number of position candidates searched when motion estimation is performed based on a first motion vector precision is different from the number of position candidates searched when motion estimation is performed based on a second motion vector precision.
6. In paragraph 1, The motion vector of the above motion information candidate is set as the initial motion vector, A video decoding method characterized in that the motion vector of the motion information candidate is updated by adding the difference between the position indicated by the initial motion vector and the optimal position determined through the motion estimation to the motion vector of the motion information candidate.
7. In paragraph 1, An image decoding method characterized in that whether to correct the motion information candidate is determined based on the result of comparing the template matching cost calculated based on the motion information of the motion information candidate with a threshold value.
8. In paragraph 1, A video decoding method, characterized in that the correction is applied only to a predefined number of motion information candidates having a small index in the motion information list.
9. In paragraph 1, Calculate the template matching cost for each of the motion information candidates in the above motion information list, A video decoding method characterized in that the correction is applied only to a predefined number of motion information candidates selected in the order of the smallest template matching cost.
10. In paragraph 1, After correcting the motion information candidates in the above motion information list, A video decoding method, characterized in that the updated motion information list is derived by rearranging the corrected motion information candidates according to the template matching cost of each of the corrected motion information candidates.
11. In paragraph 1, Through the above motion estimation, the optimal position with the smallest template matching cost is determined, A method for decoding an image, characterized in that the template matching cost is calculated based on one of multiple cost functions.
12. In paragraph 11, An image decoding method, characterized in that the above cost functions include at least one of SAD (Sum of Absolute Differences), SATD (Sum of Absolute Transformed Differences), SSD (Sum of Squared Difference), or MR-SAD (Mean-Removed Sum of Absolute Differences).
13. In paragraph 11, A video decoding method, characterized in that the cost function for calculating the template matching cost is different between the case where the motion information list is a motion information merge list and the case where the motion information list is a motion vector prediction list.
14. Step of generating a list of movement information of the current block; A step of updating the motion information list by correcting at least one of the motion information candidates included in the motion information list; A step of encoding motion information of the current block based on the updated motion information list; and A step of obtaining a prediction block of the current block based on the motion information of the current block, A video encoding method in which correction of a motion information candidate updates a motion vector of the motion information candidate by performing motion estimation based on template matching.
15. A processor for obtaining compressed video data; and Including a transmission unit for transmitting the compressed video data, The above compressed video data is, A step for generating a list of movement information of the current block; A step of updating the motion information list by correcting at least one of the motion information candidates included in the motion information list; A step of deriving motion information of the current block from the updated motion information list; and Based on the motion information of the current block, a prediction block of the current block is obtained through a step of obtaining the prediction block of the current block, A device for transmitting compressed video data, wherein the correction of a motion information candidate updates a motion vector of the motion information candidate by performing motion estimation based on template matching.
Citation Information
Patent Citations
Battery module, battery pack and vehicle comprising the battery module
KR1020220026928A
Composition for decomposing fat comprising Morus alba L. bark and Magnolia officinalis bark extract as active ingredients
KR1020230120364A
Smart shoes that guide normal gait and absorb shock
KR1020250180016A
Adaptive Motion Vector Precision for Video Coding
KR102621943B1
Product demand forecasting method and device using decomposition technique and machine learning hybrid model
KR102687917B1