Video coding method and device, and recording medium storing bitstream

The block vector-based prediction method improves video compression by generating optimal block vector sets for high-resolution images, addressing efficiency and accuracy challenges in existing technologies.

WO2025198309A1PCT designated stage Publication Date: 2025-09-25DONG A UNIV RES FOUND FOR IND ACAD COOP
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/KR2025/003520
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-04-05
Filing Date
2025-03-18
Publication Date
2025-09-25

AI Technical Summary

Technical Problem

Existing video compression technologies face challenges in efficiently compressing high-resolution images, particularly in improving compression performance, reducing complexity, and enhancing prediction accuracy while managing signaling overhead.

Method used

A block vector-based prediction method and device that generates a block vector list for a current block, utilizing block vectors derived from a cost comparison with reference blocks, and employs adaptive filtering and thresholding to construct optimal block vector sets for improved prediction.

Benefits of technology

Enhances compression performance, reduces complexity, and improves prediction accuracy by optimizing the use of block vectors, thereby reducing signaling overhead and enhancing encoder/decoder efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure KR2025003520_25092025_PF_FP_ABST
    Figure KR2025003520_25092025_PF_FP_ABST
Patent Text Reader

Abstract

An image encoding / decoding method and device according to the present disclosure may generate a block vector list for a current block and generate a prediction block of the current block on the basis of the block vector list. Here, the block vector list may include a plurality of block vectors. One or more block vector sets may be configured on the basis of the block vector list. At least one of the plurality of block vectors may be derived on the basis of a cost between a template of the current block and a template of a reference block.
Need to check novelty before this filing date? Find Prior Art

Description

Video coding method and device, and recording medium storing bitstream

[0001] The present invention relates to a video signal processing method and device.

[0002] The market demand for high-resolution video is growing, necessitating technologies capable of efficiently compressing high-resolution images. To address this market need, the ISO / IEC's Moving Picture Expert Group (MPEG) and the ITU-T's Video Coding Expert Group (VCEG) jointly formed the Joint Collaborative Team on Video Coding (JCT-VC). They completed development of the HEVC (High Efficiency Video Coding) video compression standard in January 2013 and have been actively conducting research and development on next-generation compression standards.

[0003] Video compression largely consists of intraprediction, interprediction, transform, quantization, entropy coding, and in-loop filtering. Among these, intraprediction refers to a technique that generates a prediction block for the current block using reconstructed pixels surrounding the current block. The encoder encodes the intraprediction mode used for intraprediction, and the decoder performs intraprediction by reconstructing the encoded intraprediction mode.

[0004] The present disclosure provides a method and device for constructing a block vector list.

[0005] The present disclosure seeks to provide a block vector-based prediction method and device.

[0006] The video decoding method and device according to the present disclosure can generate a block vector list for a current block and generate a prediction block of the current block based on the block vector list. Here, the block vector list can include a plurality of block vectors. One or more block vector sets can be configured based on the block vector list. At least one of the plurality of block vectors can be derived based on a cost between a template of the current block and a template of a reference block.

[0007] In the image decoding method and device according to the present disclosure, among the plurality of block vectors belonging to the block vector list, the top X block vectors in ascending order of the cost can be used in one or more block vector sets.

[0008] In the image decoding method and device according to the present disclosure, among the plurality of block vectors belonging to the block vector list, the lower X block vectors in ascending order of the cost can be used in one or more block vector sets.

[0009] In the image decoding method and device according to the present disclosure, among the plurality of block vectors belonging to the block vector list, the upper X block vectors in ascending order of coordinate values ​​can be used in one or more block vector sets. Here, the coordinate value can be either an x-coordinate value or a y-coordinate value.

[0010] In the image decoding method and device according to the present disclosure, among the plurality of block vectors belonging to the block vector list, the lower X block vectors in ascending order of coordinate values ​​can be used in one or more block vector sets. Here, the coordinate value can be either an x-coordinate value or a y-coordinate value.

[0011] In the image decoding method and device according to the present disclosure, among the plurality of block vectors belonging to the block vector list, the top X block vectors in ascending order of absolute coordinate values ​​can be used in one or more block vector sets. Here, the absolute coordinate value can be either the absolute value of the x-coordinate or the absolute value of the y-coordinate.

[0012] In the image decoding method and device according to the present disclosure, among the plurality of block vectors belonging to the block vector list, the lower X block vectors in ascending order of absolute coordinate values ​​can be used in one or more block vector sets. Here, the absolute coordinate value can be either the absolute value of the x-coordinate or the absolute value of the y-coordinate.

[0013] In the image decoding method and device according to the present disclosure, the current block vector set can be filtered based on at least one of a threshold value for the current block vector set or a characteristic of a previous block vector set.

[0014] In the image decoding method and device according to the present disclosure, the top X block vectors in ascending order of cost among the block vectors belonging to the previous block vector set can be reused in the current block vector set.

[0015] In the image decoding method and device according to the present disclosure, the threshold for the current block vector set can be set based on the smallest cost among the costs of the block vectors belonging to the current block vector set.

[0016] In the image decoding method and device according to the present disclosure, among the block vectors belonging to the current block vector set, a block vector having a cost greater than or equal to the threshold value can be excluded from the current block vector set.

[0017] In the image decoding method and device according to the present disclosure, the maximum number of block vectors that can be included in the current block vector set can be determined based on the number of block vectors belonging to the previous block vector set.

[0018] The video encoding method and device according to the present disclosure can generate a block vector list for a current block and generate a prediction block of the current block based on the block vector list.

[0019] A computer-readable recording medium according to the present disclosure can store a bitstream encoded by the image encoding method.

[0020] According to the present disclosure, the compression performance of a decoder / encoder can be improved and the complexity can be reduced by changing or expanding the search range.

[0021] According to the present disclosure, the accuracy of prediction can be improved by improving the method of constructing a block vector set.

[0022] According to the present disclosure, the accuracy of a prediction block can be improved based on an adaptive linear filter, and the performance of a decoder / encoder can be improved by implicitly deriving an optimal linear filter.

[0023] According to the present disclosure, signaling overhead of information for subpixel prediction can be reduced.

[0024] According to the present disclosure, the compression efficiency of an encoder can be improved by constructing and using a single integrated block vector list.

[0025] FIG. 1 is a block diagram showing an image encoding device according to the present disclosure.

[0026] FIG. 2 is a block diagram showing an image decoding device according to the present disclosure.

[0027] FIG. 3 illustrates a method for generating a prediction block based on a block vector as an example according to the present disclosure.

[0028] FIG. 4 illustrates a method for constructing a block vector set as an embodiment according to the present disclosure.

[0029] Figure 5 shows examples of filter shapes that can be used in linear filter mode.

[0030] The video decoding method and device according to the present disclosure can generate a block vector list for a current block and generate a prediction block of the current block based on the block vector list. Here, the block vector list can include a plurality of block vectors. One or more block vector sets can be configured based on the block vector list. At least one of the plurality of block vectors can be derived based on a cost between a template of the current block and a template of a reference block.

[0031] In the image decoding method and device according to the present disclosure, among the plurality of block vectors belonging to the block vector list, the top X block vectors in ascending order of the cost can be used in one or more block vector sets.

[0032] In the image decoding method and device according to the present disclosure, among the plurality of block vectors belonging to the block vector list, the lower X block vectors in ascending order of the cost can be used in one or more block vector sets.

[0033] In the image decoding method and device according to the present disclosure, among the plurality of block vectors belonging to the block vector list, the upper X block vectors in ascending order of coordinate values ​​can be used in one or more block vector sets. Here, the coordinate value can be either an x-coordinate value or a y-coordinate value.

[0034] In the image decoding method and device according to the present disclosure, among the plurality of block vectors belonging to the block vector list, the lower X block vectors in ascending order of coordinate values ​​can be used in one or more block vector sets. Here, the coordinate value can be either an x-coordinate value or a y-coordinate value.

[0035] In the image decoding method and device according to the present disclosure, among the plurality of block vectors belonging to the block vector list, the top X block vectors in ascending order of absolute coordinate values ​​can be used in one or more block vector sets. Here, the absolute coordinate value can be either the absolute value of the x-coordinate or the absolute value of the y-coordinate.

[0036] In the image decoding method and device according to the present disclosure, among the plurality of block vectors belonging to the block vector list, the lower X block vectors in ascending order of absolute coordinate values ​​can be used in one or more block vector sets. Here, the absolute coordinate value can be either the absolute value of the x-coordinate or the absolute value of the y-coordinate.

[0037] In the image decoding method and device according to the present disclosure, the current block vector set can be filtered based on at least one of a threshold value for the current block vector set or a characteristic of a previous block vector set.

[0038] In the image decoding method and device according to the present disclosure, the top X block vectors in ascending order of cost among the block vectors belonging to the previous block vector set can be reused in the current block vector set.

[0039] In the image decoding method and device according to the present disclosure, the threshold for the current block vector set can be set based on the smallest cost among the costs of the block vectors belonging to the current block vector set.

[0040] In the image decoding method and device according to the present disclosure, among the block vectors belonging to the current block vector set, a block vector having a cost greater than or equal to the threshold value can be excluded from the current block vector set.

[0041] In the image decoding method and device according to the present disclosure, the maximum number of block vectors that can be included in the current block vector set can be determined based on the number of block vectors belonging to the previous block vector set.

[0042] The video encoding method and device according to the present disclosure can generate a block vector list for a current block and generate a prediction block of the current block based on the block vector list.

[0043] A computer-readable recording medium according to the present disclosure can store a bitstream encoded by the image encoding method.

[0044] Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings attached to this specification so that those skilled in the art can easily implement the present invention. However, the present invention may be implemented in various different forms and is not limited to the embodiments described herein. In addition, in the drawings, parts irrelevant to the description have been omitted to clearly explain the present invention, and similar parts have been designated with similar reference numerals throughout the specification.

[0045] Throughout this specification, when a part is said to be 'connected' to another part, this includes not only cases where they are directly connected, but also cases where they are electrically connected with another element in between.

[0046] Additionally, whenever a part throughout this specification is said to "include" a component, this does not mean that other components are excluded, but rather that other components may be included, unless specifically stated otherwise.

[0047] Additionally, while terms such as "first," "second," etc. 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.

[0048] Additionally, in the embodiments of the devices and methods described herein, some components of the devices or some steps of the methods may be omitted. Furthermore, the order of some components of the devices or some steps of the methods may be changed. Furthermore, other components or other steps may be inserted into some components of the devices or some steps of the methods.

[0049] Additionally, some components or some steps of the first embodiment of the present invention may be added to the second embodiment of the present invention, or some components or some steps of the second embodiment may be replaced.

[0050] In addition, the components shown in the embodiments of the present invention are independently depicted to represent different characteristic functions, and this does not mean that each component is composed of separate hardware or a single software component. That is, each component is described by listing each component for convenience of explanation, and at least two components among each component may be combined to form a single component, or a single component may be divided into multiple components to perform a function. Such integrated and separate embodiments of each component are also included in the scope of the present invention as long as they do not deviate from the essence of the present invention.

[0051] In this specification, a block can be variously expressed as a unit, an area, a unit, a partition, etc., and a sample can be variously expressed as a pixel, a pel, a pixel, etc.

[0052] Hereinafter, embodiments of the present invention will be described in more detail with reference to the attached drawings. In describing the present invention, duplicate descriptions of identical components will be omitted.

[0053] FIG. 1 is a block diagram showing an image encoding device according to the present disclosure.

[0054] 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).

[0055] The picture segmentation unit (110) can segment 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). Hereinafter, in the embodiments of the present disclosure, the coding unit may be used to mean a unit that performs encoding or a unit that performs decoding.

[0056] 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. When a prediction unit that performs intra prediction based on a coding unit is generated and is not the minimum coding unit, intra prediction can be performed without being divided into a plurality of NxN prediction units.

[0057] The prediction unit (120, 125) may include an inter prediction unit (120) that performs inter prediction or inter prediction, and an intra prediction unit (125) that performs intra prediction or intra prediction. It may determine whether to use inter prediction or intra prediction for a prediction unit, and determine specific information (e.g., intra prediction mode, motion vector, reference picture, etc.) according to each prediction method. A residual value (residual block) between the generated prediction block and the original block may be input to the transformation unit (130). In addition, prediction mode information, motion vector information, etc. used for prediction may be encoded together with the residual value by the entropy encoding unit (165) and transmitted to the decoder.

[0058] The inter 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 prediction unit (120) may include a reference picture interpolation unit, a motion prediction unit, and a motion compensation unit.

[0059] 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.

[0060] The motion prediction unit can perform motion prediction based on a reference picture interpolated by the reference picture interpolation unit. Various methods such as FBMA (Full search-based Block Matching Algorithm), TSS (Three Step Search), and NTS (New Three-Step Search Algorithm) can be used to derive a motion vector. The motion vector can have a motion vector value in units of 1 / 2 or 1 / 4 pixels based on the interpolated pixel. The motion prediction unit can predict the current prediction unit by using different motion prediction methods. Various methods such as Skip Mode, Merge Mode, AMVP Mode, Intra Block Copy Mode, and Affine Mode can be used as motion prediction methods.

[0061] The intra prediction unit (125) can generate a prediction unit based on reference pixel information surrounding the current block, which is pixel information within the current picture. If the surrounding block of the current prediction unit is a block on which inter prediction has been performed and the reference pixel is a pixel on which inter prediction has been performed, the reference pixel included in the block on which inter prediction has been performed can be replaced and used with reference pixel information of the surrounding block on which intra prediction has been performed. That is, if the reference pixel is not available, the unavailable reference pixel information can be replaced and used with at least one reference pixel among the available reference pixels.

[0062] 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).

[0063] 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 the intra prediction mode information of the prediction unit used to generate the residual block.

[0064] The quantization unit (135) can quantize values ​​converted to the frequency domain by the transformation unit (130). The quantization coefficients can 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).

[0065] The rearrangement unit (160) can perform rearrangement of coefficient values ​​for quantized residual values.

[0066] The rearrangement unit (160) can change a two-dimensional block-shaped coefficient into a one-dimensional vector form through a coefficient scanning method. For example, the rearrangement unit (160) can change the two-dimensional block-shaped coefficient into a one-dimensional vector form by scanning from the DC coefficient to the coefficient of the high-frequency region using a zig-zag scan method. Depending on the size of the transformation unit and the intra prediction mode, a vertical scan that scans the two-dimensional block-shaped coefficient in the column direction or a horizontal scan that scans the two-dimensional block-shaped coefficient in the row direction may be used instead of the zig-zag scan. That is, depending on the size of the transformation unit and the intra prediction mode, it is possible to determine which scan method among the zig-zag scan, the vertical scan, and the horizontal scan is to be used.

[0067] 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). In this regard, the entropy encoding unit (165) can encode residual value coefficient information of the encoding unit from the rearrangement unit (160) and the prediction units (120, 125). In addition, according to the present disclosure, it is possible to signal and transmit information indicating that motion information is derived and used on the decoder side and information on a technique used to derive motion information.

[0068] 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 prediction unit included in the prediction unit (120, 125) to generate a reconstructed block.

[0069] The filter unit (150) may include at least one of a deblocking filter, an offset correction unit, and an ALF (Adaptive Loop Filter). The deblocking filter may remove block distortion caused by boundaries between blocks in a restored picture. The offset correction unit may correct the offset from the original image on a pixel-by-pixel basis for the image on which deblocking has been performed. In order to perform offset correction for a specific picture, a method may be used in which the pixels included in the image are divided into a certain number of regions, the regions to be offset are determined, and the offset is applied to the regions, or the offset is applied by considering edge information of each pixel. The ALF (Adaptive Loop Filtering) may be performed based on a value obtained by comparing the filtered restored image with the original image. After dividing the pixels included in the image into a predetermined group, one filter to be applied to the group is determined, and filtering may be performed differentially for each group.

[0070] The memory (155) can store a restored block or picture produced through the filter unit (150), and the stored restored block or picture can be provided to the prediction unit (120, 125) when performing inter prediction.

[0071] FIG. 2 is a block diagram showing an image decoding device according to the present disclosure.

[0072] 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).

[0073] 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.

[0074] The entropy decoding unit (210) can perform entropy decoding in a procedure opposite to that of the entropy encoding unit of the video encoder. 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 encoder.

[0075] The entropy decoding unit (210) can decode information related to intra prediction and inter prediction performed in the encoder.

[0076] The reordering unit (215) can perform reordering based on the method by 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.

[0077] The inverse quantization unit (220) can perform inverse quantization based on the quantization parameters provided by the encoder and the coefficient values ​​of the rearranged block.

[0078] The inverse transform unit (225) can perform inverse transform, i.e., inverse DCT, inverse DST, and inverse KLT, on the transforms performed by the transform unit, i.e., DCT, DST, and KLT, on the quantization result performed by the image encoder. The inverse transform can be performed based on the transmission unit determined by the image encoder. In the inverse transform unit (225) of the image decoder, a transform technique (e.g., DCT, DST, KLT) can be selectively performed according to a plurality of pieces of information, such as a prediction method, the size of the current block, and the prediction direction.

[0079] The prediction unit (230, 235) can generate a prediction block based on the prediction block generation related information provided by the entropy decoding unit (210) and the previously decoded block or picture information provided by the memory (245).

[0080] As described above, when performing intra prediction or intra prediction in the same manner as the operation in the image encoder, if the size of the prediction unit and the size of the transformation unit are the same, intra 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 prediction, if the size of the prediction unit and the size of the transformation unit are different, intra prediction can be performed using reference pixels based on the transformation unit. In addition, intra prediction using NxN division only for the minimum coding unit can be used.

[0081] The prediction unit (230, 235) may include a prediction unit determination unit, an inter prediction unit, and an intra 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 prediction method, and motion prediction-related information of an inter prediction method, and may distinguish a prediction unit from a current encoding unit and determine whether the prediction unit performs inter prediction or intra prediction. On the other hand, if the encoder (100) does not transmit motion prediction-related information for the inter prediction, but instead transmits information indicating that motion information is to be derived and used on the decoder side and information on a technique used to derive motion information, the prediction unit determination unit determines whether the inter prediction unit (230) performs prediction based on the information transmitted from the encoder (100).

[0082] The inter prediction unit (230) can perform inter prediction on the current prediction unit based on information included in at least one picture among the previous picture or the subsequent picture of the current picture including the current prediction unit, using information required for inter prediction of the current prediction unit provided by the image encoder. In order to perform inter prediction, it can be determined based on the encoding unit whether the motion prediction method of the prediction unit included in the corresponding encoding unit is one of Skip Mode, Merge Mode, AMVP Mode, Intra Block Copy Mode, and Affine Mode.

[0083] The intra 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 prediction, intra prediction can be performed based on intra prediction mode information of the prediction unit provided by the image encoder.

[0084] The intra prediction unit (235) may include an Adaptive Intra Smoothing (AIS) filter, a reference pixel interpolation unit, and a DC filter. The AIS filter is a unit that performs filtering on the reference pixels of the current block and can determine whether to apply the filter based on the prediction mode of the current prediction unit and apply it. 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 image encoder. If the prediction mode of the current block is a mode that does not perform AIS filtering, the AIS filter may not be applied.

[0085] The reference pixel interpolation unit can interpolate the reference pixel to generate a reference pixel of a pixel unit less than an integer value when the prediction mode of the prediction unit is a prediction unit that performs intra prediction based on the pixel value interpolated from the reference pixel. When 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.

[0086] 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.

[0087] Information about whether a deblocking filter has been applied to a corresponding block or picture can be received from a video encoding device, and if a deblocking filter has been applied, information about whether a strong or weak filter has been applied. The deblocking filter of the video decoder can receive information related to the deblocking filter provided by the video encoder, and the video decoder can perform deblocking filtering on the corresponding block.

[0088] 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 information on the offset value. ALF can be applied to the encoding unit based on information on whether ALF is applied and ALF coefficient information provided from the encoder. This ALF information can be provided by being included in a specific parameter set.

[0089] 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.

[0090] In video coding, interprediction removes temporal redundancy by patching a prediction block similar to the current block from a previously encoded reference picture. In contrast, intraprediction generates a prediction block based on reference samples. Meanwhile, block vector-based prediction assumes that regions similar to the current block exist within the same picture, and thus uses a technique to patch regions similar to the current block from previously encoded or encoded regions within the same picture.

[0091] Block vector-based prediction can be defined as a method of generating an implicit block vector list on the decoder side to reduce the amount of bits used for signaling block vectors, and generating a prediction block based on an index that specifies a block vector in the block vector list. Block vectors used before the current block can be stored and managed in a table, and the table can be utilized when block vector-based prediction is used in a block to be encoded / decoded thereafter. Block vector-based prediction can be used by Intra Block Copy (IBC) or Intra Template Matching Prediction (TMP). Hereinafter, a method of generating a prediction block based on block vectors will be described in detail with reference to FIG. 3.

[0092] Referring to FIG. 3, a block vector list for the current block can be generated (S300).

[0093] A block vector list can be generated based on the block vectors of blocks previously encoded / decoded before the current block. The blocks previously encoded / decoded before the current block may be neighboring blocks adjacent to the current block. Here, the neighboring blocks may include at least one of an upper neighboring block, a left neighboring block, an upper-left neighboring block, a lower-left neighboring block, or an upper-right neighboring block. Alternatively, the neighboring blocks may further include blocks that are not adjacent to the current block.

[0094] A block vector list can be generated by performing template matching based on a template of a current block within a predetermined search range. The predetermined search range may belong to a region that has been previously restored before the current block within a picture to which the current block belongs. The template of the current block is a surrounding region adjacent to the current block, wherein the surrounding region may include at least one of an upper surrounding region, a left surrounding region, or an upper-left surrounding region. The template of the current block may be composed of K sample lines, and K may be an integer of 1, 2, 3, 4, or more. The block vector list may include a plurality of block vectors. For example, the search range may be calculated as in the following mathematical expression 1.

[0095] [Mathematical Formula 1]

[0096] SearchRange_w = max(64, a*BlockW)

[0097] SearchRange_h = max(64, a*BlockH)

[0098] SearchRegion_w = SearchRange_w*2 + BlockW

[0099] SearchRegion_h = SearchRange_h*2 + BlockH

[0100] At least one of the upper peripheral region, the left peripheral region, or the upper left peripheral region may have a different number of samples and / or a different number of sample lines from the other. For example, the upper peripheral region may be composed of two sample lines, the left peripheral region may be composed of four sample lines, and the upper left peripheral region may be composed of zero samples. A sample line in the upper peripheral region may mean a horizontal sample line, and a sample line in the left peripheral region may mean a vertical sample line. Hereinafter, the same meaning may be interpreted.

[0101] Templates can be adaptively determined based on the size of the current block. For example, if the width and height of the current block are 4 and 8, respectively, the left peripheral area can be composed of two sample lines, and the top peripheral area can be composed of four sample lines.

[0102] A template may also be constructed based on the distance between a sample line within a surrounding area and the current block. For example, if the distance between a sample line within a surrounding area and the current block is within k samples, the entire sample line may be used as a template. Conversely, if the distance between a sample line within a surrounding area and the current block exceeds k samples, a sample line downsampled by a predetermined ratio (e.g., 1 / 2) may be used as a template.

[0103] The entire search range can be divided into predetermined block units (e.g., 1x1, 2x2, 3x3, or 4x4 units), and a block vector list can be constructed by calculating the cost between the template corresponding to the central sample position of each block unit and the template of the current block. The cost can be calculated based on the Sum of Absolute Difference (SAD), the Sum of Absolute Transformed Difference (SATD), or the MSE. Alternatively, the cost can be calculated based on a combination of at least two of the above-mentioned SAD, SATD, or MSE. The following cost can also be interpreted in the same meaning.

[0104] For example, a search can be performed in 3x3 units to construct a block vector list including 30 block vectors. The 30 block vectors in the block vector list can be rearranged in ascending order of cost. For all or some of the 30 block vectors, inter-template costs can be calculated for 8 surrounding sample locations, and a block vector list can be constructed based on 19 block vectors with the smallest cost. The 8 surrounding sample locations can refer to 8 sample locations adjacent to the central sample location within the 3x3 unit.

[0105] The aforementioned search range can be expanded or modified. For convenience of explanation, the aforementioned search range will be referred to as the first search range. To distinguish it from the first search range, the expanded or modified search range will be referred to as the second search range.

[0106] The second search range according to the present disclosure may be determined based on a predetermined offset vector. The offset vector may specify a position shifted by a predetermined offset from the position of the current block. An area extended by N samples from the area specified by the offset vector may be determined as the search range. Here, N may be an integer greater than or equal to 1.

[0107] A block vector derived based on an Intra Block Copy (IBC) may be used as the offset vector. Alternatively, a block vector derived by performing template matching based on a template of a current block within a predetermined search range may be used as the offset vector. Alternatively, a block vector (or motion vector) of a neighboring block adjacent to the current block may be used as the offset vector. Here, the neighboring block may include at least one of a left neighboring block, an upper neighboring block, a lower left neighboring block, an upper right neighboring block, or an upper left neighboring block. For example, only the block vector of the left neighboring block may be used as the offset vector. Alternatively, the offset vector may be derived based on the block vectors of a plurality of neighboring blocks. However, the present invention is not limited thereto. A block that is not adjacent to the current block but has been encoded / decoded before the current block may also be used.

[0108] Alternatively, the second search range may be determined based on a combination of at least two of the first search range, the block vector (or motion vector) of the current block, or the block vector (or motion vector) of the surrounding block.

[0109] Below, we will look at a method for constructing a block vector list based on sparse search.

[0110] The entire search range can be divided into NxM block units. The center position (or the position of a sample including the center position) within each NxM block can be a search position. The cost of the corresponding block vector can be calculated for each search position. Here, the cost can be defined as the difference (e.g., SAD, SATD) between the template corresponding to the search position and the template of the current block. K block vectors can be selected in ascending order of the calculated costs, and a block vector list can be constructed based on the selected block vectors. Here, N, M, and K can be integers greater than or equal to 1.

[0111] Alternatively, the entire search range can be divided into NxM block units. The central position (or the position of a sample including the central position) within each NxM block can be a search position. The first cost of the corresponding block vector can be calculated for each search position. Here, the first cost can be defined as the difference (e.g., SAD) between the template corresponding to the search position and the template of the current block. K block vectors can be selected in ascending order of the calculated first costs, and a block vector list can be constructed based on the selected block vectors. A second cost can be calculated for each block vector in the block vector list. Here, the second cost can be the difference (e.g., SATD) between the template corresponding to the search position of the block vector in the block vector list and the template of the current block. The block vectors in the pre-constructed block vector list can be rearranged based on the calculated second costs. Here, N, M, and K can be integers greater than or equal to 1.

[0112] In sparse search, template-based costs can be calculated for surrounding sample locations around a search location (i.e., the central location of an NxM block), and a list of adjusted block vectors can be constructed based on the calculated costs. If the cost at the central location is greater than the cost at the surrounding sample locations, the block vector corresponding to the central location can be replaced with the block vector corresponding to the corresponding peripheral sample location.

[0113] In constructing a corrected block vector list, the cost for surrounding sample locations is calculated and the direction with the smallest cost is identified, thereby allowing the process of constructing a block vector list to be terminated early.

[0114] For example, the cost of at least one surrounding sample in the upper, lower, left, or right directions relative to the central sample can be calculated to identify the direction with the lowest cost. Costs can be calculated only for surrounding samples in that direction, and the search can be terminated early for all other surrounding samples. The cost can be calculated based on the SAD or SATD.

[0115] For example, by calculating the cost for at least one surrounding sample in the up, down, left, or right directions relative to the central sample position, the direction with the relatively lower cost can be identified. If the directions are opposite, the cost can be calculated only for the surrounding sample in the direction with the lower cost, and the search can be terminated early for the other surrounding samples. In this case, the cost can be calculated based on the SAD or SATD.

[0116] For example, by calculating the cost for at least one surrounding sample in the upper left, upper right, lower left, or lower right directions relative to the central sample position, the direction with the smallest (or relatively smallest) cost can be identified. Costs can be calculated only for surrounding samples located in that direction, and the search can be terminated early for other surrounding samples. In this case, the cost can be calculated based on SAD or SATD.

[0117] For example, by calculating the cost of surrounding samples located in any direction relative to the central sample, the direction with the smallest (or relatively smallest) cost can be identified. Costs can be calculated only for surrounding samples located in that direction, and the search can be terminated early for all other surrounding samples. In this case, the cost can be calculated based on SAD or SATD.

[0118] When constructing a list of compensated block vectors, cost calculation for surrounding samples can be terminated based on a predetermined threshold value.

[0119] For example, costs can be calculated for specific surrounding samples based on the block vector corresponding to the first index in the block vector list. The smallest cost among the calculated costs multiplied by N can be set as the threshold. Here, N can be a real number greater than 0.

[0120] For example, costs can be calculated for specific surrounding samples based on the block vector corresponding to the first index in the block vector list. The threshold can be set to the largest cost among the calculated costs multiplied by N. Here, N can be a real number greater than 0.

[0121] For example, a cost can be calculated for a specific surrounding sample based on the block vector corresponding to the Mth index in the block vector list. The largest cost among the calculated costs multiplied by N can be set as the threshold. Here, M can be an integer greater than or equal to 1, and N can be a real number greater than 0.

[0122] For example, a cost can be calculated for at least one surrounding sample in the upper, lower, left, or right directions relative to the central sample location. If the calculated cost exceeds the aforementioned threshold, the search for other surrounding samples can be terminated early.

[0123] For example, a cost can be calculated for a central sample, and if the calculated cost is greater than the threshold, the search for surrounding samples can be terminated early.

[0124] It goes without saying that the combination of the above-described embodiments allows for early termination of the construction of the corrected block vector list. That is, the construction of the corrected block vector list can be early terminated based on the direction and threshold value with the lowest cost.

[0125] Referring to FIG. 3, a prediction block of the current block can be generated based on a block vector list (S310).

[0126] The encoder can determine an optimal mode by applying predefined Intra TMP modes to the current block based on the block vector list of the current block. The encoder can signal information indicating the optimal mode to the decoder. The predefined Intra TMP modes can include at least one of a sub-pel mode, a fusion mode, or a linear filter mode. The decoder can determine the Intra TMP mode of the current block based on the signaled information, and apply the determined Intra TMP mode to the current block based on the block vector list of the current block to generate a prediction block.

[0127] Alternatively, the encoder and decoder may only have one Intra TMP mode defined, where the Intra TMP mode may be a sub-pixel mode, a combined mode, or a linear filter mode.

[0128] Subpixel mode

[0129] Any one of a plurality of block vectors belonging to a block vector list can be selected. The encoder can signal an index (tmpIdx) indicating the selected block vector to the decoder. The decoder can select any one of a plurality of block vectors belonging to the block vector list based on the signaled index (tmpIdx). A prediction block of the current block can be generated based on the selected block vector.

[0130] The selected block vector may be a vector having the precision of an integer pixel. The selected block vector may be corrected based on information for sub-pixel prediction. The corrected block vector may be a vector having the precision of a sub-pixel. The information for sub-pixel prediction may include at least one of first information (tmpSubPelPrecision) indicating the precision of the block vector or second information (tmpSubPelDirection) indicating the direction of the block vector. The first information may have a value between 0 and 3, and the values ​​between 0 and 3 may indicate sub-pixel precisions of 1-pel, 1 / 2-pel, 1 / 4-pel, and 3 / 4-pel, respectively. The second information may have a value between 0 and 7, and the values ​​between 0 and 7 may indicate the top, bottom, left, right, top-left, top-right, bottom-left, and bottom-right directions, respectively, based on the position of the integer pixel.

[0131] To reduce the signaling overhead of information for subpixel prediction, the information for subpixel prediction may be implicitly derived in the decoder.

[0132] To construct a block vector list (or block vector set), the cost between the template of the current block and the template of the reference block within the search range can be calculated. At this time, the cost for all or some integer pixels existing in the search range can be stored. The cost of a subpixel can be predicted based on the cost of the integer pixels.

[0133] For example, the Error Surface technique can be used to predict the cost of a subpixel. The transmission of syntax for subpixel prediction can be replaced by the Error Surface technique. According to the Error Surface technique, if among three integer pixels (i.e., the current integer pixel, the left integer pixel, and the right integer pixel), the current integer pixel has the smallest cost and the left integer pixel has the largest cost, the location of the subpixel expected to have the smallest cost can be assumed to be located between the current integer pixel and the right integer pixel.

[0134] A block vector of a sub-pixel unit can be predicted based on the cost of neighboring integer pixels adjacent to a current integer pixel. Here, the current integer pixel may be an integer pixel indicated by the block vector (or, an upper left sample in a reference block specified by the block vector). The neighboring integer pixels may include at least one of a left integer pixel, an upper integer pixel, a right integer pixel, or a lower integer pixel. The sub-pixel unit may mean a 1 / 16-pel unit. Alternatively, the sub-pixel unit may mean a 1 / 2-pel, a 1 / 4-pel, or a 3 / 4-pel unit.

[0135] For example, a block vector in sub-pixel units can be predicted based on the cost of the current integer pixel and the costs of the surrounding integer pixels. However, if the cost of the current integer pixel is N times or more smaller than the costs of the surrounding integer pixels, the block vector in sub-pixel units may not be predicted.

[0136] If the cost of the current integer pixel is M times or more greater than the cost of the surrounding integer pixels, the precision of the block vector in sub-pixel units can be adjusted. Based on the difference between the cost of the current integer pixel and the cost of the surrounding integer pixels, the precision of the predicted block vector in sub-pixel units can be adjusted.

[0137] The cost of a new integer pixel can be calculated based on the combination of the cost of the current integer pixel and the cost of the surrounding integer pixels, and a block vector in sub-pixel units can be predicted based on this.

[0138] It is also possible to predict a sub-pixel unit block vector based on a combination of at least two of the above-described sub-pixel unit block vector prediction methods.

[0139] Since the decoder can store the cost of block vectors corresponding to all or some integer pixels existing within the search range, when predicting block vectors in sub-pixel units according to the proposed method, the overhead of the syntax for sub-pixel prediction can be reduced.

[0140] Meanwhile, according to the present disclosure, a block vector in a sub-pixel unit can be additionally searched. That is, by additionally searching surrounding sub-pixels of a previously searched sub-pixel, a block vector in a sub-pixel unit can be predicted, and a predicted block can be generated based on this.

[0141] For example, search can be performed for subpixel locations other than the existing 8-direction locations. That is, search can be performed for subpixel locations other than the subpixel locations in the top, left, bottom, right, top left, top right, bottom left, and bottom right directions.

[0142] If the block vector of the previously searched subpixel unit has a subpixel precision of 3 / 4-pel and indicates a subpixel position in the upper left direction, a subpixel position located at least to the left or upper side of the subpixel position can be additionally searched.

[0143] If the block vector of the previously searched subpixel unit has a subpixel precision of 3 / 4-pel and indicates a subpixel location in the upper right direction, a subpixel location located at least to the right or upper side of the subpixel location can be additionally searched.

[0144] If the block vector of the previously searched subpixel unit has a subpixel precision of 3 / 4-pel and indicates a subpixel position in the lower left direction, a subpixel position located at least to the left or lower of the subpixel position can be additionally searched.

[0145] If the block vector of the previously searched subpixel unit has a subpixel precision of 3 / 4-pel and indicates a subpixel location in the lower right direction, a subpixel location located at least to the right or lower of the subpixel location can be additionally searched.

[0146] If the block vector of the previously searched subpixel unit has a subpixel precision of 1 / 2-pel and indicates a subpixel position in the upper left, upper right, lower left, or lower right direction, a subpixel position located at least one of the upper, lower, left, or right of the corresponding subpixel position can be additionally searched.

[0147] If the block vector of the previously searched subpixel unit indicates a subpixel position in the upper left or lower right direction with a subpixel precision of 1 / 2-pel, a subpixel position located at least one of the upper, lower, left, right, upper right, or lower left of the corresponding subpixel position can be additionally searched.

[0148] If the block vector of the previously searched subpixel unit indicates a subpixel position in the upper right or lower left direction with a subpixel precision of 1 / 2-pel, a subpixel position located at least one of the upper, lower, left, right, upper left, or lower right of the corresponding subpixel position can be additionally searched.

[0149] If the block vector of the previously searched subpixel unit indicates a subpixel position in the upper left direction with a subpixel precision of 1 / 2-pel, a subpixel position located at least to the right or bottom of the subpixel position can be additionally searched.

[0150] If the block vector of the previously searched subpixel unit indicates a subpixel location in the upper right direction with a subpixel precision of 1 / 2-pel, a subpixel location located at least to the left or bottom of the subpixel location can be additionally searched.

[0151] If the block vector of the previously searched subpixel unit indicates a subpixel position in the lower left direction with a subpixel precision of 1 / 2-pel, a subpixel position located at least one above or to the right of the subpixel position can be additionally searched.

[0152] If the block vector of the previously searched subpixel unit has a subpixel precision of 1 / 2-pel and indicates a subpixel location in the lower right direction, a subpixel location located at least one of the top or left of the subpixel location can be additionally searched.

[0153] If the block vector of the previously searched subpixel unit has a subpixel precision of 1 / 2-pel and indicates a subpixel position in the upper or lower direction, a subpixel position located at least to the left or right of the subpixel position can be additionally searched.

[0154] If the block vector of the previously searched subpixel unit indicates a subpixel position in the upper direction with a subpixel precision of 1 / 2-pel, a subpixel position located at least one of the left, right, upper left, or upper right of the subpixel position can be additionally searched.

[0155] If the block vector of the previously searched subpixel unit indicates a subpixel position in the downward direction with a subpixel precision of 1 / 2-pel, a subpixel position located at least one of the left, right, lower left, or lower right of the subpixel position can be additionally searched.

[0156] If the block vector of the previously searched subpixel unit has a subpixel precision of 1 / 2-pel and indicates a subpixel position in the left or right direction, a subpixel position located at least one of the top or bottom of the subpixel position can be additionally searched.

[0157] If the block vector of the previously searched subpixel unit has a subpixel precision of 1 / 2-pel and indicates a subpixel position in the left direction, a subpixel position located at least one of the upper left, upper left, lower left, or lower left of the corresponding subpixel position can be additionally searched.

[0158] If the block vector of the previously searched subpixel unit has a subpixel precision of 1 / 2-pel and indicates a subpixel position in the right direction, a subpixel position located at least one of the upper right, upper right, lower right, or lower right of the subpixel position can be additionally searched.

[0159] If the previously explored block vector of sub-pixel unit has a sub-pixel precision of 1 / 4-pel, it can be additionally explored based on the same method as the case with a sub-pixel precision of 1 / 2-pel.

[0160] Information about the subpixel locations to be searched can be implicitly derived in the encoder / decoder. For example, template-based costs can be calculated for additional subpixel locations, and the subpixel locations corresponding to the top N costs in ascending order of the calculated costs can be determined as the search target locations. In this case, the costs can be calculated based on SAD, SATD, or other cost calculation methods. Alternatively, information about the subpixel locations to be searched can be encoded in the encoder and signaled to the decoder. The encoder can select the final location based on the RD cost and can explicitly signal information indicating the selected location.

[0161] The aforementioned subpixel mode can be replaced by a single mode. The single mode can be distinguished from the combined mode described below in that it generates a prediction block based on a single block vector selected from a list of block vectors. Alternatively, the subpixel mode and the single mode can be defined separately.

[0162] Combined mode

[0163] The combined mode may be a mode that generates prediction blocks based on at least two block vectors selected from a block vector list.

[0164] A block vector list can be divided into multiple block vector sets. Each block vector set can be composed of one or more block vectors. Each block vector set can be composed of up to five block vectors. For example, if a block vector list is composed of 15 block vectors, the block vector list can be divided into three block vector sets, and each block vector set can be composed of five block vectors. In this case, the indices 0, 1, and 2 can be assigned to the three block vector sets, respectively, and the block vectors belonging to the block vector sets can have indices 0 to 4, 5 to 9, and 10 to 14, respectively.

[0165] If the cost difference between block vectors within each block vector set is large, the block vector may be excluded from the block vector set. For example, among the block vectors belonging to the block vector set, block vector(s) with a cost greater than a predetermined threshold may be excluded from the block vector set. The threshold may be set differently for each block vector set. Here, the threshold may be set as in the following mathematical expression 2.

[0166] [Equation 2]

[0167] Threshold set0 = SAD Idx0 << 1

[0168] Threshold set1 = SAD Idx5 *1.2

[0169] Threshold set2 = SAD Idx10 *1.2

[0170] In Equation 2, Threshold set0 can mean a threshold applied to a set of block vectors with an index of 0. SAD Idx0 can mean the cost of a block vector with an index of 0 within a set of block vectors with an index of 0. Threshold set1 can mean a threshold applied to a set of block vectors with an index of 1. SAD Idx5 can mean the cost of a block vector with an index of 5 within a set of block vectors with an index of 1. Threshold set2 can mean a threshold applied to a set of block vectors with an index of 2. SAD Idx10 can mean the cost of a block vector with an index of 10 within a set of block vectors with an index of 2.

[0171] Example 1

[0172] One or more block vectors can be filtered based on the cost between block vectors belonging to the block vector set. Here, filtering may mean a process of removing one or more block vectors from the block vector set.

[0173] Since the indices assigned to block vectors belonging to a block vector set are fixed, the filtered block vector may not be included in other block vector set(s).

[0174] Since the block vectors in the block vector list are sorted in ascending order of cost, the filtered block vectors from the block vector set with index N can also be added to the block vector set with index (N+1). This allows for generating predicted blocks with higher accuracy.

[0175] All or some of the block vectors in the block vector list can be grouped into multiple block vector sets. Here, some of the block vectors may be the top T (e.g., 15) block vectors with the smallest cost among all the block vectors in the block vector list.

[0176] During the process of constructing a block vector set, one or more block vectors may be excluded from the block vector set based on a predetermined threshold, as discussed above. The block vector(s) excluded based on the threshold may be used in another block vector set. Hereinafter, a method for constructing a block vector set will be described with reference to FIG. 4.

[0177] The meanings of the variables, constants, and functions in Figure 4 are as follows.

[0178] 1) numBVSets: Block vector set index that specifies one of multiple block vector sets.

[0179] 2) BVIndex: A block vector index that specifies one of multiple block vectors belonging to a block vector set.

[0180] 3) maxBVCand: maximum value of block vector index (or maximum number of block vectors included in the block vector list)

[0181] 4) numFusionBV: The number of block vectors that make up the current block vector set.

[0182] 5) SAD(): SAD of the input block vector

[0183] 6) BVCand[]: Block vector array

[0184] 7) scale[]: An array of coefficients for calculating thresholds based on the block vector set index.

[0185] 8) theta: threshold corresponding to the current block vector set index

[0186] 9) maxFusionBV: The maximum number of block vectors that can be included in the block vector set.

[0187] 10) fusionBV[]: Block vector array (2D array) that constitutes each block vector set

[0188] fusionBV[] can be constructed according to the algorithm in Fig. 4. The signaling method of the combined mode can be adaptively changed based on the variable numBVSets.

[0189] The above threshold (theta) can be derived based on the cost obtained in the process of constructing the block vector list. For example, the threshold can be used as a value obtained by multiplying or adding a real number of one or more to the smallest cost among the block vectors constituting the current block vector set. Alternatively, the threshold can be derived through a weighted sum of one or more smallest costs in the block vector list. Alternatively, the threshold can be adjusted to a larger or smaller value based on the block vector set index and / or the number of block vectors constituting the block vector set. Alternatively, the threshold can be derived based on the spatial correlation and / or cost between the template indicated by the block vector to be compared with the threshold and the template of the current block. The threshold for the current block vector set can also be derived through a combination of at least two of the above-described threshold derivation methods.

[0190] One or more block vectors excluded from the above-described filtering process can be used when constructing another block vector set. A new block vector set can be constructed based only on one or more block vectors that are not excluded from the above-described filtering process. Alternatively, a new block vector set can be constructed based on one or more block vectors excluded from the above-described filtering process. Alternatively, a new block vector set can be constructed based on the block vectors excluded from the above-described filtering process and the block vectors that are not excluded from the above-described filtering process. Alternatively, a new block vector set can be constructed based only on one or more block vectors excluded from the above-described filtering-based block vector set construction methods. A block vector set can also be constructed through a combination of at least two of the above-described filtering-based block vector set construction methods.

[0191] The accuracy of the combined mode can be improved by using block vectors excluded from the current block set in the next block vector set. Furthermore, block vectors excluded through the filtering process can be utilized to construct a larger number of block vector sets.

[0192] A block vector set for the current block can be constructed based on the prediction mode of a reference block previously encoded / decoded before the current block. Here, the reference block may belong to the same picture as the current block or may be spatially adjacent to the current block.

[0193] For example, if a reference block is encoded / decoded in a combined mode of Intra TMP mode, at least one of the block vector sets of the reference block may be added to the block vector set of the current block. Alternatively, at least one of the block vector sets of the current block may be replaced with the block vector set of the reference block.

[0194] For example, if the reference block is decoded / decoded in the sub-pixel mode or linear filter mode of the Intra TMP mode, at least one of the block vector sets of the reference block may be added to the block vector set of the current block. Alternatively, at least one of the block vector sets of the current block may be replaced with the block vector set of the reference block.

[0195] For example, if the reference block is encoded / decoded in Intra Block Copy (IBC) mode, at least one of the block vector sets of the reference block may be added to the block vector set of the current block. Alternatively, at least one of the block vector sets of the current block may be replaced with the block vector set of the reference block.

[0196] For example, if a reference block has one or more motion vectors (or block vectors), the motion vectors may be added to the block vector set of the current block. Alternatively, at least one block vector belonging to the block vector set of the current block may be replaced with the motion vector of the reference block. However, the motion vector of the reference block may be scaled by considering the temporal distance between the current picture and the reference picture of the reference block. In this case, the scaled motion vector may be added to the block vector set of the current block.

[0197] For example, information (coding parameters) regarding the intra or inter prediction mode of a reference block may be added to the block vector set of the current block. Alternatively, at least one block vector belonging to the block vector set of the current block may be replaced with the above information.

[0198] A block vector set of the current block can be constructed through a combination of at least two of the above-described embodiments.

[0199] Tables 1 and 2 illustrate how to signal block vector set indices using the Truncated Rice (TR) binarization method. The signaling method may vary depending on the number of block vector sets available to the current block. Any binarization method that can distinguish the maximum bit length using a prefix, suffix, etc. may be used. Table 1 illustrates a case where the number of block vector sets is three, and Table 2 illustrates a case where the number of block vector sets is four.

[0200] Block vector set index binarization 00110211

[0201] Block vector set index binarization 0011021103111

[0202] For example, the value of numBVSets can be adjusted to be less than or equal to the original value based on the cost between the predicted block generated from the block vector set and the original block. Alternatively, a threshold value can be derived based on the cost of one or more block vectors, and the value of numBVSets can be adjusted to be less than or equal to the original value based on this threshold value.

[0203] Example 2

[0204] For each of the block vectors (i.e., block vector candidates) that can be utilized in IBC and / or Intra TMP, the cost between the template of the current block and the template of the reference block pointed to by the block vector can be calculated, and the block vector list can be sorted based on the calculated cost.

[0205] Multiple block vector sets can be constructed based on the above block vector list. Each block vector set can have N or fewer block vector(s). Here, N can be an integer greater than or equal to 1.

[0206] For example, a block vector set can be constructed based on the top K block vectors in ascending order of cost. Alternatively, a block vector set can be constructed based on the bottom K block vectors in ascending order of cost. Here, K can be an integer greater than or equal to 1.

[0207] For example, among the block vector candidates sorted in ascending order of cost, a block vector set can be constructed based on block vectors that are sequentially spaced apart from the block vector index with the smallest cost by a predetermined interval. Here, the predetermined interval can be an integer greater than or equal to 1. Among the block vector candidates sorted in ascending order of cost, a block vector set can be constructed based on block vectors that are sequentially spaced apart from the block vector index with the largest cost by a predetermined interval. Here, the predetermined interval can be an integer greater than or equal to 1.

[0208] For example, a block vector set can be constructed based on one or more block vectors having indices that are multiples of M, where M can be an integer greater than or equal to 0. The value of M can be different for each block vector set index.

[0209] For example, a block vector set can be constructed based on K consecutive block vector candidates starting from the index of the block vector candidate with the smallest x-coordinate. Alternatively, a block vector set can be constructed based on K consecutive block vector candidates starting from the index of the block vector candidate with the largest x-coordinate. Alternatively, a block vector set can be constructed based on K consecutive block vector candidates starting from the index of the block vector candidate with the smallest y-coordinate. Alternatively, a block vector set can be constructed based on K consecutive block vector candidates starting from the index of the block vector candidate with the largest y-coordinate. Here, K can be an integer greater than or equal to 1.

[0210] For example, a block vector set can be constructed based on K consecutive block vector candidates starting from the index of the block vector candidate having the smallest absolute value of the x-coordinate. Alternatively, a block vector set can be constructed based on K consecutive block vector candidates starting from the index of the block vector candidate having the largest absolute value of the x-coordinate. Alternatively, a block vector set can be constructed based on K consecutive block vector candidates starting from the index of the block vector candidate having the smallest absolute value of the y-coordinate. Alternatively, a block vector set can be constructed based on K consecutive block vector candidates starting from the index of the block vector candidate having the largest absolute value of the y-coordinate. Here, K can be an integer greater than or equal to 1.

[0211] For example, a block vector set can be constructed based on block vector candidates that are sequentially spaced apart from the index of the block vector candidate with the smallest x-coordinate by a predetermined interval. Alternatively, a block vector set can be constructed based on block vector candidates that are sequentially spaced apart from the index of the block vector candidate with the largest x-coordinate by a predetermined interval. Alternatively, a block vector set can be constructed based on block vector candidates that are sequentially spaced apart from the index of the block vector candidate with the smallest y-coordinate by a predetermined interval. Alternatively, a block vector set can be constructed based on block vector candidates that are sequentially spaced apart from the index of the block vector candidate with the largest y-coordinate by a predetermined interval. Here, the predetermined interval can be an integer greater than or equal to 1.

[0212] For example, a block vector set can be constructed based on block vector candidates that are sequentially spaced apart from the index of the block vector candidate having the smallest absolute value of the x-coordinate by a predetermined interval. Alternatively, a block vector set can be constructed based on block vector candidates that are sequentially spaced apart from the index of the block vector candidate having the largest absolute value of the x-coordinate by a predetermined interval. Alternatively, a block vector set can be constructed based on block vector candidates that are sequentially spaced apart from the index of the block vector candidate having the smallest absolute value of the y-coordinate by a predetermined interval. Alternatively, a block vector set can be constructed based on block vector candidates that are sequentially spaced apart from the index of the block vector candidate having the largest absolute value of the y-coordinate by a predetermined interval. Here, the predetermined interval can be an integer greater than or equal to 1.

[0213] For example, the indices of all or some of the block vectors that make up the block vector set can be signaled explicitly and / or implicitly.

[0214] A block vector set may be constructed based on any one of the above-described embodiments, or a block vector set may be constructed through a combination of at least two of them.

[0215] Each of the above block vector sets can be filtered based on at least one of a cost between templates (e.g., cost of a block vector), a block vector set index, or the number of block vectors belonging to the block vector set.

[0216] For example, block vector(s) having a cost greater than or equal to a predetermined threshold may be excluded from the block vector set. The threshold may be derived as the value obtained by multiplying the smallest cost within the block vector set by C. Alternatively, the threshold may be derived as the value obtained by multiplying the largest cost within the block vector set by C. Here, C may be a real number greater than or equal to 0. Block vectors excluded from a block vector set may not be included in other block vector sets.

[0217] For example, the maximum number of block vectors that can be configured in a block vector set having an index of N can be determined based on the number of block vectors configured in a block vector set having an index of (N-1). Specifically, the maximum number of block vectors that can be configured in a block vector set having an index of N can be set to be equal to the number of block vectors configured in a block vector set having an index of (N-1). Alternatively, the maximum number of block vectors that can be configured in a block vector set having an index of N can be set to a value obtained by adding or subtracting P from the number of block vectors configured in a block vector set having an index of (N-1). Here, P can be an integer greater than or equal to 1.

[0218] For example, among the block vectors belonging to the block vector set having an index of N, the top X block vector(s) in ascending order of cost can be reused in the block vector set having an index of (N+1). Alternatively, among the block vectors belonging to the block vector set having an index of N, the bottom X block vector(s) in ascending order of cost can be reused in the block vector set having an index of (N+1). Here, X can be an integer greater than or equal to 1.

[0219] For example, a new block vector can be generated by a weighted sum of at least two block vectors among the block vectors belonging to the block vector set having an index of (N-1), and the generated new block vector can be added to the block vector set having an index of N.

[0220] N block vectors that are judged to have high accuracy within the block vector list can be used in one or more block vector sets, where N can be an integer greater than or equal to 1.

[0221] For example, the top X block vectors in ascending order of cost can be used in one or more sets of block vectors. For example, the first block vector in the list of block vectors sorted by cost (i.e., the block vector with an index of 0) can be used in all sets of block vectors. Alternatively, the bottom X block vectors in ascending order of cost can be used in one or more sets of block vectors.

[0222] For example, the top X block vectors in ascending order of x-coordinate values ​​can be used in one or more sets of block vectors. Alternatively, the bottom X block vectors in ascending order of x-coordinate values ​​can be used in one or more sets of block vectors. Alternatively, the top X block vectors in ascending order of y-coordinate values ​​can be used in one or more sets of block vectors. The bottom X block vectors in ascending order of y-coordinate values ​​can be used in one or more sets of block vectors. Here, X can be an integer greater than or equal to 1.

[0223] For example, the top X block vectors in ascending order of the absolute value of the x-coordinate can be used in one or more sets of block vectors. Alternatively, the bottom X block vectors in ascending order of the absolute value of the x-coordinate can be used in one or more sets of block vectors. Alternatively, the top X block vectors in ascending order of the absolute value of the y-coordinate can be used in one or more sets of block vectors. The bottom X block vectors in ascending order of the absolute value of the y-coordinate can be used in one or more sets of block vectors. Here, X can be an integer greater than or equal to 1.

[0224] A block vector set may be generated or filtered based on any one of the embodiments described above, or a block vector set may be generated or filtered based on a combination of at least two.

[0225] One or more new block vectors can be generated based on a combination of block vectors belonging to a block vector list, and the generated new block vector(s) can be added to the block vector list.

[0226] For example, a new block vector can be generated based on the weighted sum of the top N block vectors in ascending order of cost within the block vector list. A new block vector can be generated based on the weighted sum of the bottom N block vectors in ascending order of cost within the block vector list. Here, N can be an integer greater than or equal to 2. A new block vector can be generated based on the weighted sum of the block vector with the smallest cost and the block vector with the largest cost within the block vector list.

[0227] For example, among the block vectors sorted in ascending order of cost in the block vector list, a new block vector can be generated based on a weighted sum of block vectors that are sequentially spaced apart from the block vector index with the smallest cost by a predetermined interval. Among the block vectors sorted in ascending order of cost in the block vector list, a new block vector can be generated based on a weighted sum of block vectors that are sequentially spaced apart from the block vector index with the largest cost by a predetermined interval. Here, the predetermined interval can be an integer greater than or equal to 1.

[0228] For example, a new block vector can be generated based on a weighted sum of block vectors with indices that are multiples of M, where M can be an integer greater than or equal to 0. The above process can be performed repeatedly for different values ​​of M.

[0229] For example, a new block vector can be generated by weighting the coordinates of the top N block vectors in ascending order of cost, and the generated new block vector can be used in one or more sets of block vectors. Alternatively, a new block vector can be generated by weighting the coordinates of the bottom N block vectors in ascending order of cost, and the generated new block vector can be used in one or more sets of block vectors.

[0230] A new block vector can be generated based on a combination of at least two of the above-described embodiments.

[0231] The method described above can generate one or more new block vectors, and update the block vector list based on these. A block vector set can be constructed or an additional block vector set can be created based on the updated block vector list.

[0232] For at least one set of block vectors, a threshold for filtering the block vectors can be derived. Here, the threshold can be derived based on the cost of the block vectors.

[0233] For example, when constructing a block vector set, a threshold value may be set by multiplying the cost of a specific block vector by a scale value (C). Block vectors with a cost greater than or equal to the threshold value may be excluded from the block vector set. The specific block vector may be the top K block vectors in ascending or descending order of cost. K may be an integer greater than or equal to 1.

[0234] For example, the scale value (C) can be defined differently for each block vector set. For example, for the 0th, 1st, 2nd, ..., (N-1)th block vector sets, C0, C1, C2, ..., C n ,..., C N-1 Each scale value can be used, and each scale value can be a real number greater than or equal to 0. Here, N is the number of block vector sets and can be an integer greater than or equal to 0.

[0235] Alternatively, one of the block vector sets may use the same threshold as the other. For example, if there are three block vector sets, scale values ​​of 2, 1.2, and 1.2 may be used for the three block vector sets, respectively.

[0236] A set of block vectors can be filtered based on at least one of a threshold for the set of block vectors or a characteristic of a previous set of block vectors (e.g., an index, a number of block vectors, a threshold, etc.).

[0237] For example, when constructing a block vector set, a threshold value can be derived using the aforementioned method, and block vectors with a cost greater than or equal to the derived threshold value can be excluded from the block vector set. The excluded block vectors can be restricted from being used in the next block vector set. Alternatively, the excluded block vectors can be included in the next block vector set.

[0238] For example, the maximum number of block vectors that can be included in the current block vector set can be derived based on the number of block vectors belonging to the previous block vector set. For example, the maximum number of block vectors that can be included in the current block vector set can be set to be equal to the number of block vectors belonging to the previous block vector. Alternatively, the maximum number of block vectors that can be included in the current block vector set can be set to a value that is P plus or minus the number of block vectors belonging to the previous block vector. Here, P can be an integer greater than or equal to 1.

[0239] For example, among the block vectors belonging to the previous block vector set, X block vectors having relatively small costs can be reused in the current block vector set. The X block vectors having relatively small costs may refer to the top X block vectors in ascending order of costs among the block vectors belonging to the previous block vector set. Alternatively, the X block vectors having relatively small costs may refer to the top X block vectors in ascending order of costs, excluding the first and / or second block vectors. Here, X may be an integer greater than or equal to 1.

[0240] For example, among the block vectors belonging to the previous block vector set, X block vectors having relatively high costs can be reused in the current block vector set. The X block vectors having relatively high costs can mean the top X block vectors in descending order of costs among the block vectors belonging to the previous block vector set. Alternatively, the X block vectors having relatively high costs can be the first and / or second block vectors excluding the top X block vectors in descending order of costs. Here, X can be an integer greater than or equal to 1.

[0241] For example, a new block vector can be generated based on a weighted sum of two or more block vectors belonging to a previous block vector set, and the new block vector can be added to the current block vector set.

[0242] The current block vector set can be generated or filtered through any one or a combination of at least two of the above-described embodiments.

[0243] During the process of reusing existing block vectors or filtering a block vector set, the next block vector set may include additional block vectors. In this case, the next block vector set can be filtered based on a predetermined threshold. Block vectors with a cost greater than or equal to the threshold can be excluded from the block vector set. Here, the threshold can be set based on the cost of the block vector.

[0244] For example, when N block vectors are added, a threshold can be calculated based on the cost of one block vector among indices 0 to (N-1), where N can be an integer greater than or equal to 0.

[0245] For example, when N block vectors are added, a threshold can be calculated based on the cost of the block vector at the (N+k)th index, where k can be an integer greater than or equal to 0.

[0246] For example, when N block vectors are added, a threshold can be calculated based on the weighted sum of the costs of the block vectors with indices from 0 to (N-1).

[0247] For example, when N block vectors are added, a threshold can be calculated based on a weighted sum of the costs of block vectors with indices from (N+p) to (N+k). Here, p and k can be a positive integer, a negative integer, or 0, respectively.

[0248] A threshold for filtering a set of block vectors can be calculated based on one or a combination of at least two of the above-described embodiments.

[0249] The aforementioned method can be used continuously in the encoder and decoder. Alternatively, the aforementioned method can be used adaptively in the encoder and decoder. To this end, information indicating the availability / use of the aforementioned method can be encoded in the encoder and signaled to the decoder. Alternatively, information indicating the availability / use of the aforementioned method can be implicitly derived in the encoder and decoder.

[0250] Example 3

[0251] The encoder and decoder may define two or more intra prediction modes utilizing block vector lists. In this case, a block vector list according to each intra prediction mode may be generated. Alternatively, a single block vector list (hereinafter referred to as a unified block vector list) that applies equally to the two or more intra prediction modes may be generated.

[0252] The integrated block vector list according to the present disclosure can be generated based on a combination of the block vector list construction methods discussed above. For example, the integrated block vector list can include at least one of a block vector derived through template matching with the template of the current block within a predetermined search range, or a block vector of a block previously encoded / decoded.

[0253] For example, the integrated block vector list can be used when the intra prediction mode of the current block is Intra TMP (or a combined mode of Intra TMP). The integrated block vector list can be used when the intra prediction mode of the current block is IBC (or a combined mode of IBC).

[0254] For example, a unified block vector list can be generated based on block vectors surrounding the current block. Specifically, a unified block vector list can be generated based on the block vectors of neighboring blocks spatially adjacent to the current block. A unified block vector list can also be generated based on the block vectors of neighboring blocks not adjacent to the current block. A unified block vector list can be generated by sequentially using the block vector(s) that were encoded / sub-encoded prior to the current block.

[0255] For example, a unified block vector list can be generated based on motion vectors surrounding the current block. The motion vectors can be distinguished from block vectors in that they specify reference blocks within a picture that has a different temporal order (e.g., POC) from the current picture.

[0256] Specifically, the motion vector of a neighboring block spatially adjacent to the current block can be set as a block vector and added to the unified block vector list. The motion vector of a neighboring block spatially adjacent to the current block can be scaled, the scaled motion vector can be set as a block vector and added to the unified block vector list.

[0257] The motion vector of a block that is not spatially adjacent to the current block can be set as a block vector and added to the unified block vector list. The motion vector of a block that is not spatially adjacent to the current block can be scaled, the scaled motion vector can be set as a block vector, and this can be added to the unified block vector list.

[0258] The motion vector immediately preceding the current block can be set as a block vector and added to the unified block vector list. The motion vector immediately preceding the current block can be scaled, the scaled motion vector can be set as a block vector, and added to the unified block vector list.

[0259] The motion vector(s) previously encoded / decoded in the current block can be set as block vector(s) and added to the unified block vector list. The motion vector(s) previously encoded / decoded in the current block can be scaled, and the scaled motion vector(s) can be set as block vector(s) and added to the unified block vector list.

[0260] One or more new block vectors can be generated by taking the average of at least two block vectors belonging to the integrated block vector list, and can be added to the integrated block vector list.

[0261] The aforementioned block vector set may be constructed based on the integrated block vector list, or an additional block vector set may be generated.

[0262] At least two block vectors can be selected from the previously generated block vector list (or, integrated block vector list). To this end, the encoder can encode the indices of the at least two block vectors and signal them to the decoder. The decoder can select at least two block vectors from the block vector list (or, integrated block vector list) based on the signaled indices. Prediction blocks can be generated based on the selected block vectors. The prediction block of the current block can be generated based on the generated prediction blocks.

[0263] Alternatively, multiple block vector sets may be constructed based on a block vector list or a unified block vector list. In this case, the encoder may encode an index that specifies one of the multiple block vector sets and signal it to the decoder. The decoder may then specify one of the multiple block vector sets based on the signaled index.

[0264] Prediction blocks can be generated based on all or part of the block vectors belonging to the above-mentioned specified block vector set. A prediction block of the current block can be generated based on the generated prediction blocks. Some of the block vectors can be specified based on an explicitly signaled block vector index. Alternatively, some of the block vectors can be implicitly specified in the encoder and decoder.

[0265] At least two prediction blocks may be generated based on a combination of at least two of the above-described embodiments 1 to 3.

[0266] Below, we will examine a method for generating a prediction block of the current block based on the generated prediction blocks.

[0267] A prediction block of the current block can be generated through a weighted sum of the above-generated prediction blocks (first method). Here, the weights for the weighted sum can be derived based on the costs of the block vectors used to generate the prediction blocks.

[0268] Alternatively, a predetermined filter (e.g., Weiner filter) may be applied to the generated prediction blocks to generate a prediction block of the current block (second method). The filter coefficients (or filtering weights) of the predetermined filter may be explicitly encoded in the encoder and signaled to the decoder.

[0269] Alternatively, a prediction block of the current block can be generated by selectively using either the first or second method (the third method). To this end, a flag (weight type flag) for selecting either the first or second method can be signaled.

[0270] Linear filter mode

[0271] The linear filter mode may be a mode that derives filter coefficients of a linear filter based on a template and generates a prediction block of the current block based on the derived filter coefficients.

[0272] Specifically, the filter coefficients of a linear filter can be derived based on the template of the current block and the template of the reference block. Here, the reference block can be specified based on any one of a plurality of block vectors belonging to a block vector list. The filter coefficients of the linear filter can be applied to the reference block to generate a predicted block of the current block.

[0273] The filter coefficients of the linear filter can be derived based on at least one of a current sample, a reference sample, or a neighboring sample adjacent to the reference sample. Here, the current sample may refer to a sample belonging to a template area of ​​the current block. The reference sample may be a sample belonging to the template area of ​​the reference block, and may be a sample corresponding to the position of the current sample. The neighboring samples adjacent to the reference sample may include at least one of an upper neighboring sample, a left neighboring sample, a lower neighboring sample, or a right neighboring sample.

[0274] For example, all samples within the template region of a reference block can be used as the reference samples. If there are a total of 64 samples within the template region of the reference block, the optimal filter coefficients can be derived through the Gaussian Elimination technique as shown in the following mathematical expression 3.

[0275] [Equation 3]

[0276]

[0277] In mathematical expression 3, C i represents the value of the reference sample, and N i , S i , E i and W i may represent the values ​​of the upper, lower, right, and left surrounding samples of the corresponding reference sample, respectively (where i is an integer greater than or equal to 0 and less than or equal to 63). B may be a predetermined offset. c0 to c5 may be filter coefficients applied to the reference sample, surrounding samples, and offset, respectively. ref i can represent the value of the current sample corresponding to the reference sample.

[0278] A prediction block of the current block can be generated by applying filter coefficients to samples of a reference block in a predetermined scan order (e.g., raster scan).

[0279] The linear filter mode can use an N-tap linear filter. Here, N can be a fixed value that is identically pre-defined for the encoder and decoder. For example, N can be 5. However, the present invention is not limited thereto, and N can be an integer of 3, 6, 7, 9, or a higher integer. Multiple linear filters can be defined for the encoder and decoder, and any one of the multiple linear filters can be selectively used. The multiple pre-filters can have different numbers of taps. Alternatively, the multiple linear filters can have the same number of taps but different filter coefficients. Alternatively, the multiple linear filters can have different numbers of taps and filter coefficients.

[0280] Figure 5 shows examples of filter shapes that can be used in linear filter mode.

[0281] All or part of the filter shapes illustrated in Fig. 5 may correspond to the plurality of linear filters described above. Various linear filters may be defined depending on the filter application area (or the positions of the samples input to the linear filter). For example, a linear filter that inputs the upper, lower, left, and right surrounding samples relative to the current sample may be used. Alternatively, a linear filter that inputs the upper left, upper right, lower left, and lower right surrounding samples relative to the current sample may be used.

[0282] The filter application area may be expanded or reduced based on the size of the current block and / or reference block. Here, the reference block may refer to a block that belongs to the current picture and has been encoded / decoded before the current block.

[0283] The filter application area may be expanded or reduced based on the ratio of the height and width of the current block and / or surrounding blocks. Alternatively, the filter application area may be adjusted to an asymmetrical area based on the ratio of the height and width of the current block and / or surrounding blocks.

[0284] The linear filter used in the reference block of the current block can be used in the current block.

[0285] A linear filter combining at least two of the examples of linear filters described above may also be used.

[0286] The filter candidate set including the above filter shape and / or multiple linear filters can be explicitly / implicitly configured based on Video Parameter Set (VPS), Sequence Parameter Set (SPS), Picture Parameter Set (PPS), Picture Header (PH), Slice Header (SH), Slice Data, Coding Unit, or any user setting.

[0287] When a linear filter mode is used, a prediction block can be generated based on at least one linear filter among multiple linear filters. The linear filter used in this case can be derived explicitly or implicitly in the decoder.

[0288] The template of the current block can be divided into multiple sub-regions. Among the multiple sub-regions, the first sub-region may be a region for deriving filter coefficients of each linear filter. Among the multiple sub-regions, the second sub-region may be a region for calculating costs based on the filter coefficients of each linear filter. The template of the reference block can also be divided in the same manner as the template of the current block.

[0289] For example, a template can be divided into multiple sub-regions based on the size of the current block and / or reference block.

[0290] For example, filter coefficients can be derived based on sub-regions located close to the current block and / or reference block. Conversely, costs can be calculated based on sub-regions located far from the current block and / or reference block.

[0291] For example, filter coefficients can be derived based on sub-regions located far from the current block and / or reference block. Conversely, costs can be calculated based on sub-regions located close to the current block and / or reference block.

[0292] For example, the first sub-region may be defined as a set of odd-numbered columns within the template, and the second sub-region may be defined as a set of even-numbered columns within the template. Alternatively, the first sub-region may be defined as a set of even-numbered columns within the template, and the second sub-region may be defined as a set of odd-numbered columns within the template. Alternatively, the first sub-region may be defined as a set of odd-numbered rows within the template, and the second sub-region may be defined as a set of even-numbered rows within the template. Alternatively, the first sub-region may be defined as a set of even-numbered rows within the template, and the second sub-region may be defined as a set of odd-numbered rows within the template.

[0293] For example, a template can be divided into multiple sub-regions based on the height and width ratio of the current block and / or reference block.

[0294] Templates can be distinguished based on a combination of at least two of the above-described embodiments.

[0295] Even if the template of the current block is divided into multiple sub-regions, filter coefficients can be derived based on the entire template, and costs can be calculated based on some regions within the template. Here, some regions may be sub-regions located close to the current block. Alternatively, the some regions may be sub-regions located far from the current block. Alternatively, the some regions may be defined as a set of odd-numbered columns within the template. Alternatively, the some regions may be defined as a set of even-numbered columns within the template. Alternatively, the some regions may be defined as a set of odd-numbered rows within the template. Alternatively, the some regions may be defined as a set of even-numbered rows within the template. Hereinafter, some regions may be interpreted with the same meaning.

[0296] Alternatively, even if the template of the current block is divided into multiple sub-regions, the filter coefficients can be derived based on some regions within the template and the cost can be calculated based on the entire template.

[0297] Alternatively, filter coefficients can be derived based on the entire template, without dividing into sub-regions, and costs can be calculated based on the entire template.

[0298] For each of the pre-defined linear filters, filter coefficients can be derived. Based on each linear filter, a cost between a predicted sample and a restored sample can be calculated. Here, the predicted sample may be generated by applying a linear filter to a sample belonging to the entire template or a portion of a reference block. The restored sample may be a sample belonging to the template of the current block and corresponding to a sample to which the linear filter has been applied. A cost is calculated for each of the pre-defined linear filters, and one of the pre-defined linear filters can be selected based on the calculated cost. The linear filter with the smallest cost among the calculated costs can be selected.

[0299] Since the templates of the current block and the reference block are equally accessible to the encoder and decoder, the encoder and decoder can implicitly determine the linear filter using the same method. Alternatively, the encoder can determine the optimal linear filter or filter shape by calculating the RD cost for each linear filter or filter shape belonging to the filter candidate set. The encoder can also explicitly signal the information specifying the determined optimal linear filter or filter shape by encoding it to the decoder.

[0300] The predicted block of the current block can be generated based on the linear filter selected through the aforementioned method. When at least two linear filters are selected, a predicted block can be generated based on each linear filter, and the predicted block of the current block can be generated through a weighted sum of the generated predicted blocks.

[0301] The various embodiments of the present disclosure are not intended to list all possible combinations but rather to illustrate representative aspects of the present disclosure, and the matters described in the various embodiments may be applied independently or in combinations of two or more.

[0302] Additionally, various embodiments of the present disclosure may be implemented by hardware, firmware, software, or a combination thereof. In the case of hardware implementation, the embodiments may be implemented by one or more ASICs (Application Specific Integrated Circuits), DSPs (Digital Signal Processors), DSPDs (Digital Signal Processing Devices), PLDs (Programmable Logic Devices), FPGAs (Field Programmable Gate Arrays), general processors, controllers, microcontrollers, microprocessors, etc.

[0303] The scope of the present disclosure includes software or machine-executable instructions (e.g., operating systems, applications, firmware, programs, etc.) that cause operations according to the methods of various embodiments to be executed on a device or a computer, and a non-transitory computer-readable medium having such software or instructions stored thereon and executable on the device or computer.

Claims

1. A step of generating a block vector list for the current block; and A step of generating a prediction block of the current block based on the block vector list, The above block vector list includes a plurality of block vectors, One or more block vector sets are constructed based on the above block vector list, A method for decoding an image, wherein at least one of the plurality of block vectors is derived based on a cost between a template of the current block and a template of a reference block.

2. In paragraph 1, An image decoding method, wherein the top X block vectors in ascending order of the cost among a plurality of block vectors belonging to the above block vector list are used in one or more block vector sets.

3. In paragraph 1, A method for decoding an image, wherein among a plurality of block vectors belonging to the above block vector list, the lower X block vectors in ascending order of the cost are used in one or more block vector sets.

4. In paragraph 1, Among the plurality of block vectors belonging to the above block vector list, the top X block vectors in ascending order of coordinate values ​​are used in one or more block vector sets, A method for decoding an image, wherein the above coordinate value is either an x-coordinate value or a y-coordinate value.

5. In paragraph 1, Among the plurality of block vectors belonging to the above block vector list, the lower X block vectors in ascending order of coordinate values ​​are used in one or more block vector sets, A method for decoding an image, wherein the above coordinate value is either an x-coordinate value or a y-coordinate value.

6. In paragraph 1, Among the plurality of block vectors belonging to the above block vector list, the top X block vectors in ascending order of absolute coordinate values ​​are used in one or more block vector sets. A method for decoding an image, wherein the above absolute coordinate value is either the absolute value of the x-coordinate or the absolute value of the y-coordinate.

7. In paragraph 1, Among the plurality of block vectors belonging to the above block vector list, the lower X block vectors in ascending order of absolute coordinate values ​​are used in one or more block vector sets. A method for decoding an image, wherein the above absolute coordinate value is either the absolute value of the x-coordinate or the absolute value of the y-coordinate.

8. In paragraph 1, A method for decoding an image, wherein the current block vector set is filtered based on at least one of a threshold value for the current block vector set or a characteristic of a previous block vector set.

9. In paragraph 8, A method for decoding an image, wherein the top X block vectors in ascending order of cost among the block vectors belonging to the previous block vector set are reused in the current block vector set.

10. In paragraph 8, A method for decoding an image, wherein a threshold for the current block vector set is set based on the smallest cost among the costs of block vectors belonging to the current block vector set.

11. In paragraph 10, An image decoding method, wherein among the block vectors belonging to the current block vector set, a block vector having a cost greater than or equal to the threshold value is excluded from the current block vector set.

12. In paragraph 8, A method for decoding an image, wherein the maximum number of block vectors that can be included in the current block vector set is determined based on the number of block vectors belonging to the previous block vector set.

13. A step of generating a block vector list for the current block; and A step of generating a prediction block of the current block based on the block vector list, The above block vector list includes a plurality of block vectors, One or more block vector sets are constructed based on the above block vector list, A method for encoding an image, wherein at least one of the plurality of block vectors is derived based on a cost between a template of the current block and a template of a reference block.

14. A computer-readable storage medium storing a bitstream generated based on the image encoding method according to Article 12.

Citation Information

Patent Citations

  • Installation structure of air conditioner attached to the exterior of a building in a drawer style

    KR102711720B1

  • Generating system for using small hydropower

    KR102818755B1

  • Method for adhering of tape for secondary battery

    KR102837607B1

  • Device And Method For Setting Mosquito Net Or Wind Proof Sheet Using Velcro

    KR102872015B1

  • KR20200104251A