Image encoding / decoding method and device, and recording medium in which bitstream is stored

By determining and applying filtering parameters for prediction blocks in video encoding and decoding, the method addresses inefficiencies in handling high-resolution and stereoscopic video, enhancing compression performance and accuracy.

WO2026135208A1PCT designated stage Publication Date: 2026-06-25DIGITALINSIGHTS INC

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
DIGITALINSIGHTS INC
Filing Date
2025-12-17
Publication Date
2026-06-25

AI Technical Summary

Technical Problem

Existing video compression technologies struggle to efficiently handle high-resolution and stereoscopic video content, particularly in determining and applying appropriate filtering for prediction blocks during inter-prediction, which affects compression performance.

Method used

A method and apparatus for determining whether to filter a prediction block, deriving filtering parameters, and performing filtering on both luminance and chrominance component blocks based on geometric partitioning and blending techniques, enhancing prediction block generation, and applying these techniques to improve encoder/decoder performance.

Benefits of technology

Enhances compression performance by providing more accurate predictions through filtering, improving encoding and decoding efficiency for high-resolution and stereoscopic video content.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure KR2025021958_25062026_PF_FP_ABST
    Figure KR2025021958_25062026_PF_FP_ABST
Patent Text Reader

Abstract

The present invention provides an image encoding method and an image decoding method. The image decoding method of the present invention may comprise the steps of: generating a prediction block of the current block on the basis of inter prediction; determining whether to perform filtering on the prediction block; deriving filtering parameters on the basis of whether to perform filtering on the prediction block; and performing filtering on the prediction block of the current block on the basis of the filtering parameters.
Need to check novelty before this filing date? Find Prior Art

Description

Video encoding / decoding method and device, and a recording medium storing a bitstream

[0001] The present invention relates to an encoder and a decoder, and more specifically, to a method and apparatus for encoding and decoding for generating a predicted block of a current block.

[0002] Market demand for high-resolution video is increasing, and consequently, there is a need for technology that can efficiently compress high-resolution video. In response to these market demands, the Moving Picture Expert Group (MPEG) of ISO / IEC and the Video Coding Expert Group (VCEG) of ITU-T jointly formed the Joint Collaborative Team on Video Coding (JCT-VC), completed the development of the High Efficiency Video Coding (HEVC) video compression standard in January 2013, and have been actively conducting research and development on next-generation compression standards.

[0003] Techniques applied to video compression can broadly include intra-frame prediction (or intra prediction), inter-frame prediction (or inter prediction), transformation, quantization, entropy coding, and / or in-loop filters. Meanwhile, along with the increasing demand for high-resolution video, the demand for stereoscopic video content as a new video service is also increasing. Accordingly, there is active discussion regarding video compression technologies to effectively provide high-resolution and ultra-high-resolution stereoscopic video content.

[0004] The present disclosure aims to provide a method and apparatus for determining whether to filter a prediction block of a current block when an inter-prediction is performed for a current block.

[0005] The present disclosure aims to provide a method and apparatus for deriving filtering parameters of a current block when filtering of a predicted block of a current block is performed.

[0006] The present disclosure aims to provide a method and apparatus for filtering a predicted block of a current block based on a filtering parameter of the current block.

[0007] The present disclosure aims to provide a method and apparatus for deriving filtering parameters for each of the luminance component block and the chrominance component block when filtering is performed on both the luminance component block and the chrominance component block corresponding to the position of the current block.

[0008] The present disclosure aims to provide a method and apparatus for determining whether to perform filtering for each sub-region divided by a geometric division line when a geometric division-based prediction is performed on a current block.

[0009] The present disclosure aims to provide a method and apparatus for deriving filtering parameters for each sub-region when geometric partitioning-based prediction is performed on the current block.

[0010] The present disclosure aims to provide a method and apparatus for blending at least one of the top sample or the left sample within the current block when an inter-prediction is performed for the current block.

[0011] The image decoding method and apparatus according to the present disclosure can generate a prediction block of a current block based on inter-prediction, determine whether to filter the prediction block, derive a filtering parameter based on whether to filter the prediction block, and perform filtering on the prediction block based on the filtering parameter.

[0012] In the image decoding method and apparatus according to the present disclosure, the prediction block may be generated through geometric partitioning-based prediction, and the geometric partitioning-based prediction may be performed based on geometric partitioning information, and the geometric partitioning information may include at least one of angle information or offset information of a geometric partitioning line.

[0013] In the image decoding method and apparatus according to the present disclosure, whether or not to filter the prediction block may be determined based on filtering usage information, and the filtering usage information may include at least one of a luminance component filtering execution flag or a chrominance component filtering execution flag. Here, the luminance component filtering execution flag may indicate whether or not to perform filtering for the luminance component block of the current block, and the chrominance component filtering execution flag may indicate whether or not to perform filtering for the chrominance component block of the current block.

[0014] In the image decoding method and apparatus according to the present disclosure, when the value of the luminance component filtering execution flag is 1, it may indicate that filtering is performed on the luminance component block, and when the value of the luminance component filtering execution flag is 0, it may indicate that filtering is not performed on the luminance component block. Additionally, when the value of the chrominance component filtering execution flag is 1, it may indicate that filtering is performed on the chrominance component block, and when the value of the chrominance component filtering execution flag is 0, it may indicate that filtering is not performed on the chrominance component block.

[0015] In the image decoding method and apparatus according to the present disclosure, the chrominance component filtering execution flag may be signaled when the value of the luminance component filtering execution flag is 1.

[0016] In the image decoding method and apparatus according to the present disclosure, the filtering parameter may be derived based on at least one of the template area of ​​the current block or the template area of ​​the reference block within the reference frame, and the template area of ​​the current block and the template area of ​​the reference block may each include at least one of the upper template area or the left template area.

[0017] In the image decoding method and apparatus according to the present disclosure, the filtering parameter may include at least one of a filtering parameter for a luminance component block or a filtering parameter for a chrominance component block.

[0018] In the image decoding method and apparatus according to the present disclosure, the filtering parameter for the chrominance component block can be derived based on the parameter for the luminance component block.

[0019] In the image decoding method and apparatus according to the present disclosure, the filtering parameter for the chrominance component block may be derived by scaling the parameter for the luminance component block, and the scaling may be performed based on scaling index information, and the scaling index information may represent a scaling parameter according to a pre-defined table.

[0020] In the image decoding method and apparatus according to the present disclosure, the geometric division line can divide the current block into a plurality of sub-regions, and when each of the plurality of sub-regions generates an inter-prediction block, filtering can be performed on each of the inter-prediction blocks of the plurality of sub-regions.

[0021] The image decoding method and apparatus according to the present disclosure may further include the step of performing blending for the prediction block. Here, the area where the blending is performed may be determined based on at least one of the width, height, or ratio of width to height of the current block.

[0022] In the image decoding method and apparatus according to the present disclosure, the blending may be performed based on motion information of a reference block spatially adjacent to the current block.

[0023] The image encoding method and apparatus according to the present disclosure can generate a prediction block of a current block based on inter-prediction, determine whether to filter the prediction block, derive a filtering parameter based on whether to filter the prediction block, and perform filtering on the prediction block based on the filtering parameter.

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

[0025] The bitstream transmission method and apparatus according to the present disclosure can transmit a bitstream generated by the image encoding method.

[0026] According to the present disclosure, when inter-prediction is performed on a current block, determining whether to filter the prediction block of the current block enables more efficient prediction, thereby improving the compression performance of the encoder / decoder.

[0027] According to the present disclosure, when filtering of a prediction block of a current block is performed, a more efficient prediction is made by deriving the filtering parameters of the current block, and thereby the compression performance of the encoder / decoder can be improved.

[0028] According to the present disclosure, by filtering the predicted block of the current block based on the filtering parameters of the current block, a more accurate prediction is possible, and thereby the compression performance of the encoder / decoder can be improved.

[0029] According to the present disclosure, when filtering is performed on both the luminance component block and the chrominance component block corresponding to the position of the current block, a more accurate prediction is possible by deriving filtering parameters for each of the luminance component block and the chrominance component block, thereby improving the compression performance of the encoder / decoder.

[0030] According to the present disclosure, when geometric partitioning-based prediction is performed on the current block, more efficient prediction becomes possible by deriving filtering parameters for each sub-block, thereby improving the compression performance of the encoder / decoder.

[0031] According to the present disclosure, when inter-prediction is performed on a current block, by blending at least one of the top sample or left sample within the current block, more efficient prediction becomes possible, and thereby the compression performance of the encoder / decoder can be improved.

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

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

[0034] FIG. 3 illustrates an image decoding method performed in an image decoding device according to the present disclosure.

[0035] FIG. 4 is a drawing showing an example of a spatially surrounding reference block of a current block according to the present disclosure.

[0036] FIG. 5 is a drawing showing an example of the angle and offset of a geometric division line according to the present disclosure.

[0037] FIG. 6 is a diagram showing an example of a blending process according to the present disclosure.

[0038] Embodiments of the present invention are described in detail with reference to the drawings attached to this specification so that those skilled in the art can easily implement the invention. However, the present invention may be embodied in various different forms and is not limited to the embodiments described herein. Furthermore, in order to clearly explain the invention in the drawings, parts unrelated to the explanation have been omitted, and similar parts throughout the specification are denoted by similar reference numerals.

[0039] Throughout this specification, when a part is described as being 'connected' to another part, this includes not only cases where they are directly connected, but also cases where they are electrically connected with other elements in between.

[0040] Furthermore, throughout this specification, when a part is described as 'comprising' a certain component, this means that, unless specifically stated otherwise, it does not exclude other components but may include additional components.

[0041] Additionally, terms such as "first," "second," etc., may be used to describe various components, but said components should not be limited by said terms. These terms are used solely for the purpose of distinguishing one component from another.

[0042] Additionally, in the embodiments relating to the device and method described herein, some components of the device or some steps of the method may be omitted. Also, the order of some components of the device or some steps of the method may be changed. Additionally, other components or other steps may be inserted into some components of the device or some steps of the method.

[0043] The components shown in the embodiments of the present invention are illustrated independently to represent different characteristic functions and do not imply that each component consists of separate hardware or a single software unit. That is, for convenience of explanation, each component is described as a separate component, and at least two of the components 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 separated embodiments of each component are also included within the scope of the present invention as long as they do not depart from the essence of the invention.

[0044] First, the terms used in this application are briefly explained as follows.

[0045] The video decoding apparatus described below may be a device included in a civilian security camera, civilian security system, military security camera, military security system, personal computer (PC), notebook computer, portable multimedia player (PMP), wireless communication terminal, smartphone, and server terminal such as a TV application server and service server; it may also refer to various devices equipped with a user terminal such as various devices, a communication device such as a communication modem for performing communication with a wired or wireless communication network, a memory for storing various programs and data for decoding video or predicting between or within a screen for decoding, and a microprocessor for executing programs to perform calculations and control.

[0046] In addition, the video encoded into a bitstream by the encoder can be transmitted to a video decoding device in real-time or non-real-time via wired or wireless communication networks such as the Internet, local area wireless communication networks, wireless LAN networks, WiBro networks, and mobile communication networks, or through various communication interfaces such as cables and Universal Serial Bus (USB), to be decoded, restored as a video, and played back. Alternatively, the bitstream generated by the encoder may be stored in memory. The memory may include both volatile and non-volatile memory. In this specification, memory may be described as a recording medium that stores the bitstream.

[0047] Typically, a video can be composed of a series of pictures, and each picture can be divided into coding units, such as blocks. Furthermore, those skilled in the art to which this embodiment belongs will understand that the term "picture" described below may be replaced with other terms having equivalent meanings, such as "image" or "frame." Additionally, those skilled in the art to which this embodiment belongs will understand that the term "coding unit" may be replaced with other terms having equivalent meanings, such as "unit block" or "block."

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

[0049] FIG. 1 is a block diagram showing an image encoding device according to the present invention. Referring to FIG. 1, a conventional image encoding device (100) may include a picture splitting unit (110), a prediction unit (120, 125), a conversion unit (130), a quantization unit (135), a reordering unit (160), an entropy encoding unit (165), an inverse quantization unit (140), an inverse conversion unit (145), a filter unit (150), and a memory (155).

[0050] The picture splitting unit (110) can split the input picture into at least one processing unit. At this time, the processing unit may be a Prediction Unit (PU), a Transform Unit (TU), or a Coding Unit (CU). In the following embodiments of the present invention, the term "coding unit" may be used to mean a unit that performs coding, or a unit that performs decoding.

[0051] A prediction unit may be divided into shapes such as at least one square or rectangle of the same size within a single encoding unit, or it may be divided such that one of the prediction units within a single encoding unit has a different shape and / or size from another prediction unit. When generating a prediction unit that performs intra prediction based on an encoding unit, if it is not the minimum encoding unit, intra prediction can be performed without dividing into multiple prediction units NxN.

[0052] The prediction unit (120, 125) may include an inter prediction unit (120) that performs inter prediction or inter-frame prediction, and an intra prediction unit (125) that performs intra prediction or intra-frame prediction. It may determine whether to use inter prediction or perform 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. The residual value (residual block) between the generated prediction block and the original block may be input to the conversion unit (130). In addition, the prediction mode information, motion vector information, etc. used for prediction may be encoded in the entropy encoding unit (165) along with the residual value and transmitted to the decoder. However, when the motion information derivation technique on the side of the decoder according to the present invention is applied, the prediction mode information, motion vector information, etc. are not generated in the encoder, so the information is not transmitted to the decoder. On the other hand, it is possible to signal and transmit from the encoder information instructing the derivation of motion information and information regarding the technique used to derive the motion information.

[0053] The inter prediction unit (120) may predict a prediction unit based on information of at least one picture among the previous picture or the subsequent picture of the current picture, and in some cases, may predict a prediction unit based on information of a partially encoded area 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.

[0054] In the reference picture interpolation unit, reference picture information is received from the memory (155), and pixel information of integer pixels or less can be generated 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 of integer pixels or less in units of 1 / 4 pixels. In the case of chrominance signals, a DCT-based 4-tap interpolation filter with different filter coefficients can be used to generate pixel information of integer pixels or less in units of 1 / 8 pixels.

[0055] 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 calculate motion vectors. Based on interpolated pixels, motion vectors can have motion vector values ​​in units of 1 / 2 or 1 / 4 pixels. The motion prediction unit can predict the current prediction unit by using different motion prediction methods. Various methods such as the Skip method, Merge method, AMVP (Advanced Motion Vector Prediction) method, and Intra Block Copy method can be used as motion prediction methods. In addition, when applying the motion information derivation technique on the side of the decoder according to the present invention, the methods performed by the motion prediction unit may include a template matching method and a bilateral matching method utilizing a motion trajectory.

[0056] The intra prediction unit (125) can generate a prediction unit based on reference sample information around the current block, which is pixel information within the current picture. If the surrounding block of the current prediction unit is a block that has undergone inter-prediction, and the reference sample is a sample that has undergone inter-prediction, the reference sample included in the block that has undergone inter-prediction can be replaced with the reference sample information of the surrounding block that has undergone intra-prediction. That is, if the reference sample is not available, the unavailable reference sample information can be replaced with at least one of the available reference samples.

[0057] Additionally, a residual block can be generated that includes 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. The generated residual block can be input to the conversion unit (130).

[0058] In the transformation unit (130), the residual block containing 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.

[0059] The quantization unit (135) can quantize the values ​​converted into the frequency domain in the conversion unit (130). The quantization coefficient may vary depending on the block or the importance of the image. The values ​​produced by the quantization unit (135) may be provided to the inverse quantization unit (140) and the reordering unit (160).

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

[0061] The reordering unit (160) can convert two-dimensional block-shaped coefficients into one-dimensional vector forms through a coefficient scanning method. For example, the reordering unit (160) can convert the coefficients from DC to high-frequency range coefficients into one-dimensional vector forms by scanning using a Zig-Zag Scan method. Depending on the size of the conversion unit and the intra-prediction mode, a vertical scan that scans two-dimensional block-shaped coefficients in the column direction or a horizontal scan that scans two-dimensional block-shaped coefficients in the row direction may be used instead of the Zig-Zag Scan. That is, depending on the size of the conversion unit and the intra-prediction mode, it can be determined whether to use a Zig-Zag Scan, a vertical scan, or a horizontal scan.

[0062] The entropy encoding unit (165) can perform entropy encoding based on the values ​​calculated by the reordering unit (160). Entropy encoding can use various encoding methods, such as, for example, Exponential Golomb, CAVLC (Context-Adaptive Variable Length Coding), and CABAC (Context-Adaptive Binary Arithmetic Coding). In this regard, the entropy encoding unit (165) can encode residual value coefficient information of the encoding unit from the reordering unit (160) and the prediction unit (120, 125). Additionally, according to the present invention, it is possible to signal and transmit information indicating that motion information is derived and used in the decoder side, and information regarding the technique used for deriving motion information.

[0063] In the inverse quantization unit (140) and inverse transformation unit (145), the values ​​quantized in the quantization unit (135) are inverse quantized, and the values ​​transformed in the transformation unit (130) are inverse transformed. The residual value generated in the inverse quantization unit (140) and inverse transformation unit (145) can be combined with the prediction unit 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.

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

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

[0066] FIG. 2 is a block diagram showing an image decoding device according to the present invention. Referring to FIG. 2, the image decoder (200) may include an entropy decoding unit (210), a reordering 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).

[0067] When a video bitstream is input to a video encoder, the input bitstream can be decoded using the reverse procedure of the video encoder.

[0068] The entropy decoding unit (210) can perform entropy decoding in the opposite procedure to that which the entropy encoding unit of the image encoder performed. For example, various methods such as Exponential Golomb, CAVLC (Context-Adaptive Variable Length Coding), and CABAC (Context-Adaptive Binary Arithmetic Coding) can be applied in correspondence with the method performed in the image encoder.

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

[0070] The reordering unit (215) can perform reordering based on the method of reordering the entropy-decoded bitstream in the encoding unit in the entropy decoding unit (210). The coefficients expressed in the form of a one-dimensional vector can be reordered by restoring them to the form of two-dimensional block coefficients.

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

[0072] The inverse transform unit (225) can perform inverse transforms, i.e., inverse DCT, inverse DST, and inverse KLT, on the transforms, i.e., DCT, DST, and KLT, performed by the transform unit on the quantization result performed by the image 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 transformation technique (e.g., DCT, DST, KLT) can be selectively performed according to multiple pieces of information such as a prediction method, the size of the current block, and the prediction direction.

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

[0074] As described above, when performing intra prediction or intra-frame prediction identical to the operation in the video encoder, if the size of the prediction unit and the size of the transform unit are the same, intra prediction for the prediction unit is performed based on samples to the left of the prediction unit, samples to the top left, and samples to the top; however, if the size of the prediction unit and the size of the transform unit are different when performing intra prediction, intra prediction can be performed using reference samples based on the transform unit. Additionally, intra prediction using NxN partitioning only for the minimum encoding unit may also be used.

[0075] 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 receives various information, such as prediction unit information input from the entropy decoding unit (210), prediction mode information of the intra prediction method, and motion prediction related information of the inter prediction method, distinguishes the prediction unit in the current encoding unit, and determines 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 derived and used from the decoder side and information regarding the technique used for deriving 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).

[0076] The inter prediction unit (230) can perform inter prediction for the current prediction unit based on information included in at least one picture, either a previous picture or a subsequent picture, of the current picture containing the current prediction unit, using information required for inter prediction of the current prediction unit provided by the video encoder. To perform inter prediction, it can determine whether the motion prediction method of the prediction unit included in the corresponding encoding unit is a Skip Mode, Merge Mode, AMVP Mode, or Intra Block Copy Mode based on the encoding unit. Alternatively, the inter prediction unit (230) can perform inter prediction by inducing motion information itself from information provided by the video encoder indicating that motion information is to be induced and used from the decoder side and information regarding the technique used to induce motion information.

[0077] 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, it can perform intra prediction based on the intra prediction mode information of the prediction unit provided by the image encoder. 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 part that performs filtering on the reference pixel of the current block, and can determine whether to apply the filter based on the prediction mode of the current prediction unit. AIS filtering can be performed on the reference pixel of the current block using the prediction mode of the prediction unit and the AIS filter information 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.

[0078] The reference pixel interpolation unit can generate a reference pixel of an integer value or less by interpolating the reference pixel 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. If the prediction mode of the current prediction unit is a prediction mode that generates a prediction block without interpolating the reference pixel, the reference pixel may not be interpolated. The DC filter can generate a prediction block through filtering when the prediction mode of the current block is DC mode.

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

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

[0081] The offset correction unit can perform offset correction on the restored image based on the type of offset correction and offset value information applied to the image during encoding. ALF can be applied to the encoding unit based on information on whether ALF is applied and ALF coefficient information provided by the encoder. This ALF information can be provided included in a specific parameter set.

[0082] The memory (245) can store the 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 the output unit.

[0083] The method for generating predicted blocks and restored blocks of the current block will be examined with reference to Fig. 3.

[0084] FIG. 3 illustrates an image decoding method performed in an image decoding device according to the present disclosure.

[0085] Referring to FIG. 3, a prediction block of the current block can be generated based on the inter prediction (S300).

[0086] When inter-prediction is performed for the current block, a prediction block (prediction signal) of the current block may be generated based on motion information. The motion information according to the present disclosure may include at least one of reference picture information, motion vector information, or motion vector difference value of the current block. The motion information may be derived based on at least one of a spatially adjacent reference block, a spatially non-adjacent reference block, or a temporal reference block of the current block. Alternatively, the motion information may be signaled via a bitstream.

[0087] The prediction block of the current block may be generated based on one or more motion information. For example, if the current block utilizes multiple motion information, the prediction block of the current block may be generated by weighting the prediction signals generated based on each of the multiple motion information. In this case, the multiple motion information may each be derived or signaled based on a reference block. Alternatively, one motion information may be derived or signaled based on a reference block, and other motion information may be derived based thereon.

[0088] The temporal reference block referenced to derive the motion information of the current block may be a block within a reference frame that has a temporal difference from the current frame to which the current block belongs. Alternatively, the temporal reference block may be a reference block within the reference frame that is located at a position corresponding to the current block. The motion information of the current block may be derived based on at least one reference sample among the top-left reference sample, top-right reference sample, center reference sample, bottom-left reference sample, or bottom-right reference sample within the temporal reference block. In this case, the reference samples may be searched in the order listed above, and the motion information of the current block may be derived based on the searched reference samples.

[0089] The spatial surrounding reference blocks (spatial adjacent reference blocks, or spatial non-adjacent reference blocks) referenced to induce movement information of the current block will be explained in more detail with reference to FIG. 4.

[0090] FIG. 4 is a drawing showing an example of a spatially surrounding reference block of a current block according to the present disclosure.

[0091] Referring to FIG. 4, movement information of the current block can be derived by searching reference blocks around the current block. Reference blocks spatially adjacent to the current block being searched may include at least one of the following: a reference block adjacent to the left of the lower-left sample of the current block (Block 1 of FIG. 4), a reference block adjacent to the bottom of Block 1 (Block 5 of FIG. 4), a block adjacent to the top of the upper-right sample of the current block (Block 2 of FIG. 4), a reference block adjacent to the right of Block 2 (Block 6 of FIG. 4), a reference block adjacent to the left of the upper-left sample of the current block (Block 3 of FIG. 4), a reference block adjacent to the top of Block 3 (Block 7 of FIG. 4), or a reference block adjacent to the top of the upper-left sample of the current block (Block 4 of FIG. 4). Furthermore, a reference block (Block 8 in FIG. 4) located adjacent to the left of the current block and at the bottom half of the vertical length of the current block, or a reference block (Block 9 in FIG. 4) located adjacent to the top of the current block and at the right half of the horizontal length of the current block may also be included in the search target.

[0092] Additionally, referring to FIG. 4, a reference block spatially non-adjacent to the current block being searched may include at least one of a reference block located at a distance q to the left of block 3 (block 11 in FIG. 4), a reference block adjacent to the left of block 11 (block 14 in FIG. 4), and a reference block adjacent to the left of block 14 (block 17 in FIG. 4). Similarly, at least one of reference blocks located at a distance q to the left of block 1 or block 8 (blocks 10 and 12 in FIG. 4, respectively) or reference blocks located around them (blocks 13, 15, 16, and 18 in FIG. 4, respectively) may be included in the search target. Here, q may be an integer greater than or equal to 0.

[0093] However, the spatially adjacent / non-adjacent reference blocks shown in FIG. 4 are merely examples of search target reference blocks for inducing movement information of the current block, and other spatially adjacent / non-adjacent reference blocks not shown in FIG. 4 may also be included in the search target.

[0094] When the current block generates a prediction block based on inter-prediction, the prediction block of the current block may generate a plurality of prediction blocks and generate the prediction block of the current block by weighting the plurality of prediction blocks. At least one of the plurality of prediction blocks may be a prediction block generated through motion compensation based on the motion information of the current block. The weighted sum may be performed based on weights for each of the plurality of prediction blocks, and the weights may be the same for all samples within each prediction block. For example, the weight of all samples within one of the plurality of prediction blocks may be a, and the weight of all samples within another prediction block may be b, and the sum of a and b may be 1.

[0095] The prediction block of the current block can be generated through geometric partitioning-based prediction. A geometric partitioning status flag indicating whether to perform geometric partitioning-based prediction of the current block is signaled, and geometric partitioning-based prediction can be performed according to the value of the flag. When geometric partitioning-based prediction is performed, the geometric partitioning information of the current block can be signaled. Based on the geometric partitioning information, the current block can be divided into multiple sub-regions, a prediction block for each sub-region can be generated, and the prediction block of the current block can be generated by weighting the prediction blocks of each sub-region. At this time, the weighted sum can be performed based on weights according to a table defined identically in the encoder and decoder. More detailed information regarding the execution of geometric partitioning-based prediction is explained with reference to FIG. 5.

[0096] FIG. 5 is a drawing showing an example of the angle and offset of a geometric division line according to the present disclosure.

[0097] The example in FIG. 5 shows 10 angles (angle, φ0 ~ φ9) and 4 offsets (offset, 0, ρ0, ρ1, ρ2). Here, the geometric division line may be a line that geometrically divides the current block. Based on the geometric division line, the current block may be divided into a plurality of sub-regions.

[0098] Geometric partitioning information according to the present disclosure may include at least one of angle information or offset information of a geometric partitioning line. For example, the angle and offset of the geometric partitioning line may be defined as pairs in a pre-defined table, and the position of the geometric partitioning line dividing the current block may be determined according to the angle and offset pair selected based on a signaled index. For another example, the angle information and offset information of the geometric partitioning line may be signaled, respectively, and the position of the geometric partitioning line may be determined based thereon.

[0099] Referring to FIG. 3, it is possible to determine whether to filter the prediction block of the current block (S310).

[0100] The predicted block of the current block can be corrected through a filtering process. The filtering process may be a process of correcting the difference between the current block and the reference block based on the difference in brightness values ​​between the current frame to which the current block belongs and the reference frame to which the reference block belongs. Filtering for the predicted block of the current block according to the present disclosure may be performed for all predicted blocks, or may be performed only for predicted blocks that satisfy specific conditions.

[0101] For example, filtering may be performed when the height and width of the current block are both 8 or greater, the current block uses only single motion information when generating the prediction block, does not refer to the TIP (temporal interpolated prediction) frame, and the inter-prediction mode of the current block is not an affine prediction mode. Here, the affine prediction mode may be an inter-prediction method that generates a more accurate prediction block by modeling even the rotation or scale change of the current block.

[0102] In addition, whether the current block refers to a TIP frame when generating a prediction block can be determined based on signaled TIP flag information. For example, if the value of the TIP flag information is 1, unidirectional prediction is performed when generating a prediction block for the current block, and the reference frame can be determined to be a TIP frame. Here, the TIP frame may refer to a reference frame generated based on motion information within the current frame and motion information of reference frames within the DPB, rather than a frame stored in the DPB (Decoded picture buffer).

[0103] As another example, if the resolution of the current frame and the reference frame differ, filtering for the prediction block of the current block may not be performed. In this case, the information required for filtering may not be signaled through the bitstream.

[0104] As another example, if a prediction block of the current block is generated based on global motion information, filtering may not be performed on the prediction block. In this case, the information required to perform filtering may not be signaled through the bitstream. Here, global motion information may refer to motion information signaled / induced in units such as pictures, slices, or SB (Super Block).

[0105] As another example, whether to perform filtering on the prediction block of the current block can be determined based on filtering usage information. The filtering usage information can be signaled on a block-by-block basis and can be signaled for each component of the current block (e.g., Y, Cb, Cr, or luminance and chrominance).

[0106] Whether to filter the luminance component block and the chrominance component block corresponding to the current block can be determined based on a single flag. For example, if the value of the filtering use flag indicating whether to filter the luminance component block and the chrominance component block is 1, filtering may be performed on the luminance component block and the chrominance component block, and if the value of the filtering use flag is 0, filtering may not be performed on the luminance component block and the chrominance component block.

[0107] Alternatively, whether to filter the luminance component block and the chrominance component block may be determined based on filtering usage information, and said filtering usage information may include a flag indicating whether to perform filtering for each component block. For example, if the value of the luminance component filtering execution flag indicating whether to perform filtering for the luminance component block is 1, filtering may be performed on the luminance component block, and if the value is 0, filtering may not be performed on the luminance component block. Additionally, if the value of the chrominance component filtering execution flag indicating whether to perform filtering for the chrominance component block is 1, filtering may be performed on the chrominance component block, and if the value is 0, filtering may not be performed on the chrominance component block. In this case, if the current image is in a monochrome format (e.g., YUV400 format), the chrominance component filtering execution flag may not be signaled.

[0108] The chrominance component filtering execution flag may be signaled regardless of the value of the luminance component filtering execution flag, or may be signaled based on the value of the luminance component filtering execution flag. More specifically, the chrominance component filtering execution flag may be signaled after the luminance component filtering execution flag has been signaled, or may be signaled only when filtering is performed on the luminance component block according to the value of the luminance component filtering execution flag.

[0109] Referring to FIG. 3, filtering parameters can be derived based on whether the prediction block is filtered (S320).

[0110] When filtering is performed on a prediction block of the current block, the filtering on the prediction block may be either linear filtering or non-linear filtering performed with two or more parameters. Linear filtering on the prediction block may be performed as shown in the following Equation 1.

[0111]

[0112] In Equation 1, Pred(i,j) can be the value of the prediction block (prediction signal) of the current block, and Curr pred (i,j) may be the value of the corrected prediction block generated through filtering, and α and β may be filtering parameters used in the filtering process. Additionally, the Clip function is a function that performs a clipping operation using maximum and minimum values. In this case, the maximum and minimum values ​​of the clipping operation may be determined based on the bit depth of the current image; for example, if the bit depth of the current image is 10-bit, the minimum value is 0 and the maximum value is 1023(2 10 -1 = 1023) can be.

[0113] The above filtering parameters may each be values ​​derived from the decoder, values ​​signaled from the encoder, or values ​​derived from the decoder that have been corrected based on information signaled from the encoder.

[0114] For example, based on a flag indicating whether to derive the value of filtering parameter α in the decoder, it can be determined whether the value of α is derived in the decoder or signaled in the encoder. If it is determined that the value of α is signaled in the encoder according to the value of the flag, index information for α may be additionally signaled.

[0115] As another example, only index information for a filtering parameter α for a luminance component block may be signaled in the encoder. In this case, the value of α according to the index information for α may be limited based on at least one of the motion mode information of the current block (e.g., whether the motion vector difference value is parsed) or the temporal distance between the current frame and the reference frame. For example, the index information for α may represent the sign of α. The magnitude of the absolute value of α may be derived based on at least one of the motion mode information of the current block or the temporal distance between the current frame and the reference frame. The filtering parameter α may be derived based on the magnitude of the absolute value of α derived above and the sign of α represented by the index information for α.

[0116] As another example, filtering parameters α and β can be derived based on pre-restored reference blocks around the current block. More specifically, when constructing a motion vector candidate list by searching for pre-restored spatially adjacent reference blocks or spatially non-adjacent reference blocks of the current block, if the searched reference block is a block restored through a filtering process, a motion vector candidate list including the filtering parameters of that reference block can be constructed. Additionally, if the reference block selected when generating the prediction block of the current block is a block restored through a filtering process, the filtering parameters of that reference block can be used as the filtering parameters of the current block to perform filtering on the prediction block of the current block.

[0117] As another example, filtering parameters α and β can be derived based on the template area of ​​the current block and the template area of ​​the reference block within the reference frame. The template area adjacent to the top of the current block may be W xp in size, and the template area adjacent to the left may be q x H in size. Additionally, the template area adjacent to the top of the reference block may be W' xp in size, and the template area adjacent to the left may be q x H' in size. Here, W and H may be the width and height of the current block, respectively, and W' and H' may be the width and height of the reference block, respectively, and p and q may be integers greater than or equal to 1. Additionally, p and q may be determined based on at least one of the width, height, or ratio of the width to the height of the current block.

[0118] For example, the template used to derive filtering parameters can be determined based on the presence of an upper or left template area for each of the current block and the reference block. For instance, if both the current block and the reference block have upper and left template areas, the filtering parameters can be derived using the upper and left template areas. Alternatively, if the current block has upper and left template areas and the reference block has only an upper template area, the filtering parameters can be derived using only the upper template area.

[0119] Filtering parameters can be calculated as shown in the following Equation 2 or Equation 3 based on the template area of ​​the current block and the template area of ​​the reference block.

[0120]

[0121]

[0122] In mathematical formulas 2 and 3, A[i] may represent the value of a sample within the template area of ​​the current block, and B[i] may represent the value of a sample within the template area of ​​the reference block. In this case, the sample within the template area is a sample used to derive the filtering parameter, and may represent all samples within the template area or only some samples.

[0123] The number of samples (i) used to derive the filtering parameter above can be set to a power of 2. More specifically, the sum of the number of samples in the upper template area and the number of samples in the left template area used to derive the filtering parameter can be set to a power of 2.

[0124] If the number of samples to be used to derive the filtering parameter is smaller than at least one of the width (W) of the top template area or the height (H) of the left template area, samples to be used to derive the filtering parameter may be generated through uniform or non-uniform sampling. In this case, the starting position for sampling or the sampling interval may be determined based on at least one of the width, height, or number of samples to be used to derive the filtering parameter of the current block. The starting position for sampling may be the leftmost sample in the case of the top template area, and the topmost sample in the case of the left template area. Additionally, the sampling direction may be from left to right in the case of the top template area, and from top to bottom in the case of the left template area. Additionally, the sampling interval may be an integer greater than or equal to 1.

[0125] If the number of samples in the upper template area and the left template area is smaller than the number of samples to be used to derive the filtering parameters, the filtering parameters can be derived based on samples generated using padding.

[0126] If filtering is performed on both the luminance component block and the chrominance component block of the current block, the filtering parameter (α) for the luminance component block luma and β luma ) and filtering parameters (α) for the color difference component block chroma and β chroma ) can be derived in the decoder through mathematical formula 2 and mathematical formula 3, respectively.

[0127] As another example, the filtering parameter α is determined based on the information signaled in the encoder, and the filtering parameter β may be derived based on the said α.

[0128] As another example, the filtering parameter (α) for the luminance component block luma or β luma ) is derived in the decoder, and the derived α luma or β luma Filtering parameter (α) for the color difference component block based on at least one of chroma and β chroma It can induce ).

[0129] For example, α chroma is α luma It can be like this.

[0130] As another example, α chroma is α luma It can be derived based on. More specifically, when filtering is performed on a chrominance component block based on the value of the chrominance component filtering execution flag, α based on the scaling index information signaled from the encoder luma Scaling (or shifting) α chroma It can induce.

[0131] The signaled scaling index information above may represent scaling parameters according to a table identically defined in the encoder and decoder. In this case, the encoder and decoder may define and use only one table, or define multiple tables and adaptively determine and use any one of the multiple tables. The method of adaptively determining a table may vary depending on the embodiment.

[0132] For example, one table can be adaptively determined by the difference between the quantization parameter (QP) value, which represents the degree of quantization of the luminance component block of the current block, and the quantization parameter value of the chrominance component block of the current block.

[0133] As another example, a table in which the value represented by each index is larger as the difference in quantization parameters between the luminance component block and the chrominance component block increases can be used as a table to determine scaling parameters.

[0134] As another example, one of the tables can be adaptively determined based on the difference in quantization parameters between the luminance component block and the reference luminance component block, and the difference value of the difference in quantization parameters between the chrominance component block and the reference chrominance component block.

[0135] An example of a table defined identically in the encoder and decoder to derive scaling parameters may be as shown in Table 1 below.

[0136] IndexValue (S chroma )00.510.7521.2531.541.7552.0

[0137] Scaling parameter (S) derived based on scaling index information signaled from the encoder chroma Based on ), α chroma It can be derived through the following mathematical equation 4.

[0138]

[0139] Filtering parameter β of the color difference component block chroma It can be derived through the following mathematical equation 5.

[0140]

[0141] Here, C[i] may represent the value of a sample within the template region of the chrominance component block, and D[i] may represent the value of a sample within the template region of the reference chrominance component block referenced by the chrominance component block. In this case, the sample within the template region is β chroma As a sample used to induce, it may mean all samples within the template area or only some samples.

[0142] β chroma The number of samples (i) used to derive can be set to a power of 2. More specifically, β chroma The sum of the number of samples in the top template area and the number of samples in the left template area to be used to derive can be set to a power of 2. Additionally, based on at least one of the width or height of the chromatic difference component block, β chroma The number of samples (i) used to derive can be adaptively determined. Additionally, β can be derived through processes such as sampling or padding. chroma Samples used to induce can be generated.

[0143] When the structural characteristics between the current block and the reference block are similar but there is a difference in brightness values, a corrected prediction block with higher accuracy can be generated when filtering is performed on the prediction block of the current block. However, if there is no template area of ​​the reference block corresponding to the template area of ​​the current block (e.g., the current block has only a left template area and the reference block has only a top template area), if there is no template area of ​​the current block, or if there is no template area of ​​the reference block, the decoder may not be able to derive the filtering parameter (α or β). Therefore, at least one of each filtering parameter, or a variable for deriving the filtering parameter, can be signaled in the encoder, and can also be signaled even when the decoder can derive the filtering parameter.

[0144] A global filtering parameter that can be used equally for one or more blocks may be defined. The global filtering parameter is a global scaling parameter α global , or global offset parameter β global It may include at least one of the following, and global filtering parameters may exist for each of the luminance component block and the chrominance component block. α global , and β global Each can be signaled, and each can be derived from a decoder, and α global , and β global Only one of them is signaled, and the other can be derived based on the above-derived global parameter.

[0145] For example, α global Only index information for is signaled by the encoder, and β globalcan be derived in the decoder. In this case, based on at least one of the motion mode information of the current block (e.g., whether the motion vector difference value is parsed), or the temporal distance between the current frame and the reference frame, α global α based on index information for global The value of may be limited. For example, the above α global Index information for α global The sign of can be indicated. Based on at least one of the motion mode information of the current block or the temporal distance between the current frame and the reference frame, α global The magnitude of the absolute value of can be derived. The above-derived α global The magnitude of the absolute value of and α global α represented by the index information for global Global filtering parameter α based on the sign of global can be induced. Also, β global It can be derived based on the above mathematical formula 3.

[0146] The unit to which the global filtering parameter according to the present disclosure is applied may be any one of a picture unit, a tile unit, a slice unit, a Coding Tree Unit (CTU) unit (i.e., a set of multiple blocks), or a set of multiple CTUs (nCTU). In the case where the global filtering parameter exists at the picture unit level, the global filtering parameter may exist for each reference picture based on the relationship between the current picture and each reference picture. In this case, the global filtering parameter may be signaled via a bitstream, and the parameter used for unit-specific in-loop filtering or filter coefficient information may be signaled together.

[0147] If global filtering parameters are not defined at the picture unit or block unit level, that is, if they are defined at the tile unit, slice unit, CTU (Coding Tree Unit) unit (i.e., a set of multiple blocks), or multiple CTU (nCTU) unit level, the global filtering parameters of the representative reference picture of that unit may be used as the global filtering parameters of that unit. Here, the representative reference picture may be one or more and may be determined adaptively. Additionally, the representative reference picture may be the reference picture referenced by the first inter-prediction block decoded within each unit.

[0148] For example, if global filtering parameters are defined on a tile-by-tile basis, a block that generates a prediction block using a reference picture different from the representative reference picture within the tile may not use the global filtering parameters defined on a tile-by-tile basis for filtering the prediction block of that block.

[0149] If the current luminance component block performs filtering based on global filtering parameters and filtering is also performed on the current chrominance component block, the current chrominance component block can also perform filtering based on global filtering parameters.

[0150] It may refer to the template area of ​​a reference block corresponding to the global template area. Additionally, whether a global filtering parameter is used may be determined based on a global flag indicating whether the global filtering parameter is used. More specifically, if the value of the global flag is 1 and there is no corresponding template area, the global filtering parameter may be signaled through the bitstream. Here, regarding the corresponding template area, if the value of the flag of the current block is 1 and there is a corresponding template area, a filtering parameter for filtering the prediction block of the current block may be derived from the decoder. Additionally, if the value of the global flag is 0 and there is a corresponding template area, a filtering parameter for filtering the prediction block of the current block may be derived from the decoder, and if the value of the global flag is 0 and there is no corresponding template area, filtering for the prediction block of the current block may not be performed.

[0151] For example, whether to use a global filtering parameter in a unit larger than a block can be signaled, and a filtering parameter induction flag can be signaled in a block unit. Depending on the value of the filtering parameter induction flag, a filtering parameter to be used for filtering the prediction block of the current block can be derived by referring to Equations 2 to 5.

[0152] As another example, whether to use global filtering parameters in units of nCTU can be signaled. Here, the configuration of nCTU units may be a set of multiple adjacent CTUs located in the same row. Alternatively, the configuration of nCTU units may be a set of multiple adjacent CTUs located in the same column. Or, the configuration of nCTU units may be a set of multiple adjacent CTUs regardless of row or column.

[0153] Global filtering parameters can be derived through the above Equations 2 and 3. When deriving global filtering parameters, A[i] may represent the value of a sample within the current global template area, and B[i] may represent the value of a sample within the reference template area. A[i] or B[i] may be stored and used in picture units. Here, i may be at least one of the number of samples within the current global template area or the number of samples within the reference template area. For example, if the width and height of the smallest block to which global filtering is applied are W and H, respectively, i may be any one of W, H, or W+H. If the number of samples within the global template area is greater than the number of samples within the template area of ​​the current block or the reference block, a sample at a pre-defined location may be used to derive the global parameters. In this case, the pre-defined location may be a location defined identically in the decoder and the encoder.

[0154] Referring to FIG. 3, a corrected prediction block can be generated by performing filtering based on filtering parameters (S330).

[0155] The corrected prediction block of the current block can be generated through the above mathematical formula 1 based on filtering parameters.

[0156] If geometric partitioning-based prediction is performed on the current block, whether to perform filtering can be determined based on filtering usage information.

[0157] For example, if the current block is divided into multiple sub-regions by geometric division lines and only one of the sub-regions generates a prediction block based on inter-prediction, a flag indicating whether to perform filtering on the prediction block of that sub-region may be signaled. Based on the value of the flag indicating whether to perform filtering, filtering may be performed on the sub-region that generates the prediction block based on inter-prediction. Additionally, the prediction block of the current block may be generated by weighting the filtered inter-prediction block and the intra-prediction block of the other sub-region.

[0158] As another example, if the current block is divided into multiple sub-regions by geometric dividing lines and each sub-region generates a prediction block based on inter-prediction, a flag indicating whether filtering is performed on the prediction block of each sub-region may be signaled. Alternatively, a single flag indicating whether filtering is performed on the prediction block of all sub-regions may be signaled.

[0159] When filtering is performed on prediction blocks of multiple sub-regions, filtering parameters for each prediction block may be derived or signaled, and a corrected prediction block of the current block may be generated by weighting the corrected prediction blocks based on each filtering parameter. In this case, the filtering parameters for the prediction blocks of each sub-region may be derived according to geometric partitioning information. For example, the template area used to derive the filtering parameters may differ for each of the multiple sub-regions partitioned according to geometric partitioning lines derived based on geometric partitioning information. In this case, the template area used to derive the filtering parameters may be a template area adjacent to each sub-region.

[0160] For example, the filtering parameter of one of the multiple sub-regions may be derived based on the left template area of ​​the current block, and the filtering parameter of another sub-region may be derived based on the top template area of ​​the current block. Alternatively, the filtering parameter of one sub-region may be derived based on both the left template area and the top template area of ​​the current block, and the filtering parameter of another sub-region may be derived based on either the left template area or the top template area of ​​the current block.

[0161] Alternatively, the filtering parameter of one sub-region may be derived based on the entirety of the left template region and a portion of the top template region, and the filtering parameter of another sub-region may be derived based on a portion of the top template region. Alternatively, the filtering parameter of one sub-region may be derived based on a portion of the left template region and the entirety of the top template region, and the filtering parameter of another sub-region may be derived based on a portion of the left template region. In this case, the template regions referenced by the multiple sub-regions to derive the filtering parameter may not have any overlapping regions, or they may have some overlapping regions.

[0162] As another example, if the size of a template region referenced by multiple subregions to derive filtering parameters is smaller than a predetermined size, filtering may not be performed on the prediction blocks of the subregions referencing said template region. Alternatively, whether filtering is performed on the prediction blocks of the subregions may be defined based on conditions that are identically defined in the encoder and the decoder. The above conditions may include conditions regarding at least one of the size of the current block, the ratio of the width to the height of the current block, or the partitioning mode of the current block.

[0163] When geometric partitioning-based prediction is performed on the current block, filtering may be performed on the prediction block of the current block generated by weighting multiple prediction blocks by sub-region. The filtering parameters for performing the filtering may be derived based on geometric partitioning information.

[0164] For example, a template region referenced to derive filtering parameters based on geometric division information may be derived. More specifically, a reference block referenced by a plurality of sub-regions may be divided along a geometric division line derived based on the geometric division information, and the template region of each reference block may be divided into a first template region and a second template region according to the extension of the geometric division line. Here, the first template region may be a template region adjacent to any one of the plurality of sub-regions within the reference block along the geometric division line, and the second template region may be a template region adjacent to the other of the plurality of sub-regions within the reference block.

[0165] A template region for deriving filtering parameters may be determined based on a first template region of a first reference block referenced by one of the multiple sub-regions of the current block and a second template region of a second reference block referenced by another of the multiple sub-regions of the current block. For example, the template region for deriving filtering parameters may be a region composed of a first template region of the first reference block and a second template region of the second reference block. To configure the template region for deriving filtering parameters, a first weight matrix may be applied to the first template region and the second template region of the first reference block, and a second weight matrix may be applied to the first template region and the second template region of the second reference block. Here, the first weight matrix may be a matrix that applies a weight of 1 to the first template region and a weight of 0 to the second template region, and the second weight matrix may be a matrix that applies a weight of 0 to the first template region and a weight of 1 to the second template region. Filtering parameters for the current block, or global parameters, can be derived through Equation 2 or Equation 3 based on the template area configured to derive the above filtering parameters.

[0166] When the current block generates a prediction block based on inter-prediction, a blending process (Overlapped Block Motion Compensation, OBMC) may be performed to maintain continuity between the prediction block and the surrounding area of ​​the prediction block. At this time, the blending process may be performed only when a reference block adjacent to at least one of the top or left of the current block is a block restored through inter-prediction, or it may be performed even when it is a block restored through intra-prediction.

[0167] The area where the blending is performed may be at least one of the area from the top boundary of the current block to a position a sample distance away from the top boundary, or the area from the left boundary of the current block to a position b sample distance away from the left boundary. Here, if the width of the current block is W and the height is H, the a may be an integer greater than 1 and less than H, and the b may be an integer greater than 1 and less than W. Additionally, the a or b may be a value defined based on at least one of the width, height, or ratio of the width to the height of the current block.

[0168] The blending process for the prediction block of the current block will be explained in detail with reference to Fig. 6.

[0169] FIG. 6 is a diagram showing an example of a blending process according to the present disclosure.

[0170] Referring to FIG. 6, blending for the predicted block of the current block can be performed based on a reference block T that is spatially adjacent to the current block. In this case, the reference block T may be a block with width P and height Q, and may be a block restored based on inter-prediction.

[0171] Referring to FIG. 6, the area where blending is performed based on reference block T may be an area with the same width as reference block T adjacent to the top of the current block and a height of a. The above a may be an integer greater than 1 and less than the height of the current block. Based on the movement information of reference block T, a prediction block for the area where blending is performed may be generated. More specifically, a prediction block for the area where blending is performed may be generated using the movement information of reference block T. A prediction block for the current block where blending is performed may be generated by weighting the prediction block for the area where blending is performed and the prediction block of the current block. At this time, the weighted sum may be performed based on a weighted sum matrix in which weights are defined per sample or per sample line. The weighted sum matrix may be a matrix that assigns higher weights to samples closer to reference block T and lower weights to samples further away from reference block T.

[0172] Both blending and filtering may be performed on the prediction block of the current block. Alternatively, if blending is performed on the prediction block of the current block, filtering may not be performed on the prediction block of the current block. Alternatively, if filtering is performed on the prediction block of the current block, blending may not be performed on the prediction block of the current block.

[0173] When both blending and filtering are performed on the prediction block of the current block, the order in which blending and filtering are performed may vary depending on the embodiment. For example, filtering on the prediction block of the current block may be performed first, followed by blending. As another example, blending on the prediction block of the current block may be performed first, followed by filtering.

[0174] As another example, filtering may be performed during the blending of the prediction block of the current block. For instance, filtering may be performed on the area within the current block where blending is to be performed, and blending may be performed on the filtered area. After performing the blending, filtering may be performed on the area within the current block where blending is not to be performed.

[0175] Alternatively, filtering parameters can be derived based on the above Equations 2 and 3 based on the sub-template area of ​​the current block corresponding to the template area of ​​the reference block within the reference frame referenced by the previously restored reference block around the current block. Based on the above filtering parameters, filtering can be performed on the area where blending is performed within the current block, and blending can be performed on the filtered area.

[0176] When a prediction block is generated through Intra Block Copy (IBC) prediction of the current block, filtering of the prediction block according to the present disclosure may be performed. IBC prediction may be a method of predicting the current block by copying sample values ​​from a previously restored block within the same picture as the current block. The prediction may be performed based on a block vector, which may be determined based on a block vector candidate list and a signaled index configured according to a position or search order identically defined in the encoder and decoder. Additionally, the determined block vector may be corrected through a template matching process in the template region of the current block.

[0177] When the prediction block of the current block is generated using a block vector, filtering for the prediction block according to the present disclosure may be performed based on the template area of ​​the current block and the template area of ​​the reference block. In this case, the reference block and the template area of ​​the reference block may exist within the current picture. Additionally, when the prediction block of the current block is generated through IBC prediction, filtering may be performed only on the luminance component block, and at least one of whether to perform filtering on the luminance component block or information for performing filtering may be signaled.

[0178] Referring to FIG. 3, a restoration block of the current block can be generated based on the corrected prediction block (S340).

[0179] The current block can be restored based on the residual block of the corrected prediction block and the current block. Here, the residual block can be generated by applying at least one of inverse quantization or inverse transformation to the transformation coefficients obtained from the bitstream.

[0180] The encoding method and apparatus according to the present disclosure can generate a prediction block of a current block, determine whether to filter the prediction block, derive a filtering parameter based on whether to filter the prediction block, and generate a corrected prediction block by performing filtering based on the filtering parameter. The process of deriving the filtering parameter of the current block or performing filtering is as described in FIG. 3.

[0181] The encoding method and apparatus according to the present disclosure can derive a residual block based on the prediction block. Additionally, at least one of transformation or quantization can be performed on the residual block, thereby deriving a transformation coefficient of the current block. Additionally, the transformation coefficient can be encoded.

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

[0183] In addition, various embodiments of the present disclosure may be implemented by hardware, firmware, software, or a combination thereof. In the case of implementation by hardware, it 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.

[0184] The scope of the present disclosure includes software or machine-executable instructions (e.g., operating system, application, firmware, program, etc.) that enable an operation according to a method of various embodiments to be executed on a device or computer, and a non-transitory computer-readable medium on which such software or instructions, etc. are stored and executable on a device or computer.

[0185] The present disclosure may be used industrially in the field of methods, devices, and recording media for image encoding / decoding.

Claims

A step of generating a prediction block of the current block based on inter-prediction; A step of determining whether to filter the above prediction block; A step of deriving filtering parameters based on whether the above prediction block is filtered; and An image decoding method comprising the step of performing filtering on the prediction block based on the filtering parameters. In paragraph 1, The above prediction block is generated through geometric partitioning-based prediction, and The above geometric partitioning-based prediction is performed based on geometric partitioning information, and An image decoding method wherein the geometric division information comprises at least one of angle information or offset information of a geometric division line. In paragraph 1, Whether the above prediction block is filtered is determined based on filtering usage information, and The filtering usage information above includes at least one of a luminance component filtering execution flag or a chrominance component filtering execution flag, and The above luminance component filtering execution flag indicates whether to perform filtering for the luminance component block corresponding to the current block, and An image decoding method in which the above-mentioned chrominance component filtering execution flag indicates whether to perform filtering on a chrominance component block corresponding to the current block. In paragraph 3, If the value of the above luminance component filtering execution flag is 1, it indicates that filtering is performed on the above luminance component block, and If the value of the above luminance component filtering execution flag is 0, it indicates that filtering for the above luminance component block is not performed, and If the value of the above color difference component filtering execution flag is 1, it indicates that filtering is performed on the above color difference component block, and An image decoding method that indicates that filtering for the color difference component block is not performed when the value of the color difference component filtering performance flag is 0. In paragraph 4, An image decoding method in which the above-mentioned color difference component filtering execution flag is signaled when the value of the above-mentioned luminance component filtering execution flag is 1. In paragraph 1, The above filtering parameter is derived based on at least one of the template area of ​​the current block or the template area of ​​the reference block within the reference frame, and An image decoding method in which the template area of ​​the current block and the template area of ​​the reference block each include at least one of an upper template area or a left template area. In paragraph 1, An image decoding method wherein the filtering parameter comprises at least one of a filtering parameter for a luminance component block or a filtering parameter for a chrominance component block. In Paragraph 7, An image decoding method in which the filtering parameters for the above-mentioned color difference component block are derived based on the parameters for the above-mentioned luminance component block. In paragraph 8, The filtering parameter for the above color difference component block is derived by scaling the parameter for the above luminance component block, and The above scaling is performed based on scaling index information, and The above scaling index information is an image decoding method representing scaling parameters according to a pre-defined table. In paragraph 2, The above geometric division line divides the current block into a plurality of sub-regions, and An image decoding method in which, when the plurality of sub-regions each generate an inter-prediction block, filtering is performed on each of the inter-prediction blocks of the plurality of sub-regions. In paragraph 1, It further includes the step of performing blending for the above prediction block, and An image decoding method in which the area where the blending is performed is determined based on at least one of the width, height, or ratio of width to height of the current block. In Paragraph 11, The above blending is an image decoding method performed based on motion information of a reference block spatially adjacent to the current block. A step of generating a prediction block of the current block based on inter-prediction; A step of determining whether to filter the above prediction block; A step of deriving filtering parameters based on whether the above prediction block is filtered; and An image encoding method comprising the step of performing filtering on the prediction block based on the filtering parameters. A computer-readable storage medium for storing a bitstream generated by the image encoding method according to paragraph 13. A method for transmitting a bitstream generated by a video encoding method according to paragraph 13.